Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

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.

ycb5iKNHHk.png

 

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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.