Performance Tweaks
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-08-06 22:07:10 -04:00
parent 24b69d5150
commit 3d7df7742d
3 changed files with 7 additions and 8 deletions

View File

@ -55,9 +55,10 @@ public class IndustrialLaserBlockEntity extends FieldProjectorBlockEntity {
TntBlock.primeTnt(getWorld(), targetPos); TntBlock.primeTnt(getWorld(), targetPos);
getWorld().setBlockState(targetPos, Blocks.AIR.getDefaultState()); getWorld().setBlockState(targetPos, Blocks.AIR.getDefaultState());
if (progress != 0) {
progress = 0; progress = 0;
markDirty(); markDirty();
}
} else if (IndustrialLaserRegistry.has(targetState.getBlock())) { } else if (IndustrialLaserRegistry.has(targetState.getBlock())) {
if (progress >= HardcodedConfig.INDUSTRIAL_LASER_BEAM_TIME) { if (progress >= HardcodedConfig.INDUSTRIAL_LASER_BEAM_TIME) {
getWorld().createExplosion(null, targetPos.getX() + 0.5d, targetPos.getY() + 0.5d, targetPos.getZ() + 0.5d, 0.5f, Explosion.DestructionType.NONE); getWorld().createExplosion(null, targetPos.getX() + 0.5d, targetPos.getY() + 0.5d, targetPos.getZ() + 0.5d, 0.5f, Explosion.DestructionType.NONE);

View File

@ -202,9 +202,9 @@ public class NetworkComponent extends PersistentState {
Entry entry = getOrCreate(id); Entry entry = getOrCreate(id);
if (!entry.sources.contains(pos)) { if (!entry.sources.contains(pos)) {
entry.sources.add(pos); entry.sources.add(pos);
}
markDirty(); markDirty();
} }
}
public void removeSource(int id, BlockPosWithDimension pos) { public void removeSource(int id, BlockPosWithDimension pos) {
Entry entry = getOrCreate(id); Entry entry = getOrCreate(id);

View File

@ -65,7 +65,7 @@ public abstract class MixinEntity implements PortalCooldownEntity {
@Inject(at = @At("HEAD"), method = "hasNoGravity", cancellable = true) @Inject(at = @At("HEAD"), method = "hasNoGravity", cancellable = true)
public void hasNoGravity(CallbackInfoReturnable<Boolean> info) { public void hasNoGravity(CallbackInfoReturnable<Boolean> info) {
if (isTouching(block -> block instanceof BeamBlock) && !saving) { if (!saving && isTouching(block -> block instanceof BeamBlock)) {
info.setReturnValue(true); info.setReturnValue(true);
} }
} }
@ -88,10 +88,8 @@ public abstract class MixinEntity implements PortalCooldownEntity {
@Inject(at = @At("RETURN"), method = "tick") @Inject(at = @At("RETURN"), method = "tick")
public void tick(CallbackInfo info) { public void tick(CallbackInfo info) {
if (!isTouching(block -> block == EnergonRelics.ENERGY_PORTAL_BLOCK) && energyPortalCooldown > 0) {
energyPortalCooldown--; energyPortalCooldown--;
} }
}
@Override @Override
public void resetEnergyPortalCooldown() { public void resetEnergyPortalCooldown() {