mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-12 07:16:54 +01:00
random touchups
This commit is contained in:
parent
0c89eb0279
commit
61d645c354
3 changed files with 22 additions and 2 deletions
|
@ -7,6 +7,9 @@ import net.minecraft.client.renderer.IRenderTypeBuffer;
|
|||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
public class LightHandlerRenderer<T extends TileEntity & ILightHandler.ILightHandlerProvider> extends SafeTileEntityRenderer<T> {
|
||||
public LightHandlerRenderer(TileEntityRendererDispatcher dispatcher) {
|
||||
super(dispatcher);
|
||||
|
@ -18,4 +21,9 @@ public class LightHandlerRenderer<T extends TileEntity & ILightHandler.ILightHan
|
|||
.getRenderBeams()
|
||||
.forEachRemaining(beam -> beam.render(ms, buffer, partialTicks));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGlobalRenderer(T te) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,4 +105,9 @@ public class AlignerBehaviour extends AbstractLightHandlingBehaviour<AlignerTile
|
|||
return Iterators.concat(super.getRenderBeams(), collectedBeam == null ? Collections.emptyIterator() : Collections.singleton(collectedBeam)
|
||||
.iterator());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canUpdateFast() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public abstract class AbstractLightHandlingBehaviour<T extends SmartTileEntity &
|
|||
super.tick();
|
||||
if (properties.scansBeacon && beacon != null && beacon.isRemoved())
|
||||
updateBeaconState();
|
||||
if (needsBeamUpdate)
|
||||
if (needsBeamUpdate && canUpdateFast())
|
||||
updateBeams();
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,10 @@ public abstract class AbstractLightHandlingBehaviour<T extends SmartTileEntity &
|
|||
super.lazyTick();
|
||||
if (properties.scansBeacon)
|
||||
updateBeaconState();
|
||||
if (canUpdateFast())
|
||||
requestBeamUpdate();
|
||||
else
|
||||
updateBeams();
|
||||
}
|
||||
|
||||
public void requestBeamUpdate() {
|
||||
|
@ -112,4 +115,8 @@ public abstract class AbstractLightHandlingBehaviour<T extends SmartTileEntity &
|
|||
public int getMaxScanRange() {
|
||||
return properties.scanRange;
|
||||
}
|
||||
|
||||
protected boolean canUpdateFast() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue