-
[1.8] [CLOSED] Get the actual location of the mod's 'assets' folder.
Sorry for the VERRRRY late response, and I'd like to thank both of you for the information. After re-thinking the whole thing again and I think I'll go with the one that jabelar said. Now, I figured out that making this is VERRRRY complicated or it is not even possible. I don't really want to make that whole IResource thingy, but it is a good information... thanks RANKSHANK! And, again thanks for both of you it really helped finding the solution: Copy + paste!
-
[1.8] [CLOSED] Get the actual location of the mod's 'assets' folder.
Hello! I'm kind of new in modding and I would like to know one thing. I'm making a mod for 1.8 and I want to make model creating (you know, writing all those .json files) a bit easier. I want to make a model maker! I've already made a little preview of it, but there's one thing missing. Get the location of the assets folder, and inside of it, the models/item or models/block folder. I'm working in the IntellijIDEA IDE and it is possible to do this by creating a separate module in the whole modding project, and set up a custom application launch, where it launches the model maker module before Minecraft runs. Because it's a separate module, it can easily reference the directories in the source folder. But after a good bit of time it is kind of annoying that every time I launch Minecraft the model maker runs, and it's not even needed. I think it is possible to implement all of this into the mod and get the assets folder location while Minecraft is running. Any ideas how to do this?
-
[1.8] Rotating B3D Model
Anybody else, have any ideas?
-
[1.8] Rotating B3D Model
Thx, and by the way, I'm not familiar with this too, so... This is kinda a hard thing to do. I mean the 1.8 system is better, but it's much harder to do stuff with.
-
[1.8] Rotating B3D Model
Not working .
-
[1.8] Rotating B3D Model
It is not translated properly, but that is easy, just 0.5F or -0.5F on the X or Z. But, I don't really know, how B3D models are getting rendered or where? Is it BlockModelRenderer?
-
[1.8] Rotating B3D Model
Come on... anyone?
-
[1.7.10] IItemRenderer bug.
Thanks, SO MUCH! :-)
-
[1.8] Rotating B3D Model
Hi! I made a fancy model. In 1.8, I cannot render .OBJ models, because there's no wavefront loader in Forge 1.8 (Of course I can copy the 1.7.10 version, but that only works with the rendered block in 1.8 ). So, I converted my .OBJ model into a .B3D model, using Blender with the B3DExporter script, made by RainWarrior. Then, I followed this tutorial (debugging code): https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java. Then made a blockstate file by this: https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/resources/assets/forgedebugmodelloaderregistry/blockstates/CustomModelBlock.json. It worked pretty well. I did my own transforms and in GUI, THIRDPERSON and FIRSTPERSON, they look really good. So, my problem is that Blender has a flipped YZ axis. From Minecraft's aspect the Y axis in Blender is the Z axis, and the Minecraft Z axis in Blender is the Y axis. Because of this, I have a 90° rotation around the X. No problem, in GUI, THIRDPERSON and FIRSTPERSON, I did rotations around the Z axis. So, in these cases it looks nice. But! If I want to do this in the "normal" variant it doesn't work. I don't know why. So, any suggestions how to rotate it when it's placed down? Block class: public class FancyModelBlocks extends Block { public FancyModelBlock() { super(Material.rock); this.setUnlocalizedName(NameReferences.NAME_FANCY_MODEL_BLOCK); this.setCreativeTab(ModCreativeTab.CREATIVE_TAB); } @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } @Override public boolean isVisuallyOpaque() { return false; } @Override public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) { B3DLoader.B3DState newState = new B3DLoader.B3DState(null, 1); return ((IExtendedBlockState) state).withProperty(B3DLoader.B3DFrameProperty.instance, newState); } @Override public BlockState createBlockState() { return new ExtendedBlockState(this, new IProperty[]{}, new IUnlistedProperty[]{B3DLoader.B3DFrameProperty.instance}); } } Main mod class' model registering part: @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { B3DLoader.instance.addDomain(MOD_ID.toLowerCase()); ModelLoader.setCustomModelResourceLocation(new FancyModelBlock(), 0, new ModelResourceLocation(MOD_ID.toLowerCase() + ":" + NameReferences.NAME_FANCY_MODEL_BLOCK)); } Blockstate file { "forge_marker": 1, "defaults": { "textures": { "#texture": "mymod:blocks/fancy_model_block_texture" }, "model": "mymod:fancy_model_block.b3d" }, "variants": { "normal": [{ "transform": { "rotation": [{"x": -90}] //This is not working } }], "inventory": [{ "transform": { "firstperson": { "translation": [0, -0.2, 0.15], "rotation": [{"z": 90}] //This is the rotation that I've talked about. In this case +90°, because in FP the perspective changes }, "thirdperson": { "translation": [0, -0.05, 0.025], "rotation": [{"x": 100}, {"y": -45}, {"z": -45}], //Here, to make the model fancier in third person I've rotated around just -45°, not -90° "scale": [0.45, 0.45, 0.45] }, "gui": { "translation": [0, 0.04, 0], "rotation": [{"z": 90}], //In here, it's +90°, because in GUI the perspective changes, too "scale": [0.7, 0.7, 0.7] } } }] } }
-
[1.7.10] IItemRenderer bug.
Please someone...
-
[1.7.10] IItemRenderer bug.
Sorry for me being stupid, but can you show me how to do one? Because in 1.7.10 I don't know how to do that... Again sorry if that sounds stupid.
-
[1.7.10] IItemRenderer bug.
Anyone?
-
[1.7.10] IItemRenderer bug.
Hi! I have an item, basically a special book. It'll be the guide for my mod. I created a renderer for it, because I want it to render with a little particle-like icon behind it. But, the problem is: in certain cases, the renderer just acts weird. Let me show you some pictures: With blocks on any GUI it is fine... See the particle-like icons? They are small, but eh... BUT, if I put an item (e.g a redstone) next to it on the left, it freaks out. BUT, if I put an item next to it on the RIGHT it's still cool. And, this is not for just this, item... I have more stuff with multiple layers rendered together, and in these cases all of them freaks out. Here's my code: IItemRenderer: private ItemGuide guide; private RenderItem renderItem = RenderItem.getInstance(); //UNUSED! @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type == ItemRenderType.INVENTORY || type == ItemRenderType.ENTITY; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if(item.getItem() instanceof ItemGuide) guide = (ItemGuide) item.getItem(); switch(type) { case ENTITY: IIcon si = item.getIconIndex(); //The book icon IIcon pi = guide.getParticleIcon(); //The particles, got by a special method specified in the item class. if(!item.isOnItemFrame()) { GL11.glTranslatef(-0.5F, 0, 0); ItemRenderer.renderItemIn2D(Tessellator.instance, pi.getMaxU(), pi.getMinV(), pi.getMinU(), pi.getMaxV(), pi.getIconWidth(), pi.getIconHeight(), 1.0F / 16.0F); ItemRenderer.renderItemIn2D(Tessellator.instance, si.getMaxU(), si.getMinV(), si.getMinU(), si.getMaxV(), si.getIconWidth(), si.getIconHeight(), 1.0F / 16.0F); } else { GL11.glTranslatef(0.5F, -0.1F, 0); GL11.glRotatef(180.0F, 0, 1, 0); ItemRenderer.renderItemIn2D(Tessellator.instance, pi.getMaxU(), pi.getMinV(), pi.getMinU(), pi.getMaxV(), pi.getIconWidth(), pi.getIconHeight(), 1.0F / 16.0F); ItemRenderer.renderItemIn2D(Tessellator.instance, si.getMaxU(), si.getMinV(), si.getMinU(), si.getMaxV(), si.getIconWidth(), si.getIconHeight(), 1.0F / 16.0F); } break; case INVENTORY: si = item.getIconIndex(); pi = guide.getParticleIcon(); glScalef(16, 16, 16); ItemRenderer.renderItemIn2D(Tessellator.instance, pi.getMinU(), pi.getMaxV(), pi.getMaxU(), pi.getMinV(), pi.getIconWidth(), pi.getIconHeight(), 1.0F / 16.0F); ItemRenderer.renderItemIn2D(Tessellator.instance, si.getMinU(), si.getMaxV(), si.getMaxU(), si.getMinV(), si.getIconWidth(), si.getIconHeight(), 1.0F / 16.0F); break; default: break; } } I'm using ItemRenderer.renderItemIn2D, because that renders with thickness. So, renderItem is unused! Other cases, EQUIPPED and EQUIPPED_FIRST_PERSON I'm using the default ones, because I want the particles only render in cases ENTITY and INVENTORY. Anybody help?
- Player Hand to BakedQuad
-
Player Hand to BakedQuad
Thanks, and how the .JSON file would look like? Because I've only used normal .JSON files like, for textures. Do I have to parse the dimensions in the display object? Like this: { "parent": "something OR builtin/generated" "display": { "something for x": 4, "something for y": 12, "something for z": 4 } } Or, I have to use other object...?
IPS spam blocked by CleanTalk.