Everything posted by Choonster
-
[1.10.2] Using obfuscated mods in development environment
I'm not entirely sure whether access transformers from mods in the mods folder are supported in the development environment, but you can try setting minecraft.useDepAts to true in build.gradle and adding the mods as Gradle dependencies instead of putting them in the mods folder. I do this for JEI here.
-
[1.7.10] [UNSOLVED] bash gradlew build failed
It looks like you're using the wrong quotation mark characters on line 21 and 22. You're using U+201C LEFT DOUBLE QUOTATION MARK and U+201D RIGHT DOUBLE QUOTATION MARK, but Gradle expects U+0022 QUOTATION MARK. You probably need to disable OS X's smart quotes feature by following these instructions. The instructions are for 10.9 rather than 10.11, so it may be a bit different on your system.
-
[1.7->1.10] 3d ItemRendering
Unfortunately I can't really help you with the animation system myself. Looking at the example I linked, it seems you use IAnimationStateMachine#transition to transition to a new state and play the corresponding clip.
-
[1.10.2] Register / unregister provider type in DimensionManager
Use DimensionType.register to create a new DimensionType that uses the specified WorldProvider class. You can't unregister a DimensionType , but you can unregister individual dimensions.
-
Blockstates to render model parts (change part textures and disable whole part)
If a part only renders sometimes, you should add it as a submodel in the blockstates file rather than as a part of the base model. If a part changes textures based on the block's state, set its texture in the blockstates file. If parts need to change their textures independently, they should use different texture names. You can't set the location of a submodel from the blockstates file. Assuming that each torch lights up (changes texture) when that side receives a redstone signal, the left and right torches always render and the centre torch doesn't render when it's disabled; you should include the left and right torches as part of the base model but give them separate texture names and make a separate model for the centre torch with its own texture names that's added as a submodel. I don't have any examples of this exact case, but I have some examples of similar concepts: Submodels shown or hidden based on the block's state - A pipe that always renders the centre cube and uses submodels for the side connections. Link. Textures set based on the block's state - A stained clay slab. Link.
-
[1.10.2][SOLVED]Creating a method for spawning particles on the server side
If you want code running on the server to trigger something on the client (or vice versa), you need to send a packet. In this case, vanilla already has a method to do this for you: WorldServer#spawnParticle .
-
[1.9.4+] Render Item/Block on top of my item
I suggest looking at how RenderSnowball renders its ItemStack 's model. You can also look at how Botania's altar renders its contents here.
-
[1.10.2] [Unsolved] Updating mod results in broken models
Forge will log two errors for a missing/broken model with the ModelResourceLocation <domain>:<path>#<variant> : one for the normal location (i.e. the item model at assets/<domain>/models/item/<path>.json) and one for the blockstate location (i.e. the <variant> variant of the blockstates file at assets/<domain>/blockstates/<path>.json). I'm not sure why Forge can't find your item models. If you build your mod with your IDE's build tool, are the models in the output directory? For IDEA, this is classes/production/<ProjectName>_main in your mod's project directory. If you build your mod by running the build Gradle task, are the models in the produced JAR?
-
[1.7->1.10] 3d ItemRendering
As I said in my first post, you can use a TESR ; though this is deprecated and marked for removal. You can register this TESR with ForgeHooksClient.registerTESRItemStack . There is no other way, the baked model and animation systems are the replacement for direct OpenGL rendering.
-
[1.7.10] [UNSOLVED] Can't wear leggings, helmet or boots.
You haven't shown the ItemSuuuuupermanArmor class, but I presume that the third argument of the constructor is the slot ID. If this is the case, you're passing 0 for every slot instead of passing the correct slot ID like you do for the other armour sets. 1.7.10 is extremely outdated, update to 1.10.2 and stop using unlocalised names to register your items.
-
[1.7->1.10] 3d ItemRendering
The ModelResourceLocation you set for an Item using ModelLoader.setCustomModelResourceLocation / setCustomMeshDefinition can point to a model in any supported format or a variant of a blockstates file. I explain the model loading process and how ModelResourceLocation s are mapped to models here. To use an OBJ model, you must call OBJLoader#addDomain with your resource domain (lowercase mod ID) in preInit and then specify the OBJ model the same way you'd specify a JSON model, but include the .obj extension in the path. OBJ textures are specified in the material library (.mtl) file with the same name as the model. You can see some examples from Forge here. To hide item model parts dynamically, you'll probably need to create your own IModel , ICustomModelLoader and ItemOverrideList . There's not much documentation, but again there are examples in Forge (though not of this specific thing) like ModelDynBucket . Forge now has an animation system for baked models, which you'll probably want to use for the recoil. You can see an example from Forge here: code, assets. This page explains the grammar of the Animation State Machine files.
-
Viewing Java Files Without a New Project
Notepad++ can display Java files with syntax highlighting, but it doesn't have any fancy IDE features like viewing method overrides or finding usages. IntelliJ IDEA can also open random Java files, but again you won't get many IDE features unless you create a project.
-
[1.7->1.10] 3d ItemRendering
The only way to render a ModelBase for an Item is with a TESR , but this is deprecated and will be removed as soon as possible. You will need to convert your models to JSON, OBJ or B3D or write your own model loader for some other format. This program converts Techne models to JSON. You can apply transformations to and hide model parts using AnimationProperty and IModelState . Forge has an example of hiding model parts here. You can apply transformations to the whole model depending on the transform type ( thirdperson_righthand , thirdperson_lefthand , firstperson_righthand , firstperson_lefthand , head , gui , ground , fixed ) using Forge's blockstates format. Forge has an example here, but it's slightly outdated because it doesn't account for the left-/right-hand transform types added in 1.9 (though Forge will use the thirdperson transformation as thirdperson_righthand , the same applies to firstperson and firstperson_righthand ). Forge's documentation has a section on capabilities here. The main use case is to implement an API (your own or someone else's) and allow other mods to interact with your things, e.g. IItemHandler to allow automated item storage access, IFluidHandler to allow automated fluid storage access. Another use case is to store data in an ItemStack (e.g. an IItemHandler inventory) without having to read from/write to NBT every time you interact with it.
-
[1.10] Two Layered Block
I explain how to make a fullbright model here.
-
[Unsolved] [1.10.2] Creative Tab Icon
The icon is controlled by CreativeTab#getIconItemStack . You should create your own ItemStack field and imitate the super method's behaviour using this field. Override CreativeTabs#getTabIconItem to return the next Item in the sequence. Subscribe to ClientTickEvent , check the Phase and increment a tick counter. Once it reaches 5 seconds, set the ItemStack field to null , allowing the next CreativeTab#getIconItemStack call to cache the next item.
-
[1.10.2] [Solved] Saving TileEntity data
Call super.getUpdateTag from your override of TileEntity#getUpdateTag .
-
[1.10.2] [Solved] Saving TileEntity data
In 1.9.4+, you need to override TileEntity#getUpdateTag to write the data that needs syncing to a compound tag and return it. You should then override TileEntity#getUpdatePacket to use the compound tag returned by TileEntity#getUpdateTag . TileEntity#getUpdateTag is sent with the chunk data, TileEntity#getUpdatePacket is sent after that.
-
Client Side events
No, since it first checks if you are already calling from the correct thread and in that case immediately executes the task. Ah, I didn't realise that.
-
Client Side events
Wouldn't vanilla's IThreadListener system work for this purpose?
-
[Solved] Are there any json model makers?
You must include the file extension in the model location when using an OBJ/B3D model.
-
[1.9.4] Trying to make a certain effect happen with a specific material
Your hitEntity method doesn't override a super method, you can't just add random parameters to a method and expect it to be called. If you'd used the @Override annotation, you would have already known this was the problem.
-
[1.10.2/1.9.4] Adding a sapling (texture only)
Don't store the StateMap.Builder in a field, it's only a temporary object. You must actually create an instance of StateMap.Builder . StateMap implements IStateMapper .
-
[1.10.2] How to change item icons on runtime?[solved]
ItemMeshDefinition is an interface with a single method: ModelResourceLocation getModelLocation(ItemStack stack) . This receives an ItemStack and returns a ModelResourceLocation pointing to the model that should be used for the item. How it determines which ModelResourceLocation to use is completely up to you. I have an explanation of the model loading process and how ModelResourceLocation s are mapped to models here.
-
[1.10.2] How to change item icons on runtime?[solved]
Items have models, not icons. What exactly do you want the item's model to be controlled by? For metadata-based models, use ModelLoader.setCustomModelResourceLocation in preInit to set a model for each metadata value. For models based on some other aspect of the ItemStack , use ModelLoader.setCustomMeshDefinition in preInit to set an ItemMeshDefinition for the Item ; this allows you to map an ItemStack to an arbitrary ModelResourceLocation . You must tell Minecraft to load each possible model by calling ModelBakery.registerItemVariants . For models based on some aspect of the entity holding the item or the world it's in, specify overrides in the item model itself. These can use any IItemPropertyGetter registered for the Item ( Item#addPropertyOverride ) to specify another item model.
-
[1.10.2] Can't craft Modblock
What you have now will work because you've used the proxy system properly, but it's not very flexible because it assumes that every Item uses the default model. Block breaking particle textures are specified by the "particle" texture of the block model. Are you using a regular baked model specified by a blockstates file or are you using a TileEntitySpecialRenderer ?
IPS spam blocked by CleanTalk.