Limited some blocks to only have a direction on the x-axis
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
**Features**
|
**Features**
|
||||||
- Re-added Controllers exploding when two of them are connected to the same network
|
- Re-added Controllers exploding when two of them are connected to the same network
|
||||||
|
- Limited some blocks to only have a direction on the x-axis
|
||||||
|
|
||||||
### 0.8.5
|
### 0.8.5
|
||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockPistonBase;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyDirection;
|
import net.minecraft.block.properties.PropertyDirection;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -43,11 +41,19 @@ public abstract class BlockBase extends Block {
|
|||||||
return "block." + RefinedStorage.ID + ":" + name;
|
return "block." + RefinedStorage.ID + ":" + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected BlockStateContainer.Builder createBlockStateBuilder() {
|
||||||
|
BlockStateContainer.Builder builder = new BlockStateContainer.Builder(this);
|
||||||
|
|
||||||
|
if (getDirectionType() != null) {
|
||||||
|
builder.add(DIRECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder().build();
|
||||||
DIRECTION,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,10 +68,12 @@ public abstract class BlockBase extends Block {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
if (getDirectionType() != null) {
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
|
||||||
if (tile instanceof TileBase) {
|
if (tile instanceof TileBase) {
|
||||||
return state.withProperty(DIRECTION, ((TileBase) tile).getDirection());
|
return state.withProperty(DIRECTION, ((TileBase) tile).getDirection());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
@@ -78,41 +86,37 @@ public abstract class BlockBase extends Block {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
|
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
if (!world.isRemote && getDirectionType() != null) {
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
|
||||||
if (!world.isRemote && tile instanceof TileBase) {
|
if (tile instanceof TileBase) {
|
||||||
EnumFacing dir = ((TileBase) tile).getDirection();
|
((TileBase) tile).setDirection(getDirectionType().getNext(((TileBase) tile).getDirection()));
|
||||||
|
|
||||||
int newDir = dir.ordinal() + 1;
|
RefinedStorageUtils.updateBlock(world, pos);
|
||||||
|
|
||||||
if (newDir > EnumFacing.VALUES.length - 1) {
|
return true;
|
||||||
newDir = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
((TileBase) tile).setDirection(EnumFacing.getFront(newDir));
|
|
||||||
|
|
||||||
RefinedStorageUtils.updateBlock(world, pos);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemStack) {
|
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack) {
|
||||||
super.onBlockPlacedBy(world, pos, state, player, itemStack);
|
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
if (getDirectionType() != null) {
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
|
||||||
if (tile instanceof TileBase) {
|
if (tile instanceof TileBase) {
|
||||||
EnumFacing facing = BlockPistonBase.getFacingFromEntity(pos, player);
|
EnumFacing facing = getDirectionType().getFrom(pos, player);
|
||||||
|
|
||||||
if (player.isSneaking() && hasOppositeFacingOnSneakPlace()) {
|
if (player.isSneaking() && canBePlacedOpposite()) {
|
||||||
facing = facing.getOpposite();
|
facing = facing.getOpposite();
|
||||||
|
}
|
||||||
|
|
||||||
|
((TileBase) tile).setDirection(facing);
|
||||||
}
|
}
|
||||||
|
|
||||||
((TileBase) tile).setDirection(facing);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,11 +139,7 @@ public abstract class BlockBase extends Block {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||||
if (willHarvest) {
|
return willHarvest ? true : super.removedByPlayer(state, world, pos, player, willHarvest);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.removedByPlayer(state, world, pos, player, willHarvest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -153,7 +153,11 @@ public abstract class BlockBase extends Block {
|
|||||||
return new ItemBlockBase(this, false);
|
return new ItemBlockBase(this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.HORIZONTAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -36,14 +35,14 @@ public class BlockCable extends BlockNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return new BlockStateContainer.Builder(this)
|
||||||
NORTH,
|
.add(NORTH)
|
||||||
EAST,
|
.add(EAST)
|
||||||
SOUTH,
|
.add(SOUTH)
|
||||||
WEST,
|
.add(WEST)
|
||||||
UP,
|
.add(UP)
|
||||||
DOWN,
|
.add(DOWN)
|
||||||
});
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -74,4 +73,9 @@ public class BlockCable extends BlockNode {
|
|||||||
public boolean isFullCube(IBlockState state) {
|
public boolean isFullCube(IBlockState state) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ public class BlockConstructor extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.properties.PropertyInteger;
|
import net.minecraft.block.properties.PropertyInteger;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
@@ -44,11 +43,10 @@ public class BlockController extends BlockBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder()
|
||||||
DIRECTION,
|
.add(TYPE)
|
||||||
TYPE,
|
.add(ENERGY)
|
||||||
ENERGY
|
.build();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ public class BlockCrafter extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ public class BlockDestructor extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -25,11 +24,9 @@ public class BlockDetector extends BlockNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder()
|
||||||
DIRECTION,
|
.add(POWERED)
|
||||||
CONNECTED,
|
.build();
|
||||||
POWERED
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,4 +69,9 @@ public class BlockDetector extends BlockNode {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ public class BlockExporter extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,12 @@ public class BlockExternalStorage extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -41,11 +40,9 @@ public class BlockGrid extends BlockNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder()
|
||||||
DIRECTION,
|
.add(TYPE)
|
||||||
CONNECTED,
|
.build();
|
||||||
TYPE
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,7 +32,12 @@ public class BlockImporter extends BlockNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasOppositeFacingOnSneakPlace() {
|
public boolean canBePlacedOpposite() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return EnumDirectionType.ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockInterface extends BlockNode {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,9 @@ public class BlockMachineCasing extends BlockBase {
|
|||||||
public BlockMachineCasing() {
|
public BlockMachineCasing() {
|
||||||
super("machine_casing");
|
super("machine_casing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -26,12 +25,14 @@ public abstract class BlockNode extends BlockBase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected BlockStateContainer.Builder createBlockStateBuilder() {
|
||||||
|
return super.createBlockStateBuilder().add(CONNECTED);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder().build();
|
||||||
DIRECTION,
|
|
||||||
CONNECTED
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,4 +4,9 @@ public class BlockQuartzEnrichedIron extends BlockBase {
|
|||||||
public BlockQuartzEnrichedIron() {
|
public BlockQuartzEnrichedIron() {
|
||||||
super("quartz_enriched_iron_block");
|
super("quartz_enriched_iron_block");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockRelay extends BlockNode {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -39,11 +38,9 @@ public class BlockSolderer extends BlockNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder()
|
||||||
DIRECTION,
|
.add(WORKING)
|
||||||
CONNECTED,
|
.build();
|
||||||
WORKING
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.block;
|
package refinedstorage.block;
|
||||||
|
|
||||||
import net.minecraft.block.properties.IProperty;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
@@ -41,11 +40,9 @@ public class BlockStorage extends BlockNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, new IProperty[]{
|
return createBlockStateBuilder()
|
||||||
DIRECTION,
|
.add(TYPE)
|
||||||
CONNECTED,
|
.build();
|
||||||
TYPE
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -107,4 +104,9 @@ public class BlockStorage extends BlockNode {
|
|||||||
public Item createItemForBlock() {
|
public Item createItemForBlock() {
|
||||||
return new ItemBlockStorage();
|
return new ItemBlockStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDirectionType getDirectionType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
46
src/main/java/refinedstorage/block/EnumDirectionType.java
Executable file
46
src/main/java/refinedstorage/block/EnumDirectionType.java
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
package refinedstorage.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockPistonBase;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
|
public enum EnumDirectionType {
|
||||||
|
ANY(
|
||||||
|
EnumFacing.VALUES
|
||||||
|
),
|
||||||
|
HORIZONTAL(
|
||||||
|
EnumFacing.NORTH,
|
||||||
|
EnumFacing.EAST,
|
||||||
|
EnumFacing.SOUTH,
|
||||||
|
EnumFacing.WEST
|
||||||
|
);
|
||||||
|
|
||||||
|
public final EnumFacing[] allowed;
|
||||||
|
|
||||||
|
EnumDirectionType(EnumFacing... allowed) {
|
||||||
|
this.allowed = allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumFacing getFrom(BlockPos pos, EntityLivingBase entity) {
|
||||||
|
switch (this) {
|
||||||
|
case ANY:
|
||||||
|
return BlockPistonBase.getFacingFromEntity(pos, entity);
|
||||||
|
case HORIZONTAL:
|
||||||
|
return entity.getHorizontalFacing().getOpposite();
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumFacing getNext(EnumFacing previous) {
|
||||||
|
switch (this) {
|
||||||
|
case ANY:
|
||||||
|
return previous.ordinal() + 1 >= EnumFacing.VALUES.length ? EnumFacing.VALUES[0] : EnumFacing.VALUES[previous.ordinal() + 1];
|
||||||
|
case HORIZONTAL:
|
||||||
|
return previous.rotateYCCW();
|
||||||
|
default:
|
||||||
|
return previous;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,7 +103,6 @@ public class ClientProxy extends CommonProxy {
|
|||||||
|
|
||||||
// Blocks
|
// Blocks
|
||||||
ModelLoader.setCustomStateMapper(RefinedStorageBlocks.STORAGE, (new StateMap.Builder())
|
ModelLoader.setCustomStateMapper(RefinedStorageBlocks.STORAGE, (new StateMap.Builder())
|
||||||
.ignore(RefinedStorageBlocks.STORAGE.DIRECTION)
|
|
||||||
.ignore(RefinedStorageBlocks.STORAGE.CONNECTED)
|
.ignore(RefinedStorageBlocks.STORAGE.CONNECTED)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,20 +12,6 @@
|
|||||||
"transform": "forge:default-block"
|
"transform": "forge:default-block"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": {
|
|
||||||
"north": {
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connected": {
|
"connected": {
|
||||||
"true": {
|
"true": {
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,20 +11,6 @@
|
|||||||
{
|
{
|
||||||
"transform": "forge:default-block"
|
"transform": "forge:default-block"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"direction": {
|
|
||||||
"north": {
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,20 +11,6 @@
|
|||||||
{
|
{
|
||||||
"transform": "forge:default-block"
|
"transform": "forge:default-block"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"direction": {
|
|
||||||
"north": {
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,20 +12,6 @@
|
|||||||
"transform": "forge:default-block"
|
"transform": "forge:default-block"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": {
|
|
||||||
"north": {
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"connected": {
|
"connected": {
|
||||||
"true": {
|
"true": {
|
||||||
"textures": {
|
"textures": {
|
||||||
|
|||||||
Reference in New Issue
Block a user