Performance Tweaks
EnergonRelics/pipeline/head This commit looks good Details

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);
getWorld().setBlockState(targetPos, Blocks.AIR.getDefaultState());
progress = 0;
markDirty();
if (progress != 0) {
progress = 0;
markDirty();
}
} else if (IndustrialLaserRegistry.has(targetState.getBlock())) {
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);

View File

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

View File

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