mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
Start work on the new BaseBlock/BlockState split
This commit is contained in:
@ -98,7 +98,7 @@ public class BundledBlockData {
|
||||
* @return the entry, or null
|
||||
*/
|
||||
@Nullable
|
||||
private BlockEntry findById(String id) {
|
||||
public BlockEntry findById(String id) {
|
||||
// If it has no namespace, assume minecraft.
|
||||
if (!id.contains(":")) {
|
||||
id = "minecraft:" + id;
|
||||
@ -190,10 +190,11 @@ public class BundledBlockData {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private static class BlockEntry {
|
||||
public static class BlockEntry {
|
||||
private int legacyId;
|
||||
private String id;
|
||||
private String unlocalizedName;
|
||||
public String localizedName;
|
||||
private List<String> aliases;
|
||||
private Map<String, SimpleState> states = new HashMap<>();
|
||||
private SimpleBlockMaterial material = new SimpleBlockMaterial();
|
||||
|
@ -21,6 +21,11 @@ package com.sk89q.worldedit.world.registry.state;
|
||||
|
||||
import com.sk89q.worldedit.world.registry.state.value.DirectionalStateValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DirectionalState extends SimpleState<DirectionalStateValue> {
|
||||
|
||||
public DirectionalState(List<DirectionalStateValue> values) {
|
||||
super(values);
|
||||
}
|
||||
}
|
||||
|
@ -21,17 +21,24 @@ package com.sk89q.worldedit.world.registry.state;
|
||||
|
||||
import com.sk89q.worldedit.world.registry.state.value.SimpleStateValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleState<T extends SimpleStateValue> implements State<T> {
|
||||
|
||||
private List<T> values = new ArrayList<>();
|
||||
private List<T> values;
|
||||
|
||||
/**
|
||||
* Creates a state with values
|
||||
*
|
||||
* @param values The values
|
||||
*/
|
||||
public SimpleState(List<T> values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> getValues() {
|
||||
return Collections.unmodifiableList(values);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user