-
Posts
5170 -
Joined
-
Last visited
-
Days Won
77
Everything posted by Choonster
-
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?
-
The file paths in sounds.json are relative to assets/<modid>/sounds, so your path is invalid unless your sound file is located at assets/themoneymod/sounds/audio/test.ogg. There should be a warning from SoundHandler earlier in the log saying that the file doesn't exist and can't be added to the sound event.
-
The ResourceLocation returned from ItemRecord#getRecordResource is used as the name of a sound event, not a file. You need to create a sounds.json file in assets/themoneymod in this format. Your sound files need to go in assets/themoneymod/sounds. If you name the sound event records.<recordname> (where <recordname> is the argument you passed to the ItemRecord constructor), you can just use the name argument of getRecordResource directly. I have an example implementation of a record here and a sounds.json file here.
-
Override the method and add a String to the List for each tooltip line. You should add the lines to your lang files and use StatCollector.translateToLocal to translate them to the client's language.
-
Create your own class that extends ItemBlock and overrides Item#addInformation . This method has an ItemStack argument, which has a metadata value. Register your Block using GameRegistry#registerBlock(Block, Class<? extends ItemBlock>, String) instead of GameRegistry#registerBlock(Block, String) .
-
It looks like you've used the U+201C LEFT DOUBLE QUOTATION MARK (a.k.a smart quote) character instead of the U+0022 QUOTATION MARK character.
-
You can use InventoryPlayer#addItemStackToInventory to add an item to a player's inventory (stored in the EntityPlayer#inventory field). Where you call this from depends on when you want the item to be given to the player.
-
[1.7.10] [SOLVED] Weird NoSuchMethodError with compiled mod.
Choonster replied to Elix_x's topic in Modder Support
EntityPlayer#getItemInUse is marked as @SideOnly(Side.CLIENT) , which means that it doesn't exist on the server. To access the EntityPlayer#itemInUse field on the server, you'll need to use reflection or an access transformer. -
I think the error is caused by returning null from Item#onItemRightClick . ItemInWorldManager#tryUseItem expects a non-null ItemStack to be returned, even if its stackSize is 0 (which it explicitly checks for). Oddly enough, it does check if the returned ItemStack is null; but only after checking that the returned ItemStack is equal to the original ItemStack (which can't possibly be null at that point).
-
[SOLVED] How are vanilla stack sizes drawn on ItemStacks?
Choonster replied to Anon10W1z's topic in Modder Support
In 1.7.10 and 1.8, the stack size is drawn in RenderItem#renderItemOverlayIntoGUI . -
[solved] [1.8] Render Glitch with TileEntity
Choonster replied to LordMastodon's topic in Modder Support
You should override Block#getBlockLayer to return the appropriate layer (explained in TGG's post) and Block#isFullCube to return false . -
[solved] [1.8] Render Glitch with TileEntity
Choonster replied to LordMastodon's topic in Modder Support
You need to override Block#isOpaqueCube to return false if your Block isn't a full cube. This way the adjacent Block s will still be rendered. The Grey Ghost has a post on transparent blocks here. -
[solved] [1.8] Render Glitch with TileEntity
Choonster replied to LordMastodon's topic in Modder Support
BlockContainer overrides Block#getRenderType to return -1 (no renderer) so you can use a TESR to render the Block . If you want to use a JSON model, override it to return 3. -
Use World#getTileEntity to get the TileEntity at the specified position and then cast it to your TileEntity class.
-
You're instantiating BlockOBBaseFluid before you register your Fluid s, which is invalid. You should instantiate your Fluid s and Block s inside methods called during preInit rather than in field initialisers.