Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-04 18:40:06 +01:00
Maintain insertion order for RandomPattern sub-patterns (#2603)
Dieser Commit ist enthalten in:
Ursprung
164271374b
Commit
641297497a
@ -33,7 +33,7 @@ public abstract class RandomCollection<T> {
|
||||
public static <T> RandomCollection<T> of(Map<T, Double> weights, SimpleRandom random) {
|
||||
checkNotNull(random);
|
||||
return FastRandomCollection.create(weights, random)
|
||||
.orElse(new SimpleRandomCollection<>(weights, random));
|
||||
.orElseGet(() -> new SimpleRandomCollection<>(weights, random));
|
||||
}
|
||||
|
||||
public void setRandom(SimpleRandom random) {
|
||||
|
@ -27,7 +27,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@ -41,7 +41,7 @@ public class RandomPattern extends AbstractPattern {
|
||||
|
||||
//FAWE start - SimpleRandom > Random, LHS<P> > List
|
||||
private final SimpleRandom random;
|
||||
private Map<Pattern, Double> weights = new HashMap<>();
|
||||
private Map<Pattern, Double> weights = new LinkedHashMap<>();
|
||||
private RandomCollection<Pattern> collection;
|
||||
private LinkedHashSet<Pattern> patterns = new LinkedHashSet<>();
|
||||
//FAWE end
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren