update textures #3 + item code cleanup
This commit is contained in:
parent
3c7f2cf874
commit
3e58287efa
189 changed files with 1649 additions and 2258 deletions
|
@ -66,7 +66,7 @@ public class EntityAIShareItems extends EntityAIWatchClosest2
|
|||
itemstack.decrSize(l);
|
||||
itemstack1 = new ItemStack(item, l);
|
||||
}
|
||||
else if (item == Items.wheats && itemstack.getSize() > 5)
|
||||
else if (item == Items.wheat && itemstack.getSize() > 5)
|
||||
{
|
||||
int j = itemstack.getSize() / 2 / 3 * 3;
|
||||
int k = j / 3;
|
||||
|
|
|
@ -13,7 +13,10 @@ import java.util.Set;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.function.Function;
|
||||
|
||||
import common.attributes.Attribute;
|
||||
import common.attributes.UsageSlot;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.block.natural.BlockSnow;
|
||||
import common.collect.ImmutableList;
|
||||
import common.collect.ImmutableMap;
|
||||
import common.collect.Iterables;
|
||||
|
@ -21,6 +24,8 @@ import common.collect.Lists;
|
|||
import common.collect.Maps;
|
||||
import common.collect.Sets;
|
||||
import common.collect.UnmodifiableIterator;
|
||||
import common.color.DyeColor;
|
||||
import common.color.TextColor;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.Entity;
|
||||
import common.entity.item.EntityItem;
|
||||
|
@ -28,10 +33,11 @@ import common.entity.item.EntityXp;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.item.StackSize;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
@ -902,6 +908,10 @@ public class Block {
|
|||
public int getShearsEfficiency() {
|
||||
return this.shearsEfficiency;
|
||||
}
|
||||
|
||||
public float getRadiation() {
|
||||
return this.radiation;
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return false;
|
||||
|
@ -914,6 +924,10 @@ public class Block {
|
|||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
return provider.getModel(name).add().all();
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState();
|
||||
}
|
||||
|
||||
public Property<?>[] getIgnoredProperties() {
|
||||
return null;
|
||||
|
@ -949,18 +963,14 @@ public class Block {
|
|||
return null;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemBlock(this);
|
||||
protected boolean hasRegisteredItem() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public final Item registerItem() {
|
||||
Item item = this.getItemToRegister();
|
||||
if(item == null)
|
||||
if(!this.hasRegisteredItem())
|
||||
return null;
|
||||
if(item.getBlock() != this)
|
||||
throw new IllegalArgumentException("Gegenstand für Block " + BlockRegistry.getName(this) + " stimmt nicht überein");
|
||||
this.item = item;
|
||||
return item;
|
||||
return this.item = new Item(this);
|
||||
}
|
||||
|
||||
public Item getItem() {
|
||||
|
@ -1053,7 +1063,89 @@ public class Block {
|
|||
return this.itemColored;
|
||||
}
|
||||
|
||||
public String getItemTexture(String name) {
|
||||
return name;
|
||||
public StackSize getMaxStackSize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public TextColor getItemColor() {
|
||||
return this.radiation > 0.0f ? TextColor.GREEN : null;
|
||||
}
|
||||
|
||||
public boolean place(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if(block == Blocks.snow_layer && iblockstate.getValue(BlockSnow.LAYERS).intValue() < 1)
|
||||
side = Facing.UP;
|
||||
else if (!block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (worldIn.canBlockBePlaced(this, pos, false, side, (Entity)null, stack))
|
||||
{
|
||||
State iblockstate1 = this.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, playerIn);
|
||||
|
||||
if (worldIn.setState(pos, iblockstate1, 3))
|
||||
{
|
||||
iblockstate1 = worldIn.getState(pos);
|
||||
|
||||
if (iblockstate1.getBlock() == this)
|
||||
{
|
||||
this.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn);
|
||||
}
|
||||
|
||||
worldIn.playSound(this.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
Block block = worldIn.getState(pos).getBlock();
|
||||
|
||||
if (block == Blocks.snow_layer)
|
||||
{
|
||||
side = Facing.UP;
|
||||
}
|
||||
else if (!block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
||||
return worldIn.canBlockBePlaced(this, pos, false, side, (Entity)null, stack);
|
||||
}
|
||||
|
||||
public boolean prePlace(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean dispense(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
}
|
||||
|
||||
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public final class BlockAir extends Block {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,10 @@ import common.block.Material;
|
|||
import common.color.DyeColor;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBed;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
@ -16,6 +18,7 @@ import common.properties.Property;
|
|||
import common.properties.PropertyEnum;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.Identifyable;
|
||||
import common.util.WorldPos;
|
||||
|
@ -53,6 +56,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
super(Material.BURNABLE);
|
||||
this.color = color;
|
||||
this.setDefaultState(this.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT));
|
||||
this.setTab(CheatTab.DECORATION);
|
||||
this.setBedBounds();
|
||||
}
|
||||
|
||||
|
@ -193,8 +197,73 @@ public class BlockBed extends Block implements Rotatable {
|
|||
.add(0, 3, 0, 16, 3, 16)
|
||||
.d("oak_planks").noCull().rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(PART, EnumPartType.HEAD).withProperty(FACING, Facing.NORTH);
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemBed(this).setDisplay(this.color.getSubject(0) + " Bett");
|
||||
public StackSize getMaxStackSize() {
|
||||
return StackSize.S;
|
||||
}
|
||||
|
||||
public boolean place(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (side != Facing.UP)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
boolean flag = block.isReplaceable(worldIn, pos);
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
pos = pos.up();
|
||||
}
|
||||
|
||||
int i = ExtMath.floord((double)(playerIn.rotYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
Facing enumfacing = Facing.getHorizontal(i);
|
||||
BlockPos blockpos = pos.offset(enumfacing);
|
||||
|
||||
if (playerIn.canPlayerEdit(pos, side, stack) && playerIn.canPlayerEdit(blockpos, side, stack))
|
||||
{
|
||||
boolean flag1 = worldIn.getState(blockpos).getBlock().isReplaceable(worldIn, blockpos);
|
||||
boolean flag2 = flag || worldIn.isAirBlock(pos);
|
||||
boolean flag3 = flag1 || worldIn.isAirBlock(blockpos);
|
||||
|
||||
if (flag2 && flag3 && worldIn.isBlockSolid(pos.down()) && worldIn.isBlockSolid(blockpos.down()))
|
||||
{
|
||||
State iblockstate1 = this.getState() /* .withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)) */ .withProperty(BlockBed.FACING, enumfacing).withProperty(BlockBed.PART, BlockBed.EnumPartType.FOOT);
|
||||
|
||||
if (worldIn.setState(pos, iblockstate1, 3))
|
||||
{
|
||||
State iblockstate2 = iblockstate1.withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD);
|
||||
worldIn.setState(blockpos, iblockstate2, 3);
|
||||
}
|
||||
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
return side == Facing.UP;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,11 @@ import common.block.Rotatable;
|
|||
import common.block.Material;
|
||||
import common.collect.Lists;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemDoor;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.tool.ItemKey;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
|
@ -66,6 +69,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
super(material);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(OPEN, false)
|
||||
.withProperty(HINGE, EnumHingePosition.LEFT).withProperty(HALF, EnumDoorHalf.LOWER));
|
||||
this.setTab(material == Material.WOOD ? CheatTab.WOOD : CheatTab.TECHNOLOGY);
|
||||
DOORS.add(this);
|
||||
}
|
||||
|
||||
|
@ -285,7 +289,78 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
return Transform.PANE_SIDE;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemDoor(this);
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(HALF, EnumDoorHalf.UPPER).withProperty(FACING, Facing.NORTH);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return this == Blocks.iron_door;
|
||||
}
|
||||
|
||||
public StackSize getMaxStackSize() {
|
||||
return StackSize.S;
|
||||
}
|
||||
|
||||
public boolean place(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side != Facing.UP)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if (!block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
||||
if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.canPlaceBlockAt(worldIn, pos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
placeDoor(worldIn, pos, Facing.fromAngle((double)playerIn.rotYaw), this, true);
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
return side == Facing.UP;
|
||||
}
|
||||
|
||||
public static void placeDoor(World worldIn, BlockPos pos, Facing facing, Block door, boolean update)
|
||||
{
|
||||
BlockPos blockpos = pos.offset(facing.rotateY());
|
||||
BlockPos blockpos1 = pos.offset(facing.rotateYCCW());
|
||||
int i = (worldIn.getState(blockpos1).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getState(blockpos1.up()).getBlock().isNormalCube() ? 1 : 0);
|
||||
int j = (worldIn.getState(blockpos).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getState(blockpos.up()).getBlock().isNormalCube() ? 1 : 0);
|
||||
boolean flag = worldIn.getState(blockpos1).getBlock() == door || worldIn.getState(blockpos1.up()).getBlock() == door;
|
||||
boolean flag1 = worldIn.getState(blockpos).getBlock() == door || worldIn.getState(blockpos.up()).getBlock() == door;
|
||||
boolean flag2 = false;
|
||||
|
||||
if (flag && !flag1 || j > i)
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
|
||||
BlockPos blockpos2 = pos.up();
|
||||
State iblockstate = door.getState().withProperty(BlockDoor.FACING, facing).withProperty(BlockDoor.HINGE, flag2 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT);
|
||||
worldIn.setState(pos, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2);
|
||||
worldIn.setState(blockpos2, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2);
|
||||
if(update) {
|
||||
worldIn.notifyNeighborsOfStateChange(pos, door);
|
||||
worldIn.notifyNeighborsOfStateChange(blockpos2, door);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import common.entity.Entity;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemFence;
|
||||
import common.item.tool.ItemLead;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
@ -373,10 +372,10 @@ public class BlockFence extends Block
|
|||
.e().uv(7, 7, 9, 10)
|
||||
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemFence(this);
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(EAST, false).withProperty(WEST, false).withProperty(NORTH, true).withProperty(SOUTH, true);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, WEST, EAST};
|
||||
|
|
|
@ -151,7 +151,7 @@ public class BlockFloorPortal extends Block
|
|||
return "obsidian";
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import common.init.Items;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
@ -141,7 +140,7 @@ public class BlockFlowerPot extends Block
|
|||
{
|
||||
ItemStack itemstack = playerIn.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
if (itemstack != null && itemstack.getItem().getBlock() != null)
|
||||
{
|
||||
if (this.content != null)
|
||||
{
|
||||
|
@ -259,8 +258,8 @@ public class BlockFlowerPot extends Block
|
|||
}
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return this.content == null ? super.getItemToRegister() : null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return this.content == null;
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
package common.block.artificial;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import common.attributes.Attribute;
|
||||
import common.attributes.UsageSlot;
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.block.SoundType;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.MetalType;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemMetalBlock;
|
||||
import common.item.ItemStack;
|
||||
|
||||
public class BlockMetalBlock extends Block {
|
||||
private final MetalType metal;
|
||||
|
@ -23,8 +29,23 @@ public class BlockMetalBlock extends Block {
|
|||
public MetalType getMetal() {
|
||||
return this.metal;
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return this.metal.isMagnetic();
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
tooltip.add(this.metal.formatSymbol());
|
||||
if(this.metal.radioactivity > 0.0f) {
|
||||
tooltip.add(this.metal.formatRadioactivity());
|
||||
}
|
||||
tooltip.add(this.metal.formatRarity());
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemMetalBlock(this);
|
||||
}
|
||||
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot)
|
||||
{
|
||||
if((slot == null || slot == UsageSlot.INVENTORY) && this.metal.radioactivity > 0.0f)
|
||||
map.put(Attribute.RADIATION, this.metal.radioactivity * 4.0f * 9.0f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.entity.Entity;
|
|||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemPane;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
@ -499,12 +498,8 @@ public class BlockPane extends Block
|
|||
public Transform getTransform() {
|
||||
return Transform.PANE;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemPane(this);
|
||||
}
|
||||
|
||||
public String getItemTexture(String name) {
|
||||
return this.getPaneBase();
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(NORTH, false).withProperty(SOUTH, false).withProperty(WEST, true).withProperty(EAST, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,8 +268,8 @@ public class BlockPortal extends Block
|
|||
map.put("portal", 1);
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// public BlockPattern.PatternHelper func_181089_f(World p_181089_1_, BlockPos p_181089_2_)
|
||||
|
|
|
@ -7,11 +7,12 @@ import common.block.Directional;
|
|||
import common.block.Material;
|
||||
import common.collect.Lists;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.BlockRegistry;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemSlab;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.properties.Property;
|
||||
|
@ -154,7 +155,27 @@ public class BlockSlab extends Block implements Directional {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSlab(this);
|
||||
public boolean place(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) {
|
||||
return !stack.isEmpty() && playerIn.canPlayerEdit(pos.offset(side), side, stack) &&
|
||||
(this.tryVerticalPlace(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ) || super.place(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ));
|
||||
}
|
||||
|
||||
private boolean tryVerticalPlace(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) {
|
||||
if(hitY >= 0.34f && hitY <= 0.66f) {
|
||||
State state = worldIn.getState(pos);
|
||||
Block block = state.getBlock();
|
||||
if(!block.isReplaceable(worldIn, pos))
|
||||
pos = pos.offset(side);
|
||||
if(worldIn.canBlockBePlaced(this, pos, false, side, null, stack)) {
|
||||
State place = this.getState().withProperty(BlockSlab.FACING, playerIn.getHorizontalFacing());
|
||||
if(worldIn.setState(pos, place, 3)) {
|
||||
worldIn.playSound(this.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F),
|
||||
(double)((float)pos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import common.block.Material;
|
|||
import common.color.DyeColor;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.model.BlockLayer;
|
||||
import common.properties.Property;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.collect.Lists;
|
|||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemWall;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
@ -291,10 +290,10 @@ public class BlockWall extends Block
|
|||
.e().uv(5, 3, 11, 16)
|
||||
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemWall(this);
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(UP, true).withProperty(NORTH, false).withProperty(SOUTH, false).withProperty(WEST, true).withProperty(EAST, true);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, UP, WEST, EAST};
|
||||
|
|
|
@ -4,7 +4,7 @@ import common.init.Blocks;
|
|||
import common.init.Items;
|
||||
import common.item.Item;
|
||||
import common.item.StackSize;
|
||||
import common.item.block.ItemSeedFood;
|
||||
import common.item.consumable.ItemSeedFood;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.world.State;
|
||||
|
@ -15,13 +15,13 @@ public class BlockCarrot extends BlockCrops
|
|||
{
|
||||
return Items.carrot;
|
||||
}
|
||||
|
||||
protected Item getDropItem() {
|
||||
return Items.carrot;
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
int age = state.getValue(AGE);
|
||||
return crop(provider, name + "_" + (age == 6 ? 2 : (age / 2)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSeedFood(3, this, Blocks.farmland).setDisplay("Karotte").setMaxAmount(StackSize.L);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.block.ItemSeeds;
|
||||
import common.item.material.ItemSeeds;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.properties.Property;
|
||||
|
@ -138,9 +138,13 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
|
||||
protected Item getCrop()
|
||||
{
|
||||
return Items.wheats;
|
||||
return Items.wheat;
|
||||
}
|
||||
|
||||
protected Item getDropItem() {
|
||||
return Items.wheat_seed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
|
@ -160,7 +164,7 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
{
|
||||
if (worldIn.rand.zrange(15) <= i)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getDropItem()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -218,7 +222,7 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
.s().uv(0, 0, 16, 16).noCull();
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSeeds(this, Blocks.farmland).setDisplay("Weizenkörner").setMaxAmount(StackSize.XL);
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import common.init.Blocks;
|
|||
import common.init.Items;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.block.ItemDoublePlant;
|
||||
import common.item.StackSize;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
@ -48,6 +48,8 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
this.setStepSound(SoundType.GRASS);
|
||||
this.setFlammable(60, 100);
|
||||
this.setFlatBlockTexture();
|
||||
if(this.type == BlockDoublePlant.EnumPlantType.GRASS || this.type == BlockDoublePlant.EnumPlantType.FERN)
|
||||
this.setItemColored();
|
||||
PLANTS[type.ordinal()] = this;
|
||||
}
|
||||
|
||||
|
@ -151,10 +153,14 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
}
|
||||
else
|
||||
{
|
||||
return this.type == BlockDoublePlant.EnumPlantType.FERN ? null : (this.type == BlockDoublePlant.EnumPlantType.GRASS ? (rand.chance(8) ? Items.wheat : null) : super.getItemDropped(state, rand, fortune));
|
||||
return this.type == BlockDoublePlant.EnumPlantType.FERN ? null : (this.type == BlockDoublePlant.EnumPlantType.GRASS ? (rand.chance(8) ? Items.wheat_seed : null) : super.getItemDropped(state, rand, fortune));
|
||||
}
|
||||
}
|
||||
|
||||
public int getRenderColor(State state) {
|
||||
return this.type != BlockDoublePlant.EnumPlantType.GRASS && this.type != BlockDoublePlant.EnumPlantType.FERN ? 16777215 : Colorizer.getGrassColor(0.5D, 1.0D);
|
||||
}
|
||||
|
||||
public int colorMultiplier(IWorldAccess worldIn, BlockPos pos, int renderPass)
|
||||
{
|
||||
return this.type != BlockDoublePlant.EnumPlantType.GRASS && this.type != BlockDoublePlant.EnumPlantType.FERN ? 16777215 : Colorizer.getGrassColor(worldIn, pos);
|
||||
|
@ -283,9 +289,13 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
public Transform getTransform() {
|
||||
return Transform.CROSS;
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(HALF, EnumBlockHalf.UPPER);
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemDoublePlant(this);
|
||||
public StackSize getMaxStackSize() {
|
||||
return StackSize.S;
|
||||
}
|
||||
|
||||
public static enum EnumBlockHalf implements Identifyable
|
||||
|
|
|
@ -8,11 +8,12 @@ import common.block.liquid.BlockLiquid;
|
|||
import common.block.liquid.BlockStaticLiquid;
|
||||
import common.entity.Entity;
|
||||
import common.entity.item.EntityBoat;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemLilyPad;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
@ -21,6 +22,7 @@ import common.properties.Property;
|
|||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
@ -106,8 +108,42 @@ public class BlockLilyPad extends BlockBush implements Rotatable
|
|||
public Transform getTransform() {
|
||||
return Transform.SMALL_FLAT;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemLilyPad(this);
|
||||
}
|
||||
|
||||
public boolean prePlace(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
{
|
||||
HitPosition movingobjectposition = Item.getMovingObjectPositionFromPlayer(worldIn, playerIn, true);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (movingobjectposition.type == HitPosition.ObjectType.BLOCK)
|
||||
{
|
||||
BlockPos blockpos = movingobjectposition.block;
|
||||
|
||||
if (!World.isValidXZ(blockpos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!playerIn.canPlayerEdit(blockpos.offset(movingobjectposition.side), movingobjectposition.side, itemStackIn))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPos blockpos1 = blockpos.up();
|
||||
State iblockstate = worldIn.getState(blockpos);
|
||||
|
||||
if (iblockstate.getBlock().getMaterial().isColdLiquid() && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1))
|
||||
{
|
||||
worldIn.setState(blockpos1, Blocks.waterlily.getState().withProperty(BlockLilyPad.FACING, playerIn.getHorizontalFacing().getOpposite()));
|
||||
itemStackIn.decrSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,39 +10,25 @@ import common.model.ModelProvider;
|
|||
import common.rng.Random;
|
||||
import common.world.State;
|
||||
|
||||
public class BlockMelon extends Block
|
||||
{
|
||||
public BlockMelon()
|
||||
{
|
||||
super(Material.SOFT);
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
public class BlockMelon extends Block {
|
||||
public BlockMelon() {
|
||||
super(Material.SOFT);
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.melon;
|
||||
}
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
return Items.melon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
{
|
||||
return random.range(3, 7);
|
||||
}
|
||||
protected int quantityDropped(Random random) {
|
||||
return random.range(3, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quantity dropped based on the given fortune level
|
||||
*/
|
||||
protected int quantityDroppedWithBonus(int fortune, Random random)
|
||||
{
|
||||
return Math.min(9, this.quantityDropped(random) + random.zrange(1 + fortune));
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
return provider.getModel("melon_side").add().nswe().du("melon_top");
|
||||
}
|
||||
protected int quantityDroppedWithBonus(int fortune, Random random) {
|
||||
return Math.min(9, this.quantityDropped(random) + random.zrange(1 + fortune));
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
return provider.getModel("melon_side").add().nswe().du("melon_top");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import common.init.Items;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.block.ItemSeedFood;
|
||||
import common.item.consumable.ItemSeedFood;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.util.BlockPos;
|
||||
|
@ -19,6 +19,10 @@ public class BlockPotato extends BlockCrops
|
|||
return Items.potato;
|
||||
}
|
||||
|
||||
protected Item getDropItem() {
|
||||
return Items.potato;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
|
@ -39,8 +43,4 @@ public class BlockPotato extends BlockCrops
|
|||
int age = state.getValue(AGE);
|
||||
return crop(provider, name + "_" + (age == 6 ? 2 : (age / 2)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSeedFood(1, this, Blocks.farmland).setDisplay("Kartoffel").setMaxAmount(StackSize.L);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
package common.block.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Rotatable;
|
||||
import common.block.Material;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.CheatTab;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
import common.properties.Property;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class BlockPumpkin extends Block implements Rotatable {
|
||||
public class BlockPumpkin extends Block {
|
||||
public BlockPumpkin() {
|
||||
super(Material.SOFT);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
|
||||
|
@ -25,16 +19,7 @@ public class BlockPumpkin extends Block implements Rotatable {
|
|||
return world.getState(pos).getBlock().getMaterial().isReplaceable() && world.isBlockSolid(pos.down());
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World world, BlockPos pos, Facing face, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {FACING};
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
return provider.getModel("pumpkin_side").add().du("pumpkin_top").n("pumpkin_face_" + (this.getLightValue() == 0 ? "off" : "on")).s().we()
|
||||
.rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
|
||||
return provider.getModel("pumpkin_side").add().nswe().du("pumpkin_top");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,8 +164,8 @@ public class BlockReed extends Block
|
|||
return new Property[] {AGE};
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return super.getItemToRegister().setMaxAmount(StackSize.L);
|
||||
public StackSize getMaxStackSize() {
|
||||
return StackSize.L;
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package common.block.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Directional;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.block.ItemSeeds;
|
||||
import common.item.material.ItemSeeds;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyInteger;
|
||||
import common.rng.Random;
|
||||
|
@ -23,44 +21,22 @@ import common.world.State;
|
|||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class BlockStem extends BlockBush implements Directional, IGrowable
|
||||
public class BlockStem extends BlockBush implements IGrowable
|
||||
{
|
||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7);
|
||||
|
||||
private final Block crop;
|
||||
private final String itemName;
|
||||
|
||||
public BlockStem(Block crop, String itemName)
|
||||
public BlockStem(Block crop)
|
||||
{
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FACING, Facing.UP));
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, 0));
|
||||
this.crop = crop;
|
||||
this.itemName = itemName;
|
||||
this.setTickRandomly();
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
||||
this.setTab((CheatTab)null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
state = state.withProperty(FACING, Facing.UP);
|
||||
|
||||
for (Facing enumfacing : Facing.Plane.HORIZONTAL)
|
||||
{
|
||||
if (worldIn.getState(pos.offset(enumfacing)).getBlock() == this.crop)
|
||||
{
|
||||
state = state.withProperty(FACING, enumfacing);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* is the block grass, dirt or farmland
|
||||
*/
|
||||
|
@ -88,20 +64,17 @@ public class BlockStem extends BlockBush implements Directional, IGrowable
|
|||
}
|
||||
else
|
||||
{
|
||||
for (Facing enumfacing : Facing.Plane.HORIZONTAL)
|
||||
BlockPos pos2 = pos.offset(Facing.Plane.HORIZONTAL.random(rand));
|
||||
Block block = worldIn.getState(pos2.down()).getBlock();
|
||||
Block block2 = worldIn.getState(pos2).getBlock();
|
||||
|
||||
if ((block2 == Blocks.air || block2 instanceof BlockStem) && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass))
|
||||
{
|
||||
if (worldIn.getState(pos.offset(enumfacing)).getBlock() == this.crop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
worldIn.setState(pos, Blocks.air.getState());
|
||||
worldIn.setState(pos2, this.crop.getState());
|
||||
}
|
||||
|
||||
pos = pos.offset(Facing.Plane.HORIZONTAL.random(rand));
|
||||
Block block = worldIn.getState(pos.down()).getBlock();
|
||||
|
||||
if (worldIn.getState(pos).getBlock() == Blocks.air && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass))
|
||||
{
|
||||
worldIn.setState(pos, this.crop.getState());
|
||||
else {
|
||||
worldIn.setState(pos, this.crop.getState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,20 +139,12 @@ public class BlockStem extends BlockBush implements Directional, IGrowable
|
|||
{
|
||||
if (worldIn.rand.zrange(15) <= i)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this == Blocks.melon_stem ? Items.melon_seed : Items.pumpkin_seed));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this IGrowable can grow
|
||||
*/
|
||||
|
@ -200,101 +165,81 @@ public class BlockStem extends BlockBush implements Directional, IGrowable
|
|||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE, FACING};
|
||||
return new Property[] {AGE};
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
String stem = name;
|
||||
String upperstem = name + "_connected";
|
||||
if(state.getValue(FACING).getAxis().isVertical()) {
|
||||
switch(state.getValue(AGE)) {
|
||||
case 0:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 1, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 2).tint().noCull()
|
||||
.s().uv(16, 0, 0, 2).tint().noCull()
|
||||
.add(8, -1, 0, 8, 1, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 2).tint().noCull()
|
||||
.e().uv(16, 0, 0, 2).tint().noCull();
|
||||
case 1:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 3, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 4).tint().noCull()
|
||||
.s().uv(16, 0, 0, 4).tint().noCull()
|
||||
.add(8, -1, 0, 8, 3, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 4).tint().noCull()
|
||||
.e().uv(16, 0, 0, 4).tint().noCull();
|
||||
case 2:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 5, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 6).tint().noCull()
|
||||
.s().uv(16, 0, 0, 6).tint().noCull()
|
||||
.add(8, -1, 0, 8, 5, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 6).tint().noCull()
|
||||
.e().uv(16, 0, 0, 6).tint().noCull();
|
||||
case 3:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 7, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 8).tint().noCull()
|
||||
.s().uv(16, 0, 0, 8).tint().noCull()
|
||||
.add(8, -1, 0, 8, 7, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 8).tint().noCull()
|
||||
.e().uv(16, 0, 0, 8).tint().noCull();
|
||||
case 4:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 9, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 10).tint().noCull()
|
||||
.s().uv(16, 0, 0, 10).tint().noCull()
|
||||
.add(8, -1, 0, 8, 9, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 10).tint().noCull()
|
||||
.e().uv(16, 0, 0, 10).tint().noCull();
|
||||
case 5:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 11, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 12).tint().noCull()
|
||||
.s().uv(16, 0, 0, 12).tint().noCull()
|
||||
.add(8, -1, 0, 8, 11, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 12).tint().noCull()
|
||||
.e().uv(16, 0, 0, 12).tint().noCull();
|
||||
case 6:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 13, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 14).tint().noCull()
|
||||
.s().uv(16, 0, 0, 14).tint().noCull()
|
||||
.add(8, -1, 0, 8, 13, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 14).tint().noCull()
|
||||
.e().uv(16, 0, 0, 14).tint().noCull();
|
||||
case 7:
|
||||
default:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 15, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 16).tint().noCull()
|
||||
.s().uv(16, 0, 0, 16).tint().noCull()
|
||||
.add(8, -1, 0, 8, 15, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 16).tint().noCull()
|
||||
.e().uv(16, 0, 0, 16).tint().noCull();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 7, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 8).tint().noCull()
|
||||
.s().uv(16, 0, 0, 8).tint().noCull()
|
||||
.add(8, -1, 0, 8, 7, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 8).tint().noCull()
|
||||
.e().uv(16, 0, 0, 8).tint().noCull()
|
||||
.add(0, 0, 8, 9, 16, 8)
|
||||
.n(upperstem).uv(9, 0, 0, 16).tint().noCull()
|
||||
.s(upperstem).uv(0, 0, 9, 16).tint().noCull()
|
||||
.rotate(ModelRotation.getEastRot(state.getValue(FACING).getOpposite(), false));
|
||||
}
|
||||
switch(state.getValue(AGE)) {
|
||||
case 0:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 1, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 2).tint().noCull()
|
||||
.s().uv(16, 0, 0, 2).tint().noCull()
|
||||
.add(8, -1, 0, 8, 1, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 2).tint().noCull()
|
||||
.e().uv(16, 0, 0, 2).tint().noCull();
|
||||
case 1:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 3, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 4).tint().noCull()
|
||||
.s().uv(16, 0, 0, 4).tint().noCull()
|
||||
.add(8, -1, 0, 8, 3, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 4).tint().noCull()
|
||||
.e().uv(16, 0, 0, 4).tint().noCull();
|
||||
case 2:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 5, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 6).tint().noCull()
|
||||
.s().uv(16, 0, 0, 6).tint().noCull()
|
||||
.add(8, -1, 0, 8, 5, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 6).tint().noCull()
|
||||
.e().uv(16, 0, 0, 6).tint().noCull();
|
||||
case 3:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 7, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 8).tint().noCull()
|
||||
.s().uv(16, 0, 0, 8).tint().noCull()
|
||||
.add(8, -1, 0, 8, 7, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 8).tint().noCull()
|
||||
.e().uv(16, 0, 0, 8).tint().noCull();
|
||||
case 4:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 9, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 10).tint().noCull()
|
||||
.s().uv(16, 0, 0, 10).tint().noCull()
|
||||
.add(8, -1, 0, 8, 9, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 10).tint().noCull()
|
||||
.e().uv(16, 0, 0, 10).tint().noCull();
|
||||
case 5:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 11, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 12).tint().noCull()
|
||||
.s().uv(16, 0, 0, 12).tint().noCull()
|
||||
.add(8, -1, 0, 8, 11, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 12).tint().noCull()
|
||||
.e().uv(16, 0, 0, 12).tint().noCull();
|
||||
case 6:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 13, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 14).tint().noCull()
|
||||
.s().uv(16, 0, 0, 14).tint().noCull()
|
||||
.add(8, -1, 0, 8, 13, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 14).tint().noCull()
|
||||
.e().uv(16, 0, 0, 14).tint().noCull();
|
||||
case 7:
|
||||
default:
|
||||
return provider.getModel(stem)
|
||||
.add(0, -1, 8, 16, 15, 8).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.n().uv(0, 0, 16, 16).tint().noCull()
|
||||
.s().uv(16, 0, 0, 16).tint().noCull()
|
||||
.add(8, -1, 0, 8, 15, 16).rotate(8, 8, 8, Facing.Axis.Y, 45, true)
|
||||
.w().uv(0, 0, 16, 16).tint().noCull()
|
||||
.e().uv(16, 0, 0, 16).tint().noCull();
|
||||
}
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSeeds(this, Blocks.farmland).setDisplay(this.itemName).setMaxAmount(StackSize.XL);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {FACING};
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
{
|
||||
return rand.chance(8) ? Items.wheat : null;
|
||||
return rand.chance(8) ? Items.wheat_seed : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.block.ItemSeeds;
|
||||
import common.item.material.ItemSeeds;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.properties.Property;
|
||||
|
@ -83,19 +83,11 @@ public class BlockWart extends BlockBush
|
|||
|
||||
for (int j = 0; j < i; ++j)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.soul_wart));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
|
@ -114,7 +106,7 @@ public class BlockWart extends BlockBush
|
|||
return BlockCrops.crop(provider, name + "_" + (age >= 2 ? age - 1 : age));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSeeds(this, Blocks.soul_sand).setDisplay("Seelenwarze").setMaxAmount(StackSize.L);
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -363,7 +363,7 @@ public abstract class BlockLiquid extends Block
|
|||
return true;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1137,8 +1137,8 @@ public class BlockFire extends Block
|
|||
return true;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
package common.block.natural;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import common.attributes.Attribute;
|
||||
import common.attributes.UsageSlot;
|
||||
import common.block.SoundType;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.MetalType;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemMetalBlock;
|
||||
import common.item.ItemStack;
|
||||
|
||||
public class BlockMetalOre extends BlockOre {
|
||||
private final MetalType metal;
|
||||
|
@ -18,8 +24,23 @@ public class BlockMetalOre extends BlockOre {
|
|||
public MetalType getMetal() {
|
||||
return this.metal;
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return this.metal.isMagnetic();
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
tooltip.add(this.metal.formatSymbol());
|
||||
if(this.metal.radioactivity > 0.0f) {
|
||||
tooltip.add(this.metal.formatRadioactivity());
|
||||
}
|
||||
tooltip.add(this.metal.formatRarity());
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemMetalBlock(this);
|
||||
}
|
||||
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot)
|
||||
{
|
||||
if((slot == null || slot == UsageSlot.INVENTORY) && this.metal.radioactivity > 0.0f)
|
||||
map.put(Attribute.RADIATION, this.metal.radioactivity * 4.0f * 2.0f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.init.Items;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.block.ItemSnow;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.Transform;
|
||||
|
@ -171,8 +170,49 @@ public class BlockSnow extends Block
|
|||
return height == 16 ? provider.getModel("snow").add().all() :
|
||||
provider.getModel("snow").add(0, 0, 0, 16, height, 16).u().noCull().d().nswe().uv(0, 16 - height, 16, 16);
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSnow(this);
|
||||
}
|
||||
|
||||
public boolean place(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
BlockPos blockpos = pos;
|
||||
|
||||
if ((side != Facing.UP || block != this) && !block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
blockpos = pos.offset(side);
|
||||
iblockstate = worldIn.getState(blockpos);
|
||||
block = iblockstate.getBlock();
|
||||
}
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
int i = ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue();
|
||||
|
||||
if (i <= 7)
|
||||
{
|
||||
State iblockstate1 = iblockstate.withProperty(BlockSnow.LAYERS, Integer.valueOf(i + 1));
|
||||
BoundingBox axisalignedbb = this.getCollisionBoundingBox(worldIn, blockpos, iblockstate1);
|
||||
|
||||
if (axisalignedbb != null && worldIn.checkNoEntityCollision(axisalignedbb) && worldIn.setState(blockpos, iblockstate1, 2))
|
||||
{
|
||||
worldIn.playSound(this.sound.getPlaceSound(), (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.place(stack, playerIn, worldIn, blockpos, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ public class BlockActiveDisplay extends BlockDisplay implements ITileEntityProvi
|
|||
return new TileEntityDisplay(this.density);
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
|
|
|
@ -7,9 +7,9 @@ import common.entity.Entity;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemPressurePlate;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.Transform;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
|
@ -249,9 +249,9 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
.w().uv(1, 15, 15, 16).noCull()
|
||||
.e().uv(1, 15, 15, 16).noCull();
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemPressurePlate(this);
|
||||
|
||||
public Transform getTransform() {
|
||||
return Transform.SMALL_FLAT;
|
||||
}
|
||||
|
||||
public abstract String getTexture();
|
||||
|
|
|
@ -13,7 +13,6 @@ import common.entity.types.EntityLiving;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemButton;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
@ -348,8 +347,8 @@ public class BlockButton extends Block implements Directional
|
|||
.ns().uv(5, pressed ? 15 : 14, 11, 16).noCull().we().uv(6, pressed ? 15 : 14, 10, 16).noCull()
|
||||
.rotate(getRotation(state.getValue(FACING)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemButton(this);
|
||||
|
||||
public Transform getTransform() {
|
||||
return Transform.PANE_SIDE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -503,7 +503,7 @@ public class BlockCauldron extends Block
|
|||
|
||||
return true;
|
||||
}
|
||||
else if (item == Items.glass_bottle)
|
||||
else if (item == Items.bottle)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
|
|
|
@ -210,7 +210,7 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
.s().we().rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return this.isBurning ? null : super.getItemToRegister();
|
||||
protected boolean hasRegisteredItem() {
|
||||
return !this.isBurning;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import common.entity.types.EntityLiving;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
|
|
@ -107,8 +107,8 @@ public class BlockLitTorch extends BlockTorch {
|
|||
return new Property[] {FUEL};
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Item getItem() {
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.init.Blocks;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.util.BlockPos;
|
||||
|
@ -56,7 +55,7 @@ public class BlockNuke extends Block
|
|||
return provider.getModel("nuke_side").add().nswe().d("nuke_bottom").u("nuke_top");
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return super.getItemToRegister().setColor(TextColor.RED);
|
||||
public TextColor getItemColor() {
|
||||
return TextColor.RED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ import common.init.Blocks;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemPiston;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
@ -679,8 +678,12 @@ public class BlockPistonBase extends Block implements Directional
|
|||
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getAxis() == Facing.Axis.Y
|
||||
? state.getValue(FACING).getOpposite() : state.getValue(FACING)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemPiston(this);
|
||||
}
|
||||
|
||||
public State getItemState() {
|
||||
return this.getState().withProperty(FACING, Facing.UP);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ public class BlockPistonHead extends Block implements Directional
|
|||
? state.getValue(FACING).getOpposite() : state.getValue(FACING)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package common.block.tech;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.color.DyeColor;
|
||||
import common.color.TextColor;
|
||||
import common.entity.Entity;
|
||||
import common.entity.item.EntityTnt;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -11,14 +13,16 @@ import common.init.Items;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemTNT;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyBool;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.Vec3;
|
||||
import common.world.Explosion;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
@ -157,7 +161,16 @@ public class BlockTNT extends Block
|
|||
this.onBlockDestroyedByPlayer(world, pos, state.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemTNT(this);
|
||||
public TextColor getItemColor() {
|
||||
return TextColor.RED;
|
||||
}
|
||||
|
||||
public boolean dispense(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
blockpos = blockpos.offset(facing);
|
||||
EntityTnt entitytntprimed = new EntityTnt(world, (double)blockpos.getX() + 0.5D, (double)blockpos.getY(), (double)blockpos.getZ() + 0.5D, (EntityLiving)null, this.power);
|
||||
world.spawnEntityInWorld(entitytntprimed);
|
||||
world.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F);
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class BlockToggleableLight extends Block {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return this.isOn ? null : super.getItemToRegister();
|
||||
protected boolean hasRegisteredItem() {
|
||||
return !this.isOn;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -649,8 +649,8 @@ public class BlockTripWire extends Block
|
|||
return new Property[] {DISARMED, POWERED};
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return super.getItemToRegister().setMaxAmount(StackSize.XXXL);
|
||||
public StackSize getMaxStackSize() {
|
||||
return StackSize.XXXL;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.init.Blocks;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemBlock;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
|
|
@ -535,8 +535,8 @@ public class BlockWire extends Block
|
|||
return wire_none;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return super.getItemToRegister().setMaxAmount(StackSize.XL);
|
||||
public StackSize getMaxStackSize() {
|
||||
return StackSize.XL;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
package common.block.tile;
|
||||
|
||||
import common.block.Block;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemSign;
|
||||
import common.item.ItemStack;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyInteger;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntitySign;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -16,6 +23,7 @@ public class BlockStandingSign extends BlockSign
|
|||
public BlockStandingSign()
|
||||
{
|
||||
this.setDefaultState(this.getBaseState().withProperty(ROTATION, Integer.valueOf(0)));
|
||||
this.setTab(CheatTab.DECORATION);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -36,8 +44,60 @@ public class BlockStandingSign extends BlockSign
|
|||
{
|
||||
return new Property[] {ROTATION};
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemSign(this).setDisplay("Schild");
|
||||
}
|
||||
|
||||
public boolean place(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side == Facing.DOWN)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!worldIn.getState(pos).getBlock().getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
|
||||
if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.canPlaceBlockAt(worldIn, pos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (worldIn.client)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (side == Facing.UP)
|
||||
{
|
||||
int i = ExtMath.floord((double)((playerIn.rotYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15;
|
||||
worldIn.setState(pos, Blocks.sign.getState().withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldIn.setState(pos, Blocks.wall_sign.getState().withProperty(BlockWallSign.FACING, side), 3);
|
||||
}
|
||||
|
||||
stack.decrSize();
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
|
||||
if (tileentity instanceof TileEntitySign)
|
||||
{
|
||||
playerIn.connection.show((TileEntitySign)tileentity);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
return side != Facing.DOWN && worldIn.getState(pos).getBlock().getMaterial().isSolid();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class BlockWallSign extends BlockSign implements Rotatable
|
|||
return new Property[] {FACING};
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
protected boolean hasRegisteredItem() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import common.entity.DamageSource;
|
|||
import common.entity.Entity;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.tool.ItemAxe;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.rng.Random;
|
||||
|
|
|
@ -2,11 +2,11 @@ package common.enchantment;
|
|||
|
||||
import common.attributes.UsageSlot;
|
||||
import common.item.Item;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.item.tool.ItemBow;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.tool.ItemFishingRod;
|
||||
import common.item.tool.ItemSword;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemSword;
|
||||
|
||||
public enum EnchantmentType
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ import common.init.Items;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemFishFood;
|
||||
import common.item.consumable.ItemFishFood;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.tags.TagObject;
|
||||
import common.vars.Vars;
|
||||
|
|
|
@ -45,7 +45,7 @@ public class EntityChicken extends EntityAnimal {
|
|||
this.tasks.addTask(0, new EntityAISwimming(this));
|
||||
this.tasks.addTask(1, new EntityAIPanic(this, 1.4D));
|
||||
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.wheat, false));
|
||||
this.tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.wheat_seed, false));
|
||||
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
|
||||
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(6, new EntityAIWatchClosest(this, null, 6.0F));
|
||||
|
@ -135,7 +135,7 @@ public class EntityChicken extends EntityAnimal {
|
|||
}
|
||||
|
||||
public boolean isBreedingItem(ItemStack stack) {
|
||||
return stack != null && stack.getItem() == Items.wheat;
|
||||
return stack != null && stack.getItem() == Items.wheat_seed;
|
||||
}
|
||||
|
||||
public void readEntity(TagObject tag) {
|
||||
|
|
|
@ -28,7 +28,7 @@ public class EntityCow extends EntityAnimal
|
|||
this.tasks.addTask(0, new EntityAISwimming(this));
|
||||
this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
|
||||
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheats, false));
|
||||
this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false));
|
||||
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
|
||||
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(6, new EntityAIWatchClosest(this, null, 6.0F));
|
||||
|
|
|
@ -27,8 +27,8 @@ import common.inventory.IInvBasic;
|
|||
import common.inventory.InventoryBasic;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemHorseArmor;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.tool.ItemHorseArmor;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.tags.TagObject;
|
||||
import java.util.List;
|
||||
|
@ -815,7 +815,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
|||
int j = 0;
|
||||
int k = 0;
|
||||
|
||||
if (itemstack.getItem() == Items.wheats)
|
||||
if (itemstack.getItem() == Items.wheat)
|
||||
{
|
||||
hp = 2;
|
||||
j = 20;
|
||||
|
@ -827,7 +827,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
|||
j = 30;
|
||||
k = 3;
|
||||
}
|
||||
else if (itemstack.getItem().getBlock() == Blocks.hay_block)
|
||||
else if (itemstack.getItem() == Items.hay_block)
|
||||
{
|
||||
hp = 20;
|
||||
j = 180;
|
||||
|
|
|
@ -477,7 +477,7 @@ public class EntityRabbit extends EntityAnimal {
|
|||
Block block = state.getBlock();
|
||||
if(Vars.rabidRabbits)
|
||||
return block != Blocks.bedrock;
|
||||
return block == Blocks.carrot || block == Blocks.potato || block == Blocks.wheat || block == Blocks.brown_mushroom ||
|
||||
return block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.wheats || block == Blocks.brown_mushroom ||
|
||||
block instanceof BlockFlower || block == Blocks.blue_mushroom ||
|
||||
block == Blocks.tallgrass;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class EntitySheep extends EntityAnimal
|
|||
this.tasks.addTask(0, new EntityAISwimming(this));
|
||||
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
|
||||
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheats, false));
|
||||
this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false));
|
||||
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
|
||||
this.tasks.addTask(5, this.entityAIEatGrass);
|
||||
this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
|
||||
|
|
|
@ -27,8 +27,8 @@ import common.init.Items;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.consumable.ItemFood;
|
||||
import common.item.material.ItemDye;
|
||||
import common.item.tool.ItemFood;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.tags.TagObject;
|
||||
import common.util.ExtMath;
|
||||
|
|
|
@ -6,7 +6,7 @@ import common.entity.effect.EntityLightning;
|
|||
import common.entity.types.EntityLiving;
|
||||
import common.init.Items;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.item.consumable.ItemPotion;
|
||||
import common.rng.Random;
|
||||
import common.util.ExtMath;
|
||||
import common.world.World;
|
||||
|
|
|
@ -62,15 +62,15 @@ import common.inventory.InventoryWarpChest;
|
|||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.item.tool.ItemBow;
|
||||
import common.item.tool.ItemGunBase;
|
||||
import common.item.consumable.ItemPotion;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.tool.ItemHoe;
|
||||
import common.item.tool.ItemKey;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemSword;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemGunBase;
|
||||
import common.item.weapon.ItemSword;
|
||||
import common.network.IClientPlayer;
|
||||
import common.network.IPlayer;
|
||||
import common.packet.CPacketPlayerPosition;
|
||||
|
|
|
@ -7,7 +7,7 @@ import common.entity.types.EntityThrowable;
|
|||
import common.entity.types.IObjectData;
|
||||
import common.init.SoundEvent;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemDie;
|
||||
import common.item.projectile.ItemDie;
|
||||
import common.tags.TagObject;
|
||||
import common.util.HitPosition;
|
||||
import common.world.World;
|
||||
|
|
|
@ -10,7 +10,7 @@ import common.entity.types.IObjectData;
|
|||
import common.init.ItemRegistry;
|
||||
import common.init.Items;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.item.consumable.ItemPotion;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
|
|
|
@ -153,7 +153,7 @@ public abstract class EntityAnimal extends EntityLiving
|
|||
*/
|
||||
public boolean isBreedingItem(ItemStack stack)
|
||||
{
|
||||
return stack == null ? false : stack.getItem() == Items.wheats;
|
||||
return stack == null ? false : stack.getItem() == Items.wheat;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,8 +42,8 @@ import common.init.Items;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.network.IPlayer;
|
||||
import common.packet.SPacketEntityAttach;
|
||||
import common.packet.SPacketAnimation;
|
||||
|
|
|
@ -377,10 +377,10 @@ public abstract class BlockRegistry {
|
|||
|
||||
Block pumpkin = (new BlockPumpkin()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbis");
|
||||
register("pumpkin", pumpkin);
|
||||
register("pumpkin_stem", (new BlockStem(pumpkin, "Kürbiskerne")).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbisstamm"));
|
||||
register("pumpkin_stem", (new BlockStem(pumpkin)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Kürbisstamm"));
|
||||
Block melon = (new BlockMelon()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Melone");
|
||||
register("melon_block", melon);
|
||||
register("melon_stem", (new BlockStem(melon, "Melonenkerne")).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Melonenstamm"));
|
||||
register("melon_stem", (new BlockStem(melon)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Melonenstamm"));
|
||||
|
||||
|
||||
register("dry_leaves", (new BlockDryLeaves()).setDisplay("Vertrocknetes Laub"));
|
||||
|
@ -441,7 +441,6 @@ public abstract class BlockRegistry {
|
|||
register("sponge", (new Block(Material.LOOSE)).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwamm")
|
||||
.setTab(CheatTab.DECORATION));
|
||||
register("skull", (new BlockSkull()).setHardness(1.0F).setStepSound(SoundType.STONE).setDisplay("Schädel").setTab(CheatTab.DECORATION));
|
||||
register("lit_pumpkin", (new BlockPumpkin()).setHardness(1.0F).setStepSound(SoundType.WOOD).setLightLevel(1.0F).setDisplay("Kürbislaterne"));
|
||||
register("hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(SoundType.GRASS).setDisplay("Strohballen")
|
||||
.setTab(CheatTab.DECORATION));
|
||||
register("sign", (new BlockStandingSign()).setHardness(1.0F).setStepSound(SoundType.WOOD).setDisplay("Schild"));
|
||||
|
@ -461,10 +460,10 @@ public abstract class BlockRegistry {
|
|||
|
||||
register("farmland", (new BlockFarmland()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ackerboden")
|
||||
.setShovelHarvestable().setTab(CheatTab.PLANTS));
|
||||
register("wheat", (new BlockCrops()).setDisplay("Getreide"));
|
||||
register("carrot", (new BlockCarrot()).setDisplay("Karotten"));
|
||||
register("potato", (new BlockPotato()).setDisplay("Kartoffeln"));
|
||||
register("soul_wart", (new BlockWart()).setDisplay("Seelenwarze"));
|
||||
register("wheats", (new BlockCrops()).setDisplay("Getreide"));
|
||||
register("carrots", (new BlockCarrot()).setDisplay("Karotten"));
|
||||
register("potatoes", (new BlockPotato()).setDisplay("Kartoffeln"));
|
||||
register("soul_warts", (new BlockWart()).setDisplay("Seelenwarze"));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ public abstract class Blocks {
|
|||
public static final BlockCake cake = get("cake");
|
||||
public static final Block calcium_block = get("calcium_block");
|
||||
public static final BlockOre calcium_ore = get("calcium_ore");
|
||||
public static final BlockCarrot carrot = get("carrot");
|
||||
public static final BlockCarrot carrots = get("carrots");
|
||||
public static final BlockSandStone carved_sandstone = get("carved_sandstone");
|
||||
public static final Block carved_stonebrick = get("carved_stonebrick");
|
||||
public static final BlockCauldron cauldron = get("cauldron");
|
||||
|
@ -304,7 +304,6 @@ public abstract class Blocks {
|
|||
public static final BlockStainedGlassPane lime_glass_pane = get("lime_glass_pane");
|
||||
public static final BlockWool lime_wool = get("lime_wool");
|
||||
public static final BlockFurnace lit_furnace = get("lit_furnace");
|
||||
public static final BlockPumpkin lit_pumpkin = get("lit_pumpkin");
|
||||
public static final Block lithium_block = get("lithium_block");
|
||||
public static final BlockOre lithium_ore = get("lithium_ore");
|
||||
public static final BlockCarpet magenta_carpet = get("magenta_carpet");
|
||||
|
@ -396,7 +395,7 @@ public abstract class Blocks {
|
|||
public static final BlockPortalFrame portal_frame = get("portal_frame");
|
||||
public static final Block potassium_block = get("potassium_block");
|
||||
public static final BlockOre potassium_ore = get("potassium_ore");
|
||||
public static final BlockPotato potato = get("potato");
|
||||
public static final BlockPotato potatoes = get("potatoes");
|
||||
public static final Block praseodymium_block = get("praseodymium_block");
|
||||
public static final BlockOre praseodymium_ore = get("praseodymium_ore");
|
||||
public static final BlockPumpkin pumpkin = get("pumpkin");
|
||||
|
@ -462,7 +461,7 @@ public abstract class Blocks {
|
|||
public static final BlockOre sodium_ore = get("sodium_ore");
|
||||
public static final BlockSoulFire soul_fire = get("soul_fire");
|
||||
public static final BlockSoulSand soul_sand = get("soul_sand");
|
||||
public static final BlockWart soul_wart = get("soul_wart");
|
||||
public static final BlockWart soul_warts = get("soul_warts");
|
||||
public static final Block sponge = get("sponge");
|
||||
public static final BlockStaticLiquid springwater = get("springwater");
|
||||
public static final BlockDoor spruce_door = get("spruce_door");
|
||||
|
@ -537,7 +536,7 @@ public abstract class Blocks {
|
|||
public static final BlockStaticLiquid water = get("water");
|
||||
public static final BlockLilyPad waterlily = get("waterlily");
|
||||
public static final BlockWeb web = get("web");
|
||||
public static final BlockCrops wheat = get("wheat");
|
||||
public static final BlockCrops wheats = get("wheats");
|
||||
public static final BlockBed white_bed = get("white_bed");
|
||||
public static final BlockCarpet white_carpet = get("white_carpet");
|
||||
public static final BlockColoredClay white_clay = get("white_clay");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package common.init;
|
||||
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.item.consumable.ItemPotion;
|
||||
|
||||
public abstract class BrewingRegistry {
|
||||
public static ItemPotion applyIngredient(ItemPotion potion, ItemStack ingredient) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class CraftingRegistry
|
|||
{Items.lapis_block, new ItemStack(Items.lapis_lazuli, 9)},
|
||||
{Items.charged_block, new ItemStack(Items.charged_powder, 9)},
|
||||
{Items.coal_block, new ItemStack(Items.coal, 9)},
|
||||
{Items.hay_block, new ItemStack(Items.wheats, 9)},
|
||||
{Items.hay_block, new ItemStack(Items.wheat, 9)},
|
||||
{Items.slime_block, new ItemStack(Items.slime_ball, 9)}
|
||||
};
|
||||
|
||||
|
@ -134,10 +134,10 @@ public abstract class CraftingRegistry
|
|||
add(new ItemStack(Items.gold_nugget, 9), "#", '#', Items.gold_ingot);
|
||||
|
||||
addShapeless(new ItemStack(Items.mushroom_stew), Items.brown_mushroom, Items.red_mushroom, Items.bowl);
|
||||
add(new ItemStack(Items.cookie, 8), "#X#", 'X', Items.cocoa_powder, '#', Items.wheats);
|
||||
add(new ItemStack(Items.cookie, 8), "#X#", 'X', Items.cocoa_powder, '#', Items.wheat);
|
||||
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', Items.pumpkin);
|
||||
add(new ItemStack(Items.melon_seed), "M", 'M', Items.melon);
|
||||
add(new ItemStack(Items.pumpkin_seed, 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.demon_rod);
|
||||
|
@ -266,22 +266,21 @@ public abstract class CraftingRegistry
|
|||
|
||||
add(new ItemStack(Items.iron_door, 3), "##", "##", "##", '#', 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.cake, 1), "AAA", "BEB", "CCC", 'A', Items.milk_bucket, 'B', Items.sugar, 'C', Items.wheat, 'E', Items.egg);
|
||||
add(new ItemStack(Items.sugar, 1), "#", '#', Items.reeds);
|
||||
|
||||
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.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.minecart, 1), "# #", "###", '#', Items.iron_ingot);
|
||||
add(new ItemStack(Items.cauldron, 1), "# #", "# #", "###", '#', Items.iron_ingot);
|
||||
add(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Items.cobblestone, 'B', Items.demon_rod);
|
||||
add(new ItemStack(Items.lit_pumpkin, 1), "A", "B", 'A', Items.pumpkin, 'B', Items.torch);
|
||||
add(new ItemStack(Items.tnt_minecart, 1), "A", "B", 'A', Items.tnt, 'B', Items.minecart);
|
||||
add(new ItemStack(Items.bucket, 1), "# #", " # ", '#', Items.iron_ingot);
|
||||
add(new ItemStack(Items.flowerpot, 1), "# #", " # ", '#', Items.brick);
|
||||
addShapeless(new ItemStack(Items.lighter, 1), new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1));
|
||||
add(new ItemStack(Items.bread, 1), "###", '#', Items.wheats);
|
||||
add(new ItemStack(Items.bread, 1), "###", '#', Items.wheat);
|
||||
|
||||
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);
|
||||
|
|
|
@ -23,65 +23,64 @@ import common.enchantment.Enchantment;
|
|||
import common.entity.npc.CharacterInfo;
|
||||
import common.entity.npc.SpeciesInfo;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemEffect;
|
||||
import common.item.ItemFragile;
|
||||
import common.item.ItemMagnetic;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.consumable.ItemAppleGold;
|
||||
import common.item.consumable.ItemBucketMilk;
|
||||
import common.item.consumable.ItemFishFood;
|
||||
import common.item.consumable.ItemFood;
|
||||
import common.item.consumable.ItemPotion;
|
||||
import common.item.consumable.ItemSeedFood;
|
||||
import common.item.consumable.ItemSoup;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.material.ItemBook;
|
||||
import common.item.material.ItemBottle;
|
||||
import common.item.material.ItemBucket;
|
||||
import common.item.material.ItemDye;
|
||||
import common.item.material.ItemEnchantedBook;
|
||||
import common.item.material.ItemHorseArmor;
|
||||
import common.item.material.ItemMetal;
|
||||
import common.item.material.ItemRecord;
|
||||
import common.item.material.ItemSeeds;
|
||||
import common.item.projectile.ItemChargedOrb;
|
||||
import common.item.projectile.ItemDie;
|
||||
import common.item.projectile.ItemDynamite;
|
||||
import common.item.projectile.ItemEgg;
|
||||
import common.item.projectile.ItemExpBottle;
|
||||
import common.item.projectile.ItemFireball;
|
||||
import common.item.projectile.ItemSnowball;
|
||||
import common.item.spawner.ItemBoat;
|
||||
import common.item.spawner.ItemMinecart;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.item.tool.ItemAmmo;
|
||||
import common.item.tool.ItemAppleGold;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.item.tool.ItemArrow;
|
||||
import common.item.tool.ItemAxe;
|
||||
import common.item.tool.ItemBanHammer;
|
||||
import common.item.tool.ItemBoltgun;
|
||||
import common.item.tool.ItemBow;
|
||||
import common.item.tool.ItemBucket;
|
||||
import common.item.tool.ItemBucketMilk;
|
||||
import common.item.tool.ItemCamera;
|
||||
import common.item.tool.ItemCarrotOnAStick;
|
||||
import common.item.tool.ItemChargedOrb;
|
||||
import common.item.tool.ItemDie;
|
||||
import common.item.tool.ItemDynamite;
|
||||
import common.item.tool.ItemEditor;
|
||||
import common.item.tool.ItemEgg;
|
||||
import common.item.tool.ItemExpBottle;
|
||||
import common.item.tool.ItemExterminator;
|
||||
import common.item.tool.ItemFireball;
|
||||
import common.item.tool.ItemRocketLauncher;
|
||||
import common.item.tool.ItemFishFood;
|
||||
import common.item.tool.ItemFishingRod;
|
||||
import common.item.tool.ItemFire;
|
||||
import common.item.tool.ItemFood;
|
||||
import common.item.tool.ItemGlassBottle;
|
||||
import common.item.tool.ItemHoe;
|
||||
import common.item.tool.ItemHorseArmor;
|
||||
import common.item.tool.ItemScanner;
|
||||
import common.item.tool.ItemKey;
|
||||
import common.item.tool.ItemLead;
|
||||
import common.item.tool.ItemTrident;
|
||||
import common.item.tool.ItemMagnet;
|
||||
import common.item.tool.ItemNameTag;
|
||||
import common.item.tool.ItemPickaxe;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.item.tool.ItemSaddle;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemShovel;
|
||||
import common.item.tool.ItemSnowball;
|
||||
import common.item.tool.ItemSoup;
|
||||
import common.item.tool.ItemSpaceNavigator;
|
||||
import common.item.tool.ItemSword;
|
||||
import common.item.tool.ItemWeatherToken;
|
||||
import common.item.weapon.ItemAmmo;
|
||||
import common.item.weapon.ItemArrow;
|
||||
import common.item.weapon.ItemBanHammer;
|
||||
import common.item.weapon.ItemBoltgun;
|
||||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemExterminator;
|
||||
import common.item.weapon.ItemRocketLauncher;
|
||||
import common.item.weapon.ItemSword;
|
||||
import common.item.weapon.ItemTrident;
|
||||
import common.log.Log;
|
||||
import common.util.Pair;
|
||||
import common.util.Util;
|
||||
|
@ -240,7 +239,7 @@ public abstract class ItemRegistry {
|
|||
register("mushroom_stew", (new ItemSoup(6)).setDisplay("Pilzsuppe"));
|
||||
register("feather", (new Item()).setDisplay("Feder").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XXL));
|
||||
register("gunpowder", (new Item()).setDisplay("Schwarzpulver").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL));
|
||||
register("wheats", (new Item()).setDisplay("Weizen").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.L));
|
||||
register("wheat", (new Item()).setDisplay("Weizen").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.L));
|
||||
register("bread", (new ItemFood(5, false)).setDisplay("Brot"));
|
||||
register("flint", (new Item()).setDisplay("Feuerstein").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.L));
|
||||
register("porkchop", (new ItemFood(3, true)).setDisplay("Rohes Schweinefleisch"));
|
||||
|
@ -284,11 +283,11 @@ public abstract class ItemRegistry {
|
|||
register("chicken", (new ItemFood(2, true)).setDisplay("Rohes Hühnchen"));
|
||||
register("cooked_chicken", (new ItemFood(6, true)).setDisplay("Gebratenes Hühnchen"));
|
||||
register("rotten_flesh", (new ItemFood(4, true)).setDisplay("Verrottetes Fleisch"));
|
||||
register("orb", (new ItemFragile()).setDisplay("Kugel").setTab(CheatTab.MAGIC));
|
||||
register("orb", (new Item()).setDisplay("Kugel").setTab(CheatTab.MAGIC).setFragile());
|
||||
register("demon_rod", (new Item()).setDisplay("Dämonenrute").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL));
|
||||
register("gold_coin", (new Item()).setDisplay("Goldmünze").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL));
|
||||
register("gold_nugget", (new Item()).setDisplay("Goldnugget").setTab(CheatTab.METALS).setMaxAmount(StackSize.XL));
|
||||
register("glass_bottle", (new ItemGlassBottle()).setDisplay("Glasflasche"));
|
||||
register("bottle", (new ItemBottle()).setDisplay("Flasche"));
|
||||
for(Pair<String, Effect> pot : ItemPotion.getBasePotions()) {
|
||||
register(pot.first(), new ItemPotion(pot.second(), null));
|
||||
}
|
||||
|
@ -311,12 +310,21 @@ public abstract class ItemRegistry {
|
|||
register("written_book", (new Item()).setDisplay("Beschriebenes Buch").setTab(CheatTab.MISC));
|
||||
Item emerald = (new Item()).setDisplay("Smaragd").setTab(CheatTab.METALS);
|
||||
register("emerald", emerald);
|
||||
|
||||
|
||||
register("carrot", new ItemSeedFood(3, Blocks.carrots, Blocks.farmland).setDisplay("Karotte").setMaxAmount(StackSize.L));
|
||||
register("potato", new ItemSeedFood(1, Blocks.potatoes, Blocks.farmland).setDisplay("Kartoffel").setMaxAmount(StackSize.L));
|
||||
register("wheat_seed", new ItemSeeds(Blocks.wheats, Blocks.farmland).setDisplay("Weizenkörner").setMaxAmount(StackSize.XL));
|
||||
register("soul_wart", new ItemSeeds(Blocks.soul_warts, Blocks.soul_sand).setDisplay("Seelenwarze").setMaxAmount(StackSize.L));
|
||||
register("pumpkin_seed", new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland).setDisplay("Kürbiskerne").setMaxAmount(StackSize.XL));
|
||||
register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL));
|
||||
|
||||
register("baked_potato", (new ItemFood(5, false)).setDisplay("Ofenkartoffel").setMaxAmount(StackSize.L));
|
||||
register("poisonous_potato", (new ItemFood(2, false)).setPotionEffect(Effect.POISON, 5, 0, 0.6F).setDisplay("Giftige Kartoffel").setMaxAmount(StackSize.L));
|
||||
register("golden_carrot", (new ItemFood(6, false)).setDisplay("Goldene Karotte")
|
||||
);
|
||||
register("carrot_on_a_stick", (new ItemCarrotOnAStick()).setDisplay("Karottenrute"));
|
||||
register("charge_crystal", (new ItemEffect()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DMAGENTA));
|
||||
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DMAGENTA).setGleaming());
|
||||
register("pumpkin_pie", (new ItemFood(8, false)).setDisplay("Kürbiskuchen").setTab(CheatTab.FOOD));
|
||||
for(Enchantment ench : Enchantment.values()) {
|
||||
register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS));
|
||||
|
@ -337,8 +345,8 @@ public abstract class ItemRegistry {
|
|||
for(int z = 0; z < ItemDynamite.DYNAMITE.length; z++) {
|
||||
register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED));
|
||||
}
|
||||
register("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS));
|
||||
Item chargedPowder = (new ItemMagnetic()).setDisplay("Geladener Staub").setTab(CheatTab.METALS);
|
||||
register("chain", (new Item()).setDisplay("Kette").setTab(CheatTab.MATERIALS).setMagnetic());
|
||||
Item chargedPowder = (new Item()).setDisplay("Geladener Staub").setTab(CheatTab.METALS).setMagnetic();
|
||||
register("charged_powder", chargedPowder);
|
||||
|
||||
for(OreType ore : OreType.values()) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,7 @@ import java.util.Map.Entry;
|
|||
import common.collect.Maps;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemFishFood;
|
||||
import common.item.consumable.ItemFishFood;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public abstract class TradeRegistry {
|
|||
}
|
||||
|
||||
public static final ITradeList[] TRADES = new ITradeList[] {
|
||||
new GemForItem(Items.wheats, new PriceInfo(18, 22)),
|
||||
new GemForItem(Items.wheat, new PriceInfo(18, 22)),
|
||||
new GemForItem(Items.potato, new PriceInfo(15, 19)),
|
||||
new GemForItem(Items.carrot, new PriceInfo(15, 19)),
|
||||
new ItemForGem(Items.bread, new PriceInfo(-4, -2)),
|
||||
|
|
|
@ -4,7 +4,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.init.BrewingRegistry;
|
||||
import common.init.Items;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.item.consumable.ItemPotion;
|
||||
import common.network.IPlayer;
|
||||
|
||||
public class ContainerBrewingStand extends Container
|
||||
|
@ -205,7 +205,7 @@ public class ContainerBrewingStand extends Container
|
|||
|
||||
public static boolean canHoldPotion(ItemStack stack)
|
||||
{
|
||||
return stack != null && (stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle);
|
||||
return stack != null && (stack.getItem() instanceof ItemPotion || stack.getItem() == Items.bottle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.collect.Lists;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.init.CraftingRegistry;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.item.material.ItemArmor;
|
||||
|
||||
public class ContainerPlayer extends Container {
|
||||
private final InventoryCrafting baseCrafting = new InventoryCrafting(new Container() {
|
||||
|
|
|
@ -4,7 +4,7 @@ import common.block.Block;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.tags.TagObject;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ import common.util.Vec3;
|
|||
import common.world.World;
|
||||
|
||||
public class Item {
|
||||
private final Block block;
|
||||
|
||||
private int maxAmount = StackSize.M.getAmount();
|
||||
private int maxDamage = 0;
|
||||
private Item containerItem;
|
||||
|
@ -30,6 +32,25 @@ public class Item {
|
|||
private CheatTab tab;
|
||||
private TextColor color = null;
|
||||
private int defColor = 0xffffffff;
|
||||
private boolean magnetic = false;
|
||||
private boolean gleaming = false;
|
||||
private boolean fragile = false;
|
||||
|
||||
public Item() {
|
||||
this.block = null;
|
||||
}
|
||||
|
||||
public Item(Block block) {
|
||||
this.block = block;
|
||||
this.setDisplay(this.block.getDisplay());
|
||||
this.setTab(this.block.getTab());
|
||||
if(this.block.isMagnetic())
|
||||
this.setMagnetic();
|
||||
if(this.block.getMaxStackSize() != null)
|
||||
this.setMaxAmount(this.block.getMaxStackSize());
|
||||
if(this.block.getItemColor() != null)
|
||||
this.setColor(this.block.getItemColor());
|
||||
}
|
||||
|
||||
public final Item setUnstackable() {
|
||||
this.maxAmount = 1;
|
||||
|
@ -49,7 +70,7 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Item setDisplay(String name) {
|
||||
public final Item setDisplay(String name) {
|
||||
this.display = name;
|
||||
return this;
|
||||
}
|
||||
|
@ -64,11 +85,30 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Item setColor(TextColor color) {
|
||||
public final Item setColor(TextColor color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Item setMagnetic() {
|
||||
this.magnetic = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Item setGleaming() {
|
||||
this.gleaming = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Item setFragile() {
|
||||
this.fragile = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Block getBlock() {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
public final int getMaxAmount() {
|
||||
return this.maxAmount;
|
||||
}
|
||||
|
@ -101,7 +141,19 @@ public class Item {
|
|||
return this.tab;
|
||||
}
|
||||
|
||||
protected final HitPosition getMovingObjectPositionFromPlayer(World worldIn, EntityNPC playerIn, boolean useLiquids) {
|
||||
public final boolean isMagnetic() {
|
||||
return this.magnetic;
|
||||
}
|
||||
|
||||
public final boolean hasEffect(ItemStack stack) {
|
||||
return this.gleaming || stack.isItemEnchanted();
|
||||
}
|
||||
|
||||
public final boolean isFragile() {
|
||||
return this.fragile;
|
||||
}
|
||||
|
||||
public static final HitPosition getMovingObjectPositionFromPlayer(World worldIn, EntityNPC playerIn, boolean useLiquids) {
|
||||
float f = playerIn.rotPitch;
|
||||
float f1 = playerIn.rotYaw;
|
||||
double d0 = playerIn.posX;
|
||||
|
@ -131,12 +183,8 @@ public class Item {
|
|||
return stack;
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) {
|
||||
return false;
|
||||
return this.block != null && this.block.place(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
||||
|
@ -152,6 +200,8 @@ public class Item {
|
|||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn) {
|
||||
if(this.block != null)
|
||||
this.block.prePlace(itemStackIn, worldIn, playerIn);
|
||||
return itemStackIn;
|
||||
}
|
||||
|
||||
|
@ -175,13 +225,6 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass) {
|
||||
if(renderPass > 0)
|
||||
return 16777215;
|
||||
int i = stack.getDyeColor();
|
||||
return i < 0 ? 16777215 : i;
|
||||
}
|
||||
|
||||
public ItemAction getItemUseAction() {
|
||||
return ItemAction.NONE;
|
||||
}
|
||||
|
@ -198,10 +241,8 @@ public class Item {
|
|||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip) {
|
||||
}
|
||||
|
||||
public boolean hasEffect(ItemStack stack) {
|
||||
return stack.isItemEnchanted();
|
||||
if(this.block != null)
|
||||
this.block.addInformation(stack, playerIn, tooltip);
|
||||
}
|
||||
|
||||
public boolean canEnchant(ItemStack stack) {
|
||||
|
@ -221,18 +262,12 @@ public class Item {
|
|||
}
|
||||
|
||||
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot) {
|
||||
}
|
||||
|
||||
public boolean isFragile() {
|
||||
return false;
|
||||
if(this.block != null)
|
||||
this.block.getModifiers(map, slot);
|
||||
}
|
||||
|
||||
public float getRadiation(ItemStack stack) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return false;
|
||||
return this.block != null ? this.block.getRadiation() * (float)stack.getSize() : 0.0f;
|
||||
}
|
||||
|
||||
public boolean canRenderHand() {
|
||||
|
@ -251,12 +286,29 @@ public class Item {
|
|||
return stack.getColoredName();
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return Transform.IDENTITY;
|
||||
public int getRenderColor(ItemStack stack, int pass) {
|
||||
if(this.block != null && this.block.isItemColored())
|
||||
return this.block.getRenderColor(this.block.getState());
|
||||
if(pass > 0)
|
||||
return 16777215;
|
||||
int i = stack.getDyeColor();
|
||||
return i < 0 ? 16777215 : i;
|
||||
}
|
||||
|
||||
public boolean hasBuiltinModel() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String[] getTextures(String name) {
|
||||
return new String[] {name};
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), name);
|
||||
public Model getCustomModel(ModelProvider provider, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Transform getCustomTransform() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getSprites() {
|
||||
|
@ -268,7 +320,8 @@ public class Item {
|
|||
}
|
||||
|
||||
public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
BlockDispenser.dispense(world, 6.0, facing, position, stack.split(1));
|
||||
if(this.block == null || !this.block.dispense(world, source, position, blockpos, facing, stack))
|
||||
BlockDispenser.dispense(world, 6.0, facing, position, stack.split(1));
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package common.item;
|
||||
|
||||
public class ItemEffect extends Item
|
||||
{
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package common.item;
|
||||
|
||||
public class ItemFragile extends Item {
|
||||
public boolean isFragile() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package common.item;
|
||||
|
||||
public class ItemMagnetic extends Item {
|
||||
public boolean isMagnetic() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ import common.enchantment.EnchantmentHelper;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.ItemRegistry;
|
||||
import common.item.tool.ItemBow;
|
||||
import common.item.weapon.ItemBow;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.block.artificial.BlockPane;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BlockRegistry;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.Transform;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemBed extends Item
|
||||
{
|
||||
private final BlockBed bedBlock;
|
||||
|
||||
public ItemBed(BlockBed bedBlock)
|
||||
{
|
||||
this.bedBlock = bedBlock;
|
||||
this.setTab(CheatTab.DECORATION);
|
||||
this.setMaxAmount(StackSize.S);
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.bedBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a Block is right-clicked with this Item
|
||||
*/
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (side != Facing.UP)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
boolean flag = block.isReplaceable(worldIn, pos);
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
pos = pos.up();
|
||||
}
|
||||
|
||||
int i = ExtMath.floord((double)(playerIn.rotYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
Facing enumfacing = Facing.getHorizontal(i);
|
||||
BlockPos blockpos = pos.offset(enumfacing);
|
||||
|
||||
if (playerIn.canPlayerEdit(pos, side, stack) && playerIn.canPlayerEdit(blockpos, side, stack))
|
||||
{
|
||||
boolean flag1 = worldIn.getState(blockpos).getBlock().isReplaceable(worldIn, blockpos);
|
||||
boolean flag2 = flag || worldIn.isAirBlock(pos);
|
||||
boolean flag3 = flag1 || worldIn.isAirBlock(blockpos);
|
||||
|
||||
if (flag2 && flag3 && worldIn.isBlockSolid(pos.down()) && worldIn.isBlockSolid(blockpos.down()))
|
||||
{
|
||||
State iblockstate1 = this.bedBlock.getState() /* .withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)) */ .withProperty(BlockBed.FACING, enumfacing).withProperty(BlockBed.PART, BlockBed.EnumPartType.FOOT);
|
||||
|
||||
if (worldIn.setState(pos, iblockstate1, 3))
|
||||
{
|
||||
State iblockstate2 = iblockstate1.withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD);
|
||||
worldIn.setState(blockpos, iblockstate2, 3);
|
||||
}
|
||||
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return this.bedBlock.getTransform();
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.bedBlock.getModel(provider,
|
||||
BlockRegistry.getName(this.bedBlock), this.bedBlock.getState().withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD).withProperty(BlockBed.FACING, Facing.NORTH)), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.natural.BlockSnow;
|
||||
import common.color.TextColor;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.Transform;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemBlock extends Item
|
||||
{
|
||||
protected final Block block;
|
||||
|
||||
public ItemBlock(Block block)
|
||||
{
|
||||
this.block = block;
|
||||
this.setDisplay(this.block.getDisplay());
|
||||
this.setTab(this.block.getTab());
|
||||
}
|
||||
|
||||
public ItemBlock setDisplay(String unlocalizedName)
|
||||
{
|
||||
super.setDisplay(unlocalizedName);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBlock setColor(TextColor color)
|
||||
{
|
||||
super.setColor(color);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if(block == Blocks.snow_layer && iblockstate.getValue(BlockSnow.LAYERS).intValue() < 1)
|
||||
side = Facing.UP;
|
||||
else if (!block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack))
|
||||
{
|
||||
State iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, playerIn);
|
||||
|
||||
if (worldIn.setState(pos, iblockstate1, 3))
|
||||
{
|
||||
iblockstate1 = worldIn.getState(pos);
|
||||
|
||||
if (iblockstate1.getBlock() == this.block)
|
||||
{
|
||||
this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn);
|
||||
}
|
||||
|
||||
worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
Block block = worldIn.getState(pos).getBlock();
|
||||
|
||||
if (block == Blocks.snow_layer)
|
||||
{
|
||||
side = Facing.UP;
|
||||
}
|
||||
else if (!block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
||||
return worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack);
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.block;
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return this.block.isMagnetic();
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return this.block.getRenderType() == 2 ? super.getTransform() : (this.block.hasBlockFlatTexture() ? super.getTransform() : this.block.getTransform());
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
if(this.block.getRenderType() == 2)
|
||||
return provider.getModel(provider.getEntityModel(), this.getTransform());
|
||||
return this.block.hasBlockFlatTexture() ? provider.getModel(this.getTransform(), "blocks/" + this.block.getItemTexture(name)) :
|
||||
provider.getModel(this.block.getModel(provider,
|
||||
BlockRegistry.getName(this.block), this.block.getState()), this.getTransform());
|
||||
}
|
||||
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass) {
|
||||
return this.block.isItemColored() ? this.block.getRenderColor(this.block.getState()) : super.getColorFromItemStack(stack, renderPass);
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.tech.BlockButton;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemButton extends ItemBlock {
|
||||
private final BlockButton button;
|
||||
|
||||
public ItemButton(BlockButton block) {
|
||||
super(block);
|
||||
this.button = block;
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getModel(this.button.getTexture()).add(5, 6, 6, 11, 10, 10)
|
||||
.d().uv(5, 6, 11, 10).noCull().u().uv(5, 10, 11, 6).noCull()
|
||||
.ns().uv(5, 12, 11, 16).noCull().we().uv(6, 12, 10, 16).noCull(), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.Transform;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemDoor extends Item
|
||||
{
|
||||
private final BlockDoor block;
|
||||
|
||||
public ItemDoor(BlockDoor block)
|
||||
{
|
||||
this.block = block;
|
||||
this.setTab(block.getMaterial() == Material.WOOD ? CheatTab.WOOD : CheatTab.TECHNOLOGY);
|
||||
this.setDisplay(this.block.getDisplay());
|
||||
this.setMaxAmount(StackSize.S);
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a Block is right-clicked with this Item
|
||||
*/
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side != Facing.UP)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if (!block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
||||
if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.block.canPlaceBlockAt(worldIn, pos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
placeDoor(worldIn, pos, Facing.fromAngle((double)playerIn.rotYaw), this.block, true);
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void placeDoor(World worldIn, BlockPos pos, Facing facing, Block door, boolean update)
|
||||
{
|
||||
BlockPos blockpos = pos.offset(facing.rotateY());
|
||||
BlockPos blockpos1 = pos.offset(facing.rotateYCCW());
|
||||
int i = (worldIn.getState(blockpos1).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getState(blockpos1.up()).getBlock().isNormalCube() ? 1 : 0);
|
||||
int j = (worldIn.getState(blockpos).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getState(blockpos.up()).getBlock().isNormalCube() ? 1 : 0);
|
||||
boolean flag = worldIn.getState(blockpos1).getBlock() == door || worldIn.getState(blockpos1.up()).getBlock() == door;
|
||||
boolean flag1 = worldIn.getState(blockpos).getBlock() == door || worldIn.getState(blockpos.up()).getBlock() == door;
|
||||
boolean flag2 = false;
|
||||
|
||||
if (flag && !flag1 || j > i)
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
|
||||
BlockPos blockpos2 = pos.up();
|
||||
State iblockstate = door.getState().withProperty(BlockDoor.FACING, facing).withProperty(BlockDoor.HINGE, flag2 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT);
|
||||
worldIn.setState(pos, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2);
|
||||
worldIn.setState(blockpos2, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2);
|
||||
if(update) {
|
||||
worldIn.notifyNeighborsOfStateChange(pos, door);
|
||||
worldIn.notifyNeighborsOfStateChange(blockpos2, door);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return this.block == Blocks.iron_door;
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return this.block.getTransform();
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.block.getModel(provider,
|
||||
BlockRegistry.getName(this.block), this.block.getState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER).withProperty(BlockDoor.FACING, Facing.NORTH)), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
import common.color.Colorizer;
|
||||
import common.init.BlockRegistry;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemDoublePlant extends ItemBlock
|
||||
{
|
||||
private final BlockDoublePlant.EnumPlantType type;
|
||||
|
||||
public ItemDoublePlant(BlockDoublePlant block)
|
||||
{
|
||||
super(block);
|
||||
this.type = block.getType();
|
||||
this.setMaxAmount(StackSize.S);
|
||||
}
|
||||
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass)
|
||||
{
|
||||
return this.type != BlockDoublePlant.EnumPlantType.GRASS && this.type != BlockDoublePlant.EnumPlantType.FERN ? super.getColorFromItemStack(stack, renderPass) : Colorizer.getGrassColor(0.5D, 1.0D);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.block.getModel(provider,
|
||||
BlockRegistry.getName(this.block), this.block.getState().withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER)), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.artificial.BlockFence;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemFence extends ItemBlock {
|
||||
public ItemFence(BlockFence block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getModel(((BlockFence)this.block).getTexture())
|
||||
.add(6, 0, 0, 10, 16, 4)
|
||||
.d().uv(6, 0, 10, 4)
|
||||
.u().uv(6, 0, 10, 4).noCull()
|
||||
.n().uv(6, 0, 10, 16).noCull()
|
||||
.s().uv(6, 0, 10, 16).noCull()
|
||||
.w().uv(0, 0, 4, 16).noCull()
|
||||
.e().uv(0, 0, 4, 16).noCull()
|
||||
.add(6, 0, 12, 10, 16, 16)
|
||||
.d().uv(6, 12, 10, 16)
|
||||
.u().uv(6, 12, 10, 16).noCull()
|
||||
.n().uv(6, 0, 10, 16).noCull()
|
||||
.s().uv(6, 0, 10, 16).noCull()
|
||||
.w().uv(12, 0, 16, 16).noCull()
|
||||
.e().uv(12, 0, 16, 16).noCull()
|
||||
.add(7, 13, -2, 9, 15, 18)
|
||||
.d().uv(7, 0, 9, 16).noCull()
|
||||
.u().uv(7, 0, 9, 16).noCull()
|
||||
.n().uv(7, 1, 9, 3).noCull()
|
||||
.s().uv(7, 1, 9, 3).noCull()
|
||||
.w().uv(0, 1, 16, 3).noCull()
|
||||
.e().uv(0, 1, 16, 3).noCull()
|
||||
.add(7, 5, -2, 9, 7, 18)
|
||||
.d().uv(7, 0, 9, 16).noCull()
|
||||
.u().uv(7, 0, 9, 16).noCull()
|
||||
.n().uv(7, 9, 9, 11).noCull()
|
||||
.s().uv(7, 9, 9, 11).noCull()
|
||||
.w().uv(0, 9, 16, 11).noCull()
|
||||
.e().uv(0, 9, 16, 11).noCull(), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.foliage.BlockLilyPad;
|
||||
import common.block.liquid.BlockLiquid;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.item.ItemStack;
|
||||
import common.util.BlockPos;
|
||||
import common.util.HitPosition;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemLilyPad extends ItemBlock
|
||||
{
|
||||
public ItemLilyPad(BlockLilyPad block)
|
||||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
{
|
||||
HitPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, playerIn, true);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return itemStackIn;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (movingobjectposition.type == HitPosition.ObjectType.BLOCK)
|
||||
{
|
||||
BlockPos blockpos = movingobjectposition.block;
|
||||
|
||||
if (!World.isValidXZ(blockpos))
|
||||
{
|
||||
return itemStackIn;
|
||||
}
|
||||
|
||||
if (!playerIn.canPlayerEdit(blockpos.offset(movingobjectposition.side), movingobjectposition.side, itemStackIn))
|
||||
{
|
||||
return itemStackIn;
|
||||
}
|
||||
|
||||
BlockPos blockpos1 = blockpos.up();
|
||||
State iblockstate = worldIn.getState(blockpos);
|
||||
|
||||
if (iblockstate.getBlock().getMaterial().isColdLiquid() && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1))
|
||||
{
|
||||
worldIn.setState(blockpos1, Blocks.waterlily.getState().withProperty(BlockLilyPad.FACING, playerIn.getHorizontalFacing().getOpposite()));
|
||||
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
itemStackIn.decrSize();
|
||||
// }
|
||||
|
||||
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
|
||||
}
|
||||
}
|
||||
|
||||
return itemStackIn;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import common.attributes.Attribute;
|
||||
import common.attributes.UsageSlot;
|
||||
import common.block.Block;
|
||||
import common.block.artificial.BlockMetalBlock;
|
||||
import common.block.natural.BlockMetalOre;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.MetalType;
|
||||
import common.item.ItemStack;
|
||||
|
||||
public class ItemMetalBlock extends ItemBlock {
|
||||
private final MetalType metal;
|
||||
private final boolean ore;
|
||||
|
||||
private ItemMetalBlock(Block block, MetalType metal, boolean ore) {
|
||||
super(block);
|
||||
this.metal = metal;
|
||||
this.ore = ore;
|
||||
if(this.metal.radioactivity > 0.0f)
|
||||
this.setColor(TextColor.GREEN);
|
||||
}
|
||||
|
||||
public ItemMetalBlock(BlockMetalBlock block) {
|
||||
this(block, block.getMetal(), false);
|
||||
}
|
||||
|
||||
public ItemMetalBlock(BlockMetalOre block) {
|
||||
this(block, block.getMetal(), true);
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
tooltip.add(this.metal.formatSymbol());
|
||||
if(this.metal.radioactivity > 0.0f) {
|
||||
tooltip.add(this.metal.formatRadioactivity());
|
||||
}
|
||||
tooltip.add(this.metal.formatRarity());
|
||||
}
|
||||
|
||||
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot)
|
||||
{
|
||||
if((slot == null || slot == UsageSlot.INVENTORY) && this.metal.radioactivity > 0.0f)
|
||||
map.put(Attribute.RADIATION, this.metal.radioactivity * 4.0f * (this.ore ? 2.0f : 9.0f));
|
||||
}
|
||||
|
||||
public float getRadiation(ItemStack stack) {
|
||||
return this.metal.radioactivity * (this.ore ? 0.5f : 2.0f) * (float)stack.getSize();
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return this.metal.isMagnetic();
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.artificial.BlockPane;
|
||||
import common.init.BlockRegistry;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemPane extends ItemBlock
|
||||
{
|
||||
public ItemPane(BlockPane block)
|
||||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.block.getModel(provider,
|
||||
BlockRegistry.getName(this.block), this.block.getState().withProperty(BlockPane.NORTH, false).withProperty(BlockPane.SOUTH, false).withProperty(BlockPane.WEST, true).withProperty(BlockPane.EAST, true)), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.tech.BlockPistonBase;
|
||||
import common.init.Blocks;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemPiston extends ItemBlock
|
||||
{
|
||||
public ItemPiston(BlockPistonBase block)
|
||||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getModel("piston_side").add().nswe().d("piston_bottom").u("piston_top" + (this.block ==
|
||||
Blocks.sticky_piston ? "_sticky" : "")), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.tech.BlockBasePressurePlate;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemPressurePlate extends ItemBlock {
|
||||
public ItemPressurePlate(BlockBasePressurePlate block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getModel(((BlockBasePressurePlate)this.block).getTexture())
|
||||
.add(1, 6, 1, 15, 10, 15)
|
||||
.d().uv(1, 1, 15, 15).noCull()
|
||||
.u().uv(1, 1, 15, 15).noCull()
|
||||
.n().uv(1, 6, 15, 10).noCull()
|
||||
.s().uv(1, 6, 15, 10).noCull()
|
||||
.w().uv(1, 6, 15, 10).noCull()
|
||||
.e().uv(1, 6, 15, 10).noCull(), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.tile.BlockStandingSign;
|
||||
import common.block.tile.BlockWallSign;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntitySign;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemSign extends Item
|
||||
{
|
||||
private final BlockStandingSign block;
|
||||
|
||||
public ItemSign(BlockStandingSign block)
|
||||
{
|
||||
this.block = block;
|
||||
this.setTab(CheatTab.DECORATION);
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a Block is right-clicked with this Item
|
||||
*/
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side == Facing.DOWN)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!worldIn.getState(pos).getBlock().getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
|
||||
if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.block.canPlaceBlockAt(worldIn, pos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (worldIn.client)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (side == Facing.UP)
|
||||
{
|
||||
int i = ExtMath.floord((double)((playerIn.rotYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15;
|
||||
worldIn.setState(pos, Blocks.sign.getState().withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldIn.setState(pos, Blocks.wall_sign.getState().withProperty(BlockWallSign.FACING, side), 3);
|
||||
}
|
||||
|
||||
stack.decrSize();
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
|
||||
if (tileentity instanceof TileEntitySign)
|
||||
{
|
||||
playerIn.connection.show((TileEntitySign)tileentity);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getEntityModel(), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemSlab extends ItemBlock {
|
||||
private final BlockSlab slab;
|
||||
|
||||
public ItemSlab(BlockSlab slab) {
|
||||
super(slab);
|
||||
this.slab = slab;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) {
|
||||
return !stack.isEmpty() && playerIn.canPlayerEdit(pos.offset(side), side, stack) &&
|
||||
(this.tryVerticalPlace(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ) || super.onItemUse(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ));
|
||||
}
|
||||
|
||||
private boolean tryVerticalPlace(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) {
|
||||
if(hitY >= 0.34f && hitY <= 0.66f) {
|
||||
State state = worldIn.getState(pos);
|
||||
Block block = state.getBlock();
|
||||
if(!block.isReplaceable(worldIn, pos))
|
||||
pos = pos.offset(side);
|
||||
if(worldIn.canBlockBePlaced(this.slab, pos, false, side, null, stack)) {
|
||||
State place = this.slab.getState().withProperty(BlockSlab.FACING, playerIn.getHorizontalFacing());
|
||||
if(worldIn.setState(pos, place, 3)) {
|
||||
worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F),
|
||||
(double)((float)pos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.natural.BlockSnow;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemSnow extends ItemBlock
|
||||
{
|
||||
public ItemSnow(BlockSnow block)
|
||||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!playerIn.canPlayerEdit(pos, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
BlockPos blockpos = pos;
|
||||
|
||||
if ((side != Facing.UP || block != this.block) && !block.isReplaceable(worldIn, pos))
|
||||
{
|
||||
blockpos = pos.offset(side);
|
||||
iblockstate = worldIn.getState(blockpos);
|
||||
block = iblockstate.getBlock();
|
||||
}
|
||||
|
||||
if (block == this.block)
|
||||
{
|
||||
int i = ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue();
|
||||
|
||||
if (i <= 7)
|
||||
{
|
||||
State iblockstate1 = iblockstate.withProperty(BlockSnow.LAYERS, Integer.valueOf(i + 1));
|
||||
BoundingBox axisalignedbb = this.block.getCollisionBoundingBox(worldIn, blockpos, iblockstate1);
|
||||
|
||||
if (axisalignedbb != null && worldIn.checkNoEntityCollision(axisalignedbb) && worldIn.setState(blockpos, iblockstate1, 2))
|
||||
{
|
||||
worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, playerIn, worldIn, blockpos, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.tech.BlockTNT;
|
||||
import common.color.TextColor;
|
||||
import common.entity.item.EntityTnt;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.SoundEvent;
|
||||
import common.item.ItemStack;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.Vec3;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemTNT extends ItemBlock {
|
||||
private final int power;
|
||||
|
||||
public ItemTNT(BlockTNT block) {
|
||||
super(block);
|
||||
this.power = block.getExplosionPower();
|
||||
this.setColor(TextColor.RED);
|
||||
}
|
||||
|
||||
public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
blockpos = blockpos.offset(facing);
|
||||
EntityTnt entitytntprimed = new EntityTnt(world, (double)blockpos.getX() + 0.5D, (double)blockpos.getY(), (double)blockpos.getZ() + 0.5D, (EntityLiving)null, this.power);
|
||||
world.spawnEntityInWorld(entitytntprimed);
|
||||
world.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F);
|
||||
stack.decrSize();
|
||||
return stack;
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package common.item.block;
|
||||
|
||||
import common.block.artificial.BlockWall;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
|
||||
public class ItemWall extends ItemBlock {
|
||||
private final BlockWall wallBlock;
|
||||
|
||||
public ItemWall(BlockWall block) {
|
||||
super(block);
|
||||
this.wallBlock = block;
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(
|
||||
provider.getModel(this.wallBlock.getTexture())
|
||||
.add(4, 0, 4, 12, 16, 12)
|
||||
.d().uv(4, 4, 12, 12)
|
||||
.u().uv(4, 4, 12, 12).noCull()
|
||||
.n().uv(4, 0, 12, 16).noCull()
|
||||
.s().uv(4, 0, 12, 16).noCull()
|
||||
.w().uv(4, 0, 12, 16).noCull()
|
||||
.e().uv(4, 0, 12, 16).noCull()
|
||||
.add(5, 0, 0, 11, 13, 16)
|
||||
.d().uv(5, 0, 11, 16)
|
||||
.u().uv(5, 0, 11, 16).noCull()
|
||||
.n().uv(5, 3, 11, 16)
|
||||
.s().uv(5, 3, 11, 16)
|
||||
.w().uv(0, 3, 16, 16).noCull()
|
||||
.e().uv(0, 3, 16, 16).noCull(), this.getTransform());
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package common.item.tool;
|
||||
package common.item.consumable;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
|
@ -16,11 +16,8 @@ public class ItemAppleGold extends ItemFood
|
|||
super(amount, false);
|
||||
this.powered = powered;
|
||||
this.setColor(powered ? TextColor.MAGENTA : TextColor.NEON);
|
||||
}
|
||||
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return this.powered;
|
||||
if(this.powered)
|
||||
this.setGleaming();
|
||||
}
|
||||
|
||||
protected void onFoodEaten(ItemStack stack, World worldIn, EntityNPC player)
|
|
@ -1,4 +1,4 @@
|
|||
package common.item.tool;
|
||||
package common.item.consumable;
|
||||
|
||||
import java.util.Map;
|
||||
import common.attributes.Attribute;
|
||||
|
@ -17,6 +17,7 @@ public class ItemBucketMilk extends Item
|
|||
{
|
||||
this.setUnstackable();
|
||||
this.setTab(CheatTab.TOOLS);
|
||||
this.setMagnetic();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,8 +70,4 @@ public class ItemBucketMilk extends Item
|
|||
if(slot == null || slot == UsageSlot.INVENTORY)
|
||||
map.put(Attribute.RADIATION, -5.0f);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package common.item.tool;
|
||||
package common.item.consumable;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
|
@ -45,10 +45,6 @@ public class ItemFishFood extends ItemFood
|
|||
super.onFoodEaten(stack, worldIn, player);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), (this.cooked ? "cooked_" : "") + this.type.getName());
|
||||
}
|
||||
|
||||
public static enum FishType
|
||||
{
|
||||
COD("cod", "Kabeljau", 2, 5),
|
|
@ -1,4 +1,4 @@
|
|||
package common.item.tool;
|
||||
package common.item.consumable;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
|
@ -1,4 +1,4 @@
|
|||
package common.item.tool;
|
||||
package common.item.consumable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -74,6 +74,8 @@ public class ItemPotion extends Item
|
|||
this.setTab(CheatTab.POTIONS);
|
||||
this.setColor(TextColor.ORK);
|
||||
this.setDisplay(getDisplay(this));
|
||||
if(this.effect != null)
|
||||
this.setGleaming();
|
||||
POTIONS.add(this);
|
||||
}
|
||||
|
||||
|
@ -115,10 +117,10 @@ public class ItemPotion extends Item
|
|||
// {
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return new ItemStack(Items.glass_bottle);
|
||||
return new ItemStack(Items.bottle);
|
||||
}
|
||||
|
||||
playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
|
||||
playerIn.inventory.addItemStackToInventory(new ItemStack(Items.bottle));
|
||||
// }
|
||||
|
||||
return stack;
|
||||
|
@ -165,7 +167,7 @@ public class ItemPotion extends Item
|
|||
return this.effect == null ? 0x385dc6 : this.effect.getPotion().getColor();
|
||||
}
|
||||
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass)
|
||||
public int getRenderColor(ItemStack stack, int renderPass)
|
||||
{
|
||||
return renderPass > 0 ? 16777215 : this.getPotionColor();
|
||||
}
|
||||
|
@ -222,11 +224,6 @@ public class ItemPotion extends Item
|
|||
tooltip.add(TextColor.LGRAY + "Wirkungslos");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return this.effect != null;
|
||||
}
|
||||
|
||||
public static List<Pair<String, Effect>> getBasePotions() {
|
||||
List<Pair<String, Effect>> effects = Lists.newArrayList();
|
||||
|
@ -253,8 +250,8 @@ public class ItemPotion extends Item
|
|||
return effects;
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), "potion_overlay", "bottle");
|
||||
public String[] getTextures(String name) {
|
||||
return new String[] {"potion_overlay", "bottle"};
|
||||
}
|
||||
|
||||
public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
|
@ -1,11 +1,10 @@
|
|||
package common.item.block;
|
||||
package common.item.consumable;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.foliage.BlockCrops;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.CheatTab;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemFood;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.world.World;
|
||||
|
@ -20,17 +19,8 @@ public class ItemSeedFood extends ItemFood
|
|||
super(healAmount, false);
|
||||
this.crops = crops;
|
||||
this.soil = soil;
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.crops;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a Block is right-clicked with this Item
|
||||
*/
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side != Facing.UP)
|
|
@ -1,4 +1,4 @@
|
|||
package common.item.tool;
|
||||
package common.item.consumable;
|
||||
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Items;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue