-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
Item#onUpdate is called every tick for each ItemStack of the Item in a player's inventory. If your inventory is tied to a player/mob rather than an item, you may want to use tick events as diesieben07 suggested. IUpdatePlayerListBox can be implemented by a TileEntity to receive an update every tick. You can also register other implementations of the interface to be updated by the server with MinecraftServer#registerTickable .
-
Forge and Forge mods only run on specific versions of Minecraft. Forge is available for Minecraft 1.8 and 1.8.8 (as well as earlier versions), but Not Enough Items is only available for 1.8 (as well as earlier versions). You can select the Minecraft version to download Forge for on Forge's download page. Most Forge mods include the Minecraft version they're designed for in their version numbers or on their download pages.
-
world.setBlockState() setting the wrong state?
Choonster replied to thebest108's topic in Modder Support
You can store more than 16 combinations of property values if you store values in a TileEntity and override Block#getActualState to return the values from the TileEntity , but this is mainly useful if the block's model depends on data in the TileEntity . You can't use World#setBlockState to set the values of properties that aren't stored in the metadata. In this case, you should just store the heat value in a TileEntity and forget about the blockstate. -
Commit 097c0c6 recently added the ability to use a single blockstates JSON for multiple item models, so I thought I'd try and convert my custom bow's models (identical to the vanilla bow's models) into a blockstates JSON. You can see the result here. The model changes as the bow is used like before, but I'm having trouble getting it rotated and scaled properly with the transformation format used by the Forge blockstates format. I tried to convert the vanilla item model transformations to the Forge format using the following code, but it doesn't display like the vanilla model. TRSRTransformation thirdPerson = TRSRTransformation.blockCornerToCenter(new TRSRTransformation(new ItemTransformVec3f(new Vector3f(5, -100, -45), new Vector3f(0.75f, 0, 0.25f), new Vector3f(1, 1, 1)))); TRSRTransformation firstPerson = TRSRTransformation.blockCornerToCenter(new TRSRTransformation(new ItemTransformVec3f(new Vector3f(0, -135, 25), new Vector3f(0, 4, 2), new Vector3f(1.7f, 1.7f, 1.7f)))); This is the "transform" block I ended up with: "transform": { "thirdperson": { "rotation": [ -0.31877723, 0.6963295, 0.21487917, -0.60608023 ], "translation": [ 0.75, 0, 0.25 ], "scale": [ 1, 1, 1 ], "post-rotation": [ 0, 0, 0, 1 ] }, "firstperson": { "rotation": [ 0.19996417, 0.9019799, -0.08282786, -0.37361234 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ], "post-rotation": [ 0, 0, 0, 1 ] } } This is what it looks like with no transformations. This is what it looks like with transformations. How do I properly convert the vanilla transformation format to the Forge format?
-
!!!SOLVED!!! what is wrong Minecraft crash when using crafting table
Choonster replied to Jean's topic in Modder Support
You're adding recipes before you instantiate/register your items/blocks. Items/blocks should be instantiated and registered in preInit ( FMLPreInitializationEvent ) and recipes should be added in init ( FMLInitializationEvent ). Models/renderers should only be registered from the client proxy, otherwise you'll crash the dedicated server (the Minecraft class is client-only). -
[SOLVED][1.8][FORGE] GuiHandler not firing
Choonster replied to HappyKiller1O1's topic in Modder Support
On the client side, Minecraft#thePlayer contains the client player. On the server side, MessageContext#getServerHandler returns the sending player's NetHandlerPlayServer and NetHandlerPlayServer#playerEntity contains the player. -
You installed a client-only mod (Resource Loader) on the server.
-
[1.8.8] Structure generation generating in wrong Y coordenet
Choonster replied to KingOfMiners's topic in Modder Support
The method you want is World#getHeight(BlockPos) in 1.8+. -
Your screenshot didn't post correctly. Upload it to an image hosting site like Imgur and link it here. It may help if you post your FML log (logs/fml-client-latest.log in your Minecraft folder) as well. Upload it to Gist or Pastebin and link it here.
-
Modifying onBlockActivated of an Existing Block to open a GUI
Choonster replied to Markk's topic in Modder Support
If you look carefully, you'll notice that it's being printed once from the client thread and once from the server thread. There is almost never a good reason to use the output of toString for anything but log/exception messages. In this case, you should compare block directly to the Note Block instance ( Blocks.noteblock ) using the equality ( == ) operator. If they're the equal (i.e. the same object), the block is a Note Block. -
The Fluid defines the physical properties (e.g. luminosity, density) and textures of the fluid. The IFluidBlock represents a block of the fluid in the world and uses the properties of the Fluid to determine the block's light level, flow speed, etc. BlockFluidClassic acts like vanilla liquids, you can use other implementations of IFluidBlock for different fluid behaviour. It tells my Fluid Tank block to include a version of itself filled with that Fluid in creative tabs/NEI. ModModelManager#registerFluidModel registers a model for the specified IFluidBlock . I explained what this method does in the thread I linked previously.
-
Forge does provide mechanisms for modded fluids, look at the net.minecraftforge.fluids package. I explained a lot of the fluid system (including example code) in this thread a while back. Post #5 explains the fluid initialisation and registration, post #19 explains the model registration. I overhauled my fluid registration code after that post to properly support existing fluids, you can see the updated code here (model registration for fluids and buckets is here). My code uses several Java 8 features, if you're not compiling against Java 8 you'll need to replace these with the corresponding Java 6 features (e.g. replace lambdas with anonymous classes).
-
[1.8.8] Custom model blocks with variants using "metadata"
Choonster replied to Nuchaz's topic in Modder Support
createBlockState is called from the Block constructor. Your blockstates file looks correct, but I've never worked with OBJ models myself. If you use a simple JSON model like block/cube_all and set the all texture, does it work? -
[1.8.8] Custom model blocks with variants using "metadata"
Choonster replied to Nuchaz's topic in Modder Support
Somehow the IProperty array you're passing to the ExtendedBlockState constructor contains a null value, but I can't see how that could happen in your current code since WOOD_TYPE is initialised in a static field. If you set a breakpoint on that line, is WOOD_TYPE null ? Does the value at index 0 of the array become null in the BlockState constructor before the exception is thrown? -
The changelog for each Forge version can be downloaded from files.minecraftforge.net. MCP mappings (which map SRG names like func_1121_a to MCP names like doStuff ) can be downloaded from the MCPBot website.
-
InventoryTweaks 1.59-dev-152 is for 1.7.10. InventoryTweaks 1.59-dev-165 and newer are for 1.8.
-
Your itemspawnmover.json model is using the wrong resource domain for the parent model and texture, i.e. pingusrandomstuff instead of pingusrandoms (the actual name of the folder with your assets in it).
-
Minecraft's vector classes aren't compatible with the javax.vecmath classes, you'll need to manually convert between them (i.e. create a new instance of the other vector class using the same coordinates as the existing vector).
-
[1.8] [SOLVED] Confused on creating a custom entity
Choonster replied to Max Noodles's topic in Modder Support
You should be registering renderers in your client proxy, not your main class. If you call a client-only method or reference a client-only class in your main class, your mod will crash when run on a dedicated server. -
It looks like you haven't overridden Block#getIcon , so it's still trying to use Block#blockIcon (which is null ) as the texture.
-
There's no single "extract item" method, but pipes will usually use IInventory#decrStackSize or IInventory#setInventorySlotContents to extract items from a slot.
-
There's no events for this, but itemducts and their equivalents in other mods use the IInventory / ISidedInventory interfaces to interact with TileEntity s that have inventories. You can do whatever you need to from your implementation of these interfaces.
-
Damage Indicators Mod is client-only, it doesn't work on servers.
-
Yes, they're handled by @EventHandler methods in your @Mod class like the preInit, init and postInit events. I just tested this using this code and I can confirm that it works for dedicated and integrated servers. [spoiler=Dedicated server] [23:32:04] [server thread/INFO]: Stopping the server [23:32:04] [server thread/INFO]: Server stopping. Dedicated? true [23:32:04] [server thread/INFO]: Stopping server [23:32:04] [server thread/INFO]: Saving players [23:32:04] [server thread/INFO]: Saving worlds [23:32:04] [server thread/INFO]: Saving chunks for level 'world'/Overworld [23:32:04] [server thread/INFO]: Saving chunks for level 'world'/Nether [23:32:04] [server thread/INFO]: Saving chunks for level 'world'/The End [23:32:04] [server thread/INFO]: Unloading dimension 0 [23:32:04] [server thread/INFO]: Unloading dimension -1 [23:32:04] [server thread/INFO]: Unloading dimension 1 [23:32:04] [server thread/INFO]: Remapping stats for 0 blocks/items [23:32:05] [server thread/INFO]: Applying holder lookups [23:32:05] [server thread/INFO]: Holder lookups applied [23:32:05] [server thread/INFO]: Server stopped. Dedicated? true [spoiler=Integrated Server] [23:40:14] [server thread/INFO]: Server stopping. Dedicated? false [23:40:14] [server thread/INFO]: Stopping server [23:40:14] [server thread/INFO]: Saving players [23:40:15] [server thread/INFO]: Saving worlds [23:40:15] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [23:40:15] [server thread/INFO]: Saving chunks for level 'New World'/Nether [23:40:15] [server thread/INFO]: Saving chunks for level 'New World'/The End [23:40:15] [server thread/INFO]: Unloading dimension 0 [23:40:15] [server thread/INFO]: Unloading dimension -1 [23:40:15] [server thread/INFO]: Unloading dimension 1 [23:40:15] [server thread/INFO]: Remapping stats for 0 blocks/items [23:40:15] [server thread/INFO]: Applying holder lookups [23:40:15] [server thread/INFO]: Holder lookups applied [23:40:15] [server thread/INFO]: Server stopped. Dedicated? false
-
Are you sure those events don't fire for the integrated server? It looks like they're fired in Loader#serverStopped , which is indirectly called at the end of MinecraftServer#run (from FMLCommonHandler#handleServerStopped ).