Posted October 23, 201510 yr What do I do if I want a block to rotate. Similar to the furnace, when you place it, it always gets placed with the front facing you. Thanks. package com.chlod.golf.Blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class Slide extends Block{ protected Slide(Material p_i45394_1_) { super(p_i45394_1_); this.slipperiness = 1.5F; this.setTickRandomly(true); } } Developer of Chlod's Mod! Project Link: http://minecraft.curseforge.com/projects/chlods-mod
October 23, 201510 yr Look into IIcon in regards to taking side/meta data parameters. Also, Depending on 1.7.x or 1.8 you may find BlockState or otherwise. Reference block code on this tutorial for example of 1.8 code: jabelarminecraft.blogspot.com/p/blog-page_31.html?m=1 For 1.7.10 I'd recommend: bedrockminer.jimdo.com/modding-tutorials/basic-modding-1-7/multi-texture-blocks/ You can also look at vanilla furnace or crafting table (work bench in class name) as they use front, side and top textures. www.YouTube.com/WeiseGamer www.twitter.com/WeiseGamer
October 23, 201510 yr Looks like you are on 1.7.x - you'll want to override #onBlockPlacedBy which is called when a player places the block, and then #getIcon to return the appropriate texture based on the side and current metadata. You can basically copy the implementations from BlockFurnace provided that you are not using metadata for anything else, though I would recommend you take some time to understand how it works. http://i.imgur.com/NdrFdld.png[/img]
October 25, 20159 yr This is my blocks. I want to merge #2 and #8, #3 and #9, #4 and #5 and #6 and #7 blocks. I mean, it'll be new blocks, that'll be rotate its upper texture due to yaw of player who placed this blocks. Please, learn me, how to do it?
October 25, 20159 yr Looks like you are on 1.7.x - you'll want to override #onBlockPlacedBy which is called when a player places the block, and then #getIcon to return the appropriate texture based on the side and current metadata. You can basically copy the implementations from BlockFurnace provided that you are not using metadata for anything else, though I would recommend you take some time to understand how it works. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.