From 9285a2ffdc9729f7b3c6917e44fdc68fc2d253c9 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 27 May 2018 12:48:44 +1000 Subject: + Added a custom ItemEntity for the Large Chicken Eggs, they now hatch in world. + Added a custom Mutagen Fluid used in making Large Eggs. $ Fixed some issue with BlockPos object having invalid worlds. --- .../api/objects/minecraft/ChunkManager.java | 2 +- .../core/entity/item/ItemEntityGiantEgg.java | 109 +++++++++++++++++++++ .../core/item/chemistry/NuclearChem.java | 51 +++++++++- .../core/item/general/ItemAreaClear.java | 12 +-- .../gtPlusPlus/core/item/general/ItemGiantEgg.java | 53 +++++++++- .../item/general/capture/ItemEntityCatcher.java | 2 +- .../core/item/tool/misc/ConnectedBlockFinder.java | 2 +- .../core/util/minecraft/EntityUtils.java | 2 +- .../transformers/Preloader_ClassTransformer2.java | 4 +- .../gregtech/common/helpers/TreeFarmHelper.java | 26 ++--- .../gregtech/common/render/GTPP_CapeRenderer.java | 2 +- .../basic/GregtechMetaWirelessCharger.java | 2 +- 12 files changed, 235 insertions(+), 32 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java (limited to 'src') diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/ChunkManager.java b/src/Java/gtPlusPlus/api/objects/minecraft/ChunkManager.java index 77839b9ff2..b0975dcca7 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/ChunkManager.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/ChunkManager.java @@ -308,7 +308,7 @@ public class ChunkManager implements LoadingCallback, OrderedLoadingCallback, Fo int z = ticket.getModData().getInteger("zCoord"); if (y >= 0) { - BlockPos tile = new BlockPos(x, y, z); + BlockPos tile = new BlockPos(x, y, z, world); Ticket H = tryForceLoadChunk(new DimChunkPos(world, tile).getChunk()); int jhg = 0; diff --git a/src/Java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java b/src/Java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java new file mode 100644 index 0000000000..c6ba9ff224 --- /dev/null +++ b/src/Java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java @@ -0,0 +1,109 @@ +package gtPlusPlus.core.entity.item; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.NBTUtils; + +public class ItemEntityGiantEgg extends EntityItem { + + /** + * The maximum age of this Chicken Egg. The item will try hatch once this is reached. + */ + public int mEggAge = 10000; + public int mEggSize = -1; + + public ItemEntityGiantEgg(World aWorld) { + super(aWorld); + } + + public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ) { + super(aWorld, aX, aY, aZ); + } + + public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ, ItemStack aStack) { + super(aWorld, aX, aY, aZ, aStack); + } + + + //Large eggs don't despawn, because they will try hatch first. + @Override + public void onUpdate() { + if (this.lifespan != Integer.MAX_VALUE) { + this.lifespan = Integer.MAX_VALUE; + } + + if (this.getEntityItem() != null) { + ItemStack g = this.getEntityItem(); + NBTUtils.setInteger(g, "mTicksExisted", this.age); + this.setEntityItemStack(g); + Logger.INFO("Writing age to NBT of stored stack item."); + } + else { + ItemStack g = ItemUtils.getSimpleStack(ModItems.itemBigEgg); + NBTUtils.setInteger(g, "mTicksExisted", this.age); + this.setEntityItemStack(g); + Logger.INFO("Writing age to NBT of new stack item."); + + } + + if (this.age >= 1000) { + //Cache the value for efficiency + if (mEggSize == -1) + mEggSize = (this.getEntityItem() != null ? (this.getEntityItem().hasTagCompound() ? (this.getEntityItem().getTagCompound().hasKey("size") ? this.getEntityItem().getTagCompound().getInteger("size") : 1) : 1) : 1); + if (MathUtils.randInt(100*mEggSize, 1000) >= MathUtils.randInt(950, 1000)) { + //Spawn Chicken + spawnGiantChicken(); + } + } + super.onUpdate(); + } + + private void spawnGiantChicken() { + try { + EntityGiantChickenBase entitychicken = new EntityGiantChickenBase(this.worldObj); + entitychicken.setGrowingAge(-24000); + entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + this.worldObj.spawnEntityInWorld(entitychicken); + } + catch (Throwable t) {} + } + + //These eggs also do not combine. + @Override + public boolean combineItems(EntityItem p_70289_1_) { + return false; + } + + @Override + public void writeEntityToNBT(NBTTagCompound aNBT) { + super.writeEntityToNBT(aNBT); + aNBT.setInteger("mEggAge", mEggAge); + aNBT.setInteger("mTicksExisted", this.age); + } + + @Override + public void readEntityFromNBT(NBTTagCompound aNBT) { + super.readEntityFromNBT(aNBT); + mEggAge = aNBT.getInteger("mEggAge"); + } + + //They're fireproof + @Override + public void setFire(int p_70015_1_) { + } + + @Override + public boolean isBurning() { + return false; + } + + +} diff --git a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java index 696ed2aeca..4f2bf877f1 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java @@ -1,6 +1,13 @@ package gtPlusPlus.core.item.chemistry; +import net.minecraft.init.Items; + +import gregtech.api.enums.GT_Values; + +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraftforge.fluids.Fluid; public class NuclearChem { @@ -8,13 +15,24 @@ public class NuclearChem { public static Fluid Burnt_LiFBeF2ThF4UF4; public static Fluid Burnt_LiFBeF2ZrF4UF4; public static Fluid Burnt_LiFBeF2ZrF4U235; + + public static Fluid GeneticMutagen; + private static boolean generateMutagenRecipe = false; public static void run(){ //Create Coal Gas - Burnt_LiFBeF2ThF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ThF4UF4", "Burnt LiFBeF2ThF4UF4 Salt", 545, new short[]{48, 48, 175, 100}, null, null); - Burnt_LiFBeF2ZrF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4UF4", "Burnt LiFBeF2ZrF4UF4 Salt", 520, new short[]{48, 68, 165, 100}, null, null); - Burnt_LiFBeF2ZrF4U235 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4U235", "Burnt LiFBeF2ZrF4U235 Salt", 533, new short[]{68, 48, 185, 100}, null, null); + Burnt_LiFBeF2ThF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ThF4UF4", "Burnt LiFBeF2ThF4UF4 Salt", 545, new short[]{48, 175, 48, 100}, null, null); + Burnt_LiFBeF2ZrF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4UF4", "Burnt LiFBeF2ZrF4UF4 Salt", 520, new short[]{48, 168, 68, 100}, null, null); + Burnt_LiFBeF2ZrF4U235 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4U235", "Burnt LiFBeF2ZrF4U235 Salt", 533, new short[]{68, 185, 48, 100}, null, null); + + if (FluidUtils.getFluidStack("fluid.Mutagen", 1) == null) { + GeneticMutagen = FluidUtils.generateFluidNonMolten("GeneticMutagen", "Genetic Mutagen", 12, new short[]{22, 148, 185, 100}, null, null); + generateMutagenRecipe = true; + } + else { + GeneticMutagen = FluidUtils.getFluidStack("fluid.Mutagen", 1).getFluid(); + } createRecipes(); @@ -22,5 +40,32 @@ public class NuclearChem { } private static void createRecipes() { + + if (generateMutagenRecipe) + chemReator_CreateMutagen(); + + chemReactor_MutagenWithEggs(); + } + + private static void chemReator_CreateMutagen() { + GT_Values.RA.addChemicalRecipe( + CI.getNumberedCircuit(20), + ItemUtils.getSimpleStack(Items.nether_star, 2), + FluidUtils.getMobEssence(5000), + FluidUtils.getFluidStack(GeneticMutagen, 8000), + null, + 30*20, + 500); + } + + private static void chemReactor_MutagenWithEggs() { + GT_Values.RA.addChemicalRecipe( + CI.getNumberedCircuit(20), + ItemUtils.getSimpleStack(Items.egg, 2), + FluidUtils.getFluidStack(GeneticMutagen, 500), + null, + ItemUtils.getSimpleStack(ModItems.itemBigEgg, 2), + 300*20, + 500); } } diff --git a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java index 23b0144231..09c4fdfc6b 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java @@ -113,15 +113,15 @@ public class ItemAreaClear extends CoreItem { int y2 = (y1-10); int z2 = (z1-24); - removeBlockColumn(world, new BlockPos(x2, y2, z2)); + removeBlockColumn(world, new BlockPos(x2, y2, z2, world)); return true; } public boolean removeBlockColumn(World world, BlockPos pos){ for (int i=0; i<50; i++){ - removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos-10, pos.zPos+i)); - removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i)); - removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos+10, pos.zPos+i)); + removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos-10, pos.zPos+i, world)); + removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i, world)); + removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos+10, pos.zPos+i, world)); } return true; } @@ -160,13 +160,13 @@ public class ItemAreaClear extends CoreItem { int y2 = (y1-1); int z2 = (z1-10); - fillBlockColumn(world, new BlockPos(x2, y2, z2)); + fillBlockColumn(world, new BlockPos(x2, y2, z2, world)); return true; } public boolean fillBlockColumn(World world, BlockPos pos){ for (int i=0; i<21; i++){ - fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i)); + fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i, world)); } return true; } diff --git a/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java b/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java index 761cbf268f..2b3d718538 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemGiantEgg.java @@ -1,11 +1,15 @@ package gtPlusPlus.core.item.general; +import static gtPlusPlus.core.lib.CORE.RANDOM; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import gtPlusPlus.core.entity.item.ItemEntityGiantEgg; import gtPlusPlus.core.item.base.BaseItemBurnable; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; @@ -15,6 +19,7 @@ public class ItemGiantEgg extends BaseItemBurnable { public ItemGiantEgg(String unlocalizedName, String displayName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, String oredictName, int burnTime, int meta) { super(unlocalizedName, displayName, creativeTab, stackSize, maxDmg, description, oredictName, burnTime, meta); + this.setMaxStackSize(1); } @Override @@ -22,8 +27,13 @@ public class ItemGiantEgg extends BaseItemBurnable { String localName = super.getItemStackDisplayName(aStack); nbtWork(aStack); int size = 1; + int age = 0; if (NBTUtils.hasKey(aStack, "size")){ size = NBTUtils.getInteger(aStack, "size"); + if (NBTUtils.hasKey(aStack, "mTicksExisted")){ + age = NBTUtils.getInteger(aStack, "mTicksExisted"); + return ""+size+" "+localName+" ["+age+"]"; + } return ""+size+" "+localName; } return "?? "+localName; @@ -43,10 +53,9 @@ public class ItemGiantEgg extends BaseItemBurnable { @Override public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) { - // TODO Auto-generated method stub super.onCreated(p_77622_1_, p_77622_2_, p_77622_3_); } - + public void nbtWork(ItemStack aStack) { if (NBTUtils.hasKey(aStack, "playerHeld")) { if (NBTUtils.getBoolean(aStack, "playerHeld") && !NBTUtils.hasKey(aStack, "size")) { @@ -55,4 +64,44 @@ public class ItemGiantEgg extends BaseItemBurnable { } } + @Override + public boolean hasCustomEntity(ItemStack stack) { + return true; + } + + @Override + public Entity createEntity(World world, Entity location, ItemStack itemstack) { + + if (location instanceof EntityPlayer) { + + EntityPlayer player = (EntityPlayer) location; + + if (itemstack == null) { + return null; + } + else if (itemstack.stackSize == 0) { + return null; + } + else { + ItemEntityGiantEgg entityitem = new ItemEntityGiantEgg(world, player.posX, player.posY - 0.30000001192092896D + (double)player.getEyeHeight(), player.posZ, itemstack); + entityitem.delayBeforeCanPickup = 40; + entityitem.func_145799_b(player.getCommandSenderName()); + float f = 0.1F; + float f1; + f = 0.3F; + entityitem.motionX = (double)(-MathHelper.sin(player.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float)Math.PI) * f); + entityitem.motionZ = (double)(MathHelper.cos(player.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float)Math.PI) * f); + entityitem.motionY = (double)(-MathHelper.sin(player.rotationPitch / 180.0F * (float)Math.PI) * f + 0.1F); + f = 0.02F; + f1 = RANDOM.nextFloat() * (float)Math.PI * 2.0F; + f *= RANDOM.nextFloat(); + entityitem.motionX += Math.cos((double)f1) * (double)f; + entityitem.motionY += (double)((RANDOM.nextFloat() - RANDOM.nextFloat()) * 0.1F); + entityitem.motionZ += Math.sin((double)f1) * (double)f; + return entityitem; + } + } + return null; + } + } diff --git a/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java b/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java index f8b63a7a19..592b68d06a 100644 --- a/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java +++ b/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java @@ -206,7 +206,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { if (NBTUtils.hasKey(itemstack,"mHasEntity") && NBTUtils.getBoolean(itemstack,"mHasEntity")) { Logger.WARNING("Trying to release (2)"); - boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y+1, z)); + boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y+1, z, world)); if (!mDidSpawn){ PlayerUtils.messagePlayer(player, "You failed to release a "+NBTUtils.getString(itemstack,"mEntityName")+"."); diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java b/src/Java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java index 622a294dc2..555635741e 100644 --- a/src/Java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java +++ b/src/Java/gtPlusPlus/core/item/tool/misc/ConnectedBlockFinder.java @@ -75,7 +75,7 @@ public class ConnectedBlockFinder extends BaseItemWithDamageValue{ int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - BlockPos mStartPoint = new BlockPos(x,y,z); + BlockPos mStartPoint = new BlockPos(x,y,z, world); Block mBlockType = world.getBlock(x, y, z); int mBlockMeta = mBlockType.getDamageValue(world, x, y, z); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java index 10d14d3d34..d2781dfc48 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java @@ -49,7 +49,7 @@ public class EntityUtils { final int blockX = MathHelper.floor_double(parEntity.posX); final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY)-1; final int blockZ = MathHelper.floor_double(parEntity.posZ); - return new BlockPos(blockX, blockY, blockZ); + return new BlockPos(blockX, blockY, blockZ, parEntity.worldObj); } //TODO diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java index ebe1813e15..402a510a79 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java @@ -189,7 +189,7 @@ public class Preloader_ClassTransformer2 { NBTTagCompound i = new NBTTagCompound(); - i = stupidFuckingNBTMap.get(new BlockPos(o.xCoord, o.yCoord, o.zCoord)); + i = stupidFuckingNBTMap.get(new BlockPos(o.xCoord, o.yCoord, o.zCoord, o.getWorld())); Logger.INFO("Got NBT Tag Value from map."); NBTTagCompound tNBT = i; @@ -238,7 +238,7 @@ public class Preloader_ClassTransformer2 { else { fffff.set(tGregTechTileEntity.getMetaTileEntity().getBaseMetaTileEntity(), tNBT); Logger.REFLECTION("Hopefully injected field data."); - stupidFuckingNBTMap.put(new BlockPos(aX, aY, aZ), tNBT); + stupidFuckingNBTMap.put(new BlockPos(aX, aY, aZ, tGregTechTileEntity.getMetaTileEntity().getBaseMetaTileEntity().getWorld()), tNBT); Logger.INFO("Set NBT Tag Value to map."); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java index 9d7750d834..2bfb07ff4a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java @@ -415,7 +415,7 @@ public class TreeFarmHelper { if (h == 1) { if (TreeFarmHelper.isWoodLog(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) { Logger.INFO("Found a Log"); - return new BlockPos(aBaseMetaTileEntity.getXCoord()+xDir + i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir + j); + return new BlockPos(aBaseMetaTileEntity.getXCoord()+xDir + i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir + j, aBaseMetaTileEntity.getWorld()); } } } @@ -558,42 +558,42 @@ public class TreeFarmHelper { int z = P.zPos; if (checkLeaves) { if (isWoodLog(W.getBlock(x-1, y, z)) || isLeaves(W.getBlock(x-1, y, z))) { - BlockPos L = new BlockPos(x-1, y, z); + BlockPos L = new BlockPos(x-1, y, z, W); if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); } } if (isWoodLog(W.getBlock(x+1, y, z)) || isLeaves(W.getBlock(x+1, y, z))) { - BlockPos L = new BlockPos(x+1, y, z); + BlockPos L = new BlockPos(x+1, y, z, W); if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); } } if (isWoodLog(W.getBlock(x, y-1, z)) || isLeaves(W.getBlock(x, y-1, z))) { - BlockPos L = new BlockPos(x, y-1, z); + BlockPos L = new BlockPos(x, y-1, z, W); if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); } } if (isWoodLog(W.getBlock(x, y+1, z)) || isLeaves(W.getBlock(x, y+1, z))) { - BlockPos L = new BlockPos(x, y+1, z); + BlockPos L = new BlockPos(x, y+1, z, W); if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); } } if (isWoodLog(W.getBlock(x, y, z-1)) || isLeaves(W.getBlock(x, y, z-1))) { - BlockPos L = new BlockPos(x, y, z-1); + BlockPos L = new BlockPos(x, y, z-1, W); if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); } } if (isWoodLog(W.getBlock(x, y, z+1)) || isLeaves(W.getBlock(x, y, z+1))) { - BlockPos L = new BlockPos(x, y, z+1); + BlockPos L = new BlockPos(x, y, z+1, W); if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); @@ -602,42 +602,42 @@ public class TreeFarmHelper { } else { if (isWoodLog(W.getBlock(x-1, y, z))) { - BlockPos L = new BlockPos(x-1, y, z); + BlockPos L = new BlockPos(x-1, y, z, W); //if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); //} } if (isWoodLog(W.getBlock(x+1, y, z))) { - BlockPos L = new BlockPos(x+1, y, z); + BlockPos L = new BlockPos(x+1, y, z, W); //if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); //} } if (isWoodLog(W.getBlock(x, y-1, z))) { - BlockPos L = new BlockPos(x, y-1, z); + BlockPos L = new BlockPos(x, y-1, z, W); //if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); //} } if (isWoodLog(W.getBlock(x, y+1, z))) { - BlockPos L = new BlockPos(x, y+1, z); + BlockPos L = new BlockPos(x, y+1, z, W); //if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); //} } if (isWoodLog(W.getBlock(x, y, z-1))) { - BlockPos L = new BlockPos(x, y, z-1); + BlockPos L = new BlockPos(x, y, z-1, W); //if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); //} } if (isWoodLog(W.getBlock(x, y, z+1))) { - BlockPos L = new BlockPos(x, y, z+1); + BlockPos L = new BlockPos(x, y, z+1, W); //if (!checkedSpaces.contains(L)) { mConnected.add(L); Logger.INFO("Found Connected. [III]"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java index 895ad35a14..1bfe20810f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java @@ -50,7 +50,7 @@ extends RenderPlayer { if (!hasResourceChecked) { //Give Devs Dev capes. if (CORE.DEVENV) { - cachedResource = this.mCapes[4]; + cachedResource = this.mCapes[2]; hasResourceChecked = true; } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index 1046b6d7dd..e18dc43a79 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -460,7 +460,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } public BlockPos getTileEntityPosition(){ - return new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); + return new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld()); } public BlockPos getPositionOfEntity(Entity mEntity){ -- cgit