-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
[SOLVED] [1.8][1.7.10] Custom tool harvesting some blocks slowly
Choonster replied to Choonster's topic in Modder Support
In 1.8, Item#getStrVsBlock is only used in Item#getDigSpeed (which ItemTool overrides to use tool classes) and InventoryPlayer#getStrVsBlock (which isn't used anywhere). In 1.7.10, Item#func_150893_a (the equivalent method) is only used in EntityPlayer#isCurrentToolAdventureModeExempt (which should use my override of Item#canHarvestBlock first) and Inventory#func_146023_a (which again isn't used anywhere). -
Adding the Fluid and its Block aren't that different in 1.8, except you need to pass ResourceLocation s of the fluid's textures to the Fluid constructor. The new model system is fairly different, though. You need to use Forge's advanced blockstates format to tell each fluid block to use Forge's fluid model and specify which Fluid to use the textures from. I don't have a guide, but I do have examples: Fluid / Block instantiation and registration: my mod, Forge Model registration: my mod, Forge Blockstates file: my mod, Forge The registration of fluid containers (buckets and tanks) in my ModFluids class is currently broken ( FluidContainerRegistry doesn't support NBT-based fluid containers), so don't use that. Edit: Fixed the formatting.
-
I've created a tool that can function as a pickaxe, axe or shovel; but for some reason it's harvesting specific blocks much slower than the effective vanilla tool does while harvesting other blocks at the same speed as the vanilla tool. The slow blocks include Block of Coal, Dispenser, Note Block, Bricks, Obsidian, Redstone Ore, Monster Spawner, Stairs, Doors and Pressure Plates. I can't see any pattern in which blocks are slow and which are normal speed. My code can be found here: 1.7.10, 1.8. Does anyone know what's going wrong? Is there some vanilla method I need to implement?
-
If you're going to use multiple values from a string split, you should store returned array in a local variable and reference that instead of calling String#split once per value. Doing this will also allow you to step through the code in a debugger and see what the values for each position are before they're parsed into floats.
-
BuildCraft and EnderIO both have examples of RF generators and pipes.
-
You'll probably want to use IExtendedEntityProperties to store the stats for each player. coolAlis has a tutorial on the system here. To implement the effects of these stats, just use the hooks and events provided by Forge. How you do this depends on what you actually want to do.
-
Witches are spawned in Witch Huts in the ComponentScatteredFeaturePieces.SwampHut#addComponentParts method.
-
[1.7.10] Help with status effects and items!
Choonster replied to Dr_Derpy's topic in Modder Support
If using the Ibuprofen is instant, override Item#onItemRightClick to apply the damage or potion effect. If you need to eat it like a potion, override the following methods (look at ItemFood and ItemPotion to see examples of this): Item#getMaxItemUseDuration to return 32 (the same use duration as food and potions) Item#getItemUseAction to return EnumAction.drink (the same action as potions) or EnumAction.eat (the same action as food) Item#onItemRightClick to call EntityPlayer#setItemInUse with the ItemStack argument and the result of calling this.getMaxItemUseDuration with the ItemStack argument (this makes the player start using the item when they right click) Item#onEaten to apply the damage or potion effect To check if a player has a potion effect active, use EntityLivingBase#isPotionActive ( EntityPlayer extends from EntityLivingBase ). To apply a potion effect, use EntityLivingBase#addPotionEffect . To damage a player, use Entity#attackEntityFrom . -
[Workaround Found] [1.7.10] Making a Vanilla Item Usable (Like Food)
Choonster replied to Choonster's topic in Modder Support
Thanks for the advice, jabelar. I decided to add a custom Edible Sugar item and replace all recipes involving Sugar with recipes that output Edible Sugar and/or take either kind of Sugar as input. I also added recipes to convert between regular and Edible Sugar. You can see my implementation of this here. This is the class I used to replace the recipes. -
[1.7.10] Help with status effects and items!
Choonster replied to Dr_Derpy's topic in Modder Support
You'd want the sickness to be a Potion . When the player uses the Ibuprofen, check if they have the Potion active: if they do, damage or kill them; else heal them and apply the Potion . -
Someone posted here asking for help making Sugar edible, so I thought I'd try to help them; but unfortunately it looks like vanilla breaks things by replacing the player's held item with a copy, which stops the item from being used (you can see a full explanation of the effect here). My code is here. Is there any way around this without resorting to ASM or intercepting packets?
-
Has anyone managed to get Scala and Java 8 working in the same project? I've got a test mod here that's configured to compile both Scala and Java through the Scala plugin, but the compiler fails when it encounters Java 8 features like static methods in interfaces. This is what gradlew --stacktrace build outputs: Attempting to run the client in IDEA outputs the following errors: I'd like to get this working in mixed compilation mode (the default) so Java and Scala code can reference each other in either direction.
-
You can call vararg methods in Scala just like you would in Java, see this example.
-
[1.7.10] How to change vanilla item's behavior
Choonster replied to darthvader45's topic in Modder Support
I replied to the OP's post on minecraftforum.net: -
1.7.10 Minecraft will not load when using 1.7.10
Choonster replied to x21Brandon21x's topic in Support & Bug Reports
One of the mods you installed was made for Minecraft 1.8, but you're running 1.7.10. Mods only work on specific versions of Minecraft, you need to install ones made for the version you're running. Most mods will have the Minecraft version they're made for in the JAR's file name. The crash happened early in the loading process, so it doesn't say which mod caused it. -
FMLNetworkEvent.ClientConnectedToServerEvent is fired on the FML bus ( FMLCommonHandler.instance().bus() ) client-side when the client connects to a server (integrated or dedicated). In 1.8 this event is fired on a Netty thread rather than the main client thread, so you can't directly interact with normal Minecraft classes. Read the Warning for Minecraft 1.8 section of diesieben07's SimpleNetworkWrapper tutorial to see how to schedule a task on the main client or server thread; this will allow you to safely interact with Minecraft classes. When the client is connected to a dedicated server or LAN game (only as a guest), Minecraft#getCurrentServerData will return a ServerData object describing the current server and FMLNetworkEvent.ClientConnectedToServerEvent#isLocal will be false . The ServerData#serverIP field contains the IP of the server. In a single-player game or as the host of a LAN game, Minecraft#getCurrentServerData will return null and FMLNetworkEvent.ClientConnectedToServerEvent#isLocal will be true . You can see an example of how to handle the event here.
-
Searching for a NullPointer since two days!
Choonster replied to ItsAMysteriousYT's topic in Modder Support
No, the cache only stores artifacts of Gradle tasks; it doesn't involve your source code. -
Searching for a NullPointer since two days!
Choonster replied to ItsAMysteriousYT's topic in Modder Support
Did it recompile Minecraft + Forge or just skip it? If it was skipped, you should force it to be recompiled by updating to a newer Forge version, deleting the JARs for the current version in the Gradle cache or running the cleanCache task to completely wipe the cache. -
In game skin changer only works in dev environment
Choonster replied to Dijkstra's topic in Modder Support
Use EntityPlayer#getGameProfile to get a player's GameProfile . The boolean is whether the downloaded texture names need to be securely signed. AbstractClientPlayer passes true , you probably should too. -
Searching for a NullPointer since two days!
Choonster replied to ItsAMysteriousYT's topic in Modder Support
There's not much point to that. The problem is with ForgeGradle rather than Forge itself and the latest Forge version still defaults to ForgeGradle 2.0.1 stable rather than the snapshot, so you'd still have to make the same edits in build.gradle. -
Searching for a NullPointer since two days!
Choonster replied to ItsAMysteriousYT's topic in Modder Support
The NullPointerException in CrashReportCategory#firstTwoElementsOfStackTraceMatch is caused by ForgeGradle not building Minecraft with debug information, this has been fixed in the latest snapshot version. In your build.gradle, uncomment the "bleeding edge" code at the top ( buildscript block and apply plugin ), comment out the "stable" plugins block, re-run setupDecompWorkspace and re-generate your IDE project. Once you've done this, the actual exception should be visible. -
Searching for a NullPointer since two days!
Choonster replied to ItsAMysteriousYT's topic in Modder Support
Post the actual exception and stacktrace. -
The exception was thrown on line 35 of ItemMaskLoup , but line 35 of the code you posted couldn't have thrown that exception. Can you upload the latest version of your code and the crash report to Gist and link them here?
-
Forge Server Loses Memory Over A Few Minutes
Choonster replied to ChumYT's topic in Support & Bug Reports
Upload fml-server-latest.log to Gist and link it here. -
1.7.10 Minecraft will not load when using 1.7.10
Choonster replied to x21Brandon21x's topic in Support & Bug Reports
You installed a 1.8 mod on 1.7.10.