This commit is contained in:
Modmuss50 2015-11-23 19:51:40 +00:00
parent ef82ceb714
commit 839647ed85
9 changed files with 86 additions and 99 deletions

View file

@ -15,7 +15,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
public static final int MAX_OUTPUT = ConfigTechReborn.aesuMaxOutput;
public static final int MAX_STORAGE = ConfigTechReborn.aesuMaxStorage;
public Inventory inventory = new Inventory(2, "TileAesu", 64);
public Inventory inventory = new Inventory(2, "TileAesu", 64, this);
private int OUTPUT = 64; //The current output
private double euLastTick = 0;
private double euChange;
@ -116,7 +116,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1);
writeToNBTWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.stackTagCompound.setTag("tileEntity", tileEntity);
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
return dropStack;
}

View file

@ -53,24 +53,25 @@ public class TilePlayerDectector extends TilePowerAcceptor {
while (tIterator.hasNext()) {
EntityPlayer player = (EntityPlayer) tIterator.next();
if (player.getDistanceSq((double) super.getPos().getX() + 0.5D, (double) super.getPos().getY() + 0.5D, (double) super.getPos().getZ() + 0.5D) <= 256.0D) {
if(worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) == 0){//ALL
redstone = true;
} else if (blockMetadata == 1){//Others
if(!owenerUdid.isEmpty() && !owenerUdid.equals(player.getUniqueID().toString())){
redstone = true;
}
} else {//You
if(!owenerUdid.isEmpty() &&owenerUdid.equals(player.getUniqueID().toString())){
redstone = true;
}
}
// if(worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) == 0){//ALL
// redstone = true;
// } else if (blockMetadata == 1){//Others
// if(!owenerUdid.isEmpty() && !owenerUdid.equals(player.getUniqueID().toString())){
// redstone = true;
// }
// } else {//You
// if(!owenerUdid.isEmpty() &&owenerUdid.equals(player.getUniqueID().toString())){
// redstone = true;
// }
// }//TODO meta fix
redstone = true;
}
}
useEnergy(50);
}
if(lastRedstone != redstone){
worldObj.markBlockForUpdate(getPos().getX(), getPos().getY(), getPos().getZ());
worldObj.notifyBlocksOfNeighborChange(getPos().getX(), getPos().getY(), getPos().getZ(), worldObj.getBlock(getPos().getX(), getPos().getY(), getPos().getZ()));
worldObj.markBlockForUpdate(getPos());
worldObj.notifyNeighborsOfStateChange(getPos(), worldObj.getBlockState(getPos()).getBlock());
}
}
}

View file

@ -45,14 +45,18 @@ public class TileIDSU extends TilePowerAcceptor {
return 1000000000;
}
//TODO meta fix
@Override
public boolean canAcceptEnergy(EnumFacing direction) {
return worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) != Functions.getIntDirFromDirection(direction);
//return worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) != Functions.getIntDirFromDirection(direction);
return true;
}
@Override
public boolean canProvideEnergy(EnumFacing direction) {
return worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) == Functions.getIntDirFromDirection(direction);
//return worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) == Functions.getIntDirFromDirection(direction);
return true;
}
@Override