mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 13:09:42 +00:00
Luminizers no longer unbind automatically. This serves as a workaround for them getting unbound by chunkloading problems.
This commit is contained in:
1 parent
32f762c01b
commit
22f988e3bc
1 file changed
+8
-9
@@ -43,7 +43,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
int ticksElapsed = 0;
|
||||
|
||||
public void mountEntity(EntityLivingBase e) {
|
||||
if(e.ridingEntity != null || worldObj.isRemote || bindY == -1)
|
||||
if(e.ridingEntity != null || worldObj.isRemote || bindY == -1 || !isValidBinding())
|
||||
return;
|
||||
|
||||
EntityPlayerMover mover = new EntityPlayerMover(worldObj, xCoord, yCoord, zCoord, bindX, bindY, bindZ);
|
||||
@@ -54,15 +54,9 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(bindY > -1) {
|
||||
Block block = worldObj.getBlock(bindX, bindY, bindZ);
|
||||
if(block != ModBlocks.lightRelay) {
|
||||
bindY = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
ticksElapsed++;
|
||||
ticksElapsed++;
|
||||
|
||||
if(bindY > -1 && isValidBinding()) {
|
||||
Vector3 vec = getMovementVector();
|
||||
|
||||
double dist = 0.1;
|
||||
@@ -86,6 +80,11 @@ public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isValidBinding() {
|
||||
Block block = worldObj.getBlock(bindX, bindY, bindZ);
|
||||
return block == ModBlocks.lightRelay;
|
||||
}
|
||||
|
||||
public Vector3 getMovementVector() {
|
||||
return new Vector3(bindX - xCoord, bindY - yCoord, bindZ - zCoord);
|
||||
|
||||
Reference in new issue
Block a user