summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/worldGen
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-06-11 19:59:48 +0100
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-06-11 19:59:48 +0100
commit2f93a3de229a3351d91708cf60fbc9ab7a1be97f (patch)
treee5c60900d517d428e00946a7816ab67a75c0e3aa /src/main/java/darkknight/jewelrycraft/worldGen
parente66ce0d4678e288d981f734fa7fdec8f9642545e (diff)
Improved color detection system by 10000000%! (not rly, but it's better
than b4)
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/worldGen')
-rw-r--r--src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java23
-rw-r--r--src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java22
2 files changed, 11 insertions, 34 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java
index b7662bb..5f094e4 100644
--- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java
+++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure2.java
@@ -45,23 +45,12 @@ public class WorldGenStructure2 extends WorldGenerator {
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();
+ if (stack != null && JewelryNBT.ingot(stack) != null) {
+ if (!world.isRemote) world.func_147480_a(x, y, z, true);
+ JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage());
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage()));
+ System.out.println(x + " " + y + " " + z);
+ world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3);
}
return true;
}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java
index 5518ef4..77ce6c1 100644
--- a/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java
+++ b/src/main/java/darkknight/jewelrycraft/worldGen/WorldGenStructure5.java
@@ -76,23 +76,11 @@ public class WorldGenStructure5 extends WorldGenerator {
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();
+ if (stack != null && JewelryNBT.ingot(stack) != null) {
+ if (!world.isRemote) world.func_147480_a(x, y, z, true);
+ JewelrycraftMod.saveData.setString((x + 1) + " " + (y + 2) + " " + (z - 2) + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage());
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x + 1, y + 2, z - 2, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage()));
+ world.setBlock(x + 1, y + 2, z - 2, BlockList.moltenMetal, 0, 3);
}
} 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);