From 2db4ccd4c7891282b1af5561ca7ee2621af856c1 Mon Sep 17 00:00:00 2001 From: mDiyo Date: Tue, 27 Aug 2013 18:11:13 -0700 Subject: [PATCH] Various fixes involving projectiles and tool speed --- mods/tinker/textures/gui/extractor.png | Bin 0 -> 2066 bytes tconstruct/TConstruct.java | 2 +- tconstruct/blocks/SoilBlock.java | 9 +++ tconstruct/blocks/slime/SlimeGrass.java | 14 +++- tconstruct/blocks/slime/SlimeLeaves.java | 1 + tconstruct/client/gui/SmelteryGui.java | 27 ++++--- tconstruct/common/TContent.java | 50 ++++++------ tconstruct/entity/projectile/ArrowEntity.java | 9 ++- .../entity/projectile/RotatingBase.java | 7 +- tconstruct/items/tools/Dagger.java | 4 +- tconstruct/items/tools/Excavator.java | 16 +--- tconstruct/items/tools/Hammer.java | 21 ++--- tconstruct/library/tools/ToolCore.java | 2 +- tconstruct/worldgen/SlimeTreeGen.java | 75 +++++++++++------- 14 files changed, 138 insertions(+), 99 deletions(-) create mode 100644 mods/tinker/textures/gui/extractor.png diff --git a/mods/tinker/textures/gui/extractor.png b/mods/tinker/textures/gui/extractor.png new file mode 100644 index 0000000000000000000000000000000000000000..f571ac54c39251f96227a71b6a9e84484ee6fb52 GIT binary patch literal 2066 zcmcIkc~H|y8to*QghM%ZxWr&UhhddNP#A;|5#>-oltL7ch)Tc}!l9r8fge)JH5`jj zs1QL=38KIZARworW?+Db91>WDBSJC>7%=4EO7@34yS25o`{#C7UtiVtzSrHaUit}7 zm#s>AN&tYZZm!NJ0YJc81i+%zS&FLD(=7$#YopPF#srQZVm*v zU#tTMF<0F@j$kIR`Y1!AspjESI8x%~e8}he*usPtMT=vAS)9}wnix6ip@k^$=A$ch z9!0x7!;bjO7|g#VL`}cb?T%#siPTMbs9n;k{TpgNBXlspv?1Eq)J5qj-PQTx+3l6I z9i$iHv1i)MUfEItq447VMSc6(a%C-%26f&UV1PYFDkK8BV1-;PD4+Y~rnwtvv=C8X6AE6RL(Y zD!fYWTegzXq{S2f6o4Us?g*AGlIR1WK3`^9$HQ;)(8ThAw1R>H_jAQZ%Xcc!KWmis zq&VV(FI{^4a~-Z1Y~#kZ6f|38W@fHAbsmR$`oL2=X_ZtMjJC+n%F5DA@{X8zIeRY| z*!Ba~=;+;5Hc1g+A$z-n2Q{hN6^Muwd;L%vjn*`JMZ6=Zghu1CH{^+G0B0+$VfKsB zV_&e$&&arLpS^m#5WY`n!&$R8CMc3t3VDog zr6>73F}Qfa2T?2WW!0sP>O`*7I~>zRhk#10gz$s>&!Gd7-x=Pxr+7&q)TSSi+AN$3 zsTAcz53LACQr$6~rTdp@7#sHMm0L|z`Iz4bx2t$^2SAo8Gzx+;l{wnMPZD=uZdm;# zsa7WBDDH&$N_l6hhA+V37cW{Y9ph&GP!`Op82O5-^3EC=7AocouNaEPC#ahK;}cER z9e(Z`ILElNpX@a2f(cp6eX{A=v<^6t9^Fp zs671V%)Su&_+@&1(v&Ta+^ASrO)M%ZvO{|0cD3uKsrLi%go_|PKuTS;9Kyr{T&<^h z%vOg5(X=xLVj_vRP=Fo^u8UHYFhrJQprVa1in36K()TZIfHIc-B1eRREYU<($w&FR zuwEifrO35P5+se%<;IdD_uI2;+TE8?P!yUdw|mJATQ1DONo4XbABLq9ly7F%U4h#3jaS31Sbb7IWgYo}JgEEJjFX|E+?|UgOBqaD%6#Ox!(LLxL%!!d>KAD&&cq?|4sLq+p#UqGdd(6gqdu8kc!UkuK z`Od3GX5i>WNT0NksdcnlpAOwlD+KVd z2Cb`yZ=r~epcX^=2AndLtbra`tIU>{0(3ehNN5+4V&D+EmCAY5cao2rr3>S6u*x3& zOML-BeKc|wp?75gVF=tK*JKS%k%>D)c;qtQDvnZen7w21r~`EVoWoxle&`)y!UD3{ z)R9=&k-a>ebXTY?;>kaCYcd}p_w3!0HH8<0Kwe!sFN<)`PzjCYD;D8%e&Rnn+X+fsS4=WV?^{0)PR;Y|l={p~4PM~!@aeew9Raq7X` zr;$Z_TJ|d<|S-{dIX4zR>`LOq?HLk2YX^* z7i?>rRu6~(Ab}d_tk;zipq4nn9O2cMFVXd9_g)+NKGq=oBSQeDN0lz!%qH@V zJJDp>L_VLduFi_{-F-XC%?g^=&P~m>;eC2uZj|frPilW4|3@*zl*VQeR~N%;yW6+T z4ye1*(re0%-ro(`bm>CHE dU(FUF!zf)M`@VVnwqvt~+YwLaYA4dozXR~Ug|h$v literal 0 HcmV?d00001 diff --git a/tconstruct/TConstruct.java b/tconstruct/TConstruct.java index 0e69f260..8640640d 100644 --- a/tconstruct/TConstruct.java +++ b/tconstruct/TConstruct.java @@ -45,7 +45,7 @@ import cpw.mods.fml.relauncher.Side; * @dependencies: IC2 API, MFR API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.dev.30.2", dependencies = "required-after:Forge@[7.7.1.687,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.3", dependencies = "required-after:Forge@[7.7.1.687,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class) public class TConstruct { diff --git a/tconstruct/blocks/SoilBlock.java b/tconstruct/blocks/SoilBlock.java index 2b38c8fa..c5b21efa 100644 --- a/tconstruct/blocks/SoilBlock.java +++ b/tconstruct/blocks/SoilBlock.java @@ -1,5 +1,6 @@ package tconstruct.blocks; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -37,6 +38,14 @@ public class SoilBlock extends TConstructBlock } } } + + public float getBlockHardness(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 5) + return Block.dirt.blockHardness; + return this.blockHardness; + } /*public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { diff --git a/tconstruct/blocks/slime/SlimeGrass.java b/tconstruct/blocks/slime/SlimeGrass.java index f491b031..c5f463ac 100644 --- a/tconstruct/blocks/slime/SlimeGrass.java +++ b/tconstruct/blocks/slime/SlimeGrass.java @@ -34,7 +34,11 @@ public class SlimeGrass extends Block @Override public int damageDropped (int meta) { - return meta; + if (meta == 1) //dirt + return 0; + + else //slime dirt + return 5; } @Override @@ -124,4 +128,12 @@ public class SlimeGrass extends Block } } } + + public int idDropped(int metadata, Random random, int fortune) + { + if (metadata == 1) + return TContent.craftedSoil.blockID; + else + return Block.dirt.blockID; + } } diff --git a/tconstruct/blocks/slime/SlimeLeaves.java b/tconstruct/blocks/slime/SlimeLeaves.java index 4ad70295..3dd094a9 100644 --- a/tconstruct/blocks/slime/SlimeLeaves.java +++ b/tconstruct/blocks/slime/SlimeLeaves.java @@ -29,6 +29,7 @@ public class SlimeLeaves extends BlockLeaves super(id); setCreativeTab(TConstructRegistry.blockTab); setLightOpacity(1); + this.setHardness(0.3f); } @SideOnly(Side.CLIENT) diff --git a/tconstruct/client/gui/SmelteryGui.java b/tconstruct/client/gui/SmelteryGui.java index c9471bcd..64b32eaa 100644 --- a/tconstruct/client/gui/SmelteryGui.java +++ b/tconstruct/client/gui/SmelteryGui.java @@ -145,7 +145,7 @@ public class SmelteryGui extends NewContainerGui } } } - + private static final ResourceLocation background = new ResourceLocation("tinker", "textures/gui/smeltery.png"); private static final ResourceLocation backgroundSide = new ResourceLocation("tinker", "textures/gui/smelteryside.png"); private static final ResourceLocation terrain = new ResourceLocation("terrain.png"); @@ -184,18 +184,21 @@ public class SmelteryGui extends NewContainerGui { int total = logic.getTotalLiquid(); int liquidLayers = (total / 20000 + 1) * 20000; - int liquidSize = liquid.amount * 52 / liquidLayers; - if (liquidSize == 0) - liquidSize = 1; - while (liquidSize > 0) + if (liquidLayers != 0) { - int size = liquidSize >= 16 ? 16 : liquidSize; - drawLiquidRect(cornerX + basePos, (cornerY + 68) - size - base, renderIndex, 16, size); - drawLiquidRect(cornerX + basePos + 16, (cornerY + 68) - size - base, renderIndex, 16, size); - drawLiquidRect(cornerX + basePos + 32, (cornerY + 68) - size - base, renderIndex, 16, size); - drawLiquidRect(cornerX + basePos + 48, (cornerY + 68) - size - base, renderIndex, 4, size); - liquidSize -= size; - base += size; + int liquidSize = liquid.amount * 52 / liquidLayers; + if (liquidSize == 0) + liquidSize = 1; + while (liquidSize > 0) + { + int size = liquidSize >= 16 ? 16 : liquidSize; + drawLiquidRect(cornerX + basePos, (cornerY + 68) - size - base, renderIndex, 16, size); + drawLiquidRect(cornerX + basePos + 16, (cornerY + 68) - size - base, renderIndex, 16, size); + drawLiquidRect(cornerX + basePos + 32, (cornerY + 68) - size - base, renderIndex, 16, size); + drawLiquidRect(cornerX + basePos + 48, (cornerY + 68) - size - base, renderIndex, 4, size); + liquidSize -= size; + base += size; + } } } } diff --git a/tconstruct/common/TContent.java b/tconstruct/common/TContent.java index f7610d36..173aad2f 100644 --- a/tconstruct/common/TContent.java +++ b/tconstruct/common/TContent.java @@ -461,7 +461,7 @@ public class TContent implements IFuelHandler moltenIronFluid.setBlockID(moltenIron).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[0] = moltenIronFluid; fluidBlocks[0] = moltenIron; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenIronFluid, 1), new ItemStack(buckets, 1, 0), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenIronFluid, 1000), new ItemStack(buckets, 1, 0), new ItemStack(Item.bucketEmpty))); moltenGoldFluid = new Fluid("Molten Gold"); FluidRegistry.registerFluid(moltenGoldFluid); @@ -470,7 +470,7 @@ public class TContent implements IFuelHandler moltenGoldFluid.setBlockID(moltenGold).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[1] = moltenGoldFluid; fluidBlocks[1] = moltenGold; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenGoldFluid, 1), new ItemStack(buckets, 1, 1), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenGoldFluid, 1000), new ItemStack(buckets, 1, 1), new ItemStack(Item.bucketEmpty))); moltenCopperFluid = new Fluid("Molten Copper"); FluidRegistry.registerFluid(moltenCopperFluid); @@ -479,7 +479,7 @@ public class TContent implements IFuelHandler moltenCopperFluid.setBlockID(moltenCopper).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[2] = moltenCopperFluid; fluidBlocks[2] = moltenCopper; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenCopperFluid, 1), new ItemStack(buckets, 1, 2), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenCopperFluid, 1000), new ItemStack(buckets, 1, 2), new ItemStack(Item.bucketEmpty))); moltenTinFluid = new Fluid("Molten Tin"); FluidRegistry.registerFluid(moltenTinFluid); @@ -488,7 +488,7 @@ public class TContent implements IFuelHandler moltenTinFluid.setBlockID(moltenTin).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[3] = moltenTinFluid; fluidBlocks[3] = moltenTin; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenTinFluid, 1), new ItemStack(buckets, 1, 3), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenTinFluid, 1000), new ItemStack(buckets, 1, 3), new ItemStack(Item.bucketEmpty))); moltenAluminumFluid = new Fluid("Molten Aluminum"); FluidRegistry.registerFluid(moltenAluminumFluid); @@ -497,7 +497,7 @@ public class TContent implements IFuelHandler moltenAluminumFluid.setBlockID(moltenAluminum).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[4] = moltenAluminumFluid; fluidBlocks[4] = moltenAluminum; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAluminumFluid, 1), new ItemStack(buckets, 1, 4), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAluminumFluid, 1000), new ItemStack(buckets, 1, 4), new ItemStack(Item.bucketEmpty))); moltenCobaltFluid = new Fluid("Molten Cobalt"); FluidRegistry.registerFluid(moltenCobaltFluid); @@ -506,7 +506,7 @@ public class TContent implements IFuelHandler moltenCobaltFluid.setBlockID(moltenCobalt).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[5] = moltenCobaltFluid; fluidBlocks[5] = moltenCobalt; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenCobaltFluid, 1), new ItemStack(buckets, 1, 5), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenCobaltFluid, 1000), new ItemStack(buckets, 1, 5), new ItemStack(Item.bucketEmpty))); moltenArditeFluid = new Fluid("Molten Ardite"); FluidRegistry.registerFluid(moltenArditeFluid); @@ -515,7 +515,7 @@ public class TContent implements IFuelHandler moltenArditeFluid.setBlockID(moltenArdite).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[6] = moltenArditeFluid; fluidBlocks[6] = moltenArdite; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenArditeFluid, 1), new ItemStack(buckets, 1, 6), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenArditeFluid, 1000), new ItemStack(buckets, 1, 6), new ItemStack(Item.bucketEmpty))); moltenBronzeFluid = new Fluid("Molten Bronze"); FluidRegistry.registerFluid(moltenBronzeFluid); @@ -524,7 +524,7 @@ public class TContent implements IFuelHandler moltenBronzeFluid.setBlockID(moltenBronze).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[7] = moltenBronzeFluid; fluidBlocks[7] = moltenBronze; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenBronzeFluid, 1), new ItemStack(buckets, 1, 7), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenBronzeFluid, 1000), new ItemStack(buckets, 1, 7), new ItemStack(Item.bucketEmpty))); moltenAlubrassFluid = new Fluid("Molten Aluminum Brass"); FluidRegistry.registerFluid(moltenAlubrassFluid); @@ -533,7 +533,7 @@ public class TContent implements IFuelHandler moltenAlubrassFluid.setBlockID(moltenAlubrass).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[8] = moltenAlubrassFluid; fluidBlocks[8] = moltenAlubrass; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAlubrassFluid, 1), new ItemStack(buckets, 1, 8), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAlubrassFluid, 1000), new ItemStack(buckets, 1, 8), new ItemStack(Item.bucketEmpty))); moltenManyullynFluid = new Fluid("Molten Manyullyn"); FluidRegistry.registerFluid(moltenManyullynFluid); @@ -542,7 +542,7 @@ public class TContent implements IFuelHandler moltenManyullynFluid.setBlockID(moltenManyullyn).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[9] = moltenManyullynFluid; fluidBlocks[9] = moltenManyullyn; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenManyullynFluid, 1), new ItemStack(buckets, 1, 9), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenManyullynFluid, 1000), new ItemStack(buckets, 1, 9), new ItemStack(Item.bucketEmpty))); moltenAlumiteFluid = new Fluid("Molten Alumite"); FluidRegistry.registerFluid(moltenAlumiteFluid); @@ -551,7 +551,7 @@ public class TContent implements IFuelHandler moltenAlumiteFluid.setBlockID(moltenAlumite).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[10] = moltenAlumiteFluid; fluidBlocks[10] = moltenAlumite; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAlumiteFluid, 1), new ItemStack(buckets, 1, 10), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAlumiteFluid, 1000), new ItemStack(buckets, 1, 10), new ItemStack(Item.bucketEmpty))); moltenObsidianFluid = new Fluid("Molten Obsidian"); FluidRegistry.registerFluid(moltenObsidianFluid); @@ -560,7 +560,7 @@ public class TContent implements IFuelHandler moltenObsidianFluid.setBlockID(moltenObsidian).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[11] = moltenObsidianFluid; fluidBlocks[11] = moltenObsidian; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenObsidianFluid, 1), new ItemStack(buckets, 1, 11), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenObsidianFluid, 1000), new ItemStack(buckets, 1, 11), new ItemStack(Item.bucketEmpty))); moltenSteelFluid = new Fluid("Molten Steel"); FluidRegistry.registerFluid(moltenSteelFluid); @@ -569,7 +569,7 @@ public class TContent implements IFuelHandler moltenSteelFluid.setBlockID(moltenSteel).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[12] = moltenSteelFluid; fluidBlocks[12] = moltenSteel; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSteelFluid, 1), new ItemStack(buckets, 1, 12), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSteelFluid, 1000), new ItemStack(buckets, 1, 12), new ItemStack(Item.bucketEmpty))); moltenGlassFluid = new Fluid("Molten Glass"); FluidRegistry.registerFluid(moltenGlassFluid); @@ -578,7 +578,7 @@ public class TContent implements IFuelHandler moltenGlassFluid.setBlockID(moltenGlass).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[13] = moltenGlassFluid; fluidBlocks[13] = moltenGlass; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenGlassFluid, 1), new ItemStack(buckets, 1, 13), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenGlassFluid, 1000), new ItemStack(buckets, 1, 13), new ItemStack(Item.bucketEmpty))); moltenStoneFluid = new Fluid("Seared Stone"); FluidRegistry.registerFluid(moltenStoneFluid); @@ -587,7 +587,7 @@ public class TContent implements IFuelHandler moltenStoneFluid.setBlockID(moltenStone).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[14] = moltenStoneFluid; fluidBlocks[14] = moltenStone; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenStoneFluid, 1), new ItemStack(buckets, 1, 14), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenStoneFluid, 1000), new ItemStack(buckets, 1, 14), new ItemStack(Item.bucketEmpty))); moltenEmeraldFluid = new Fluid("Liquified Emerald"); FluidRegistry.registerFluid(moltenEmeraldFluid); @@ -596,7 +596,7 @@ public class TContent implements IFuelHandler moltenEmeraldFluid.setBlockID(moltenEmerald).setDensity(3000).setViscosity(6000); fluids[15] = moltenEmeraldFluid; fluidBlocks[15] = moltenEmerald; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenEmeraldFluid, 1), new ItemStack(buckets, 1, 15), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenEmeraldFluid, 1000), new ItemStack(buckets, 1, 15), new ItemStack(Item.bucketEmpty))); bloodFluid = new Fluid("Blood"); FluidRegistry.registerFluid(bloodFluid); @@ -605,7 +605,7 @@ public class TContent implements IFuelHandler bloodFluid.setBlockID(blood).setDensity(3000).setViscosity(6000); fluids[16] = bloodFluid; fluidBlocks[16] = blood; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(bloodFluid, 1), new ItemStack(buckets, 1, 16), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(bloodFluid, 1000), new ItemStack(buckets, 1, 16), new ItemStack(Item.bucketEmpty))); moltenNickelFluid = new Fluid("nickel.molten"); FluidRegistry.registerFluid(moltenNickelFluid); @@ -614,7 +614,7 @@ public class TContent implements IFuelHandler moltenNickelFluid.setBlockID(moltenNickel).setDensity(3000).setViscosity(6000); fluids[17] = moltenNickelFluid; fluidBlocks[17] = moltenNickel; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenNickelFluid, 1), new ItemStack(buckets, 1, 17), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenNickelFluid, 1000), new ItemStack(buckets, 1, 17), new ItemStack(Item.bucketEmpty))); moltenLeadFluid = new Fluid("lead.molten"); FluidRegistry.registerFluid(moltenLeadFluid); @@ -623,7 +623,7 @@ public class TContent implements IFuelHandler moltenLeadFluid.setBlockID(moltenLead).setDensity(3000).setViscosity(6000); fluids[18] = moltenLeadFluid; fluidBlocks[18] = moltenLead; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenLeadFluid, 1), new ItemStack(buckets, 1, 18), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenLeadFluid, 1000), new ItemStack(buckets, 1, 18), new ItemStack(Item.bucketEmpty))); moltenSilverFluid = new Fluid("silver.molten"); FluidRegistry.registerFluid(moltenSilverFluid); @@ -632,7 +632,7 @@ public class TContent implements IFuelHandler moltenSilverFluid.setBlockID(moltenSilver).setDensity(3000).setViscosity(6000); fluids[19] = moltenSilverFluid; fluidBlocks[19] = moltenSilver; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSilverFluid, 1), new ItemStack(buckets, 1, 19), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSilverFluid, 1000), new ItemStack(buckets, 1, 19), new ItemStack(Item.bucketEmpty))); moltenShinyFluid = new Fluid("platinum.molten"); FluidRegistry.registerFluid(moltenShinyFluid); @@ -641,7 +641,7 @@ public class TContent implements IFuelHandler moltenShinyFluid.setBlockID(moltenShiny).setDensity(3000).setViscosity(6000); fluids[20] = moltenLeadFluid; fluidBlocks[20] = moltenShiny; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenShinyFluid, 1), new ItemStack(buckets, 1, 20), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenShinyFluid, 1000), new ItemStack(buckets, 1, 20), new ItemStack(Item.bucketEmpty))); moltenInvarFluid = new Fluid("invar.molten"); FluidRegistry.registerFluid(moltenInvarFluid); @@ -650,7 +650,7 @@ public class TContent implements IFuelHandler moltenInvarFluid.setBlockID(moltenInvar).setDensity(3000).setViscosity(6000); fluids[21] = moltenInvarFluid; fluidBlocks[21] = moltenInvar; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenInvarFluid, 1), new ItemStack(buckets, 1, 21), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenInvarFluid, 1000), new ItemStack(buckets, 1, 21), new ItemStack(Item.bucketEmpty))); moltenElectrumFluid = new Fluid("electrum.molten"); FluidRegistry.registerFluid(moltenElectrumFluid); @@ -659,7 +659,7 @@ public class TContent implements IFuelHandler moltenElectrumFluid.setBlockID(moltenElectrum).setDensity(3000).setViscosity(6000); fluids[22] = moltenElectrumFluid; fluidBlocks[22] = moltenElectrum; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenElectrumFluid, 1), new ItemStack(buckets, 1, 22), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenElectrumFluid, 1000), new ItemStack(buckets, 1, 22), new ItemStack(Item.bucketEmpty))); moltenEnderFluid = new Fluid("ender"); FluidRegistry.registerFluid(moltenEnderFluid); @@ -668,7 +668,7 @@ public class TContent implements IFuelHandler moltenEnderFluid.setBlockID(moltenEnder).setDensity(3000).setViscosity(6000); fluids[23] = moltenEnderFluid; fluidBlocks[23] = moltenEnder; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenEnderFluid, 1), new ItemStack(buckets, 1, 23), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenEnderFluid, 1000), new ItemStack(buckets, 1, 23), new ItemStack(Item.bucketEmpty))); //Slime slimeStep = new StepSoundSlime("mob.slime", 1.0f, 1.0f); @@ -680,7 +680,7 @@ public class TContent implements IFuelHandler blueSlimeFluid.setBlockID(slimePool); fluids[24] = blueSlimeFluid; fluidBlocks[24] = slimePool; - FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(blueSlimeFluid, 1), new ItemStack(buckets, 1, 24), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(blueSlimeFluid, 1000), new ItemStack(buckets, 1, 24), new ItemStack(Item.bucketEmpty))); slimeGel = new SlimeGel(PHConstruct.slimeGel).setStepSound(slimeStep).setUnlocalizedName("slime.gel"); GameRegistry.registerBlock(slimeGel, SlimeGelItemBlock.class, "slime.gel"); diff --git a/tconstruct/entity/projectile/ArrowEntity.java b/tconstruct/entity/projectile/ArrowEntity.java index fbf9c98f..1f72ffaa 100644 --- a/tconstruct/entity/projectile/ArrowEntity.java +++ b/tconstruct/entity/projectile/ArrowEntity.java @@ -75,6 +75,11 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa public void onUpdate () { this.onEntityUpdate(); + if (returnStack == null || returnStack.stackSize < 1) + { + this.setDead(); + } + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); @@ -265,13 +270,13 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (movingobjectposition.entityHit instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) movingobjectposition.entityHit; - if (player.inventory.addItemStackToInventory(returnStack)) + if (canBePickedUp == 2 || player.inventory.addItemStackToInventory(returnStack)) this.setDead(); } else if (movingobjectposition.entityHit instanceof EntityLivingBase) { EntityLivingBase living = (EntityLivingBase) movingobjectposition.entityHit; - if (addItemStackToInventory(returnStack, living)) + if (canBePickedUp == 2 || addItemStackToInventory(returnStack, living)) this.setDead(); } } diff --git a/tconstruct/entity/projectile/RotatingBase.java b/tconstruct/entity/projectile/RotatingBase.java index deeac382..af58b17f 100644 --- a/tconstruct/entity/projectile/RotatingBase.java +++ b/tconstruct/entity/projectile/RotatingBase.java @@ -4,7 +4,6 @@ import java.util.List; import tconstruct.library.tools.AbilityHelper; - import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -342,6 +341,7 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData tags.setByte("inTile", (byte) inTile); tags.setByte("shake", (byte) arrowShake); tags.setByte("onGround", (byte) (onGround ? 1 : 0)); + tags.setBoolean("Retrieval", doNotRetrieve); } public void readEntityFromNBT (NBTTagCompound tags) @@ -355,6 +355,7 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData inTile = tags.getByte("inTile") & 0xff; arrowShake = tags.getByte("shake") & 0xff; onGround = tags.getByte("onGround") == 1; + doNotRetrieve = tags.getBoolean("Retrieval"); } public void onCollideWithPlayer (EntityPlayer entityplayer) @@ -374,7 +375,8 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData { return; } - AbilityHelper.addToInv(entityplayer, returnStack, true); + if (!doNotRetrieve) + AbilityHelper.addToInv(entityplayer, returnStack, true); worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); entityplayer.onItemPickup(this, 1); kill(); @@ -412,6 +414,7 @@ public class RotatingBase extends Entity implements IEntityAdditionalSpawnData public EntityPlayer owner; protected int ticksInGround; protected int ticksInAir; + public boolean doNotRetrieve; @Override public void writeSpawnData (ByteArrayDataOutput data) diff --git a/tconstruct/items/tools/Dagger.java b/tconstruct/items/tools/Dagger.java index 04f032ec..960d344c 100644 --- a/tconstruct/items/tools/Dagger.java +++ b/tconstruct/items/tools/Dagger.java @@ -23,12 +23,12 @@ public class Dagger extends Weapon if (!world.isRemote) { DaggerEntity dagger = new DaggerEntity(stack, world, player); + if (player.capabilities.isCreativeMode) + dagger.doNotRetrieve = true; world.spawnEntityInWorld(dagger); } itemstack.stackSize--; return itemstack; - /*player.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); - return itemstack;*/ } public ItemStack onEaten (ItemStack itemstack, World world, EntityPlayer player) diff --git a/tconstruct/items/tools/Excavator.java b/tconstruct/items/tools/Excavator.java index 480f95a4..34c09e06 100644 --- a/tconstruct/items/tools/Excavator.java +++ b/tconstruct/items/tools/Excavator.java @@ -273,7 +273,7 @@ public class Excavator extends HarvestTool int durability = tags.getInteger("Damage"); float stonebound = tags.getFloat("Shoddy"); - float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound; + float bonusLog = (float) Math.log(durability / 216f + 1) * 2 * stonebound; trueSpeed += bonusLog; if (hlvl <= tags.getInteger("HarvestLevel")) @@ -283,18 +283,4 @@ public class Excavator extends HarvestTool } return super.getStrVsBlock(stack, block, meta); } - /*@Override - public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) - { - super.onUpdate(stack, world, entity, par4, par5); - if (entity instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) entity; - ItemStack equipped = player.getCurrentEquippedItem(); - if (equipped == stack) - { - player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 1, 1)); - } - } - }*/ } diff --git a/tconstruct/items/tools/Hammer.java b/tconstruct/items/tools/Hammer.java index 75145590..6fb034a5 100644 --- a/tconstruct/items/tools/Hammer.java +++ b/tconstruct/items/tools/Hammer.java @@ -211,7 +211,7 @@ public class Hammer extends HarvestTool World world = player.worldObj; final int blockID = world.getBlockId(x, y, z); final int meta = world.getBlockMetadata(x, y, z); - Block block = Block.blocksList[blockID]; + final Block block = Block.blocksList[blockID]; if (!stack.hasTagCompound()) return false; @@ -229,6 +229,9 @@ public class Hammer extends HarvestTool break; } } + + if (block == Block.silverfish) + validStart = true; MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, player, true, 5.0D); if (mop == null || !validStart) @@ -262,10 +265,10 @@ public class Hammer extends HarvestTool if (!(tags.getBoolean("Broken"))) { int localblockID = world.getBlockId(xPos, yPos, zPos); - block = Block.blocksList[localblockID]; + Block localBlock = Block.blocksList[localblockID]; int localMeta = world.getBlockMetadata(xPos, yPos, zPos); - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - float localHardness = block == null ? Float.MAX_VALUE : block.getBlockHardness(world, xPos, yPos, zPos); + int hlvl = MinecraftForge.getBlockHarvestLevel(localBlock, meta, getHarvestType()); + float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos); if (hlvl <= tags.getInteger("HarvestLevel") && localHardness - 1.5 <= blockHardness) { @@ -278,16 +281,16 @@ public class Hammer extends HarvestTool if (!cancelHarvest) { - if (block != null && !(localHardness < 0)) + if (localBlock != null && !(localHardness < 0)) { for (int iter = 0; iter < materials.length; iter++) { - if (materials[iter] == block.blockMaterial) + if (materials[iter] == localBlock.blockMaterial) { if (!player.capabilities.isCreativeMode) { - block.harvestBlock(world, player, xPos, yPos, zPos, localMeta); - block.onBlockHarvested(world, x, y, z, localMeta, player); + localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta); + localBlock.onBlockHarvested(world, x, y, z, localMeta, player); if (blockHardness > 0f) onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player); } @@ -345,7 +348,7 @@ public class Hammer extends HarvestTool int durability = tags.getInteger("Damage"); float stonebound = tags.getFloat("Shoddy"); - float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound; + float bonusLog = (float) Math.log(durability / 216f + 1) * 2 * stonebound; trueSpeed += bonusLog; if (hlvl <= tags.getInteger("HarvestLevel")) diff --git a/tconstruct/library/tools/ToolCore.java b/tconstruct/library/tools/ToolCore.java index 2e01b093..7fd16cd4 100644 --- a/tconstruct/library/tools/ToolCore.java +++ b/tconstruct/library/tools/ToolCore.java @@ -820,7 +820,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox public int discharge (ItemStack stack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate) { NBTTagCompound tags = stack.getTagCompound(); - if (!tags.hasKey("charge")) + if (tags == null || !tags.hasKey("charge")) return 0; if (amount > 0) diff --git a/tconstruct/worldgen/SlimeTreeGen.java b/tconstruct/worldgen/SlimeTreeGen.java index ac2b1923..c2fc4b1e 100644 --- a/tconstruct/worldgen/SlimeTreeGen.java +++ b/tconstruct/worldgen/SlimeTreeGen.java @@ -15,10 +15,12 @@ public class SlimeTreeGen extends WorldGenerator public final int metaWood; public final int metaLeaves; public final boolean seekHeight; + public final boolean notify; public SlimeTreeGen(boolean notify, int treeHeight, int treeRange, int woodMeta, int leavesMeta) { super(notify); + this.notify = notify; this.minTreeHeight = treeHeight; this.treeHeightRange = treeRange; this.metaWood = woodMeta; @@ -105,36 +107,36 @@ public class SlimeTreeGen extends WorldGenerator placeDiamondLayer(world, xPos, yPos + height - i, zPos, i + 1); } - this.setBlockAndMetadata(world, xPos+4, yPos + height - 3, zPos, 0, 0); - this.setBlockAndMetadata(world, xPos-4, yPos + height - 3, zPos, 0, 0); - this.setBlockAndMetadata(world, xPos, yPos + height - 3, zPos+4, 0, 0); - this.setBlockAndMetadata(world, xPos, yPos + height - 3, zPos-4, 0, 0); - this.setBlockAndMetadata(world, xPos+1, yPos + height - 3, zPos+1, 0, 0); - this.setBlockAndMetadata(world, xPos+1, yPos + height - 3, zPos-1, 0, 0); - this.setBlockAndMetadata(world, xPos-1, yPos + height - 3, zPos+1, 0, 0); - this.setBlockAndMetadata(world, xPos-1, yPos + height - 3, zPos-1, 0, 0); - + this.setBlockAndMetadata(world, xPos + 4, yPos + height - 3, zPos, 0, 0); + this.setBlockAndMetadata(world, xPos - 4, yPos + height - 3, zPos, 0, 0); + this.setBlockAndMetadata(world, xPos, yPos + height - 3, zPos + 4, 0, 0); + this.setBlockAndMetadata(world, xPos, yPos + height - 3, zPos - 4, 0, 0); + this.setBlockAndMetadata(world, xPos + 1, yPos + height - 3, zPos + 1, 0, 0); + this.setBlockAndMetadata(world, xPos + 1, yPos + height - 3, zPos - 1, 0, 0); + this.setBlockAndMetadata(world, xPos - 1, yPos + height - 3, zPos + 1, 0, 0); + this.setBlockAndMetadata(world, xPos - 1, yPos + height - 3, zPos - 1, 0, 0); + //Drippers - this.setBlockAndMetadata(world, xPos+3, yPos + height - 4, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos-3, yPos + height - 4, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos-3, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos+3, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos+2, yPos + height - 4, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos+2, yPos + height - 4, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos-2, yPos + height - 4, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos-2, yPos + height - 4, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); - - this.setBlockAndMetadata(world, xPos+3, yPos + height - 5, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos-3, yPos + height - 5, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos-3, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos+3, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos+2, yPos + height - 5, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos+2, yPos + height - 5, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos-2, yPos + height - 5, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); - this.setBlockAndMetadata(world, xPos-2, yPos + height - 5, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos + 3, yPos + height - 4, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos - 3, yPos + height - 4, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos - 3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos + 3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos + 2, yPos + height - 4, zPos + 2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos + 2, yPos + height - 4, zPos - 2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos - 2, yPos + height - 4, zPos + 2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos - 2, yPos + height - 4, zPos - 2, TContent.slimeLeaves.blockID, this.metaLeaves); + + this.setBlockAndMetadata(world, xPos + 3, yPos + height - 5, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos - 3, yPos + height - 5, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos - 3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos + 3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos + 2, yPos + height - 5, zPos + 2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos + 2, yPos + height - 5, zPos - 2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos - 2, yPos + height - 5, zPos + 2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos - 2, yPos + height - 5, zPos - 2, TContent.slimeLeaves.blockID, this.metaLeaves); } - - void placeDiamondLayer(World world, int xPos, int yPos, int zPos, int range ) + + void placeDiamondLayer (World world, int xPos, int yPos, int zPos, int range) { for (int x = -range; x <= range; x++) { @@ -142,7 +144,7 @@ public class SlimeTreeGen extends WorldGenerator { if (Math.abs(x) + Math.abs(z) <= range) { - this.setBlockAndMetadata(world, x+xPos, yPos, z+zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, x + xPos, yPos, z + zPos, TContent.slimeLeaves.blockID, this.metaLeaves); } } } @@ -163,4 +165,19 @@ public class SlimeTreeGen extends WorldGenerator } } + protected void setBlockAndMetadata (World world, int x, int y, int z, int blockID, int blockMeta) + { + Block block = Block.blocksList[world.getBlockId(x, y, z)]; + if (block == null || block.isBlockReplaceable(world, x, y, z)) + { + if (this.notify) + { + world.setBlock(x, y, z, blockID, blockMeta, 3); + } + else + { + world.setBlock(x, y, z, blockID, blockMeta, 2); + } + } + } }