Some more fixes to the energy net
This commit is contained in:
parent
7e5e40a338
commit
6765756e2d
2 changed files with 5 additions and 3 deletions
|
@ -32,7 +32,9 @@ public class TRTickHandler {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void worldTick(TickEvent.WorldTickEvent e) {
|
public void worldTick(TickEvent.WorldTickEvent e) {
|
||||||
if(!e.world.isRemote)
|
if(e.world.isRemote){
|
||||||
|
return;
|
||||||
|
}
|
||||||
MinecraftForge.EVENT_BUS.post(new PowerTickEvent());
|
MinecraftForge.EVENT_BUS.post(new PowerTickEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class TRPowerNet {
|
||||||
|
|
||||||
public int addEnergy(int max) {
|
public int addEnergy(int max) {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
if (tile.canAcceptEnergy(EnumFacing.NORTH)) {
|
if (tile.canAcceptEnergy(EnumFacing.NORTH) && max > 0) {
|
||||||
if (type.tier.ordinal() > tile.getTier().ordinal()) {
|
if (type.tier.ordinal() > tile.getTier().ordinal()) {
|
||||||
if (tile instanceof TileEntity) {
|
if (tile instanceof TileEntity) {
|
||||||
((TileEntity) tile).getWorld().createExplosion(new EntityTNTPrimed(((TileEntity) tile).getWorld()), ((TileEntity) tile).getPos().getX(), ((TileEntity) tile).getPos().getY(), ((TileEntity) tile).getPos().getZ(), 2.5F, true);
|
((TileEntity) tile).getWorld().createExplosion(new EntityTNTPrimed(((TileEntity) tile).getWorld()), ((TileEntity) tile).getPos().getX(), ((TileEntity) tile).getPos().getY(), ((TileEntity) tile).getPos().getZ(), 2.5F, true);
|
||||||
|
|
Loading…
Reference in a new issue