Compare commits

..

2 commits

Author SHA1 Message Date
Flanks255
48a2734161 nothing to see here... 2022-07-27 13:34:00 -05:00
Flanks255
011834c732 Colorful lasers 2022-07-27 13:06:26 -05:00
4 changed files with 15 additions and 2 deletions

View file

@ -26,5 +26,6 @@ public interface IAtomicReconstructor extends IEnergyTile {
Direction getOrientation();
void resetBeam(int maxAge);
void resetBeam(int maxAge, int color);
int getTTL();
}

View file

@ -40,6 +40,7 @@ public class ReconstructorRenderer extends TileEntityRenderer<TileEntityAtomicRe
public void render(TileEntityAtomicReconstructor tile, float partialTicks, @Nonnull MatrixStack matrices, @Nonnull IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay) {
ItemStack stack = tile.inv.getStackInSlot(0);
//default color 0x1b6dff
int color = tile.getBeamColor();
Direction direction = tile.getOrientation();
float rot = 360.0f - direction.getOpposite().toYRot(); //Sigh...
float pitch = 0;
@ -49,7 +50,7 @@ public class ReconstructorRenderer extends TileEntityRenderer<TileEntityAtomicRe
pitch = -90;
}
if (tile.getProgress() > 0) {
AssetUtil.renderLaser(matrices, buffer, 0, 0, 0, rot, pitch, 5, 0, 0x1b6dff, 0.8f * tile.getProgress(), 0.2f);
AssetUtil.renderLaser(matrices, buffer, 0, 0, 0, rot, pitch, 5, 0, color, 0.8f * tile.getProgress(), 0.2f);
tile.decTTL();
}
if (stack.isEmpty() || !(stack.getItem() instanceof ILensItem)) {

View file

@ -41,6 +41,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
private int oldEnergy;
private int ttl = 0;
private int maxAge = 0;
private int beamColor = 0x1b6dff;
public TileEntityAtomicReconstructor() {
super(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getTileEntityType(), 1);
@ -62,8 +63,18 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
@Override
public void resetBeam(int maxAge) {
this.resetBeam(maxAge, 0x1b6dff);
}
@Override
public void resetBeam(int maxAge, int color) {
this.ttl = maxAge;
this.maxAge = maxAge;
this.beamColor = color;
}
public int getBeamColor() {
return this.beamColor;
}
public float getProgress(){

View file

@ -230,7 +230,7 @@ public final class AssetUtil {
Minecraft mc = Minecraft.getInstance();
TileEntity tile = mc.level.getBlockEntity(new BlockPos(startX, startY, startZ));
if(tile instanceof TileEntityAtomicReconstructor)
((TileEntityAtomicReconstructor) tile).resetBeam(maxAge);
((TileEntityAtomicReconstructor) tile).resetBeam(maxAge, color);
/* if (mc.player.distanceToSqr(startX, startY, startZ) <= 64 || mc.player.distanceToSqr(endX, endY, endZ) <= 64) {