Jump to content

mGamer426

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by mGamer426

  1. 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!
  2. 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?
  3. Anybody else, have any ideas?
  4. 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.
  5. Not working .
  6. 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?
  7. Come on... anyone?
  8. Thanks, SO MUCH! :-)
  9. 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] } } }] } }
  10. Please someone...
  11. 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.
  12. Anyone?
  13. 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?
  14. Anyone?
  15. 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...?
  16. Hi, I want to turn the player hand into a BakedQuad. My questions are...: What are the dimensions?, How to position it? and How to bind the player's skin texture? (Is that regular texture binding or not.). So, if you can please answer these questions, and I will appreciate a code too.
  17. Thanks, appreciate it! I watched your post and now I have a little bit of understanding what's going on... So, my question is how to do that bake quad, which is the player's hand. How big it is, etc.? Thanks.
  18. Hi! I made an item, and I want it to render a little special. I want that while you're holding the item, it renders the player's hand, and it renders a particle above it. That will kinda look like the player holding a particle in his hand. What's hard about this, is making the player's arm rendering while holding the item. And my other problem is I can't figure out what class to extend or implement to make the renderer. I've never really used IPerspectiveAwareModel, and I think it is not the good way to go. Also, with rendering the player's hand I tried RenderPlayerAPI and it not worked! So, do you have any suggestions?
  19. Yeah, I tried it without this API but that not worked at all... So, our only way is to do this whole RenderPlayerAPI thing. RenderPlayerAPI is a good thing, it's useful and everything but our only problem is... they didn't make a tutorial from the mod and this is annoying. And by the way, thanks for the info EverythingGames... ;-)
  20. OK, I will, I promise and thanks for the code. I was looking for stuff in the API earlier, and I found an interface, called RenderPlayer. This contains a lot of methods, and I saw two of them, that are do something with the left arm. First is: realRenderLeftArm, second is: localRenderLeftArm. I don't know what those are doing, but it's horrible that there isn't any proper tutorials from this API. localRenderLeftArm is used in a few classes, but I don't know. Thanks again for the code!
  21. Just can you post the code which works while not holding an item? I think that would be a starting point and I can figure out more about it. Thanks...
  22. Thanks really... Just a secret: I want to do this for 1.8 but I thought there isn't any stuff about that, because rendering is totally changed ;D. PS: Yeah, changing those events might be very bad practice.
  23. Hello! I created a new item and I created a texture for it. I made two textures: one for displaying the item in the inventory slot, one for displaying the item equipped in third-person and in first-person mode. The problem is... the item will look much better equipped if the players arm showing too (of course in first person). So, can you help me? I created a simple code, which is shows the player's arm, but it shows it like... an arm in the player's arm. Here's the code: public class TestItemRenderer implements IItemRenderer { private static RenderItem renderItem = new RenderItem(); private ModelBiped modelBipedMain = new ModelBiped(0.0F); private static Minecraft mc = Minecraft.getMinecraft(); @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { case INVENTORY: return true; case EQUIPPED: return true; case EQUIPPED_FIRST_PERSON: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED_FIRST_PERSON: renderFirstPersonArm(mc.thePlayer); } } private void renderFirstPersonArm(EntityPlayer player) { mc.renderEngine.bindTexture(mc.thePlayer.getLocationSkin()); float f = 1.0F; GL11.glColor3f(f, f, f); this.modelBipedMain.onGround = 0.0F; this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, player); this.modelBipedMain.bipedRightArm.offsetY = 1F; this.modelBipedMain.bipedRightArm.render(0.0625F); } } So, this is a little bit offsetted player arm, in the player's arm. Is there any way to override the game's mechanic and don't hide the player's arm while holding the item? Oh, and by the way here's a picture what happens: Thanks for any help.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.