mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-15 21:31:05 +00:00
refactor TypeToken to TypeKey
This commit is contained in:
+3
-3
@@ -21,7 +21,7 @@ import com.dfsek.terra.api.addon.annotations.Version;
|
||||
import com.dfsek.terra.api.event.EventListener;
|
||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||
import com.dfsek.terra.api.injection.annotations.Inject;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
import com.dfsek.terra.api.util.seeded.SeededBuilder;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.biome.generation.pipeline.BiomeSource;
|
||||
@@ -35,8 +35,8 @@ public class BiomePipelineAddon extends TerraAddon implements EventListener {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
|
||||
public static final TypeToken<SeededBuilder<BiomeProvider>> BIOME_PROVIDER_BUILDER_TOKEN = new TypeToken<>(){};
|
||||
public static final TypeToken<SeededBuilder<BiomeSource>> BIOME_SOURCE_BUILDER_TOKEN = new TypeToken<>(){};
|
||||
public static final TypeKey<SeededBuilder<BiomeProvider>> BIOME_PROVIDER_BUILDER_TOKEN = new TypeKey<>(){};
|
||||
public static final TypeKey<SeededBuilder<BiomeSource>> BIOME_SOURCE_BUILDER_TOKEN = new TypeKey<>(){};
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.registry.OpenRegistry;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
import com.dfsek.terra.api.util.seeded.SeededTerraBiome;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
@@ -16,7 +16,7 @@ public class BiomeConfigType implements ConfigType<BiomeTemplate, SeededTerraBio
|
||||
private final ConfigPack pack;
|
||||
private final BiomeFactory factory;
|
||||
|
||||
public static final TypeToken<SeededTerraBiome> BIOME_TYPE_TOKEN = new TypeToken<>() {};
|
||||
public static final TypeKey<SeededTerraBiome> BIOME_TYPE_TOKEN = new TypeKey<>() {};
|
||||
|
||||
public BiomeConfigType(ConfigPack pack) {
|
||||
this.pack = pack;
|
||||
@@ -34,7 +34,7 @@ public class BiomeConfigType implements ConfigType<BiomeTemplate, SeededTerraBio
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeToken<SeededTerraBiome> getTypeClass() {
|
||||
public TypeKey<SeededTerraBiome> getTypeClass() {
|
||||
return BIOME_TYPE_TOKEN;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.registry.OpenRegistry;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
import com.dfsek.terra.api.world.Flora;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
@@ -14,7 +14,7 @@ public class FloraConfigType implements ConfigType<FloraTemplate, Flora> {
|
||||
private final FloraFactory factory = new FloraFactory();
|
||||
private final ConfigPack pack;
|
||||
|
||||
public static final TypeToken<Flora> FLORA_TYPE_TOKEN = new TypeToken<>(){};
|
||||
public static final TypeKey<Flora> FLORA_TYPE_TOKEN = new TypeKey<>(){};
|
||||
|
||||
public FloraConfigType(ConfigPack pack) {
|
||||
this.pack = pack;
|
||||
@@ -31,7 +31,7 @@ public class FloraConfigType implements ConfigType<FloraTemplate, Flora> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeToken<Flora> getTypeClass() {
|
||||
public TypeKey<Flora> getTypeClass() {
|
||||
return FLORA_TYPE_TOKEN;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ import com.dfsek.terra.api.event.EventListener;
|
||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||
import com.dfsek.terra.api.injection.annotations.Inject;
|
||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
import com.dfsek.terra.api.util.seeded.SeededNoiseSampler;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -49,7 +49,7 @@ public class NoiseAddon extends TerraAddon implements EventListener {
|
||||
@Inject
|
||||
private TerraPlugin plugin;
|
||||
|
||||
public static final TypeToken<Supplier<ObjectTemplate<SeededNoiseSampler>>> NOISE_SAMPLER_TOKEN = new TypeToken<>() {};
|
||||
public static final TypeKey<Supplier<ObjectTemplate<SeededNoiseSampler>>> NOISE_SAMPLER_TOKEN = new TypeKey<>() {};
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
||||
+3
-3
@@ -6,14 +6,14 @@ import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.registry.OpenRegistry;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class OreConfigType implements ConfigType<OreTemplate, Ore> {
|
||||
private final OreFactory factory = new OreFactory();
|
||||
private final ConfigPack pack;
|
||||
public static final TypeToken<Ore> ORE_TYPE_TOKEN = new TypeToken<>(){};
|
||||
public static final TypeKey<Ore> ORE_TYPE_TOKEN = new TypeKey<>(){};
|
||||
|
||||
public OreConfigType(ConfigPack pack) {
|
||||
this.pack = pack;
|
||||
@@ -30,7 +30,7 @@ public class OreConfigType implements ConfigType<OreTemplate, Ore> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeToken<Ore> getTypeClass() {
|
||||
public TypeKey<Ore> getTypeClass() {
|
||||
return ORE_TYPE_TOKEN;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.registry.OpenRegistry;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
import com.dfsek.terra.api.world.generator.Palette;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
@@ -18,7 +18,7 @@ public class PaletteConfigType implements ConfigType<PaletteTemplate, Palette> {
|
||||
private final ConfigPack pack;
|
||||
private final TerraPlugin main;
|
||||
|
||||
public static final TypeToken<Palette> PALETTE_TYPE_TOKEN = new TypeToken<>(){};
|
||||
public static final TypeKey<Palette> PALETTE_TYPE_TOKEN = new TypeKey<>(){};
|
||||
|
||||
public PaletteConfigType(ConfigPack pack, TerraPlugin main) {
|
||||
this.pack = pack;
|
||||
@@ -36,7 +36,7 @@ public class PaletteConfigType implements ConfigType<PaletteTemplate, Palette> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeToken<Palette> getTypeClass() {
|
||||
public TypeKey<Palette> getTypeClass() {
|
||||
return PALETTE_TYPE_TOKEN;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.registry.OpenRegistry;
|
||||
import com.dfsek.terra.api.util.TypeToken;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
import com.dfsek.terra.api.world.Tree;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
@@ -14,7 +14,7 @@ public class TreeConfigType implements ConfigType<TreeTemplate, Tree> {
|
||||
private final TreeFactory factory = new TreeFactory();
|
||||
private final ConfigPack pack;
|
||||
|
||||
public static final TypeToken<Tree> TREE_TYPE_TOKEN = new TypeToken<>(){};
|
||||
public static final TypeKey<Tree> TREE_TYPE_TOKEN = new TypeKey<>(){};
|
||||
public TreeConfigType(ConfigPack pack) {
|
||||
this.pack = pack;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class TreeConfigType implements ConfigType<TreeTemplate, Tree> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeToken<Tree> getTypeClass() {
|
||||
public TypeKey<Tree> getTypeClass() {
|
||||
return TREE_TYPE_TOKEN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user