Cache biome object, further reduce diff
This commit is contained in:
parent
0ebbc2bbe5
commit
0f8174796c
12 changed files with 41 additions and 43 deletions
|
|
@ -3,6 +3,7 @@ package org.dynmap.common;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.dynmap.hdmap.HDBlockModels;
|
||||
|
||||
|
|
@ -44,6 +45,7 @@ public class BiomeMap {
|
|||
private int watercolormult;
|
||||
private int grassmult;
|
||||
private int foliagemult;
|
||||
private Optional<?> biomeObj = Optional.empty();
|
||||
private final String id;
|
||||
private final String resourcelocation;
|
||||
private final int index;
|
||||
|
|
@ -300,10 +302,13 @@ public class BiomeMap {
|
|||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public String getResourcelocation() {
|
||||
return resourcelocation;
|
||||
}
|
||||
public String toString() {
|
||||
return String.format("%s(%s)", id, resourcelocation);
|
||||
}
|
||||
public @SuppressWarnings("unchecked") <T> Optional<T> getBiomeObject() {
|
||||
return (Optional<T>) biomeObj;
|
||||
}
|
||||
public void setBiomeObject(Object biomeObj) {
|
||||
this.biomeObj = Optional.of(biomeObj);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue