Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Soul Engine #357

Merged
merged 32 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
52c5d68
add lava/blaze generator
ferriarnus Jul 26, 2023
7293e6c
fix syncing issue
ferriarnus Jul 26, 2023
7f0bd74
Merge branch 'dev/1.20.1' into mob-generator
ferriarnus Jul 26, 2023
c57ed5e
add more mob souls
ferriarnus Jul 26, 2023
3ae3b8f
change soulbinder recipe to only work if souldata is found
ferriarnus Jul 26, 2023
0041d18
fix networking + gui stuff
ferriarnus Jul 26, 2023
1584c61
Merge branch 'dev/1.20.1' into mob-generator
ferriarnus Jul 31, 2023
182f609
update and add fluid tag support
ferriarnus Jul 31, 2023
0398554
Update mob_generator.json
ferriarnus Aug 1, 2023
aab2503
Update MachineBlocks.java
ferriarnus Aug 1, 2023
d7073f8
Rename soulbounditem
ferriarnus Aug 1, 2023
ef92a53
Merge branch 'dev/1.20.1' into mob-generator
ferriarnus Aug 2, 2023
b90f16a
Update MachineBlocks.java
ferriarnus Aug 2, 2023
61c45f6
add recipe
ferriarnus Aug 2, 2023
35cdc3c
Add more info in the gui
ferriarnus Aug 2, 2023
27ca7af
Update MobGeneratorScreen.java
ferriarnus Aug 2, 2023
711fbbf
Merge branch 'dev/1.20.1' into mob-generator
ferriarnus Aug 12, 2023
dfe4473
update
ferriarnus Aug 12, 2023
33cb6fe
add jei support
ferriarnus Aug 12, 2023
1c2322a
Update MobGeneratorCategory.java
ferriarnus Aug 12, 2023
5ab151e
Merge branch 'dev/1.20.1' into mob-generator
ferriarnus Aug 17, 2023
ded013e
update + add better jei support
ferriarnus Aug 17, 2023
6e242b4
More jei support
ferriarnus Aug 17, 2023
075c55e
made changes
ferriarnus Aug 18, 2023
8c15dae
update datagen
ferriarnus Aug 19, 2023
46b9eda
add temp textures
ferriarnus Aug 19, 2023
15aab28
Update SoulEngineBlockEntity.java
ferriarnus Aug 19, 2023
c0cd9b5
oops
ferriarnus Aug 19, 2023
9ed57e0
fix soul engine recipe
ferriarnus Aug 19, 2023
72b38ac
Merge branch 'dev/1.20.1' into mob-generator
ferriarnus Aug 19, 2023
7ba436d
Update MachinePackets.java
ferriarnus Aug 19, 2023
54b5c01
Fix datagen
Rover656 Aug 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"variants": {
"facing=east,powered=false": {
"model": "enderio:block/soul_engine_combined",
"y": 90
},
"facing=east,powered=true": {
"model": "enderio:block/soul_engine_active_combined",
"y": 90
},
"facing=north,powered=false": {
"model": "enderio:block/soul_engine_combined"
},
"facing=north,powered=true": {
"model": "enderio:block/soul_engine_active_combined"
},
"facing=south,powered=false": {
"model": "enderio:block/soul_engine_combined",
"y": 180
},
"facing=south,powered=true": {
"model": "enderio:block/soul_engine_active_combined",
"y": 180
},
"facing=west,powered=false": {
"model": "enderio:block/soul_engine_combined",
"y": 270
},
"facing=west,powered=true": {
"model": "enderio:block/soul_engine_active_combined",
"y": 270
}
}
}
2 changes: 2 additions & 0 deletions src/generated/resources/assets/enderio/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
"block.enderio.slice_and_splice": "ǝɔıןdS,N,ǝɔıןS",
"block.enderio.soul_binder": "ɹǝpuıᗺ ןnoS",
"block.enderio.soul_chain": "uıɐɥƆ ןnoS",
"block.enderio.soul_engine": "ǝuıbuƎ ןnoS",
"block.enderio.soularium_block": "ʞɔoןᗺ ɯnıɹɐןnoS",
"block.enderio.soularium_pressure_plate": "ǝʇɐןԀ ǝɹnssǝɹԀ ɯnıɹɐןnoS",
"block.enderio.stirling_generator": "ɹoʇɐɹǝuǝ⅁ buıןɹıʇS",
Expand Down Expand Up @@ -243,6 +244,7 @@
"gui.enderio.category.sag_mill": "ןןıW ⅁ⱯS",
"gui.enderio.category.slicing": "buıɔıןS",
"gui.enderio.category.soul_binding": "buıpuıᗺ ןnoS",
"gui.enderio.category.soul_engine": "ǝuıbuƎ ןnoS",
"gui.enderio.category.tank": "ʞuɐ⟘ pınןℲ",
"gui.enderio.conduit.extract": "ʇɔɐɹʇxƎ",
"gui.enderio.conduit.insert": "ʇɹǝsuI",
Expand Down
2 changes: 2 additions & 0 deletions src/generated/resources/assets/enderio/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
"block.enderio.slice_and_splice": "Slice'N'Splice",
"block.enderio.soul_binder": "Soul Binder",
"block.enderio.soul_chain": "Soul Chain",
"block.enderio.soul_engine": "Soul Engine",
"block.enderio.soularium_block": "Soularium Block",
"block.enderio.soularium_pressure_plate": "Soularium Pressure Plate",
"block.enderio.stirling_generator": "Stirling Generator",
Expand Down Expand Up @@ -243,6 +244,7 @@
"gui.enderio.category.sag_mill": "SAG Mill",
"gui.enderio.category.slicing": "Slicing",
"gui.enderio.category.soul_binding": "Soul Binding",
"gui.enderio.category.soul_engine": "Soul Engine",
"gui.enderio.category.tank": "Fluid Tank",
"gui.enderio.conduit.extract": "Extract",
"gui.enderio.conduit.insert": "Insert",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parent": "minecraft:block/block",
"children": {
"machine": {
"parent": "enderio:block/soul_engine_active"
},
"overlay": {
"parent": "enderio:block/io_overlay"
}
},
"item_render_order": [
"machine",
"overlay"
],
"loader": "forge:composite",
"textures": {
"particle": "enderio:block/soul_engine_front"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parent": "minecraft:block/block",
"children": {
"machine": {
"parent": "enderio:block/soul_engine"
},
"overlay": {
"parent": "enderio:block/io_overlay"
}
},
"item_render_order": [
"machine",
"overlay"
],
"loader": "forge:composite",
"textures": {
"particle": "enderio:block/soul_engine_front"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "enderio:block/soul_engine"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_ingredient": {
"conditions": {
"items": [
{
"items": [
"enderio:ensouled_chassis"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "enderio:soul_engine"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_ingredient",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"enderio:soul_engine"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"entity": "minecraft:blaze",
"fluid": "#minecraft:lava",
"power/mb": 300,
"tick/mb": 15
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"entity": "minecraft:enderman",
"fluid": "enderio:flowing_dew_of_the_void",
"power/mb": 900,
"tick/mb": 10
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"entity": "minecraft:husk",
"fluid": "enderio:flowing_nutrient_distillation",
"power/mb": 500,
"tick/mb": 15
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"entity": "minecraft:zombie",
"fluid": "enderio:flowing_nutrient_distillation",
"power/mb": 500,
"tick/mb": 15
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"entity": "minecraft:zombie_villager",
"fluid": "enderio:flowing_nutrient_distillation",
"power/mb": 500,
"tick/mb": 15
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_nbt",
"ops": [
{
"op": "replace",
"source": "",
"target": "BlockEntityTag"
}
],
"source": "block_entity"
}
],
"name": "enderio:soul_engine"
}
],
"rolls": 1.0
}
],
"random_sequence": "enderio:blocks/soul_engine"
}
30 changes: 30 additions & 0 deletions src/generated/resources/data/enderio/recipes/soul_engine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"B": {
"item": "minecraft:bucket"
},
"C": {
"item": "enderio:ensouled_chassis"
},
"G": {
"tag": "enderio:fused_quartz"
},
"I": {
"item": "enderio:soularium_ingot"
},
"Z": {
"item": "enderio:zombie_electrode"
}
},
"pattern": [
"IGI",
"BCB",
"IZI"
],
"result": {
"item": "enderio:soul_engine"
},
"show_notification": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "enderio:soul_binding",
"energy": 188000,
"exp": 5,
"input": {
"item": "enderio:soul_engine"
},
"output": "enderio:soul_engine",
"souldata": "engine"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.enderio.machines.client.gui.screen;

