mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-26 21:09:23 +01:00
Making Phantom Device Range being tested better
This commit is contained in:
parent
87a7fbad5a
commit
02e5a161dc
2 changed files with 4 additions and 28 deletions
|
@ -17,6 +17,7 @@ import ellpeck.actuallyadditions.util.WorldUtil;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -101,20 +102,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
|||
|
||||
@Override
|
||||
public boolean isBoundThingInRange(){
|
||||
if(this.hasBoundPosition()){
|
||||
int xDif = this.boundPosition.getX()-this.xCoord;
|
||||
int yDif = this.boundPosition.getY()-this.yCoord;
|
||||
int zDif = this.boundPosition.getZ()-this.zCoord;
|
||||
|
||||
if(xDif >= -this.range && xDif <= this.range){
|
||||
if(yDif >= -this.range && yDif <= this.range){
|
||||
if(zDif >= -this.range && zDif <= this.range){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.hasBoundPosition() && this.boundPosition.toVec().distanceTo(Vec3.createVectorHelper(xCoord, yCoord, zCoord)) <= this.range;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,6 +20,7 @@ import ellpeck.actuallyadditions.util.WorldUtil;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile{
|
||||
|
@ -104,20 +105,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
|||
|
||||
@Override
|
||||
public boolean isBoundThingInRange(){
|
||||
if(this.hasBoundPosition()){
|
||||
int xDif = this.boundPosition.getX()-this.xCoord;
|
||||
int yDif = this.boundPosition.getY()-this.yCoord;
|
||||
int zDif = this.boundPosition.getZ()-this.zCoord;
|
||||
|
||||
if(xDif >= -this.range && xDif <= this.range){
|
||||
if(yDif >= -this.range && yDif <= this.range){
|
||||
if(zDif >= -this.range && zDif <= this.range){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.hasBoundPosition() && this.boundPosition.toVec().distanceTo(Vec3.createVectorHelper(xCoord, yCoord, zCoord)) <= this.range;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue