mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Fixed the starfield creator not working in multiplayer. Closes #281.
This commit is contained in:
1 parent
638f24bf53
commit
2b43cd1567
1 file changed
+25
-17
@@ -17,27 +17,35 @@ public class TileStarfield extends TileMod {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(worldObj.isDaytime())
|
||||
return;
|
||||
int meta = getBlockMetadata();
|
||||
if(!worldObj.isRemote) {
|
||||
int newMeta = worldObj.isDaytime() ? 0 : 1;
|
||||
if(newMeta != meta) {
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
meta = newMeta;
|
||||
}
|
||||
}
|
||||
|
||||
if(meta == 1) {
|
||||
double radius = 512;
|
||||
int iter = 2;
|
||||
for(int i = 0; i < iter; i++) {
|
||||
double x = xCoord + 0.5 + (Math.random() - 0.5) * radius;
|
||||
double y = yCoord + 256;
|
||||
double z = zCoord + 0.5 + (Math.random() - 0.5) * radius;
|
||||
|
||||
double radius = 512;
|
||||
int iter = 2;
|
||||
for(int i = 0; i < iter; i++) {
|
||||
double x = xCoord + 0.5 + (Math.random() - 0.5) * radius;
|
||||
double y = yCoord + 256;
|
||||
double z = zCoord + 0.5 + (Math.random() - 0.5) * radius;
|
||||
float w = 0.6F;
|
||||
float c = 1F - w;
|
||||
|
||||
float w = 0.6F;
|
||||
float c = 1F - w;
|
||||
float r = w + (float) Math.random() * c;
|
||||
float g = w + (float) Math.random() * c;
|
||||
float b = w + (float) Math.random() * c;
|
||||
|
||||
float r = w + (float) Math.random() * c;
|
||||
float g = w + (float) Math.random() * c;
|
||||
float b = w + (float) Math.random() * c;
|
||||
float s = 20F + (float) Math.random() * 20F;
|
||||
int m = 50;
|
||||
|
||||
float s = 20F + (float) Math.random() * 20F;
|
||||
int m = 50;
|
||||
|
||||
Botania.proxy.sparkleFX(worldObj, x, y, z, r, g, b, s, m);
|
||||
Botania.proxy.sparkleFX(worldObj, x, y, z, r, g, b, s, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user