1
Hi. I want to make a crafting table/workbench/whatever that acts EXACTLY the same as the vanilla one, but I want to retexture my version. The following is my code:
It works... kind of. The GUI opens and I can craft with it but the item selection is messed up I can never tell what I'm selecting when I click. If anyone could help, it would be appreciated.
~Unlocked
package com.unlocked.stone_bricks.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.block.BlockWorkbench;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class CraftingBrick extends Block
{
private static final String __OBFID = "CL_00000221";
public CraftingBrick(boolean inverted)
{
super(Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setHardness(1.5f);
this.setResistance(10f);
if (inverted){
this.setBlockName("crafting_brick_inverted");
}
else{
this.setBlockName("crafting_brick");
}
if (inverted){
this.setBlockTextureName("stonebricks:invertedcrafting_brick");
}
else{
this.setBlockTextureName("stonebricks:crafting_brick");
}
}
/**
* Called upon block activation (right click on the block.)
*/
@Override
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
if (!p_149727_1_.isRemote)
{
return true;
}
else
{
p_149727_5_.displayGUIWorkbench(p_149727_2_, p_149727_3_, p_149727_4_);
return true;
}
}
}
It works... kind of. The GUI opens and I can craft with it but the item selection is messed up I can never tell what I'm selecting when I click. If anyone could help, it would be appreciated.
~Unlocked
Create an account or sign in to comment.
12
info Note: You're viewing a single reply. View all replies
1
Yeah...I figured that was the case.