-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
[1.8][SOLVED] Player F3 information
Choonster replied to Sakuya is my waifu's topic in Modder Support
The debug text is assembled in GuiOverlayDebug#call (for the text on the left) and GuiOverlayDebug#getDebugInfoRight (for the text on the right). -
In single player, the integrated server will fire all server-side events (including BreakEvent and ServerChatEvent ).
-
Send values from one Block(TileEntity) to another [1.8]
Choonster replied to ItsAMysteriousYT's topic in Modder Support
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). -
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.
-
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.
-
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.
-
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.
-
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.
-
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).
-
[SOLVED][1.7.10] - Player max health AttributeModifier
Choonster replied to Agravaine's topic in Modder Support
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. -
Just like in 1.7.10, there's an overload of setBlockState with and without the flags argument.
-
Extend BlockBush (or the appropriate subclass) and override getCollisionBoundingBox to return the same thing as the implementation in Block .
-
You still have a syntax error in your model. Did you remove the semicolon?
-
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.
-
How would I go about drawing shapes using the GL library?
Choonster replied to UntouchedWagons's topic in Modder Support
Rendering of the fishing line and bobber is done in RenderFish . -
[1.8] Making a crafting recipe item back (or another item)
Choonster replied to Lycarah's topic in Modder Support
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 . -
[1.8] Making a crafting recipe item back (or another item)
Choonster replied to Lycarah's topic in Modder Support
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. -
[1.8] Get Minecraft block by unlocalized name
Choonster replied to LordMastodon's topic in Modder Support
They're usually similar, but not always the same. The wiki does have a list of all vanilla block and item names here, though. -
[1.8] Get Minecraft block by unlocalized name
Choonster replied to LordMastodon's topic in Modder Support
Yes. -
[1.8] Get Minecraft block by unlocalized name
Choonster replied to LordMastodon's topic in Modder Support
You don't. Just pass the mod ID and item name as separate arguments. -
[1.8] Get Minecraft block by unlocalized name
Choonster replied to LordMastodon's topic in Modder Support
Why not use the item's GameRegistry name and GameRegistry.findItem ? -
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?