Skip to content

Commit

Permalink
- fix ArrayPool leaking resources to multiple threads
Browse files Browse the repository at this point in the history
- remove ChunkReader from biome container
- hopefully greatly improved memory efficiency by pooling Cell & Chunk arrays
- added custom snow placer that places snow beneath leaves as well as on top
  • Loading branch information
dags- committed Jun 6, 2020
1 parent 5e99228 commit 5411388
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static Builder builder() {
return new Builder();
}

private static JsonElement arg(Object arg) {
public static JsonElement arg(Object arg) {
if (arg instanceof String) {
return new JsonPrimitive((String) arg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.terraforged.fm.matcher.feature.FeatureMatcher;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -101,14 +102,10 @@ public static Builder builder() {
}

public static <T> FeatureTransformer replace(T find, T replace) {
if (find instanceof String) {
return builder().value((String) find, (String) replace).build();
}
if (find instanceof Number) {
return builder().value((Number) find, (Number) replace).build();
}
if (find instanceof Boolean) {
return builder().value((Boolean) find, (Boolean) replace).build();
JsonElement f = FeatureMatcher.arg(find);
JsonElement r = FeatureMatcher.arg(replace);
if (f.isJsonPrimitive() && r.isJsonPrimitive()) {
return builder().value(f.getAsJsonPrimitive(), r.getAsJsonPrimitive()).build();
}
return NONE;
}
Expand Down

0 comments on commit 5411388

Please sign in to comment.