mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Actually initialize GameModes and WeatherTypes.
This commit is contained in:
parent
5e81dd1c4c
commit
57c161a602
@ -44,8 +44,10 @@ import com.sk89q.worldedit.world.block.BlockState;
|
|||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.FuzzyBlockState;
|
import com.sk89q.worldedit.world.block.FuzzyBlockState;
|
||||||
import com.sk89q.worldedit.world.entity.EntityType;
|
import com.sk89q.worldedit.world.entity.EntityType;
|
||||||
|
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||||
import com.sk89q.worldedit.world.item.ItemCategory;
|
import com.sk89q.worldedit.world.item.ItemCategory;
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
|
import com.sk89q.worldedit.world.weather.WeatherTypes;
|
||||||
import org.bstats.bukkit.Metrics;
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -173,6 +175,9 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
|||||||
EntityType.REGISTRY.register("minecraft:" + lowerCaseMcId, new EntityType("minecraft:" + lowerCaseMcId));
|
EntityType.REGISTRY.register("minecraft:" + lowerCaseMcId, new EntityType("minecraft:" + lowerCaseMcId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ... :|
|
||||||
|
GameModes.get("");
|
||||||
|
WeatherTypes.get("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupTags() {
|
private void setupTags() {
|
||||||
|
@ -628,7 +628,8 @@ public final class BlockTypes {
|
|||||||
private BlockTypes() {
|
private BlockTypes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @Nullable BlockType get(final String id) {
|
@Nullable
|
||||||
|
public static BlockType get(final String id) {
|
||||||
return BlockType.REGISTRY.get(id);
|
return BlockType.REGISTRY.get(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ package com.sk89q.worldedit.world.gamemode;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class GameModes {
|
public final class GameModes {
|
||||||
|
|
||||||
public static final GameMode SURVIVAL = register("survival");
|
public static final GameMode SURVIVAL = register("survival");
|
||||||
public static final GameMode CREATIVE = register("creative");
|
public static final GameMode CREATIVE = register("creative");
|
||||||
|
@ -21,23 +21,25 @@ package com.sk89q.worldedit.world.weather;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class WeatherTypes {
|
public final class WeatherTypes {
|
||||||
|
|
||||||
static {
|
public static final WeatherType CLEAR = register("clear");
|
||||||
// This isn't really a proper registry - so inject these before they're obtained.
|
public static final WeatherType RAIN = register("rain");
|
||||||
WeatherType.REGISTRY.register("clear", new WeatherType("clear"));
|
public static final WeatherType THUNDER_STORM = register("thunder_storm");
|
||||||
WeatherType.REGISTRY.register("rain", new WeatherType("rain"));
|
|
||||||
WeatherType.REGISTRY.register("thunder_storm", new WeatherType("thunder_storm"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable public static final WeatherType CLEAR = get("clear");
|
|
||||||
@Nullable public static final WeatherType RAIN = get("rain");
|
|
||||||
@Nullable public static final WeatherType THUNDER_STORM = get("thunder_storm");
|
|
||||||
|
|
||||||
private WeatherTypes() {
|
private WeatherTypes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @Nullable WeatherType get(final String id) {
|
private static WeatherType register(String id) {
|
||||||
|
return register(new WeatherType(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeatherType register(WeatherType weather) {
|
||||||
|
return WeatherType.REGISTRY.register(weather.getId(), weather);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public static WeatherType get(final String id) {
|
||||||
return WeatherType.REGISTRY.get(id);
|
return WeatherType.REGISTRY.get(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user