• 0

    posted a message on [Tutorial] Making an axe cut down the entirety of a tree when broken at the bottom
    This tutorial will show you how to make an axe cut down a tree from bottom to top when the lowest block is broken.

    Here's the code:

    @Override
    public boolean onBlockDestroyed(ItemStack axe, World world, int blockID, int x, int y, int z, EntityLiving thePlayer)
    {
    int offset;
    for (offset = 0; world.getBlockId(x, y + offset, z) == Block.wood.blockID; offset++)
    {
    int compY = y + offset;
    final int woodType = world.getBlockMetadata(x, compY, z);
    world.setBlock(x, compY, z, 0);
    world.spawnEntityInWorld(new EntityItem(world, x, compY, z, new ItemStack(Block.wood, 1, woodType)));
    }
    
    axe.damageItem((offset > 0) ? offset : 1, thePlayer);
    return false;
    }


    Here's the explanation:

    int offset;

    This holds the current offset of the y coordinate of the broken block.

    for (offset = 0; world.getBlockId(x, y + offset, z) == Block.wood.blockID; offset++)

    This loops until the block at "y + offset" is not a wood block. This is also the mechanism that increments the offset variable. I'm not going to explain further since if you don't know how for loops work you really shouldn't be modding ;P

    final int woodType = world.getBlockMetadata(x, compY, z);

    This holds the type of the wood that it's currently on so it's not always oak wood. Although being used only once, this is not an inline variable because the next function executed deletes the block, and would always make the metadata equal zero (oak).

    world.setBlock(x, compY, z, 0);

    This deletes the block by setting it to air.

    world.spawnEntityInWorld(new EntityItem(world, x, compY, z, new ItemStack(Block.wood, 1, woodType)));

    This spawns the wood item on the ground in world, at x, y and z, with the damage woodType.

    axe.damageItem((offset > 0) ? offset : 1, thePlayer);

    This damages the axe. In doing so, it checks if the offset is greater than 0, and if it is, damage it (value of offset) times, and if it's not, damage it once, using the conditional operator.

    I'm sure some things could be done differently, this is just how I do it.
    Posted in: Mods Discussion
  • 0

    posted a message on RS-CRAFT A RUNESCAPE MOD
    This thread has been locked indefinitely or until the OP requests it be unlocked.
    Posted in: WIP Mods
  • 0

    posted a message on [TOOL] MC Downgrader - The Time Machine for Minecraft!
    This thread is locked until request by the developer due to the sheer amount of questions.
    Posted in: Minecraft Tools
  • 1

    posted a message on AoA--25 New Dimensions• 330 Mobs• 27 Bosses• Skills• Quests• 600+Items [LARGE Bugfix Update, May 2018]
    Hello everyone,

    This is a tiny PSA regarding large error messages and stack traces.

    To avoid taking up unnecessary space in the thread, please encapsulate your error in spoiler tags. For example:

    [spoiler]

    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    [/spoiler]


    Changes to:


    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    ThisissampletextThisissampletext
    ThisissampletextThisissampletext

    Thank you.
    Posted in: Minecraft Mods
  • 1

    posted a message on TechGuy's Modding Tutorials
    Quote from kijoyo

    I had the same problem and realized you just have to type the name of the item that you created. You don't have to type Item.Whatever item you created. So if you named you item banana you would type: Character.valueOf('B'), Banana


    You don't have to use Character.valueOf. You can just put the two single quotes.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Grumdot

    No worries, thanks for replying anyway. I've mostly figured it out since yesterday.

    I now have a new problem (that I've also asked elsewhere, but the more the merrier...): I can place the entities by clicking on a block with my wand item, which removes the block and places an entity which looks and feels like a block, but I want them to look like the block they replaced, so I have this code:

    My entity file looks like this:
    public class BlockEntity extends Entity{
    public int blockId;
    public int meta;
    
    public BlockEntity(World par1World) { // #1
    super(par1World);
    ...
    }
    
    public BlockEntity(World par1World, int x, int y, int z , int blockId , int meta ) { // #2
    super(par1World);
    this.blockId = blockId;
    ...
    }
    
    ...
    }


    My wand item uses constructor #2 to create the entity, and passes in the blockId of the block that was clicked on. (Works fine)
    The plan is for the renderer to check the blockId stored here to select the correct block to render.

    But what happens is that before rendering constructor #1 gets called (not by me) and so blockId gets reset to 0! (I know this is what's happening, I've checked)
    My renderer has no way of getting the correct block ID...

    Nowhere in the code is there a call to my constructor #1 (for example the code compiles fine even if I delete constructor #1).

    The only solution I can think of atm is to create separate entities and renderers for each type of block, which is a TERRIBLE solution...

    What is calling constructor #1?
    I have to admit I'm totally stumped. How do I fix this?

    EDIT: In case you were wondering, deleting constructor #1 causes MC to crash:


    2013-02-19 19:17:56 [INFO] [STDERR] java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:17:56 [INFO] [STDERR] at lv.a(EntityList.java:139)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:401)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:103)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:83)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.f(ChunkProviderServer.java:182)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.c(ChunkProviderServer.java:118)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:310)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.a(IntegratedServer.java:84)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.c(IntegratedServer.java:100)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
    2013-02-19 19:17:56 [INFO] [STDERR] at fy.run(SourceFile:849)
    2013-02-19 19:17:56 [INFO] [STDOUT] Skipping Entity with id Grumdot_SMPships.grumdot_myentityblock
    2013-02-19 19:17:56 [INFO] [STDERR] java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:17:56 [INFO] [STDERR] at lv.a(EntityList.java:139)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:401)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:103)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:83)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.f(ChunkProviderServer.java:182)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.c(ChunkProviderServer.java:118)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:310)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.a(IntegratedServer.java:84)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.c(IntegratedServer.java:100)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
    2013-02-19 19:17:56 [INFO] [STDERR] at fy.run(SourceFile:849)
    2013-02-19 19:17:56 [INFO] [STDOUT] Skipping Entity with id Grumdot_SMPships.grumdot_myentityblock
    2013-02-19 19:17:56 [INFO] [STDERR] java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:17:56 [INFO] [STDERR] at lv.a(EntityList.java:139)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:401)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:103)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:83)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.f(ChunkProviderServer.java:182)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.c(ChunkProviderServer.java:118)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:310)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.a(IntegratedServer.java:84)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.c(IntegratedServer.java:100)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
    2013-02-19 19:17:56 [INFO] [STDERR] at fy.run(SourceFile:849)
    2013-02-19 19:17:56 [INFO] [STDOUT] Skipping Entity with id Grumdot_SMPships.grumdot_myentityblock
    2013-02-19 19:17:56 [INFO] [STDERR] java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:17:56 [INFO] [STDERR] at lv.a(EntityList.java:139)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:401)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:103)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:83)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.f(ChunkProviderServer.java:182)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.c(ChunkProviderServer.java:118)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:310)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.a(IntegratedServer.java:84)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.c(IntegratedServer.java:100)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
    2013-02-19 19:17:56 [INFO] [STDERR] at fy.run(SourceFile:849)
    2013-02-19 19:17:56 [INFO] [STDOUT] Skipping Entity with id Grumdot_SMPships.grumdot_myentityblock
    2013-02-19 19:17:56 [INFO] [STDERR] java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:17:56 [INFO] [STDERR] at lv.a(EntityList.java:139)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:401)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:103)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:83)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.f(ChunkProviderServer.java:182)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.c(ChunkProviderServer.java:118)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:310)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.a(IntegratedServer.java:84)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.c(IntegratedServer.java:100)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
    2013-02-19 19:17:56 [INFO] [STDERR] at fy.run(SourceFile:849)
    2013-02-19 19:17:56 [INFO] [STDOUT] Skipping Entity with id Grumdot_SMPships.grumdot_myentityblock
    2013-02-19 19:17:56 [INFO] [STDERR] java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:17:56 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:17:56 [INFO] [STDERR] at lv.a(EntityList.java:139)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:401)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:103)
    2013-02-19 19:17:56 [INFO] [STDERR] at aam.a(AnvilChunkLoader.java:83)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.f(ChunkProviderServer.java:182)
    2013-02-19 19:17:56 [INFO] [STDERR] at im.c(ChunkProviderServer.java:118)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:310)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.a(IntegratedServer.java:84)
    2013-02-19 19:17:56 [INFO] [STDERR] at bdz.c(IntegratedServer.java:100)
    2013-02-19 19:17:56 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
    2013-02-19 19:17:56 [INFO] [STDERR] at fy.run(SourceFile:849)
    2013-02-19 19:17:56 [INFO] [STDOUT] Skipping Entity with id Grumdot_SMPships.grumdot_myentityblock
    2013-02-19 19:18:08 [INFO] [STDOUT] ###############5
    2013-02-19 19:18:08 [INFO] [STDOUT] &&&&&&&&&&& new block entity has id 5

    2013-02-19 19:18:08 [SEVERE] [ForgeModLoader] A severe problem occurred during the spawning of an entity
    java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    at java.lang.Class.getConstructor0(Class.java:2706)
    at java.lang.Class.getConstructor(Class.java:1657)
    at cpw.mods.fml.client.FMLClientHandler.spawnEntityIntoClientWorld(FMLClientHandler.java:341)
    at cpw.mods.fml.common.FMLCommonHandler.spawnEntityIntoClientWorld(FMLCommonHandler.java:334)
    at cpw.mods.fml.common.network.EntitySpawnPacket.execute(EntitySpawnPacket.java:183)
    at cpw.mods.fml.common.network.FMLNetworkHandler.handleFMLPacket(FMLNetworkHandler.java:102)
    at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:67)
    at ayh.a(NetClientHandler.java:1483)
    at di.a(SourceFile:59)
    at cf.b(MemoryConnection.java:80)
    at ayh.d(NetClientHandler.java:240)
    at ayp.b(WorldClient.java:92)
    at net.minecraft.client.Minecraft.l(Minecraft.java:1872)
    at net.minecraft.client.Minecraft.J(Minecraft.java:846)
    at net.minecraft.client.Minecraft.run(Minecraft.java:771)
    at java.lang.Thread.run(Thread.java:662)
    2013-02-19 19:18:09 [INFO] [ForgeModLoader] Unloading dimension 0
    2013-02-19 19:18:09 [INFO] [ForgeModLoader] Unloading dimension -1
    2013-02-19 19:18:09 [INFO] [ForgeModLoader] Unloading dimension 1
    2013-02-19 19:18:10 [INFO] [STDERR] t: Exception in world tick
    2013-02-19 19:18:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.l(Minecraft.java:1888)
    2013-02-19 19:18:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.J(Minecraft.java:846)
    2013-02-19 19:18:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:771)
    2013-02-19 19:18:10 [INFO] [STDERR] at java.lang.Thread.run(Thread.java:662)
    2013-02-19 19:18:10 [INFO] [STDERR] Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:18:10 [INFO] [STDERR] at com.google.common.base.Throwables.propagate(Throwables.java:160)
    2013-02-19 19:18:10 [INFO] [STDERR] at cpw.mods.fml.client.FMLClientHandler.spawnEntityIntoClientWorld(FMLClientHandler.java:394)
    2013-02-19 19:18:10 [INFO] [STDERR] at cpw.mods.fml.common.FMLCommonHandler.spawnEntityIntoClientWorld(FMLCommonHandler.java:334)
    2013-02-19 19:18:10 [INFO] [STDERR] at cpw.mods.fml.common.network.EntitySpawnPacket.execute(EntitySpawnPacket.java:183)
    2013-02-19 19:18:10 [INFO] [STDERR] at cpw.mods.fml.common.network.FMLNetworkHandler.handleFMLPacket(FMLNetworkHandler.java:102)
    2013-02-19 19:18:10 [INFO] [STDERR] at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:67)
    2013-02-19 19:18:10 [INFO] [STDERR] at ayh.a(NetClientHandler.java:1483)
    2013-02-19 19:18:10 [INFO] [STDERR] at di.a(SourceFile:59)
    2013-02-19 19:18:10 [INFO] [STDERR] at cf.b(MemoryConnection.java:80)
    2013-02-19 19:18:10 [INFO] [STDERR] at ayh.d(NetClientHandler.java:240)
    2013-02-19 19:18:10 [INFO] [STDERR] at ayp.b(WorldClient.java:92)
    2013-02-19 19:18:10 [INFO] [STDERR] at net.minecraft.client.Minecraft.l(Minecraft.java:1872)
    2013-02-19 19:18:10 [INFO] [STDERR] ... 3 more
    2013-02-19 19:18:10 [INFO] [STDERR] Caused by: java.lang.NoSuchMethodException: SMPships.MyBlockEntity.<init>(yc)
    2013-02-19 19:18:10 [INFO] [STDERR] at java.lang.Class.getConstructor0(Class.java:2706)
    2013-02-19 19:18:10 [INFO] [STDERR] at java.lang.Class.getConstructor(Class.java:1657)
    2013-02-19 19:18:10 [INFO] [STDERR] at cpw.mods.fml.client.FMLClientHandler.spawnEntityIntoClientWorld(FMLClientHandler.java:341)
    2013-02-19 19:18:10 [INFO] [STDERR] ... 13 more
    2013-02-19 19:18:20 [INFO] [STDOUT] Stopping!
    2013-02-19 19:18:20 [INFO] [STDOUT] SoundSystem shutting down...
    2013-02-19 19:18:20 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
    2013-02-19 19:18:20 [INFO] [STDERR] Exception in thread "Minecraft main thread" org.lwjgl.LWJGLException: X Error - disp: 0x7fbf3c060410 serial: 5446 error: BadWindow (invalid Window parameter) request_code: 2 minor_code: 0
    2013-02-19 19:18:20 [INFO] [STDERR] at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:318)
    2013-02-19 19:18:20 [INFO] [STDERR] at org.lwjgl.opengl.LinuxKeyboard.nSetDetectableKeyRepeat(Native Method)
    2013-02-19 19:18:20 [INFO] [STDERR] at org.lwjgl.opengl.LinuxKeyboard.setDetectableKeyRepeat(LinuxKeyboard.java:152)
    2013-02-19 19:18:20 [INFO] [STDERR] at org.lwjgl.opengl.LinuxKeyboard.destroy(LinuxKeyboard.java:163)
    2013-02-19 19:18:20 [INFO] [STDERR] at org.lwjgl.opengl.LinuxDisplay.destroyKeyboard(LinuxDisplay.java:1203)
    2013-02-19 19:18:20 [INFO] [STDERR] at org.lwjgl.input.Keyboard.destroy(Keyboard.java:349)
    2013-02-19 19:18:20 [INFO] [STDERR] at net.minecraft.client.Minecraft.e(Minecraft.java:723)
    2013-02-19 19:18:20 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:801)
    2013-02-19 19:18:20 [INFO] [STDERR] at java.lang.Thread.run(Thread.java:662)


    EDIT 2: Here is a stack trace for constructor #1:


    java.lang.Exception
    2013-02-19 20:04:53 [INFO] [STDERR] at SMPships.BlockEntity.<init>(BlockEntity.java:61)
    2013-02-19 20:04:53 [INFO] [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2013-02-19 20:04:53 [INFO] [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    2013-02-19 20:04:53 [INFO] [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    2013-02-19 20:04:53 [INFO] [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    2013-02-19 20:04:53 [INFO] [STDERR] at cpw.mods.fml.client.FMLClientHandler.spawnEntityIntoClientWorld(FMLClientHandler.java:341)
    2013-02-19 20:04:53 [INFO] [STDERR] at cpw.mods.fml.common.FMLCommonHandler.spawnEntityIntoClientWorld(FMLCommonHandler.java:334)
    2013-02-19 20:04:53 [INFO] [STDERR] at cpw.mods.fml.common.network.EntitySpawnPacket.execute(EntitySpawnPacket.java:183)
    2013-02-19 20:04:53 [INFO] [STDERR] at cpw.mods.fml.common.network.FMLNetworkHandler.handleFMLPacket(FMLNetworkHandler.java:102)
    2013-02-19 20:04:53 [INFO] [STDERR] at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:67)
    2013-02-19 20:04:53 [INFO] [STDERR] at ayh.a(NetClientHandler.java:1483)
    2013-02-19 20:04:53 [INFO] [STDERR] at di.a(SourceFile:59)
    2013-02-19 20:04:53 [INFO] [STDERR] at cf.b(MemoryConnection.java:80)
    2013-02-19 20:04:53 [INFO] [STDERR] at ayh.d(NetClientHandler.java:240)
    2013-02-19 20:04:53 [INFO] [STDERR] at ayp.b(WorldClient.java:92)
    2013-02-19 20:04:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.l(Minecraft.java:1872)
    2013-02-19 20:04:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.J(Minecraft.java:846)
    2013-02-19 20:04:53 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:771)
    2013-02-19 20:04:53 [INFO] [STDERR] at java.lang.Thread.run(Thread.java:662)
    Is this problem something to do with the entity being spawned in both client and server?

    My client proxy has nothing but:
    MinecraftForgeClient.preloadTexture("smpShipsBlocks.png");
    RenderingRegistry.registerEntityRenderingHandler( BlockEntity.class, new BlockEntityRender() );


    And my common proxy has nothing happening in it at all.

    My wand Item class spawns the new entity:
    par3World.spawnEntityInWorld( new BlockEntity(par3World, par4 , par5 , par6 , blockID , blockMeta ) );


    Is that all correct?


    You could try storing the block ID integers in a separate class and making an erase method or something. It may not be very efficient but it's all I can think of at the moment. I wrote a concept for you: http://pastebin.com/EUmGXyPs
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Grumdot

    Hi all,

    I've asked this in another tute forum but had no luck. Hoping someone here will know...

    How do I create an entity that looks and feels (i.e. collides with player, from the side, top and bottom) like a block?

    I've attempted this, and I have a little wand item to test my code with that turns the block its clicked on to air, and then places a mod entity in the same place, but I can't figure out how to create and place a "block" entity (an entity that looks and feels like a block) instead.....

    Help please?


    Here are the relevant files I have at the moment:

    Mod file

    package Wand;
    
    import net.minecraft.block.Block;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityEggInfo;
    import net.minecraft.entity.EntityList;
    import net.minecraft.entity.EnumCreatureType;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.biome.BiomeGenBase;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.Init;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.network.NetworkMod;
    import cpw.mods.fml.common.registry.EntityRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.common.registry.LanguageRegistry;
    
    @Mod(modid = "Grumdot_Wand", name = "Wand", version = "0.1")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
    
    public class Wand {
    
    	public static Item tutorialItem;
    
    	@SidedProxy(clientSide = "Wand.ClientProxyWand", serverSide = "Wand.CommonProxyWand")
    	public static CommonProxyWand proxy;
    
    	@Init
    	public void load(FMLInitializationEvent event)
    		proxy.registerRenderThings();	
    
    //create wand item
    		tutorialItem = new ItemTutorial( 5000 ).setIconIndex( 0 ).setItemName( "tutorial" );
    		LanguageRegistry.addName( tutorialItem , "Tutorial Item" );
    
    //create tutorial mob entity
    		EntityRegistry.registerModEntity( EntityTutorial.class , "tutorial" , 1, this , 80, 3, true);
    		LanguageRegistry.instance().addStringLocalization("entity.grumdot_Wand.tutorial.name", "Tutorial Monster" );
    
    	}//load
    }//class


    Item file

    package Wand;
    
    import net.minecraft.block.Block;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.World;
    
    public class ItemTutorial extends Item {
    
    	public ItemTutorial(int par1) {
    		 super(par1);
    		 this.setCreativeTab(CreativeTabs.tabMaterials);
    	}
    
    	public String getTextureFile()	{
    			return "/wand.png";
    	}
    
    //when click on block with wand
    	public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)	{
    
    		if( !par3World.isRemote && par3World.blockExists(par4, par5, par6) ) {//only place on the server side, not on client , and only if block exists
    
    int blockID = par3World.getBlockId( par4, par5 , par6 ); //get block type
    
    			par3World.setBlock(par4, par5, par6, 0 ); //set to air
    
    			Entity e = new EntityTutorial( par3World ); //spawn entity where block was
    			e.setPosition( par4, par5, par6);
    			par3World.spawnEntityInWorld(e);
    
    			return true;
    		}
    		return false;
    	}//on use
    }



    Entity file

    package Wand;
    
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.monster.EntityMob;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.World;
    
    public class EntityTutorial extends EntityMob {
    
    public EntityTutorial(World par1World) {
    super(par1World);
    this.texture = "/Wand.png";
    this.moveSpeed = 0.25F;
    }
    
    public int getMaxHealth() {
    return 20;
    }
    
    public int getAttackStrength(Entity par1Entity)	 {
    return 4;
    }
    
    protected boolean isAIEnabled()	 {
    return false;
    }
    
    		public int getTotalArmorValue()	 {
    return 2;
    }
    
    		protected int getDropItemId()	 {//normal drop in death	
    return Item.ingotGold.itemID;
    }
    
    }//class


    Render file

    package Wand;
    
    import net.minecraft.client.renderer.entity.RenderLiving;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLiving;
    
    public class RenderTutorial extends RenderLiving {
    
    protected ModelTutorial model;
    
    public RenderTutorial (ModelTutorial modelTutorial, float f) {
    	super(modelTutorial, f);
    	model = ((ModelTutorial)mainModel);
    }
    
    	public void renderTutorial(EntityTutorial entity, double par2, double par4, double par6, float par8, float par9)	 {
    		super.doRenderLiving(entity, par2, par4, par6, par8, par9);
    	}
    
    
    public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)	 {
    		renderTutorial((EntityTutorial)par1EntityLiving, par2, par4, par6, par8, par9);
    	}
    
    
    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)	 {
    		renderTutorial((EntityTutorial)par1Entity, par2, par4, par6, par8, par9);
    	}
    
    }



    As entities are not my specialty, my best suggestion would be to take some pointers from the falling sand/gravel entities.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from jokrage

    I hate of everybody is a fanboy of Forge. I find forge overcomplicates things, so much easier to use modloader.


    I'm getting flat out sick of this. Please refrain (read: STOP ENTIRELY) from posting for the sole purpose of criticizing something. As TechGuy put it, it's not even constructive, and no one wants to hear it.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from PirateCody

    wtf????? No more modloader tuts?!?!?? THIS SUCKS. I WILL NO LONGER BE SUPPORTING THESE TUTORIALS!


    And why not, exactly? Switching to Forge is beyond easy, and does not force much on you like ModLoader does. ModLoader is also completely stagnant, while Forge is getting new features very often. I may as well leave it at that.

    Quote from Capn_Jack

    I see, sort of having trouble with getting the code to work, how exactly do i set the string as null? .-.


    in the EntityKtf.java:
    public String getTexture;
    {
    this.texture = "/moditems/modskin.png";
    public boolean interact(EntityPlayer par1EntityPlayer)
    {
    ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
    if (var2 != null && var2.itemID == mod_KtfMod.ItemMask.shiftedIndex)
    {
    	 if (--var2.stackSize <= 0)
    	 {
    		 par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk));
    	 }
    	 else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk)))
    	 {
    		 par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.shiftedIndex, 1, 0));
    	 }
    	 return true;
    }
    else
    {
    	 return super.interact(par1EntityPlayer);
    }
    }
    }

    m
    *code is just the "snippet," if you will*


    Which string? The mob texture? You could either remove it completely, set it to a blank one, or put 'null' where you'd put the directory.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from ghosrec35

    That is the worst advice i've ever seen given for Forge. The entire idea behind forge is to place your files in your own packages so that you are not required to install your mod within the minecraft.jar, and can merely place a zipped version of your mod into the mods folder. Forge aims to move away from JarMods, except in the case of allowing for compatibilities with ModLoader mods.



    You will create your own package to place all your files in. Some common package conventions are: Here


    I'm not even sure why I said that myself. I use my own packages. Wow, for some reason a ModLoader mindset just popped up for some reason...
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from Diddie

    Hey, I got a question about the forge modding tutorials. Where do I put my main class (that one that registers the iitems, blocks etc.)?


    Edit: ghosrec35's got this.

    \/ \/
    Posted in: Mapping and Modding Tutorials
  • 1

    posted a message on TechGuy's Modding Tutorials
    Quote from Wei123

    I haven't tried to recompile my mod yet. I just need to change the codes for 1.4.7.


    ...you have to recompile it in order to get errors so you/we can fix it...
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Doctor Who Client Mod - Open Alpha Now Available to play NOW! (Bigger on the Inside, TARDIS Flight, Planets, Sonics & way MORE!)
    This is just...
    hnnnnnnnnnnnnnnnnnnnnnnng.
    It looks so amazing.
    Posted in: WIP Mods
  • 1

    posted a message on TechGuy's Modding Tutorials
    Quote from C0rpal

    Are you planning to finish the dimension tutorial? NO RUSH! just wondering.

    //C0rpal


    Quote from TechGuy543 »

    This section is under work. I will try not to let it die like the gui tutorial did. By the time this tutorial is fully done, it will probably be my most comprehensive tutorial by far.
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from PirateCody

    Are you gonna finish/ work on the modloader tutorials?


    I believe he said he will keep those up to date as well.

    Quote from collon29


    --- BEGIN ERROR REPORT 888ad383 --------
    Full report at:
    C:\Users\Jason\Desktop\Minecraft Modding\JASON\Myth Mod\jars\.\crash-reports\crash-2013-01-07_10.54.25-client.txt
    Please show that file to Mojang, NOT just this screen!
    
    Generated 7/01/13 10:54 AM
    
    -- Head --
    Stacktrace:
    at net.minecraft.src.RenderItem.func_77020_a(RenderItem.java:252)
    at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:184)
    at net.minecraft.src.RenderItem.doRender(RenderItem.java:571)
    
    -- Entity being rendered --
    Details:
    Entity Type: Item (net.minecraft.src.EntityItem)
    Entity ID: 6396
    Name: item.item.Aqua Potion
    Exact location: 358.31, 5.31, -599.66
    Block location: World: (358,5,-600), Chunk: (at 6,0,8 in 22,-38; contains blocks 352,0,-608 to 367,255,-593), Region: (0,-2; contains chunks 0,-64 to 31,-33, blocks 0,0,-1024 to 511,255,-513)
    Momentum: -0.25, -0.01, 0.08
    
    -- Renderer details --
    Details:
    Assigned renderer: net.minecraft.src.RenderItem@3523e2
    Location: -0.01,-0.31,-0.00 - World: (-1,-1,-1), Chunk: (at 15,-1,15 in -1,-1; contains blocks -16,0,-16 to -1,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
    Rotation: 52.014706
    Delta: 0.18043041
    Stacktrace:
    at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:219)
    at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:188)
    at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:438)
    at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1100)
    at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
    
    -- Affected level --
    Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['Player234'/76, l='MpServer', x=358.32, y=5.62, z=-599.66]]
    Chunk stats: MultiplayerChunkCache: 441
    Level seed: 0
    Level generator: ID 01 - flat, ver 0. Features enabled: false
    Level generator options:
    Level spawn location: World: (449,4,-666), Chunk: (at 1,0,6 in 28,-42; contains blocks 448,0,-672 to 463,255,-657), Region: (0,-2; contains chunks 0,-64 to 31,-33, blocks 0,0,-1024 to 511,255,-513)
    Level time: 21533 game time, 8743 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Forced entities: 17 total; [EntityBlueWizard['entity.BlueWizard.name'/34, l='MpServer', x=370.74, y=4.00, z=-599.19], EntityRedWizard['entity.RedWizard.name'/35, l='MpServer', x=375.38, y=4.00, z=-605.00], EntityImp['entity.IMP.name'/32, l='MpServer', x=367.45, y=4.00, z=-604.47], EntityItem['item.item.Aqua Potion'/6396, l='MpServer', x=358.31, y=5.31, z=-599.66], EntityImp['entity.IMP.name'/33, l='MpServer', x=368.38, y=4.00, z=-604.96], EntitySaberTooth['entity.SaberTooth.name'/38, l='MpServer', x=368.50, y=4.00, z=-597.97], EntityImp['entity.IMP.name'/39, l='MpServer', x=368.50, y=4.00, z=-605.97], EntityYellowWizard['entity.YellowWizard.name'/36, l='MpServer', x=376.50, y=4.00, z=-606.00], EntityUnicorn['entity.Unicorn.name'/37, l='MpServer', x=375.72, y=4.00, z=-595.85], EntitySlime['Slime'/40, l='MpServer', x=425.65, y=4.61, z=-637.84], EntityClientPlayerMP['Player234'/76, l='MpServer', x=358.32, y=5.62, z=-599.66], EntitySlime['Slime'/13, l='MpServer', x=290.41, y=4.00, z=-588.44], EntityPig['Pig'/44, l='MpServer', x=439.13, y=4.00, z=-522.13], EntityVillager['Villager'/19, l='MpServer', x=281.59, y=4.00, z=-533.78], EntityVillager['Villager'/20, l='MpServer', x=284.25, y=4.00, z=-542.75], EntityVillager['Villager'/26, l='MpServer', x=287.59, y=4.00, z=-530.44], EntitySaberTooth['entity.SaberTooth.name'/31, l='MpServer', x=368.56, y=4.00, z=-596.97]]
    Retry entities: 0 total; []
    Stacktrace:
    at net.minecraft.src.WorldClient.addWorldInfoToCrashReport(WorldClient.java:406)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2434)
    at net.minecraft.client.Minecraft.run(Minecraft.java:784)
    at java.lang.Thread.run(Unknown Source)
    
    -- System Details --
    Details:
    Minecraft Version: 1.4.6
    Operating System: Windows 8 (x86) version 6.2
    Java Version: 1.7.0_10, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 875445880 bytes (834 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 9255 (518280 bytes; 0 MB) allocated, 260 (14560 bytes; 0 MB) used
    Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftError, ReportedException, ...]
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    ModLoader: Mods loaded: 2
    ModLoader 1.4.6
    mod_Mythical v0.1
    
    LWJGL: 2.4.2
    OpenGL: AMD Radeon HD 6450 GL version 4.2.11931 Compatibility Profile Context, ATI Technologies Inc.
    Is Modded: Very likely; Jar signature invalidated
    Type: Client (map_client.txt)
    Texture Pack: Default
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 208 (11648 bytes; 0 MB) allocated, 137 (7672 bytes; 0 MB) used
    
    java.lang.ArrayIndexOutOfBoundsException: 22363
    at net.minecraft.src.RenderItem.func_77020_a(RenderItem.java:252)
    at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:184)
    at net.minecraft.src.RenderItem.doRender(RenderItem.java:571)
    at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:219)
    at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:188)
    at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:438)
    at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1100)
    at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
    at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:878)
    at net.minecraft.client.Minecraft.run(Minecraft.java:768)
    at java.lang.Thread.run(Unknown Source)
    --- END ERROR REPORT 90030bc9 ----------



    Are you using 22363 as an item ID?
    Posted in: Mapping and Modding Tutorials
  • To post a comment, please .