-
Posts
1830 -
Joined
-
Last visited
-
Days Won
12
Everything posted by DavidM
-
About a few days ago Forge 1.13.2 came out. I am attempting to port one of my 1.12.2 mod to 1.13.2; however, it seems that everything has changed massively, and I'm stuck on even creating the main mod class. So, is there any documentations/example mods to look at at the moment?
-
So far you've only added a model for your block when placed in world; you did not add a model for your block as an item. What you need to do is to add a iron_ladder.json in your models/item. In the ladder's case, the item should be a child of item/generated with the iron_ladder.png as the texture. Since the model for ladder is flat, you can just add it like how you would add an item. { "parent": "item/generated", "textures": { "layer0": "modid:items/iron_ladder" } } EDIT: send your iron_ladder.json in your model/item folder. You should also check your console to see if any missing textures are reported.
-
Your texture path is missing a domain (mod id), so Minecraft thinks you are looking for "blocks/iron_ladder" in the vanilla Minecraft assets, which does contain a texture for "iron_ladder". Change "blocks/iron_ladder" to "modid:blocks/iron_ladder"
-
Custom PlayerRender/ModelBiped/ArmorLayers - 1.12.2
DavidM replied to SorenCabral's topic in Modder Support
You have to change the file name as well as all the references to the class when you change the class name. Your IDE should tell you what you need to do. -
Custom PlayerRender/ModelBiped/ArmorLayers - 1.12.2
DavidM replied to SorenCabral's topic in Modder Support
You are basically saying "if the player's name is 'yRaposa', render all player models on his client differently". NO, you want to change the model of the player "yRaposa", not to change all player models on the client whose player name is "yRaposa". You need to put the if statement inside your RenderPlayerEvent handler, and only cancel the event as well as add custom rendering when the player's name is "yRaposa". -
Custom PlayerRender/ModelBiped/ArmorLayers - 1.12.2
DavidM replied to SorenCabral's topic in Modder Support
Use RenderPlayerEvent.Pre . -
[1.12.2] How can i shrink my entity and stop it laying eggs?
DavidM replied to Drachenbauer's topic in Modder Support
Override onLivingUpdate and set this.timeUntilNextEgg to something higher than 0 (say, 100). -
Custom PlayerRender/ModelBiped/ArmorLayers - 1.12.2
DavidM replied to SorenCabral's topic in Modder Support
In your RenderPlayerEvent event handler call event.setCanceled(true); , then add your code for rendering the player. Also, please use the < > button to insert code. -
According to your last screenshot, you are in the "bin" folder. You need to go back to your "src" folder. Apart from that, I can't figure out what went wrong. Check all your spellings and your ModelRegistry.
-
Hmm... try right-clicking on your project folder and click "Refresh", then launch the game again. Might not be the problem but worth a try.
-
No they don't. Check your spelling. You named your assets folder "asset". Minecraft is looking for assets/testmod/*, which does not exist in your mod directory due to the misspelling of the "assets" folder.
-
Yes. You are missing a model file. nov4e had given you a good example model json. You might want to use them for now. You need to have a furnace.json in your testmod/models/block/. You need to have a furnace.json in your testmod/blockstates/. You need to have a furnace texture in your testmod/textures/blocks/. The error is saying that Minecraft cannot find your furnace.json in your testmod/models/block/.
-
You are not importing anything from the internet here. You are importing from the forge library. Also, let your IDE do the importing for you, it should tell you when you have an unresolved type. Hover over it to import.
-
EnchantmentHelper.getEnchantments(ItemStack) returns a Map<Enchantment, Integer> , which, when called Map::get(Enchantment) , returns the level for the specified enchantment.
-
1. Your ClientRegistry.bindTileEntitySpecialRenderer should be called once per TESR. Therefore, you should put it in one of the inits in your client proxy. 2. Add debug lines to help figure out why your TESR is not being called. 3. The name tag is from your tile entity (custom name). You can delete all custom name related code for now, as you won't need it.
-
This issue still exists. Again, since FastTESR are batched together to improve performance, it does NOT support access to GlStateManager and GLXX. I would suggest you to use the normal TileEntitySpecialRenderer just for now and come back to FastTESR when you are more familiar with rendering. The render method in TileEntitySpecialRenderer and FastTESR are different. Your current code has many reference to the GlStateManager as well as getting the bufferbuilder from the tessellator. A FastTESR should NOT have those. To be honest you are quite lost here. You need to understand that the TileEntitySpecialRenderer is for rendering ONLY. It should not (and cannot) do anything apart from rendering. It is possible to convert FE to fluid, but you have to do so in the tile entity. The line fluid.amount / te.maximunFluidAmount is for getting the height of the liquid in order to render it. It has nothing to do with the conversion, so you shouldn't be putting te.energy in the denominator. In short, the tile entity does all the "real" work while the TESR just makes everything prettier. Lastly and most importantly, since your debug line in your TESR is not printing anything, I suspect that you forgot to bind your TESR to your TileEntity. Register your TESR with ClientRegistry.bindTileEntitySpecialRenderer. Put the code for registering TESR in your client proxy (TESRs should only exist in the client).
-
1. No you don't need to bump. 2. Use for loops to clean up your rendering code. 3. Please post your code for your tile entity. 4. Line 55: float scale = (1.0f) * fluid.amount / (te.energy); Yes I see, you are trying to get the scaled amount of your liquid, but this line has problems. Dividing the fluid amount by the energy amount makes no sense. You are trying to get how full the pipe is, so you need to doing something like fluid.amount / te.maximunFluidAmount 5. The FastTESR#renderTileEntityFast has x, y, and z as parameters. Use them instead of the xyz from TileEntity.pos. 6. Since your fluid isn't rendering at all, I would suggest you to add a debug line after Line 55 to print out the value of scale , just in case it is 0 the whole time. 7. That is not how a FastTESR is to be used. Read https://mcforge.readthedocs.io/en/latest/tileentities/tesr/#fasttesr again. FastTESR#renderTileEntityFast provides a bufferbuilder. Use the provided bufferbuilder. Moreover, GlStateManager and GLXX cannot be used in FastTESR. 8. FluidStack fluid = new FluidStack(ModFluids.FLUX_FLUID, 1); if (fluid == null) { return; } This null check is pointless. You just assigned an instance of FluidStack to fluid on the previous line. Again, since you did not post your code for your tile entity, we cannot be sure what went wrong. "Fluid not rendering" is too vague, as many things can cause that problem. Posting your full code helps us to find out all the problems that lead to "fluid not rendering".
-
Override ItemArmor#onArmorTick to detect when the player is wearing the armor. As for making the player emit light, I can think of 3 methods, all of which have drawbacks: 1. Manually set the light level of the blocks around the player (very resource demanding, can cause a lot of lag) 2. Make a custom block that emits light. Create the block at the player's position, and destroy it whenever the player moves to another block. Repeat the process as the player moves 3. Rewrite how Minecraft lighting works (like in AtomicStryker's Dynamic Lights mod) (hard to implement if you are a novice modder, as you have stated) I would say the 2nd way is the easiest to understand and to implement.
-
You HAVE to submit your code for others to help you. You need to show your code for your block, tileentity, and tesr, otherwise other people will have to guess what you are trying to do and what you did wrong. From my understanding, you are trying to render flowing liquid inside your pipe. The easiest way would be to attach a TileEntitySpecialRenderer to your pipe, get the amount of liquid in the pipe, and render the height of the liquid according to the amount of liquid (draw a rectangle inside the pipe with the texture of the desired liquid; its height should increase as the amount of liquid increase, and decrease when the amount of liquid decrease).
-
Amazing. Thanks!
-
I'm trying to call a function whenever the player, holding a specific item, falls (hits) the ground. The closest I can get is to override Item#onUpdate and detect whether the player is on the ground, but this triggers every tick when the player is on the ground instead of the tick when the player hits the ground. @Override public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) { super.onUpdate(stack, world, entity, itemSlot, isSelected); if (world.isRemote || !(entity instanceof EntityPlayer)) return; EntityPlayer player = (EntityPlayer) entity; if (isSelected) { if (player.onGround) { someFunction(); } } } I was thinking the record whether the player is on the ground, and check to recorded value during the tick after to see if onGround is true this tick while onGround is false the previous tick, but I haven't implement it yet.
-
I figured it out. Just in case someone else is having the same problem, I used RenderManager.renderEntity. Minecraft.getMinecraft().getRenderManager().renderEntity(mob, 0F, 0F, 0F, 0F, 0, false); It might also be possible to just get the IModel of the mob and bake it into the block; however, since in my case I have to spin the mob around, I used TESR.
-
I am looking for a way to get the model of an EntityLiving , then shrink it to the size of a block and render it as a block. The result would be similar to the mob trophies in OpenBlocks. However, I have no clue how to obtain the model of an EntityLiving and to adjust it to make it renderable as a block. Thanks.