Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. You should probably review the basics of Java before you try to mod. A class can only extend a single class. Just extend BlockLog instead of Block . You don't need to override Block#getRenderType unless you want to use a different renderer to the super class. Block uses 3 (JSON model) and BlockLog doesn't override it. Your addInformation method won't do anything unless you're calling it yourself. It doesn't override any super method.
  2. TileEntity#getTileData isn't meant to be used for your own TileEntities , it's meant to be used with TileEntities from vanilla or other mods. It returns an NBT tag completely separate from the NBT you read from/write to in TileEntity#readFromNBT and TileEntity#writeToNBT . Your Block#getExtendedState override should be calling TileEntityMimicBlock#getState on the TileEntity at the Block 's position.
  3. You'll need to be a bit more specific than that. What are you trying to do, how is it not working, what errors are you getting?
  4. Waila calls IWailaDataProvider#getNBTData on the server, so you can just write the appropriate values from the TileEntity to the NBT. If you don't register an NBT provider for the Block or TileEntity, Waila will simply call TileEntity#wrtieToNBT for you. You should use the IWailaDataAccessor 's NBT directly rather than the TileEntity in getWailaStack , getWailaHead , getWailaBody and getWailaTail methods.
  5. BlockLog overrides onBlockPlaced to set the rotation of the log from the side of the other Block that the player clicked on. If you extend BlockLog , this will be done for you. The log models use block/cube_column and block/column_side as the parent models for the regular and side models, respectively. Look at the blockstates file for any log type to see how it selects the model to use.
  6. ChunkProviderHell and ChunkProviderEnd in the net.minecraft.world.gen package. In IDEA, you can press Ctrl-N and start typing a class name to search your project and libraries for matching classes. Eclipse probably has a similar feature.
  7. Are you not aware that 1.8 uses JSON models for most blocks and items?
  8. I see, thanks for that explanation then. That makes me curious how the entitydata command works, perhaps it calls the readfromNBT function again. If you look at its implementation in 1.8, you'll see that it tells the Entity to write itself to NBT, merges that with the NBT specified in the command and then tells the Entity to read from the merged NBT. To address your initial confusion of ThrownPotion vs. EntityPotion : every Entity class is registered with a unique name. ThrownPotion is the name that the EntityPotion class is registered with.
  9. Use World#getBlockState to get the current block state at the specified position, then use IBlockState#getValue to get the value of each property. Some blocks have properties that aren't stored in the metadata (e.g. connection state of panes), you can use Block#getExtendedState to get an IBlockState with the actual values of these properties.
  10. You should pass the actual state ( World#getBlockState ) rather than the default state ( Block#getDefaultState ) to harvestBlock . At the time of removedByPlayer being called, the Block is still in the world.
  11. You can also download exports of the mappings from the MCPBot site. Alternatively, you can view the mappings used by your ForgeGradle workspaces in the ~/.gradle/caches/minecraft/de/oceanlabs/mcp/<channel>/<version> directory (replace ~ with %USERPROFILE% on Windows).
  12. Override the BiomeGenBase#getGrassColorAtPos method that Failender mentioned.
  13. Not unless you create your own wire, vanilla redstone can only store power levels 0-15.
  14. Try overriding Block#removedByPlayer to call Block#harvestBlock if the player that destroyed the block is in creative mode.
  15. Simply returning true from Block#onBlockActivated should prevent the Eye of Ender from spawning. I just wrote this simple example and it works without issue.
  16. Gradle skips a task if it has previously completed it and the result is still valid. Your log doesn't have any errors in it, have you tried running gradlew eclipse or gradlew idea to generate an IDE project?
  17. Re-run gradlew setupDecompWorkspace eclipse .
  18. Okay, I thought I could use the vanilla spawn egg; but I'll implement my own egg and manually increment the stats.
  19. The Fluid constructor takes a ResourceLocation each for the still and flowing icons. To change the colour of the fluid, you'll need to extend Fluid and override Fluid#getColor . You'll need to register the forge fluid model for your BlockFluid . You can see an example of this here and here.
  20. You're calling ItemStack#getItem before checking if the ItemStack (returned from player.getCurrentEquippedItem() ) is null . When it's null , you'll get a NullPointerException because you tried to call a method of a null value. getHeldItem and getCurrentEquippedItem do the exact same thing, you should really only use one. Don't use System.out.println for output that the player is supposed to see in-game. Use EntityPlayer#addChatComponentMessage to send a chat message to a player (make sure you only do it on the client or server, not both). For general logging output, use FMLLog or a wrapper around it.
  21. For the stats to be incremented, the class to ID mapping is needed. For the egg to work, the ID to class mapping is needed. For the /summon command's auto-complete to work (not a big priority), the string (name) to ID mapping is needed (though the IDs are never actually used). Should I let FML create the class <-> name mappings with EntityRegistry.addModEntity and then manually add the three ID mappings and the egg?
  22. Is the basic premise of what I'm doing (using IDs >= 256 with vanilla spawn eggs) correct? Is there a specific part of my code you think is unnecessary? EntityRegistry.registerGlobalEntityID will log an ERROR message when the ID isn't an unsigned byte, though it will still add the mapping and the egg with EntityList.addMapping . My code calls the same method.
  23. This is only for a test mod which I don't plan to update to 1.8, I have a separate test mod for each version. I ended up going with a slightly different solution, but your reference to invalid IDs pointed me in the right direction. Thanks. The solution I ended up with was using IDs in the range [256, Short.MAX_VALUE ] and calling EntityList.addMapping instead of EntityRegistry.registerGlobalEntityID to add the spawn egg. You can see the code here. In the process of testing this, I realised that Biomes O' Plenty was already using IDs >= 300 for its own entities; so I found its implementation here. This is simpler than mine, but it doesn't add the class to ID mapping so kill statistics don't work.
  24. Following the comments from diesieben07 in this thread, I thought I'd try and implement my own spawn egg that didn't use global IDs. I quickly ran into an issue: the entity kill statistics rely on EntityList.EntityEggInfo , which is tied to the global ID list. I can create my own stats for each of my entities and increment them myself; but they won't show up in the vanilla statistics GUI (the mobs section of which also relies on global IDs). Is there any way to have kill statistics that display in the vanilla GUI without global IDs?
  25. You need to call setHasSubtypes(true) on your Item , otherwise the metadata will be ignored when the player picks it up.
×
×
  • Create New...

Important Information

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