-
Posts
5170 -
Joined
-
Last visited
-
Days Won
77
Everything posted by Choonster
-
Ah, I just figured out what's wrong. You didn't specify the variant in the item model's ModelResourceLocation , so it defaulted to normal (which isn't defined for regular item models). You need to specify the inventory variant using the second argument of the ModelResourceLocation constructor (like in my examples).
-
Definitely no errors in that log. Could you try removing your resource pack? It shouldn't be causing issues, but it's best to rule it out completely.
-
I'm not too sure what's going wrong. Could you post the log anyway so I can confirm that there's no errors in it? You should be registering blocks in the preInit phase, not the init phase. You should only be registering models from your client proxy so you don't crash the dedicated server. Don't use the block's unlocalised name for the model, use its registry name ( block.getRegistryName() in 1.8.9 or Block.blockRegistry.getNameForObject(block).toString() in [nobbc]1..[/nobbc] Edit: Damn smileys.
-
I'm not sure what you've done wrong. Are there any other errors in the log? I just made a simple mod that adds a single block here and the model works without issue. If you post your latest code (specifically the class where you register the block and the class where you register the block's model) and the FML log (logs/fml-client-latest.log), I may be able to help you further. Please use Gist or Pastebin to post the log and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
-
Your item model has the wrong parent model ( craftattack:blocks/testblock instead of craftattack:block/testblock ). You can't register models directly in your main @Mod class, you'll crash the server. Use the sided proxy system and register models in your client proxy or a class that's called from it. Don't catch an exception if you're just going to ignore it. That will only make it harder to figure out where the error is when something goes wrong.
-
The ModelResourceLocation is your resource domain (lowercase mod ID), the model's path excluding the .json extension (relative to models/item) and the variant ( inventory for a standard item model). For the assets/craftattack/models/item/testblock.json model, use new ModelResourceLocation("craftattack:testblock", "inventory") .
-
That method should register the model, but it will crash the dedicated server. GameRegistry.registerBlock needs to be called on both sides, but Minecraft is client-only so it doesn't exist on the dedicated server. I'd recommend creating a class to register your block/item models and calling ModelLoader.setCustomModelResourceLocation for each item (including the item forms of your blocks). You can see an example of this in my mod here. This is called from my client proxy, which is called from my main class. You shouldn't be using Item.getIdFromItem or the LanguageRegistry class. Item IDs are automatically managed and translations should be handled through lang files.
-
You need to tell Minecraft which model to use for the item form of your block by calling ModelLoader.setCustomModelResourceLocation or ModelLoader.setCustomMeshDefinition from your client proxy in the preInit phase.
-
PowerConnectable doesn't call the super methods from its overrides of writeToNBT / readFromNBT .
-
Forge crash when I try to start my server
Choonster replied to Sarion_'s topic in Support & Bug Reports
Are you sure it's provided by the server JAR? I just used the 1.7.10-10.13.4.1614 and 1.8.9-11.15.1.1732 installers to install servers and both of them downloaded joptsimple to the libraries folder. -
[1.8][SOLVED] Get's EntityPlayerMP from EntityPlayerSP
Choonster replied to TheCrafter4000's topic in Modder Support
What do you need the container for? Why is the code being run from the client side? In the handler for a client-to-server IMessage , use MessageContext#getServerHandler to get the sending player's NetHandlerPlayServer and then get the player from the NetHandlerPlayServer#playerEntity field. -
Forge crash when I try to start my server
Choonster replied to Sarion_'s topic in Support & Bug Reports
Minecraft is missing a required library (joptsimple). If you don't have direct access to upload files to the server, tell your host to fix this. -
[1.8]how would I run a command with my mod
Choonster replied to BoonieQuafter-CrAfTeR's topic in Modder Support
What do you mean? -
Can't you just package it as a regular mod and have other mods add it as a dependency manually or through Maven? I'd suggest using the new ContainedDep mechanic to package your mod inside other mods, but it doesn't look like contained mods can be coremods (at least not when they're first extracted).
-
[1.8]how would I run a command with my mod
Choonster replied to BoonieQuafter-CrAfTeR's topic in Modder Support
Use MinecraftServer.getServer to get the server instance, MinecraftServer#getCommandManager to get the server's command manager and ICommandManager#executeCommand to execute a command. -
Villages and villagers appear to treat any block that extends BlockDoor and uses Material.wood as a valid door. The EntityAIOpenDoor AI task used by villagers to open doors uses BlockDoor#toggleDoor to open and close doors. If you want your door to be used by villagers, make sure it uses Material.wood and is opened/closed by BlockDoor#toggleDoor .
-
[1.8.8/1.8.9] Help with Forge blockstate transforms
Choonster replied to Choonster's topic in Modder Support
Bump again. Still having the same issue finding the right transformations. This is what it looks like in third person with no transformations. This is what it looks like in third person with transformations. -
It looks like Fry just committed a fix for this, so it should work in 1.8.9-11.15.1.1730 once that's been released.
-
[1.8] Move the player visual with keyboard?
Choonster replied to oznecniV97's topic in Modder Support
Like I said, Minecraft#thePlayer (i.e. the instance field of Minecraft called thePlayer ) contains the client player. Use Minecraft.getMinecraft() to get the Minecraft instance. -
[1.8] Move the player visual with keyboard?
Choonster replied to oznecniV97's topic in Modder Support
I only needed to check the entity because Block#onEntityCollidedWithBlock is called when any entity collides with the block, not just the player. I needed to check the side using the World#isRemote field because the method is called on the client and the server. Obviously only the player can use keybindings and this only happens on the client side, so you don't need to check that. On the client side, there's only one World ( Minecraft#theWorld ) and one client player ( Minecraft#thePlayer ). -
[1.8.9] How do I rotate depending on the time?
Choonster replied to sjoopies's topic in Modder Support
For 90-degree rotations, you should be able to rotate the model from the blockstates file. Create a property in your block's state to store the current rotation (this could be an enum), then override Block#getActualState to return an IBlockState with this property set to the appropriate value based on the current world time ( World#getWorldTime ). For other rotations, you may be able to do something with ISmartBlockModel or TileEntitySpecialRenderer / FastTESR ; but I can't help you much with these. -
Just add the "display" object to the top-level object like you would any other JSON model.
-
Override Block#onBlockActivated to do something when the block is right clicked. To spawn an item, create a new EntityItem at the appropriate position using the EntityItem(World worldIn, double x, double y, double z, ItemStack stack) constructor then spawn in it the world with World#spawnEntityInWorld . BlockPos#up() will return a BlockPos one block above the original position, so you can use this to get the position for the item entity from your block's position.
-
[1.8] Custom Item Model Not Rendering
Choonster replied to AnonymousModder's topic in Modder Support
If you mouseover the names with a line through them, it should tell you that they no longer exist (because they don't). IItemRenderer has been replaced with the model system. You can either create a standard item model in JSON, OBJ or B3D format or create a more dynamic model using one of the interfaces that extend IModel / IBakedModel (e.g. ISmartItemModel ). The Grey Ghost has a post explaining some of the new item rendering system here.