Fixed Quantum Gates unregistering and spam-teleporting player
This commit is contained in:
parent
94eccc606a
commit
27a32e97eb
2 changed files with 11 additions and 6 deletions
|
@ -76,7 +76,7 @@ public class PartQuantumGlyph extends JCuboidPart implements TSlottedPart, JNorm
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onWorldSeparate()
|
||||
public void preRemove()
|
||||
{
|
||||
FrequencyGrid.instance().unregister((IQuantumGate) tile());
|
||||
}
|
||||
|
@ -272,13 +272,17 @@ public class PartQuantumGlyph extends JCuboidPart implements TSlottedPart, JNorm
|
|||
{
|
||||
nbt.setByte("side", slot);
|
||||
nbt.setByte("number", number);
|
||||
int frequency = ((IQuantumGate) tile()).getFrequency();
|
||||
nbt.setInteger("frequency", frequency);
|
||||
|
||||
if (frequency != -1)
|
||||
if (tile() != null)
|
||||
{
|
||||
getInventory().save(nbt);
|
||||
getQuantumTank().writeToNBT(nbt);
|
||||
int frequency = ((IQuantumGate) tile()).getFrequency();
|
||||
nbt.setInteger("frequency", frequency);
|
||||
|
||||
if (frequency != -1)
|
||||
{
|
||||
getInventory().save(nbt);
|
||||
getQuantumTank().writeToNBT(nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ public class QuantumGateManager
|
|||
{
|
||||
teleportEntity.setLocationAndAngles(location.x, location.y, location.z, teleportEntity.rotationYaw, 0.0F);
|
||||
teleportEntity.motionX = teleportEntity.motionY = teleportEntity.motionZ = 0.0D;
|
||||
teleportEntity.setSneaking(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue