Energy storages item charging fixes, transformers fixes, electric items fixes.
This commit is contained in:
parent
b42b5274b5
commit
be4f10b975
63 changed files with 2154 additions and 2123 deletions
|
@ -0,0 +1,18 @@
|
|||
package techreborn.blocks.transformers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.tiles.transformers.TileEVTransformer;
|
||||
|
||||
public class BlockEVTransformer extends BlockTransformer {
|
||||
|
||||
public BlockEVTransformer() {
|
||||
super("evtransformer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new TileEVTransformer();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,42 +1,21 @@
|
|||
package techreborn.blocks.transformers;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.transformers.TileHVTransformer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class BlockHVTransformer extends BlockTransformer
|
||||
{
|
||||
public class BlockHVTransformer extends BlockTransformer {
|
||||
|
||||
public BlockHVTransformer()
|
||||
{
|
||||
super("hvtransformer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileHVTransformer();
|
||||
}
|
||||
@Override public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(ModBlocks.machineframe, 1 , 7));
|
||||
return list;
|
||||
}
|
||||
public BlockHVTransformer() {
|
||||
super("hvtransformer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new TileHVTransformer();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,40 +1,21 @@
|
|||
package techreborn.blocks.transformers;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.tiles.transformers.TileLVTransformer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class BlockLVTransformer extends BlockTransformer
|
||||
{
|
||||
public class BlockLVTransformer extends BlockTransformer {
|
||||
|
||||
public BlockLVTransformer()
|
||||
{
|
||||
super("lvtransformer");
|
||||
}
|
||||
public BlockLVTransformer() {
|
||||
super("lvtransformer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileLVTransformer();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new TileLVTransformer();
|
||||
}
|
||||
|
||||
@Override public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(this, 1 , 0));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,41 +1,22 @@
|
|||
package techreborn.blocks.transformers;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.transformers.TileMVTransformer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class BlockMVTransformer extends BlockTransformer
|
||||
{
|
||||
public class BlockMVTransformer extends BlockTransformer {
|
||||
|
||||
public BlockMVTransformer()
|
||||
{
|
||||
super("mvtransformer");
|
||||
}
|
||||
public BlockMVTransformer() {
|
||||
super("mvtransformer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new TileMVTransformer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileMVTransformer();
|
||||
}
|
||||
|
||||
@Override public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> list = new ArrayList<>();
|
||||
list.add(new ItemStack(ModBlocks.machineframe, 1 , 6));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,292 +32,239 @@ import java.util.Random;
|
|||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
public abstract class BlockTransformer extends BaseTileBlock implements IRotationTexture, ITexturedBlock
|
||||
{
|
||||
public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
protected final String prefix = "techreborn:blocks/machine/storage/";
|
||||
public String name;
|
||||
public abstract class BlockTransformer extends BaseTileBlock implements IRotationTexture, ITexturedBlock {
|
||||
public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
protected final String prefix = "techreborn:blocks/machine/storage/";
|
||||
public String name;
|
||||
|
||||
public BlockTransformer(String name)
|
||||
{
|
||||
super(Material.ROCK);
|
||||
setHardness(2f);
|
||||
setUnlocalizedName("techreborn." + name.toLowerCase());
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||
this.name = name;
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
return new BlockStateContainer(this, FACING);
|
||||
}
|
||||
public BlockTransformer(String name) {
|
||||
super(Material.ROCK);
|
||||
setHardness(2f);
|
||||
setUnlocalizedName("techreborn." + name.toLowerCase());
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
super.onBlockAdded(worldIn, pos, state);
|
||||
this.setDefaultFacing(worldIn, pos, state);
|
||||
}
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
return new BlockStateContainer(this, FACING);
|
||||
}
|
||||
|
||||
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
IBlockState sate = worldIn.getBlockState(pos.north());
|
||||
Block block = sate.getBlock();
|
||||
IBlockState state1 = worldIn.getBlockState(pos.south());
|
||||
Block block1 = state1.getBlock();
|
||||
IBlockState state2 = worldIn.getBlockState(pos.west());
|
||||
Block block2 = state2.getBlock();
|
||||
IBlockState state3 = worldIn.getBlockState(pos.east());
|
||||
Block block3 = state3.getBlock();
|
||||
EnumFacing enumfacing = state.getValue(FACING);
|
||||
@Override
|
||||
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
|
||||
super.onBlockAdded(worldIn, pos, state);
|
||||
this.setDefaultFacing(worldIn, pos, state);
|
||||
}
|
||||
|
||||
if (enumfacing == EnumFacing.NORTH && block.isFullBlock(state) && !block1.isFullBlock(state1))
|
||||
{
|
||||
enumfacing = EnumFacing.SOUTH;
|
||||
} else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock(state1) && !block.isFullBlock(state))
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
} else if (enumfacing == EnumFacing.WEST && block2.isFullBlock(state2) && !block3.isFullBlock(state2))
|
||||
{
|
||||
enumfacing = EnumFacing.EAST;
|
||||
} else if (enumfacing == EnumFacing.EAST && block3.isFullBlock(state3) && !block2.isFullBlock(state2))
|
||||
{
|
||||
enumfacing = EnumFacing.WEST;
|
||||
}
|
||||
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) {
|
||||
if (!worldIn.isRemote) {
|
||||
IBlockState sate = worldIn.getBlockState(pos.north());
|
||||
Block block = sate.getBlock();
|
||||
IBlockState state1 = worldIn.getBlockState(pos.south());
|
||||
Block block1 = state1.getBlock();
|
||||
IBlockState state2 = worldIn.getBlockState(pos.west());
|
||||
Block block2 = state2.getBlock();
|
||||
IBlockState state3 = worldIn.getBlockState(pos.east());
|
||||
Block block3 = state3.getBlock();
|
||||
EnumFacing enumfacing = state.getValue(FACING);
|
||||
|
||||
worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
|
||||
}
|
||||
}
|
||||
if (enumfacing == EnumFacing.NORTH && block.isFullBlock(state) && !block1.isFullBlock(state1)) {
|
||||
enumfacing = EnumFacing.SOUTH;
|
||||
} else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock(state1) && !block.isFullBlock(state)) {
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
} else if (enumfacing == EnumFacing.WEST && block2.isFullBlock(state2) && !block3.isFullBlock(state2)) {
|
||||
enumfacing = EnumFacing.EAST;
|
||||
} else if (enumfacing == EnumFacing.EAST && block3.isFullBlock(state3) && !block2.isFullBlock(state2)) {
|
||||
enumfacing = EnumFacing.WEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer,
|
||||
ItemStack stack)
|
||||
{
|
||||
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
|
||||
EnumFacing facing = placer.getHorizontalFacing().getOpposite();
|
||||
if (placer.rotationPitch < -50)
|
||||
{
|
||||
facing = EnumFacing.DOWN;
|
||||
} else if (placer.rotationPitch > 50)
|
||||
{
|
||||
facing = EnumFacing.UP;
|
||||
}
|
||||
setFacing(facing, worldIn, pos);
|
||||
}
|
||||
worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer,
|
||||
ItemStack stack) {
|
||||
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
|
||||
EnumFacing facing = placer.getHorizontalFacing().getOpposite();
|
||||
if (placer.rotationPitch < -50) {
|
||||
facing = EnumFacing.DOWN;
|
||||
} else if (placer.rotationPitch > 50) {
|
||||
facing = EnumFacing.UP;
|
||||
}
|
||||
setFacing(facing, worldIn, pos);
|
||||
}
|
||||
|
||||
|
||||
protected List<ItemStack> dropInventory(IBlockAccess world, BlockPos pos, ItemStack itemToDrop) {
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
protected List<ItemStack> dropInventory(IBlockAccess world, BlockPos pos, ItemStack itemToDrop)
|
||||
{
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
if (tileEntity == null) {
|
||||
System.out.print("Null");
|
||||
return null;
|
||||
}
|
||||
if (!(tileEntity instanceof IInventory)) {
|
||||
|
||||
if (tileEntity == null)
|
||||
{
|
||||
System.out.print("Null");
|
||||
return null;
|
||||
}
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
System.out.print("Not Instance");
|
||||
return null;
|
||||
}
|
||||
|
||||
System.out.print("Not INstance");
|
||||
return null;
|
||||
}
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
ItemStack itemStack = inventory.getStackInSlot(i);
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack itemStack = inventory.getStackInSlot(i);
|
||||
if (itemStack == null) {
|
||||
continue;
|
||||
}
|
||||
if (itemStack != null && itemStack.stackSize > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
items.add(itemStack.copy());
|
||||
}
|
||||
items.add(itemToDrop.copy());
|
||||
return items;
|
||||
|
||||
if (itemStack == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (itemStack != null && itemStack.stackSize > 0)
|
||||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
items.add(itemStack.copy());
|
||||
}
|
||||
items.add(itemToDrop.copy());
|
||||
return items;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
int facingInt = getSideFromEnum(state.getValue(FACING));
|
||||
return facingInt;
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int facingInt = getSideFromEnum(state.getValue(FACING));
|
||||
return facingInt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
boolean active = false;
|
||||
EnumFacing facing = getSideFromint(meta);
|
||||
return this.getDefaultState().withProperty(FACING, facing);
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
boolean active = false;
|
||||
EnumFacing facing = getSideFromint(meta);
|
||||
return this.getDefaultState().withProperty(FACING, facing);
|
||||
}
|
||||
|
||||
public void setFacing(EnumFacing facing, World world, BlockPos pos)
|
||||
{
|
||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing));
|
||||
}
|
||||
public void setFacing(EnumFacing facing, World world, BlockPos pos) {
|
||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing));
|
||||
}
|
||||
|
||||
public EnumFacing getSideFromint(int i)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
return EnumFacing.NORTH;
|
||||
} else if (i == 1)
|
||||
{
|
||||
return EnumFacing.SOUTH;
|
||||
} else if (i == 2)
|
||||
{
|
||||
return EnumFacing.EAST;
|
||||
} else if (i == 3)
|
||||
{
|
||||
return EnumFacing.WEST;
|
||||
} else if (i == 4)
|
||||
{
|
||||
return EnumFacing.UP;
|
||||
} else if (i == 5)
|
||||
{
|
||||
return EnumFacing.DOWN;
|
||||
}
|
||||
return EnumFacing.NORTH;
|
||||
}
|
||||
public EnumFacing getSideFromint(int i) {
|
||||
if (i == 0) {
|
||||
return EnumFacing.NORTH;
|
||||
} else if (i == 1) {
|
||||
return EnumFacing.SOUTH;
|
||||
} else if (i == 2) {
|
||||
return EnumFacing.EAST;
|
||||
} else if (i == 3) {
|
||||
return EnumFacing.WEST;
|
||||
} else if (i == 4) {
|
||||
return EnumFacing.UP;
|
||||
} else if (i == 5) {
|
||||
return EnumFacing.DOWN;
|
||||
}
|
||||
return EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
public int getSideFromEnum(EnumFacing facing)
|
||||
{
|
||||
if (facing == EnumFacing.NORTH)
|
||||
{
|
||||
return 0;
|
||||
} else if (facing == EnumFacing.SOUTH)
|
||||
{
|
||||
return 1;
|
||||
} else if (facing == EnumFacing.EAST)
|
||||
{
|
||||
return 2;
|
||||
} else if (facing == EnumFacing.WEST)
|
||||
{
|
||||
return 3;
|
||||
} else if (facing == EnumFacing.UP)
|
||||
{
|
||||
return 4;
|
||||
} else if (facing == EnumFacing.DOWN)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public int getSideFromEnum(EnumFacing facing) {
|
||||
if (facing == EnumFacing.NORTH) {
|
||||
return 0;
|
||||
} else if (facing == EnumFacing.SOUTH) {
|
||||
return 1;
|
||||
} else if (facing == EnumFacing.EAST) {
|
||||
return 2;
|
||||
} else if (facing == EnumFacing.WEST) {
|
||||
return 3;
|
||||
} else if (facing == EnumFacing.UP) {
|
||||
return 4;
|
||||
} else if (facing == EnumFacing.DOWN) {
|
||||
return 5;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + name.toLowerCase() + "_front";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + name.toLowerCase() + "_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + name.toLowerCase() + "_front";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + name.toLowerCase() + "_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + name.toLowerCase() + "_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + name.toLowerCase() + "_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + name.toLowerCase() + "_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + name.toLowerCase() + "_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + name.toLowerCase() + "_side";
|
||||
}
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + name.toLowerCase() + "_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing)
|
||||
{
|
||||
if (this instanceof IRotationTexture)
|
||||
{
|
||||
IRotationTexture rotationTexture = this;
|
||||
if (getFacing(blockState) == facing)
|
||||
{
|
||||
return rotationTexture.getFrontOff();
|
||||
}
|
||||
if (facing == EnumFacing.UP)
|
||||
{
|
||||
return rotationTexture.getTop();
|
||||
}
|
||||
if (facing == EnumFacing.DOWN)
|
||||
{
|
||||
return rotationTexture.getBottom();
|
||||
}
|
||||
return rotationTexture.getSide();
|
||||
}
|
||||
return "techreborn:blocks/machine/machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
|
||||
if (this instanceof IRotationTexture) {
|
||||
IRotationTexture rotationTexture = this;
|
||||
if (getFacing(blockState) == facing) {
|
||||
return rotationTexture.getFrontOff();
|
||||
}
|
||||
if (facing == EnumFacing.UP) {
|
||||
return rotationTexture.getTop();
|
||||
}
|
||||
if (facing == EnumFacing.DOWN) {
|
||||
return rotationTexture.getBottom();
|
||||
}
|
||||
return rotationTexture.getSide();
|
||||
}
|
||||
return "techreborn:blocks/machine/machine_side";
|
||||
}
|
||||
|
||||
public EnumFacing getFacing(IBlockState state)
|
||||
{
|
||||
return state.getValue(FACING);
|
||||
}
|
||||
public EnumFacing getFacing(IBlockState state) {
|
||||
return state.getValue(FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
|
||||
public enum Facings implements Predicate<EnumFacing>, Iterable<EnumFacing> {
|
||||
ALL;
|
||||
|
||||
public enum Facings implements Predicate<EnumFacing>,Iterable<EnumFacing>
|
||||
{
|
||||
ALL;
|
||||
public EnumFacing[] facings() {
|
||||
return new EnumFacing[]{
|
||||
EnumFacing.NORTH, EnumFacing.EAST,
|
||||
EnumFacing.SOUTH, EnumFacing.WEST,
|
||||
EnumFacing.UP, EnumFacing.DOWN};
|
||||
}
|
||||
|
||||
public EnumFacing[] facings()
|
||||
{
|
||||
return new EnumFacing[] { EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST,
|
||||
EnumFacing.UP, EnumFacing.DOWN };
|
||||
}
|
||||
public EnumFacing random(Random rand) {
|
||||
EnumFacing[] aenumfacing = this.facings();
|
||||
return aenumfacing[rand.nextInt(aenumfacing.length)];
|
||||
}
|
||||
|
||||
public EnumFacing random(Random rand)
|
||||
{
|
||||
EnumFacing[] aenumfacing = this.facings();
|
||||
return aenumfacing[rand.nextInt(aenumfacing.length)];
|
||||
}
|
||||
public boolean apply(EnumFacing facing) {
|
||||
return facing != null;
|
||||
}
|
||||
|
||||
public boolean apply(EnumFacing p_apply_1_)
|
||||
{
|
||||
return p_apply_1_ != null;
|
||||
}
|
||||
public Iterator<EnumFacing> iterator() {
|
||||
return Iterators.forArray(this.facings());
|
||||
}
|
||||
|
||||
public Iterator<EnumFacing> iterator()
|
||||
{
|
||||
return Iterators.forArray(this.facings());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue