mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
meta is bad pls
This commit is contained in:
parent
3fcebcdd05
commit
8bb71ad796
8 changed files with 10 additions and 10 deletions
|
@ -62,7 +62,7 @@ public class BlockLampPowerer extends BlockBase{
|
|||
private void updateLamp(World world, BlockPos pos){
|
||||
if(!world.isRemote){
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
BlockPos coords = pos.offset(WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)));
|
||||
BlockPos coords = pos.offset(WorldUtil.getDirectionByPistonRotation(state));
|
||||
this.updateLampsAtPos(world, coords, world.isBlockIndirectlyGettingPowered(pos) > 0, new ArrayList<BlockPos>());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
|
|||
@Override
|
||||
public EnumFacing getOrientation(){
|
||||
IBlockState state = this.world.getBlockState(this.pos);
|
||||
return WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state));
|
||||
return WorldUtil.getDirectionByPistonRotation(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -78,7 +78,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
|
|||
|
||||
private void doWork(){
|
||||
IBlockState state = this.world.getBlockState(this.pos);
|
||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state));
|
||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state);
|
||||
|
||||
BlockPos coordsBlock = this.pos.offset(sideToManipulate);
|
||||
IBlockState stateToBreak = this.world.getBlockState(coordsBlock);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase{
|
|||
private void doWork(){
|
||||
if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){
|
||||
IBlockState state = this.world.getBlockState(this.pos);
|
||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state));
|
||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state);
|
||||
|
||||
for(int i = 0; i < RANGE; i++){
|
||||
BlockPos coordsBlock = this.pos.offset(sideToManipulate, i+1);
|
||||
|
|
|
@ -67,7 +67,7 @@ public class TileEntityDropper extends TileEntityInventoryBase{
|
|||
ItemStack theoreticalRemove = this.removeFromInventory(false);
|
||||
if(StackUtil.isValid(theoreticalRemove)){
|
||||
IBlockState state = this.world.getBlockState(this.pos);
|
||||
WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)), this.world, this.pos, StackUtil.setStackSize(theoreticalRemove.copy(), 1));
|
||||
WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(state), this.world, this.pos, StackUtil.setStackSize(theoreticalRemove.copy(), 1));
|
||||
this.removeFromInventory(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer
|
|||
@Override
|
||||
public EnumFacing getOrientation(){
|
||||
IBlockState state = this.world.getBlockState(this.pos);
|
||||
return WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state));
|
||||
return WorldUtil.getDirectionByPistonRotation(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,8 +68,7 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing
|
|||
|
||||
private void doWork(){
|
||||
IBlockState state = this.world.getBlockState(this.pos);
|
||||
Block block = state.getBlock();
|
||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(block.getMetaFromState(state));
|
||||
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state);
|
||||
BlockPos coordsBlock = this.pos.offset(sideToManipulate);
|
||||
|
||||
IBlockState stateToBreak = this.world.getBlockState(coordsBlock);
|
||||
|
|
|
@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|||
import de.ellpeck.actuallyadditions.mod.tile.FilterSettings;
|
||||
import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirectional;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -260,8 +261,8 @@ public final class WorldUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static EnumFacing getDirectionByPistonRotation(int meta) {
|
||||
return EnumFacing.values()[meta];
|
||||
public static EnumFacing getDirectionByPistonRotation(IBlockState state) {
|
||||
return state.getValue(BlockDirectional.FACING);
|
||||
}
|
||||
|
||||
public static ArrayList<Material> getMaterialsAround(World world, BlockPos pos) {
|
||||
|
|
Loading…
Reference in a new issue