Jump to content

wookiederk

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by wookiederk

  1. Drag them into the .minecraft jar! Take your a folder that has: mods/jerrymod/textures/items/"youritemname.png". Then, open up your compiled .minecraft jar and drag the folder in!
  2. It isn't attached to a block. I'm trying to make a custom Player Inventory Screen to load.
  3. Its not a normal block Gui. Its a custom Inventory Gui. Any ideas about that?
  4. Texture path correct? return "/environment/custom_sun.png"
  5. Shouldnt this tell the file which tile entity to open? public TileEntity createNewTileEntity(World world) { return new TileEntityInventory(); } ? Also, how would I make the player's current coords the x, y, and z? thanks for the help
  6. I'm getting a nullpointer when I render my gui from the key. Here is my keyHandler code: static EntityPlayer player; static World world; int x; int y; int z; public TileEntity createNewTileEntity(World world) { return new TileEntityInventory(); } static KeyBinding myBinding = new KeyBinding("MyBind", Keyboard.KEY_R); public ExcelteorKeyHandler() { // the first value is an array of KeyBindings, the second is whether or // not the call // keyDown should repeat as long as the key is down super(new KeyBinding[] { myBinding }, new boolean[] { false }); } @Override public String getLabel() { return "mykeybindings"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity == null) { return; } player.openGui(Main.instance, 0, world, x, y, z); } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { // do whatever } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT); // I am unsure if any different TickTypes have any different effects. } The Null Pointer Is From the Two Lines TileEntity tileEntity = world.getBlockTileEntity(x, y, z); player.openGui(Main.instance, 0, world, x, y, z);
  7. Thanks for that link. What I was trying to say earlier was: How can you set the inputKey to the inputKey the User Specified as his/her Inventory Key? My Custom Gui would overwrite the Vanilla inventory with my own, but the following code while (this.gameSettings.keyBindInventory.isPressed()) { this.displayGuiScreen(new GuiInventory(this.thePlayer)); does not work, specifically the gameSettings.keyBindInventory.isPressed()
  8. Hi, I have a working gui code, a TileEntity, Gui Handler, Gui Class, and Container, for a custom block. But instead of opening the gui with a block, I want to open the gui by pressing a keyboard key. If its possible, can I assign that particular input key to the same input the player assigned towards the inventory? (Overwriting Inventory Screen) Do you render the gui the same as if it was a block (I Couldnt get this to work) or is there different code to open a gui for inventory? In Summary: How do you render a custom gui from the input handler? How do you assign that particular input to that of your game settings for inventory? Edit: Cleaned Up Post
  9. Yeah i understand. I use to make blocks that way, and usuallly wuppy's tuts are pretty easy to follow, so I go off of his codes a lot. http://wuppy29.blogspot.nl/2013/04/modding-151-basic-block-part-1.html Going back to Gaara51's method, which is what works.
  10. Caused by: java.lang.NoSuchMethodError: net.minecraft.block.Block.func_94330_A()Ljava/lang/String; at derek.main.Main.load(Main.java:32) Line 32 in the load method of my main file is: GameRegistry.registerBlock(yellowLeaves, modid + yellowLeaves.getUnlocalizedName2()); Does this help with anything? Im pretty sure that is correct.
  11. Yes. It runs with clean minecraft.jar files with minecraft forge. Does not run on the minecraft_server.
  12. I really need this working as soon as possible. Its so frustrating because single player works just fine.
  13. Hey, my mod works perfectly fine in single player. However, when i run it on a minecraft forge server, it crashes. Heres the crash report java.lang.NoSuchMethodError: net.minecraft.block.Block.func_94330_A()Ljava/lang/String; at derek.main.Main.load(Main.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93) at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:140) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429) at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573) 2013-04-27 16:20:58 [iNFO] [sTDERR] cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: net.minecraft.block.Block.func_94330_A()Ljava/lang/String; 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.transition(LoadController.java:142) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355) 2013-04-27 16:20:58 [iNFO] [sTDERR] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:140) 2013-04-27 16:20:58 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429) 2013-04-27 16:20:58 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573) 2013-04-27 16:20:58 [iNFO] [sTDERR] Caused by: java.lang.NoSuchMethodError: net.minecraft.block.Block.func_94330_A()Ljava/lang/String; 2013-04-27 16:20:58 [iNFO] [sTDERR] at derek.main.Main.load(Main.java:32) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-04-27 16:20:58 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) 2013-04-27 16:20:58 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) 2013-04-27 16:20:58 [iNFO] [sTDERR] ... 5 more 2013-04-27 16:20:58 [sEVERE] [Minecraft-Server] Encountered an unexpected exception LoaderException cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: net.minecraft.block.Block.func_94330_A()Ljava/lang/String; at cpw.mods.fml.common.LoadController.transition(LoadController.java:142) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93) at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:140) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429) at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573) Caused by: java.lang.NoSuchMethodError: net.minecraft.block.Block.func_94330_A()Ljava/lang/String; at derek.main.Main.load(Main.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) ... 5 more Please Help
  14. Found the issue. this.worldGeneratorYellowTrees = new WorldGenYellowTree(false); this.worldGeneratorOrangeTrees = new WorldGenOrangeTree(false); Was missing these two lines of code.
  15. Tree generation in my biome keeps crashing. Tree Gen code is copied from the WorldGenTree class. Not sure what the problem is, any help appreciated. Crash: net.minecraft.util.ReportedException: Ticking memory connection 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:60) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:674) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-04-27 09:20:34 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:260) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:203) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.biome.BiomeGenBase.decorate(BiomeGenBase.java:366) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderGenerate.populate(ChunkProviderGenerate.java:577) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:258) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1244) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.management.PlayerInstance.<init>(PlayerInstance.java:36) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:89) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.management.PlayerManager.updateMountedMovingPlayer(PlayerManager.java:248) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.server.management.ServerConfigurationManager.serverUpdateMountedMovingPlayer(ServerConfigurationManager.java:276) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.handleFlying(NetServerHandler.java:408) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet10Flying.processPacket(Packet10Flying.java:51) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:134) 2013-04-27 09:20:34 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:53) 2013-04-27 09:20:34 [iNFO] [sTDERR] ... 6 more 2013-04-27 09:20:34 [sEVERE] [Minecraft-Server] Encountered an unexpected exception ReportedException net.minecraft.util.ReportedException: Ticking memory connection at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:60) at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:674) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.NullPointerException at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:260) at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:203) at net.minecraft.world.biome.BiomeGenBase.decorate(BiomeGenBase.java:366) at net.minecraft.world.gen.ChunkProviderGenerate.populate(ChunkProviderGenerate.java:577) at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:258) at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1244) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153) at net.minecraft.server.management.PlayerInstance.<init>(PlayerInstance.java:36) at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:89) at net.minecraft.server.management.PlayerManager.updateMountedMovingPlayer(PlayerManager.java:248) at net.minecraft.server.management.ServerConfigurationManager.serverUpdateMountedMovingPlayer(ServerConfigurationManager.java:276) at net.minecraft.network.NetServerHandler.handleFlying(NetServerHandler.java:408) at net.minecraft.network.packet.Packet10Flying.processPacket(Packet10Flying.java:51) at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:134) at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:53) ... 6 more My WorldGenYellowTree code: /** The minimum height of a generated tree. */ private final int minTreeHeight; /** True if this tree should grow Vines. */ private final boolean vinesGrow; /** The metadata value of the wood to use in tree generation. */ private final int metaWood; /** The metadata value of the leaves to use in tree generation. */ private final int metaLeaves; public WorldGenYellowTree(boolean par1) { this(par1, 4, 0, 0, false); } public WorldGenYellowTree(boolean par1, int par2, int par3, int par4, boolean par5) { super(par1); this.minTreeHeight = par2; this.metaWood = par3; this.metaLeaves = par4; this.vinesGrow = par5; } public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { int l = par2Random.nextInt(3) + this.minTreeHeight; boolean flag = true; if (par4 >= 1 && par4 + l + 1 <= 256) { int i1; byte b0; int j1; int k1; for (i1 = par4; i1 <= par4 + 1 + l; ++i1) { b0 = 1; if (i1 == par4) { b0 = 0; } if (i1 >= par4 + 1 + l - 2) { b0 = 2; } for (int l1 = par3 - b0; l1 <= par3 + b0 && flag; ++l1) { for (j1 = par5 - b0; j1 <= par5 + b0 && flag; ++j1) { if (i1 >= 0 && i1 < 256) { k1 = par1World.getBlockId(l1, i1, j1); Block block = Block.blocksList[k1]; if (k1 != 0 && !block.isLeaves(par1World, l1, i1, j1) && k1 != Block.grass.blockID && k1 != Block.dirt.blockID && !block.isWood(par1World, l1, i1, j1)) { flag = false; } } else { flag = false; } } } } if (!flag) { return false; } else { i1 = par1World.getBlockId(par3, par4 - 1, par5); Block soil = Block.blocksList[i1]; boolean isSoil = (soil != null && soil.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Block.sapling)); if (isSoil && par4 < 256 - l - 1) { soil.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); b0 = 3; byte b1 = 0; int i2; int j2; int k2; for (j1 = par4 - b0 + l; j1 <= par4 + l; ++j1) { k1 = j1 - (par4 + l); i2 = b1 + 1 - k1 / 2; for (j2 = par3 - i2; j2 <= par3 + i2; ++j2) { k2 = j2 - par3; for (int l2 = par5 - i2; l2 <= par5 + i2; ++l2) { int i3 = l2 - par5; if (Math.abs(k2) != i2 || Math.abs(i3) != i2 || par2Random.nextInt(2) != 0 && k1 != 0) { int j3 = par1World.getBlockId(j2, j1, l2); Block block = Block.blocksList[j3]; if (block == null || block.canBeReplacedByLeaves(par1World, j2, j1, l2)) { this.setBlockAndMetadata(par1World, j2, j1, l2, Main.yellowLeaves.blockID, this.metaLeaves); } } } } } for (j1 = 0; j1 < l; ++j1) { k1 = par1World.getBlockId(par3, par4 + j1, par5); Block block = Block.blocksList[k1]; if (k1 == 0 || block == null || block.isLeaves(par1World, par3, par4 + j1, par5)) { this.setBlockAndMetadata(par1World, par3, par4 + j1, par5, Block.wood.blockID, this.metaWood); if (this.vinesGrow && j1 > 0) { if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + j1, par5)) { this.setBlockAndMetadata(par1World, par3 - 1, par4 + j1, par5, Block.vine.blockID, ; } if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + j1, par5)) { this.setBlockAndMetadata(par1World, par3 + 1, par4 + j1, par5, Block.vine.blockID, 2); } if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + j1, par5 - 1)) { this.setBlockAndMetadata(par1World, par3, par4 + j1, par5 - 1, Block.vine.blockID, 1); } if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + j1, par5 + 1)) { this.setBlockAndMetadata(par1World, par3, par4 + j1, par5 + 1, Block.vine.blockID, 4); } } } } if (this.vinesGrow) { for (j1 = par4 - 3 + l; j1 <= par4 + l; ++j1) { k1 = j1 - (par4 + l); i2 = 2 - k1 / 2; for (j2 = par3 - i2; j2 <= par3 + i2; ++j2) { for (k2 = par5 - i2; k2 <= par5 + i2; ++k2) { Block block = Block.blocksList[par1World.getBlockId(j2, j1, k2)]; if (block != null && block.isLeaves(par1World, j2, j1, k2)) { if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2 - 1, j1, k2) == 0) { this.growVines(par1World, j2 - 1, j1, k2, ; } if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2 + 1, j1, k2) == 0) { this.growVines(par1World, j2 + 1, j1, k2, 2); } if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2, j1, k2 - 1) == 0) { this.growVines(par1World, j2, j1, k2 - 1, 1); } if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2, j1, k2 + 1) == 0) { this.growVines(par1World, j2, j1, k2 + 1, 4); } } } } } if (par2Random.nextInt(5) == 0 && l > 5) { for (j1 = 0; j1 < 2; ++j1) { for (k1 = 0; k1 < 4; ++k1) { if (par2Random.nextInt(4 - j1) == 0) { i2 = par2Random.nextInt(3); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[k1]], par4 + l - 5 + j1, par5 + Direction.offsetZ[Direction.rotateOpposite[k1]], Block.cocoaPlant.blockID, i2 << 2 | k1); } } } } } return true; } else { return false; } } } else { return false; } } /** * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length */ private void growVines(World par1World, int par2, int par3, int par4, int par5) { this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5); int i1 = 4; while (true) { --par3; if (par1World.getBlockId(par2, par3, par4) != 0 || i1 <= 0) { return; } this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5); --i1; } } BiomeGenAutumnForest: /** The tree generator. */ public WorldGenYellowTree worldGeneratorYellowTrees; public WorldGenOrangeTree worldGeneratorOrangeTrees; public BiomeGenAutumnForest(int id) { super(id); this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4)); this.theBiomeDecorator.treesPerChunk = 10; this.theBiomeDecorator.grassPerChunk = 2; } public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { return (WorldGenerator) (par1Random.nextInt(5) == 0 ? this.worldGeneratorForest : (par1Random.nextInt(10) == 0 ? this.worldGeneratorYellowTrees : this.worldGeneratorOrangeTrees)); }
  16. My custom flower keeps crashing from the "canBlockStay" part of my code. Not sure what the problem is because its mostly copied from the minecraft BlockFlower class. public class BlockOrangeFlower extends Block implements IPlantable { public BlockOrangeFlower(int par1, Material par2Material) { super(par1, par2Material); this.setTickRandomly(true); float f = 0.2F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f); this.setCreativeTab(CreativeTabs.tabDecorations); this.setStepSound(soundGrassFootstep); } public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4); } /** * Gets passed in the blockID of the block below and supposed to return true * if its allowed to grow on the type of blockID passed in. Args: blockID */ protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == Block.grass.blockID || par1 == Block.dirt.blockID || par1 == Block.tilledField.blockID; } /** * Lets the block know when one of its neighbor changes. Doesn't know which * neighbor changed (coordinates passed are their own) Args: x, y, z, * neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { super.onNeighborBlockChange(par1World, par2, par3, par4, par5); this.checkFlowerChange(par1World, par2, par3, par4); } /** * Ticks the block if it's been scheduled */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { this.checkFlowerChange(par1World, par2, par3, par4); } protected final void checkFlowerChange(World par1World, int par2, int par3, int par4) { if (!this.canBlockStay(par1World, par2, par3, par4)) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); } } /** * Can this block stay at this position. Similar to canPlaceBlockAt except * gets checked often with plants. */ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World .canBlockSeeTheSky(par2, par3, par4)) && (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this)); } /** * Returns a bounding box from the pool of bounding boxes (this means this * box can change after the pool has been cleared to be reused) */ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } /** * Is this block (a) opaque and (b) a full 1m cube? This determines whether * or not to render the shared face of two adjacent blocks and also whether * the player can attach torches, redstone wire, etc to this block. */ public boolean isOpaqueCube() { return false; } /** * If this block doesn't render as an ordinary block it will return False * (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } /** * The type of render function that is called for this block */ public int getRenderType() { return 1; } @Override public EnumPlantType getPlantType(World world, int x, int y, int z) { // TODO Auto-generated method stub return null; } @Override public int getPlantID(World world, int x, int y, int z) { // TODO Auto-generated method stub return 0; } @Override public int getPlantMetadata(World world, int x, int y, int z) { // TODO Auto-generated method stub return 0; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(Main.modid + ":" + this.getUnlocalizedName2()); } } Crash: java.lang.NullPointerException 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.block.Block.canSustainPlant(Block.java:2213) 2013-04-26 23:51:08 [iNFO] [sTDERR] at derek.main.BlockOrangeFlower.canBlockStay(BlockOrangeFlower.java:79) 2013-04-26 23:51:08 [iNFO] [sTDERR] at derek.main.BlockOrangeFlower.canPlaceBlockAt(BlockOrangeFlower.java:31) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.block.Block.canPlaceBlockOnSide(Block.java:939) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.block.Block.canPlaceBlockOnSide(Block.java:921) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.world.World.canPlaceEntityOnSide(World.java:3773) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.item.ItemBlock.canPlaceItemBlockOnSide(ItemBlock.java:180) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1315) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1799) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:834) 2013-04-26 23:51:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:759) 2013-04-26 23:51:08 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) Any help appreciated.
  17. Heres the log was the same with my items in block ID range, ande the same with my items in Item ID range....
  18. I can change that later. It still wouldnt explain why the ID's would revert to 256, though. Or would it?
  19. Hi, for some reason my config file wont work. Everytime I launch, all my item ID's revert to 256. They all override eachother, when the config file has different values. Please help!
  20. Ok, I hav the custom texture. how would i make it switch to the new texture when the person clicks at that angle? (Sorry, newb)
  21. I currently have this: That allows me to place it on the ceiling. But how can i rotate the flower to be upside-down?
  22. I Forgot to add this line of code: EntityRegistry.registerModEntity(EntityBlueCrystal.class, "BlueCrystal", cpw.mods.fml.common.registry.EntityRegistry.findGlobalUniqueEntityId(), this, 64, 1, true); Fixed
  23. My custom projectile is invisible when I shoot it from my custom bow.When set to EntityArrow it shoots just fine, but when i change it to EntityBlueCrystal the arrows do not render, although sound and damage is working (animals appear to get hit still). Any help appreciated: Client Proxy Class: EntityBlueCrystal Class (Copied from entity arrow, changed some variables) RenderBlueCrystalClass: I do not have anything in my main mod file regarding the projectile (I'm not sure what I am supposed to put to register it there, only put It in the client proxy (New Modder)).
×
×
  • Create New...

Important Information

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