Jump to content

Choonster

Moderators
  • Posts

    5153
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. It should be okay to save the EnergyStorage in the root compound tag or a nested compound tag. It's not a slot, it doesn't need a slot number.
  2. Iterate through Potion.potionTypes until you find a Potion that returns the specified name from Potion#getName . You'll probably want to do this once at startup rather than every time you apply the effect.
  3. Thog has a 1.8.8 fork of NEI here, but I have no idea what state it's in.
  4. For 1.8 and earlier, you can install the deobfuscated versions of CodeChickenLib and CodeChickenCore to deobfuscate other mods at runtime; allowing you to use regular obfuscated mods in the development environment. Unfortunately ChickenBones hasn't ported them to 1.8.8 yet.
  5. Block#isAir is a method added by Forge. Presumably it takes parameters so mods can base the result on some property of the location (e.g. blockstate/metadata, TileEntity value, per-world or per-level values).
  6. Looking at the vanilla compass rendering code, it looks like most of your current code should still work with a few minor changes. Just use the TextureAtlasSprite 's ResourceLocation as the texture of your item model. You'll want to look at RenderItemFrame#renderItem to see how the vanilla compass is rendered in item frames and use it as the basis of your RenderItemInFrameEvent handler.
  7. This happened because LandDefender couldn't establish a connection to its local SQLite DB for some reason. Unfortunately it suppresses the exception that explains what went wrong and prints "Exception in establishing database connection" to the console when this happens (which doesn't tell anyone anything useful). It looks like the author fixed a similar issue in 0.2.1, you may want to report this again (and also tell the author to use FML's logging system and log the exception when something goes wrong).
  8. You're writing every ItemStack to the same compound tag, so each slot is overwriting the previous one. You need to write a list tag containing a compound tag for each slot's ItemStack . Include the slot number in each compound tag, skip any slots with a null ItemStack . Look at how TileEntityChest saves and loads its contents.
  9. It looks like you're still calling EntityRegistry.registerGlobalEntityID , don't do this. This method registers the entity class with the name you provide (i.e. horror ), but if you only call EntityRegistry.registerModEntity instead it will prefix the name with your mod ID (i.e. jm.horror ).
  10. I've been trying something similar to that, however it just crashes my minecraft whenever I toggle my mod. @SubscribeEvent public void onPlayerTick(TickEvent.PlayerTickEvent e) { if (AutoClickerKeyBind.isOn == true) { //FMLClientHandler.instance().getClient().playerController.attackEntity(thePlayer, objectMouseOver.entityHit); mc.getMinecraft().playerController.attackEntity(mc.thePlayer, mc.objectMouseOver.entityHit); } } In future, post crash reports if your code is crashing. Knowing what the error is makes it much easier to find the solution. In this case, TickEvent.PlayerTickEvent is fired on both the client and server threads. You should check world.isRemote to make sure you're only attacking from the client thread. The event is also fired twice per tick, so check the event's phase field and only attack in one phase.
  11. Do not use EntityRegistry.registerGlobalEntityID . It's completely unnecessary and will break things if you run out of global IDs (255 is the max and vanilla already uses a lot). If you use the overload of EntityRegistry.registerModEntity with the two additional int parameters, it will call EntityRegistry.registerEgg for you (using the two int s as the background and foreground colours of the egg). It looks like you're never actually calling the methods of EntityRegisterHorror from your main class. Side note: you don't need a separate registration class for each entity type. Are you sure the entity isn't being summoned or is it just not being rendered? Put a breakpoint in the EntityHorror constructor and run Minecraft in debug mode.
  12. Not all mobs use the new AI task system in 1.7.10, some still use the old AI system. If you want to handle these mobs, you may need to manually execute their AI tasks from LivingUpdateEvent .
  13. I explain how to simulate a right click client-side here (block that uses this, actual right click simulation). GameSettings#keyBindAttack is the left click (attack) key binding.
  14. FMLNetworkEvent.ClientConnectedToServerEvent is fired on the client side when you connect to a server (integrated or dedicated). When this fires, you can use Minecraft.getMinecraft().getCurrentServerData() to get a ServerData object describing the current server (including its IP/domain). I explain more about this event and the ServerData class here.
  15. Don't use metadata values yourself (the whole point of the blockstate system is to abstract away metadata), get the default state of a block ( Block#getDefaultState ) and then set each property to the desired value (chain IBlockState#withProperty calls). Your Block#getStateFromMeta implementation can be simplified: comparison operators like == already return boolean values, you don't need to use a ternary expression here. Consider using the != (not equal), > (greater than) or ! (not) operators here.
  16. public YourBlockClass() // Constructor of YourBlockClass { super(Material.rock); setDefaultState(blockState.getBaseState().withProperty(SOME_PROPERTY, someDefaultValue).withProperty(OTHER_PROPERTY, otherDefaultValue)); }
  17. That should work, but I have a few minor nitpicks: Name your variables properly. type isn't a type of any kind, it's the value of the LIT property so call it something like lit or isLit . Use raw primitive types (boolean ) rather than boxed primitive types ( Boolean ) when possible. Generic type arguments require boxed types, but Java will automatically box and unbox primitives as needed. See this page for more details on boxing. There's no need for the parentheses around the returned values, you can have any amount of whitespace between return and the expression. You can convert the if statement to a ternary expression.
  18. Block#onBlockActivated is called on both the client and server (like most methods). You can't store mutable data in fields of your Block or Item classes, these are singletons so only one instance of the class exists per block/item type. Any changes you make will be shared between all occurrences of the block/item. You need to use the block's IBlockState to store the activated state: Create your properties (using the IProperty implementations) and store them as public static final fields Override Block#createBlockState to return a new instance of BlockState , using this and the properties as constructor arguments Override Block#getStateFromMeta and Block#getMetaFromState to convert between the IBlockState and metadata Use blockState.getBaseState() to get the base state, then chain IBlockState#withProperty calls to set each property's value before passing the result to Block#setDefaultState in the constructor to set the default state You can use IBlockState#getValue to get the value of a property and World#setBlockState to change the state at the specified position.
  19. Have you got item models with those names in src/main/resources/assets/zylroth/models/item?
  20. You installed a 1.7.10 mod on 1.8.8. Mods only work with specific versions of Minecraft.
  21. You're using the same item model for every metadata value (the item's unlocalised name without the item. prefix).
  22. PC worlds are 30,000 x 30,000. If your world is 256 x 256, something is very wrong. Screenshots and log files may help diagnose the problem. Use Gist to post logs.
  23. Do you actually know Java? A solid understanding of Java is required to create mods. Pass the arguments of onBlockHarvested to the random class as method arguments, then do the same from the random class to the random event.
  24. What I said before still applies: you have the world, position, blockstate and player as arguments of onBlockHarvested ; so pass whichever of these you need to the random class and then pass them to the random event.
  25. You're using a 1.6.4 mod on 1.8.8. Mods only work with specific versions of Minecraft.
×
×
  • Create New...

Important Information

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