use of mekanism.common.content.teleporter.TeleporterFrequency in project Mekanism by mekanism.
the class TileEntityTeleporter method onUpdateServer.
@Override
protected void onUpdateServer() {
super.onUpdateServer();
if (teleportBounds == null && frameDirection != null) {
resetBounds();
}
status = canTeleport();
if (MekanismUtils.canFunction(this) && status == 1 && teleDelay == 0) {
teleport();
}
if (teleDelay == 0 && teleportBounds != null && !didTeleport.isEmpty()) {
cleanTeleportCache();
}
boolean prevShouldRender = shouldRender;
shouldRender = status == 1 || status > 4;
EnumColor prevColor = color;
TeleporterFrequency freq = getFrequency(FrequencyType.TELEPORTER);
color = freq != null ? freq.getColor() : null;
if (shouldRender != prevShouldRender) {
// This also means the comparator output changed so notify the neighbors we have a change
WorldUtils.notifyLoadedNeighborsOfTileChange(level, getBlockPos());
sendUpdatePacket();
} else if (color != prevColor) {
sendUpdatePacket();
}
teleDelay = Math.max(0, teleDelay - 1);
energySlot.fillContainerOrConvert();
}
use of mekanism.common.content.teleporter.TeleporterFrequency in project Mekanism by mekanism.
the class TileEntityTeleporter method incrementFrequencyColor.
@ComputerMethod
private void incrementFrequencyColor() throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = getFrequency();
frequency.setColor(frequency.getColor().getNext());
}
use of mekanism.common.content.teleporter.TeleporterFrequency in project Mekanism by mekanism.
the class TileEntityTeleporter method setFrequency.
@ComputerMethod
private void setFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = FrequencyType.TELEPORTER.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency == null) {
throw new ComputerException("No public teleporter frequency with name '%s' found.", name);
}
setFrequency(FrequencyType.TELEPORTER, frequency.getIdentity(), getOwnerUUID());
}
use of mekanism.common.content.teleporter.TeleporterFrequency in project Mekanism by mekanism.
the class TileEntityTeleporter method decrementFrequencyColor.
@ComputerMethod
private void decrementFrequencyColor() throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = getFrequency();
frequency.setColor(frequency.getColor().getPrevious());
}
use of mekanism.common.content.teleporter.TeleporterFrequency in project Mekanism by mekanism.
the class TileEntityTeleporter method createFrequency.
@ComputerMethod
private void createFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = FrequencyType.TELEPORTER.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency != null) {
throw new ComputerException("Unable to create public teleporter frequency with name '%s' as one already exists.", name);
}
setFrequency(FrequencyType.TELEPORTER, new FrequencyIdentity(name, true), getOwnerUUID());
}
Aggregations