Jump to content

DaveTheModder

Members
  • Posts

    19
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I code things.

DaveTheModder's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I would agree, but I've seen other mods do it the same way with apparently no issues. Maybe I should create a custom WorldChunkManager?
  2. I'm trying to create custom dimensions. For development purposes only, I have it so that when a certain shovel is right-clicked, the player teleports to the dimension. The problem is that whenever I right click the shovel it takes me to the dimension for a tiny bit of time, but then takes me to the nether. Occasionally, it'll take me to the dimension, but not often. Here is my WorldProvider class: Here is my ChunkProvider class: If it helps, here is my custom BiomeGen: Any ideas what is causing the problem? Thanks for help!
  3. I have a class called ArrowCount which creates a string of text to render on the screen. It renders fine, but when I try to reposition it, the text moves when changing the gui size in the Minecraft settings. Here's my class: public class ArrowCount { private static Minecraft mc = Minecraft.getMinecraft(); public static int arrowCount = 20; public static void renderToHud() { if((mc.inGameHasFocus) || (mc.currentScreen != null) && (mc.currentScreen instanceof GuiChat) && !mc.gameSettings.showDebugInfo) { ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); FontRenderer fontRender = mc.fontRendererObj; int width = res.getScaledWidth(); int height = res.getScaledHeight(); int arrows = arrowCount; String arrowCount = "Arrows: " + arrows; int x = width / 2; int y = (height / 2) + 82; int color = 0xffffff; mc.fontRendererObj.drawStringWithShadow(arrowCount, x, y, color); } } } I thought about this, and I'm pretty sure that because in the integer y, when I added 82, it always displays it in the same spot because 82 is static and will not change. Does anyone know how I can have the text in the same spot no matter what size the gui is? Thanks
  4. Ok, I changed it to this: <code>public class ModEventHandler { @SubscribeEvent public void interact(PlayerInteractEvent event) { Action action = event.action; EntityPlayer player = event.entityPlayer; World world = player.worldObj; Block block = world.getBlockState(event.pos).getBlock(); if(action != event.action.RIGHT_CLICK_AIR) { if(action == event.action.RIGHT_CLICK_BLOCK) { System.out.println("UUUUUUUUUUU"); if(block == Blocks.chest) { if(!world.isRemote) { EntityZombie entity = new EntityZombie(world); entity.setPosition(player.posX, player.posY + 2, player.posZ); world.spawnEntityInWorld(entity); world.setBlockState(event.pos, Blocks.bedrock.getDefaultState()); } } } } } }</code> And it still gives me the same error. It directs me to the line where I define the block variable. EDIT: Oh. Derp. Don't answer this yet.
  5. I got rid of the part where it checks to make sure block != null, and it still gives me the error Here's my code: <code>public class ModEventHandler { @SubscribeEvent public void interact(PlayerInteractEvent event) { Action action = event.action; EntityPlayer player = event.entityPlayer; World world = player.worldObj; Block block = world.getBlockState(event.pos).getBlock(); if(action.RIGHT_CLICK_BLOCK != null) { System.out.println("UUUUUUUUUUU"); if(block == Blocks.chest) { if(!world.isRemote) { EntityZombie entity = new EntityZombie(world); entity.setPosition(player.posX, player.posY + 2, player.posZ); world.spawnEntityInWorld(entity); world.setBlockState(event.pos, Blocks.bedrock.getDefaultState()); } } } } }</code>
  6. That successfully sets the block and summons the entity, but if I right click anything but a chest, even air, it crashes, saying this:
  7. I'm working on a 1.8 mod, and I'm having trouble setting and getting blocks. What I'm trying to do is spawn an entity when a chest is right clicked, but I can't figure out how to do it. Here is how I'd do it prior to 1.8: public class ModEventHandler { @SubscribeEvent public void interact(PlayerInteractEvent event) { Action action = event.action; EntityPlayer player = event.entityPlayer; World world = player.worldObj; Block block = world.getBlock(event.x, event.y, event.z); if(action.RIGHT_CLICK_BLOCK != null) { if(event.world.getBlock(event.x, event.y, event.z) == Blocks.chest) { if(!world.isRemote) { EntityZombie entity = new EntityZombie(world); entity.setPosition(event.x, event.y + 2, event.z); world.spawnEntityInWorld(entity); world.setBlock(event.x, event.y, event.z, Blocks.bedrock); } } } } } But I'm not sure how to accomplish this in 1.8, as there are no setBlock/getBlock methods. How can I do this?
  8. Oh. Derp. Thanks for your help!
  9. Hey all, I'm working on a 1.8 mod, and I'm having trouble with the JSON files. No matter what I do, it always gives an error in the console and shows the default black/purple texture on the block. Here's the error: Here is my assets/dark/models/item/darkGrass.json (FWI, dark is my modid and darkGrass is the variable name of my block.) Here is my assets/dark/models/block/darkGrass.json: Here is my assets/dark/blockstates/darkGrass.json: I render the block in init using: Any idea what's wrong? Thanks for all help!
  10. Ah, well, I guess if nothing works I could just have it chase the player as an EntityMob but never actually hurt him. Thanks for your help!
  11. What works: What doesn't work:
  12. Erm... Not exactly the question I had in the post, but I appreciate the thought!
  13. Bumperino. If anyone has a solution to this, I'd appreciate all help! (NOTE: I didn't see anything in the rules banning bumping, so... @_@)
  14. Here's my RenderNPC: Here's my ClientProxy:
×
×
  • Create New...

Important Information

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