From e66ce0d4678e288d981f734fa7fdec8f9642545e Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Thu, 11 Jun 2015 18:10:50 +0100 Subject: Fixed liquids on servers + other stuff --- .../darkknight/jewelrycraft/JewelrycraftMod.java | 1 - .../jewelrycraft/events/PlayerRenderHandler.java | 24 +- .../jewelrycraft/item/ItemMoltenMetalBucket.java | 404 ++++++++++----------- .../jewelrycraft/item/render/BraceletRender.java | 2 +- .../darkknight/jewelrycraft/thirdparty/Alpaca.java | 2 - .../darkknight/jewelrycraft/util/Variables.java | 2 +- .../jewelrycraft/worldGen/WorldGenStructure2.java | 97 ++--- .../jewelrycraft/worldGen/WorldGenStructure5.java | 147 ++++---- 8 files changed, 340 insertions(+), 339 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java b/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java index 5855466..6c8ca44 100644 --- a/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java +++ b/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java @@ -62,7 +62,6 @@ public class JewelrycraftMod public static File liquidsConf; public static SimpleNetworkWrapper netWrapper; public static boolean fancyRender = false; - public static Potion alpacaPotion = null; /** * Pre initialization of mod stuff. diff --git a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java index 74c7072..9bbb419 100644 --- a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java @@ -81,11 +81,11 @@ public class PlayerRenderHandler { float s = 0.055F; NBTTagCompound nbt = (NBTTagCompound) playerInfo.getTag("ext" + i); ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) arm = body; + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) arm = body; GL11.glPushMatrix(); if (arm.rotateAngleX == 0.0F && arm.rotateAngleY == 0.0F && arm.rotateAngleZ == 0.0F) { if ((arm.rotationPointX + rotAngleX) != 0.0F || (arm.rotationPointY + rotAngleY) != 0.0F || (arm.rotationPointZ + rotAngleZ) != 0.0F) GL11.glTranslatef((arm.rotationPointX + rotAngleX) * s, (arm.rotationPointY + rotAngleY) * s, (arm.rotationPointZ + rotAngleZ) * s); - } else if (!Loader.isModLoaded("alpaca") || (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))) { + } else if (!Loader.isModLoaded("alpaca") /*|| (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))*/) { GL11.glTranslatef((arm.rotationPointX + rotAngleX) * s, (arm.rotationPointY + rotAngleY) * s, (arm.rotationPointZ + rotAngleZ) * s); if (arm.rotateAngleZ != 0.0F) GL11.glRotatef(arm.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); if (arm.rotateAngleY != 0.0F) GL11.glRotatef(arm.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); @@ -94,7 +94,7 @@ public class PlayerRenderHandler { if (JewelryNBT.ingot(item) != null) ingot = JewelryNBT.ingotColor(item); if (JewelryNBT.gem(item) != null) gem = JewelryNBT.gemColor(item); float scale = 0.1f; - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) { + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) { if (no <= 4) { GL11.glTranslatef(0.35F, -4.35F, -2.8F + 0.15F * no); GL11.glRotatef(90f, 0F, 1F, 0F); @@ -122,14 +122,14 @@ public class PlayerRenderHandler { if ((playerInfo.hasKey("ext10") || playerInfo.hasKey("ext11")) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())) { GL11.glPushMatrix(); GL11.glColor4f(1, 1, 1, 1); - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) { + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) { rightArm = body; GL11.glTranslatef(0.0F, 0.05F, 0.0F); GL11.glRotatef(-30F, 0.0F, 1.0F, 0.0F); } if (rightArm.rotateAngleX == 0.0F && rightArm.rotateAngleY == 0.0F && rightArm.rotateAngleZ == 0.0F) { if ((rightArm.rotationPointX + rotAngleX) != 0.0F || (rightArm.rotationPointY + rotAngleY) != 0.0F || (rightArm.rotationPointZ + rotAngleZ) != 0.0F) GL11.glTranslatef((rightArm.rotationPointX + rotAngleX) * size, (rightArm.rotationPointY + rotAngleY) * size, (rightArm.rotationPointZ + rotAngleZ) * size); - } else if (!Loader.isModLoaded("alpaca") || (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))) { + } else if (!Loader.isModLoaded("alpaca") /*|| (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))*/) { GL11.glTranslatef((rightArm.rotationPointX + rotAngleX) * size, (rightArm.rotationPointY + rotAngleY) * size, (rightArm.rotationPointZ + rotAngleZ) * size); if (rightArm.rotateAngleZ != 0.0F) GL11.glRotatef(rightArm.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); if (rightArm.rotateAngleY != 0.0F) GL11.glRotatef(rightArm.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); @@ -142,14 +142,14 @@ public class PlayerRenderHandler { if ((playerInfo.hasKey("ext12") || playerInfo.hasKey("ext13")) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())) { GL11.glPushMatrix(); GL11.glColor4f(1, 1, 1, 1); - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) { + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) { leftArm = body; GL11.glTranslatef(-0.1F, 0.0F, 0.1F); GL11.glRotatef(-140F, 0.0F, 1.0F, 0.0F); } if (leftArm.rotateAngleX == 0.0F && leftArm.rotateAngleY == 0.0F && leftArm.rotateAngleZ == 0.0F) { if ((leftArm.rotationPointX + rotAngleX) != 0.0F || (leftArm.rotationPointY + rotAngleY) != 0.0F || (leftArm.rotationPointZ + rotAngleZ) != 0.0F) GL11.glTranslatef((leftArm.rotationPointX + rotAngleX) * size, (leftArm.rotationPointY + rotAngleY) * size, (leftArm.rotationPointZ + rotAngleZ) * size); - } else if (!Loader.isModLoaded("alpaca") || (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))) { + } else if (!Loader.isModLoaded("alpaca") /*|| (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))*/) { GL11.glTranslatef((leftArm.rotationPointX + rotAngleX) * size + 0.2F, (leftArm.rotationPointY + rotAngleY) * size, (leftArm.rotationPointZ + rotAngleZ) * size); if (leftArm.rotateAngleZ != 0.0F) GL11.glRotatef(leftArm.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); if (leftArm.rotateAngleY != 0.0F) GL11.glRotatef(leftArm.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); @@ -169,13 +169,13 @@ public class PlayerRenderHandler { GL11.glPushMatrix(); if (body.rotateAngleX == 0.0F && body.rotateAngleY == 0.0F && body.rotateAngleZ == 0.0F) { if (body.rotationPointX != 0.0F || body.rotationPointY != 0.0F || body.rotationPointZ != 0.0F) GL11.glTranslatef(body.rotationPointX * size, body.rotationPointY * size, body.rotationPointZ * size); - } else if (!Loader.isModLoaded("alpaca") || (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))) { + } else if (!Loader.isModLoaded("alpaca") /*|| (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))*/) { GL11.glTranslatef(body.rotationPointX * size, body.rotationPointY * size, body.rotationPointZ * size); if (body.rotateAngleZ != 0.0F) GL11.glRotatef(body.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); if (body.rotateAngleY != 0.0F) GL11.glRotatef(body.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); if (body.rotateAngleX != 0.0F) GL11.glRotatef(body.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F); } - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) GL11.glTranslatef(0.0F, 0.55F, -0.28F); + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) GL11.glTranslatef(0.0F, 0.55F, -0.28F); GL11.glScalef(0.0625f, 0.0625f, 0.0625f); if (JewelryNBT.gem(item) != null) gem = JewelryNBT.gemColor(item); if (JewelryNBT.ingot(item) != null) ingot = JewelryNBT.ingotColor(item); @@ -194,16 +194,16 @@ public class PlayerRenderHandler { ItemStack item = ItemStack.loadItemStackFromNBT(nbt); GL11.glPushMatrix(); float s = 0.0625F; - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) head = body; + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) head = body; if (head.rotateAngleX == 0.0F && head.rotateAngleY == 0.0F && head.rotateAngleZ == 0.0F) { if (head.rotationPointX != 0.0F || head.rotationPointY != 0.0F || head.rotationPointZ != 0.0F) GL11.glTranslatef(head.rotationPointX * size, head.rotationPointY * size, head.rotationPointZ * size); - } else if (!Loader.isModLoaded("alpaca") || (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))) { + } else if (!Loader.isModLoaded("alpaca") /*|| (Loader.isModLoaded("alpaca") && !fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer))*/) { GL11.glTranslatef(head.rotationPointX * size, head.rotationPointY * size, head.rotationPointZ * size); if (head.rotateAngleZ != 0.0F) GL11.glRotatef(head.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); if (head.rotateAngleY != 0.0F) GL11.glRotatef(head.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); if (head.rotateAngleX != 0.0F) GL11.glRotatef(head.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F); } - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)) GL11.glTranslatef(0.0F, 0.7F, -0.2F); + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient(event.entityPlayer)*/) GL11.glTranslatef(0.0F, 0.7F, -0.2F); GL11.glScalef(s, s, s); GL11.glTranslatef(0.0F, 1.0F, -2.0F); if (JewelryNBT.gem(item) != null) gem = JewelryNBT.gemColor(item); diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java index 1cacc37..b9a83c4 100644 --- a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java @@ -1,8 +1,10 @@ package darkknight.jewelrycraft.item; import java.io.IOException; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -20,215 +22,207 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import darkknight.jewelrycraft.JewelrycraftMod; import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; import darkknight.jewelrycraft.network.PacketSendLiquidData; import darkknight.jewelrycraft.util.JewelryNBT; import darkknight.jewelrycraft.util.Variables; -public class ItemMoltenMetalBucket extends Item -{ - public IIcon liquid; - - /** +public class ItemMoltenMetalBucket extends Item { + public IIcon liquid; + + /** * */ - public ItemMoltenMetalBucket() - { - maxStackSize = 1; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - * - * @param stack - * @param par2World - * @param par3EntityPlayer - * @return - */ - @Override - public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) - { - boolean flag = BlockList.moltenMetal == Blocks.air; - MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag); - if (movingobjectposition == null) return stack; - else{ - FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, stack, par2World, movingobjectposition); - if (MinecraftForge.EVENT_BUS.post(event)) return stack; - if (event.getResult() == Event.Result.ALLOW){ - if (par3EntityPlayer.capabilities.isCreativeMode) return stack; - if (--stack.stackSize <= 0) return event.result; - if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result)) par3EntityPlayer.dropPlayerItemWithRandomChoice(event.result, false); - return stack; - } - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){ - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; - if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) return stack; - if (flag){ - if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack)) return stack; - par2World.getBlock(i, j, k).getMaterial(); - par2World.getBlockMetadata(i, j, k); - par2World.setBlockToAir(i, j, k); - return func_150910_a(stack, par3EntityPlayer, ItemList.bucket); - }else{ - if (BlockList.moltenMetal == Blocks.air) return new ItemStack(Items.bucket); - if (movingobjectposition.sideHit == 0) --j; - if (movingobjectposition.sideHit == 1) ++j; - if (movingobjectposition.sideHit == 2) --k; - if (movingobjectposition.sideHit == 3) ++k; - if (movingobjectposition.sideHit == 4) --i; - if (movingobjectposition.sideHit == 5) ++i; - if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack)) return stack; - try{ - if (tryPlaceContainedLiquid(par2World, i, j, k, stack) && !par3EntityPlayer.capabilities.isCreativeMode) return new ItemStack(Items.bucket); - } - catch(IOException e){ - e.printStackTrace(); - } - } - } - return stack; - } - } - - /** - * @param p_150910_1_ - * @param p_150910_2_ - * @param p_150910_3_ - * @return - */ - private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) - { - if (p_150910_2_.capabilities.isCreativeMode) return p_150910_1_; - else if (--p_150910_1_.stackSize <= 0) return new ItemStack(p_150910_3_); - else{ - if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false); - return p_150910_1_; - } - } - - /** - * Attempts to place the liquid contained inside the bucket. - * - * @param world - * @param x - * @param y - * @param z - * @param stack - * @return - * @throws IOException - */ - public boolean tryPlaceContainedLiquid(World world, int x, int y, int z, ItemStack stack) throws IOException - { - if (BlockList.moltenMetal == Blocks.air) return false; - else{ - Material material = world.getBlock(x, y, z).getMaterial(); - boolean flag = !material.isSolid(); - if (!world.isAirBlock(x, y, z) && !flag) return false; - else if (stack != null && JewelryNBT.ingot(stack) != null){ - if (!world.isRemote && flag && !material.isLiquid()) world.func_147480_a(x, y, z, true); - int color = color(stack, 1); - JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color); - JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color)); - world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3); - return true; - }else return false; - } - } - - /** - * @param iconRegister - */ - @Override - public void registerIcons(IIconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("bucket_empty"); - liquid = iconRegister.registerIcon(Variables.MODID + ":bucketOverlay"); - } - - /** - * @param stack - * @param pass - * @return - */ - @Override - @SideOnly (Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - try{ - return color(stack, pass); - } - catch(IOException e){ - e.printStackTrace(); - } - return 16777215; - } - - /** - * @return - */ - @Override - public boolean requiresMultipleRenderPasses() - { - return true; - } - - /** - * @param stack - * @param pass - * @return - */ - @Override - public IIcon getIcon(ItemStack stack, int pass) - { - if (pass == 0) return itemIcon; - if (pass == 1) return liquid; - return itemIcon; - } - - /** - * @param stack - * @param pass - * @return - * @throws IOException - */ - @SideOnly(Side.CLIENT) - public static int color(ItemStack stack, int pass) throws IOException - { - if (pass == 1) return ItemMoltenMetal.color(stack, pass); - return 16777215; - } - - /** - * @param ingot - * @return - */ - public ItemStack getModifiedItemStack(ItemStack ingot) - { - ItemStack itemstack = new ItemStack(this); - JewelryNBT.addMetal(itemstack, ingot); - return itemstack; - } - - /** - * @param stack - * @return - */ - @Override - public String getItemStackDisplayName(ItemStack stack) - { - try{ - if (JewelryNBT.ingot(stack) != null){ - ItemStack ingot = JewelryNBT.ingot(stack); - if (ingot != null){ - if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage()); - return StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name").trim() + " " + ingot.getDisplayName().replace("Ingot", " ").trim(); - }else return StatCollector.translateToLocal("bucket.unknown"); - } - } - catch(Exception e){ - System.out.println("Error: " + e); - } - return ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim() + " " + StatCollector.translateToLocal("info.jewelrycraft2.metal"); - } + public ItemMoltenMetalBucket() { + maxStackSize = 1; + } + + /** + * Called whenever this item is equipped and the right mouse button is + * pressed. Args: itemStack, world, entityPlayer + * + * @param stack + * @param par2World + * @param par3EntityPlayer + * @return + */ + @Override + public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) { + boolean flag = BlockList.moltenMetal == Blocks.air; + MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag); + if (movingobjectposition == null) return stack; + else { + FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, stack, par2World, movingobjectposition); + if (MinecraftForge.EVENT_BUS.post(event)) return stack; + if (event.getResult() == Event.Result.ALLOW) { + if (par3EntityPlayer.capabilities.isCreativeMode) return stack; + if (--stack.stackSize <= 0) return event.result; + if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result)) par3EntityPlayer.dropPlayerItemWithRandomChoice(event.result, false); + return stack; + } + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) return stack; + if (flag) { + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack)) return stack; + par2World.getBlock(i, j, k).getMaterial(); + par2World.getBlockMetadata(i, j, k); + par2World.setBlockToAir(i, j, k); + return func_150910_a(stack, par3EntityPlayer, ItemList.bucket); + } else { + if (BlockList.moltenMetal == Blocks.air) return new ItemStack(Items.bucket); + if (movingobjectposition.sideHit == 0) --j; + if (movingobjectposition.sideHit == 1) ++j; + if (movingobjectposition.sideHit == 2) --k; + if (movingobjectposition.sideHit == 3) ++k; + if (movingobjectposition.sideHit == 4) --i; + if (movingobjectposition.sideHit == 5) ++i; + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack)) return stack; + try { + if (tryPlaceContainedLiquid(par2World, i, j, k, stack) && !par3EntityPlayer.capabilities.isCreativeMode) return new ItemStack(Items.bucket); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return stack; + } + } + + /** + * @param p_150910_1_ + * @param p_150910_2_ + * @param p_150910_3_ + * @return + */ + private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) { + if (p_150910_2_.capabilities.isCreativeMode) return p_150910_1_; + else if (--p_150910_1_.stackSize <= 0) return new ItemStack(p_150910_3_); + else { + if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false); + return p_150910_1_; + } + } + + /** + * Attempts to place the liquid contained inside the bucket. + * + * @param world + * @param x + * @param y + * @param z + * @param stack + * @return + * @throws IOException + */ + public boolean tryPlaceContainedLiquid(World world, int x, int y, int z, ItemStack stack) throws IOException { + if (BlockList.moltenMetal == Blocks.air) return false; + else { + Material material = world.getBlock(x, y, z).getMaterial(); + boolean flag = !material.isSolid(); + if (!world.isAirBlock(x, y, z) && !flag) return false; + else if (stack != null && JewelryNBT.ingot(stack) != null) { + if (!world.isRemote && flag && !material.isLiquid()) world.func_147480_a(x, y, z, true); + if (world.isRemote) { + int color = color(stack, 1); + JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color)); + } else { + JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + world.rand.nextInt(16777216)); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), world.rand.nextInt(16777216))); + } + world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3); + return true; + } else return false; + } + } + + /** + * @param iconRegister + */ + @Override + public void registerIcons(IIconRegister iconRegister) { + itemIcon = iconRegister.registerIcon("bucket_empty"); + liquid = iconRegister.registerIcon(Variables.MODID + ":bucketOverlay"); + } + + /** + * @param stack + * @param pass + * @return + */ + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + try { + return color(stack, pass); + } catch (IOException e) { + e.printStackTrace(); + } + return 16777215; + } + + /** + * @return + */ + @Override + public boolean requiresMultipleRenderPasses() { + return true; + } + + /** + * @param stack + * @param pass + * @return + */ + @Override + public IIcon getIcon(ItemStack stack, int pass) { + if (pass == 0) return itemIcon; + if (pass == 1) return liquid; + return itemIcon; + } + + /** + * @param stack + * @param pass + * @return + * @throws IOException + */ + @SideOnly(Side.CLIENT) + public static int color(ItemStack stack, int pass) throws IOException { + if (pass == 1) return ItemMoltenMetal.color(stack, pass); + return 16777215; + } + + /** + * @param ingot + * @return + */ + public ItemStack getModifiedItemStack(ItemStack ingot) { + ItemStack itemstack = new ItemStack(this); + JewelryNBT.addMetal(itemstack, ingot); + return itemstack; + } + + /** + * @param stack + * @return + */ + @Override + public String getItemStackDisplayName(ItemStack stack) { + try { + if (JewelryNBT.ingot(stack) != null) { + ItemStack ingot = JewelryNBT.ingot(stack); + if (ingot != null) { + if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage()); + return StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name").trim() + " " + ingot.getDisplayName().replace("Ingot", " ").trim(); + } else return StatCollector.translateToLocal("bucket.unknown"); + } + } catch (Exception e) { + System.out.println("Error: " + e); + } + return ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim() + " " + StatCollector.translateToLocal("info.jewelrycraft2.metal"); + } } diff --git a/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java b/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java index bdec55d..f24dfec 100644 --- a/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java +++ b/src/main/java/darkknight/jewelrycraft/item/render/BraceletRender.java @@ -28,7 +28,7 @@ public class BraceletRender extends TileEntitySpecialRenderer GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); if ((float)z != -1) bracelet.render(entity, 0F, 0F, 0F, (float)z, f, 1.0F); - if (Loader.isModLoaded("alpaca") && fiskfille.alpaca.AlpacaAPI.isAlpacaClient((EntityPlayer)entity)){ + if (Loader.isModLoaded("alpaca") /*&& fiskfille.alpaca.AlpacaAPI.isAlpacaClient((EntityPlayer)entity)*/){ GL11.glTranslatef(1F, 0F, -9F); GL11.glRotatef(25F, 1F, 0F, 0F); GL11.glRotatef(-25F, 0F, 1F, 0F); diff --git a/src/main/java/darkknight/jewelrycraft/thirdparty/Alpaca.java b/src/main/java/darkknight/jewelrycraft/thirdparty/Alpaca.java index 548004e..82c341f 100644 --- a/src/main/java/darkknight/jewelrycraft/thirdparty/Alpaca.java +++ b/src/main/java/darkknight/jewelrycraft/thirdparty/Alpaca.java @@ -1,7 +1,6 @@ package darkknight.jewelrycraft.thirdparty; import darkknight.jewelrycraft.JewelrycraftMod; -import fiskfille.alpaca.common.potion.AlpacaPotions; /** * @author Sorin @@ -19,7 +18,6 @@ public class Alpaca implements IThirdParty @Override public void postInit() { - JewelrycraftMod.alpacaPotion = AlpacaPotions.potionAlpaca; } @Override diff --git a/src/main/java/darkknight/jewelrycraft/util/Variables.java b/src/main/java/darkknight/jewelrycraft/util/Variables.java index a0abe50..aeb2fb6 100644 --- a/src/main/java/darkknight/jewelrycraft/util/Variables.java +++ b/src/main/java/darkknight/jewelrycraft/util/Variables.java @@ -6,7 +6,7 @@ public class Variables { public static final String MODID = "jewelrycraft2"; public static final String MODNAME = "Jewelrycraft 2"; - public static final String VERSION = "1.0.10"; + public static final String VERSION = "1.0.11"; public static final String PACKET_CHANNEL = "jewelrycraft2"; public static final String CONFIG_GUI = "darkknight.jewelrycraft.config.ConfigGuiFactory"; diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java index f8b3094..b7662bb 100644 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java @@ -20,51 +20,54 @@ import darkknight.jewelrycraft.util.JewelrycraftUtil; /** * @author Sorin */ -public class WorldGenStructure2 extends WorldGenerator -{ - public boolean generate(World world, BiomeGenBase biome, Random rand, int x, int y, int z) - { - Block block = Blocks.stonebrick; - Block stair = Blocks.stone_brick_stairs; - int metadata = 0, slabMeta = 5; - if (biome == BiomeGenBase.desert || biome == BiomeGenBase.desertHills){ - block = Blocks.sandstone; - stair = Blocks.sandstone_stairs; - metadata = 2; - } - for(int i = -1; i <= 1; i++) - for(int k = -1; k <= 1; k++) - world.setBlock(x + i, y, z + k, Blocks.air); - for(int i = -1; i <= 1; i++) - for(int k = -1; k <= 1; k++) - world.setBlock(x + i, y - 1, z + k, block, metadata, 2); - for(int i = -1; i <= 1; i++) - for(int k = -1; k <= 1; k++) - world.setBlock(x + i, y, z + k, stair); - for(int i = -1; i <= 1; i++) - for(int k = -1; k <= 1; k++) - world.setBlockMetadataWithNotify(x + i, y, z + k, (k == -1) ? 3 : (k == 0) ? (i == 1) ? 0 : 1 : 2, 2); - world.setBlock(x, y, z, Blocks.air); - ItemStack stack = new ItemStack(ItemList.bucket); - JewelryNBT.addMetal(stack, JewelrycraftUtil.metal.get(rand.nextInt(JewelrycraftUtil.metal.size()))); - try{ - if (stack != null && JewelryNBT.ingot(stack) != null){ - if (!world.isRemote) world.func_147480_a(x, y, z, true); - int color = ItemMoltenMetalBucket.color(stack, 1); - JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color); - JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color)); - world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3); - } - } - catch(IOException e){ - e.printStackTrace(); - } - return true; - } - - @Override - public boolean generate(World world, Random rand, int x, int y, int z) - { - return generate(world, BiomeGenBase.plains, rand, x, y, z); - } +public class WorldGenStructure2 extends WorldGenerator { + public boolean generate(World world, BiomeGenBase biome, Random rand, int x, int y, int z) { + Block block = Blocks.stonebrick; + Block stair = Blocks.stone_brick_stairs; + int metadata = 0, slabMeta = 5; + if (biome == BiomeGenBase.desert || biome == BiomeGenBase.desertHills) { + block = Blocks.sandstone; + stair = Blocks.sandstone_stairs; + metadata = 2; + } + for (int i = -1; i <= 1; i++) + for (int k = -1; k <= 1; k++) + world.setBlock(x + i, y, z + k, Blocks.air); + for (int i = -1; i <= 1; i++) + for (int k = -1; k <= 1; k++) + world.setBlock(x + i, y - 1, z + k, block, metadata, 2); + for (int i = -1; i <= 1; i++) + for (int k = -1; k <= 1; k++) + world.setBlock(x + i, y, z + k, stair); + for (int i = -1; i <= 1; i++) + for (int k = -1; k <= 1; k++) + world.setBlockMetadataWithNotify(x + i, y, z + k, (k == -1) ? 3 : (k == 0) ? (i == 1) ? 0 : 1 : 2, 2); + world.setBlock(x, y, z, Blocks.air); + ItemStack stack = new ItemStack(ItemList.bucket); + JewelryNBT.addMetal(stack, JewelrycraftUtil.metal.get(rand.nextInt(JewelrycraftUtil.metal.size()))); + try { + if (stack != null && JewelryNBT.ingot(stack) != null) { + if (!world.isRemote) world.func_147480_a(x, y, z, true); + if (world.isRemote) { + int color = ItemMoltenMetalBucket.color(stack, 1); + JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color)); + } + else{ + JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + rand.nextInt(16777216)); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), rand.nextInt(16777216))); + } + System.out.println(x + " " + y + " " + z); + world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3); + } + } catch (IOException e) { + e.printStackTrace(); + } + return true; + } + + @Override + public boolean generate(World world, Random rand, int x, int y, int z) { + return generate(world, BiomeGenBase.plains, rand, x, y, z); + } } diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java index 0533a1b..5518ef4 100644 --- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java @@ -5,14 +5,18 @@ package darkknight.jewelrycraft.worldGen; import java.io.IOException; import java.util.Random; + +import cpw.mods.fml.relauncher.Side; import darkknight.jewelrycraft.JewelrycraftMod; import darkknight.jewelrycraft.block.BlockList; import darkknight.jewelrycraft.item.ItemList; import darkknight.jewelrycraft.item.ItemMoltenMetalBucket; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; import darkknight.jewelrycraft.network.PacketSendLiquidData; import darkknight.jewelrycraft.util.JewelryNBT; import darkknight.jewelrycraft.util.JewelrycraftUtil; import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -26,74 +30,77 @@ import net.minecraftforge.common.DungeonHooks; /** * @author Sorin */ -public class WorldGenStructure5 extends WorldGenerator -{ - public boolean generate(World world, BiomeGenBase biome, Random rand, int x, int y, int z) - { - Block slab = Blocks.stone_slab; - Block stair = Blocks.stone_brick_stairs; - Block block = Blocks.stonebrick; - int metadata = 0, slabMeta = 5; - if (biome == BiomeGenBase.desert || biome == BiomeGenBase.desertHills){ - stair = Blocks.sandstone_stairs; - block = Blocks.sandstone; - metadata = 2; - slabMeta = 1; - } - for(int i = -2; i <= 2; i++) - for(int j = 0; j <= 3; j++) - for(int k = -3; k <= -1; k++) - world.setBlock(x + i, y + j, z + k, Blocks.air); - for(int i = -5; i <= -3; i++) - for(int k = -3; k <= 2; k++) - world.setBlock(x + i, y, z + k, Blocks.air); - for(int i = -2; i <= 2; i++) - for(int k = -3; k <= -1; k++) - world.setBlock(x + i, y, z + k, block, metadata, 1); - for(int i = 1; i <= 2; i++) - for(int k = -3; k <= -1; k++) - world.setBlock(x + i, y + 1, z + k, block, metadata, 1); - for(int i = -5; i <= -3; i++) - for(int k = -3; k <= 2; k++) - world.setBlock(x + i, y - 1, z + k, block, metadata, 1); - for(int i = -5; i <= -3; i++) - for(int k = -3; k <= 2; k++) - if ((i != -4 || k <= -3 || k >= 2) && !(i == -3 && k == -2)) world.setBlock(x + i, y, z + k, slab, slabMeta, 2); - world.setBlock(x - 3, y, z - 1, stair, 0, 2); - world.setBlock(x - 3, y, z - 3, stair, 0, 2); - world.setBlock(x - 2, y + 1, z - 3, slab, slabMeta, 2); - world.setBlock(x - 2, y + 1, z - 1, slab, slabMeta, 2); - world.setBlock(x - 1, y + 1, z - 3, slab, slabMeta, 2); - world.setBlock(x - 1, y + 1, z - 1, slab, slabMeta, 2); - world.setBlock(x, y + 1, z - 1, stair, 0, 2); - world.setBlock(x, y + 1, z - 3, stair, 0, 2); - world.setBlock(x + 1, y + 2, z - 3, slab, slabMeta, 2); - world.setBlock(x + 1, y + 2, z - 1, slab, slabMeta, 2); - for(int k = -3; k <= -1; k++) - world.setBlock(x + 2, y + 2, z + k, block, metadata, 1); - if (rand.nextInt(5) == 0){ - ItemStack stack = new ItemStack(ItemList.bucket); - JewelryNBT.addMetal(stack, new ItemStack(Items.gold_ingot)); - try{ - if (stack != null && JewelryNBT.ingot(stack) != null){ - if (!world.isRemote) world.func_147480_a(x, y, z, true); - int color = ItemMoltenMetalBucket.color(stack, 1); - JewelrycraftMod.saveData.setString((x + 1) + " " + (y + 2) + " " + (z - 2) + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color); - JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x + 1, y + 2, z - 2, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color)); - world.setBlock(x + 1, y + 2, z - 2, BlockList.moltenMetal, 0, 3); - } - } - catch(IOException e){ - e.printStackTrace(); - } - }else if (rand.nextBoolean()) world.setBlock(x + 1, y + 2, z - 2, Blocks.lava, 0, 3); - else world.setBlock(x + 1, y + 2, z - 2, Blocks.water, 0, 3); - return true; - } - - @Override - public boolean generate(World world, Random rand, int x, int y, int z) - { - return generate(world, BiomeGenBase.plains, rand, x, y, z); - } +public class WorldGenStructure5 extends WorldGenerator { + public boolean generate(World world, BiomeGenBase biome, Random rand, int x, int y, int z) { + Block slab = Blocks.stone_slab; + Block stair = Blocks.stone_brick_stairs; + Block block = Blocks.stonebrick; + int metadata = 0, slabMeta = 5; + if (biome == BiomeGenBase.desert || biome == BiomeGenBase.desertHills) { + stair = Blocks.sandstone_stairs; + block = Blocks.sandstone; + metadata = 2; + slabMeta = 1; + } + for (int i = -2; i <= 2; i++) + for (int j = 0; j <= 3; j++) + for (int k = -3; k <= -1; k++) + world.setBlock(x + i, y + j, z + k, Blocks.air); + for (int i = -5; i <= -3; i++) + for (int k = -3; k <= 2; k++) + world.setBlock(x + i, y, z + k, Blocks.air); + for (int i = -2; i <= 2; i++) + for (int k = -3; k <= -1; k++) + world.setBlock(x + i, y, z + k, block, metadata, 1); + for (int i = 1; i <= 2; i++) + for (int k = -3; k <= -1; k++) + world.setBlock(x + i, y + 1, z + k, block, metadata, 1); + for (int i = -5; i <= -3; i++) + for (int k = -3; k <= 2; k++) + world.setBlock(x + i, y - 1, z + k, block, metadata, 1); + for (int i = -5; i <= -3; i++) + for (int k = -3; k <= 2; k++) + if ((i != -4 || k <= -3 || k >= 2) && !(i == -3 && k == -2)) world.setBlock(x + i, y, z + k, slab, slabMeta, 2); + world.setBlock(x - 3, y, z - 1, stair, 0, 2); + world.setBlock(x - 3, y, z - 3, stair, 0, 2); + world.setBlock(x - 2, y + 1, z - 3, slab, slabMeta, 2); + world.setBlock(x - 2, y + 1, z - 1, slab, slabMeta, 2); + world.setBlock(x - 1, y + 1, z - 3, slab, slabMeta, 2); + world.setBlock(x - 1, y + 1, z - 1, slab, slabMeta, 2); + world.setBlock(x, y + 1, z - 1, stair, 0, 2); + world.setBlock(x, y + 1, z - 3, stair, 0, 2); + world.setBlock(x + 1, y + 2, z - 3, slab, slabMeta, 2); + world.setBlock(x + 1, y + 2, z - 1, slab, slabMeta, 2); + for (int k = -3; k <= -1; k++) + world.setBlock(x + 2, y + 2, z + k, block, metadata, 1); + if (rand.nextInt(5) == 0) { + ItemStack stack = new ItemStack(ItemList.bucket); + JewelryNBT.addMetal(stack, new ItemStack(Items.gold_ingot)); + try { + if (stack != null && JewelryNBT.ingot(stack) != null) { + if (!world.isRemote) world.func_147480_a(x, y, z, true); + if (world.isRemote) { + int color = ItemMoltenMetalBucket.color(stack, 1); + JewelrycraftMod.saveData.setString((x + 1) + " " + (y + 2) + " " + (z - 2) + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x + 1, y + 2, z - 2, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color)); + JewelrycraftMod.netWrapper.sendToServer(new PacketRequestLiquidData(Minecraft.getMinecraft().theWorld.provider.dimensionId, x + 1, y + 2, z - 2)); + } + else{ + JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + rand.nextInt(16777216)); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), rand.nextInt(16777216))); + } + world.setBlock(x + 1, y + 2, z - 2, BlockList.moltenMetal, 0, 3); + } + } catch (IOException e) { + e.printStackTrace(); + } + } else if (rand.nextBoolean()) world.setBlock(x + 1, y + 2, z - 2, Blocks.lava, 0, 3); + else world.setBlock(x + 1, y + 2, z - 2, Blocks.water, 0, 3); + return true; + } + + @Override + public boolean generate(World world, Random rand, int x, int y, int z) { + return generate(world, BiomeGenBase.plains, rand, x, y, z); + } } -- cgit v1.2.3