TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
[1.8] Minecraft searches for wrong model file
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
It is used. If you leave it out, or the two don't match, your item won't render properly. In the case where your item has variants, it needs different meshers for the variants. If your item is simple, you wind up registering "twice" which is yeah a redundancy, but it's for sure just easier to add the registration and the model mesher and get on with coding something interesting.. Trust me, I have dug pretty deep into the model and item registry code, it took me a day to understand it all and that's 10 hours of my life I'm never getting back... -TGG -
Hi I think what you are trying to do is not possible. You need to create a multi block structure instead. For example like the vanilla bed or the door. I think Forge has some inbuilt support to help with this, I know nothing about it. Google may help... -TGG
-
Well if it makes you feel any better, I've made this bug at least a dozen times over the years... -TGG
-
Hi What is in your blockstates .json ? That should look something like { "variants": { "colour=red": { "model": "minecraftbyexample:mbe03_block_variants_model_red"}, "colour=green": { "model": "minecraftbyexample:mbe03_block_variants_model_green" } } } -TGG
-
> try setting a breakpoint or System.out.println in there to see why) I guess you didn't try this suggestion? eg System.out.println("b1: " + b1); System.out.println("b2:" + b2); AxisAlignedBB retval = b1.func_111270_a(b2); System.out.println("b1xb2:" + retval); return b1.func_111270_a(b2); If you do this, you'll find out pretty quickly that your switches are busted. -TGG
-
Hi. Have you checked to see whether your public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) is ever being called? eg using breakpoint or System.out.println("renderTileEntityAt"); If not, the registration of your TileEntity and/or TileEntitySpecialRenderer is probably not right. -TGG
-
In 1.8, IRecipe conveniently provides ItemStack[] getRemainingItems(InventoryCrafting p_179532_1_); to do exactly this. In 1.7.10 I think you might have to do something clever with ItemCraftedEvent (i.e. modify the crafting matrix to remove "extra" itemstacks). See SlotCrafting.onPickupFromSlot() for the vanilla code where it all happens. Never tried it myself, it may not work... -TGG
-
Hi Try this TileEntity:: /** Return an appropriate bounding box enclosing the TESR * This method is used to control whether the TESR should be rendered or not, depending on where the player is looking. * The default is the AABB for the parent block, which might be too small if the TESR renders outside the borders of the * parent block. * If you get the boundary too small, the TESR may disappear when you aren't looking directly at it. * @return an appropriately size AABB for the TileEntity */ @SideOnly(Side.CLIENT) @Override public AxisAlignedBB getRenderBoundingBox() { // if your render should always be performed regardless of where the player is looking, use infinite AxisAlignedBB infiniteExample = INFINITE_EXTENT_AABB; // our gem will stay above the block, up to 1 block higher, so our bounding box is from [x,y,z] to [x+1, y+2, z+1] AxisAlignedBB aabb = new AxisAlignedBB(getPos(), getPos().add(1, 2, 1)); return aabb; } (What I mean is - try it with an infinite box. If that fixes your problem, your bounding box is wrong - try setting a breakpoint or System.out.println in there to see why) This link might also be of interest https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe21_tileentityspecialrenderer -TGG
-
[1.8] Can't get block to render in inventory
TheGreyGhost replied to 61352151511's topic in Modder Support
keen, glad you fixed it. TGG -
I think the short answer is - no, it is not possible in the same way as IItemRenderer was. in RenderEntityItem // Forge: Call to IItemRenderer, For now Its disabled. //i = net.minecraftforge.client.ForgeHooksClient.renderEntityItem(p_177075_1_, itemstack, this.field_177079_e, this.renderManager.renderEngine, i); I wouldn't hold my breath for it to be reenabled either. I also think it will be quite tricky to add this behaviour using the existing hooks, I would suggest using Reflection to either add the call above into RenderEntityItem, or alternatively create your own EntityMyItem extends EntityItem, register a renderer for that, and use Reflection to substitute your EntityMyItem whenever an EntityItem is created for your item, eg in World.spawnEntityInWorld. If you figure out how to do it I'd be very interested... -TGG
-
Hi Some questions 1) Do the subtypes both show up in the creative inventory? (i.e. an item for both cherry and dev) Or is there only one custom plank? 2) do the items render correctly in your hand or in the inventory? 3) if you place the cherry block, does it look the same as the dev block? 4) are there any relevant error messages in the console? One thing to try (which may not fix it) add this.setHasSubtypes(true); to your ACPlanksItem constructor -TGG
-
show some screenshots of the symptoms? -TGG
-
[1.8] Can't get block to render in inventory
TheGreyGhost replied to 61352151511's topic in Modder Support
Hi Try doing the modelmesher code step by step and using your debugger or System.out.println to make sure it is working correctly.. eg Item itemBlockPartial = GameRegistry.findItem("minecraftbyexample", "mbe02_block_partial"); ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation("minecraftbyexample:mbe02_block_partial", "inventory"); final int DEFAULT_ITEM_SUBTYPE = 0; Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockPartial, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation); Perhaps (eg) your String id is wrong, or similar. If no joy with that, try placing a breakpoint in ItemRenderer.renderItemInFirstPerson at this line this.renderItem(entityplayersp, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON); and then trace through until you get to RenderItem.renderItemModelForEntity at this line IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack); This will let you see if the mesher has your model or not- i.e. if ibakedmodel is not found anywhere, or if it is found but is not right. If that doesn't give you enough info, post back your results? -TGG -
[1.8] Can't get block to render in inventory
TheGreyGhost replied to 61352151511's topic in Modder Support
> FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT !! this is just begging for trouble, you should use proxies instead - see here http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html Try fixing it and seeing if it solves your problem. -TGG -
This link might be helpful http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html -TGG
-
[1.8] Registering Item Models With Metadata
TheGreyGhost replied to shucke's topic in Modder Support
Dude... you need more sleep private void registerItemModelWithMeta(Item item, int meta, String loc){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( FishingItems.rawFish, // aiiiiee meta, new ModelResourceLocation(loc, "inventory")); -TGG -
Hi At the moment you can't use the Block Models to render your techne models. You would either need to convert to the block model format, or use a TileEntitySpecialRenderer, or use reflection to add a new render type. Some more background on 1.8 models here (see the Block Rendering sections) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
-
[1.8] "flying is not allowed on this server". Is it my mod's fault?
TheGreyGhost replied to ElDome's topic in Modder Support
Are you messing with the player's bounding box by any chance? If you know how to use conditional breakpoints on your debugger, you could try running the server in the debugger and putting a conditional breakpoint on this line: NetHandlerPlayServer::processPlayer(C03PacketPlayer packetIn) if (!this.serverController.isFlightAllowed() && !this.playerEntity.capabilities.allowFlying && !worldserver.checkBlockCollision(axisalignedbb) && !this.playerEntity.capabilities.allowFlying) // breakpoint here If you put a breakpoint there to stop when this.floatingTickCount == 80, then you can trace into worldserver.checkBlockCollision and see why your player's abb doesn't collide with it. -TGG -
Well, saving you a few frustrating hours maybe By the way - forge 1.8 is out of beta now! http://www.minecraftforge.net/forum/index.php/topic,27505.0.html I think you're right.... -TGG
-
What I've done that worked for me: In the build.gradle file, you'll find a version number eg minecraft { version = "1.8-11.14.0.1285-1.8" Change it to the version number you want, re-run gradlew setupDecompWorkspace eclipse or gradlew setupDecompWorkspace idea and you're done. Backup first if you're not using github or similar. http://jabelarminecraft.blogspot.com.au/p/quick-tips-eclipse.html talks about it some more. -TGG
-
[1.8] "flying is not allowed on this server". Is it my mod's fault?
TheGreyGhost replied to ElDome's topic in Modder Support
does it happen repeatably, or intermittently / randomly? -
[1.8] "flying is not allowed on this server". Is it my mod's fault?
TheGreyGhost replied to ElDome's topic in Modder Support
Hi This message seems to arise when the player is out of contact with the ground (player doesn't collide with a solid block under their feet) for more than 80 C03PacketPlayer packets in a row. Does your mod give the player extra high bounce or something? A network load problem seems unlikely because the code looks like it counts the number of packets it receives. Not sure how you could best troubleshoot this one; trial and error might be necessary? -TGG -
[1.7.10] Directional blocks don't render correctly in inventory.
TheGreyGhost replied to Geforce's topic in Modder Support
Hi That just means that the front of your furnace is on the other side of the cube where you can't see it. From memory, the item renders with a metadata of 0 which (presumably) makes your block face the other way. If you swap your metadata values around (i.e. make north south and east west) it should render with the front visible. -TGG -
Hi Are you using the latest Forge 1.8? This happened to me as well and it was a bug in forge that they fixed at least a month ago. -TGG