import com.enderio.EnderIO;
import com.enderio.api.misc.Vector2i;
import com.enderio.base.common.lang.EIOLang;
import com.enderio.core.client.gui.screen.EIOScreen;
import com.enderio.core.client.gui.widgets.EnumIconWidget;
import com.enderio.machines.client.gui.widget.CapacitorEnergyWidget;
import com.enderio.machines.client.gui.widget.FluidStackWidget;
import com.enderio.machines.client.gui.widget.ioconfig.IOConfigButton;
import com.enderio.machines.common.menu.SoulEngineMenu;
import com.enderio.machines.common.souldata.EngineSoul;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.player.Inventory;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.Optional;

public class SoulEngineScreen extends EIOScreen<SoulEngineMenu>{

public static final ResourceLocation BG_TEXTURE = EnderIO.loc("textures/gui/soul_engine.png");

public SoulEngineScreen(SoulEngineMenu pMenu, Inventory pPlayerInventory, Component pTitle) {
super(pMenu, pPlayerInventory, pTitle);
}

@Override
protected void init() {
super.init();

addRenderableOnly(new CapacitorEnergyWidget(this, getMenu().getBlockEntity()::getEnergyStorage, getMenu().getBlockEntity()::isCapacitorInstalled, 16 + leftPos, 14 + topPos, 9, 42));

addRenderableWidget(new EnumIconWidget<>(this, leftPos + imageWidth - 8 - 12, topPos + 6, () -> menu.getBlockEntity().getRedstoneControl(),
control -> menu.getBlockEntity().setRedstoneControl(control), EIOLang.REDSTONE_MODE));

addRenderableOnly(new FluidStackWidget(this, getMenu().getBlockEntity()::getFluidTank, 80 + leftPos, 21 + topPos, 16, 47));

addRenderableWidget(new IOConfigButton<>(this, leftPos + imageWidth - 6 - 16, topPos + 22, 16, 16, menu, this::addRenderableWidget, font));

}

@Override
protected void renderLabels(GuiGraphics guiGraphics, int pMouseX, int pMouseY) {
super.renderLabels(guiGraphics, pMouseX, pMouseY);
Optional<ResourceLocation> rl = getMenu().getBlockEntity().getEntityType();
if (rl.isPresent()) {
EntityType<?> type = ForgeRegistries.ENTITY_TYPES.getValue(rl.get());
if (type != null && ForgeRegistries.ENTITY_TYPES.getKey(type).equals(rl.get())) { // check we don't get the default pig
String name = type.getDescription().getString();
guiGraphics.drawString(font, name, imageWidth / 2f - font.width(name) / 2f, 10, 4210752, false);
} else {
guiGraphics.drawString(font, rl.get().toString(), imageWidth / 2f - font.width(rl.get().toString()) / 2f, 10, 4210752, false);
}
EngineSoul.SoulData data = EngineSoul.ENGINE.map.get(rl.get());
if (data != null) {
guiGraphics.drawString(font, data.tickpermb() + " t/mb", imageWidth / 2f + 12 , 40, 4210752, false);
guiGraphics.drawString(font, data.powerpermb() + " µI/mb", imageWidth / 2f + 12 , 50, 4210752, false);

}
}


}

@Override
public ResourceLocation getBackgroundImage() {
return BG_TEXTURE;
}

@Override
protected Vector2i getBackgroundImageSize() {
return new Vector2i(176, 166);
}
}