All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.BlockWorkbench Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package net.minecraft.server;

public class BlockWorkbench extends Block {

  protected BlockWorkbench() {
    super(Material.WOOD);
    this.a(CreativeModeTab.c);
  }

  public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumDirection enumdirection, float f, float f1, float f2) {
    if (!world.isClientSide) {
      entityhuman.openTileEntity(new TileEntityContainerWorkbench(world, blockposition));
      entityhuman.b(StatisticList.Z);
    }
    return true;
  }

  public static class TileEntityContainerWorkbench implements ITileEntityContainer {

    private final World a;
    private final BlockPosition b;

    public TileEntityContainerWorkbench(World world, BlockPosition blockposition) {
      this.a = world;
      this.b = blockposition;
    }

    public String getName() {
      return null;
    }

    public boolean hasCustomName() {
      return false;
    }

    public IChatBaseComponent getScoreboardDisplayName() {
      return new ChatMessage(Blocks.CRAFTING_TABLE.a() + ".name");
    }

    public Container createContainer(PlayerInventory playerinventory, EntityHuman entityhuman) {
      return new ContainerWorkbench(playerinventory, this.a, this.b);
    }

    public String getContainerName() {
      return "minecraft:crafting_table";
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy