diff --git a/CHANGELOG.md b/CHANGELOG.md index 7305cd1ac..f9483b88a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Added the ability for fluid collectors to collect water and lava from filled cauldrons. * Explicitly made the Drills unbreakable. * Fixed worldgenned AA plants breaking on block update. +* Add off-hand slot to Energizer/Enervator # 1.3.10+mc1.21.1 * Fixed Fluid placer not being harvestable. diff --git a/src/generated/resources/.cache/20d9b6419a057e67e5bca6ce3a3de93ccc3382bf b/src/generated/resources/.cache/20d9b6419a057e67e5bca6ce3a3de93ccc3382bf index 02fadae59..69a7be884 100644 --- a/src/generated/resources/.cache/20d9b6419a057e67e5bca6ce3a3de93ccc3382bf +++ b/src/generated/resources/.cache/20d9b6419a057e67e5bca6ce3a3de93ccc3382bf @@ -1,2 +1 @@ -// 1.21.1 2024-11-28T16:44:16.4503165 Update structure files in /structure/ -be1261b16ca6da9123934a123abb191d64ed46b8 data/actuallyadditions/structure/andrew_period_house.nbt +// 1.21.1 2024-11-30T16:01:44.9441801 Update structure files in /structure/ diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 82b74fa91..70d962a9c 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.21.1 2024-11-17T13:53:47.3759486 Recipes +// 1.21.1 2024-11-30T16:05:55.0827347 Recipes b44fee42c2b2b3f56256fe76b2d9f529dc87350a data/actuallyadditions/recipe/atomic_reconstructor.json b1c937b75ba7f8e02dfac4db5253271f2de502e5 data/actuallyadditions/recipe/battery_box.json 660b96730a8ef88b4b44e4ce67fde0945c13ae7f data/actuallyadditions/recipe/bio_reactor.json @@ -10,9 +10,9 @@ bc3771d03192825636fb2d1037b902f5c39e97f8 data/actuallyadditions/recipe/black_qua 3d658c921ea08a80509f5e899c310d84af825854 data/actuallyadditions/recipe/black_quartz_pillar_slab.json 72316aa353fa29f5d0eb5e74849e94ff68ac3ee8 data/actuallyadditions/recipe/black_quartz_pillar_stair.json 93052b0c0fdf1aa83a5a0b26037a008aefc3ba80 data/actuallyadditions/recipe/black_quartz_pillar_wall.json -e9fad26d1fbcb1acf6f5bd711e890787dae636b1 data/actuallyadditions/recipe/black_quartz_slab.json -393c8837e266d33037e02d6704564e2867e89c5b data/actuallyadditions/recipe/black_quartz_stair.json -24f80731fdcb2f950f28949e9c3dbfcd1ec83278 data/actuallyadditions/recipe/black_quartz_wall.json +faee252ef06044ffbef63886eba7bf1f3129cb4a data/actuallyadditions/recipe/black_quartz_slab.json +7cfdb8371ff8e65b594664d9da40124c5e6ee5e3 data/actuallyadditions/recipe/black_quartz_stair.json +18fb02ad6a38943b94bca71e9e5e948a80bd1aa3 data/actuallyadditions/recipe/black_quartz_wall.json bc5c51e659c0b493098b7919740fc6419efb94d9 data/actuallyadditions/recipe/breaker.json 48a5893a0109e467dca8343ee6d4334095e6d118 data/actuallyadditions/recipe/canola_press.json d46bb9d164ab5fcd00acb4f97f77f18245780243 data/actuallyadditions/recipe/chiseled_black_quartz_block.json diff --git a/src/generated/resources/data/actuallyadditions/recipe/black_quartz_slab.json b/src/generated/resources/data/actuallyadditions/recipe/black_quartz_slab.json index 29bd382b1..bbe837779 100644 --- a/src/generated/resources/data/actuallyadditions/recipe/black_quartz_slab.json +++ b/src/generated/resources/data/actuallyadditions/recipe/black_quartz_slab.json @@ -3,7 +3,7 @@ "category": "misc", "key": { "Q": { - "item": "actuallyadditions:black_quartz_pillar_block" + "item": "actuallyadditions:black_quartz_block" } }, "pattern": [ diff --git a/src/generated/resources/data/actuallyadditions/recipe/black_quartz_stair.json b/src/generated/resources/data/actuallyadditions/recipe/black_quartz_stair.json index 3895816a8..041b6eaa4 100644 --- a/src/generated/resources/data/actuallyadditions/recipe/black_quartz_stair.json +++ b/src/generated/resources/data/actuallyadditions/recipe/black_quartz_stair.json @@ -3,7 +3,7 @@ "category": "misc", "key": { "Q": { - "item": "actuallyadditions:black_quartz_pillar_block" + "item": "actuallyadditions:black_quartz_block" } }, "pattern": [ diff --git a/src/generated/resources/data/actuallyadditions/recipe/black_quartz_wall.json b/src/generated/resources/data/actuallyadditions/recipe/black_quartz_wall.json index 19bce1c4c..1c6da2f13 100644 --- a/src/generated/resources/data/actuallyadditions/recipe/black_quartz_wall.json +++ b/src/generated/resources/data/actuallyadditions/recipe/black_quartz_wall.json @@ -3,7 +3,7 @@ "category": "misc", "key": { "Q": { - "item": "actuallyadditions:black_quartz_pillar_block" + "item": "actuallyadditions:black_quartz_block" } }, "pattern": [ diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java index a63d89dba..8fb76a787 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -101,13 +101,13 @@ public class BlockRecipeGenerator extends RecipeProvider { .save(recipeOutput); //Black Quartz Wall - Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput); + Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ.get(), recipeOutput); //Black Quartz Slab - Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput); + Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ.get(), recipeOutput); //Black Quartz Stairs - Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput); + Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ.get(), recipeOutput); //Smooth Black Quartz Wall Recipe.wall(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), recipeOutput); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java index dd042f29c..05a98441e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; +import com.mojang.datafixers.util.Pair; import de.ellpeck.actuallyadditions.mod.inventory.slot.ArmorSlot; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; @@ -25,6 +26,7 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.capabilities.Capabilities; +import java.util.Map; import java.util.Objects; public class ContainerEnergizer extends AbstractContainerMenu { @@ -59,9 +61,22 @@ public class ContainerEnergizer extends AbstractContainerMenu { for (int k = 0; k < 4; ++k) { EquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k]; - ResourceLocation resourcelocation = InventoryMenu.TEXTURE_EMPTY_SLOTS.get(slot); - this.addSlot(new ArmorSlot(inventory, slot, 36 + 3 - k, 102, 19 + k * 18, resourcelocation)); + ResourceLocation resourcelocation = InventoryMenu.TEXTURE_EMPTY_SLOTS.getOrDefault(slot, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD); + this.addSlot(new ArmorSlot(inventory, slot, 36 + 3 - k, 102, 19 + k * 18, resourcelocation) {}); } + + this.addSlot(new Slot(inventory, 40, 120, 19 + 3 * 18) { + @Override + public void setByPlayer(ItemStack newStack, ItemStack oldStack) { + inventory.player.onEquipItem(EquipmentSlot.OFFHAND, oldStack, newStack); + super.setByPlayer(newStack, oldStack); + } + + @Override + public Pair getNoItemIcon() { + return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD); + } + }); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java index 8aef02190..81bdd5511 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; +import com.mojang.datafixers.util.Pair; import de.ellpeck.actuallyadditions.mod.inventory.slot.ArmorSlot; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; @@ -57,6 +58,19 @@ public class ContainerEnervator extends AbstractContainerMenu { ResourceLocation resourcelocation = InventoryMenu.TEXTURE_EMPTY_SLOTS.get(slot); this.addSlot(new ArmorSlot(inventory, slot, 36 + 3 - k, 102, 19 + k * 18, resourcelocation)); } + + this.addSlot(new Slot(inventory, 40, 120, 19 + 3 * 18) { + @Override + public void setByPlayer(ItemStack newStack, ItemStack oldStack) { + inventory.player.onEquipItem(EquipmentSlot.OFFHAND, oldStack, newStack); + super.setByPlayer(newStack, oldStack); + } + + @Override + public Pair getNoItemIcon() { + return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD); + } + }); } @Nonnull diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/gui_energizer.png b/src/main/resources/assets/actuallyadditions/textures/gui/gui_energizer.png index 238b0c4af..59f8bfc55 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/gui_energizer.png and b/src/main/resources/assets/actuallyadditions/textures/gui/gui_energizer.png differ diff --git a/src/main/resources/data/actuallyadditions/structure/andrew_period_house.nbt b/src/main/resources/data/actuallyadditions/structure/andrew_period_house.nbt index 48b6a58d9..6d27ec927 100644 Binary files a/src/main/resources/data/actuallyadditions/structure/andrew_period_house.nbt and b/src/main/resources/data/actuallyadditions/structure/andrew_period_house.nbt differ