Everything posted by Choonster
-
[1.8]how to get block position?
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.
-
I want to write String save in box.
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
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.
-
Set a block ignoring its neighbors
Just like in 1.7.10, there's an overload of setBlockState with and without the flags argument.
-
[1.8]Solid Plants?
Extend BlockBush (or the appropriate subclass) and override getCollisionBoundingBox to return the same thing as the implementation in Block .
-
[1.8] Problem with Textures on Swords
You still have a syntax error in your model. Did you remove the semicolon?
-
[1.8] Problem with Textures on Swords
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?
Rendering of the fishing line and bobber is done in RenderFish .
-
[1.8] Making a crafting recipe item back (or another item)
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)
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.
-
Mod Help. (1.7.10) Setting Tab Background, Adding Records, Item Persistence, etc
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?
-
[1.8] Get Minecraft block by unlocalized name
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
Yes.
-
[1.8] Get Minecraft block by unlocalized name
You don't. Just pass the mod ID and item name as separate arguments.
-
[1.8] Get Minecraft block by unlocalized name
Why not use the item's GameRegistry name and GameRegistry.findItem ?
-
Mod Help. (1.7.10) Setting Tab Background, Adding Records, Item Persistence, etc
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.
-
Mod Help. (1.7.10) Setting Tab Background, Adding Records, Item Persistence, etc
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?
-
Mod Help. (1.7.10) Setting Tab Background, Adding Records, Item Persistence, etc
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.
-
Mod Help. (1.7.10) Setting Tab Background, Adding Records, Item Persistence, etc
If you've set up a ForgeGradle workspace, you'll have a copy of Minecraft's assets in ~/.gradle/caches/minecraft/assets (replace ~ with %USERPROFILE% on Windows).
-
Mod Help. (1.7.10) Setting Tab Background, Adding Records, Item Persistence, etc
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.
-
[1.7.10] Lore on block with metadata
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.
-
[1.7.10] Lore on block with metadata
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) .
-
1.7.10 gradlew build
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.
-
Giving specified player an item
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.
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.
IPS spam blocked by CleanTalk.