EverythingGames
Forge Modder-
Posts
388 -
Joined
-
Last visited
Everything posted by EverythingGames
-
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
I tried placing the model in the block folder - I'm rendering an item though. When I do that I get a FileNotFoundException saying it needs to be placed in the item folder - that tells me there that it definitely needs to be in the models/item folder. Also, we know that the .JSON has to be in the blockstates folder. There is probably something wrong with my model... -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
I did the same. We'll get this working one way or another. -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
I'm still trying...lol. I keep getting this bull [13:12:29] [Client thread/ERROR] [FML]: No root mesh in model armed:models/block/gun.b3d and no mesh name in location, skipping -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
Actually, did you register your item render the usual way Minecraft.getMinecraft().getRenderItem().getItemModelMesher.register(item, 0, new modelresourcelocation...); And then use B3DLoader.instance.addDomain(Reference.MODID); ModelLoader.setCustomModelResourceLocation(ModItems.KingdomKey, 0, new ModelResourceLocation(Reference.MODID + ":" + Strings.KingdomKey, "inventory")); -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
If I can get my model to render I can work on its textures and help you further. So the model.json goes in the blockstates folder, the model.b3d goes into the models/items folder, and the mesh must be triangular - is that correct? From there, I can help on solving the texture problem. -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
You are correct. Are you using the .B3D exporter by RainWarrior? -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
I don't think you need like a .mtl file - that is what the JSON is for I guess... I am getting a runtime exception on my B3D model saying there is no root mesh - blender is probably causing the problem. Make sure in Blender you UV the texture to the model then export it. After that, define your texture in the .JSON. -
[1.8] [SOLVED] B3D item model has no texture
EverythingGames replied to Wehavecookies56's topic in Modder Support
I think you should look very closely to your path to the texture in your .JSON. "texture": "modid:items/yourtexture" P.S - I've been trying to get my B3D models to load...but I can't...if you could help me I'd be very grateful. You said something about a blockstate .JSON? For an item? What about the regular item .JSON? -
Maybe you looking for this one: EntityJoinWorldEvent Not sure on what bus it goes. EntityJoinWorldEvent is fired on the Forge Event Bus. Called whenever any entity joins the world (you can check if the entity is an instance of the player). Why over complicate it though? Use the PlayerLoggedInEvent as stated above.
-
It's certainly possible to change the cape in 1.8 (see my code here and here), I imagine it's possible to change the skin in the same way. I tried using your method to change the player skin (similar to yourself changing the cape). I get a null pointer exception at both the lines that I used reflection, public class PlayerSkinReplacement { private static final ExecutorService EXECUTORSERVICE = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue()); private static final ResourceLocation RESOURCELOCATION = new ResourceLocation(MainReference.ID + ":" + "textures/player/playerskin.png"); public static final void playerSkinReplacement(AbstractClientPlayer abstractclientplayer) { final NetworkPlayerInfo networkplayerinfo; try { networkplayerinfo = (NetworkPlayerInfo) AbstractClientPlayer.class.getDeclaredMethod("getPlayerInfo", new Class[] {}).invoke(abstractclientplayer); } catch(Exception exception) { exception.printStackTrace(); return; } if(networkplayerinfo == null) { return; } ManagerReflection.setField(NetworkPlayerInfo.class, "locationSkin", networkplayerinfo, PlayerSkinReplacement.RESOURCELOCATION); } public static final void callPlayerSkinReplacement(AbstractClientPlayer abstractclientplayer) { PlayerSkinReplacement.EXECUTORSERVICE.submit(() -> { try { Thread.sleep(100); } catch(Exception exception) { exception.printStackTrace(); return; } Minecraft.getMinecraft().addScheduledTask(() -> PlayerSkinReplacement.playerSkinReplacement(abstractclientplayer)); }); } }
-
[1.8] B3D Item Code Does Not Work
EverythingGames replied to EverythingGames's topic in Modder Support
If anyone is interested, this is an .OBJ loader I found for all Minecraft versions [including 1.8] [the page says it isn't updated - if you look at the mod author's repo, the code API was updated to 1.8] http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1294081-any-version-of-minecraft-minecraft-glutils-obj -
That did nothing. Usually, if you want to change values, you must use Pre in an event (usually used for cancelling). Like I said above, I wanted to change the ModelPlayer.aimBow to equal true. With the code above, I included a System Out debug to see what the aimBow boolean returned - it returned true, however, obviously its not rendering the player third person arms when "drawing a bow."
-
[1.7.10] Make gui button with custom texture
EverythingGames replied to ccsimon's topic in Modder Support
As stated above, create your own GuiButton. In your class you will be able to define things such as textures, text color, text color when hovered upon, etc. After that, when drawing your GUI you need to create an instance of your button - I'm sure you can figure that out. -
I believe your exactly right. However, RenderPlayer is called in about 4 other places (utilizing its two different constructors), so it is going to be a bit hard (what rendering isn't hard, ). Really, all I need is to tell Minecraft that, when holding my specific item, to set ModelPlayer.aimedBow to true. This piece of code I tried in the RenderPlayerEvent seemed to do nothing: @SubscribeEvent public void onEvent(RenderPlayerEvent.Pre event) { final RenderPlayer renderplayer = event.renderer; final ModelPlayer modelplayer = renderplayer.getPlayerModel(); modelplayer.aimedBow = true; }
-
I tried to overwrite the player render class for EntityPlayer, but the RenderRegistry class seems to not use my new PlayerRender class for the player. Instead, it still uses the regular RenderPlayer class. Here is my code: ClientProxy RenderingRegistry.registerEntityRenderingHandler(EntityPlayer.class, new PlayerRender(Minecraft.getMinecraft().getRenderManager(), false)); PlayerRender (new RenderPlayer class) public class PlayerRender extends RenderPlayer { public PlayerRender(RenderManager renderManager, boolean useSmallArms) { super(renderManager, useSmallArms); } private void renderArms(AbstractClientPlayer abstractClientPlayer) { final ModelPlayer modelplayer = this.getPlayerModel(); final ItemStack itemstack = abstractClientPlayer.inventory.getCurrentItem(); final Item item = itemstack.getItem(); if(item.equals(MainInitialization.ITEMS.get("m40"))) { modelplayer.aimedBow = true; } } @Override public void func_180596_a(AbstractClientPlayer abstractClientPlayer, double p_180596_2_, double p_180596_4_, double p_180596_6_, float p_180596_8_, float p_180596_9_) { this.renderArms(abstractClientPlayer); super.func_180596_a(abstractClientPlayer, p_180596_2_, p_180596_4_, p_180596_6_, p_180596_8_, p_180596_9_); } }
-
[1.8] B3D Item Code Does Not Work
EverythingGames replied to EverythingGames's topic in Modder Support
Yea, I'n going to setup a repo in the future - I've extensively used the new model system and found interesting ways on how you can minipulate the GL state in a wrapper class (at run-time). Someone may find stuff like that useful. I still really want to get these models rendered, no luck though. B3D would be nice to use because of the .JSON file that comes along with it (minecraft rejects the JSON when loading - see above JsonParseException). OBJ loader is nice as well but I don't know how to create / edit .mtl files for it. Also, I realized yesterday my model must be consistent with triangular mesh vs quadrilateral mesh (quads). Hopefully someone who knows their way around this "complex" rendering can help me out - thanks! -
Which means the current system doesn't support it. Maybe in the future it will.
-
Yes, the arm is an aesthetic of realism added when holding an item. The arm needs independent transforms to be positioned properly.
-
You may be on to something. What about independent translation / rotation for the arm? 3 pixel or 4 pixel arm support?
-
How would you do this without IItemRenderer? I doubt this will change...handlePerspective is called to get the matrix that should be added to the GL state for the model returned in the pair.
-
Try MrCrayfish's tutorials for 1.8. Search him on YouTube - (you will learn block rendering there) 1.8 rendering changed enormously.
-
If it fixes the problem and doesn't effect performance, aesthetics (in a bad way), and / or doesn't disrupt the rendering process in any way (GL calls can be made in model code), why is that stupid ? It works. Effectively. This is modders working with the new rendering system.
-
GL calls and bind texture are two different things. I have used GL in model code, never hurt it one bit. Forge makes GL calls when handlePerspective() is called getting the Pair matrix that should be added to the GL state before rendering.
-
(1.7.10) .onEaten - Return Itemstack
EverythingGames replied to xxWhatsherfacex's topic in Modder Support
What exactly are you trying to do? -
For NBT you want to create a class implementing ISmartItemModel and checking NBT data in the handleItemState() method. You can switch between different models based on NBT their, since handleItemState() returns an IBakedModel type. You may have to add your ModelResourceLocation to the model bakery - ModelBakery.addVariantName(Item, Meta, modelresourcelocation(ID + : +NameOfModel, inv);