more cleanup

This commit is contained in:
Sen 2025-06-22 23:29:33 +02:00
parent 72d46bfe72
commit 18962cd653
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
97 changed files with 352 additions and 387 deletions

View file

@ -136,7 +136,7 @@ public class BlockRenderer
// this.chestRenderer.renderChestBrightness(state.getBlock(), brightness);
GlState.color(brightness, brightness, brightness, 1.0F);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(state.getBlock()));
TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(state.getBlock().getItem()));
break;
case 3:

View file

@ -597,7 +597,7 @@ public class WorldClient extends AWorldClient
// for (int i1 = 0; i1 < 8; ++i1) {
// this.spawnEntityFX(EnumParticleTypes.ITEM_CRACK, EnumParticleTypes.ITEM_CRACK.getShouldIgnoreRange(),
// d131, d141, d161, random.gaussian() * 0.15D, random.doublev() * 0.2D, random.gaussian() * 0.15D,
// new int[] {ItemRegistry.getIdFromItem(ItemRegistry.getItemFromBlock(Blocks.glass)), 0});
// new int[] {ItemRegistry.getIdFromItem(Items.glass), 0});
// }
this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F);
break;

View file

@ -18,16 +18,16 @@ import common.world.World;
public class EntityAITakePlace extends EntityAIBase
{
private static final Map<State, ItemStack> STEALABLE = Maps.newHashMap();
private static final Map<State, Item> STEALABLE = Maps.newHashMap();
private static final Map<Item, State> PLACEABLE = Maps.newHashMap();
private static void addPlaceable(State state, ItemStack stack) {
STEALABLE.put(state, stack);
PLACEABLE.put(stack.getItem(), state);
private static void addPlaceable(State state, Item item) {
STEALABLE.put(state, item);
PLACEABLE.put(item, state);
}
private static void addPlaceable(Block block) {
addPlaceable(block.getState(), new ItemStack(block));
addPlaceable(block.getState(), block.getItem());
}
static {
@ -72,7 +72,7 @@ public class EntityAITakePlace extends EntityAIBase
BlockPos blockpos = new BlockPos(i, j, k);
if(this.place) {
ItemStack stack = this.entity.getHeldItem();
if(stack == null || !PLACEABLE.containsKey(this.entity.getHeldItem().getItem()))
if(stack == null || !PLACEABLE.containsKey(stack.getItem()))
return;
Block replace = world.getState(blockpos).getBlock();
Block below = world.getState(blockpos.down()).getBlock();
@ -94,8 +94,7 @@ public class EntityAITakePlace extends EntityAIBase
Block block = state.getBlock();
if (STEALABLE.containsKey(state) &&
(this.entity.getHeldItem() == null || (ItemStack.areItemsEqual(STEALABLE.get(state),
this.entity.getHeldItem()) && this.entity.getHeldItem().size < this.entity.getHeldItem().getMaxStackSize())))
(this.entity.getHeldItem() == null || (STEALABLE.get(state) == this.entity.getHeldItem().getItem() && this.entity.getHeldItem().size < this.entity.getHeldItem().getMaxStackSize())))
{
this.entity.getLookHelper().setLookPosition((double)i + 0.5, (double)j + 0.5, (double)k + 0.5, 10.0F,
(float)this.entity.getVerticalFaceSpeed());
@ -104,7 +103,7 @@ public class EntityAITakePlace extends EntityAIBase
if(this.entity.getHeldItem() != null)
++this.entity.getHeldItem().size;
else
this.entity.setItemNoUpdate(0, STEALABLE.get(state).copy());
this.entity.setItemNoUpdate(0, new ItemStack(STEALABLE.get(state)));
}
}
}
@ -113,7 +112,7 @@ public class EntityAITakePlace extends EntityAIBase
//{
// ItemStack itemstack = player.inventory.armorInventory[3];
//
// if (itemstack != null && itemstack.getItem() == ItemRegistry.getItemFromBlock(Blocks.pumpkin))
// if (itemstack != null && itemstack.getItem() == Items.pumpkin)
// {
// return false;
// }

View file

@ -24,7 +24,7 @@ import common.entity.item.EntityItem;
import common.entity.item.EntityXp;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.ItemRegistry;
import common.init.BlockRegistry;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
@ -189,6 +189,7 @@ public class Block {
private String display;
private CheatTab tab;
public SoundType sound;
private Item item;
private static <T> Iterable<List<T>> cartesianProduct(Iterable<? extends Iterable<? extends T>> sets) {
return arraysAsLists(cartesianProduct(Object.class, sets));
@ -581,7 +582,7 @@ public class Block {
}
public Item getItemDropped(State state, Random rand, int fortune) {
return ItemRegistry.getItemFromBlock(this);
return this.getItem() instanceof ItemBlock item ? item : null;
}
public float getPlayerRelativeBlockHardness(EntityNPC playerIn, World worldIn, BlockPos pos) {
@ -860,9 +861,9 @@ public class Block {
}
public ItemStack createStackedBlock(State state) {
Item item = ItemRegistry.getItemFromBlock(this);
Item item = this.getItem();
// TODO: data
return new ItemStack(item);
return item instanceof ItemBlock ? new ItemStack(item) : null;
}
public int quantityDroppedWithBonus(int fortune, Random random) {
@ -901,7 +902,7 @@ public class Block {
}
public Item getItem(World worldIn, BlockPos pos) {
return ItemRegistry.getItemFromBlock(this);
return this.getItem() instanceof ItemBlock item ? item : null;
}
public CheatTab getTab() {
@ -1020,7 +1021,21 @@ public class Block {
return null;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, this.flatItemTexture ? "" : null);
}
public final Item registerItem() {
Item item = this.getItemToRegister();
if(item == null)
return null;
if(item.getBlock() != this)
throw new IllegalArgumentException("Gegenstand für Block " + BlockRegistry.getNameFromBlock(this) + " stimmt nicht überein");
this.item = item;
return item;
}
public final Item getItem() {
return this.item;
}
}

View file

@ -38,7 +38,7 @@ public final class BlockAir extends Block {
return false;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -208,7 +208,7 @@ public class BlockBed extends Block implements Rotatable {
.d("oak_planks").noCull().rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBed(this).setDisplay(this.color.getSubject(0) + " Bett");
}
}

View file

@ -249,7 +249,7 @@ public class BlockCake extends Block
return cake_slices[state.getValue(BITES)];
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSmallBlock(this).setMaxAmount(1).setDisplay("Kuchen").setTab(CheatTab.DECORATION);
}
}

View file

@ -278,7 +278,7 @@ public class BlockDoor extends Block implements Rotatable
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getItem();
return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getDoorItem();
}
/**
@ -318,10 +318,10 @@ public class BlockDoor extends Block implements Rotatable
public Item getItem(World worldIn, BlockPos pos)
{
return this.getItem();
return this.getDoorItem();
}
private Item getItem()
private Item getDoorItem()
{
return this == Blocks.iron_door ? Items.iron_door : (this == Blocks.spruce_door ? Items.spruce_door : (this == Blocks.birch_door ? Items.birch_door : (this == Blocks.jungle_door ? Items.jungle_door : (this == Blocks.acacia_door ? Items.acacia_door : (this == Blocks.dark_oak_door ? Items.dark_oak_door : (this == Blocks.cherry_door ? Items.cherry_door : (this == Blocks.maple_door ? Items.maple_door : Items.oak_door)))))));
}
@ -504,7 +504,7 @@ public class BlockDoor extends Block implements Rotatable
return new Property[] {POWERED};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemDoor(this);
}

View file

@ -382,7 +382,7 @@ public class BlockFence extends Block
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemFence(this);
}
}

View file

@ -159,7 +159,7 @@ public class BlockFloorPortal extends Block
return "obsidian";
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -9,7 +9,6 @@ import common.collect.Lists;
import common.entity.npc.EntityNPC;
import common.init.BlockRegistry;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
@ -181,7 +180,7 @@ public class BlockFlowerPot extends Block
public Item getItem(World worldIn, BlockPos pos)
{
return worldIn.getState(pos).getBlock() == this && this.content != null ? ItemRegistry.getItemFromBlock(this.content) : Items.flowerpot;
return worldIn.getState(pos).getBlock() == this && this.content != null ? this.content.getItem() : Items.flowerpot;
}
public boolean isPickStrict()
@ -209,7 +208,7 @@ public class BlockFlowerPot extends Block
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
if(this.content != null)
spawnAsEntity(worldIn, pos, new ItemStack(this.content));
spawnAsEntity(worldIn, pos, new ItemStack(this.content.getItem()));
super.onBlockRemoved(worldIn, pos, state);
}
@ -270,7 +269,7 @@ public class BlockFlowerPot extends Block
}
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.content == null ? new ItemSmallBlock(this).setDisplay("Blumentopf").setTab(CheatTab.DECORATION) : null;
}
}

View file

@ -3,7 +3,6 @@ package common.block.artificial;
import common.block.BlockRotatedPillar;
import common.block.Material;
import common.entity.types.EntityLiving;
import common.init.ItemRegistry;
import common.item.CheatTab;
import common.item.ItemStack;
import common.properties.Property;
@ -69,7 +68,7 @@ public class BlockHay extends BlockRotatedPillar
public ItemStack createStackedBlock(State state)
{
return new ItemStack(ItemRegistry.getItemFromBlock(this));
return new ItemStack(this.getItem());
}
/**

View file

@ -20,7 +20,7 @@ public class BlockMetalBlock extends Block {
this.setTab(CheatTab.GEMS);
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemMetalBlock(this, this.metal, false);
}
}

View file

@ -501,7 +501,7 @@ public class BlockPane extends Block
}
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.canDrop ? super.getItemToRegister() : new ItemBlock(this, "glass", false);
}
}

View file

@ -296,7 +296,7 @@ public class BlockPortal extends Block
map.put("portal", 1);
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}

View file

@ -9,7 +9,6 @@ import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
@ -74,7 +73,7 @@ public class BlockPortalFrame extends Block implements Rotatable
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.obsidian);
return Items.obsidian;
}
public int quantityDropped(Random random)

View file

@ -76,7 +76,7 @@ public class BlockSkull extends Block implements Rotatable {
return true;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSmallBlock(this).setDisplay("Schädel").setTab(CheatTab.DECORATION);
}
}

View file

@ -270,7 +270,7 @@ public class BlockSlab extends Block implements Directional
return true;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSlab(this);
}

View file

@ -50,7 +50,7 @@ public class BlockStainedGlassPane extends BlockPane
return this.color.getName() + "_glass_pane";
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, "");
}
}

View file

@ -296,7 +296,7 @@ public class BlockWall extends Block
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemWall(this);
}
}

View file

@ -25,7 +25,7 @@ public class BlockCarrot extends BlockCrops
return crop(provider, name + "_" + (age == 6 ? 2 : (age / 2)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSeedFood(3, this, Blocks.farmland).setDisplay("Karotte").setMaxAmount(128);
}
}

View file

@ -271,7 +271,7 @@ public class BlockCocoa extends Block implements Rotatable, IGrowable
return model.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -243,7 +243,7 @@ public class BlockCrops extends BlockBush implements IGrowable
.s().uv(0, 0, 16, 16).noCull();
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSeeds(this, Blocks.farmland).setDisplay("Weizenkörner").setMaxAmount(256);
}
}

View file

@ -64,7 +64,7 @@ public class BlockDeadBush extends BlockBush
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
{
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
spawnAsEntity(worldIn, pos, new ItemStack(Blocks.deadbush));
spawnAsEntity(worldIn, pos, new ItemStack(Items.deadbush));
}
else
{

View file

@ -8,7 +8,6 @@ import common.color.Colorizer;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
@ -152,7 +151,7 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
}
else
{
return this.type == BlockDoublePlant.EnumPlantType.FERN ? null : (this.type == BlockDoublePlant.EnumPlantType.GRASS ? (rand.chance(8) ? Items.wheat : null) : ItemRegistry.getItemFromBlock(this));
return this.type == BlockDoublePlant.EnumPlantType.FERN ? null : (this.type == BlockDoublePlant.EnumPlantType.GRASS ? (rand.chance(8) ? Items.wheat : null) : this.getItem());
}
}
@ -236,7 +235,7 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
}
else
{
spawnAsEntity(worldIn, pos, new ItemStack(this.type == BlockDoublePlant.EnumPlantType.GRASS ? Blocks.tallgrass : Blocks.fern, 2));
spawnAsEntity(worldIn, pos, new ItemStack(this.type == BlockDoublePlant.EnumPlantType.GRASS ? Items.tallgrass : Items.fern, 2));
return true;
}
}
@ -256,7 +255,7 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{
spawnAsEntity(worldIn, pos, new ItemStack(this));
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
}
/**
@ -301,7 +300,7 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
return new Property[] {FACING};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemDoublePlant(this);
}

View file

@ -145,7 +145,7 @@ public class BlockGrass extends Block implements IGrowable
.add().nswe("grass_side_overlay").tint();
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemColored(this);
}
}

View file

@ -3,7 +3,6 @@ package common.block.foliage;
import common.block.Block;
import common.block.Material;
import common.entity.types.EntityLiving;
import common.init.ItemRegistry;
import common.item.Item;
import common.item.block.ItemBlock;
import common.model.Model;
@ -64,12 +63,12 @@ public class BlockHugeMushroom extends Block
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(this.smallBlock);
return this.smallBlock.getItem();
}
public Item getItem(World worldIn, BlockPos pos)
{
return ItemRegistry.getItemFromBlock(this.smallBlock);
return this.smallBlock.getItem();
}
/**
@ -143,7 +142,7 @@ public class BlockHugeMushroom extends Block
}
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, 14);
}

View file

@ -320,7 +320,7 @@ public class BlockLeaves extends BlockLeavesBase
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te) {
if(!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears) {
spawnAsEntity(worldIn, pos, new ItemStack(this));
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
}
else {
super.harvestBlock(worldIn, player, pos, state, te);
@ -336,7 +336,7 @@ public class BlockLeaves extends BlockLeavesBase
return new Property[] {DECAY};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemColored(this, 8);
}
}

View file

@ -115,7 +115,7 @@ public class BlockLilyPad extends BlockBush implements Rotatable
.rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemLilyPad(this);
}
}

View file

@ -44,7 +44,7 @@ public class BlockPotato extends BlockCrops
return crop(provider, name + "_" + (age == 6 ? 2 : (age / 2)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSeedFood(1, this, Blocks.farmland).setDisplay("Kartoffel").setMaxAmount(128);
}
}

View file

@ -194,7 +194,7 @@ public class BlockReed extends Block
return new Property[] {AGE};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSmallBlock(this).setDisplay("Zuckerrohr").setTab(CheatTab.PLANTS).setMaxAmount(128);
}
}

View file

@ -321,7 +321,7 @@ public class BlockStem extends BlockBush implements DirectionalUp, IGrowable
}
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSeeds(this, Blocks.farmland).setDisplay(this.itemName).setMaxAmount(256);
}
}

View file

@ -106,7 +106,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
{
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
{
spawnAsEntity(worldIn, pos, new ItemStack(this));
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
}
else
{
@ -149,7 +149,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
return provider.getModel("deadbush").cross();
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemColored(this, "");
}

View file

@ -6,6 +6,7 @@ import common.color.Colorizer;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
@ -427,7 +428,7 @@ public class BlockVine extends Block
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
{
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
spawnAsEntity(worldIn, pos, new ItemStack(Blocks.vine));
spawnAsEntity(worldIn, pos, new ItemStack(Items.vine));
}
else
{
@ -593,7 +594,7 @@ public class BlockVine extends Block
}
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemColored(this, "");
}
}

View file

@ -134,7 +134,7 @@ public class BlockWart extends BlockBush
return BlockCrops.crop(provider, name + "_" + (age >= 2 ? age - 1 : age));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSeeds(this, Blocks.soul_sand).setDisplay("Seelenwarze").setPotionEffect("+4").setMaxAmount(128);
}
}

View file

@ -404,7 +404,7 @@ public abstract class BlockLiquid extends Block
return true;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -2,8 +2,7 @@ package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.rng.Random;
@ -16,6 +15,6 @@ public class BlockBlackenedStone extends Block {
}
public Item getItemDropped(State state, Random rand, int fortune) {
return ItemRegistry.getItemFromBlock(Blocks.blackened_cobble);
return Items.blackened_cobble;
}
}

View file

@ -1153,7 +1153,7 @@ public class BlockFire extends Block
return true;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -2,7 +2,6 @@ package common.block.natural;
import common.block.BlockFalling;
import common.block.Material;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
@ -21,11 +20,11 @@ public class BlockGravel extends BlockFalling
{
int chance = Vars.flintChance;
if(chance <= 0)
return ItemRegistry.getItemFromBlock(this);
return this.getItem();
fortune *= 3;
if(fortune >= chance)
fortune = chance - 1;
return rand.chance(chance - fortune) ? Items.flint : ItemRegistry.getItemFromBlock(this);
return rand.chance(chance - fortune) ? Items.flint : this.getItem();
}
// public MapColor getMapColor(IBlockState state)

View file

@ -15,7 +15,7 @@ public class BlockMetalOre extends BlockOre {
this.setRadiation(metal.radioactivity * 0.5f);
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemMetalBlock(this, this.metal, true);
}
}

View file

@ -2,8 +2,7 @@ package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.rng.Random;
@ -22,7 +21,7 @@ public class BlockObsidian extends Block
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.obsidian);
return Items.obsidian;
}
// /**

View file

@ -2,7 +2,6 @@ package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.init.ItemRegistry;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
@ -49,13 +48,13 @@ public class BlockOre extends Block
public Item getItemDropped(State state, Random rand, int fortune)
{
return this.dropItem == null ? ItemRegistry.getItemFromBlock(this) : this.dropItem.getItem();
return this.dropItem == null ? this.getItem() : this.dropItem.getItem();
// this == Blocks.coal_ore ? Items.coal :
// (this == Blocks.diamond_ore ? Items.diamond :
// (this == Blocks.lapis_ore ? Items.dye :
// (this == Blocks.emerald_ore ? Items.emerald :
// (this == Blocks.quartz_ore ? Items.quartz :
// ItemRegistry.getItemFromBlock(this)))));
// this.getItem()))));
}
public int quantityDropped(Random random)
@ -67,7 +66,7 @@ public class BlockOre extends Block
public int quantityDroppedWithBonus(int fortune, Random random)
{
if (fortune > 0 &&
ItemRegistry.getItemFromBlock(this) != this.getItemDropped((State)this.getValidStates().iterator().next(), random, fortune))
this.getItem() != this.getItemDropped((State)this.getValidStates().iterator().next(), random, fortune))
{
int i = random.zrange(fortune + 2) - 1;
@ -96,7 +95,7 @@ public class BlockOre extends Block
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
if (this.getItemDropped(state, worldIn.rand, fortune) != ItemRegistry.getItemFromBlock(this))
if (this.getItemDropped(state, worldIn.rand, fortune) != this.getItem())
{
int i = worldIn.rand.range(this.minExperience, this.maxExperience);

View file

@ -5,7 +5,6 @@ import common.block.Material;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
@ -114,7 +113,7 @@ public class BlockRedstoneOre extends Block
{
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
if (this.getItemDropped(state, worldIn.rand, fortune) != ItemRegistry.getItemFromBlock(this))
if (this.getItemDropped(state, worldIn.rand, fortune) != this.getItem())
{
int i = worldIn.rand.roll(5);
this.dropXpOnBlockBreak(worldIn, pos, i);
@ -179,7 +178,7 @@ public class BlockRedstoneOre extends Block
public ItemStack createStackedBlock(State state)
{
return new ItemStack(Blocks.redstone_ore);
return new ItemStack(Items.redstone_ore);
}
public boolean isXrayVisible()
@ -195,7 +194,7 @@ public class BlockRedstoneOre extends Block
return provider.getModel("redstone_ore").add().all();
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.isOn ? null : super.getItemToRegister();
}
}

View file

@ -190,7 +190,7 @@ public class BlockSnow extends Block
provider.getModel("snow").add(0, 0, 0, 16, height, 16).u().noCull().d().nswe().uv(0, 16 - height, 16, 16);
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSnow(this);
}
}

View file

@ -2,8 +2,7 @@ package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.rng.Random;
@ -16,6 +15,6 @@ public class BlockStone extends Block {
}
public Item getItemDropped(State state, Random rand, int fortune) {
return ItemRegistry.getItemFromBlock(Blocks.cobblestone);
return Items.cobblestone;
}
}

View file

@ -261,7 +261,7 @@ public abstract class BlockBasePressurePlate extends Block
.e().uv(1, 15, 15, 16).noCull();
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemPressurePlate(this);
}

View file

@ -545,7 +545,7 @@ public class BlockBrewingStand extends BlockContainer
| (state.getValue(HAS_BOTTLE[2]) ? 4 : 0)];
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSmallBlock(this).setDisplay("Braustand").setTab(CheatTab.TECHNOLOGY);
}
}

View file

@ -438,7 +438,7 @@ public class BlockButton extends Block implements Directional
.rotate(getRotation(state.getValue(FACING)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemButton(this);
}
}

View file

@ -672,7 +672,7 @@ public class BlockCauldron extends Block
return cauldron_levels[state.getValue(LEVEL)];
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSmallBlock(this).setDisplay("Kessel").setTab(CheatTab.TECHNOLOGY);
}
}

View file

@ -641,7 +641,7 @@ public class BlockChest extends BlockContainer implements Rotatable
return "oak_planks";
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemChest(this);
}
}

View file

@ -5,7 +5,7 @@ import common.block.Material;
import common.block.SoundType;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.model.Model;
@ -111,12 +111,12 @@ public class BlockDaylightDetector extends BlockContainer
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.daylight_detector);
return Items.daylight_detector;
}
public Item getItem(World worldIn, BlockPos pos)
{
return ItemRegistry.getItemFromBlock(Blocks.daylight_detector);
return Items.daylight_detector;
}
public boolean isFullCube()
@ -192,7 +192,7 @@ public class BlockDaylightDetector extends BlockContainer
.e("daylight_detector_side").uv(0, 10, 16, 16);
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.inverted ? null : super.getItemToRegister();
}
}

View file

@ -322,7 +322,7 @@ public class BlockDispenser extends BlockContainer implements Directional
return new Property[] {TRIGGERED};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, 2);
}
}

View file

@ -7,7 +7,7 @@ import common.block.Material;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.inventory.Container;
import common.inventory.InventoryHelper;
import common.item.Item;
@ -44,7 +44,7 @@ public class BlockFurnace extends BlockContainer implements Rotatable
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.furnace);
return Items.furnace;
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
@ -228,7 +228,7 @@ public class BlockFurnace extends BlockContainer implements Rotatable
public Item getItem(World worldIn, BlockPos pos)
{
return ItemRegistry.getItemFromBlock(Blocks.furnace);
return Items.furnace;
}
/**

View file

@ -362,7 +362,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
return new Property[] {ENABLED};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, "hopper", true);
}
}

View file

@ -318,7 +318,7 @@ public class BlockLever extends Block
.rotate(getRotation(state.getValue(FACING)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, "lever", false);
}

View file

@ -77,7 +77,7 @@ public class BlockNuke extends Block
return provider.getModel("nuke_side").add().nswe().d("nuke_bottom").u("nuke_top");
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this).setColor(TextColor.RED);
}
}

View file

@ -729,7 +729,7 @@ public class BlockPistonBase extends Block implements Directional
? state.getValue(FACING).getOpposite() : state.getValue(FACING)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemPiston(this);
}
}

View file

@ -8,7 +8,7 @@ import common.block.Material;
import common.block.SoundType;
import common.entity.Entity;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.model.Model;
import common.model.ModelProvider;
@ -227,7 +227,7 @@ public class BlockPistonHead extends Block implements Directional
public Item getItem(World worldIn, BlockPos pos)
{
return worldIn.getState(pos).getValue(TYPE) == BlockPistonHead.EnumPistonType.STICKY ? ItemRegistry.getItemFromBlock(Blocks.sticky_piston) : ItemRegistry.getItemFromBlock(Blocks.piston);
return worldIn.getState(pos).getValue(TYPE) == BlockPistonHead.EnumPistonType.STICKY ? Items.sticky_piston : Items.piston;
}
/**
@ -296,7 +296,7 @@ public class BlockPistonHead extends Block implements Directional
? state.getValue(FACING).getOpposite() : state.getValue(FACING)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}

View file

@ -311,7 +311,7 @@ public class BlockPistonMoving extends BlockContainer
return new Property[] {FACING, TYPE};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -441,7 +441,7 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Komparator").setTab(CheatTab.TECHNOLOGY);
}

View file

@ -3,7 +3,7 @@ package common.block.tech;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.rng.Random;
@ -76,24 +76,24 @@ public class BlockRedstoneLight extends Block
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.redstone_lamp);
return Items.redstone_lamp;
}
public Item getItem(World worldIn, BlockPos pos)
{
return ItemRegistry.getItemFromBlock(Blocks.redstone_lamp);
return Items.redstone_lamp;
}
public ItemStack createStackedBlock(State state)
{
return new ItemStack(Blocks.redstone_lamp);
return new ItemStack(Items.redstone_lamp);
}
public boolean isMagnetic() {
return true;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.isOn ? null : super.getItemToRegister();
}
}

View file

@ -571,7 +571,7 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Verstärker").setTab(CheatTab.TECHNOLOGY);
}
}

View file

@ -7,7 +7,7 @@ import common.block.Block;
import common.collect.Lists;
import common.collect.Maps;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.init.SoundEvent;
import common.item.CheatTab;
import common.item.Item;
@ -177,7 +177,7 @@ public class BlockRedstoneTorch extends BlockTorch
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.redstone_torch);
return Items.redstone_torch;
}
/**
@ -212,7 +212,7 @@ public class BlockRedstoneTorch extends BlockTorch
public Item getItem(World worldIn, BlockPos pos)
{
return ItemRegistry.getItemFromBlock(Blocks.redstone_torch);
return Items.redstone_torch;
}
public boolean isAssociatedBlock(Block other)
@ -224,7 +224,7 @@ public class BlockRedstoneTorch extends BlockTorch
return true;
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return this.isOn ? super.getItemToRegister() : null;
}

View file

@ -1029,7 +1029,7 @@ public class BlockRedstoneWire extends Block
return new Property[] {POWER};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemRedstone(Blocks.redstone).setDisplay("Redstone").setPotionEffect(PotionHelper.redstoneEffect).setMaxAmount(256);
}

View file

@ -197,7 +197,7 @@ public class BlockTNT extends Block
this.onBlockDestroyedByPlayer(world, pos, state.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemTNT(this);
}
}

View file

@ -699,7 +699,7 @@ public class BlockTripWire extends Block
return new Property[] {DISARMED, POWERED};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSmallBlock(this).setDisplay("Faden").setTab(CheatTab.TECHNOLOGY).setMaxAmount(1024);
}
}

View file

@ -591,7 +591,7 @@ public class BlockTripWireHook extends Block implements Rotatable
return model.rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBlock(this, "tripwire_hook", false);
}
}

View file

@ -5,8 +5,7 @@ import common.block.Rotatable;
import common.block.Material;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.inventory.InventoryWarpChest;
import common.item.CheatTab;
import common.item.Item;
@ -64,7 +63,7 @@ public class BlockWarpChest extends Block implements Rotatable
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return ItemRegistry.getItemFromBlock(Blocks.obsidian);
return Items.obsidian;
}
/**

View file

@ -81,7 +81,7 @@ public class BlockBannerHanging extends BlockBanner
return new Property[] {FACING};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -41,7 +41,7 @@ public class BlockBannerStanding extends BlockBanner
return new Property[] {ROTATION};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemBanner(this).setDisplay("Banner");
}
}

View file

@ -53,7 +53,7 @@ public class BlockStandingSign extends BlockSign
return new Property[] {ROTATION};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return new ItemSign(this).setDisplay("Schild");
}
}

View file

@ -91,7 +91,7 @@ public class BlockWallSign extends BlockSign implements Rotatable
return new Property[] {FACING};
}
public Item getItemToRegister() {
protected Item getItemToRegister() {
return null;
}
}

View file

@ -19,7 +19,6 @@ import common.entity.npc.EntityNPC;
import common.entity.types.EntityAnimal;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.init.SoundEvent;
import common.inventory.AnimalChest;
@ -396,7 +395,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
{
if (!this.worldObj.client && this.isChested())
{
this.dropItem(ItemRegistry.getItemFromBlock(Blocks.chest), 1);
this.dropItem(Items.chest, 1);
this.setChested(false);
}
}
@ -945,7 +944,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
return true;
}
if (!flag && this.canCarryChest() && !this.isChested() && itemstack.getItem() == ItemRegistry.getItemFromBlock(Blocks.chest))
if (!flag && this.canCarryChest() && !this.isChested() && itemstack.getItem() == Items.chest)
{
this.setChested(true);
this.playSound(SoundEvent.PLOP, 1.0F);
@ -1825,7 +1824,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
// return true;
// }
//
// if (stack != null && stack.getItem() == ItemRegistry.getItemFromBlock(Blocks.chest) && !this.isChested())
// if (stack != null && stack.getItem() == Items.chest && !this.isChested())
// {
// this.setChested(true);
// this.initHorseChest();

View file

@ -64,7 +64,7 @@ public class EntityMooshroom extends EntityCow
for (int i = 0; i < 5; ++i)
{
this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Blocks.red_mushroom)));
this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Items.red_mushroom)));
}
itemstack.damageItem(1, player);

View file

@ -142,7 +142,7 @@ public class EntitySheep extends EntityAnimal
protected Item getDropItem()
{
return ItemRegistry.getItemFromBlock(BlockWool.getByColor(this.getFleeceColor()));
return BlockWool.getByColor(this.getFleeceColor()).getItem();
}
public void handleStatusUpdate(byte id)

View file

@ -10,7 +10,6 @@ import common.entity.EntityType;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.model.ParticleType;
@ -421,7 +420,7 @@ public class EntityBoat extends Entity
{
for (int j1 = 0; j1 < 3; ++j1)
{
this.dropItemWithOffset(ItemRegistry.getItemFromBlock(Blocks.oak_planks), 1, 0.0F);
this.dropItemWithOffset(Items.oak_planks, 1, 0.0F);
}
for (int k1 = 0; k1 < 2; ++k1)
@ -552,7 +551,7 @@ public class EntityBoat extends Entity
{
for (int i = 0; i < 3; ++i)
{
this.dropItemWithOffset(ItemRegistry.getItemFromBlock(Blocks.oak_planks), 1, 0.0F);
this.dropItemWithOffset(Items.oak_planks, 1, 0.0F);
}
for (int j = 0; j < 2; ++j)

View file

@ -4,7 +4,7 @@ import common.block.tech.BlockChest;
import common.entity.DamageSource;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.inventory.Container;
import common.inventory.ContainerChest;
import common.inventory.InventoryPlayer;
@ -31,7 +31,7 @@ public class EntityChestCart extends EntityCartContainer
if (Vars.objectDrop)
{
this.dropItemWithOffset(ItemRegistry.getItemFromBlock(Blocks.chest), 1, 0.0F);
this.dropItemWithOffset(Items.chest, 1, 0.0F);
}
}

View file

@ -140,7 +140,7 @@ public class EntityFalling extends Entity implements IObjectData
}
else if (this.shouldDropItem && Vars.objectDrop)
{
this.entityDropItem(new ItemStack(block), 0.0F);
this.entityDropItem(new ItemStack(block.getItem()), 0.0F);
}
}
}
@ -149,7 +149,7 @@ public class EntityFalling extends Entity implements IObjectData
{
if (this.shouldDropItem && Vars.objectDrop)
{
this.entityDropItem(new ItemStack(block), 0.0F);
this.entityDropItem(new ItemStack(block.getItem()), 0.0F);
}
this.setDead();

View file

@ -6,7 +6,7 @@ import java.util.function.Predicate;
import common.entity.DamageSource;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.inventory.Container;
import common.inventory.ContainerHopper;
import common.inventory.InventoryPlayer;
@ -194,7 +194,7 @@ public class EntityHopperCart extends EntityCartContainer implements IHopper
if (Vars.objectDrop)
{
this.dropItemWithOffset(ItemRegistry.getItemFromBlock(Blocks.hopper), 1, 0.0F);
this.dropItemWithOffset(Items.hopper, 1, 0.0F);
}
}

View file

@ -9,7 +9,9 @@ import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.init.SoundEvent;
import common.item.Item;
import common.item.ItemStack;
import common.log.Log;
import common.model.ParticleType;
@ -89,7 +91,7 @@ public class EntityItem extends Entity
this.health = 5;
this.hoverStart = (float)(Math.random() * Math.PI * 2.0D);
this.setSize(0.25F, 0.25F);
this.setEntityItemStack(new ItemStack(Blocks.air, 0));
this.setEntityItemStack(new ItemStack((Item)null, 0));
}
protected void entityInit()
@ -402,12 +404,12 @@ public class EntityItem extends Entity
if (this.delayBeforeCanPickup == 0 // && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getUser()))
&& entityIn.inventory.addItemStackToInventory(itemstack))
{
// if (itemstack.getItem() == ItemRegistry.getItemFromBlock(Blocks.log))
// if (itemstack.getItem() == Items.log)
// {
// entityIn.triggerAchievement(AchievementList.mineWood);
// }
//
// if (itemstack.getItem() == ItemRegistry.getItemFromBlock(Blocks.log2))
// if (itemstack.getItem() == Items.log2)
// {
// entityIn.triggerAchievement(AchievementList.mineWood);
// }
@ -503,7 +505,7 @@ public class EntityItem extends Entity
Log.TICK.warn("Gegenstand-Objekt " + this.getId() + " hat kein Item?!");
}
return new ItemStack(Blocks.stone);
return new ItemStack(Items.stone);
}
else
{

View file

@ -5,6 +5,7 @@ import common.entity.DamageSource;
import common.entity.Entity;
import common.entity.projectile.EntityArrow;
import common.init.Blocks;
import common.init.Items;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.model.ParticleType;
@ -94,7 +95,7 @@ public class EntityTntCart extends EntityCart
if (!source.isExplosion() && Vars.objectDrop)
{
this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F);
this.entityDropItem(new ItemStack(Items.tnt), 0.0F);
}
if (source.isFireDamage() || source.isExplosion() || d0 >= 0.009999999776482582D)

View file

@ -12,9 +12,9 @@ public abstract class FishConstants {
new RngFishable(new ItemStack(Items.string), 5), (new RngFishable(new ItemStack(Items.fishing_rod), 2)).setMaxDamagePercent(0.9F),
new RngFishable(new ItemStack(Items.bowl), 10), new RngFishable(new ItemStack(Items.stick), 5),
new RngFishable(new ItemStack(Items.ink_sack, 10), 1),
new RngFishable(new ItemStack(Blocks.tripwire_hook), 10), new RngFishable(new ItemStack(Items.rotten_flesh), 10));
new RngFishable(new ItemStack(Items.tripwire_hook), 10), new RngFishable(new ItemStack(Items.rotten_flesh), 10));
public static final WeightedList<RngFishable> FISHING_TREASURE = new WeightedList<RngFishable>(
new RngFishable(new ItemStack(Blocks.waterlily), 1), new RngFishable(new ItemStack(Items.name_tag), 1),
new RngFishable(new ItemStack(Items.waterlily), 1), new RngFishable(new ItemStack(Items.name_tag), 1),
new RngFishable(new ItemStack(Items.saddle), 1),
(new RngFishable(new ItemStack(Items.bow), 1)).setMaxDamagePercent(0.25F).setEnchantable(),
(new RngFishable(new ItemStack(Items.fishing_rod), 1)).setMaxDamagePercent(0.25F).setEnchantable(),

View file

@ -59,7 +59,6 @@ import common.block.foliage.BlockVine;
import common.block.foliage.BlockWart;
import common.block.foliage.LeavesType;
import common.block.liquid.BlockDynamicLiquid;
import common.block.liquid.BlockLiquid;
import common.block.liquid.BlockStaticLiquid;
import common.block.natural.BlockBedrock;
import common.block.natural.BlockBlackenedDirt;
@ -152,10 +151,6 @@ public abstract class BlockRegistry {
return REGISTRY.getName(block);
}
public static String getNameFromFluid(BlockLiquid block) {
return REGISTRY.getName(block instanceof BlockDynamicLiquid dy ? dy.getStaticBlock() : block);
}
public static int getStateId(State state) {
Block block = state.getBlock();
return getIdFromBlock(block) + (block.getMetaFromState(state) << 12);

View file

@ -6,7 +6,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import common.block.Block;
import common.block.artificial.BlockBed;
import common.block.artificial.BlockCarpet;
import common.block.artificial.BlockStainedGlass;
@ -37,12 +36,12 @@ public abstract class CraftingRegistry
{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}
};
private static final Object[][] COMPRESSED = new Object[][] {
{Blocks.emerald_block, new ItemStack(Items.emerald, 9)},
{Blocks.lapis_block, new ItemStack(Items.lapis_lazuli, 9)},
{Blocks.redstone_block, new ItemStack(Items.redstone, 9)},
{Blocks.coal_block, new ItemStack(Items.coal, 9)},
{Blocks.hay_block, new ItemStack(Items.wheats, 9)},
{Blocks.slime_block, new ItemStack(Items.slime_ball, 9)}
{Items.emerald_block, new ItemStack(Items.emerald, 9)},
{Items.lapis_block, new ItemStack(Items.lapis_lazuli, 9)},
{Items.redstone_block, new ItemStack(Items.redstone, 9)},
{Items.coal_block, new ItemStack(Items.coal, 9)},
{Items.hay_block, new ItemStack(Items.wheats, 9)},
{Items.slime_block, new ItemStack(Items.slime_ball, 9)}
};
private static final List<IRecipe> recipes = Lists.<IRecipe>newArrayList();
@ -71,7 +70,7 @@ public abstract class CraftingRegistry
add(new ItemStack(ItemRegistry.getRegisteredItem(ore.name + "_leggings")), ARMOR[2], 'X', item);
add(new ItemStack(ItemRegistry.getRegisteredItem(ore.name + "_boots")), ARMOR[3], 'X', item);
}
Block block = BlockRegistry.getRegisteredBlock(ore.name + "_block");
Item block = ItemRegistry.getRegisteredItem(ore.name + "_block");
add(new ItemStack(block), "###", "###", "###", '#', item);
add(new ItemStack(item, 9), "#", '#', block);
}
@ -97,7 +96,7 @@ public abstract class CraftingRegistry
add(new ItemStack(ItemRegistry.getRegisteredItem(metal.name + "_leggings")), ARMOR[2], 'X', item);
add(new ItemStack(ItemRegistry.getRegisteredItem(metal.name + "_boots")), ARMOR[3], 'X', item);
}
Block block = BlockRegistry.getRegisteredBlock(metal.name + "_block");
Item block = ItemRegistry.getRegisteredItem(metal.name + "_block");
add(new ItemStack(block), "###", "###", "###", '#', item);
add(new ItemStack(item, 9), "#", '#', block);
}
@ -131,7 +130,7 @@ public abstract class CraftingRegistry
for (int i = 0; i < COMPRESSED.length; ++i)
{
Block block = (Block)COMPRESSED[i][0];
Item block = (Item)COMPRESSED[i][0];
ItemStack itemstack = (ItemStack)COMPRESSED[i][1];
add(new ItemStack(block), "###", "###", "###", '#', itemstack);
add(itemstack, "#", '#', block);
@ -140,47 +139,47 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.gold_ingot), "###", "###", "###", '#', Items.gold_nugget);
add(new ItemStack(Items.gold_nugget, 9), "#", '#', Items.gold_ingot);
addShapeless(new ItemStack(Items.mushroom_stew), Blocks.brown_mushroom, Blocks.red_mushroom, Items.bowl);
addShapeless(new ItemStack(Items.mushroom_stew), Items.brown_mushroom, Items.red_mushroom, Items.bowl);
add(new ItemStack(Items.cookie, 8), "#X#", 'X', Items.cocoa, '#', Items.wheats);
add(new ItemStack(Blocks.melon_block), "MMM", "MMM", "MMM", 'M', Items.melon);
add(new ItemStack(Items.melon_block), "MMM", "MMM", "MMM", 'M', Items.melon);
add(new ItemStack(Items.melon_stem), "M", 'M', Items.melon);
add(new ItemStack(Items.pumpkin_stem, 4), "M", 'M', Blocks.pumpkin);
addShapeless(new ItemStack(Items.pumpkin_pie), Blocks.pumpkin, Items.sugar, Items.egg);
addShapeless(new ItemStack(Items.fermented_spider_eye), Items.spider_eye, Blocks.brown_mushroom, Items.sugar);
add(new ItemStack(Items.pumpkin_stem, 4), "M", 'M', Items.pumpkin);
addShapeless(new ItemStack(Items.pumpkin_pie), Items.pumpkin, Items.sugar, Items.egg);
addShapeless(new ItemStack(Items.fermented_spider_eye), Items.spider_eye, Items.brown_mushroom, Items.sugar);
addShapeless(new ItemStack(Items.blazing_powder, 2), Items.blaze_rod);
addShapeless(new ItemStack(Items.magma_cream), Items.blazing_powder, Items.slime_ball);
add(new ItemStack(Blocks.trapped_chest), "#-", '#', Blocks.chest, '-', Blocks.tripwire_hook);
add(new ItemStack(Blocks.warp_chest), "###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.charged_orb);
add(new ItemStack(Blocks.furnace), "###", "# #", "###", '#', Blocks.cobblestone);
add(new ItemStack(Blocks.sandstone), "##", "##", '#', Blocks.sand);
add(new ItemStack(Blocks.smooth_sandstone, 4), "##", "##", '#', Blocks.sandstone);
add(new ItemStack(Blocks.quartz_pillar, 2), "#", "#", '#', Blocks.quartz_block);
add(new ItemStack(Blocks.stonebrick, 4), "##", "##", '#', Blocks.stone);
addShapeless(new ItemStack(Blocks.mossy_stonebrick), Blocks.stonebrick, Blocks.vine);
addShapeless(new ItemStack(Blocks.mossy_cobblestone, 1), Blocks.cobblestone, Blocks.vine);
add(new ItemStack(Blocks.iron_bars, 16), "###", "###", '#', Items.iron_ingot);
add(new ItemStack(Blocks.glass_pane, 16), "###", "###", '#', Blocks.glass);
add(new ItemStack(Blocks.redstone_lamp, 1), " R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone);
add(new ItemStack(Blocks.beacon, 1), "GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.charge_crystal, 'O', Blocks.obsidian);
add(new ItemStack(Blocks.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick);
add(new ItemStack(Blocks.coarse_dirt, 4), "DG", "GD", 'D', Blocks.dirt, 'G', Blocks.gravel);
add(new ItemStack(Items.trapped_chest), "#-", '#', Items.chest, '-', Items.tripwire_hook);
add(new ItemStack(Items.warp_chest), "###", "#E#", "###", '#', Items.obsidian, 'E', Items.charged_orb);
add(new ItemStack(Items.furnace), "###", "# #", "###", '#', Items.cobblestone);
add(new ItemStack(Items.sandstone), "##", "##", '#', Items.sand);
add(new ItemStack(Items.smooth_sandstone, 4), "##", "##", '#', Items.sandstone);
add(new ItemStack(Items.quartz_pillar, 2), "#", "#", '#', Items.quartz_block);
add(new ItemStack(Items.stonebrick, 4), "##", "##", '#', Items.stone);
addShapeless(new ItemStack(Items.mossy_stonebrick), Items.stonebrick, Items.vine);
addShapeless(new ItemStack(Items.mossy_cobblestone), Items.cobblestone, Items.vine);
add(new ItemStack(Items.iron_bars, 16), "###", "###", '#', Items.iron_ingot);
add(new ItemStack(Items.glass_pane, 16), "###", "###", '#', Items.glass);
add(new ItemStack(Items.redstone_lamp, 1), " R ", "RGR", " R ", 'R', Items.redstone, 'G', Items.glowstone);
add(new ItemStack(Items.beacon, 1), "GGG", "GSG", "OOO", 'G', Items.glass, 'S', Items.charge_crystal, 'O', Items.obsidian);
add(new ItemStack(Items.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick);
add(new ItemStack(Items.coarse_dirt, 4), "DG", "GD", 'D', Items.dirt, 'G', Items.gravel);
add(new ItemStack(Blocks.lamp, 1), " R ", "RGR", " R ", 'R', Blocks.glass, 'G', Blocks.glowstone);
add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.glass, 'G', Items.glowstone);
for (DyeColor color : DyeColor.values())
{
ItemDye dye = ItemDye.getByColor(color);
if(color != DyeColor.WHITE)
addShapeless(new ItemStack(BlockWool.getByColor(color)), dye, Blocks.white_wool);
add(new ItemStack(BlockColoredClay.getByColor(color), 8), "###", "#X#", "###", '#', Blocks.hardened_clay, 'X', dye);
add(new ItemStack(BlockStainedGlass.getByColor(color), 8), "###", "#X#", "###", '#', Blocks.glass, 'X', dye);
add(new ItemStack(BlockStainedGlassPane.getByColor(color), 16), "###", "###", '#', BlockStainedGlass.getByColor(color));
addShapeless(new ItemStack(BlockWool.getByColor(color).getItem()), dye, Items.white_wool);
add(new ItemStack(BlockColoredClay.getByColor(color).getItem(), 8), "###", "#X#", "###", '#', Items.hardened_clay, 'X', dye);
add(new ItemStack(BlockStainedGlass.getByColor(color).getItem(), 8), "###", "#X#", "###", '#', Items.glass, 'X', dye);
add(new ItemStack(BlockStainedGlassPane.getByColor(color).getItem(), 16), "###", "###", '#', BlockStainedGlass.getByColor(color).getItem());
}
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.YELLOW)), Blocks.dandelion);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Blocks.rose);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Blocks.poppy);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.YELLOW)), Items.dandelion);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Items.rose);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Items.poppy);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.WHITE), 3), Items.bone);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK), 2), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.ORANGE), 2), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.YELLOW)));
@ -194,22 +193,22 @@ public abstract class CraftingRegistry
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 2), new ItemStack(ItemDye.getByColor(DyeColor.PURPLE)), new ItemStack(ItemDye.getByColor(DyeColor.PINK)));
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 3), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.PINK)));
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 4), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.LIGHT_BLUE)), Blocks.blue_orchid);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA)), Blocks.allium);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Blocks.houstonia);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Blocks.red_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.ORANGE)), Blocks.orange_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Blocks.white_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK)), Blocks.pink_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Blocks.daisy);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.YELLOW), 2), Blocks.sunflower);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 2), Blocks.syringa);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED), 2), Blocks.rose_bush);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK), 2), Blocks.paeonia);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.LIGHT_BLUE)), Items.blue_orchid);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA)), Items.allium);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Items.houstonia);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Items.red_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.ORANGE)), Items.orange_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Items.white_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK)), Items.pink_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Items.daisy);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.YELLOW), 2), Items.sunflower);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 2), Items.syringa);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED), 2), Items.rose_bush);
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK), 2), Items.paeonia);
for (DyeColor color : DyeColor.values())
{
add(new ItemStack(BlockCarpet.getByColor(color), 3), "##", '#', BlockWool.getByColor(color));
add(new ItemStack(BlockCarpet.getByColor(color).getItem(), 3), "##", '#', BlockWool.getByColor(color).getItem());
}
recipes.add(new RecipesArmorDyes());
@ -218,7 +217,7 @@ public abstract class CraftingRegistry
for (DyeColor color : DyeColor.values())
{
add(ItemBanner.getColoredBanner(color), "###", "###", " | ", '#', BlockWool.getByColor(color), '|', Items.stick);
add(ItemBanner.getColoredBanner(color), "###", "###", " | ", '#', BlockWool.getByColor(color).getItem(), '|', Items.stick);
}
recipes.add(new RecipeDuplicatePattern());
@ -236,74 +235,74 @@ public abstract class CraftingRegistry
Item slab = ItemRegistry.getRegisteredItem(wood.getName() + "_slab");
add(new ItemStack(slab, 6), "###", '#', planks);
add(new ItemStack(ItemRegistry.getRegisteredItem(wood.getName() + "_stairs"), 4), "# ", "## ", "###", '#', planks);
add(new ItemStack(Blocks.daylight_detector), "GGG", "QQQ", "WWW", 'G', Blocks.glass, 'Q', Items.quartz, 'W', slab);
add(new ItemStack(Items.daylight_detector), "GGG", "QQQ", "WWW", 'G', Items.glass, 'Q', Items.quartz, 'W', slab);
add(new ItemStack(Blocks.chest), "###", "# #", "###", '#', planks);
addBasic(new ItemStack(Blocks.workbench), "##", "##", '#', planks);
add(new ItemStack(Blocks.assembly_unit), "----", "XXXX", "X##X", '#', Blocks.construction_table, '-', Items.titanium_ingot, 'X', planks);
add(new ItemStack(Items.chest), "###", "# #", "###", '#', planks);
addBasic(new ItemStack(Items.workbench), "##", "##", '#', planks);
add(new ItemStack(Items.assembly_unit), "----", "XXXX", "X##X", '#', Items.construction_table, '-', Items.titanium_ingot, 'X', planks);
add(new ItemStack(Blocks.jukebox, 1), "###", "#X#", "###", '#', planks, 'X', Items.diamond);
add(new ItemStack(Blocks.noteblock, 1), "###", "#X#", "###", '#', planks, 'X', Items.redstone);
add(new ItemStack(Blocks.bookshelf, 1), "###", "XXX", "###", '#', planks, 'X', Items.book);
add(new ItemStack(Blocks.trapdoor, 2), "###", "###", '#', planks);
add(new ItemStack(Items.jukebox, 1), "###", "#X#", "###", '#', planks, 'X', Items.diamond);
add(new ItemStack(Items.noteblock, 1), "###", "#X#", "###", '#', planks, 'X', Items.redstone);
add(new ItemStack(Items.bookshelf, 1), "###", "XXX", "###", '#', planks, 'X', Items.book);
add(new ItemStack(Items.trapdoor, 2), "###", "###", '#', planks);
add(new ItemStack(Items.sign, 3), "###", "###", " X ", '#', planks, 'X', Items.stick);
add(new ItemStack(Items.stick, 4), "#", "#", '#', planks);
add(new ItemStack(Items.bowl, 4), "# #", " # ", '#', planks);
add(new ItemStack(Items.boat, 1), "# #", "###", '#', planks);
add(new ItemStack(Blocks.tripwire_hook, 2), "I", "S", "#", '#', planks, 'S', Items.stick, 'I', Items.iron_ingot);
add(new ItemStack(Blocks.wooden_button, 1), "#", '#', planks);
add(new ItemStack(Blocks.wooden_pressure_plate, 1), "##", '#', planks);
add(new ItemStack(Blocks.piston, 1), "TTT", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', planks);
add(new ItemStack(Items.tripwire_hook, 2), "I", "S", "#", '#', planks, 'S', Items.stick, 'I', Items.iron_ingot);
add(new ItemStack(Items.wooden_button, 1), "#", '#', planks);
add(new ItemStack(Items.wooden_pressure_plate, 1), "##", '#', planks);
add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', planks);
for(DyeColor color : BlockBed.COLORS) {
add(new ItemStack(ItemRegistry.getRegisteredItem(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color), 'X', planks);
add(new ItemStack(ItemRegistry.getRegisteredItem(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks);
}
}
add(new ItemStack(Blocks.cobblestone_wall, 6), "###", "###", '#', Blocks.cobblestone);
add(new ItemStack(Blocks.mossy_cobblestone_wall, 6), "###", "###", '#', Blocks.mossy_cobblestone);
add(new ItemStack(Blocks.blood_brick_fence, 6), "###", "###", '#', Blocks.blood_brick);
add(new ItemStack(Items.cobblestone_wall, 6), "###", "###", '#', Items.cobblestone);
add(new ItemStack(Items.mossy_cobblestone_wall, 6), "###", "###", '#', Items.mossy_cobblestone);
add(new ItemStack(Items.blood_brick_fence, 6), "###", "###", '#', Items.blood_brick);
add(new ItemStack(Items.lead, 2), "~~ ", "~O ", " ~", '~', Items.string, 'O', Items.slime_ball);
add(new ItemStack(Blocks.snow, 1), "##", "##", '#', Items.snowball);
add(new ItemStack(Blocks.snow_layer, 6), "###", '#', Blocks.snow);
add(new ItemStack(Blocks.clay, 1), "##", "##", '#', Items.clay_ball);
add(new ItemStack(Blocks.brick_block, 1), "##", "##", '#', Items.brick);
add(new ItemStack(Blocks.glowstone, 1), "##", "##", '#', Items.glowstone_dust);
add(new ItemStack(Blocks.quartz_block, 1), "##", "##", '#', Items.quartz);
add(new ItemStack(Blocks.white_wool, 1), "##", "##", '#', Items.string);
add(new ItemStack(Blocks.tnt, 1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Blocks.sand);
add(new ItemStack(Items.snow, 1), "##", "##", '#', Items.snowball);
add(new ItemStack(Items.snow_layer, 6), "###", '#', Items.snow);
add(new ItemStack(Items.clay, 1), "##", "##", '#', Items.clay_ball);
add(new ItemStack(Items.brick_block, 1), "##", "##", '#', Items.brick);
add(new ItemStack(Items.glowstone, 1), "##", "##", '#', Items.glowstone_dust);
add(new ItemStack(Items.quartz_block, 1), "##", "##", '#', Items.quartz);
add(new ItemStack(Items.white_wool, 1), "##", "##", '#', Items.string);
add(new ItemStack(Items.tnt, 1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Items.sand);
add(new ItemStack(Blocks.tnt_1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Blocks.tnt);
add(new ItemStack(Blocks.tnt_2), "##", "##", '#', Blocks.tnt_1);
addShapeless(new ItemStack(Blocks.tnt_3), Blocks.tnt_2, Blocks.tnt_2);
addShapeless(new ItemStack(Blocks.tnt_4), Blocks.tnt_3, Blocks.tnt_3);
addShapeless(new ItemStack(Blocks.tnt_5), Blocks.tnt_4, Blocks.tnt_4);
addShapeless(new ItemStack(Blocks.tnt_6), Blocks.tnt_5, Blocks.tnt_5);
addShapeless(new ItemStack(Blocks.tnt_7), Blocks.tnt_6, Blocks.tnt_6);
add(new ItemStack(Blocks.nuke, 1), "###", "###", "###", '#', Blocks.tnt_7);
add(new ItemStack(Items.tnt_1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Items.tnt);
add(new ItemStack(Items.tnt_2), "##", "##", '#', Items.tnt_1);
addShapeless(new ItemStack(Items.tnt_3), Items.tnt_2, Items.tnt_2);
addShapeless(new ItemStack(Items.tnt_4), Items.tnt_3, Items.tnt_3);
addShapeless(new ItemStack(Items.tnt_5), Items.tnt_4, Items.tnt_4);
addShapeless(new ItemStack(Items.tnt_6), Items.tnt_5, Items.tnt_5);
addShapeless(new ItemStack(Items.tnt_7), Items.tnt_6, Items.tnt_6);
add(new ItemStack(Items.nuke, 1), "###", "###", "###", '#', Items.tnt_7);
add(new ItemStack(Blocks.ladder, 3), "# #", "###", "# #", '#', Items.stick);
add(new ItemStack(Items.ladder, 3), "# #", "###", "# #", '#', Items.stick);
add(new ItemStack(Items.iron_door, 3), "##", "##", "##", '#', Items.iron_ingot);
add(new ItemStack(Blocks.iron_trapdoor, 1), "##", "##", '#', Items.iron_ingot);
add(new ItemStack(Items.iron_trapdoor, 1), "##", "##", '#', Items.iron_ingot);
add(new ItemStack(Items.cake, 1), "AAA", "BEB", "CCC", 'A', Items.milk_bucket, 'B', Items.sugar, 'C', Items.wheats, 'E', Items.egg);
add(new ItemStack(Items.sugar, 1), "#", '#', Items.reeds);
add(new ItemStack(Blocks.torch, 4), "X", "#", 'X', Items.coal, '#', Items.stick);
add(new ItemStack(Blocks.torch, 4), "X", "#", 'X', Items.charcoal, '#', Items.stick);
add(new ItemStack(Items.glass_bottle, 3), "# #", " # ", '#', Blocks.glass);
add(new ItemStack(Blocks.rail, 16), "X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick);
add(new ItemStack(Blocks.golden_rail, 6), "X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick);
add(new ItemStack(Blocks.activator_rail, 6), "XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Blocks.redstone_torch, 'S', Items.stick);
add(new ItemStack(Blocks.detector_rail, 6), "X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Blocks.stone_pressure_plate);
add(new ItemStack(Items.torch, 4), "X", "#", 'X', Items.coal, '#', Items.stick);
add(new ItemStack(Items.torch, 4), "X", "#", 'X', Items.charcoal, '#', Items.stick);
add(new ItemStack(Items.glass_bottle, 3), "# #", " # ", '#', Items.glass);
add(new ItemStack(Items.rail, 16), "X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick);
add(new ItemStack(Items.golden_rail, 6), "X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick);
add(new ItemStack(Items.activator_rail, 6), "XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Items.redstone_torch, 'S', Items.stick);
add(new ItemStack(Items.detector_rail, 6), "X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Items.stone_pressure_plate);
add(new ItemStack(Items.minecart, 1), "# #", "###", '#', Items.iron_ingot);
add(new ItemStack(Items.cauldron, 1), "# #", "# #", "###", '#', Items.iron_ingot);
add(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Blocks.cobblestone, 'B', Items.blaze_rod);
add(new ItemStack(Blocks.lit_pumpkin, 1), "A", "B", 'A', Blocks.pumpkin, 'B', Blocks.torch);
add(new ItemStack(Items.chest_minecart, 1), "A", "B", 'A', Blocks.chest, 'B', Items.minecart);
add(new ItemStack(Items.tnt_minecart, 1), "A", "B", 'A', Blocks.tnt, 'B', Items.minecart);
add(new ItemStack(Items.hopper_minecart, 1), "A", "B", 'A', Blocks.hopper, 'B', Items.minecart);
add(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Items.cobblestone, 'B', Items.blaze_rod);
add(new ItemStack(Items.lit_pumpkin, 1), "A", "B", 'A', Items.pumpkin, 'B', Items.torch);
add(new ItemStack(Items.chest_minecart, 1), "A", "B", 'A', Items.chest, 'B', Items.minecart);
add(new ItemStack(Items.tnt_minecart, 1), "A", "B", 'A', Items.tnt, 'B', Items.minecart);
add(new ItemStack(Items.hopper_minecart, 1), "A", "B", 'A', Items.hopper, 'B', Items.minecart);
add(new ItemStack(Items.bucket, 1), "# #", " # ", '#', Items.iron_ingot);
add(new ItemStack(Items.flowerpot, 1), "# #", " # ", '#', Items.brick);
addShapeless(new ItemStack(Items.flint_and_steel, 1), new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1));
@ -311,34 +310,34 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.fishing_rod, 1), " #", " #X", "# X", '#', Items.stick, 'X', Items.string);
add(new ItemStack(Items.carrot_on_a_stick, 1), "# ", " X", '#', Items.fishing_rod, 'X', Items.carrot);
add(new ItemStack(Blocks.cobblestone_stairs, 4), "# ", "## ", "###", '#', Blocks.cobblestone);
add(new ItemStack(Blocks.brick_stairs, 4), "# ", "## ", "###", '#', Blocks.brick_block);
add(new ItemStack(Blocks.stonebrick_stairs, 4), "# ", "## ", "###", '#', Blocks.stonebrick);
add(new ItemStack(Blocks.blood_brick_stairs, 4), "# ", "## ", "###", '#', Blocks.blood_brick);
add(new ItemStack(Blocks.sandstone_stairs, 4), "# ", "## ", "###", '#', Blocks.sandstone);
add(new ItemStack(Blocks.quartz_stairs, 4), "# ", "## ", "###", '#', Blocks.quartz_block);
add(new ItemStack(Items.cobblestone_stairs, 4), "# ", "## ", "###", '#', Items.cobblestone);
add(new ItemStack(Items.brick_stairs, 4), "# ", "## ", "###", '#', Items.brick_block);
add(new ItemStack(Items.stonebrick_stairs, 4), "# ", "## ", "###", '#', Items.stonebrick);
add(new ItemStack(Items.blood_brick_stairs, 4), "# ", "## ", "###", '#', Items.blood_brick);
add(new ItemStack(Items.sandstone_stairs, 4), "# ", "## ", "###", '#', Items.sandstone);
add(new ItemStack(Items.quartz_stairs, 4), "# ", "## ", "###", '#', Items.quartz_block);
add(new ItemStack(Items.golden_apple, 1), "###", "#X#", "###", '#', Items.gold_ingot, 'X', Items.apple);
add(new ItemStack(Items.charged_apple, 1), "###", "#X#", "###", '#', Blocks.gold_block, 'X', Items.apple);
add(new ItemStack(Items.charged_apple, 1), "###", "#X#", "###", '#', Items.gold_block, 'X', Items.apple);
add(new ItemStack(Items.golden_carrot, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot);
add(new ItemStack(Items.speckled_melon, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon);
add(new ItemStack(Blocks.lever, 1), "X", "#", '#', Blocks.cobblestone, 'X', Items.stick);
add(new ItemStack(Blocks.redstone_torch, 1), "X", "#", '#', Items.stick, 'X', Items.redstone);
add(new ItemStack(Items.repeater, 1), "#X#", "III", '#', Blocks.redstone_torch, 'X', Items.redstone, 'I', Blocks.stone);
add(new ItemStack(Items.comparator, 1), " # ", "#X#", "III", '#', Blocks.redstone_torch, 'X', Items.quartz, 'I', Blocks.stone);
add(new ItemStack(Items.lever, 1), "X", "#", '#', Items.cobblestone, 'X', Items.stick);
add(new ItemStack(Items.redstone_torch, 1), "X", "#", '#', Items.stick, 'X', Items.redstone);
add(new ItemStack(Items.repeater, 1), "#X#", "III", '#', Items.redstone_torch, 'X', Items.redstone, 'I', Items.stone);
add(new ItemStack(Items.comparator, 1), " # ", "#X#", "III", '#', Items.redstone_torch, 'X', Items.quartz, 'I', Items.stone);
add(new ItemStack(Items.navigator, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.redstone);
add(new ItemStack(Blocks.stone_button, 1), "#", '#', Blocks.stone);
add(new ItemStack(Blocks.stone_pressure_plate, 1), "##", '#', Blocks.stone);
add(new ItemStack(Blocks.heavy_weighted_pressure_plate, 1), "##", '#', Items.iron_ingot);
add(new ItemStack(Blocks.light_weighted_pressure_plate, 1), "##", '#', Items.gold_ingot);
add(new ItemStack(Blocks.dispenser, 1), "###", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.bow, 'R', Items.redstone);
add(new ItemStack(Blocks.dropper, 1), "###", "# #", "#R#", '#', Blocks.cobblestone, 'R', Items.redstone);
add(new ItemStack(Blocks.sticky_piston, 1), "S", "P", 'S', Items.slime_ball, 'P', Blocks.piston);
add(new ItemStack(Blocks.enchanting_table, 1), " B ", "D#D", "###", '#', Blocks.obsidian, 'B', Items.book, 'D', Items.diamond);
add(new ItemStack(Blocks.anvil, 1), "III", " i ", "iii", 'I', Blocks.iron_block, 'i', Items.iron_ingot);
add(new ItemStack(Items.stone_button, 1), "#", '#', Items.stone);
add(new ItemStack(Items.stone_pressure_plate, 1), "##", '#', Items.stone);
add(new ItemStack(Items.heavy_weighted_pressure_plate, 1), "##", '#', Items.iron_ingot);
add(new ItemStack(Items.light_weighted_pressure_plate, 1), "##", '#', Items.gold_ingot);
add(new ItemStack(Items.dispenser, 1), "###", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.bow, 'R', Items.redstone);
add(new ItemStack(Items.dropper, 1), "###", "# #", "#R#", '#', Items.cobblestone, 'R', Items.redstone);
add(new ItemStack(Items.sticky_piston, 1), "S", "P", 'S', Items.slime_ball, 'P', Items.piston);
add(new ItemStack(Items.enchanting_table, 1), " B ", "D#D", "###", '#', Items.obsidian, 'B', Items.book, 'D', Items.diamond);
add(new ItemStack(Items.anvil, 1), "III", " i ", "iii", 'I', Items.iron_block, 'i', Items.iron_ingot);
addShapeless(new ItemStack(Items.charged_orb, 1), Items.orb, Items.blazing_powder);
addShapeless(new ItemStack(Items.fire_charge, 3), Items.gunpowder, Items.blazing_powder, Items.coal);
addShapeless(new ItemStack(Items.fire_charge, 3), Items.gunpowder, Items.blazing_powder, Items.charcoal);
add(new ItemStack(Blocks.hopper), "I I", "ICI", " I ", 'I', Items.iron_ingot, 'C', Blocks.chest);
add(new ItemStack(Items.hopper), "I I", "ICI", " I ", 'I', Items.iron_ingot, 'C', Items.chest);
add(new ItemStack(Items.dynamite, 1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Items.clay_ball);
@ -350,19 +349,19 @@ public abstract class CraftingRegistry
addShapeless(new ItemStack(Items.dynamite_6), Items.dynamite_5, Items.dynamite_5);
addShapeless(new ItemStack(Items.dynamite_7), Items.dynamite_6, Items.dynamite_6);
add(new ItemStack(Items.portal_frame, 1), "XYX", "X#X", "XXX", 'X', Blocks.obsidian, 'Y', Items.orb, '#', Items.charged_orb);
add(new ItemStack(Items.experience_bottle, 1), "YXY", "X#X", "YXY", 'X', Blocks.glass_pane, 'Y', Blocks.glowstone, '#', Items.emerald);
add(new ItemStack(Blocks.mob_spawner, 1), "###", "#X#", "###", 'X', Items.charge_crystal, '#', Blocks.iron_bars);
add(new ItemStack(Blocks.dragon_egg, 1), "###", "#X#", "#D#", 'X', Items.charge_crystal, 'D', Items.diamond, '#', Blocks.obsidian);
add(new ItemStack(Items.portal_frame, 1), "XYX", "X#X", "XXX", 'X', Items.obsidian, 'Y', Items.orb, '#', Items.charged_orb);
add(new ItemStack(Items.experience_bottle, 1), "YXY", "X#X", "YXY", 'X', Items.glass_pane, 'Y', Items.glowstone, '#', Items.emerald);
add(new ItemStack(Items.mob_spawner, 1), "###", "#X#", "###", 'X', Items.charge_crystal, '#', Items.iron_bars);
add(new ItemStack(Items.dragon_egg, 1), "###", "#X#", "#D#", 'X', Items.charge_crystal, 'D', Items.diamond, '#', Items.obsidian);
add(new ItemStack(Blocks.red_button, 1), "#", '#', Items.redstone);
add(new ItemStack(Items.red_button, 1), "#", '#', Items.redstone);
add(new ItemStack(Items.chick_magnet, 1), "A A", "N N", " C ", 'A', Items.aluminium_ingot, 'N', Items.nickel_ingot, 'C', Items.cobalt_ingot);
add(new ItemStack(Items.magnet, 1), "I I", "N N", " R ", 'I', Items.iron_ingot, 'N', Items.neodymium_ingot, 'R', Items.redstone);
addShapeless(new ItemStack(Items.splash_potion), Items.potion, Items.gunpowder);
add(new ItemStack(Blocks.construction_table), "---", "-#-", "---", '#', Blocks.workbench, '-', Items.iron_ingot);
add(new ItemStack(Blocks.bedrock), "#####", "#####", "#####", "#####", "#####", '#', Blocks.obsidian);
add(new ItemStack(Items.construction_table), "---", "-#-", "---", '#', Items.workbench, '-', Items.iron_ingot);
add(new ItemStack(Items.bedrock), "#####", "#####", "#####", "#####", "#####", '#', Items.obsidian);
Collections.sort(recipes, new Comparator<IRecipe>()
{
@ -420,14 +419,14 @@ public abstract class CraftingRegistry
{
itemstack = new ItemStack((Item)recipeComponents[i + 1]);
}
else if (recipeComponents[i + 1] instanceof Block)
{
itemstack = new ItemStack((Block)recipeComponents[i + 1]);
}
else if (recipeComponents[i + 1] instanceof ItemStack)
{
itemstack = (ItemStack)recipeComponents[i + 1];
}
else
{
throw new IllegalArgumentException("Invalid shaped recipe: unknown type " + recipeComponents[i + 1].getClass().getName() + "!");
}
map.put(character, itemstack);
}
@ -469,12 +468,7 @@ public abstract class CraftingRegistry
}
else
{
if (!(object instanceof Block))
{
throw new IllegalArgumentException("Invalid shapeless recipe: unknown type " + object.getClass().getName() + "!");
}
list.add(new ItemStack((Block)object));
throw new IllegalArgumentException("Invalid shapeless recipe: unknown type " + object.getClass().getName() + "!");
}
}

View file

@ -1,13 +1,11 @@
package common.init;
import java.util.Map;
import common.attributes.UsageSlot;
import common.block.Block;
import common.block.liquid.BlockDynamicLiquid;
import common.block.liquid.BlockLiquid;
import common.block.liquid.BlockStaticLiquid;
import common.block.natural.BlockOre;
import common.collect.Maps;
import common.color.DyeColor;
import common.color.TextColor;
import common.entity.item.EntityCart;
@ -23,7 +21,6 @@ import common.item.ItemSmall;
import common.item.ItemStack;
import common.item.ItemStick;
import common.item.ItemTiny;
import common.item.block.ItemBlock;
import common.item.material.ItemBook;
import common.item.material.ItemDye;
import common.item.material.ItemEnchantedBook;
@ -89,7 +86,6 @@ import common.world.Weather;
public abstract class ItemRegistry {
public static final Mapping<Item> REGISTRY = new Mapping();
public static final Map<Block, ItemBlock> BLOCKMAP = Maps.<Block, ItemBlock>newHashMap();
private static int nextItemId = 4096;
@ -105,10 +101,6 @@ public abstract class ItemRegistry {
return REGISTRY.byId(id);
}
public static ItemBlock getItemFromBlock(Block block) {
return BLOCKMAP.get(block);
}
public static Item getRegisteredItem(String name) {
return REGISTRY.byName(name);
}
@ -152,14 +144,9 @@ public abstract class ItemRegistry {
static void register() {
for(Block block : BlockRegistry.REGISTRY) {
Item item = block.getItemToRegister();
if(item == null)
continue;
if(item.getBlock() != block)
throw new IllegalArgumentException("Gegenstand für Block " + BlockRegistry.getNameFromBlock(block) + " stimmt nicht überein");
REGISTRY.register(BlockRegistry.getIdFromBlock(block), BlockRegistry.getNameFromBlock(block), item);
if(item instanceof ItemBlock iblock)
BLOCKMAP.put(block, iblock);
Item item = block.registerItem();
if(item != null)
REGISTRY.register(BlockRegistry.getIdFromBlock(block), BlockRegistry.getNameFromBlock(block), item);
}
Item bucket = (new ItemBucket(null, false)).setDisplay("Eimer");

View file

@ -3,7 +3,6 @@ package common.init;
import java.util.Map;
import java.util.Map.Entry;
import common.block.Block;
import common.collect.Maps;
import common.item.Item;
import common.item.ItemStack;
@ -23,18 +22,18 @@ public abstract class SmeltingRegistry
static void register()
{
add(Blocks.sand, new ItemStack(Blocks.glass), 0.1F);
add(Blocks.red_sand, new ItemStack(Blocks.glass), 0.1F);
add(Items.sand, new ItemStack(Items.glass), 0.1F);
add(Items.red_sand, new ItemStack(Items.glass), 0.1F);
add(Items.porkchop, new ItemStack(Items.cooked_porkchop), 0.35F);
add(Items.beef, new ItemStack(Items.cooked_beef), 0.35F);
add(Items.chicken, new ItemStack(Items.cooked_chicken), 0.35F);
add(Blocks.cobblestone, new ItemStack(Blocks.stone), 0.1F);
add(Blocks.stonebrick, new ItemStack(Blocks.cracked_stonebrick), 0.1F);
add(Items.cobblestone, new ItemStack(Items.stone), 0.1F);
add(Items.stonebrick, new ItemStack(Items.cracked_stonebrick), 0.1F);
add(Items.clay_ball, new ItemStack(Items.brick), 0.3F);
add(Blocks.clay, new ItemStack(Blocks.hardened_clay), 0.35F);
add(Blocks.cactus, new ItemStack(Items.cactus_green), 0.2F);
add(Items.clay, new ItemStack(Items.hardened_clay), 0.35F);
add(Items.cactus, new ItemStack(Items.cactus_green), 0.2F);
add(Items.potato, new ItemStack(Items.baked_potato), 0.35F);
add(Blocks.hellrock, new ItemStack(Items.bloodbrick), 0.1F);
add(Items.hellrock, new ItemStack(Items.bloodbrick), 0.1F);
for (ItemFishFood.FishType fish : ItemFishFood.FishType.values())
{
@ -44,30 +43,25 @@ public abstract class SmeltingRegistry
}
}
add(Blocks.emerald_ore, new ItemStack(Items.emerald), 1.0F);
add(Blocks.coal_ore, new ItemStack(Items.coal), 0.1F);
add(Blocks.lapis_ore, new ItemStack(Items.lapis_lazuli), 0.2F);
add(Blocks.quartz_ore, new ItemStack(Items.quartz), 0.2F);
add(Blocks.redstone_ore, new ItemStack(Items.redstone), 0.7F);
add(Items.emerald_ore, new ItemStack(Items.emerald), 1.0F);
add(Items.coal_ore, new ItemStack(Items.coal), 0.1F);
add(Items.lapis_ore, new ItemStack(Items.lapis_lazuli), 0.2F);
add(Items.quartz_ore, new ItemStack(Items.quartz), 0.2F);
add(Items.redstone_ore, new ItemStack(Items.redstone), 0.7F);
for(OreType ore : OreType.values()) {
Item item = ItemRegistry.getRegisteredItem(ore.item);
add(BlockRegistry.getRegisteredBlock(ore.name + "_ore"), new ItemStack(item), ((float)ore.experience) / 3.0F);
add(ItemRegistry.getRegisteredItem(ore.name + "_ore"), new ItemStack(item), ((float)ore.experience) / 3.0F);
}
for(MetalType metal : MetalType.values()) {
Item item = ItemRegistry.getRegisteredItem(metal.isPowder ? (metal.name + "_powder") : (metal.name + "_ingot"));
add(BlockRegistry.getRegisteredBlock(metal.name + "_ore"), new ItemStack(item), 0.7F);
add(ItemRegistry.getRegisteredItem(metal.name + "_ore"), new ItemStack(item), 0.7F);
}
for(WoodType wood : WoodType.values()) {
add(BlockRegistry.getRegisteredBlock(wood.getName() + "_log"), new ItemStack(Items.charcoal), 0.15F);
add(ItemRegistry.getRegisteredItem(wood.getName() + "_log"), new ItemStack(Items.charcoal), 0.15F);
}
}
private static void add(Block input, ItemStack stack, float experience)
{
add(ItemRegistry.getItemFromBlock(input), stack, experience);
}
private static void add(Item input, ItemStack stack, float experience)
{
add(new ItemStack(input), stack, experience);

View file

@ -19,9 +19,9 @@ public abstract class TradeRegistry {
new GemForItem(Items.potato, new PriceInfo(15, 19)),
new GemForItem(Items.carrot, new PriceInfo(15, 19)),
new ItemForGem(Items.bread, new PriceInfo(-4, -2)),
new GemForItem(ItemRegistry.getItemFromBlock(Blocks.pumpkin), new PriceInfo(8, 13)),
new GemForItem(Items.pumpkin, new PriceInfo(8, 13)),
new ItemForGem(Items.pumpkin_pie, new PriceInfo(-3, -2)),
new GemForItem(ItemRegistry.getItemFromBlock(Blocks.melon_block), new PriceInfo(7, 12)),
new GemForItem(Items.melon_block, new PriceInfo(7, 12)),
new ItemForGem(Items.apple, new PriceInfo(-5, -7)),
new ItemForGem(Items.cookie, new PriceInfo(-6, -10)),
new ItemForGem(Items.cake, new PriceInfo(1, 1)),
@ -39,16 +39,16 @@ public abstract class TradeRegistry {
new GemForItem(Items.string, new PriceInfo(15, 20)),
new ItemForGem(Items.arrow, new PriceInfo(-12, -8)),
new ItemForGem(Items.bow, new PriceInfo(2, 3)),
new ItemForGemItem(ItemRegistry.getItemFromBlock(Blocks.gravel),
new ItemForGemItem(Items.gravel,
new PriceInfo(10, 10), Items.flint, new PriceInfo(6, 10)),
new GemForItem(Items.paper, new PriceInfo(24, 36)),
new BookForGem(),
new GemForItem(Items.book, new PriceInfo(8, 10)),
new ItemForGem(Items.navigator, new PriceInfo(10, 12)),
new ItemForGem(ItemRegistry.getItemFromBlock(Blocks.bookshelf),
new ItemForGem(Items.bookshelf,
new PriceInfo(3, 4)),
new GemForItem(Items.written_book, new PriceInfo(2, 2)),
new ItemForGem(ItemRegistry.getItemFromBlock(Blocks.glass),
new ItemForGem(Items.glass,
new PriceInfo(-5, -3)),
new BookForGem(),
new BookForGem(),

View file

@ -45,7 +45,7 @@ public class ContainerPlayer extends Container
}
public boolean isItemValid(ItemStack stack)
{
return stack != null && stack.getItem() instanceof ItemArmor && ((ItemArmor)stack.getItem()).armorType.getArmorSlot() == k_f; // : (stack.getItem() != ItemRegistry.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull ? false : k_f == 0));
return stack != null && stack.getItem() instanceof ItemArmor && ((ItemArmor)stack.getItem()).armorType.getArmorSlot() == k_f; // : (stack.getItem() != Items.pumpkin && stack.getItem() != Items.skull ? false : k_f == 0));
}
// public String getSlotTexture()
// {

View file

@ -68,7 +68,7 @@ public class SlotCrafting extends Slot
this.amountCrafted = 0;
// if (stack.getItem() == ItemRegistry.getItemFromBlock(Blocks.crafting_table))
// if (stack.getItem() == Items.crafting_table)
// {
// this.thePlayer.triggerAchievement(AchievementList.buildWorkBench);
// }
@ -78,7 +78,7 @@ public class SlotCrafting extends Slot
// this.thePlayer.triggerAchievement(AchievementList.buildPickaxe);
// }
//
// if (stack.getItem() == ItemRegistry.getItemFromBlock(Blocks.furnace))
// if (stack.getItem() == Items.furnace)
// {
// this.thePlayer.triggerAchievement(AchievementList.buildFurnace);
// }
@ -108,12 +108,12 @@ public class SlotCrafting extends Slot
// this.thePlayer.triggerAchievement(AchievementList.buildSword);
// }
//
// if (stack.getItem() == ItemRegistry.getItemFromBlock(Blocks.enchanting_table))
// if (stack.getItem() == Items.enchanting_table)
// {
// this.thePlayer.triggerAchievement(AchievementList.enchantments);
// }
//
// if (stack.getItem() == ItemRegistry.getItemFromBlock(Blocks.bookshelf))
// if (stack.getItem() == Items.bookshelf)
// {
// this.thePlayer.triggerAchievement(AchievementList.bookcase);
// }

View file

@ -2,44 +2,43 @@ package common.item;
import java.util.List;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
public enum CheatTab {
BLOCKS("Baumaterial") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.glass);
return Items.glass;
}
},
NATURE("Gestein und Natur") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.grass);
return Items.grass;
}
},
WOOD("Holz") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.maple_planks);
return Items.maple_planks;
}
},
PLANTS("Pflanzen") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.oak_leaves_spring);
return Items.oak_leaves_spring;
}
},
DECORATION("Dekoration") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.hay_block);
return Items.hay_block;
}
},
TECHNOLOGY("Redstone & Technik") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.tnt);
return Items.tnt;
}
},
GEMS("Erze & Teure Blöcke") {
protected Item getIconItem() {
return ItemRegistry.getItemFromBlock(Blocks.diamond_block);
return Items.diamond_block;
}
},
SPAWNERS("Mob & Itemspawner") {

View file

@ -32,16 +32,6 @@ public final class ItemStack
private Item item;
private TagObject tag;
public ItemStack(Block block)
{
this(block, 1);
}
public ItemStack(Block block, int amount)
{
this(ItemRegistry.getItemFromBlock(block), amount);
}
public ItemStack(Item item)
{
this(item, 1);

View file

@ -253,7 +253,7 @@ public class ItemArmor extends Item
// }
public static int getArmorPosition(ItemStack stack) {
// if(stack.getItem() != ItemRegistry.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull) {
// if(stack.getItem() != Items.pumpkin && stack.getItem() != Items.skull) {
if(stack.getItem() instanceof ItemArmor) {
switch(((ItemArmor)stack.getItem()).armorType) {
case HEAD:

View file

@ -4,6 +4,7 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
@ -12,11 +13,10 @@ import common.block.Material;
import common.block.liquid.BlockDynamicLiquid;
import common.block.liquid.BlockLiquid;
import common.block.liquid.BlockStaticLiquid;
import common.collect.Maps;
import common.collect.Sets;
import common.entity.npc.EntityNPC;
import common.init.BlockRegistry;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.init.SoundEvent;
import common.item.CheatTab;
@ -38,9 +38,15 @@ import common.world.AWorldServer;
public class ItemBucket extends Item
{
private static final Map<BlockLiquid, ItemBucket> MAPPING = Maps.newHashMap();
private final boolean recursive;
private final BlockDynamicLiquid liquid;
public static ItemBucket getByFluid(BlockLiquid liquid) {
return MAPPING.get(liquid);
}
private static boolean test(AWorldServer world, BlockPos pos, Set<Block> blocks, int max, BlockPos origin, int radius) {
if(pos.getY() < -World.MAX_SIZE_Y || pos.getY() > max)
return false;
@ -111,8 +117,10 @@ public class ItemBucket extends Item
this.liquid = liquid;
this.recursive = recursive;
this.setTab(liquid == null ? CheatTab.TOOLS : CheatTab.LIQUIDS);
// if(!empty)
// this.setHasSubtypes(true);
if(liquid != null && !recursive) {
MAPPING.put(liquid, this);
MAPPING.put(liquid.getStaticBlock(), this);
}
}
public BlockDynamicLiquid getLiquid() {
@ -181,9 +189,7 @@ public class ItemBucket extends Item
worldIn.setBlockToAir(blockpos);
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
Block block = iblockstate.getBlock();
return this.fillBucket(itemStackIn, playerIn, new ItemStack(
ItemRegistry.getRegisteredItem(BlockRegistry.getNameFromFluid((BlockLiquid)block) +
"_bucket")));
return this.fillBucket(itemStackIn, playerIn, new ItemStack(MAPPING.get((BlockLiquid)block)));
}
}
}
@ -336,7 +342,7 @@ public class ItemBucket extends Item
Item item;
if (material.isLiquid() && block instanceof BlockLiquid && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0)
{
item = ItemRegistry.getRegisteredItem(BlockRegistry.getNameFromFluid((BlockLiquid)block) + "_bucket");
item = MAPPING.get((BlockLiquid)block);
}
else
{

View file

@ -246,11 +246,11 @@ public class TileEntityBanner extends TileEntity
HALF_VERTICAL_MIRROR("half_vertical_right", "vhr", "Links %s gespalten", null, true, " ##", " ##", " ##"),
HALF_HORIZONTAL_MIRROR("half_horizontal_bottom", "hhb", "Unten %s geteilt", null, true, " ", "###", "###"),
BORDER("border", "bo", "%s Bord", 1, false, "###", "# #", "###"),
CURLY_BORDER("curly_border", "cbo", "%s Spickelbord", 1, false, new ItemStack(Blocks.vine)),
CURLY_BORDER("curly_border", "cbo", "%s Spickelbord", 1, false, new ItemStack(Items.vine)),
RUNE("rune", "run", "%s Rune", -1, false, new ItemStack(Items.golden_apple)),
GRADIENT("gradient", "gra", "%s Farbverlauf", 1, false, "# #", " # ", " # "),
GRADIENT_UP("gradient_up", "gru", "%s Farbverlauf (Invertiert)", 1, false, " # ", " # ", "# #"),
BRICKS("bricks", "bri", "Feld %s gemauert", null, true, new ItemStack(Blocks.brick_block)),
BRICKS("bricks", "bri", "Feld %s gemauert", null, true, new ItemStack(Items.brick_block)),
SKULL("skull", "sku", "%s Schädel", 1, false, new ItemStack(Items.skull)),
FLOWER("flower", "flo", "%s Blume", -1, false, new ItemStack(Items.daisy)),
THING("thing", "thi", "%s <???>", 0, false, new ItemStack(Items.charged_apple));

View file

@ -345,7 +345,7 @@ public class TileEntityFurnace extends TileEntityLockable implements ITickable,
++this.furnaceItemStacks[2].size;
}
// if (this.furnaceItemStacks[0].getItem() == ItemRegistry.getItemFromBlock(Blocks.sponge) && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null && this.furnaceItemStacks[1].getItem() == Items.bucket)
// if (this.furnaceItemStacks[0].getItem() == Items.sponge && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null && this.furnaceItemStacks[1].getItem() == Items.bucket)
// {
// this.furnaceItemStacks[1] = new ItemStack(Items.water_bucket);
// }

View file

@ -1,7 +1,5 @@
package common.tileentity;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.inventory.ContainerTile;
import common.item.ItemStack;
@ -32,7 +30,7 @@ public class TileEntityTianReactor extends TileEntityDevice {
}
public boolean isItemValidForSlot(int index, ItemStack stack) {
return index == 0 ? stack.getItem() == Items.aluminium_ingot : (index == 1 ? stack.getItem() == ItemRegistry.getItemFromBlock(Blocks.lead_block) : false);
return index == 0 ? stack.getItem() == Items.aluminium_ingot : (index == 1 ? stack.getItem() == Items.lead_block : false);
}
protected int getMaxTemp() {

View file

@ -1,7 +1,5 @@
package server.worldgen;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.init.Items;
import common.item.RngLoot;
import common.rng.WeightedList;
@ -11,8 +9,8 @@ public abstract class LootConstants {
new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.bread, 1, 3, 15),
new RngLoot(Items.apple, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 5), new RngLoot(Items.iron_sword, 1, 1, 5),
new RngLoot(Items.iron_chestplate, 1, 1, 5), new RngLoot(Items.iron_helmet, 1, 1, 5), new RngLoot(Items.iron_leggings, 1, 1, 5),
new RngLoot(Items.iron_boots, 1, 1, 5), new RngLoot(ItemRegistry.getItemFromBlock(Blocks.obsidian), 3, 7, 5),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.oak_sapling), 3, 7, 5), new RngLoot(Items.saddle, 1, 1, 3),
new RngLoot(Items.iron_boots, 1, 1, 5), new RngLoot(Items.obsidian, 3, 7, 5),
new RngLoot(Items.oak_sapling, 3, 7, 5), new RngLoot(Items.saddle, 1, 1, 3),
new RngLoot(Items.iron_horse_armor, 1, 1, 1), new RngLoot(Items.gold_horse_armor, 1, 1, 1),
new RngLoot(Items.diamond_horse_armor, 1, 1, 1));
public static final WeightedList<RngLoot> STRONGHOLD_CHEST = new WeightedList(new RngLoot(Items.orb, 1, 1, 10),
@ -42,14 +40,14 @@ public abstract class LootConstants {
new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.redstone, 4, 9, 5),
new RngLoot(Items.lapis_lazuli, 4, 9, 5), new RngLoot(Items.diamond, 1, 2, 3),
new RngLoot(Items.coal, 3, 8, 10), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.rail), 4, 8, 1), new RngLoot(Items.melon_stem, 2, 4, 10),
new RngLoot(Items.rail, 4, 8, 1), new RngLoot(Items.melon_stem, 2, 4, 10),
new RngLoot(Items.pumpkin_stem, 2, 4, 10), new RngLoot(Items.saddle, 1, 1, 3), new RngLoot(Items.iron_horse_armor, 1, 1, 1));
public static final WeightedList<RngLoot> HELL_FORTRESS = new WeightedList(new RngLoot(Items.diamond, 1, 3, 5),
new RngLoot(Items.iron_ingot, 1, 5, 5), new RngLoot(Items.gold_ingot, 1, 3, 15), new RngLoot(Items.gold_sword, 1, 1, 5),
new RngLoot(Items.gold_chestplate, 1, 1, 5), new RngLoot(Items.flint_and_steel, 1, 1, 5),
new RngLoot(Items.soul_wart, 3, 7, 5), new RngLoot(Items.saddle, 1, 1, 10), new RngLoot(Items.gold_horse_armor, 1, 1, 8),
new RngLoot(Items.iron_horse_armor, 1, 1, 5), new RngLoot(Items.diamond_horse_armor, 1, 1, 3),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.obsidian), 2, 4, 2));
new RngLoot(Items.obsidian, 2, 4, 2));
public static final WeightedList<RngLoot> DUNGEON_CHEST = new WeightedList(new RngLoot(Items.saddle, 1, 1, 11),
new RngLoot(Items.iron_ingot, 1, 4, 11), new RngLoot(Items.bread, 1, 1, 11), new RngLoot(Items.wheats, 1, 4, 11),
new RngLoot(Items.gunpowder, 1, 4, 11), new RngLoot(Items.string, 1, 4, 11), new RngLoot(Items.bucket, 1, 1, 11),
@ -62,9 +60,9 @@ public abstract class LootConstants {
new RngLoot(Items.record_ward, 1, 1, 1), new RngLoot(Items.record_11, 1, 1, 1), new RngLoot(Items.record_wait, 1, 1, 1),
new RngLoot(Items.record_delay, 1, 1, 1), new RngLoot(Items.record_extend, 1, 1, 1));
public static final WeightedList<RngLoot> ABANDONED_ITEMS = new WeightedList(new RngLoot(Items.stick, 1, 3, 10),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.oak_planks), 1, 3, 10),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.oak_log), 1, 3, 10), new RngLoot(Items.stone_axe, 1, 1, 3),
new RngLoot(Items.oak_planks, 1, 3, 10),
new RngLoot(Items.oak_log, 1, 3, 10), new RngLoot(Items.stone_axe, 1, 1, 3),
new RngLoot(Items.wood_axe, 1, 1, 5), new RngLoot(Items.stone_pickaxe, 1, 1, 3), new RngLoot(Items.wood_pickaxe, 1, 1, 5),
new RngLoot(Items.apple, 2, 3, 5), new RngLoot(Items.bread, 2, 3, 3),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.acacia_log), 1, 3, 10));
new RngLoot(Items.acacia_log, 1, 3, 10));
}