Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. The debug text is assembled in GuiOverlayDebug#call (for the text on the left) and GuiOverlayDebug#getDebugInfoRight (for the text on the right).
  2. In single player, the integrated server will fire all server-side events (including BreakEvent and ServerChatEvent ).
  3. If you want a ticking TileEntity in 1.8, implement IUpdatePlayerListBox . Block#randomDisplayTick is client-only, so it's not really suitable for processes that need to run on the server (like energy transfers).
  4. You need to override Item#requiresMultipleRenderPasses to return true and Item#getIcon(ItemStack stack, int pass) to return the particle icon on pass 0 and the book icon on pass 1. Look at the vanilla overrides of Item#getIconFromDamageForRenderPass for examples of multi-layer items.
  5. To allow falling blocks to collide with the block but other entities to pass through it, you need to override Block#addCollisionBoxesToList to only call the super method if the Entity is an instance of EntityFallingBlock . I have an example of this here.
  6. This exception is thrown when the ingredient ItemStack for one of the characters in the pattern string is null (a character with a null ingredient is not the same as a character with no ingredient specified). For this recipe, I think you'll need to assemble the pattern strings dynamically - for each ingredient index: if the ingredient for the index exists, use the corresponding character; else use a space.
  7. Why are you creating a new ItemStack with the same Item and stack size but using the Block 's metadata instead of the existing ItemStack 's metadata? The metadata values used by Saplings aren't the same values as those used by Leaves. Block#getDrops already returns a list of ItemStack s with the correct metadata values for you, there's no need to subvert it. You shouldn't need to create a new Random for each iteration of the loop, create an instance once, store it as an instance field of your class and use that.
  8. Each event is fired on a specific event bus, you need to register your handler with the right bus to receive the event. Forge's events are fired on one of its three event buses (usually MinecraftForge.EVENT_BUS , but there's also TERRAIN_GEN_BUS and ORE_GEN_BUS ); FML's events are fired on its own event bus ( FMLCommonHandler.instance().bus() ). The doc comment of an event class will often tell you which bus it's fired on, but you can also use your IDE's Find Usages/Call Hierarchy tool to see where it's instantiated and thus which bus it's fired on.
  9. For a command, you can use CommandBase.func_175757_a to parse a BlockPos from x, y and z coordinate arguments. The int argument is the starting index of the command's coordinate arguments and the boolean argument is whether to use the centre coordinate of the block (i.e. add 0.5) if the user specified an absolute integer coordinate. I'm not really sure why the last argument is necessary.
  10. No need to use events if it's your own Block . Override Block#getPlayerRelativeBlockHardness to return -1.0f to prevent a player from starting to mine the Block and override Block#removedByPlayer to return false to prevent a player from breaking the Block (probably not strictly needed for vanilla, but mods with AoE mining tools like Tinkers Construct may break a Block without checking its hardness).
  11. That code is designed to apply modifiers from an equipment ItemStack (held item or equipped armour). If you're applying a modifier from some other mechanic, that's not the way to do it. Saved modifiers only save when the Entity is written to NBT (generally when saving the world). When a player respawns, a new EntityPlayer is created (without copying the attribute NBT) and PlayerEvent.Clone is fired; you should be able to use this event to reapply the modifiers.
  12. Just like in 1.7.10, there's an overload of setBlockState with and without the flags argument.
  13. Extend BlockBush (or the appropriate subclass) and override getCollisionBoundingBox to return the same thing as the implementation in Block .
  14. You still have a syntax error in your model. Did you remove the semicolon?
  15. As the log says, you have a syntax error in your redstonesword model (an unclosed string with a semicolon after it). JSONLint will tell you what the problem is in more detail.
  16. Rendering of the fishing line and bobber is done in RenderFish .
  17. You'll probably need to make your own recipe class that implements IRecipe (extending an existing implementation will simplify things) and override IRecipe#getRemainingItems to return an array containing the container item for each slot (if any) and your custom remaining item for any slot containing the appropriate vanilla item. ForgeHooks.defaultRecipeGetRemainingItems will create and fill an array of the container items, so you can just search for the vanilla item. If you extend an existing shaped/shapeless recipe class, you can probably just call super.getRemainingItems instead of the ForgeHooks method. Make sure you register your recipe class with RecipeSorter.register .
  18. If it's your own item that should give something back, you need to use the container item system. I've written an example of an unbreaking container item (never breaks) and a breaking container item (breaks after a fixed number of uses). You can see how to use them in recipes here. These examples are for 1.7.10, but should work in 1.8 as well.
  19. I don't think Minecraft imposes a maximum length. The file will be compressed when its in the mod's JAR, I don't think you can compress it in any other way. I'm not sure why there'd be a pause. Do you get a pause when playing the OGG in a normal audio player?
  20. They're usually similar, but not always the same. The wiki does have a list of all vanilla block and item names here, though.
  21. You don't. Just pass the mod ID and item name as separate arguments.
  22. Why not use the item's GameRegistry name and GameRegistry.findItem ?
  23. I copied your sounds.json into my own, put an audio file at assets/testmod2/sounds/audio/test.ogg and created a new record class using "record.rawk" as the sound event and it worked without issue. You can see what I did here.
  24. 90% of the code in SummontheRawk is pointless, there's no need to override a super method to do exactly the same thing. All you need to override is getRecordResource . When you do override a method, you should add the @Override annotation to it. You can print text to the log/console using the standard System.out (for quick and dirty debugging) or FMLLog (for properly formatted output). You can also use a wrapper around FMLLog , like this. You can also set breakpoints and launch Minecraft in debug mode. Do you get any warnings from SoundManager earlier in the log?
×
×
  • Create New...

Important Information

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