Posted January 30, 20178 yr Hi! I made a oak shelf, i am able to add items on it with right click, but as you can see in the picture, the items are on one side only in the right position... As you can see: And yes, its pretty obvious, because i use static translates this is my SpecialTileEntity renderer part: private static final EntityItem ITEM = new EntityItem(Minecraft.getMinecraft().world, 0, 0, 0, new ItemStack(ModItems.tinApple)); @Override public void renderTileEntityAt(TileEntityOakShelf te, double x, double y, double z, float partialTicks, int destroyStage) { super.renderTileEntityAt(te, x, y, z, partialTicks, destroyStage); ITEM.hoverStart = 0F; GlStateManager.pushMatrix(); { GlStateManager.translate(x, y, z); GlStateManager.rotate(90F, 1, 90F, 0); GlStateManager.translate(-0.22, 0.5, .15); GlStateManager.scale(.5, .5, .5); for(int i = 0; i < te.itemCount; i++){ Minecraft.getMinecraft().getRenderManager().doRenderEntity(ITEM, 0, 0, 0, 0F, 0F, false); GlStateManager.translate(-0.3625, 0, 0); } } GlStateManager.popMatrix(); } } How would i make it that it goes to the right side evertime? Thanks a bunch!
January 30, 20178 yr Make an EnumFacing variable in your tile entity, and then in put in a if(te.getFacing() == EnumFacing.*) in your TESR and then rotate the items differently and place them different Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 30, 20178 yr Author Make an EnumFacing variable in your tile entity, and then in put in a if(te.getFacing() == EnumFacing.*) in your TESR and then rotate the items differently and place them different So, i went off on the code way you told me here, i ended up with this: My TileEntity: public EnumFacing getFacing(){ EnumFacing face = (EnumFacing) EnumFacing.NORTH; return face; } and my Special Renderer if(te.getFacing() == EnumFacing.NORTH){ GlStateManager.pushMatrix(); { GlStateManager.translate(x, y, z); GlStateManager.rotate(90F, 1, 90F, 0); GlStateManager.translate(-0.22, 0.5, .15); GlStateManager.scale(.5, .5, .5); for(int i = 0; i < te.itemCount; i++){ Minecraft.getMinecraft().getRenderManager().doRenderEntity(ITEM, 0, 0, 0, 0F, 0F, false); GlStateManager.translate(-0.3625, 0, 0); } } GlStateManager.popMatrix(); } But i cant seem to find how to get the facing of the block right there... because i told it to keep on NORTH
January 30, 20178 yr What you need to do is access the BlockState of your block where the TileEntity is and check the FACING property and get the Facing from that. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
January 30, 20178 yr Author What you need to do is access the BlockState of your block where the TileEntity is and check the FACING property and get the Facing from that. As a newb im looking into these things on google, not much luck yet with this public IBlockState getState(){ IBlockState state = (IBlockState) super.getUpdateTag(); return state; } Why isnt there a simple method like: getFacing(); that returns the face haha
January 30, 20178 yr How much Java do you know? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
January 31, 20178 yr As a newb im looking into these things on google, not much luck yet with this public IBlockState getState(){ IBlockState state = (IBlockState) super.getUpdateTag(); return state; } Why isnt there a simple method like: getFacing(); that returns the face haha o_O The getUpdateTag method returns some Packet object. Why on earth are you trying to cast that to an IBlockState? There's nothing even in the method's name to suggest that it might be even tangentially related to what you're trying to do. There isn't a simple method like getFacing because you have to create it yourself. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 31, 20178 yr Author As a newb im looking into these things on google, not much luck yet with this public IBlockState getState(){ IBlockState state = (IBlockState) super.getUpdateTag(); return state; } Why isnt there a simple method like: getFacing(); that returns the face haha o_O The getUpdateTag method returns some Packet object. Why on earth are you trying to cast that to an IBlockState? There's nothing even in the method's name to suggest that it might be even tangentially related to what you're trying to do. There isn't a simple method like getFacing because you have to create it yourself. Well, i put that there because i was testing all the super. statements, i ended on getUpdateTag(), not that i am specificly using it. How much Java do you know? Not much. Well, i cant learn by 'reading' so i tend to learn from tutorials.
January 31, 20178 yr I would suggest watching some tutorials on some Object Oriented Programming so you can learn the concepts, I would recommend it being Java over other obviously. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
January 31, 20178 yr Author I would suggest watching some tutorials on some Object Oriented Programming so you can learn the concepts, I would recommend it being Java over other obviously. Yeah... as im coming from a PHP/JS/HTML/CSS background..
January 31, 20178 yr I would suggest watching some tutorials on some Object Oriented Programming so you can learn the concepts, I would recommend it being Java over other obviously. Yeah... as im coming from a PHP/JS/HTML/CSS background.. Yeah that is not quite the best for this....Once you have those OOP concepts down you should be able to tackle this problem with barely any effort. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
January 31, 20178 yr Author I would suggest watching some tutorials on some Object Oriented Programming so you can learn the concepts, I would recommend it being Java over other obviously. Yeah... as im coming from a PHP/JS/HTML/CSS background.. Yeah that is not quite the best for this....Once you have those OOP concepts down you should be able to tackle this problem with barely any effort. I hope so Any recommendations of a tutorial i should look into, and by that i mean a creators name?
January 31, 20178 yr I would suggest watching some tutorials on some Object Oriented Programming so you can learn the concepts, I would recommend it being Java over other obviously. Yeah... as im coming from a PHP/JS/HTML/CSS background.. Yeah that is not quite the best for this....Once you have those OOP concepts down you should be able to tackle this problem with barely any effort. I hope so Any recommendations of a tutorial i should look into, and by that i mean a creators name? I do not have any recommendations because I just jumped in and learned as I went, but you can just go on to youtube and search for "java concepts tutorial for beginners" or "java for beginners" and that should work. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.