My goal is to create upgraded variants of vanilla objects that are built using 3D models rather than standard blocks or block items. I'm using a fairly current Forge (1098 for 1.7.2).
Phase 1: Modelling (complete)
I do my modelling in Wings3d, a freeware modeller written in Erlang that is quite easy to use. Here are the basic objects i want to start with...
Phase 2: UV unwrapping (process known)
There are plenty of excellent tutorials on this process, google wings3d uv mapping.
Phase 4: Use and query a JSON table to let specific blocks find their models and textures. (Need help)
Here is the JSON I want to use, at least to start:
I can make the file available to Minecraft as a ResourceLocation:
public static ResourceLocation Content =
new ResourceLocation("assets/tapioca/links/links.json");
The plan is to have a read method query the JSON with a name, get the model and texture strings from the resulting entry, then replace the stub strings in ReadModel with the result. Another option is to create a table from the file that can be queried.
This file looks like it could do what I want and the internal gson looks viable also. I have a lot more experience with Visual Studio C# than Eclipse Java. I just need the pathway from ResourceLocation to ReadModel.
Phase 1: Modelling (complete)
I do my modelling in Wings3d, a freeware modeller written in Erlang that is quite easy to use. Here are the basic objects i want to start with...
Phase 2: UV unwrapping (process known)
There are plenty of excellent tutorials on this process, google wings3d uv mapping.
Here is an example.
Phase 3: Import models into Minecraft (in process, 70-80%)
I based the method on this example.
First I need a TileEntity:
package com.inqiuix.tapioca; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; public class ObjEntity extends TileEntity { private IModelCustom model; private ResourceLocation texture, modelContent; public IModelCustom Model() { return model; } public ResourceLocation Texture() { return texture; } public ObjEntity(String name) { ReadModel(name); } public void ReadModel(String name) { modelContent = new ResourceLocation("modid", "/assets/models/"+"model"+".obj"); // inner string is a stub model = AdvancedModelLoader.loadModel(modelContent); texture = new ResourceLocation("modid", "/assets/textures/"+"texture"+".png"); // inner string is a stub } }Then I need a special renderer for it:
package com.inqiuix.tapioca; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; public class ObjRender extends TileEntitySpecialRenderer { public ObjRender(){ } @Override public void renderTileEntityAt( TileEntity me, double px, double py, double pz, float fl) { ObjEntity obj = (ObjEntity)me; GL11.glPushMatrix(); GL11.glTranslated(px, py, pz); Minecraft.getMinecraft().renderEngine.bindTexture(obj.Texture()); obj.Model().renderAll(); GL11.glPopMatrix(); } }Phase 4: Use and query a JSON table to let specific blocks find their models and textures. (Need help)
Here is the JSON I want to use, at least to start:
{ "Objects": [ { "name":"IronSconce", "model": "sconce", "texture": "sconceiron" } { "name":"GoldSconce", "model": "sconce", "texture"; "sconcegold" } { "name":"DoubleOven", "model": "oven2", "texture": "ovendouble" } { "name":"NetherOven", "model": "oven4", "texture": "ovenquad" } { "name":"Chimney", "model": "chimney", "texture": "chimney" } ] }I can make the file available to Minecraft as a ResourceLocation:
public static ResourceLocation Content = new ResourceLocation("assets/tapioca/links/links.json");The plan is to have a read method query the JSON with a name, get the model and texture strings from the resulting entry, then replace the stub strings in ReadModel with the result. Another option is to create a table from the file that can be queried.
This file looks like it could do what I want and the internal gson looks viable also. I have a lot more experience with Visual Studio C# than Eclipse Java. I just need the pathway from ResourceLocation to ReadModel.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumDid you already finish it?
EDIT: This is what i already have done...
I didnt test it but the resource location in 1.7.2 its ok...
I need some help with the textures...