mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Made Phantomface update nearby Pipes on every occasion where something could change to connect or disconnect a Pipe
This commit is contained in:
parent
7e2b9a2420
commit
490956dcb5
2 changed files with 15 additions and 2 deletions
|
@ -37,7 +37,6 @@ public class ItemPhantomConnector extends Item implements INameableItem{
|
||||||
if(tile instanceof TileEntityPhantomface){
|
if(tile instanceof TileEntityPhantomface){
|
||||||
if(this.checkHasConnection(stack, player, tile)){
|
if(this.checkHasConnection(stack, player, tile)){
|
||||||
((TileEntityPhantomface)tile).boundPosition = this.getStoredPosition(stack);
|
((TileEntityPhantomface)tile).boundPosition = this.getStoredPosition(stack);
|
||||||
WorldUtil.updateTileAndTilesAround(tile);
|
|
||||||
this.clearStorage(stack);
|
this.clearStorage(stack);
|
||||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc")));
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc")));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -32,6 +32,10 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{
|
||||||
public final int defaultRange = ConfigIntValues.PHANTOMFACE_RANGE.getValue();
|
public final int defaultRange = ConfigIntValues.PHANTOMFACE_RANGE.getValue();
|
||||||
public int range;
|
public int range;
|
||||||
|
|
||||||
|
private int rangeBefore;
|
||||||
|
private WorldPos boundPosBefore;
|
||||||
|
private Block boundBlockBefore;
|
||||||
|
|
||||||
public TileEntityPhantomface(String name){
|
public TileEntityPhantomface(String name){
|
||||||
super(0, name);
|
super(0, name);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +58,9 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{
|
||||||
|
|
||||||
if(xDif >= -this.range && xDif <= this.range){
|
if(xDif >= -this.range && xDif <= this.range){
|
||||||
if(yDif >= -this.range && yDif <= this.range){
|
if(yDif >= -this.range && yDif <= this.range){
|
||||||
if(zDif >= -this.range && zDif <= this.range) return true;
|
if(zDif >= -this.range && zDif <= this.range){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +75,14 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{
|
||||||
if(!this.hasBoundTile()){
|
if(!this.hasBoundTile()){
|
||||||
this.boundPosition = null;
|
this.boundPosition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((this.boundPosition != null && (this.boundBlockBefore != this.boundPosition.getBlock() || !this.boundPosition.isEqual(boundPosBefore))) || this.range != this.rangeBefore){
|
||||||
|
this.rangeBefore = this.range;
|
||||||
|
this.boundPosBefore = this.boundPosition;
|
||||||
|
this.boundBlockBefore = this.boundPosition == null ? null : this.boundPosition.getBlock();
|
||||||
|
System.out.println("Hi!");
|
||||||
|
WorldUtil.updateTileAndTilesAround(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue