diff --git a/gradle.properties b/gradle.properties index ec79bb5..7715c48 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,4 +7,4 @@ meta_download=https://www.curseforge.com/minecraft/mc-mods/engineers-decor/ version_minecraft=1.19.1 version_forge_minecraft=1.19.1-42.0.1 version_jei=11.0.0.206 -version_engineersdecor=1.2.25 +version_engineersdecor=1.2.26 diff --git a/meta/update.json b/meta/update.json index 6b5e5e5..3ab5856 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.19.1": { + "1.2.26": "[F] Fixed Mineral Melting Furnace fluid extraction (issue #223, ty adkinss).", "1.2.25": "[U] Ported to 1.19.1.", "1.1.24": "[U] Forge updated to 1.19-41.1.0.\n[B] Known issue: JEI integration missing.", "1.1.24-b1": "[U] Initial 1.19 port.\n[D] Metal/Treated Wood Crafting Table dropped in favour of IE Engineer's Crafting Table.\n[D] Labeled Crate dropped.\n[D] Obsolete wood blocks dropped.", @@ -60,7 +61,7 @@ "1.1.2-b1": "[U] Ported to MC1.16.2." }, "promos": { - "1.19.1-recommended": "1.2.25", - "1.19.1-latest": "1.2.25" + "1.19.1-recommended": "1.2.26", + "1.19.1-latest": "1.2.26" } } \ No newline at end of file diff --git a/readme.md b/readme.md index d3c602f..c1ae787 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.18.x. ## Version history + - v1.2.26 [F] Fixed Mineral Melting Furnace fluid extraction (issue #223, ty adkinss). + - v1.2.25 [U] Ported to 1.19.1. - v1.1.24 [U] Forge updated to 1.19-41.1.0. diff --git a/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java b/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java index 46c8217..d1e60b4 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java +++ b/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java @@ -477,18 +477,23 @@ public class EdMineralSmelter level.playSound(null, worldPosition, SoundEvents.LAVA_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 0.7f); } } - } else if((phase()==PHASE_LAVA) && (tank_.getFluidAmount()>0)) { - // Phase unchanged, fluid transfer check. - FluidStack fs = tank_.getFluid().copy(); - if(fs.getAmount() > 100) fs.setAmount(100); - final int n = Fluidics.fill(level, getBlockPos().below(), Direction.UP, fs); - if(n > 0) { - tank_.drain(n); - if(tank_.isEmpty()) { - final ItemStack prev = main_inventory_.getItem(0); - reset_process(); - main_inventory_.setItem(0, prev); - level.playSound(null, worldPosition, SoundEvents.LAVA_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 0.7f); + } else if(phase()>=PHASE_LAVA) { + if(tank_.getFluidAmount()<=0) { + reset_process(); + level.playSound(null, worldPosition, SoundEvents.LAVA_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 0.7f); + } else { + // Phase unchanged, fluid transfer check. + FluidStack fs = tank_.getFluid().copy(); + if(fs.getAmount() > 100) fs.setAmount(100); + final int n = Fluidics.fill(level, getBlockPos().below(), Direction.UP, fs); + if(n > 0) { + tank_.drain(n); + if(tank_.isEmpty()) { + final ItemStack prev = main_inventory_.getItem(0); + reset_process(); + main_inventory_.setItem(0, prev); + level.playSound(null, worldPosition, SoundEvents.LAVA_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 0.7f); + } } } } diff --git a/src/main/java/wile/engineersdecor/libmc/Inventories.java b/src/main/java/wile/engineersdecor/libmc/Inventories.java index df90998..29a7f64 100644 --- a/src/main/java/wile/engineersdecor/libmc/Inventories.java +++ b/src/main/java/wile/engineersdecor/libmc/Inventories.java @@ -72,14 +72,20 @@ public class Inventories return (entity==null) ? (null) : (itemhandler(entity,side)); } - public static IItemHandler itemhandler(Entity entity) - { return (entity instanceof Container) ? (new InvWrapper((Container)entity)) : null; } - public static IItemHandler itemhandler(Player player) { return new PlayerMainInvWrapper(player.getInventory()); } + public static IItemHandler itemhandler(Entity entity) + { return itemhandler(entity, null); } + public static IItemHandler itemhandler(Entity entity, @Nullable Direction side) - { return (entity instanceof Container) ? (new InvWrapper((Container)entity)) : null; } + { + if(entity==null) return null; + final IItemHandler ih = entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side).orElse(null); + if(ih!=null) return ih; + if(entity instanceof Container container) return (new InvWrapper(container)); + return null; + } public static boolean insertionPossible(Level world, BlockPos pos, @Nullable Direction side, boolean including_entities) { return itemhandler(world, pos, side, including_entities) != null; }