the (no) redstone patch TM
Before Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 75 B |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.8 KiB |
|
@ -464,7 +464,7 @@ public class Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNormalCube() {
|
public boolean isNormalCube() {
|
||||||
return this.material.isOpaque() && this.isFullCube() && !this.canProvidePower();
|
return this.material.isOpaque() && this.isFullCube();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVisuallyOpaque() {
|
public boolean isVisuallyOpaque() {
|
||||||
|
@ -861,26 +861,6 @@ public class Block {
|
||||||
return this.colorMultiplier(worldIn, pos, 0);
|
return this.colorMultiplier(worldIn, pos, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canProvidePower() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasSignalProcessing() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn) {
|
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,4 +1055,16 @@ public class Block {
|
||||||
public final Item getItem() {
|
public final Item getItem() {
|
||||||
return this.item;
|
return this.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canConnectToWire() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||||
|
return Double.POSITIVE_INFINITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double powerTick(World worldIn, BlockPos pos, State state, Random rand, double voltage, double currentLimit) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,16 +219,6 @@ public class BlockCake extends Block
|
||||||
return new Property[] {BITES};
|
return new Property[] {BITES};
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return (7 - ((Integer)worldIn.getState(pos).getValue(BITES)).intValue()) * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Model getModel(ModelProvider provider, String name, State state) {
|
public Model getModel(ModelProvider provider, String name, State state) {
|
||||||
return cake_slices[state.getValue(BITES)];
|
return cake_slices[state.getValue(BITES)];
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,16 +97,6 @@ public class BlockPortalFrame extends Block implements Rotatable
|
||||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(ORB, Boolean.valueOf(false));
|
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(ORB, Boolean.valueOf(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return ((Boolean)worldIn.getState(pos).getValue(ORB)).booleanValue() ? 15 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Property[] getProperties()
|
protected Property[] getProperties()
|
||||||
{
|
{
|
||||||
return new Property[] {FACING, ORB};
|
return new Property[] {FACING, ORB};
|
||||||
|
|
|
@ -13,7 +13,6 @@ import common.model.ModelProvider;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.Facing;
|
|
||||||
import common.world.IBlockAccess;
|
import common.world.IBlockAccess;
|
||||||
import common.world.IWorldAccess;
|
import common.world.IWorldAccess;
|
||||||
import common.world.State;
|
import common.world.State;
|
||||||
|
@ -206,20 +205,10 @@ public abstract class BlockBasePressurePlate extends Block
|
||||||
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
|
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
return this.getSignalStrength(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
return side == Facing.UP ? this.getSignalStrength(state) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||||
*/
|
*/
|
||||||
public boolean canProvidePower()
|
public boolean canConnectToWire()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import common.block.Material;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.inventory.Container;
|
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.CheatTab;
|
import common.item.CheatTab;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
|
@ -468,16 +467,6 @@ public class BlockBrewingStand extends BlockContainer
|
||||||
return Items.brewing_stand;
|
return Items.brewing_stand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return Container.calcSignal(worldIn.getTileEntity(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockLayer getBlockLayer()
|
public BlockLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
return BlockLayer.CUTOUT;
|
return BlockLayer.CUTOUT;
|
||||||
|
|
|
@ -207,20 +207,14 @@ public class BlockButton extends Block implements Directional
|
||||||
super.onBlockRemoved(worldIn, pos, state);
|
super.onBlockRemoved(worldIn, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||||
{
|
return state.getValue(POWERED) ? 0.0 : super.getResistance(worldIn, pos, state);
|
||||||
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (state.getValue(FACING) == side ? 15 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||||
*/
|
*/
|
||||||
public boolean canProvidePower()
|
public boolean canConnectToWire()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -584,16 +584,6 @@ public class BlockCauldron extends Block
|
||||||
return Items.cauldron;
|
return Items.cauldron;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return ((Integer)worldIn.getState(pos).getValue(LEVEL)).intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Property[] getProperties()
|
protected Property[] getProperties()
|
||||||
{
|
{
|
||||||
return new Property[] {LEVEL};
|
return new Property[] {LEVEL};
|
||||||
|
|
|
@ -13,7 +13,6 @@ import common.entity.animal.EntityCat;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.inventory.Container;
|
|
||||||
import common.inventory.IInventory;
|
import common.inventory.IInventory;
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.CheatTab;
|
import common.item.CheatTab;
|
||||||
|
@ -238,16 +237,6 @@ public class BlockChest extends BlockContainer implements Rotatable
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return Container.calcSignalFrom(this.getChest(worldIn, pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Property[] getProperties()
|
protected Property[] getProperties()
|
||||||
{
|
{
|
||||||
return new Property[] {FACING};
|
return new Property[] {FACING};
|
||||||
|
|
|
@ -47,10 +47,9 @@ public class BlockDaylightDetector extends BlockContainer
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
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);
|
||||||
return ((Integer)state.getValue(POWER)).intValue();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePower(AWorldServer worldIn, BlockPos pos)
|
public void updatePower(AWorldServer worldIn, BlockPos pos)
|
||||||
{
|
{
|
||||||
|
@ -143,7 +142,7 @@ public class BlockDaylightDetector extends BlockContainer
|
||||||
/**
|
/**
|
||||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||||
*/
|
*/
|
||||||
public boolean canProvidePower()
|
public boolean canConnectToWire()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import common.block.Material;
|
||||||
import common.entity.item.EntityItem;
|
import common.entity.item.EntityItem;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.inventory.Container;
|
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.CheatTab;
|
import common.item.CheatTab;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
|
@ -159,16 +158,6 @@ public class BlockDispenser extends BlockContainer implements Directional
|
||||||
return new Vec3(d0, d1, d2);
|
return new Vec3(d0, d1, d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return Container.calcSignal(worldIn.getTileEntity(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of render function called. 3 for standard block models, 2 for TESR's, 1 for liquids, -1 is no render
|
* The type of render function called. 3 for standard block models, 2 for TESR's, 1 for liquids, -1 is no render
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,7 +8,6 @@ import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.init.Blocks;
|
import common.init.Blocks;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.inventory.Container;
|
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.model.Model;
|
import common.model.Model;
|
||||||
|
@ -196,16 +195,6 @@ public class BlockFurnace extends BlockContainer implements Rotatable
|
||||||
super.onBlockRemoved(worldIn, pos, state);
|
super.onBlockRemoved(worldIn, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return Container.calcSignal(worldIn.getTileEntity(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItem(World worldIn, BlockPos pos)
|
public Item getItem(World worldIn, BlockPos pos)
|
||||||
{
|
{
|
||||||
return Items.furnace;
|
return Items.furnace;
|
||||||
|
|
|
@ -7,7 +7,6 @@ import common.block.Material;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.inventory.Container;
|
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.CheatTab;
|
import common.item.CheatTab;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
|
@ -195,16 +194,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input)
|
|
||||||
{
|
|
||||||
return Container.calcSignal(worldIn.getTileEntity(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockLayer getBlockLayer()
|
public BlockLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
return BlockLayer.CUTOUT_MIPPED;
|
return BlockLayer.CUTOUT_MIPPED;
|
||||||
|
|
|
@ -231,20 +231,14 @@ public class BlockLever extends Block
|
||||||
super.onBlockRemoved(worldIn, pos, state);
|
super.onBlockRemoved(worldIn, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||||
{
|
return state.getValue(POWERED) ? 0.0 : super.getResistance(worldIn, pos, state);
|
||||||
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing() == side ? 15 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||||
*/
|
*/
|
||||||
public boolean canProvidePower()
|
public boolean canConnectToWire()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import common.block.ITileEntityProvider;
|
||||||
import common.block.Material;
|
import common.block.Material;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.inventory.Container;
|
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.CheatTab;
|
import common.item.CheatTab;
|
||||||
import common.properties.Property;
|
import common.properties.Property;
|
||||||
|
@ -62,14 +61,6 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti
|
||||||
worldIn.removeTileEntity(pos);
|
worldIn.removeTileEntity(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSignalProcessing() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSignal(World worldIn, BlockPos pos, int input) {
|
|
||||||
return Container.calcSignal(worldIn.getTileEntity(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) {
|
public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) {
|
||||||
super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam);
|
super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam);
|
||||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||||
|
|
|
@ -24,6 +24,10 @@ public class BlockPressurePlate extends BlockBasePressurePlate
|
||||||
this.sensitivity = sensitivityIn;
|
this.sensitivity = sensitivityIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||||
|
return state.getValue(POWERED) ? 0.0 : super.getResistance(worldIn, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
protected int getSignalStrength(State state)
|
protected int getSignalStrength(State state)
|
||||||
{
|
{
|
||||||
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
|
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
|
||||||
|
|
|
@ -36,6 +36,10 @@ public class BlockPressurePlateWeighted extends BlockBasePressurePlate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
protected int getSignalStrength(State state)
|
protected int getSignalStrength(State state)
|
||||||
{
|
{
|
||||||
return ((Integer)state.getValue(POWER)).intValue();
|
return ((Integer)state.getValue(POWER)).intValue();
|
||||||
|
|
|
@ -319,20 +319,14 @@ public class BlockTripWireHook extends Block implements Rotatable
|
||||||
super.onBlockRemoved(worldIn, pos, state);
|
super.onBlockRemoved(worldIn, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||||
{
|
return state.getValue(POWERED) ? 0.0 : super.getResistance(worldIn, pos, state);
|
||||||
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (state.getValue(FACING) == side ? 15 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||||
*/
|
*/
|
||||||
public boolean canProvidePower()
|
public boolean canConnectToWire()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package common.block.tech;
|
package common.block.tech;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.ArrayDeque;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Queue;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import common.block.Block;
|
import common.block.Block;
|
||||||
|
@ -21,13 +22,10 @@ import common.properties.PropertyInteger;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
|
||||||
import common.util.Facing;
|
import common.util.Facing;
|
||||||
import common.util.Identifyable;
|
import common.util.Identifyable;
|
||||||
import common.util.ParticleType;
|
|
||||||
import common.world.IBlockAccess;
|
import common.world.IBlockAccess;
|
||||||
import common.world.IWorldAccess;
|
import common.world.IWorldAccess;
|
||||||
import common.world.AWorldClient;
|
|
||||||
import common.world.State;
|
import common.world.State;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
import common.world.AWorldServer;
|
import common.world.AWorldServer;
|
||||||
|
@ -35,327 +33,211 @@ import common.world.AWorldServer;
|
||||||
public class BlockWire extends Block
|
public class BlockWire extends Block
|
||||||
{
|
{
|
||||||
private static final Model wire_none = ModelProvider.getModelProvider().getModel("wire_cross")
|
private static final Model wire_none = ModelProvider.getModelProvider().getModel("wire_cross")
|
||||||
.add(5, 0.25f, 5, 11, 0.25f, 11).noShade()
|
.add(2, 0.25f, 2, 14, 0.25f, 14).noShade()
|
||||||
.u().uv(5, 5, 11, 11).tint().noCull()
|
.u("wire_line").uv(2, 2, 14, 14).noCull()
|
||||||
.add(5, 0.25f, 5, 11, 0.25f, 11).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 5, 11, 11).noCull()
|
|
||||||
;
|
;
|
||||||
private static final Model wire_nsew = ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
private static final Model wire_nsew = ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(0, 0, 16, 16).tint().noCull()
|
.u().uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
;
|
;
|
||||||
private static final Model wire_unusueuw = ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
private static final Model wire_unusueuw = ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(0, 0, 16, 16).tint().noCull()
|
.u().uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
|
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
|
||||||
.e("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.e("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
|
|
||||||
.e("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
;
|
;
|
||||||
private static final Model wire_unus = ModelProvider.getModelProvider().getModel("wire_cross")
|
private static final Model wire_unus = ModelProvider.getModelProvider().getModel("wire_cross")
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.u("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
;
|
;
|
||||||
private static final Model wire_ueuw = ModelProvider.getModelProvider().getModel("wire_cross")
|
private static final Model wire_ueuw = ModelProvider.getModelProvider().getModel("wire_cross")
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u("wire_line").uv(0, 0, 16, 16).tint().noCull()
|
.u("wire_line").uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_line_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
|
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
|
||||||
.e("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.e("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
|
|
||||||
.e("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private static Model wire_n(boolean rot) {
|
private static Model wire_n(boolean rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross")
|
return ModelProvider.getModelProvider().getModel("wire_cross")
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.u("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
|
.rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Model wire_ne(ModelRotation rot) {
|
private static Model wire_ne(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 9).noShade()
|
||||||
.u().uv(5, 0, 16, 11).tint().noCull()
|
.u().uv(7, 0, 16, 9).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Model wire_uew(boolean rot) {
|
private static Model wire_uew(boolean rot) {
|
||||||
Model model = ModelProvider.getModelProvider().getModel("wire_cross")
|
Model model = ModelProvider.getModelProvider().getModel("wire_cross")
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u("wire_line").uv(0, 0, 16, 16).tint().noCull()
|
.u("wire_line").uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_line_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull();
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull();
|
|
||||||
return rot ? model.uvLock().rotate(ModelRotation.X0_Y180) : model;
|
return rot ? model.uvLock().rotate(ModelRotation.X0_Y180) : model;
|
||||||
}
|
}
|
||||||
private static Model wire_nue(ModelRotation rot) {
|
private static Model wire_nue(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 9).noShade()
|
||||||
.u().uv(5, 0, 16, 11).tint().noCull()
|
.u().uv(7, 0, 16, 9).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(270).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(270).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(270).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_une(ModelRotation rot) {
|
private static Model wire_une(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 9).noShade()
|
||||||
.u().uv(5, 0, 16, 11).tint().noCull()
|
.u().uv(7, 0, 16, 9).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_nse(ModelRotation rot) {
|
private static Model wire_nse(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_uns(boolean lock, ModelRotation rot) {
|
private static Model wire_uns(boolean lock, ModelRotation rot) {
|
||||||
Model model = ModelProvider.getModelProvider().getModel("wire_cross")
|
Model model = ModelProvider.getModelProvider().getModel("wire_cross")
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.u("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
return lock ? model.uvLock() : model;
|
return lock ? model.uvLock() : model;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Model wire_nsue(ModelRotation rot) {
|
private static Model wire_nsue(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(270).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(270).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(270).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unse(ModelRotation rot) {
|
private static Model wire_unse(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_nuse(ModelRotation rot) {
|
private static Model wire_nuse(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unue(ModelRotation rot) {
|
private static Model wire_unue(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 9).noShade()
|
||||||
.u().uv(5, 0, 16, 11).tint().noCull()
|
.u().uv(7, 0, 16, 9).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Model wire_unusue(ModelRotation rot) {
|
private static Model wire_unusue(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unusew(boolean rot) {
|
private static Model wire_unusew(boolean rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(0, 0, 16, 16).tint().noCull()
|
.u().uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
|
.rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
|
||||||
}
|
}
|
||||||
private static Model wire_unusuew(ModelRotation rot) {
|
private static Model wire_unusuew(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(0, 0, 16, 16).tint().noCull()
|
.u().uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unuse(ModelRotation rot) {
|
private static Model wire_unuse(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_nusue(ModelRotation rot) {
|
private static Model wire_nusue(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
||||||
.n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.n("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
|
|
||||||
.n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unsew(ModelRotation rot) {
|
private static Model wire_unsew(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(0, 0, 16, 16).tint().noCull()
|
.u().uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unsuew(ModelRotation rot) {
|
private static Model wire_unsuew(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(0, 0, 16, 16).tint().noCull()
|
.u().uv(0, 0, 16, 16).noCull()
|
||||||
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
private static Model wire_unsue(ModelRotation rot) {
|
private static Model wire_unsue(ModelRotation rot) {
|
||||||
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
.add(7, 0.25f, 0, 16, 0.25f, 16).noShade()
|
||||||
.u().uv(5, 0, 16, 16).tint().noCull()
|
.u().uv(7, 0, 16, 16).noCull()
|
||||||
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
|
|
||||||
.u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
|
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
||||||
.s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.s("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
|
|
||||||
.s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
||||||
.w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
|
.w("wire_line").uv(0, 0, 16, 16).rot(90).noCull()
|
||||||
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
|
|
||||||
.w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
|
|
||||||
.rotate(rot);
|
.rotate(rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +246,7 @@ public class BlockWire extends Block
|
||||||
public static final PropertyEnum<EnumAttachPosition> SOUTH = PropertyEnum.<EnumAttachPosition>create("south", EnumAttachPosition.class);
|
public static final PropertyEnum<EnumAttachPosition> SOUTH = PropertyEnum.<EnumAttachPosition>create("south", EnumAttachPosition.class);
|
||||||
public static final PropertyEnum<EnumAttachPosition> WEST = PropertyEnum.<EnumAttachPosition>create("west", EnumAttachPosition.class);
|
public static final PropertyEnum<EnumAttachPosition> WEST = PropertyEnum.<EnumAttachPosition>create("west", EnumAttachPosition.class);
|
||||||
public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15);
|
public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15);
|
||||||
private boolean canProvidePower = true;
|
|
||||||
private final Set<BlockPos> blocksNeedingUpdate = Sets.<BlockPos>newHashSet();
|
private final Set<BlockPos> blocksNeedingUpdate = Sets.<BlockPos>newHashSet();
|
||||||
|
|
||||||
public BlockWire()
|
public BlockWire()
|
||||||
|
@ -421,12 +303,6 @@ public class BlockWire extends Block
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int colorMultiplier(IWorldAccess worldIn, BlockPos pos, int renderPass)
|
|
||||||
{
|
|
||||||
State iblockstate = worldIn.getState(pos);
|
|
||||||
return iblockstate.getBlock() != this ? super.colorMultiplier(worldIn, pos, renderPass) : this.colorMultiplier(((Integer)iblockstate.getValue(POWER)).intValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||||
{
|
{
|
||||||
return worldIn.isBlockSolid(pos.down()) || worldIn.getState(pos.down()).getBlock() == Blocks.glowstone;
|
return worldIn.isBlockSolid(pos.down()) || worldIn.getState(pos.down()).getBlock() == Blocks.glowstone;
|
||||||
|
@ -452,9 +328,9 @@ public class BlockWire extends Block
|
||||||
int i = ((Integer)state.getValue(POWER)).intValue();
|
int i = ((Integer)state.getValue(POWER)).intValue();
|
||||||
int j = 0;
|
int j = 0;
|
||||||
j = this.getMaxCurrentStrength(worldIn, pos2, j);
|
j = this.getMaxCurrentStrength(worldIn, pos2, j);
|
||||||
this.canProvidePower = false;
|
// this.canProvidePower = false;
|
||||||
int k = 0; // TODO: worldIn.isBlockIndirectlyGettingPowered(pos1);
|
int k = 0; // TODO: worldIn.isBlockIndirectlyGettingPowered(pos1);
|
||||||
this.canProvidePower = true;
|
// this.canProvidePower = true;
|
||||||
|
|
||||||
if (k > 0 && k > j - 1)
|
if (k > 0 && k > j - 1)
|
||||||
{
|
{
|
||||||
|
@ -647,57 +523,6 @@ public class BlockWire extends Block
|
||||||
return this.getItem();
|
return this.getItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
return !this.canProvidePower ? 0 : this.getWeakPower(worldIn, pos, state, side);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
|
|
||||||
{
|
|
||||||
if (!this.canProvidePower)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int i = ((Integer)state.getValue(POWER)).intValue();
|
|
||||||
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if (side == Facing.UP)
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EnumSet<Facing> enumset = EnumSet.<Facing>noneOf(Facing.class);
|
|
||||||
|
|
||||||
for (Facing enumfacing : Facing.Plane.HORIZONTAL)
|
|
||||||
{
|
|
||||||
if (this.isConnectedTo(worldIn, pos, enumfacing))
|
|
||||||
{
|
|
||||||
enumset.add(enumfacing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (side.getAxis().isHorizontal() && enumset.isEmpty())
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
else if (enumset.contains(side) && !enumset.contains(side.rotateYCCW()) && !enumset.contains(side.rotateY()))
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, Facing side)
|
private boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, Facing side)
|
||||||
{
|
{
|
||||||
BlockPos blockpos = pos.offset(side);
|
BlockPos blockpos = pos.offset(side);
|
||||||
|
@ -733,59 +558,50 @@ public class BlockWire extends Block
|
||||||
// }
|
// }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return block.canProvidePower() && side != null;
|
return block.canConnectToWire() && side != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public double doPowerPhase(AWorldServer world, BlockPos pos, Random rand, double voltage, double currentLimit) { // TODO: implement
|
||||||
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
Queue<BlockPos> queue = new ArrayDeque<BlockPos>();
|
||||||
*/
|
Set<BlockPos> traversed = Sets.newHashSet();
|
||||||
public boolean canProvidePower()
|
traversed.add(pos);
|
||||||
{
|
queue.add(pos);
|
||||||
return this.canProvidePower;
|
double converted = 0.0;
|
||||||
|
while((pos = queue.poll()) != null) {
|
||||||
|
for(Facing off : Facing.values()) {
|
||||||
|
BlockPos bpos = pos.offset(off);
|
||||||
|
if(!traversed.contains(bpos)) {
|
||||||
|
traversed.add(bpos);
|
||||||
|
State state = world.getState(bpos);
|
||||||
|
if(state.getBlock().canConnectToWire() || state.getBlock() instanceof BlockWire) {
|
||||||
|
double power = state.getBlock().powerTick(world, bpos, state, rand, voltage, currentLimit);
|
||||||
|
converted += power;
|
||||||
|
voltage -= state.getBlock().getResistance(world, bpos, state) * (power / voltage);
|
||||||
|
if(voltage <= 0.0) {
|
||||||
|
queue.clear();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
queue.add(bpos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return converted;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int colorMultiplier(int powerLevel)
|
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||||
{
|
return 5.0;
|
||||||
float f = (float)powerLevel / 15.0F;
|
}
|
||||||
float f1 = f * 0.6F + 0.4F;
|
|
||||||
|
|
||||||
if (powerLevel == 0)
|
public double powerTick(World worldIn, BlockPos pos, State state, Random rand, double voltage, double currentLimit) {
|
||||||
{
|
return 0.01;
|
||||||
f1 = 0.3F;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
float f2 = f * f * 0.7F - 0.5F;
|
// public boolean canConnectToWire()
|
||||||
float f3 = f * f * 0.6F - 0.7F;
|
// {
|
||||||
|
// return true;
|
||||||
if (f2 < 0.0F)
|
// }
|
||||||
{
|
|
||||||
f2 = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f3 < 0.0F)
|
|
||||||
{
|
|
||||||
f3 = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = ExtMath.clampi((int)(f1 * 255.0F), 0, 255);
|
|
||||||
int j = ExtMath.clampi((int)(f2 * 255.0F), 0, 255);
|
|
||||||
int k = ExtMath.clampi((int)(f3 * 255.0F), 0, 255);
|
|
||||||
return -16777216 | i << 16 | j << 8 | k;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
|
||||||
{
|
|
||||||
int i = ((Integer)state.getValue(POWER)).intValue();
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
{
|
|
||||||
double d0 = (double)pos.getX() + 0.5D + ((double)rand.floatv() - 0.5D) * 0.2D;
|
|
||||||
double d1 = (double)((float)pos.getY() + 0.0625F);
|
|
||||||
double d2 = (double)pos.getZ() + 0.5D + ((double)rand.floatv() - 0.5D) * 0.2D;
|
|
||||||
worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, this.colorMultiplier(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItem(World worldIn, BlockPos pos)
|
public Item getItem(World worldIn, BlockPos pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,7 +9,6 @@ import common.entity.npc.EntityNPC;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.network.IPlayer;
|
import common.network.IPlayer;
|
||||||
import common.tileentity.TileEntity;
|
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
|
||||||
public abstract class Container
|
public abstract class Container
|
||||||
|
@ -772,39 +771,4 @@ public abstract class Container
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Like the version that takes an inventory. If the given TileEntity is not an Inventory, 0 is returned instead.
|
|
||||||
*/
|
|
||||||
public static int calcSignal(TileEntity te)
|
|
||||||
{
|
|
||||||
return te instanceof IInventory ? calcSignalFrom((IInventory)te) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int calcSignalFrom(IInventory inv)
|
|
||||||
{
|
|
||||||
if (inv == null)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
float f = 0.0F;
|
|
||||||
|
|
||||||
for (int j = 0; j < inv.getSizeInventory(); ++j)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = inv.getStackInSlot(j);
|
|
||||||
|
|
||||||
if (itemstack != null)
|
|
||||||
{
|
|
||||||
f += (float)itemstack.getSize() / (float)Math.min(inv.getInventoryStackLimit(), itemstack.getMaxStackSize());
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
f = f / (float)inv.getSizeInventory();
|
|
||||||
return ExtMath.floorf(f * 14.0F) + (i > 0 ? 1 : 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|