Everything posted by Choonster
-
Adding to loot tables
When using @Mod.EventBusSubscriber, your event handler methods need to be static. Your lootLoad method isn't.
-
java.lang.ArrayIndexOutOfBoundsException: 5, (custom ToolMaterial) [SOLVED]
Both of those are valid. The important thing is that you call that constructor, it doesn't matter where you get the values from.
-
java.lang.ArrayIndexOutOfBoundsException: 5, (custom ToolMaterial) [SOLVED]
This particular ArrayIndexOutOfBoundsException is caused by calling the ItemAxe(ToolMaterial) constructor with a non-Vanilla ToolMaterial as it tries to look up the attack speed and damage using the ToolMaterial's ordinal as an array index. These arrays only have as many entries as their are Vanilla ToolMaterials, so any modded ToolMaterial's ordinal causes an ArrayIndexOutOfBoundsException. The solution is to use the ItemAxe(ToolMaterial, float, float) constructor and specify the attack damage and speed yourself.
-
Custom Item takes damage as expected but doesn't allow crafting after.
If your item uses the container item system to damage itself (like my ItemCuttingAxe), you don't need to create your own recipe class; just use one of the existing Vanilla or Forge classes. You only need to damage the item in the recipe if you're using an item from Vanilla or another mod.
-
SOLVED [1.12.2] Lang file doesn't work
Your lang file needs to be called en_us.lang (with an underscore), not en-us.lang (with a dash).
-
Where is the sever.properties file parsed at?
Those files are handled by the UserListX objects in the server's PlayerList instance.
-
Where is the sever.properties file parsed at?
DedicatedServer#init creates an instance of PropertyManager to parse the server.properties file and stores it in the DedicatedServer#settings field. This is the first method called when the server thread starts up.
-
[1.12.2 - Solved] Actual BlockStates not saving
The whole point of using Block#getActualState is to set the values of properties that aren't saved to metadata and are instead derived from other data (e.g. surrounding blocks or a TileEntity). World#getBlockState only returns the metadata-based state at that position, so your override of Block#getActualState sets the facing property of the state argument to the same value it already had (0). Since the facing property can't be saved to metadata or derived from surrounding blocks, you need to store it in a TileEntity.
-
Crash upon loading Jar java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
Your code is trying to load a Kotlin class, but Minecraft/Forge don't ship with the Kotlin library. As with any other library, you'll either need to have users install it themselves or embed the library in your mod's JAR and have Forge extract it.
-
Capabilities Is Deprecated?
Use the non-deprecated overload that takes a Callable argument.
-
Spawning Particles on LivingHurtEvent?
Entity#getEntityId is completely unrelated to global entity IDs. It's a unique entity ID specifically designed to be sent over the network.
-
Spawning Particles on LivingHurtEvent?
You can either generate the random number on the server and send it in the packet or generate it on the client. You need to send the entity's ID (Entity#getEntityId) in the packet and then get the client-side entity from the client World using World#getEntityByID.
-
Spawning Particles on LivingHurtEvent?
The two WorldServer#spawnParticle overloads without an EntityPlayerMP argument loop through all of the WorldServer's player entities and call WorldServer#sendPacketWithinDistance to send the packet to them if they're in range of the specified coordinates. I believe any packet sent through SimpleNetworkWrapper by a mod that's not present on the client will simply be ignored. If a mod present on both sides sends a packet that hasn't been registered on the client, an exception will be thrown.
-
Spawning Particles on LivingHurtEvent?
Yes, call World#spawnParticles on the client World in the packet's handler to spawn the particles.
-
Spawning Particles on LivingHurtEvent?
If you look at the method that handles the particle packet (NetHandlerPlayClient#handleParticles), you'll see that it generates random x, y and z speeds based on the speed you specified in the WorldServer method. If you need more control than the WorldServer methods give you, you can create your own packet to spawn the particles.
-
Can't connect to server (20 missing registry)
You have Recurrent Complex installed on the server but not on the client. It needs to be installed on both sides.
-
Spawning Particles on LivingHurtEvent?
To spawn particles from the logical server, use one of the spawnParticle overloads defined in WorldServer rather than the ones defined in World. These send a packet to players within range of the specified coordinates (or just the specified player if using the overload with an EntityPlayerMP argument) that tells their clients to spawn the specified number and type of particles.
-
[1.12.2] Setting a delay for onItemRightClicked
Minecraft has a built-in cooldown system (CooldownTracker) that it uses for Ender Pearls, Chorus Fruit and Shields (after a player has theirs disabled).
-
How does forge work?
The documentation explains the commands here.
-
WorlToScreen
What is a "World2Screen method?"
-
Server GUI Not Showing up
You're using Java 9, which Forge doesn't support. Uninstall it and install Java 8 instead.
-
.obj block model , inventory display
You can specify item transformations using Forge's blockstates format, but this requires them to be specified as TRSRTransformations (or one of Forge's built-in transformations: "forge:default-block", "forge:default-item" and "forge:default-tool") rather than the Vanilla ItemTransformVec3f format. I explain how to do this here.
-
entity.getShadowSize() missing
That's what Entity#getShadowSize returned, but that method no longer exists; if you compare the 1.7.10 and 1.12.2 implementations of Render#renderShadow, you'll see that they're fairly similar but the entity's shadow size is no longer used. The Render#shadowSize field is 0.5 for RenderDragon in both 1.7.10 and 1.12.2.
-
[1.12.2] [UNSOLVED] Mappings Event
RegistryEvent.MissingMappings<T> is fired when there are missing mappings for a registry and can be used to remap them to new names.
-
entity.getShadowSize() missing
They won't be empty if there are mods that have used the RenderingRegistry methods, but they'll never have the Vanilla instances and the Render instances you create from the IRenderFactory instances won't be the same ones that are used to render the entities during gameplay. It's best to use the ones stored in RenderManager. Mods that use the non-deprecated IRenderFactory registration method of RenderingRegistry will have their Render instances added to the RenderManager instance when it's created between preInit and init. Mods that use the deprecated Render registration method of RenderingRegistry will have their Render instances added to the RenderManager instance after postInit. If you really want to support the mods that are still using the deprecated method two years after it was replaced (it was deprecated with this commit and meant to be removed in 1.9), you could lazy-load the shadow sizes for each class when they're required rather than loading them all at startup.
IPS spam blocked by CleanTalk.