small cleanup

This commit is contained in:
Sen 2025-06-21 21:10:00 +02:00
parent 827d9585c3
commit 1ef1b4ae30
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
7 changed files with 12 additions and 60 deletions

View file

@ -48,7 +48,6 @@ import common.item.ItemChargedOrb;
import common.item.ItemChest;
import common.item.ItemColored;
import common.item.ItemDie;
import common.item.ItemDispenser;
import common.item.ItemDoor;
import common.item.ItemDoublePlant;
import common.item.ItemDye;
@ -71,7 +70,6 @@ import common.item.ItemFragile;
import common.item.ItemGlassBottle;
import common.item.ItemHoe;
import common.item.ItemHorseArmor;
import common.item.ItemHugeMushroom;
import common.item.ItemInfoWand;
import common.item.ItemKey;
import common.item.ItemLead;
@ -216,8 +214,8 @@ public abstract class ItemRegistry {
static void register() {
registerBlock(Blocks.grass, new ItemColored(Blocks.grass));
registerBlock(Blocks.dispenser, new ItemDispenser(Blocks.dispenser));
registerBlock(Blocks.dropper, new ItemDispenser(Blocks.dropper));
registerBlock(Blocks.dispenser, new ItemBlock(Blocks.dispenser, 2));
registerBlock(Blocks.dropper, new ItemBlock(Blocks.dropper, 2));
registerBlock(Blocks.sticky_piston, new ItemPiston(Blocks.sticky_piston));
registerBlock(Blocks.piston, new ItemPiston(Blocks.piston));
registerBlock(Blocks.nuke, new ItemBlock(Blocks.nuke).setColor(TextColor.RED));
@ -225,8 +223,8 @@ public abstract class ItemRegistry {
registerBlock(Blocks.stone_pressure_plate, new ItemPressurePlate(Blocks.stone_pressure_plate));
registerBlock(Blocks.wooden_pressure_plate, new ItemPressurePlate(Blocks.wooden_pressure_plate));
registerBlock(Blocks.snow_layer, new ItemSnow(Blocks.snow_layer));
registerBlock(Blocks.brown_mushroom_block, new ItemHugeMushroom(Blocks.brown_mushroom_block));
registerBlock(Blocks.red_mushroom_block, new ItemHugeMushroom(Blocks.red_mushroom_block));
registerBlock(Blocks.brown_mushroom_block, new ItemBlock(Blocks.brown_mushroom_block, 14));
registerBlock(Blocks.red_mushroom_block, new ItemBlock(Blocks.red_mushroom_block, 14));
registerBlock(Blocks.vine, new ItemColored(Blocks.vine, ""));
registerBlock(Blocks.waterlily, new ItemLilyPad(Blocks.waterlily));
registerBlock(Blocks.trapped_chest, new ItemChest(Blocks.trapped_chest));

View file

@ -151,7 +151,7 @@ public abstract class Items {
public static final ItemBlock brown_glass = get("brown_glass");
public static final ItemBlock brown_glass_pane = get("brown_glass_pane");
public static final ItemBlock brown_mushroom = get("brown_mushroom");
public static final ItemHugeMushroom brown_mushroom_block = get("brown_mushroom_block");
public static final ItemBlock brown_mushroom_block = get("brown_mushroom_block");
public static final ItemBlock brown_wool = get("brown_wool");
public static final ItemBucket bucket = get("bucket");
public static final ItemFlintAndSteel burning_soul = get("burning_soul");
@ -275,9 +275,9 @@ public abstract class Items {
public static final ItemDie die_6 = get("die_6");
public static final ItemDie die_8 = get("die_8");
public static final ItemBlock dirt = get("dirt");
public static final ItemDispenser dispenser = get("dispenser");
public static final ItemBlock dispenser = get("dispenser");
public static final ItemBlock dragon_egg = get("dragon_egg");
public static final ItemDispenser dropper = get("dropper");
public static final ItemBlock dropper = get("dropper");
public static final ItemBlock dry_leaves = get("dry_leaves");
public static final ItemDynamite dynamite = get("dynamite");
public static final ItemDynamite dynamite_1 = get("dynamite_1");
@ -662,7 +662,7 @@ public abstract class Items {
public static final ItemBlock red_glass = get("red_glass");
public static final ItemBlock red_glass_pane = get("red_glass_pane");
public static final ItemBlock red_mushroom = get("red_mushroom");
public static final ItemHugeMushroom red_mushroom_block = get("red_mushroom_block");
public static final ItemBlock red_mushroom_block = get("red_mushroom_block");
public static final ItemBlock red_sand = get("red_sand");
public static final ItemBlock red_tulip = get("red_tulip");
public static final ItemBlock red_wool = get("red_wool");

View file

@ -122,11 +122,6 @@ public class Item
return stack;
}
public int getMetadata()
{
return 0;
}
public boolean hitEntity(ItemStack stack, EntityLiving target, EntityLiving attacker)
{
return false;

View file

@ -79,8 +79,7 @@ public class ItemBlock extends Item
}
else if (worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack))
{
int i = this.getMetadata();
State iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, i, playerIn);
State iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, this.fixedMeta, playerIn);
if (worldIn.setState(pos, iblockstate1, 3))
{
@ -192,11 +191,6 @@ public class ItemBlock extends Item
{
return this.block;
}
public int getMetadata()
{
return this.fixedMeta;
}
// public Set<String> getValidTags() {
// return Sets.newHashSet("BlockEntityTag");
@ -222,8 +216,8 @@ public class ItemBlock extends Item
public Model getModel(ModelProvider provider, String name) {
return this.flatTexture != null ? provider.getModel(this.getTransform(), !this.flatTexture.isEmpty() ? this.flatTexture :
this.block.getModel(provider,
BlockRegistry.getNameFromBlock(this.block).toString(), this.block.getStateFromMeta(this.getMetadata())).getPrimary() /* "blocks/" + name */) :
BlockRegistry.getNameFromBlock(this.block).toString(), this.block.getStateFromMeta(this.fixedMeta)).getPrimary() /* "blocks/" + name */) :
provider.getModel(this.block.getModel(provider,
BlockRegistry.getNameFromBlock(this.block).toString(), this.block.getStateFromMeta(this.getMetadata())), this.getTransform());
BlockRegistry.getNameFromBlock(this.block).toString(), this.block.getStateFromMeta(this.fixedMeta)), this.getTransform());
}
}

View file

@ -1,13 +0,0 @@
package common.item;
import common.block.Block;
public class ItemDispenser extends ItemBlock {
public ItemDispenser(Block block) {
super(block);
}
public int getMetadata() {
return 2;
}
}

View file

@ -1,13 +0,0 @@
package common.item;
import common.block.Block;
public class ItemHugeMushroom extends ItemBlock {
public ItemHugeMushroom(Block block) {
super(block);
}
public int getMetadata() {
return 14;
}
}

View file

@ -9,16 +9,7 @@ public class ItemPiston extends ItemBlock
{
public ItemPiston(Block block)
{
super(block);
}
/**
* Converts the given ItemStack damage value into a metadata value to be placed in the world when this Item is
* placed as a Block (mostly used with ItemBlocks).
*/
public int getMetadata()
{
return 7;
super(block, 7);
}
public boolean isMagnetic() {