-
Posts
5172 -
Joined
-
Last visited
-
Days Won
78
Everything posted by Choonster
-
Where is the sever.properties file parsed at?
Choonster replied to jredfox's topic in Modder Support
Those files are handled by the UserListX objects in the server's PlayerList instance. -
Where is the sever.properties file parsed at?
Choonster replied to jredfox's topic in Modder Support
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
Choonster replied to leduyquang753's topic in Modder Support
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. -
Use the non-deprecated overload that takes a Callable argument.
-
Entity#getEntityId is completely unrelated to global entity IDs. It's a unique entity ID specifically designed to be sent over the network.
-
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.
-
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.
-
Yes, call World#spawnParticles on the client World in the packet's handler to spawn the particles.
-
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)
Choonster replied to EnderGamingFilms's topic in Support & Bug Reports
You have Recurrent Complex installed on the server but not on the client. It needs to be installed on both sides. -
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
Choonster replied to naturaGodhead's topic in Modder Support
Minecraft has a built-in cooldown system (CooldownTracker) that it uses for Ender Pearls, Chorus Fruit and Shields (after a player has theirs disabled). -
The documentation explains the commands here.
-
What is a "World2Screen method?"
-
You're using Java 9, which Forge doesn't support. Uninstall it and install Java 8 instead.
-
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.
-
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.
-
RegistryEvent.MissingMappings<T> is fired when there are missing mappings for a registry and can be used to remap them to new names.
-
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.
-
ContainerWorkbench (the Crafting Table's Container) does this in its onContainerClosed method. If you're using IItemHandler for your inventories (which you should be), you'll need to replicate the logic in Container#clearContainer rather than calling it directly.
-
[1.12] Make custom grass block use the colour map
Choonster replied to MCrafterzz's topic in Modder Support
You need to create an IItemColor implementation that gets the colour from BlockColors and then register that with ItemColors. You can see an example of this here. -
[1.12.2] Vanilla mobs with custom loot table [SOLVED]
Choonster replied to supreme marshal's topic in Modder Support
It's probably worth noting that you can use LootEntryTable to generate loot from another loot table. -
RenderingRegistry is just temporary storage for mod entity renderers/factories during the startup process, RenderManager#entityRenderMap stores the actual instances used to render entities during gameplay.
-
The code you posted doesn't compile, because entry1 is declared inside the if statement but referenced outside of it (because it doesn't have braces). Please post a working Git repository of your mod so I can debug this. See my mod and its .gitignore file for an example of the repository structure to use and which files to include. This .gitingore file tells Git to ignore everything (the first line) except the files that are actually required (the lines starting with an exclamation mark).