diff --git a/src/generated/resources/assets/otemod/models/item/partial_item.json b/src/generated/resources/assets/otemod/models/item/partial_item.json new file mode 100644 index 0000000..f889bf3 --- /dev/null +++ b/src/generated/resources/assets/otemod/models/item/partial_item.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "otemod:item/partial_item" + } +} \ No newline at end of file diff --git a/src/main/java/dev/zontreck/otemod/OTEMod.java b/src/main/java/dev/zontreck/otemod/OTEMod.java index 1559890..e3f4713 100644 --- a/src/main/java/dev/zontreck/otemod/OTEMod.java +++ b/src/main/java/dev/zontreck/otemod/OTEMod.java @@ -16,6 +16,7 @@ import dev.zontreck.otemod.enchantments.NightVisionEnchantment; import dev.zontreck.otemod.events.EventHandler; import dev.zontreck.otemod.implementation.*; import dev.zontreck.otemod.implementation.compressor.CompressionChamberScreen; +import dev.zontreck.otemod.implementation.uncrafting.UncrafterScreen; import dev.zontreck.otemod.implementation.vault.*; import dev.zontreck.otemod.integrations.KeyBindings; import dev.zontreck.otemod.items.DeprecatedModItems; @@ -290,6 +291,7 @@ public class OTEMod MenuScreens.register(ModMenuTypes.SCRUBBER.get(), ItemScrubberScreen::new); MenuScreens.register(ModMenuTypes.MAGIC_SCRUBBER.get(), MagicalScrubberScreen::new); MenuScreens.register(ModMenuTypes.COMPRESSION_CHAMBER.get(), CompressionChamberScreen::new); + MenuScreens.register(ModMenuTypes.UNCRAFTER.get(), UncrafterScreen::new); //ItemBlockRenderTypes.setRenderLayer(ModBlocks.AURORA_DOOR.get(), RenderType.translucent()); diff --git a/src/main/java/dev/zontreck/otemod/blocks/UncrafterBlock.java b/src/main/java/dev/zontreck/otemod/blocks/UncrafterBlock.java index e34afce..0311e18 100644 --- a/src/main/java/dev/zontreck/otemod/blocks/UncrafterBlock.java +++ b/src/main/java/dev/zontreck/otemod/blocks/UncrafterBlock.java @@ -1,6 +1,5 @@ package dev.zontreck.otemod.blocks; -import dev.zontreck.otemod.blocks.entity.CompressionChamberBlockEntity; import dev.zontreck.otemod.blocks.entity.ModEntities; import dev.zontreck.otemod.blocks.entity.UncrafterBlockEntity; import dev.zontreck.otemod.networking.ModMessages; diff --git a/src/main/java/dev/zontreck/otemod/blocks/entity/UncrafterBlockEntity.java b/src/main/java/dev/zontreck/otemod/blocks/entity/UncrafterBlockEntity.java index a24b874..eb431f6 100644 --- a/src/main/java/dev/zontreck/otemod/blocks/entity/UncrafterBlockEntity.java +++ b/src/main/java/dev/zontreck/otemod/blocks/entity/UncrafterBlockEntity.java @@ -16,12 +16,10 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ContainerData; -import net.minecraft.world.inventory.SimpleContainerData; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; diff --git a/src/main/java/dev/zontreck/otemod/data/ModItemModelsProvider.java b/src/main/java/dev/zontreck/otemod/data/ModItemModelsProvider.java index 7c40ece..d4ea6db 100644 --- a/src/main/java/dev/zontreck/otemod/data/ModItemModelsProvider.java +++ b/src/main/java/dev/zontreck/otemod/data/ModItemModelsProvider.java @@ -60,6 +60,7 @@ public class ModItemModelsProvider extends ItemModelProvider item(ModItems.DARK_RED_BRICK); item(ModItems.LIME_BRICK); item(ModItems.GREEN_BRICK); + item(ModItems.PARTIAL_ITEM); /* Engineer's Decor Items diff --git a/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterMenu.java b/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterMenu.java index a6c52e2..30dabc5 100644 --- a/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterMenu.java +++ b/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterMenu.java @@ -42,18 +42,11 @@ public class UncrafterMenu extends AbstractContainerMenu addPlayerHotbar(inv); this.entity.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.UP).ifPresent(handler->{ - addSlot(new SlotItemHandler(handler, 0, 87,39)); + addSlot(new SlotItemHandler(handler, 0, 39,39)); }); this.entity.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).ifPresent(handler->{ - for(int Y = 0; Y < 2; Y ++) - { - for(int X = 0; X < 9; X++) - { - addSlot(new SlotItemHandler(handler, X + Y * 9 + 9, UNCRAFTER_STORAGE_LEFT * X * 18, UNCRAFTER_STORAGE_HEIGHT*Y*18)); - } - - } + addSlot(new SlotItemHandler(handler, 0, 151, 39)); }); @@ -83,9 +76,6 @@ public class UncrafterMenu extends AbstractContainerMenu return 0; } - private static final int UNCRAFTER_STORAGE_LEFT = 15; - private static final int UNCRAFTER_STORAGE_HEIGHT = 63; - // CREDIT GOES TO: diesieben07 | https://github.com/diesieben07/SevenCommons // must assign a slot number to each of the slots used by the GUI. @@ -143,9 +133,9 @@ public class UncrafterMenu extends AbstractContainerMenu return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.COMPRESSION_CHAMBER.get()); } - private static final int PLAYER_INVENTORY_FIRST_SLOT_HEIGHT = 107; - private static final int PLAYER_INVENTORY_FIRST_SLOT_LEFT = 15; - private static final int PLAYER_HOTBAR_FIRST_SLOT = 164; + private static final int PLAYER_INVENTORY_FIRST_SLOT_HEIGHT = 71; + private static final int PLAYER_INVENTORY_FIRST_SLOT_LEFT = 29; + private static final int PLAYER_HOTBAR_FIRST_SLOT = 138; private void addPlayerInventory(Inventory inv) { diff --git a/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterScreen.java b/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterScreen.java index d74aa64..57b0c62 100644 --- a/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterScreen.java +++ b/src/main/java/dev/zontreck/otemod/implementation/uncrafting/UncrafterScreen.java @@ -27,7 +27,7 @@ public class UncrafterScreen extends AbstractContainerScreen this.leftPos=0; this.imageWidth=198; - this.imageHeight=204; + this.imageHeight=167; } @Override @@ -40,7 +40,7 @@ public class UncrafterScreen extends AbstractContainerScreen int x = (width - imageWidth )/2; int y = (height - imageHeight)/2; - EIA = new EnergyInfoArea(x+182, y+126, menu.entity.getEnergyStorage(), 5, 63); + EIA = new EnergyInfoArea(x+186, y+143, menu.entity.getEnergyStorage(), 5, 63); } @Override @@ -69,7 +69,7 @@ public class UncrafterScreen extends AbstractContainerScreen } private void renderEnergy(GuiGraphics stack, int mouseX, int mouseY, int x, int y) { - if(isMouseAbove(mouseX, mouseY, x, y, 182, 126, 5, 63)){ + if(isMouseAbove(mouseX, mouseY, x, y, leftPos + 182, topPos + 126, 5, 63)){ stack.renderTooltip(font, EIA.getTooltips(), Optional.empty(), mouseX-x, mouseY-y); } } @@ -79,7 +79,7 @@ public class UncrafterScreen extends AbstractContainerScreen { if(menu.isCrafting()) { - stack.blit(TEXTURE, leftPos+116, topPos+44, 179, 11, menu.getScaledProgress(),7); + stack.blit(TEXTURE, leftPos+68, topPos+52, 2, 210, menu.getScaledProgress(),9); } } diff --git a/src/main/java/dev/zontreck/otemod/networking/packets/EnergySyncS2CPacket.java b/src/main/java/dev/zontreck/otemod/networking/packets/EnergySyncS2CPacket.java index f540192..5b080d1 100644 --- a/src/main/java/dev/zontreck/otemod/networking/packets/EnergySyncS2CPacket.java +++ b/src/main/java/dev/zontreck/otemod/networking/packets/EnergySyncS2CPacket.java @@ -5,6 +5,7 @@ import java.util.function.Supplier; import dev.zontreck.otemod.blocks.entity.CompressionChamberBlockEntity; import dev.zontreck.otemod.blocks.entity.ItemScrubberBlockEntity; import dev.zontreck.otemod.blocks.entity.MagicalScrubberBlockEntity; +import dev.zontreck.otemod.blocks.entity.UncrafterBlockEntity; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; @@ -46,6 +47,9 @@ public class EnergySyncS2CPacket { { entity.setEnergy(energy); } else if(Minecraft.getInstance().level.getBlockEntity(pos) instanceof CompressionChamberBlockEntity entity) + { + entity.setEnergy(energy); + } else if(Minecraft.getInstance().level.getBlockEntity(pos) instanceof UncrafterBlockEntity entity) { entity.setEnergy(energy); } diff --git a/src/main/resources/data/otemod/recipes/steel_railing.json b/src/main/resources/data/otemod/recipes/steel_railing.json deleted file mode 100644 index 401bd8a..0000000 --- a/src/main/resources/data/otemod/recipes/steel_railing.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "WWW", - "W W" - ], - "key": { - "W": { - "item": "otemod:metal_bar" - } - }, - "result": { - "item": "otemod:steel_railing", - "count": 1 - } -}