Jump to content

NEG2013

Members
  • Posts

    123
  • Joined

  • Last visited

Everything posted by NEG2013

  1. My game crashes whenever I click on a inventory slot of any time(custom or other) Crash Report ---- Minecraft Crash Report ---- // Would you like a cupcake? Time: 4/27/16 6:55 PM Description: Ticking memory connection java.lang.IndexOutOfBoundsException: Index: 59, Size: 45 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at net.minecraft.inventory.Container.slotClick(Container.java:300) at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955) at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41) at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at net.minecraft.inventory.Container.slotClick(Container.java:300) at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955) at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41) at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@5df2deb8 Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_74, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 867235496 bytes (827 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA ac{1.5.7} [Acsension] (bin) GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player935'/331, l='New World', x=989.63, y=4.00, z=-783.32]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' Container Class package neg2013.acsension.inventory; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import neg2013.acsension.slot.CrusherInputSlot; import neg2013.acsension.slot.CrusherOutputSlot; import neg2013.acsension.slot.GenericSlot; import neg2013.acsension.tile_entity.TECrusher; import neg2013.acsension.tile_entity.TEDecomp; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; public class DecompContainer extends Container{ private TEDecomp decomp; private int slotId = -1; private int nextId(){ slotId++; return slotId; } public DecompContainer(InventoryPlayer invPlayer, TEDecomp decomp){ this.decomp = decomp; // player inv //hot bar for(int x = 0; x < 9; x++){ addSlotToContainer(new Slot(invPlayer, x, 8 + (18 * x), 146)); } for(int x = 0; x < 9; x++){ for(int y = 0; y < 3; y++){ addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + 18 * x, 88 + 18 * y)); addSlotToContainer(new GenericSlot(decomp, nextId(), 80, 15)); addSlotToContainer(new GenericSlot(decomp, nextId(), 60, 64)); addSlotToContainer(new GenericSlot(decomp, nextId(), 80, 64)); addSlotToContainer(new GenericSlot(decomp, nextId(), 100, 64)); } } // player inv } @Override public boolean canInteractWith(EntityPlayer player) { return true; } } Please just ask if youd like to see any other classes
  2. well I have a gui but when you go to pick up an item it just goes back down, so its impossible to move the item here is the code for the container part of it please ask if youd like to see another class package neg2013.acsension.inventory; import neg2013.acsension.slot.CrusherInputSlot; import neg2013.acsension.slot.GenericSlot; import neg2013.acsension.tile_entity.TECrusher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; public class CrusherContainer extends Container{ private TECrusher crusher; private int slotId = -1; private int nextId(){ slotId++; return slotId; } public CrusherContainer(InventoryPlayer invPlayer, TECrusher crusher){ this.crusher = crusher; // player inv //hot bar for(int x = 0; x < 9; x++){ addSlotToContainer(new Slot(invPlayer, x, 8 + (18 * x), 146)); } for(int x = 0; x < 9; x++){ for(int y = 0; y < 3; y++){ addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + 18 * x, 88 + 18 * y)); addSlotToContainer(new CrusherInputSlot(crusher, nextId(), 33, 26)); } } // player inv } //mid @Override public boolean canInteractWith(EntityPlayer player) { return true; } }
  3. frankly I wrote every one of those jack-shit method and ive notice that they nothing (that's the problem) thatnks for the help (sarcasm)
  4. I understand and also I update all the blocks to TileEntitys but the system still doesn't work so here are the class again(some stuff changed) BlockDuct.java http://pastebin.com/EK4GTDYC BlockEnergyDuctBase.java http://pastebin.com/F4GsHtvx IAc.java(interface) http://pastebin.com/9f2MaawR BlockSolarGenny.java http://pastebin.com/1WSPeBe8 BlockAc.java package neg2013.acsension.infrastructure; import neg2013.acsension.interfaces.IAc; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockAC extends Block implements IAc{ protected BlockAC(Material material) { super(material); this.blockHardness = 2f; } //done @Override public int MaxEnergyStored() { int maxEnergyStored = MaxEnergyStored(); return 0; } //done @Override public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) { int tick = tickRate(Minecraft.getMinecraft().theWorld); int energyStored = tick * EnergyGenerating() - EnergyConsuming(); return energyStored; } //done @Override public int EnergyGenerating() { int energyGenerating = EnergyGenerating(); return energyGenerating; } //done @Override public boolean CanGenerateEnergy(int x, int y, int z) { boolean canGenerateEnergy = CanGenerateEnergy(x, y, z); return canGenerateEnergy; } //done @Override public boolean CanConsumeEnergy() { boolean canConsumeEnergy = CanConsumeEnergy(); return canConsumeEnergy; } //done @Override public boolean canAcceptEnergy() { boolean canacceptEnergy = canAcceptEnergy(); return canacceptEnergy; } //done @Override public boolean canConnectToAc() { boolean canconnectToAc = canConnectToAc(); canconnectToAc = true; return canconnectToAc; } //done @Override public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) { int energyIn = EnergyIn(access, x, y, z, world); energyIn = EnergyDraw(access, x, y, z, world); return energyIn; } //done @Override public int EnergyOut(IBlockAccess access, int x, int y, int z, World world) { int energyOut = EnergyOut(access, x, y, z, world); energyOut = EnergyPush(access, x, energyOut, z, world); return energyOut; } //done @Override public int EnergyDraw(IBlockAccess access, int x, int y, int z, World world) { int energyDraw = EnergyDraw(access, x, y, z, world); return energyDraw; } //done @Override public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) { int energyPush = EnergyPush(access, x, y, z, world); return energyPush; } //done @Override public int NeighborDraw(IBlockAccess access, int x, int y, int z, World world) { int neighborDraw = NeighborDraw(access, x, y, z, world); return neighborDraw; } //done @Override public int NeighborPush(IBlockAccess access, int x, int y, int z, World world) { int neighborPush = NeighborPush(access, x, y, z, world); return neighborPush; } //done @Override public int EnergyConsuming() { int energyConsuming = EnergyConsuming(); return energyConsuming; } @Override public boolean IsPowered(IBlockAccess access, int x, int y, int z, World world) { if(NeighborPush(access, x, y, z, world) >=1 ){ return true; } return false; } } BlockRedstoneConverter.java package neg2013.acsension.infrastructure; import neg2013.acsension.Acsension; import neg2013.acsension.interfaces.IAc; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockRedstoneConverter extends BlockAC implements ITileEntityProvider{ public BlockRedstoneConverter(Material material) { super(material); } @Override public int MaxEnergyStored() { // TODO Auto-generated method stub return 2; } @Override public boolean CanGenerateEnergy(int x, int y, int z) { // TODO Auto-generated method stub return false; } @Override public boolean CanConsumeEnergy() { // TODO Auto-generated method stub return true; } @Override public boolean canAcceptEnergy() { // TODO Auto-generated method stub return true; } //done @Override public boolean canConnectToAc() { return true; } //done @Override public int EnergyOut(IBlockAccess access, int x, int y, int z, World world) { return 0; } //done @Override public int EnergyDraw(IBlockAccess access, int x, int y, int z, World world) { return 1; } //done @Override public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) { return 0; } public int EnergyIn (IBlockAccess access, int x, int y, int z, World world) { return super.EnergyIn(access, x, y, z, world); } @Override public int EnergyConsuming() { return 1; } @Override public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) { int energyStored = EnergyStored( access, x, y, z, world); return super.EnergyStored( access, x, y, z, world); } @Override public boolean IsPowered(IBlockAccess access, int x, int y, int z, World world) { if(IsPowered(access, x, y, z, world)){ this.setLightLevel(15f); } return super.IsPowered(access, x, y, z, world); } @Override public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) { return true; } public boolean canProvidePower() { return true; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { // TODO Auto-generated method stub return null; } } BlockCreativeArray.java package neg2013.acsension.infrastructure; import neg2013.acsension.interfaces.IAc; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockCreativeArray extends Block implements IAc , ITileEntityProvider{ public BlockCreativeArray(Material material) { super(material); } @Override public int MaxEnergyStored() { return 1000000000; } @Override public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) { return 1000000000; } @Override public int EnergyGenerating() { // TODO Auto-generated method stub return 1000000000; } @Override public int EnergyConsuming() { // TODO Auto-generated method stub return 0; } @Override public boolean CanGenerateEnergy(int x, int y, int z) { // TODO Auto-generated method stub return true; } @Override public boolean CanConsumeEnergy() { // TODO Auto-generated method stub return false; } @Override public boolean canAcceptEnergy() { // TODO Auto-generated method stub return false; } @Override public boolean canConnectToAc() { // TODO Auto-generated method stub return true; } @Override public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return 1000000000; } @Override public int EnergyOut(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return 1000000000; } @Override public int EnergyDraw(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return 0; } @Override public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return 1000000000; } @Override public int NeighborDraw(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return 0; } @Override public int NeighborPush(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return 0; } @Override public boolean IsPowered(IBlockAccess access, int x, int y, int z, World world) { // TODO Auto-generated method stub return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { // TODO Auto-generated method stub return null; } }
  5. I'm changing to tileentitys now but why would the game care if its a regular block or TileEntity
  6. line 41-141 are all commented out
  7. I replaced the generating one this this hint it still will not work int tick = tickRate(Minecraft.getMinecraft().theWorld); int energyStored = EnergyIn(access, x, y, z, world); return (energyStored * tick); I also don't know where you see this method @Override public int EnergyStored() { // TODO Auto-generated method stub return 0; }
  8. I may have changed something after I pasted it here they are again EnergyDuct http://pastebin.com/yPmfzn5f energyDuctBase http://pastebin.com/C9unk14v
  9. I removed the setLightLevel bit, energyDraw was set at 1 on the test block also what do you mean here "where would this block store energy? If we create a field for it, all of our Duct blocks would share that variable!"? and the duct has this for its stored int tick = tickRate(Minecraft.getMinecraft().theWorld); int energyStored = tick * EnergyGenerating(); return energyStored;" Line 105 of that paste has a method that calls itself. Also, setLightLevel is not how you get a block to emit light on a per-instance basis. That will cause all copies of the block to start emitting light. You also never reset the light value. That block also never calls EnergyDraw in order to determine how much energy it should take from anywhere. Similarly, EnergyIn isn't called from anywhere and similarly does nothing. Then in your EnergyDuct block your EnergyStored method returns 0, meaning it would be incapable of sending energy anywhere. But if we look at this a little more closely: where would this block store energy? If we create a field for it, all of our Duct blocks would share that variable!
  10. http://pastebin.com/S51PdEaf that's a block I made just to test if its working and if its working it should light up but its not lighting up so...
  11. not working as in it isn't sending power to a block that's set to consume it
  12. I have been creating a powering system and its not working below are the classes if I forgot anything or you need to see another part of the code just ask. solar genny http://pastebin.com/M1z2LPEt energy duct http://pastebin.com/XhLRutMk energy duct base http://pastebin.com/wr1PPTA2 blockAC http://pastebin.com/peXAkz1v
  13. well how would I do that and the block still doesn't work it just becomes unseeable
  14. when its right clicked now it becomes invisible and also how do I expand the hit boxes beyond one block?
  15. I added a tank that works in all aspects beside the fact that the texture will not load at all I posted the entire class below. package neg2013.acsension.infrastructure; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import neg2013.acsension.block.BlockCopperIngot; 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.boss.IBossDisplayData; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class BlockTank extends Block{ @SideOnly(Side.CLIENT) private IIcon field_150035_a; @SideOnly(Side.CLIENT) private IIcon field_150034_b; private static final String __OBFID = "CL_00000221"; @Override public boolean isOpaqueCube() { return false; } @Override public boolean renderAsNormalBlock() { return false; } public BlockTank(Material material) { super(material); this.setHardness(2f); } //storage things public void func_150024_a(World world, int a, int b, int c, int p_150024_5_) { world.setBlockMetadataWithNotify(a, b, c, MathHelper.clamp_int(p_150024_5_, 0, 44), 2); world.func_147453_f(a, b, c, this); } public static int func_150027_b(int a) { return a; } public boolean onBlockActivated( World world, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (world.isRemote) { return true; } else { ItemStack itemstack = player.inventory.getCurrentItem(); if (itemstack == null) { return true; } else { int i1 = world.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); int j1 = func_150027_b(i1); if (itemstack.getItem() == Items.water_bucket) { if (j1 < 10) { if (!player.capabilities.isCreativeMode) { player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.bucket)); } this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 + 1); } if (itemstack.getItem() == Items.bucket) { if (j1 > 0) { if (!player.capabilities.isCreativeMode) { player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.water_bucket)); } this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_,j1 + 1); } return true; } return true; } else { if (itemstack.getItem() == Items.glass_bottle) { if (j1 > 0) { if (!player.capabilities.isCreativeMode) { ItemStack itemstack1 = new ItemStack(Items.potionitem, 1, 0); if (!player.inventory.addItemStackToInventory(itemstack1)) { world.spawnEntityInWorld(new EntityItem(world, (double)p_149727_2_ + 0.5D, (double)p_149727_3_ + 1.5D, (double)p_149727_4_ + 0.5D, itemstack1)); } else if (player instanceof EntityPlayerMP) { ((EntityPlayerMP)player).sendContainerToPlayer(player.inventoryContainer); } --itemstack.stackSize; if (itemstack.stackSize <= 0) { player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); } } this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); } } else if (j1 > 0 && itemstack.getItem() instanceof ItemArmor && ((ItemArmor)itemstack.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) { ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); itemarmor.removeColor(itemstack); this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); return true; } if(itemstack.getItem() == Items.bucket && j1 > 0) { if (j1 < 10) { if (!player.capabilities.isCreativeMode) { player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.water_bucket)); } this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); } if (itemstack.getItem() == Items.water_bucket) { if (j1 > 0) { if (!player.capabilities.isCreativeMode) { player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.water_bucket)); } this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); } return true; } this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); return true; } return false; } } } } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister p_149651_1_, World world, int z, int y, int x) { int i1 = world.getBlockMetadata(x, y, z); int j1 = func_150027_b(i1); if(i1 == 0){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(i1 <= 4){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side1" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side1"); }if(i1 <= { this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side2" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side2"); }if(i1 <= 12){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side3" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side3"); }if(j1 <= 16){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side4" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side4"); }if(j1 <= 20){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side5" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side5"); }if(j1 <= 24){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side6" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side6"); }if(j1 <= 28){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side7" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side7"); }if(j1 <= 32){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side8" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side8"); }if(j1 <= 36){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side9" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side9"); }if(j1 <= 40){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side10" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side10"); }if(j1 <= 44){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side11" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side11"); } this.field_150035_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); } @Override public IIcon getIcon(int p_149691_1_, int p_149691_2_) { return p_149691_1_ == 1 ? this.field_150035_a : (p_149691_1_ == 0 ? this.field_150035_a : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.field_150034_b)); } /*if(j1 <= 0){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 4){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= { this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 12){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 16){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 20){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 24){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 28){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 32){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 36){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 40){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }if(j1 <= 44){ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" ); this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side"); }*/ }
  16. package neg2013.acsension.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockGrowth extends Block{ public BlockGrowth(Material material) { super(material); this.setHardness(1f); } @Override public boolean isOpaqueCube() { return false; } @Override public boolean renderAsNormalBlock() { return false; } //storage things public void meta(World world, int a, int b, int c, int d) { world.setBlockMetadataWithNotify(a, b, c, MathHelper.clamp_int(d, 0, 32), 2); world.func_147453_f(a, b, c, this); } public static int returner(int a) { return a; } @Override public boolean onBlockActivated(World world, int x, int y, int z,EntityPlayer player, int a, float f1, float f2, float f3) { int i1 = world.getBlockMetadata(x, y, z); int j1 = returner(i1); this.meta(world, x, y, z, j1 + 1); float max = j1 * 1f; this.setBlockBounds(max, max, max, -max, -max, -max); return true; } //sry that I can read obfuscated code:( }
  17. Id Love to help/team up to help you with your mod please pm me about how we could communicate and share code.
  18. I want a block that when right clicked the metadata goes up 1 and based on the metadata it increases the size(a tiny bit) but when I do this it either stops being visible or becomes 9x9 (that's with 1.01 or 1.0001 size increase) public void func_150024_a(World world, int a, int b, int c, int p_150024_5_) { world.setBlockMetadataWithNotify(a, b, c, MathHelper.clamp_int(p_150024_5_, 0, 32), 2); world.func_147453_f(a, b, c, this); } public static int func_150027_b(int a) { return a; } @Override public boolean onBlockActivated(World world, int p_149727_2_, int p_149727_3_, int p_149727_4_,EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { int i1 = world.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); int j1 = func_150027_b(i1); this.func_150024_a(world, p_149727_2_, p_149727_3_, p_149727_4_, j1 + 1); float max = j1 * 1f; this.setBlockBounds(max, max, max, -max, -max, -max); return true; }
  19. How do I update all my old 1.7.10 code to 1.9
  20. well I'm trying to create and item that gets the players coordinates when right clicked at first and then teleport then to those cords whenever right clicked after that here is my code. public void func_meta(ItemStack itemstack, int a) { itemstack.setItemDamage(a); } public static int func_return(int a) { return a; } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player, int x, int y, int z) { int i1 = itemstack.getItemDamage(); int j1 = func_return(i1); if(j1 == 0){ itemstack.setItemDamage(1); player.getPlayerCoordinates().posX = x; player.getPlayerCoordinates().posY = y; player.getPlayerCoordinates().posZ = z; return itemstack; } if(j1 == 1){ if (player.capabilities.isCreativeMode) { return itemstack; } else { // --itemstack.stackSize; if (!world.isRemote) { player.setPosition(x, y, z); return itemstack; } return itemstack; }
  21. I understand basic Guis but I don't now how to create a slot in a container type gui if you good give and example that would help more than go look at GuiChest or IInventory class. thanks
  22. I have tried messing with the onNeighborBlockChange method and a few other but failed. So the question is how do you have a block "see" what is next to it so it can update its texture so they "connect"?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.