update textures #1
This commit is contained in:
parent
4b313dd869
commit
a3ceadd0ff
100 changed files with 217 additions and 787 deletions
|
@ -1,8 +0,0 @@
|
|||
package common.block;
|
||||
|
||||
import common.properties.PropertyEnum;
|
||||
import common.util.Facing;
|
||||
|
||||
public interface DirectionalDown {
|
||||
public static final PropertyEnum<Facing> FACING = PropertyEnum.create("facing", Facing.class, Facing.DOWN, Facing.NORTH, Facing.SOUTH, Facing.WEST, Facing.EAST);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package common.block;
|
||||
|
||||
import common.properties.PropertyEnum;
|
||||
import common.util.Facing;
|
||||
|
||||
public interface DirectionalUp {
|
||||
public static final PropertyEnum<Facing> FACING = PropertyEnum.create("facing", Facing.class, Facing.UP, Facing.NORTH, Facing.SOUTH, Facing.WEST, Facing.EAST);
|
||||
}
|
|
@ -1,259 +0,0 @@
|
|||
package common.block.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Rotatable;
|
||||
import common.color.DyeColor;
|
||||
import common.block.Material;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.Blocks;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemDye;
|
||||
import common.model.BlockLayer;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
import common.model.Transform;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyInteger;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
import common.vars.Vars;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class BlockCocoa extends Block implements Rotatable, IGrowable
|
||||
{
|
||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 2);
|
||||
|
||||
public BlockCocoa()
|
||||
{
|
||||
super(Material.PLANT);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(AGE, Integer.valueOf(0)));
|
||||
this.setTickRandomly();
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (!this.canBlockStay(worldIn, pos, state))
|
||||
{
|
||||
this.dropBlock(worldIn, pos, state);
|
||||
}
|
||||
else if (Vars.cocoaGrowth > 0 && worldIn.rand.chance(Vars.cocoaGrowth))
|
||||
{
|
||||
int i = ((Integer)state.getValue(AGE)).intValue();
|
||||
|
||||
if (i < 2)
|
||||
{
|
||||
worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(i + 1)), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canBlockStay(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
pos = pos.offset((Facing)state.getValue(FACING));
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
return iblockstate.getBlock() == Blocks.jungle_log; // && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE;
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getSelectedBoundingBox(worldIn, pos);
|
||||
}
|
||||
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Facing enumfacing = (Facing)iblockstate.getValue(FACING);
|
||||
int i = ((Integer)iblockstate.getValue(AGE)).intValue();
|
||||
int j = 4 + i * 2;
|
||||
int k = 5 + i * 2;
|
||||
float f = (float)j / 2.0F;
|
||||
|
||||
switch (enumfacing)
|
||||
{
|
||||
case SOUTH:
|
||||
this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)k) / 16.0F, (15.0F - (float)j) / 16.0F, (8.0F + f) / 16.0F, 0.75F, 0.9375F);
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)k) / 16.0F, 0.0625F, (8.0F + f) / 16.0F, 0.75F, (1.0F + (float)j) / 16.0F);
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
this.setBlockBounds(0.0625F, (12.0F - (float)k) / 16.0F, (8.0F - f) / 16.0F, (1.0F + (float)j) / 16.0F, 0.75F, (8.0F + f) / 16.0F);
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
this.setBlockBounds((15.0F - (float)j) / 16.0F, (12.0F - (float)k) / 16.0F, (8.0F - f) / 16.0F, 0.9375F, 0.75F, (8.0F + f) / 16.0F);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
|
||||
*/
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, State state, EntityLiving placer)
|
||||
{
|
||||
Facing enumfacing = Facing.fromAngle((double)placer.rotYaw);
|
||||
worldIn.setState(pos, state.withProperty(FACING, enumfacing), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
if (!facing.getAxis().isHorizontal())
|
||||
{
|
||||
facing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, facing.getOpposite()).withProperty(AGE, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!this.canBlockStay(worldIn, pos, state))
|
||||
{
|
||||
this.dropBlock(worldIn, pos, state);
|
||||
}
|
||||
}
|
||||
|
||||
private void dropBlock(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
worldIn.setState(pos, Blocks.air.getState(), 3);
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
int i = ((Integer)state.getValue(AGE)).intValue();
|
||||
int j = 1;
|
||||
|
||||
if (i >= 2)
|
||||
{
|
||||
j = 3;
|
||||
}
|
||||
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this IGrowable can grow
|
||||
*/
|
||||
public boolean canGrow(World worldIn, BlockPos pos, State state, boolean isClient)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue() < 2;
|
||||
}
|
||||
|
||||
public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, State state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
|
||||
{
|
||||
worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(((Integer)state.getValue(AGE)).intValue() + 1)), 2);
|
||||
}
|
||||
|
||||
public BlockLayer getBlockLayer()
|
||||
{
|
||||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, AGE};
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
Model model;
|
||||
switch(state.getValue(AGE)) {
|
||||
case 0:
|
||||
model = provider.getModel("cocoa_0")
|
||||
.add(6, 7, 11, 10, 12, 15)
|
||||
.d().uv(0, 0, 4, 4).noCull()
|
||||
.u().uv(0, 0, 4, 4).noCull()
|
||||
.n().uv(11, 4, 15, 9).noCull()
|
||||
.s().uv(11, 4, 15, 9).noCull()
|
||||
.w().uv(11, 4, 15, 9).noCull()
|
||||
.e().uv(11, 4, 15, 9).noCull()
|
||||
.add(8, 12, 12, 8, 16, 16)
|
||||
.w().uv(12, 0, 16, 4).noCull()
|
||||
.e().uv(16, 0, 12, 4).noCull();
|
||||
break;
|
||||
case 1:
|
||||
model = provider.getModel("cocoa_1")
|
||||
.add(5, 5, 9, 11, 12, 15)
|
||||
.d().uv(0, 0, 6, 6).noCull()
|
||||
.u().uv(0, 0, 6, 6).noCull()
|
||||
.n().uv(9, 4, 15, 11).noCull()
|
||||
.s().uv(9, 4, 15, 11).noCull()
|
||||
.w().uv(9, 4, 15, 11).noCull()
|
||||
.e().uv(9, 4, 15, 11).noCull()
|
||||
.add(8, 12, 12, 8, 16, 16)
|
||||
.w().uv(12, 0, 16, 4).noCull()
|
||||
.e().uv(16, 0, 12, 4).noCull();
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
model = provider.getModel("cocoa_2")
|
||||
.add(4, 3, 7, 12, 12, 15)
|
||||
.d().uv(0, 0, 7, 7).noCull()
|
||||
.u().uv(0, 0, 7, 7).noCull()
|
||||
.n().uv(7, 4, 15, 13).noCull()
|
||||
.s().uv(7, 4, 15, 13).noCull()
|
||||
.w().uv(7, 4, 15, 13).noCull()
|
||||
.e().uv(7, 4, 15, 13).noCull()
|
||||
.add(8, 12, 12, 8, 16, 16)
|
||||
.w().uv(12, 0, 16, 4).noCull()
|
||||
.e().uv(16, 0, 12, 4).noCull();
|
||||
break;
|
||||
}
|
||||
return model.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return Transform.PANE_SIDE;
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemDye(DyeColor.BROWN, this);
|
||||
}
|
||||
}
|
|
@ -262,7 +262,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
spawnAsEntity(worldIn, pos, new ItemStack(item));
|
||||
}
|
||||
|
||||
i = 200;
|
||||
i = this.type.getDropChance();
|
||||
|
||||
if (fortune > 0)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package common.block.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.DirectionalUp;
|
||||
import common.block.Directional;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.CheatTab;
|
||||
|
@ -23,7 +23,7 @@ import common.world.State;
|
|||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class BlockStem extends BlockBush implements DirectionalUp, IGrowable
|
||||
public class BlockStem extends BlockBush implements Directional, IGrowable
|
||||
{
|
||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7);
|
||||
|
||||
|
@ -206,7 +206,7 @@ public class BlockStem extends BlockBush implements DirectionalUp, IGrowable
|
|||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
String stem = name;
|
||||
String upperstem = name + "_connected";
|
||||
if(state.getValue(FACING) == Facing.UP) {
|
||||
if(state.getValue(FACING).getAxis().isVertical()) {
|
||||
switch(state.getValue(AGE)) {
|
||||
case 0:
|
||||
return provider.getModel(stem)
|
||||
|
|
|
@ -1,161 +0,0 @@
|
|||
package common.block.tech;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.ITileEntityProvider;
|
||||
import common.block.Material;
|
||||
import common.block.SoundType;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.model.Transform;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyInteger;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntityDaylightDetector;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.LightType;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class BlockDaylightDetector extends Block implements ITileEntityProvider
|
||||
{
|
||||
public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15);
|
||||
private final boolean inverted;
|
||||
|
||||
public BlockDaylightDetector(boolean inverted)
|
||||
{
|
||||
super(Material.WOOD);
|
||||
this.inverted = inverted;
|
||||
this.setDefaultState(this.getBaseState().withProperty(POWER, Integer.valueOf(0)));
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.setHardness(0.2F);
|
||||
this.setStepSound(SoundType.WOOD);
|
||||
// this.setDisplay("daylightDetector");
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
|
||||
}
|
||||
|
||||
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||
return state.getValue(POWER) > 0 ? (double)(15 - state.getValue(POWER)) * 10000.0 : super.getResistance(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public void updatePower(AWorldServer worldIn, BlockPos pos)
|
||||
{
|
||||
if (worldIn.dimension.hasSkyLight() && worldIn.dimension.hasDaylight())
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
int i = worldIn.getLightFor(LightType.SKY, pos) - worldIn.getSkylightSubtracted();
|
||||
float f = worldIn.getDayPhase(1.0F);
|
||||
float f1 = f < (float)Math.PI ? 0.0F : ((float)Math.PI * 2F);
|
||||
f = f + (f1 - f) * 0.2F;
|
||||
i = Math.round((float)i * ExtMath.cos(f));
|
||||
i = ExtMath.clampi(i, 0, 15);
|
||||
|
||||
if (this.inverted)
|
||||
{
|
||||
i = 15 - i;
|
||||
}
|
||||
|
||||
if (((Integer)iblockstate.getValue(POWER)).intValue() != i)
|
||||
{
|
||||
worldIn.setState(pos, iblockstate.withProperty(POWER, Integer.valueOf(i)), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
// if (playerIn.isAllowEdit())
|
||||
// {
|
||||
if (worldIn.client)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.inverted)
|
||||
{
|
||||
worldIn.setState(pos, Blocks.daylight_detector.getState().withProperty(POWER, state.getValue(POWER)), 4);
|
||||
Blocks.daylight_detector.updatePower((AWorldServer)worldIn, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldIn.setState(pos, Blocks.daylight_detector_inverted.getState().withProperty(POWER, state.getValue(POWER)), 4);
|
||||
Blocks.daylight_detector_inverted.updatePower((AWorldServer)worldIn, pos);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
|
||||
// }
|
||||
}
|
||||
|
||||
public Item getItem()
|
||||
{
|
||||
return Items.daylight_detector;
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||
*/
|
||||
public boolean canConnectToWire(State state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
public TileEntity createNewTileEntity()
|
||||
{
|
||||
return new TileEntityDaylightDetector();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {POWER};
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
return provider.getModel(this.inverted ? "daylight_detector_inverted_top" : "daylight_detector_top")
|
||||
.add(0, 0, 0, 16, 6, 16)
|
||||
.d("daylight_detector_side").uv(0, 0, 16, 16)
|
||||
.u().uv(0, 0, 16, 16).noCull()
|
||||
.n("daylight_detector_side").uv(0, 10, 16, 16)
|
||||
.s("daylight_detector_side").uv(0, 10, 16, 16)
|
||||
.w("daylight_detector_side").uv(0, 10, 16, 16)
|
||||
.e("daylight_detector_side").uv(0, 10, 16, 16);
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return this.inverted ? null : super.getItemToRegister();
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ package common.block.tech;
|
|||
import java.util.List;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.DirectionalDown;
|
||||
import common.block.Directional;
|
||||
import common.block.ITileEntityProvider;
|
||||
import common.block.Material;
|
||||
import common.entity.Entity;
|
||||
|
@ -11,8 +11,6 @@ import common.entity.npc.EntityNPC;
|
|||
import common.entity.types.EntityLiving;
|
||||
import common.inventory.InventoryHelper;
|
||||
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;
|
||||
|
@ -28,9 +26,10 @@ import common.world.State;
|
|||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class BlockHopper extends Block implements ITileEntityProvider, DirectionalDown
|
||||
public class BlockHopper extends Block implements ITileEntityProvider, Directional
|
||||
{
|
||||
private static final Model hopper_down = ModelProvider.getModelProvider().getModel("hopper_outside")
|
||||
private static Model getHopperModel(boolean up) {
|
||||
return ModelProvider.getModelProvider().getModel("hopper_outside")
|
||||
.add(0, 10, 0, 16, 11, 16)
|
||||
.d().uv(0, 0, 16, 16).noCull()
|
||||
.u("hopper_inside").uv(0, 0, 16, 16).noCull()
|
||||
|
@ -79,8 +78,8 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
.n().uv(6, 12, 10, 16).noCull()
|
||||
.s().uv(6, 12, 10, 16).noCull()
|
||||
.w().uv(6, 12, 10, 16).noCull()
|
||||
.e().uv(6, 12, 10, 16).noCull()
|
||||
;
|
||||
.e().uv(6, 12, 10, 16).noCull().rotate(up ? ModelRotation.X180_Y0 : ModelRotation.X0_Y0);
|
||||
}
|
||||
|
||||
public BlockHopper()
|
||||
{
|
||||
|
@ -100,7 +99,8 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F);
|
||||
boolean flip = state.getBlock() == this && state.getValue(FACING) == Facing.UP;
|
||||
this.setBlockBounds(0.0F, flip ? 0.375f : 0.0F, 0.0F, 1.0F, flip ? 1.0f : 0.625F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
|
@ -120,14 +120,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
Facing enumfacing = facing.getOpposite();
|
||||
|
||||
if (enumfacing == Facing.UP)
|
||||
{
|
||||
enumfacing = Facing.DOWN;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
return this.getState().withProperty(FACING, facing.getOpposite());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,7 +144,6 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
if (tileentity instanceof TileEntityHopper)
|
||||
{
|
||||
playerIn.connection.show((TileEntityHopper)tileentity);
|
||||
// playerIn.triggerAchievement(StatRegistry.hopperStat);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -203,7 +195,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
return state.getValue(FACING) == Facing.DOWN ? hopper_down : provider.getModel("hopper_outside")
|
||||
return state.getValue(FACING).getAxis().isVertical() ? getHopperModel(state.getValue(FACING) == Facing.UP) : provider.getModel("hopper_outside")
|
||||
.add(0, 10, 0, 16, 11, 16)
|
||||
.d().uv(0, 0, 16, 16).noCull()
|
||||
.u("hopper_inside").uv(0, 0, 16, 16).noCull()
|
||||
|
|
|
@ -88,12 +88,12 @@ public class BlockTNT extends Block
|
|||
{
|
||||
Item item = playerIn.getCurrentEquippedItem().getItem();
|
||||
|
||||
if (item == Items.flint_and_steel || item == Items.fireball)
|
||||
if (item == Items.lighter || item == Items.fireball)
|
||||
{
|
||||
this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);
|
||||
worldIn.setBlockToAir(pos);
|
||||
|
||||
if (item == Items.flint_and_steel)
|
||||
if (item == Items.lighter)
|
||||
{
|
||||
playerIn.getCurrentEquippedItem().damage(1, playerIn);
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ public class BlockToggleableLight extends Block {
|
|||
if(player.getCurrentEquippedItem() == null)
|
||||
return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ);
|
||||
Item item = player.getCurrentEquippedItem().getItem();
|
||||
if(item != Items.flint_and_steel && item != Items.fireball)
|
||||
if(item != Items.lighter && item != Items.fireball)
|
||||
return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ);
|
||||
if(item == Items.flint_and_steel)
|
||||
if(item == Items.lighter)
|
||||
player.getCurrentEquippedItem().damage(1, player);
|
||||
else
|
||||
player.getCurrentEquippedItem().decrSize();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package common.block.tech;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.DirectionalUp;
|
||||
import common.block.Directional;
|
||||
import common.block.Material;
|
||||
import common.block.artificial.BlockFence;
|
||||
import common.block.artificial.BlockStainedGlass;
|
||||
|
@ -24,7 +24,7 @@ import common.world.State;
|
|||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public abstract class BlockTorch extends Block implements DirectionalUp
|
||||
public abstract class BlockTorch extends Block implements Directional
|
||||
{
|
||||
private static boolean isBlockNormalCube(World world, BlockPos pos, boolean def) {
|
||||
if(!World.isValid(pos) || (world.client && !world.isBlockLoaded(pos, false)))
|
||||
|
@ -74,7 +74,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp
|
|||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
{
|
||||
for (Facing enumfacing : FACING.getStates())
|
||||
for (Facing enumfacing : Facing.values())
|
||||
{
|
||||
if (this.canPlaceAt(worldIn, pos, enumfacing))
|
||||
{
|
||||
|
@ -89,7 +89,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp
|
|||
{
|
||||
BlockPos blockpos = pos.offset(facing.getOpposite());
|
||||
boolean flag = facing.getAxis().isHorizontal();
|
||||
return flag && isBlockNormalCube(worldIn, blockpos, true) || facing.equals(Facing.UP) && this.canPlaceOn(worldIn, blockpos);
|
||||
return flag && isBlockNormalCube(worldIn, blockpos, true) || facing.getAxis().isVertical() && this.canPlaceOn(worldIn, blockpos);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,7 +137,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp
|
|||
}
|
||||
else
|
||||
{
|
||||
Facing enumfacing = (Facing)state.getValue(FACING);
|
||||
Facing enumfacing = state.getValue(FACING);
|
||||
Facing.Axis enumfacing$axis = enumfacing.getAxis();
|
||||
Facing enumfacing1 = enumfacing.getOpposite();
|
||||
boolean flag = false;
|
||||
|
@ -166,7 +166,7 @@ public abstract class BlockTorch extends Block implements DirectionalUp
|
|||
|
||||
protected boolean checkForDrop(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, (Facing)state.getValue(FACING)))
|
||||
if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, state.getValue(FACING)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -206,6 +206,11 @@ public abstract class BlockTorch extends Block implements DirectionalUp
|
|||
{
|
||||
this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
|
||||
}
|
||||
else if (enumfacing == Facing.DOWN)
|
||||
{
|
||||
f = 0.25F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
|
||||
}
|
||||
else
|
||||
{
|
||||
f = 0.1F;
|
||||
|
@ -226,29 +231,34 @@ public abstract class BlockTorch extends Block implements DirectionalUp
|
|||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
if(state.getValue(FACING) == Facing.UP)
|
||||
return provider.getModel(name)
|
||||
.add(7, 0, 7, 9, 10, 9).noShade()
|
||||
.d().uv(7, 13, 9, 15).noCull()
|
||||
.u().uv(7, 6, 9, 8).noCull()
|
||||
.add(7, 0, 0, 9, 16, 16).noShade()
|
||||
.w().uv(0, 0, 16, 16).noCull()
|
||||
.e().uv(0, 0, 16, 16).noCull()
|
||||
.add(0, 0, 7, 16, 16, 9).noShade()
|
||||
.n().uv(0, 0, 16, 16).noCull()
|
||||
.s().uv(0, 0, 16, 16).noCull();
|
||||
else
|
||||
return provider.getModel(name)
|
||||
.add(-1, 3.5f, 7, 1, 13.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false)
|
||||
.d().uv(7, 13, 9, 15).noCull()
|
||||
.u().uv(7, 6, 9, 8).noCull()
|
||||
.add(-1, 3.5f, 0, 1, 19.5f, 16).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false)
|
||||
.w().uv(0, 0, 16, 16).noCull()
|
||||
.e().uv(0, 0, 16, 16).noCull()
|
||||
.add(-8, 3.5f, 7, 8, 19.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false)
|
||||
.n().uv(0, 0, 16, 16).noCull()
|
||||
.s().uv(0, 0, 16, 16).noCull()
|
||||
.rotate(ModelRotation.getEastRot(state.getValue(FACING), false));
|
||||
if(state.getValue(FACING).getAxis().isVertical()) {
|
||||
Model model = provider.getModel(name)
|
||||
.add(7, 0, 7, 9, 10, 9).noShade();
|
||||
if(state.getValue(FACING) == Facing.UP)
|
||||
model = model.d().uv(7, 13, 9, 15).noCull();
|
||||
model = model.u().uv(7, 6, 9, 8).noCull()
|
||||
.add(7, 0, 0, 9, 16, 16).noShade()
|
||||
.w().uv(0, 0, 16, 16).noCull()
|
||||
.e().uv(0, 0, 16, 16).noCull()
|
||||
.add(0, 0, 7, 16, 16, 9).noShade()
|
||||
.n().uv(0, 0, 16, 16).noCull()
|
||||
.s().uv(0, 0, 16, 16).noCull();
|
||||
return state.getValue(FACING) == Facing.UP ? model : model
|
||||
.add(7, 0, 4, 9, 0, 12).noShade().du("iron_bars").cull(Facing.DOWN)
|
||||
.add(7, 0, 4, 9, 16, 4).noShade().ns("iron_bars").noCull()
|
||||
.add(7, 0, 12, 9, 16, 12).noShade().ns("iron_bars").noCull();
|
||||
}
|
||||
return provider.getModel(name)
|
||||
.add(-1, 3.5f, 7, 1, 13.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false)
|
||||
.d().uv(7, 13, 9, 15).noCull()
|
||||
.u().uv(7, 6, 9, 8).noCull()
|
||||
.add(-1, 3.5f, 0, 1, 19.5f, 16).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false)
|
||||
.w().uv(0, 0, 16, 16).noCull()
|
||||
.e().uv(0, 0, 16, 16).noCull()
|
||||
.add(-8, 3.5f, 7, 8, 19.5f, 9).noShade().rotate(0, 3.5f, 8, Facing.Axis.Z, -22.5f, false)
|
||||
.n().uv(0, 0, 16, 16).noCull()
|
||||
.s().uv(0, 0, 16, 16).noCull()
|
||||
.rotate(ModelRotation.getEastRot(state.getValue(FACING), false));
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
|
|
|
@ -31,11 +31,11 @@ public class BlockUnlitTorch extends BlockTorch {
|
|||
if(playerIn.getCurrentEquippedItem() != null) {
|
||||
Item item = playerIn.getCurrentEquippedItem().getItem();
|
||||
|
||||
if(item == Items.flint_and_steel || item == Items.fireball) {
|
||||
if(item == Items.lighter || item == Items.fireball) {
|
||||
worldIn.setState(pos, this.lit.getState().withProperty(FACING, state.getValue(FACING)).withProperty(BlockLitTorch.FUEL, 7), 3);
|
||||
worldIn.playAuxSFX(playerIn, 1007, pos, 0);
|
||||
|
||||
if(item == Items.flint_and_steel) {
|
||||
if(item == Items.lighter) {
|
||||
playerIn.getCurrentEquippedItem().damage(1, playerIn);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -19,7 +19,7 @@ public enum DyeColor implements Identifyable, Displayable {
|
|||
CYAN("cyan", "Türkis", "Türkises", "Türkiser", "Türkise", null, "Türkiser Farbstoff", 5013401, TextColor.CYAN),
|
||||
PURPLE("purple", "Violett", "Violettes", "Violetter", "Violette", null, "Violetter Farbstoff", 8339378, TextColor.DMAGENTA),
|
||||
BLUE("blue", "Blau", "Blaues", "Blauer", "Blaue", "lapis_lazuli", "Lapislazuli", 3361970, TextColor.MIDNIGHT),
|
||||
BROWN("brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa", "Kakaobohnen", 6704179, TextColor.BROWN),
|
||||
BROWN("brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa_powder", "Gemahlene Kakaobohnen", 6704179, TextColor.BROWN),
|
||||
GREEN("green", "Grün", "Grünes", "Grüner", "Grüne", "cactus_green", "Kaktusgrün", 6717235, TextColor.DGREEN),
|
||||
RED("red", "Rot", "Rotes", "Roter", "Rote", null, "Roter Farbstoff", 10040115, TextColor.DRED),
|
||||
BLACK("black", "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "ink_sack", "Tintenbeutel", 1644825, TextColor.BLACK);
|
||||
|
|
|
@ -229,7 +229,7 @@ public class EntityHaunter extends EntityNPC {
|
|||
{
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.flint_and_steel)
|
||||
if (itemstack != null && itemstack.getItem() == Items.lighter)
|
||||
{
|
||||
this.worldObj.playSound(SoundEvent.IGNITE, this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, 1.0F);
|
||||
player.swingItem();
|
||||
|
|
|
@ -39,7 +39,6 @@ import common.block.foliage.BlockBlackenedSoil;
|
|||
import common.block.foliage.BlockBlueShroom;
|
||||
import common.block.foliage.BlockCactus;
|
||||
import common.block.foliage.BlockCarrot;
|
||||
import common.block.foliage.BlockCocoa;
|
||||
import common.block.foliage.BlockCrops;
|
||||
import common.block.foliage.BlockDeadBush;
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
|
@ -99,7 +98,6 @@ import common.block.tech.BlockButton;
|
|||
import common.block.tech.BlockCauldron;
|
||||
import common.block.tech.BlockChest;
|
||||
import common.block.tech.BlockCore;
|
||||
import common.block.tech.BlockDaylightDetector;
|
||||
import common.block.tech.BlockDispenser;
|
||||
import common.block.tech.BlockDropper;
|
||||
import common.block.tech.BlockEnchantmentTable;
|
||||
|
@ -362,7 +360,6 @@ public abstract class BlockRegistry {
|
|||
register("reeds", (new BlockReed()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Zuckerrohr").setTab(CheatTab.PLANTS));
|
||||
register("vine", (new BlockVine()).setHardness(0.2F).setStepSound(SoundType.GRASS).setDisplay("Ranken").setShearsEfficiency(0));
|
||||
register("waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Seerosenblatt"));
|
||||
register("cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(SoundType.WOOD).setDisplay("Kakao"));
|
||||
|
||||
|
||||
|
||||
|
@ -666,8 +663,6 @@ public abstract class BlockRegistry {
|
|||
register("lamp", (new BlockToggleableLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS)
|
||||
.setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY));
|
||||
register("lit_lamp", (new BlockToggleableLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Lampe"));
|
||||
register("daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor"));
|
||||
register("daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor"));
|
||||
register("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken"));
|
||||
register("string", (new BlockTripWire()).setDisplay("Stolperdraht").setShearsEfficiency(0).setTab(CheatTab.TECHNOLOGY));
|
||||
|
||||
|
|
|
@ -164,7 +164,6 @@ public abstract class Blocks {
|
|||
public static final BlockSlab cobblestone_slab = get("cobblestone_slab");
|
||||
public static final BlockStairs cobblestone_stairs = get("cobblestone_stairs");
|
||||
public static final BlockWall cobblestone_wall = get("cobblestone_wall");
|
||||
public static final BlockCocoa cocoa = get("cocoa");
|
||||
public static final BlockWorkbench construction_table = get("construction_table");
|
||||
public static final Block copper_block = get("copper_block");
|
||||
public static final BlockOre copper_ore = get("copper_ore");
|
||||
|
@ -190,8 +189,6 @@ public abstract class Blocks {
|
|||
public static final BlockSapling dark_oak_sapling = get("dark_oak_sapling");
|
||||
public static final BlockSlab dark_oak_slab = get("dark_oak_slab");
|
||||
public static final BlockStairs dark_oak_stairs = get("dark_oak_stairs");
|
||||
public static final BlockDaylightDetector daylight_detector = get("daylight_detector");
|
||||
public static final BlockDaylightDetector daylight_detector_inverted = get("daylight_detector_inverted");
|
||||
public static final BlockTallGrass dead_bush = get("dead_bush");
|
||||
public static final BlockDeadBush deadbush = get("deadbush");
|
||||
public static final Block diamond_block = get("diamond_block");
|
||||
|
|
|
@ -134,7 +134,7 @@ 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, '#', Items.wheats);
|
||||
add(new ItemStack(Items.cookie, 8), "#X#", 'X', Items.cocoa_powder, '#', Items.wheats);
|
||||
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);
|
||||
|
@ -218,7 +218,6 @@ public abstract class CraftingRegistry
|
|||
Item slab = ItemRegistry.byName(wood.getName() + "_slab");
|
||||
add(new ItemStack(slab, 6), "###", '#', planks);
|
||||
add(new ItemStack(ItemRegistry.byName(wood.getName() + "_stairs"), 4), "# ", "## ", "###", '#', planks);
|
||||
add(new ItemStack(Items.daylight_detector), "GGG", "QQQ", "WWW", 'G', Items.glass, 'Q', Items.quartz, 'W', slab);
|
||||
|
||||
add(new ItemStack(Items.chest), "###", "# #", "###", '#', planks);
|
||||
add(new ItemStack(Items.workbench), "##", "##", '#', planks);
|
||||
|
@ -281,7 +280,7 @@ public abstract class CraftingRegistry
|
|||
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.flint_and_steel, 1), new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1));
|
||||
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.fishing_rod, 1), " #", " #X", "# X", '#', Items.stick, 'X', Items.string);
|
||||
|
|
|
@ -61,7 +61,7 @@ import common.item.tool.ItemFireball;
|
|||
import common.item.tool.ItemRocketLauncher;
|
||||
import common.item.tool.ItemFishFood;
|
||||
import common.item.tool.ItemFishingRod;
|
||||
import common.item.tool.ItemFlintAndSteel;
|
||||
import common.item.tool.ItemFire;
|
||||
import common.item.tool.ItemFood;
|
||||
import common.item.tool.ItemGlassBottle;
|
||||
import common.item.tool.ItemHoe;
|
||||
|
@ -222,9 +222,9 @@ public abstract class ItemRegistry {
|
|||
register("weather_token_" + weather.getName(), new ItemWeatherToken(weather).setTab(CheatTab.MAGIC));
|
||||
}
|
||||
|
||||
register("flint_and_steel", (new ItemFlintAndSteel(Blocks.fire)).setDisplay("Feuerzeug"));
|
||||
register("burning_soul", (new ItemFlintAndSteel(Blocks.soul_fire)).setDisplay("Brennende Seele"));
|
||||
register("dark_lighter", (new ItemFlintAndSteel(Blocks.black_fire)).setDisplay("Verdunkelndes Feuerzeug"));
|
||||
register("lighter", (new ItemFire(Blocks.fire)).setDisplay("Feuerzeug"));
|
||||
register("burning_soul", (new ItemFire(Blocks.soul_fire)).setDisplay("Brennende Seele"));
|
||||
register("dark_lighter", (new ItemFire(Blocks.black_fire)).setDisplay("Verdunkelndes Feuerzeug"));
|
||||
register("apple", (new ItemFood(4, false)).setDisplay("Apfel").setMaxAmount(StackSize.L));
|
||||
register("bow", (new ItemBow()).setDisplay("Bogen"));
|
||||
register("boltgun", (new ItemBoltgun()).setDisplay("Bolter"));
|
||||
|
@ -270,9 +270,7 @@ public abstract class ItemRegistry {
|
|||
}
|
||||
Item lapis = null;
|
||||
for(DyeColor color : DyeColor.values()) {
|
||||
if(color == DyeColor.BROWN)
|
||||
continue;
|
||||
Item dye = new ItemDye(color, null);
|
||||
Item dye = new ItemDye(color);
|
||||
if(color == DyeColor.BLUE)
|
||||
lapis = dye;
|
||||
register(color.getDye(), dye);
|
||||
|
@ -288,7 +286,7 @@ public abstract class ItemRegistry {
|
|||
register("rotten_flesh", (new ItemFood(4, true)).setDisplay("Verrottetes Fleisch"));
|
||||
register("orb", (new ItemFragile()).setDisplay("Kugel").setTab(CheatTab.MAGIC));
|
||||
register("demon_rod", (new Item()).setDisplay("Dämonenrute").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XL));
|
||||
register("tear", (new Item()).setDisplay("Träne").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"));
|
||||
for(Pair<String, Effect> pot : ItemPotion.getBasePotions()) {
|
||||
|
|
|
@ -59,7 +59,7 @@ import common.item.tool.ItemFireball;
|
|||
import common.item.tool.ItemRocketLauncher;
|
||||
import common.item.tool.ItemFishFood;
|
||||
import common.item.tool.ItemFishingRod;
|
||||
import common.item.tool.ItemFlintAndSteel;
|
||||
import common.item.tool.ItemFire;
|
||||
import common.item.tool.ItemFood;
|
||||
import common.item.tool.ItemGlassBottle;
|
||||
import common.item.tool.ItemHoe;
|
||||
|
@ -223,7 +223,7 @@ public abstract class Items {
|
|||
public static final ItemBlock brown_mushroom_block = get("brown_mushroom_block");
|
||||
public static final ItemBlock brown_wool = get("brown_wool");
|
||||
public static final ItemBucket bucket = get("bucket");
|
||||
public static final ItemFlintAndSteel burning_soul = get("burning_soul");
|
||||
public static final ItemFire burning_soul = get("burning_soul");
|
||||
public static final ItemBlock cactus = get("cactus");
|
||||
public static final ItemDye cactus_green = get("cactus_green");
|
||||
public static final ItemBlock cake = get("cake");
|
||||
|
@ -284,7 +284,7 @@ public abstract class Items {
|
|||
public static final ItemSlab cobblestone_slab = get("cobblestone_slab");
|
||||
public static final ItemBlock cobblestone_stairs = get("cobblestone_stairs");
|
||||
public static final ItemWall cobblestone_wall = get("cobblestone_wall");
|
||||
public static final ItemDye cocoa = get("cocoa");
|
||||
public static final ItemDye cocoa_powder = get("cocoa_powder");
|
||||
public static final ItemBlock construction_table = get("construction_table");
|
||||
public static final ItemFood cooked_beef = get("cooked_beef");
|
||||
public static final ItemFood cooked_chicken = get("cooked_chicken");
|
||||
|
@ -303,7 +303,7 @@ public abstract class Items {
|
|||
public static final ItemBlock cyan_wool = get("cyan_wool");
|
||||
public static final ItemBlock daisy = get("daisy");
|
||||
public static final ItemBlock dandelion = get("dandelion");
|
||||
public static final ItemFlintAndSteel dark_lighter = get("dark_lighter");
|
||||
public static final ItemFire dark_lighter = get("dark_lighter");
|
||||
public static final ItemDoor dark_oak_door = get("dark_oak_door");
|
||||
public static final ItemFence dark_oak_fence = get("dark_oak_fence");
|
||||
public static final ItemBlock dark_oak_fence_gate = get("dark_oak_fence_gate");
|
||||
|
@ -317,7 +317,6 @@ public abstract class Items {
|
|||
public static final ItemBlock dark_oak_sapling = get("dark_oak_sapling");
|
||||
public static final ItemSlab dark_oak_slab = get("dark_oak_slab");
|
||||
public static final ItemBlock dark_oak_stairs = get("dark_oak_stairs");
|
||||
public static final ItemBlock daylight_detector = get("daylight_detector");
|
||||
public static final ItemBlock dead_bush = get("dead_bush");
|
||||
public static final ItemBlock deadbush = get("deadbush");
|
||||
public static final Item diamond = get("diamond");
|
||||
|
@ -367,14 +366,14 @@ public abstract class Items {
|
|||
public static final ItemFireball fireball = get("fireball");
|
||||
public static final ItemFishingRod fishing_rod = get("fishing_rod");
|
||||
public static final Item flint = get("flint");
|
||||
public static final ItemFlintAndSteel flint_and_steel = get("flint_and_steel");
|
||||
public static final ItemFire lighter = get("lighter");
|
||||
public static final ItemBlock floor_tiles = get("floor_tiles");
|
||||
public static final ItemBlock floor_tiles_black = get("floor_tiles_black");
|
||||
public static final ItemBlock floor_tiles_red = get("floor_tiles_red");
|
||||
public static final ItemBlock floor_tiles_white = get("floor_tiles_white");
|
||||
public static final ItemBlock flowerpot = get("flowerpot");
|
||||
public static final ItemBlock furnace = get("furnace");
|
||||
public static final Item tear = get("tear");
|
||||
public static final Item gold_coin = get("gold_coin");
|
||||
public static final Item ghi_fragment = get("ghi_fragment");
|
||||
public static final ItemBlock glass = get("glass");
|
||||
public static final ItemGlassBottle glass_bottle = get("glass_bottle");
|
||||
|
|
|
@ -3,10 +3,10 @@ package common.init;
|
|||
import common.color.Colorizer;
|
||||
|
||||
public enum WoodType {
|
||||
OAK("oak", "Eichen", null, 20, "apple"),
|
||||
OAK("oak", "Eichen", null, 20, "apple", 200),
|
||||
SPRUCE("spruce", "Fichten", Colorizer.PINE, 20),
|
||||
BIRCH("birch", "Birken", Colorizer.BIRCH, 20),
|
||||
JUNGLE("jungle", "Tropen", null, 40),
|
||||
JUNGLE("jungle", "Tropen", null, 40, "cocoa_powder", 350),
|
||||
ACACIA("acacia", "Akazien", null, 20),
|
||||
DARK_OAK("dark_oak", "Schwarzeichen", null, 20),
|
||||
CHERRY("cherry", "Kirsch", Colorizer.NONE, 20),
|
||||
|
@ -17,17 +17,19 @@ public enum WoodType {
|
|||
private final String name;
|
||||
private final Colorizer tintType;
|
||||
private final int sapChance;
|
||||
private final int dropChance;
|
||||
private final String item;
|
||||
private final String display;
|
||||
|
||||
private WoodType(String name, String display, Colorizer tint, int sapChance) {
|
||||
this(name, display, tint, sapChance, null);
|
||||
this(name, display, tint, sapChance, null, 0);
|
||||
}
|
||||
|
||||
private WoodType(String name, String display, Colorizer tint, int sapChance, String item) {
|
||||
private WoodType(String name, String display, Colorizer tint, int sapChance, String item, int dropChance) {
|
||||
this.name = name;
|
||||
this.tintType = tint;
|
||||
this.sapChance = sapChance;
|
||||
this.dropChance = dropChance;
|
||||
this.item = item;
|
||||
this.display = display;
|
||||
}
|
||||
|
@ -40,6 +42,10 @@ public enum WoodType {
|
|||
return this.sapChance;
|
||||
}
|
||||
|
||||
public int getDropChance() {
|
||||
return this.dropChance;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public enum CheatTab {
|
|||
},
|
||||
TOOLS("Werkzeug", false) {
|
||||
protected Item getIconItem() {
|
||||
return Items.flint_and_steel;
|
||||
return Items.lighter;
|
||||
}
|
||||
},
|
||||
LIQUIDS("Flüssigkeiten", false) {
|
||||
|
|
|
@ -111,7 +111,7 @@ public class ItemBlock extends Item
|
|||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return this.block.getRenderType() == 2 ? Transform.IDENTITY : (this.block.hasBlockFlatTexture() ? super.getTransform() : this.block.getTransform());
|
||||
return this.block.getRenderType() == 2 ? super.getTransform() : (this.block.hasBlockFlatTexture() ? super.getTransform() : this.block.getTransform());
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
|
|
|
@ -8,6 +8,8 @@ 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;
|
||||
|
@ -83,4 +85,8 @@ public class ItemSign extends Item
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getEntityModel(), this.getTransform());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package common.item.material;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Rotatable;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.block.foliage.BlockCocoa;
|
||||
import common.block.foliage.IGrowable;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.animal.EntitySheep;
|
||||
|
@ -15,9 +13,6 @@ 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.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
|
@ -31,17 +26,15 @@ public class ItemDye extends Item {
|
|||
private static final ItemDye[] DIES = new ItemDye[DyeColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final Block block;
|
||||
|
||||
public static ItemDye getByColor(DyeColor color) {
|
||||
return DIES[color.ordinal()];
|
||||
}
|
||||
|
||||
public ItemDye(DyeColor color, Block block)
|
||||
public ItemDye(DyeColor color)
|
||||
{
|
||||
this.color = color;
|
||||
this.block = block;
|
||||
this.setTab(color == DyeColor.BROWN ? CheatTab.PLANTS : (color == DyeColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS));
|
||||
this.setTab(color == DyeColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS);
|
||||
this.setDisplay(color.getDyeName());
|
||||
this.setMaxAmount(StackSize.XXL);
|
||||
DIES[this.color.ordinal()] = this;
|
||||
|
@ -50,10 +43,6 @@ public class ItemDye extends Item {
|
|||
public DyeColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a Block is right-clicked with this Item
|
||||
|
@ -78,39 +67,6 @@ public class ItemDye extends Item {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
else if (this.color == DyeColor.BROWN)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if (block == Blocks.jungle_log) // && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE)
|
||||
{
|
||||
if (side == Facing.DOWN)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (side == Facing.UP)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pos = pos.offset(side);
|
||||
|
||||
if (worldIn.isAirBlock(pos))
|
||||
{
|
||||
State iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, playerIn);
|
||||
worldIn.setState(pos, iblockstate1, 2);
|
||||
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
stack.decrSize();
|
||||
// }
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
if(iblockstate.getBlock() instanceof BlockBed) {
|
||||
Block bedBlock = BlockRegistry.byName(this.color.getName() + "_bed");
|
||||
|
@ -240,14 +196,4 @@ public class ItemDye extends Item {
|
|||
public int getDispenseSoundId() {
|
||||
return this.color == DyeColor.WHITE ? 0 : super.getDispenseSoundId();
|
||||
}
|
||||
|
||||
public Transform getTransform() {
|
||||
return this.block == null ? super.getTransform() : this.block.getTransform();
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return this.block == null ? super.getModel(provider, name) :
|
||||
provider.getModel(this.block.getModel(provider,
|
||||
BlockRegistry.getName(this.block), this.block instanceof BlockCocoa ? this.block.getState().withProperty(BlockCocoa.FACING, Facing.SOUTH).withProperty(BlockCocoa.AGE, 2) : this.block.getState()), this.getTransform());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,17 +120,10 @@ public class ItemArmor extends Item
|
|||
public boolean isMagnetic() {
|
||||
return this.material.isMagnetic();
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
if(this.material.canBeDyed())
|
||||
return provider.getModel(this.getTransform(), name, name + "_overlay");
|
||||
else
|
||||
return super.getModel(provider, name);
|
||||
}
|
||||
|
||||
// public Set<String> getValidTags() {
|
||||
// return Sets.newHashSet("color");
|
||||
// }
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(provider.getEntityModel(), this.getTransform());
|
||||
}
|
||||
|
||||
public static int getArmorPosition(ItemStack stack) {
|
||||
// if(stack.getItem() != Items.pumpkin && stack.getItem() != Items.skull) {
|
||||
|
|
|
@ -14,11 +14,11 @@ import common.util.Facing;
|
|||
import common.util.Vec3;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemFlintAndSteel extends Item
|
||||
public class ItemFire extends Item
|
||||
{
|
||||
private final BlockFire fireBlock;
|
||||
|
||||
public ItemFlintAndSteel(BlockFire fireBlock)
|
||||
public ItemFire(BlockFire fireBlock)
|
||||
{
|
||||
this.fireBlock = fireBlock;
|
||||
this.setMaxDamage(64);
|
|
@ -67,6 +67,6 @@ public class ItemGlassBottle extends Item
|
|||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), "potion_bottle_empty");
|
||||
return provider.getModel(this.getTransform(), "bottle");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ public class ItemPotion extends Item
|
|||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), "potion_overlay", "potion_bottle_drinkable");
|
||||
return provider.getModel(this.getTransform(), "potion_overlay", "bottle");
|
||||
}
|
||||
|
||||
public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
package common.tileentity;
|
||||
|
||||
import common.tags.TagObject;
|
||||
|
||||
public class TileEntityComparator extends TileEntity
|
||||
{
|
||||
private int outputSignal;
|
||||
|
||||
public void writeTags(TagObject compound)
|
||||
{
|
||||
super.writeTags(compound);
|
||||
compound.setInt("OutputSignal", this.outputSignal);
|
||||
}
|
||||
|
||||
public void readTags(TagObject compound)
|
||||
{
|
||||
super.readTags(compound);
|
||||
this.outputSignal = compound.getInt("OutputSignal");
|
||||
}
|
||||
|
||||
public int getOutputSignal()
|
||||
{
|
||||
return this.outputSignal;
|
||||
}
|
||||
|
||||
public void setOutputSignal(int p_145995_1_)
|
||||
{
|
||||
this.outputSignal = p_145995_1_;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return 0xaf0000;
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package common.tileentity;
|
||||
|
||||
import common.block.tech.BlockDaylightDetector;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class TileEntityDaylightDetector extends TileEntity implements ITickable
|
||||
{
|
||||
private int updateTimer;
|
||||
|
||||
public void update()
|
||||
{
|
||||
if (this.worldObj != null && !this.worldObj.client)
|
||||
{
|
||||
if(this.updateTimer <= 0) {
|
||||
this.blockType = this.getBlockType();
|
||||
|
||||
if (this.blockType instanceof BlockDaylightDetector)
|
||||
{
|
||||
((BlockDaylightDetector)this.blockType).updatePower((AWorldServer)this.worldObj, this.pos);
|
||||
}
|
||||
|
||||
this.updateTimer = 20;
|
||||
}
|
||||
else {
|
||||
--this.updateTimer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return 0xffffaf;
|
||||
}
|
||||
}
|
|
@ -224,7 +224,7 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable
|
|||
|
||||
if (!this.isFull())
|
||||
{
|
||||
flag = captureDroppedItems(this) || flag;
|
||||
flag = captureDroppedItems(this, state.getValue(BlockHopper.FACING) != Facing.UP) || flag;
|
||||
}
|
||||
|
||||
if (flag)
|
||||
|
@ -382,13 +382,13 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable
|
|||
return true;
|
||||
}
|
||||
|
||||
public static boolean captureDroppedItems(TileEntityHopper p_145891_0_)
|
||||
public static boolean captureDroppedItems(TileEntityHopper te, boolean down)
|
||||
{
|
||||
IInventory iinventory = getHopperInventory(p_145891_0_);
|
||||
IInventory iinventory = getHopperInventory(te, !down);
|
||||
|
||||
if (iinventory != null)
|
||||
{
|
||||
Facing enumfacing = Facing.DOWN;
|
||||
Facing enumfacing = down ? Facing.UP : Facing.DOWN;
|
||||
|
||||
if (isInventoryEmpty(iinventory, enumfacing))
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable
|
|||
|
||||
for (int i = 0; i < aint.length; ++i)
|
||||
{
|
||||
if (pullItemFromSlot(p_145891_0_, iinventory, aint[i], enumfacing))
|
||||
if (pullItemFromSlot(te, iinventory, aint[i], enumfacing))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -414,18 +414,18 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable
|
|||
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
if (pullItemFromSlot(p_145891_0_, iinventory, k, enumfacing))
|
||||
if (pullItemFromSlot(te, iinventory, k, enumfacing))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(down)
|
||||
{
|
||||
for (EntityItem entityitem : func_181556_a(p_145891_0_.getWorld(), p_145891_0_.getXPos(), p_145891_0_.getYPos() + 1.0D, p_145891_0_.getZPos()))
|
||||
for (EntityItem entityitem : func_181556_a(te.getWorld(), te.getXPos(), te.getYPos() + 1.0D, te.getZPos()))
|
||||
{
|
||||
if (putDropInInventoryAllSlots(p_145891_0_, entityitem))
|
||||
if (putDropInInventoryAllSlots(te, entityitem))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -600,9 +600,9 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable
|
|||
/**
|
||||
* Returns the IInventory for the specified hopper
|
||||
*/
|
||||
public static IInventory getHopperInventory(TileEntityHopper hopper)
|
||||
public static IInventory getHopperInventory(TileEntityHopper hopper, boolean down)
|
||||
{
|
||||
return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + 1.0D, hopper.getZPos());
|
||||
return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + (down ? -1.0 : 1.0), hopper.getZPos());
|
||||
}
|
||||
|
||||
public static List<EntityItem> func_181556_a(World p_181556_0_, double p_181556_1_, double p_181556_3_, double p_181556_5_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue