Beispiel #1
0
 @Override
 @SideOnly(Side.CLIENT)
 public void func_94332_a(IconRegister register) {
   for (GunBoxType type : GunBoxType.gunBoxMap.values()) {
     type.top = register.func_94245_a(type.topTexturePath);
     type.side = register.func_94245_a(type.sideTexturePath);
     type.bottom = register.func_94245_a(type.bottomTexturePath);
   }
 }
Beispiel #2
0
  @Override
  public boolean placeBlockAt(
      ItemStack stack,
      EntityPlayer player,
      World world,
      int x,
      int y,
      int z,
      int side,
      float hitX,
      float hitY,
      float hitZ,
      int metadata) {
    GunBoxType type = GunBoxType.getBox(stack.getItemDamage());
    if (type == null) return false;
    boolean place =
        super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);

    if (place) {
      TileEntityGunBox entity = (TileEntityGunBox) world.getBlockTileEntity(x, y, z);
      entity.setShortName(type.shortName);
    }

    return place;
  }
Beispiel #3
0
  @SideOnly(value = Side.CLIENT)
  @Override
  public Icon getBlockTextureFromSideAndMetadata(int side, int metadata) {
    GunBoxType type = GunBoxType.getBox(metadata);

    if (type == null) return null;

    if (side == 1) {
      return type.top;
    }
    if (side == 0) {
      return type.bottom;
    }
    return type.side;
  }
Beispiel #4
0
 @Override
 public String getUnlocalizedName(ItemStack stack) {
   GunBoxType type = GunBoxType.getBox(stack.getItemDamage());
   if (type == null) return "";
   return type.shortName;
 }