Everything posted by Choonster
-
[SOLVED][1.12.2]Lose durability on my axe when making wood planks
Not every axe (or axe-like tool) will extend ItemAxe. For example, the base class for Tinkers' Construct's tools extends Item and the harvest tools override Forge's harvest level/tool class methods (like Item#getToolClasses) to determine the tool classes based on the tool type and the harvest levels based on the tool's materials.
-
[1.12] Get harvest level of Tinker Tool?
You need to supply the actual tool ItemStack that the player has placed in the machine so that mods like Tinkers' Construct can read the NBT and determine the harvest level based on it. If you supply an empty ItemStack or one without any NBT, Tinkers' Construct won't know what the harvest level is.
-
[SOLVED][1.8] With built JAR, it crashes with NoClassDefFoundError
The MCP to SRG obfuscation performed by the build Gradle task only changes field and method names, class names are always the same between MCP and SRG. This means that NoClassDefFoundError can't be caused by lack of reobfuscation. Usually it's caused by accessing a client-only class from code that runs on the dedicated server.
-
[SOLVED] [1.12] NoSuchMethodError for getSlotFor
@SideOnly restricts classes, methods and fields to a specific physical side. The integrated server runs on the physical client, so it has access to things annotated with @SideOnly(Side.CLIENT) (though it should never actually use these). The dedicated server runs on the physical server, which doesn't have access to things annotated with @SideOnly(Side.CLIENT). Use InventoryPlayer#hasItemStack to check if an ItemStack is anywhere in a player's inventory, matching the Item and metadata but not the NBT or capabilities.
-
[SOLVED] [1.12] NoSuchMethodError for getSlotFor
InventoryPlayer#getSlotFor is a client-only method (i.e. it's annotated with @SideOnly(Side.CLIENT)), so it doesn't exist on the dedicated server and can't be used from common code (like an event handler running on the logical server).
-
1.12 Where is the texture location of the cross or crosshair in the middle of the screen
The crosshair texture is in the assets/minecraft/textures/gui/icons.png file.
-
[1.10.2] Event Priority?
Event handlers with the same priority are called in the order that they were registered in. This isn't documented, so it's probably best to consider it an implementation detail that shouldn't be relied upon.
-
is there any way to conver SoundEvents.RECORDS_CAT to resource location?
I explain how to get an InputStream from a SoundEvent here:
-
Forge crash
- Tried to launch Forge 1.12.2 but kept launching Vanilla game
The forge launcher profile isn't actually configured to use a Forge version. You need to set it to a Forge version in the Launch Options tab.- Forge crash
That doesn't appear to be the FML log. Please find the file named fml-client-latest.log in the logs folder of the game directory and then upload it to Gist and link it here.- Forge crash
Post the FML log (logs/fml-client-latest.log in the game directory) using Gist or Pastebin. This should tell us why it's crashing.- Sync item stack capability data to client
I explained how to sync item capabilities here:- Is the block under the cross hairs a door?
That code looks like it's from a Bukkit plugin (or a plugin for a similar system) rather than an old Forge mod. You need to use IBlockState#getValue to get the values of the various properties stored in the BlockDoor class from the state. This will tell you the door's facing and hinge position diesieben07 explained which properties you need and which block to get their values from earlier in the thread.- Is the block under the cross hairs a door?
I must have confused getHitVec with the hitX/Y/Z arguments of Block#onBlockActivated, which I'm pretty sure are between 0 and 1. I don't have my IDE in front of me, so I might be mistaken (again). Edit: The hitX/Y/Z arguments of Block#onBlockActivated are between 0 and 1.- PlayerDropsEvent and PlayerEvent.PlayerRespawnEvent not called in anyway?
You register the Class object with the event bus, which means your event handler methods need to be static. The Forge documentation explains this in more detail here.- Is the block under the cross hairs a door?
getHitVec is the position on the block that the player clicked (in the range 0-1), not the position of the block in the world.- PlayerDropsEvent and PlayerEvent.PlayerRespawnEvent not called in anyway?
Are you definitely registering your event handler properly? Post the registration code.- Whats the best way to change vanilla blocks behaviour when events are not available?
Which version are you using? By the looks of it, it's not 1.12; which is where the new registry system was introduced. Before 1.12 there was the substitution alias system (GameRegistry.addSubstitutionAlias), though I never managed to get it working properly myself.- 1.11.2 Server v13.20.1.2386 en-us.lang warning
These warnings were quietened down in Forge 1.12-14.21.1.2399. Update to 1.12.2 and you won't see them anymore.- Biomes in nether?
Have you tried looking at Biomes O' Plenty's code for Nether biomes?- Grayscale
You first need to implement IBlockColor, you'll probably want to do this with a lambda or anonymous class. Look at the BlockColors#init method for the vanilla IBlockColor implementations for leaves and grass. You'll also need to create an IItemColor implementation that returns the Block's colour. Look at the ItemColors#init method for the vanilla IItemColor implementation for leaves and grass. Call BlockColors#registerBlockColorHandler with an instance of your IBlockColor implementation and the Blocks that you want coloured at runtime. Call ItemColors#registerItemColorHandler with an instance of your IItemColor implementation and the Blocks (or their Item forms) that you want coloured at runtime. Do this from a client-only class (e.g. your client proxy) in the init phase. I have an example of an IBlockColor/IItemColor implementation for a block that uses the grass colours here.- Grayscale
You don't need to replace the Blocks themselves, just register IBlockColor instances for them and replace the textures using a resource pack (e.g. your mod's assets diretory). Do this using the BlockColors class, which also contains the Vanilla IBlockColor implementations.- [1.10.2] Command Help.
That's only necessary when the original method is being called on a thread other than the main client/server thread, e.g. packet handlers are run on a Netty thread. Commands are run on the main server thread, so scheduling a task like that just runs it immediately on the same thread; making it completely pointless to do so.- Issue with forge server.
Minecraft and Forge don't support Java 9, you need to use Java 8. - Tried to launch Forge 1.12.2 but kept launching Vanilla game
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.