mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-04 03:37:59 -04:00
Fix transparency
This commit is contained in:
parent
e20df9e42a
commit
c7a277da8e
@ -6,8 +6,6 @@ import java.util.List;
|
||||
import io.cubyz.CubyzLogger;
|
||||
|
||||
public class Registry<T extends IRegistryElement> {
|
||||
private int IDs = 0;
|
||||
|
||||
private HashMap<String, T> hashMap = new HashMap<>();
|
||||
private boolean debug = Boolean.parseBoolean(System.getProperty("registry.debugEnabled", "false"));
|
||||
private boolean alwaysError = Boolean.parseBoolean(System.getProperty("registry.dumpAsError", "true"));
|
||||
@ -36,8 +34,6 @@ public class Registry<T extends IRegistryElement> {
|
||||
System.err.flush();
|
||||
return;
|
||||
}
|
||||
element.setID(IDs);
|
||||
IDs++;
|
||||
hashMap.put(element.getRegistryID().toString(), element);
|
||||
if (debug) {
|
||||
CubyzLogger.instance.info("Registered " + getType(element.getClass()) + " as " + element.getRegistryID());
|
||||
|
@ -224,11 +224,24 @@ public class LocalWorld extends World {
|
||||
|
||||
public void generate() {
|
||||
Random r = new Random();
|
||||
int ID = 0;
|
||||
seed = r.nextInt();
|
||||
blocks = new Block[CubzRegistries.BLOCK_REGISTRY.registered().length];
|
||||
for (IRegistryElement ire : CubzRegistries.BLOCK_REGISTRY.registered()) {
|
||||
Block b = (Block) ire;
|
||||
blocks[b.ID] = b;
|
||||
if(!b.isTransparent()) {
|
||||
blocks[ID] = b;
|
||||
b.ID = ID;
|
||||
ID++;
|
||||
}
|
||||
}
|
||||
for (IRegistryElement ire : CubzRegistries.BLOCK_REGISTRY.registered()) {
|
||||
Block b = (Block) ire;
|
||||
if(b.isTransparent()) {
|
||||
blocks[ID] = b;
|
||||
b.ID = ID;
|
||||
ID++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user