diff --git a/build.gradle b/build.gradle index 1dc41bb..90cdd99 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ buildscript apply plugin: 'forge' -version = "1.7.10-1.2.0.4" +version = "1.7.10-1.2.0.5" group= "net.zarathul.simplefluidtanks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "simplefluidtanks" diff --git a/src/main/java/net/zarathul/simplefluidtanks/blocks/ValveBlock.java b/src/main/java/net/zarathul/simplefluidtanks/blocks/ValveBlock.java index 960a862..43a0d3c 100644 --- a/src/main/java/net/zarathul/simplefluidtanks/blocks/ValveBlock.java +++ b/src/main/java/net/zarathul/simplefluidtanks/blocks/ValveBlock.java @@ -13,6 +13,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; @@ -314,11 +315,11 @@ private void fillContainerFromTank(World world, int x, int y, int z, EntityPlaye player.inventory.setInventorySlotContents(player.inventory.currentItem, null); } - // add filled container to player inventory or drop it to the ground if the inventory is full + // add filled container to player inventory or drop it to the ground if the inventory is full or we're dealing with a fake player - if (!player.inventory.addItemStackToInventory(filledContainer)) + if (player instanceof FakePlayer || !player.inventory.addItemStackToInventory(filledContainer)) { - world.spawnEntityInWorld(new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, filledContainer)); + world.spawnEntityInWorld(new EntityItem(world, player.posX + 0.5D, player.posY + 1.5D, player.posZ + 0.5D, filledContainer)); } else if (player instanceof EntityPlayerMP) { @@ -383,11 +384,11 @@ private void drainContainerIntoTank(World world, int x, int y, int z, EntityPlay player.inventory.setInventorySlotContents(player.inventory.currentItem, null); } - // add emptied container to player inventory or drop it to the ground if the inventory is full + // add emptied container to player inventory or drop it to the ground if the inventory is full or we're dealing with a fake player - if (!player.inventory.addItemStackToInventory(emptyContainer)) + if (player instanceof FakePlayer || !player.inventory.addItemStackToInventory(emptyContainer)) { - world.spawnEntityInWorld(new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, emptyContainer)); + world.spawnEntityInWorld(new EntityItem(world, player.posX + 0.5D, player.posY + 1.5D, player.posZ + 0.5D, emptyContainer)); } else if (player instanceof EntityPlayerMP) { diff --git a/src/main/java/net/zarathul/simplefluidtanks/configuration/Config.java b/src/main/java/net/zarathul/simplefluidtanks/configuration/Config.java index b0cde22..aee8b16 100644 --- a/src/main/java/net/zarathul/simplefluidtanks/configuration/Config.java +++ b/src/main/java/net/zarathul/simplefluidtanks/configuration/Config.java @@ -28,8 +28,8 @@ public final class Config ), new RecipeComponent[] { - new RecipeComponent("I", "minecraft", "iron_ingot"), - new RecipeComponent("G", "minecraft", "glass") + new RecipeComponent("I", "oreDict", "ingotIron"), + new RecipeComponent("G", "oreDict", "blockGlass") } ); @@ -43,8 +43,8 @@ public final class Config ), new RecipeComponent[] { - new RecipeComponent("I", "minecraft", "iron_ingot"), - new RecipeComponent("S", "minecraft", "slime_ball"), + new RecipeComponent("I", "oreDict", "ingotIron"), + new RecipeComponent("S", "oreDict", "slimeball"), new RecipeComponent("T", SimpleFluidTanks.MOD_ID, Registry.TANKBLOCK_NAME) } ); @@ -59,7 +59,7 @@ public final class Config ), new RecipeComponent[] { - new RecipeComponent("I", "minecraft", "iron_ingot") + new RecipeComponent("I", "oreDict", "ingotIron") } );