mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
The laser relay has less particles again now.
As it was lagging games.
This commit is contained in:
parent
41027a07c2
commit
549402d98e
2 changed files with 3 additions and 3 deletions
|
@ -60,7 +60,7 @@ public class PacketParticle implements IMessage{
|
|||
double difZ = startZ-endZ;
|
||||
double distance = new Vec3d(startX, startY, startZ).distanceTo(new Vec3d(endX, endY, endZ));
|
||||
|
||||
for(int times = 0; times < particleAmount/2; times++){
|
||||
for(int times = 0; times < Math.max(particleAmount/2, 1); times++){
|
||||
for(double i = 0; i <= 1; i += 1/(distance*particleAmount)){
|
||||
EntityColoredParticleFX fx = new EntityColoredParticleFX(world, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
|
|
|
@ -100,13 +100,13 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderParticles(){
|
||||
if(Util.RANDOM.nextInt(ConfigValues.lessParticles ? 8 : 3) == 0){
|
||||
if(Util.RANDOM.nextInt(ConfigValues.lessParticles ? 16 : 8) == 0){
|
||||
BlockPos thisPos = this.pos;
|
||||
LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos);
|
||||
if(network != null){
|
||||
for(LaserRelayConnectionHandler.ConnectionPair aPair : network.connections){
|
||||
if(aPair.contains(thisPos) && PosUtil.areSamePos(thisPos, aPair.firstRelay)){
|
||||
PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 2 : Util.RANDOM.nextInt(6)+1, 0.6F, this.isItem ? COLOR_ITEM : COLOR, 1F);
|
||||
PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, this.isItem ? COLOR_ITEM : COLOR, 1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue