Add forge registries for most vanilla registries
Made all registry names consistent with their vanilla counterparts Also added a system for legacy registry names, so no data will be lost Cleaned up formatting in GameData and ForgeRegistries
This commit is contained in:
parent
40f2276e88
commit
3385e62aa7
29 changed files with 523 additions and 54 deletions
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java
|
||||
+++ b/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java
|
||||
@@ -15,7 +15,7 @@
|
||||
import net.minecraft.util.math.IPosWrapper;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class MemoryModuleType<U> {
|
||||
+public class MemoryModuleType<U> extends net.minecraftforge.registries.ForgeRegistryEntry<MemoryModuleType<?>> {
|
||||
public static final MemoryModuleType<Void> field_220940_a = func_220937_a("dummy", Optional.empty());
|
||||
public static final MemoryModuleType<GlobalPos> field_220941_b = func_220937_a("home", Optional.of(GlobalPos::func_218176_a));
|
||||
public static final MemoryModuleType<GlobalPos> field_220942_c = func_220937_a("job_site", Optional.of(GlobalPos::func_218176_a));
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/entity/ai/brain/schedule/Activity.java
|
||||
+++ b/net/minecraft/entity/ai/brain/schedule/Activity.java
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class Activity {
|
||||
+public class Activity extends net.minecraftforge.registries.ForgeRegistryEntry<Activity> {
|
||||
public static final Activity field_221365_a = func_221363_a("core");
|
||||
public static final Activity field_221366_b = func_221363_a("idle");
|
||||
public static final Activity field_221367_c = func_221363_a("work");
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/entity/ai/brain/schedule/Schedule.java
|
||||
+++ b/net/minecraft/entity/ai/brain/schedule/Schedule.java
|
||||
@@ -8,7 +8,7 @@
|
||||
import java.util.stream.Collectors;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class Schedule {
|
||||
+public class Schedule extends net.minecraftforge.registries.ForgeRegistryEntry<Schedule> {
|
||||
public static final Schedule field_221383_a = func_221380_a("empty").func_221402_a(0, Activity.field_221366_b).func_221404_a();
|
||||
public static final Schedule field_221384_b = func_221380_a("simple").func_221402_a(5000, Activity.field_221367_c).func_221402_a(11000, Activity.field_221369_e).func_221404_a();
|
||||
public static final Schedule field_221385_c = func_221380_a("villager_baby").func_221402_a(10, Activity.field_221366_b).func_221402_a(3000, Activity.field_221368_d).func_221402_a(6000, Activity.field_221366_b).func_221402_a(10000, Activity.field_221368_d).func_221402_a(12000, Activity.field_221369_e).func_221404_a();
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/entity/ai/brain/sensor/SensorType.java
|
||||
+++ b/net/minecraft/entity/ai/brain/sensor/SensorType.java
|
||||
@@ -4,7 +4,7 @@
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class SensorType<U extends Sensor<?>> {
|
||||
+public class SensorType<U extends Sensor<?>> extends net.minecraftforge.registries.ForgeRegistryEntry<SensorType<?>> {
|
||||
public static final SensorType<DummySensor> field_220997_a = func_220996_a("dummy", DummySensor::new);
|
||||
public static final SensorType<NearestLivingEntitiesSensor> field_220998_b = func_220996_a("nearest_living_entities", NearestLivingEntitiesSensor::new);
|
||||
public static final SensorType<NearestPlayersSensor> field_220999_c = func_220996_a("nearest_players", NearestPlayersSensor::new);
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/entity/item/PaintingType.java
|
||||
+++ b/net/minecraft/entity/item/PaintingType.java
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class PaintingType {
|
||||
+public class PaintingType extends net.minecraftforge.registries.ForgeRegistryEntry<PaintingType> {
|
||||
public static final PaintingType field_200843_b = func_221119_a("kebab", 16, 16);
|
||||
public static final PaintingType field_200844_c = func_221119_a("aztec", 16, 16);
|
||||
public static final PaintingType field_200845_d = func_221119_a("alban", 16, 16);
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/entity/merchant/villager/VillagerProfession.java
|
||||
+++ b/net/minecraft/entity/merchant/villager/VillagerProfession.java
|
||||
@@ -9,7 +9,7 @@
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.village.PointOfInterestType;
|
||||
|
||||
-public class VillagerProfession {
|
||||
+public class VillagerProfession extends net.minecraftforge.registries.ForgeRegistryEntry<VillagerProfession> {
|
||||
public static final VillagerProfession field_221151_a = func_221147_a("none", PointOfInterestType.field_221054_b);
|
||||
public static final VillagerProfession field_221152_b = func_221147_a("armorer", PointOfInterestType.field_221055_c);
|
||||
public static final VillagerProfession field_221153_c = func_221147_a("butcher", PointOfInterestType.field_221056_d);
|
|
@ -5,7 +5,7 @@
|
|||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public abstract class Fluid {
|
||||
+public abstract class Fluid implements net.minecraftforge.common.extensions.IForgeFluid {
|
||||
+public abstract class Fluid extends net.minecraftforge.registries.ForgeRegistryEntry<Fluid> implements net.minecraftforge.common.extensions.IForgeFluid {
|
||||
public static final ObjectIntIdentityMap<IFluidState> field_207201_d = new ObjectIntIdentityMap<>();
|
||||
protected final StateContainer<Fluid, IFluidState> field_207202_e;
|
||||
private IFluidState field_207200_b;
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/item/crafting/CookingRecipeSerializer.java
|
||||
+++ b/net/minecraft/item/crafting/CookingRecipeSerializer.java
|
||||
@@ -8,7 +8,7 @@
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class CookingRecipeSerializer<T extends AbstractCookingRecipe> implements IRecipeSerializer<T> {
|
||||
+public class CookingRecipeSerializer<T extends AbstractCookingRecipe> extends net.minecraftforge.registries.ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<T> {
|
||||
private final int field_222178_t;
|
||||
private final CookingRecipeSerializer.IFactory<T> field_222179_u;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/item/crafting/IRecipeSerializer.java
|
||||
+++ b/net/minecraft/item/crafting/IRecipeSerializer.java
|
||||
@@ -5,7 +5,7 @@
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public interface IRecipeSerializer<T extends IRecipe<?>> {
|
||||
+public interface IRecipeSerializer<T extends IRecipe<?>> extends net.minecraftforge.registries.IForgeRegistryEntry<IRecipeSerializer<?>> {
|
||||
IRecipeSerializer<ShapedRecipe> field_222157_a = func_222156_a("crafting_shaped", new ShapedRecipe.Serializer());
|
||||
IRecipeSerializer<ShapelessRecipe> field_222158_b = func_222156_a("crafting_shapeless", new ShapelessRecipe.Serializer());
|
||||
SpecialRecipeSerializer<ArmorDyeRecipe> field_222159_c = func_222156_a("crafting_special_armordye", new SpecialRecipeSerializer<>(ArmorDyeRecipe::new));
|
|
@ -88,7 +88,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
public static class Serializer implements IRecipeSerializer<ShapedRecipe> {
|
||||
- public static class Serializer implements IRecipeSerializer<ShapedRecipe> {
|
||||
+ public static class Serializer extends net.minecraftforge.registries.ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<ShapedRecipe> {
|
||||
+ private static final ResourceLocation NAME = new ResourceLocation("minecraft", "crafting_shaped");
|
||||
public ShapedRecipe func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_) {
|
||||
String s = JSONUtils.func_151219_a(p_199425_2_, "group", "");
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
return p_194133_1_ * p_194133_2_ >= this.field_77579_b.size();
|
||||
}
|
||||
|
||||
public static class Serializer implements IRecipeSerializer<ShapelessRecipe> {
|
||||
- public static class Serializer implements IRecipeSerializer<ShapelessRecipe> {
|
||||
+ public static class Serializer extends net.minecraftforge.registries.ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<ShapelessRecipe> {
|
||||
+ private static final ResourceLocation NAME = new ResourceLocation("minecraft", "crafting_shapeless");
|
||||
public ShapelessRecipe func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_) {
|
||||
String s = JSONUtils.func_151219_a(p_199425_2_, "group", "");
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/item/crafting/SingleItemRecipe.java
|
||||
+++ b/net/minecraft/item/crafting/SingleItemRecipe.java
|
||||
@@ -64,7 +64,7 @@
|
||||
return this.field_222132_b.func_77946_l();
|
||||
}
|
||||
|
||||
- public static class Serializer<T extends SingleItemRecipe> implements IRecipeSerializer<T> {
|
||||
+ public static class Serializer<T extends SingleItemRecipe> extends net.minecraftforge.registries.ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<T> {
|
||||
final SingleItemRecipe.Serializer.IRecipeFactory<T> field_222180_t;
|
||||
|
||||
protected Serializer(SingleItemRecipe.Serializer.IRecipeFactory<T> p_i50146_1_) {
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/item/crafting/SpecialRecipeSerializer.java
|
||||
+++ b/net/minecraft/item/crafting/SpecialRecipeSerializer.java
|
||||
@@ -5,7 +5,7 @@
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
-public class SpecialRecipeSerializer<T extends IRecipe<?>> implements IRecipeSerializer<T> {
|
||||
+public class SpecialRecipeSerializer<T extends IRecipe<?>> extends net.minecraftforge.registries.ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<T> {
|
||||
private final Function<ResourceLocation, T> field_222176_t;
|
||||
|
||||
public SpecialRecipeSerializer(Function<ResourceLocation, T> p_i50024_1_) {
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/particles/ParticleType.java
|
||||
+++ b/net/minecraft/particles/ParticleType.java
|
||||
@@ -3,7 +3,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class ParticleType<T extends IParticleData> {
|
||||
+public class ParticleType<T extends IParticleData> extends net.minecraftforge.registries.ForgeRegistryEntry<ParticleType<?>> {
|
||||
private final boolean field_197581_e;
|
||||
private final IParticleData.IDeserializer<T> field_197582_f;
|
||||
|
11
patches/minecraft/net/minecraft/stats/StatType.java.patch
Normal file
11
patches/minecraft/net/minecraft/stats/StatType.java.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/stats/StatType.java
|
||||
+++ b/net/minecraft/stats/StatType.java
|
||||
@@ -7,7 +7,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class StatType<T> implements Iterable<Stat<T>> {
|
||||
+public class StatType<T> extends net.minecraftforge.registries.ForgeRegistryEntry<StatType<?>> implements Iterable<Stat<T>> {
|
||||
private final Registry<T> field_199082_a;
|
||||
private final Map<T, Stat<T>> field_199083_b = new IdentityHashMap<>();
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/util/registry/Registry.java
|
||||
+++ b/net/minecraft/util/registry/Registry.java
|
||||
@@ -66,32 +66,36 @@
|
||||
@@ -66,71 +66,75 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
@ -16,7 +16,8 @@
|
|||
+ @Deprecated public static final Registry<SoundEvent> field_212633_v = forge("sound_event", SoundEvent.class, () -> {
|
||||
return SoundEvents.field_187638_cR;
|
||||
});
|
||||
public static final DefaultedRegistry<Fluid> field_212619_h = func_222933_a("fluid", "empty", () -> {
|
||||
- public static final DefaultedRegistry<Fluid> field_212619_h = func_222933_a("fluid", "empty", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<Fluid> field_212619_h = forgeDefaulted("fluid", Fluid.class, () -> {
|
||||
return Fluids.field_204541_a;
|
||||
});
|
||||
- public static final Registry<Effect> field_212631_t = func_222935_a("mob_effect", () -> {
|
||||
|
@ -43,41 +44,105 @@
|
|||
+ @Deprecated public static final DefaultedRegistry<Potion> field_212621_j = forgeDefaulted("potion", Potion.class, () -> {
|
||||
return Potions.field_185229_a;
|
||||
});
|
||||
public static final Registry<WorldCarver<?>> field_218377_o = func_222935_a("carver", () -> {
|
||||
@@ -106,7 +110,7 @@
|
||||
public static final Registry<Placement<?>> field_218380_r = func_222935_a("decorator", () -> {
|
||||
- public static final Registry<WorldCarver<?>> field_218377_o = func_222935_a("carver", () -> {
|
||||
+ @Deprecated public static final Registry<WorldCarver<?>> field_218377_o = forge("carver", WorldCarver.class, () -> {
|
||||
return WorldCarver.field_222709_a;
|
||||
});
|
||||
- public static final Registry<SurfaceBuilder<?>> field_218378_p = func_222935_a("surface_builder", () -> {
|
||||
+ @Deprecated public static final Registry<SurfaceBuilder<?>> field_218378_p = forge("surface_builder", SurfaceBuilder.class, () -> {
|
||||
return SurfaceBuilder.field_215396_G;
|
||||
});
|
||||
- public static final Registry<Feature<?>> field_218379_q = func_222935_a("feature", () -> {
|
||||
+ @Deprecated public static final Registry<Feature<?>> field_218379_q = forge("feature", Feature.class, () -> {
|
||||
return Feature.field_202290_aj;
|
||||
});
|
||||
- public static final Registry<Placement<?>> field_218380_r = func_222935_a("decorator", () -> {
|
||||
+ @Deprecated public static final Registry<Placement<?>> field_218380_r = forge("decorator", Placement.class, () -> {
|
||||
return Placement.field_215022_h;
|
||||
});
|
||||
- public static final Registry<Biome> field_212624_m = func_222935_a("biome", () -> {
|
||||
+ @Deprecated public static final Registry<Biome> field_212624_m = forge("biome", Biome.class, () -> {
|
||||
return Biomes.field_180279_ad;
|
||||
});
|
||||
public static final Registry<ParticleType<? extends IParticleData>> field_212632_u = func_222935_a("particle_type", () -> {
|
||||
@@ -115,13 +119,13 @@
|
||||
public static final Registry<BiomeProviderType<?, ?>> field_212625_n = func_222935_a("biome_source_type", () -> {
|
||||
- public static final Registry<ParticleType<? extends IParticleData>> field_212632_u = func_222935_a("particle_type", () -> {
|
||||
+ @Deprecated public static final Registry<ParticleType<? extends IParticleData>> field_212632_u = forge("particle_type", ParticleType.class, () -> {
|
||||
return ParticleTypes.field_197611_d;
|
||||
});
|
||||
- public static final Registry<BiomeProviderType<?, ?>> field_212625_n = func_222935_a("biome_source_type", () -> {
|
||||
+ @Deprecated public static final Registry<BiomeProviderType<?, ?>> field_212625_n = forge("biome_source_type", BiomeProviderType.class, () -> {
|
||||
return BiomeProviderType.field_206859_d;
|
||||
});
|
||||
- public static final Registry<TileEntityType<?>> field_212626_o = func_222935_a("block_entity_type", () -> {
|
||||
+ @Deprecated public static final Registry<TileEntityType<?>> field_212626_o = forge("block_entity_type", TileEntityType.class, () -> {
|
||||
return TileEntityType.field_200971_b;
|
||||
});
|
||||
public static final Registry<ChunkGeneratorType<?, ?>> field_212627_p = func_222935_a("chunk_generator_type", () -> {
|
||||
- public static final Registry<ChunkGeneratorType<?, ?>> field_212627_p = func_222935_a("chunk_generator_type", () -> {
|
||||
+ @Deprecated public static final Registry<ChunkGeneratorType<?, ?>> field_212627_p = forge("chunk_generator_type", ChunkGeneratorType.class, () -> {
|
||||
return ChunkGeneratorType.field_205489_f;
|
||||
});
|
||||
- public static final Registry<DimensionType> field_212622_k = func_222935_a("dimension_type", () -> {
|
||||
+ public static final Registry<DimensionType> field_212622_k = func_222939_a("dimension_type", net.minecraftforge.common.DimensionManager.getRegistry(), () -> {
|
||||
return DimensionType.OVERWORLD;
|
||||
});
|
||||
public static final DefaultedRegistry<PaintingType> field_212620_i = func_222933_a("motive", "kebab", () -> {
|
||||
@@ -148,7 +152,7 @@
|
||||
- public static final DefaultedRegistry<PaintingType> field_212620_i = func_222933_a("motive", "kebab", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<PaintingType> field_212620_i = forgeDefaulted("motive", PaintingType.class, () -> {
|
||||
return PaintingType.field_200843_b;
|
||||
});
|
||||
public static final Registry<ResourceLocation> field_212623_l = func_222935_a("custom_stat", () -> {
|
||||
return Stats.field_75953_u;
|
||||
});
|
||||
- public static final DefaultedRegistry<ChunkStatus> field_218360_A = func_222933_a("chunk_status", "empty", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<ChunkStatus> field_218360_A = forgeDefaulted("chunk_status", ChunkStatus.class, () -> {
|
||||
return ChunkStatus.EMPTY;
|
||||
});
|
||||
public static final Registry<Structure<?>> field_218361_B = func_222935_a("structure_feature", () -> {
|
||||
@@ -148,37 +152,37 @@
|
||||
public static final Registry<IJigsawDeserializer> field_218365_F = func_222935_a("structure_pool_element", () -> {
|
||||
return IJigsawDeserializer.field_214931_e;
|
||||
});
|
||||
- public static final Registry<ContainerType<?>> field_218366_G = func_222935_a("menu", () -> {
|
||||
+ public static final Registry<ContainerType<?>> field_218366_G = forge("menu", ContainerType.class, () -> {
|
||||
+ @Deprecated public static final Registry<ContainerType<?>> field_218366_G = forge("menu", ContainerType.class, () -> {
|
||||
return ContainerType.field_221514_h;
|
||||
});
|
||||
public static final Registry<IRecipeType<?>> field_218367_H = func_222935_a("recipe_type", () -> {
|
||||
return IRecipeType.field_222149_a;
|
||||
});
|
||||
- public static final Registry<IRecipeSerializer<?>> field_218368_I = func_222935_a("recipe_serializer", () -> {
|
||||
+ @Deprecated public static final Registry<IRecipeSerializer<?>> field_218368_I = forge("recipe_serializer", IRecipeSerializer.class, () -> {
|
||||
return IRecipeSerializer.field_222158_b;
|
||||
});
|
||||
- public static final Registry<StatType<?>> field_212634_w = func_222935_a("stat_type", () -> {
|
||||
+ @Deprecated public static final Registry<StatType<?>> field_212634_w = forge("stat_type", StatType.class, () -> {
|
||||
return Stats.field_75929_E;
|
||||
});
|
||||
public static final DefaultedRegistry<IVillagerType> field_218369_K = func_222933_a("villager_type", "plains", () -> {
|
||||
return IVillagerType.field_221175_c;
|
||||
});
|
||||
- public static final DefaultedRegistry<VillagerProfession> field_218370_L = func_222933_a("villager_profession", "none", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<VillagerProfession> field_218370_L = forgeDefaulted("villager_profession", VillagerProfession.class, () -> {
|
||||
return VillagerProfession.field_221151_a;
|
||||
});
|
||||
- public static final DefaultedRegistry<PointOfInterestType> field_218371_M = func_222933_a("point_of_interest_type", "unemployed", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<PointOfInterestType> field_218371_M = forgeDefaulted("point_of_interest_type", PointOfInterestType.class, () -> {
|
||||
return PointOfInterestType.field_221054_b;
|
||||
});
|
||||
- public static final DefaultedRegistry<MemoryModuleType<?>> field_218372_N = func_222933_a("memory_module_type", "dummy", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<MemoryModuleType<?>> field_218372_N = forgeDefaulted("memory_module_type", MemoryModuleType.class, () -> {
|
||||
return MemoryModuleType.field_220940_a;
|
||||
});
|
||||
- public static final DefaultedRegistry<SensorType<?>> field_218373_O = func_222933_a("sensor_type", "dummy", () -> {
|
||||
+ @Deprecated public static final DefaultedRegistry<SensorType<?>> field_218373_O = forgeDefaulted("sensor_type", SensorType.class, () -> {
|
||||
return SensorType.field_220997_a;
|
||||
});
|
||||
- public static final Registry<Schedule> field_218374_P = func_222935_a("schedule", () -> {
|
||||
+ @Deprecated public static final Registry<Schedule> field_218374_P = forge("schedule", Schedule.class, () -> {
|
||||
return Schedule.field_221383_a;
|
||||
});
|
||||
- public static final Registry<Activity> field_218375_Q = func_222935_a("activity", () -> {
|
||||
+ @Deprecated public static final Registry<Activity> field_218375_Q = forge("activity", Activity.class, () -> {
|
||||
return Activity.field_221366_b;
|
||||
});
|
||||
|
||||
@@ -230,6 +234,14 @@
|
||||
return ((MutableRegistry<T>)p_218343_0_).func_218382_a(p_218343_1_, new ResourceLocation(p_218343_2_), p_218343_3_);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/village/PointOfInterestType.java
|
||||
+++ b/net/minecraft/village/PointOfInterestType.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class PointOfInterestType {
|
||||
+public class PointOfInterestType extends net.minecraftforge.registries.ForgeRegistryEntry<PointOfInterestType> {
|
||||
private static final Predicate<PointOfInterestType> field_221071_s = (p_221041_0_) -> {
|
||||
return Registry.field_218370_L.func_201756_e().map(VillagerProfession::func_221149_b).collect(Collectors.toSet()).contains(p_221041_0_);
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/biome/provider/BiomeProviderType.java
|
||||
+++ b/net/minecraft/world/biome/provider/BiomeProviderType.java
|
||||
@@ -4,7 +4,7 @@
|
||||
import java.util.function.Supplier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
-public class BiomeProviderType<C extends IBiomeProviderSettings, T extends BiomeProvider> {
|
||||
+public class BiomeProviderType<C extends IBiomeProviderSettings, T extends BiomeProvider> extends net.minecraftforge.registries.ForgeRegistryEntry<BiomeProviderType<?, ?>> {
|
||||
public static final BiomeProviderType<CheckerboardBiomeProviderSettings, CheckerboardBiomeProvider> field_205460_b = func_212581_a("checkerboard", CheckerboardBiomeProvider::new, CheckerboardBiomeProviderSettings::new);
|
||||
public static final BiomeProviderType<SingleBiomeProviderSettings, SingleBiomeProvider> field_205461_c = func_212581_a("fixed", SingleBiomeProvider::new, SingleBiomeProviderSettings::new);
|
||||
public static final BiomeProviderType<OverworldBiomeProviderSettings, OverworldBiomeProvider> field_206859_d = func_212581_a("vanilla_layered", OverworldBiomeProvider::new, OverworldBiomeProviderSettings::new);
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/chunk/ChunkStatus.java
|
||||
+++ b/net/minecraft/world/chunk/ChunkStatus.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraft.world.gen.WorldGenRegion;
|
||||
import net.minecraft.world.gen.feature.template.TemplateManager;
|
||||
|
||||
-public class ChunkStatus {
|
||||
+public class ChunkStatus extends net.minecraftforge.registries.ForgeRegistryEntry<ChunkStatus> {
|
||||
private static final EnumSet<Heightmap.Type> field_222618_n = EnumSet.of(Heightmap.Type.OCEAN_FLOOR_WG, Heightmap.Type.WORLD_SURFACE_WG);
|
||||
private static final EnumSet<Heightmap.Type> field_222619_o = EnumSet.of(Heightmap.Type.OCEAN_FLOOR, Heightmap.Type.WORLD_SURFACE, Heightmap.Type.MOTION_BLOCKING, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES);
|
||||
private static final ChunkStatus.ILoadingWorker field_223211_p = (p_222588_0_, p_222588_1_, p_222588_2_, p_222588_3_, p_222588_4_, p_222588_5_) -> {
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/gen/ChunkGeneratorType.java
|
||||
+++ b/net/minecraft/world/gen/ChunkGeneratorType.java
|
||||
@@ -7,7 +7,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class ChunkGeneratorType<C extends GenerationSettings, T extends ChunkGenerator<C>> implements IChunkGeneratorFactory<C, T> {
|
||||
+public class ChunkGeneratorType<C extends GenerationSettings, T extends ChunkGenerator<C>> extends net.minecraftforge.registries.ForgeRegistryEntry<ChunkGeneratorType<?, ?>> implements IChunkGeneratorFactory<C, T> {
|
||||
public static final ChunkGeneratorType<OverworldGenSettings, OverworldChunkGenerator> field_206911_b = func_212676_a("surface", OverworldChunkGenerator::new, OverworldGenSettings::new, true);
|
||||
public static final ChunkGeneratorType<NetherGenSettings, NetherChunkGenerator> field_206912_c = func_212676_a("caves", NetherChunkGenerator::new, NetherGenSettings::new, true);
|
||||
public static final ChunkGeneratorType<EndGenerationSettings, EndChunkGenerator> field_206913_d = func_212676_a("floating_islands", EndChunkGenerator::new, EndGenerationSettings::new, true);
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/gen/carver/WorldCarver.java
|
||||
+++ b/net/minecraft/world/gen/carver/WorldCarver.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
import net.minecraft.world.gen.feature.ProbabilityConfig;
|
||||
|
||||
-public abstract class WorldCarver<C extends ICarverConfig> {
|
||||
+public abstract class WorldCarver<C extends ICarverConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<WorldCarver<?>> {
|
||||
public static final WorldCarver<ProbabilityConfig> field_222709_a = func_222699_a("cave", new CaveWorldCarver(ProbabilityConfig::func_214645_a, 256));
|
||||
public static final WorldCarver<ProbabilityConfig> field_222710_b = func_222699_a("hell_cave", new NetherCaveWorldCarver(ProbabilityConfig::func_214645_a));
|
||||
public static final WorldCarver<ProbabilityConfig> field_222711_c = func_222699_a("canyon", new CanyonWorldCarver(ProbabilityConfig::func_214645_a));
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/gen/feature/Feature.java
|
||||
+++ b/net/minecraft/world/gen/feature/Feature.java
|
||||
@@ -44,7 +44,7 @@
|
||||
import net.minecraft.world.gen.feature.structure.WoodlandMansionStructure;
|
||||
import net.minecraft.world.gen.placement.CountConfig;
|
||||
|
||||
-public abstract class Feature<FC extends IFeatureConfig> {
|
||||
+public abstract class Feature<FC extends IFeatureConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<Feature<?>> {
|
||||
public static final Structure<PillagerOutpostConfig> field_214536_b = func_214468_a("pillager_outpost", new PillagerOutpostStructure(PillagerOutpostConfig::func_214642_a));
|
||||
public static final Structure<MineshaftConfig> field_202329_g = func_214468_a("mineshaft", new MineshaftStructure(MineshaftConfig::func_214638_a));
|
||||
public static final Structure<NoFeatureConfig> field_202330_h = func_214468_a("woodland_mansion", new WoodlandMansionStructure(NoFeatureConfig::func_214639_a));
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/gen/placement/Placement.java
|
||||
+++ b/net/minecraft/world/gen/placement/Placement.java
|
||||
@@ -13,7 +13,7 @@
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.IFeatureConfig;
|
||||
|
||||
-public abstract class Placement<DC extends IPlacementConfig> {
|
||||
+public abstract class Placement<DC extends IPlacementConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<Placement<?>> {
|
||||
public static final Placement<FrequencyConfig> field_215015_a = func_214999_a("count_heightmap", new AtSurface(FrequencyConfig::func_214721_a));
|
||||
public static final Placement<FrequencyConfig> field_215016_b = func_214999_a("count_top_solid", new TopSolid(FrequencyConfig::func_214721_a));
|
||||
public static final Placement<FrequencyConfig> field_215017_c = func_214999_a("count_heightmap_32", new SurfacePlus32(FrequencyConfig::func_214721_a));
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java
|
||||
+++ b/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java
|
||||
@@ -9,7 +9,7 @@
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
|
||||
-public abstract class SurfaceBuilder<C extends ISurfaceBuilderConfig> {
|
||||
+public abstract class SurfaceBuilder<C extends ISurfaceBuilderConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<SurfaceBuilder<?>> {
|
||||
public static final BlockState field_215409_f = Blocks.field_150350_a.func_176223_P();
|
||||
public static final BlockState field_215410_g = Blocks.field_150346_d.func_176223_P();
|
||||
public static final BlockState field_215411_h = Blocks.field_196658_i.func_176223_P();
|
|
@ -22,14 +22,32 @@ package net.minecraftforge.registries;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ai.brain.memory.MemoryModuleType;
|
||||
import net.minecraft.entity.ai.brain.schedule.Activity;
|
||||
import net.minecraft.entity.ai.brain.schedule.Schedule;
|
||||
import net.minecraft.entity.ai.brain.sensor.SensorType;
|
||||
import net.minecraft.entity.item.PaintingType;
|
||||
import net.minecraft.entity.merchant.villager.VillagerProfession;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.util.registry.Bootstrap;
|
||||
import net.minecraft.village.PointOfInterestType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.stats.StatType;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.provider.BiomeProviderType;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
import net.minecraft.world.gen.ChunkGeneratorType;
|
||||
import net.minecraft.world.gen.carver.WorldCarver;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.placement.Placement;
|
||||
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
|
@ -42,7 +60,9 @@ public class ForgeRegistries
|
|||
{
|
||||
static { init(); } // This must be above the fields so we guarantee it's run before findRegistry is called. Yay static inializers
|
||||
|
||||
// Game objects
|
||||
public static final IForgeRegistry<Block> BLOCKS = RegistryManager.ACTIVE.getRegistry(Block.class);
|
||||
public static final IForgeRegistry<Fluid> FLUIDS = RegistryManager.ACTIVE.getRegistry(Fluid.class);
|
||||
public static final IForgeRegistry<Item> ITEMS = RegistryManager.ACTIVE.getRegistry(Item.class);
|
||||
public static final IForgeRegistry<Effect> POTIONS = RegistryManager.ACTIVE.getRegistry(Effect.class);
|
||||
public static final IForgeRegistry<Biome> BIOMES = RegistryManager.ACTIVE.getRegistry(Biome.class);
|
||||
|
@ -51,7 +71,30 @@ public class ForgeRegistries
|
|||
public static final IForgeRegistry<Enchantment> ENCHANTMENTS = RegistryManager.ACTIVE.getRegistry(Enchantment.class);
|
||||
public static final IForgeRegistry<EntityType<?>> ENTITIES = RegistryManager.ACTIVE.getRegistry(EntityType.class);
|
||||
public static final IForgeRegistry<TileEntityType<?>> TILE_ENTITIES = RegistryManager.ACTIVE.getRegistry(TileEntityType.class);
|
||||
public static final IForgeRegistry<ParticleType<?>> PARTICLE_TYPES = RegistryManager.ACTIVE.getRegistry(ParticleType.class);
|
||||
public static final IForgeRegistry<ContainerType<?>> CONTAINERS = RegistryManager.ACTIVE.getRegistry(ContainerType.class);
|
||||
public static final IForgeRegistry<PaintingType> PAINTING_TYPES = RegistryManager.ACTIVE.getRegistry(PaintingType.class);
|
||||
public static final IForgeRegistry<IRecipeSerializer<?>> RECIPE_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(IRecipeSerializer.class);
|
||||
public static final IForgeRegistry<StatType<?>> STAT_TYPES = RegistryManager.ACTIVE.getRegistry(StatType.class);
|
||||
|
||||
// Villages
|
||||
public static final IForgeRegistry<VillagerProfession> PROFESSIONS = RegistryManager.ACTIVE.getRegistry(VillagerProfession.class);
|
||||
public static final IForgeRegistry<PointOfInterestType> POI_TYPES = RegistryManager.ACTIVE.getRegistry(PointOfInterestType.class);
|
||||
public static final IForgeRegistry<MemoryModuleType<?>> MEMORY_MODULE_TYPES = RegistryManager.ACTIVE.getRegistry(MemoryModuleType.class);
|
||||
public static final IForgeRegistry<SensorType<?>> SENSOR_TYPES = RegistryManager.ACTIVE.getRegistry(SensorType.class);
|
||||
public static final IForgeRegistry<Schedule> SCHEDULES = RegistryManager.ACTIVE.getRegistry(Schedule.class);
|
||||
public static final IForgeRegistry<Activity> ACTIVITIES = RegistryManager.ACTIVE.getRegistry(Activity.class);
|
||||
|
||||
// Worldgen
|
||||
public static final IForgeRegistry<WorldCarver<?>> WORLD_CARVERS = RegistryManager.ACTIVE.getRegistry(WorldCarver.class);
|
||||
public static final IForgeRegistry<SurfaceBuilder<?>> SURFACE_BUILDERS = RegistryManager.ACTIVE.getRegistry(SurfaceBuilder.class);
|
||||
public static final IForgeRegistry<Feature<?>> FEATURES = RegistryManager.ACTIVE.getRegistry(Feature.class);
|
||||
public static final IForgeRegistry<Placement<?>> DECORATORS = RegistryManager.ACTIVE.getRegistry(Placement.class);
|
||||
public static final IForgeRegistry<BiomeProviderType<?, ?>> BIOME_PROVIDER_TYPES = RegistryManager.ACTIVE.getRegistry(BiomeProviderType.class);
|
||||
public static final IForgeRegistry<ChunkGeneratorType<?, ?>> CHUNK_GENERATOR_TYPES = RegistryManager.ACTIVE.getRegistry(ChunkGeneratorType.class);
|
||||
public static final IForgeRegistry<ChunkStatus> CHUNK_STATUS = RegistryManager.ACTIVE.getRegistry(ChunkStatus.class);
|
||||
|
||||
// Custom forge registries
|
||||
public static final IForgeRegistry<ModDimension> MOD_DIMENSIONS = RegistryManager.ACTIVE.getRegistry(ModDimension.class);
|
||||
public static final IForgeRegistry<DataSerializerEntry> DATA_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(DataSerializerEntry.class);
|
||||
|
||||
|
@ -63,5 +106,4 @@ public class ForgeRegistries
|
|||
GameData.init();
|
||||
Bootstrap.register();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,20 +26,38 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ai.brain.memory.MemoryModuleType;
|
||||
import net.minecraft.entity.ai.brain.schedule.Activity;
|
||||
import net.minecraft.entity.ai.brain.schedule.Schedule;
|
||||
import net.minecraft.entity.ai.brain.sensor.SensorType;
|
||||
import net.minecraft.entity.item.PaintingType;
|
||||
import net.minecraft.entity.merchant.villager.VillagerProfession;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.network.datasync.IDataSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.stats.StatType;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.registry.SimpleRegistry;
|
||||
import net.minecraft.village.PointOfInterestType;
|
||||
import net.minecraft.util.registry.DefaultedRegistry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.provider.BiomeProviderType;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
import net.minecraft.world.gen.ChunkGeneratorType;
|
||||
import net.minecraft.world.gen.carver.WorldCarver;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.placement.Placement;
|
||||
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
|
@ -70,8 +88,6 @@ import java.util.stream.Collectors;
|
|||
|
||||
import static net.minecraftforge.registries.ForgeRegistry.REGISTRIES;
|
||||
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException.WrappedPrintStream;
|
||||
|
||||
/**
|
||||
* INTERNAL ONLY
|
||||
* MODDERS SHOULD HAVE NO REASON TO USE THIS CLASS
|
||||
|
@ -80,17 +96,44 @@ public class GameData
|
|||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
public static final ResourceLocation BLOCKS = new ResourceLocation("minecraft:blocks");
|
||||
public static final ResourceLocation ITEMS = new ResourceLocation("minecraft:items");
|
||||
public static final ResourceLocation POTIONS = new ResourceLocation("minecraft:potions");
|
||||
public static final ResourceLocation BIOMES = new ResourceLocation("minecraft:biomes");
|
||||
public static final ResourceLocation SOUNDEVENTS = new ResourceLocation("minecraft:soundevents");
|
||||
public static final ResourceLocation POTIONTYPES = new ResourceLocation("minecraft:potiontypes");
|
||||
public static final ResourceLocation ENCHANTMENTS = new ResourceLocation("minecraft:enchantments");
|
||||
public static final ResourceLocation ENTITIES = new ResourceLocation("minecraft:entities");
|
||||
public static final ResourceLocation TILEENTITIES = new ResourceLocation("minecraft:tileentities");
|
||||
public static final ResourceLocation CONTAINERS = new ResourceLocation("minecraft:containers");
|
||||
public static final ResourceLocation PROFESSIONS = new ResourceLocation("minecraft:villagerprofessions");
|
||||
// Vanilla registries
|
||||
// Names used here match those in net.minecraft.util.Registry
|
||||
|
||||
// Game objects
|
||||
public static final ResourceLocation BLOCKS = new ResourceLocation("block");
|
||||
public static final ResourceLocation FLUIDS = new ResourceLocation("fluid");
|
||||
public static final ResourceLocation ITEMS = new ResourceLocation("item");
|
||||
public static final ResourceLocation POTIONS = new ResourceLocation("mob_effect");
|
||||
public static final ResourceLocation BIOMES = new ResourceLocation("biome");
|
||||
public static final ResourceLocation SOUNDEVENTS = new ResourceLocation("sound_event");
|
||||
public static final ResourceLocation POTIONTYPES = new ResourceLocation("potion");
|
||||
public static final ResourceLocation ENCHANTMENTS = new ResourceLocation("enchantment");
|
||||
public static final ResourceLocation ENTITIES = new ResourceLocation("entity_type");
|
||||
public static final ResourceLocation TILEENTITIES = new ResourceLocation("block_entity_type");
|
||||
public static final ResourceLocation PARTICLE_TYPES = new ResourceLocation("particle_type");
|
||||
public static final ResourceLocation CONTAINERS = new ResourceLocation("menu");
|
||||
public static final ResourceLocation PAINTING_TYPES = new ResourceLocation("motive"); // sic
|
||||
public static final ResourceLocation RECIPE_SERIALIZERS = new ResourceLocation("recipe_serializer");
|
||||
public static final ResourceLocation STAT_TYPES = new ResourceLocation("stat_type");
|
||||
|
||||
// Villages
|
||||
public static final ResourceLocation PROFESSIONS = new ResourceLocation("villager_profession");
|
||||
public static final ResourceLocation POI_TYPES = new ResourceLocation("point_of_interest_type");
|
||||
public static final ResourceLocation MEMORY_MODULE_TYPES = new ResourceLocation("memory_module_type");
|
||||
public static final ResourceLocation SENSOR_TYPES = new ResourceLocation("sensor_type");
|
||||
public static final ResourceLocation SCHEDULES = new ResourceLocation("schedule");
|
||||
public static final ResourceLocation ACTIVITIES = new ResourceLocation("activities");
|
||||
|
||||
// Worldgen
|
||||
public static final ResourceLocation WORLD_CARVERS = new ResourceLocation("carver");
|
||||
public static final ResourceLocation SURFACE_BUILDERS = new ResourceLocation("surface_builder");
|
||||
public static final ResourceLocation FEATURES = new ResourceLocation("feature");
|
||||
public static final ResourceLocation DECORATORS = new ResourceLocation("decorator");
|
||||
public static final ResourceLocation BIOME_PROVIDER_TYPES = new ResourceLocation("biome_source_type");
|
||||
public static final ResourceLocation CHUNK_GENERATOR_TYPES = new ResourceLocation("chunk_generator_type");
|
||||
public static final ResourceLocation CHUNK_STATUS = new ResourceLocation("chunk_status");
|
||||
|
||||
// Custom forge registries
|
||||
public static final ResourceLocation MODDIMENSIONS = new ResourceLocation("forge:moddimensions");
|
||||
public static final ResourceLocation SERIALIZERS = new ResourceLocation("minecraft:dataserializers");
|
||||
|
||||
|
@ -119,16 +162,42 @@ public class GameData
|
|||
if (hasInit)
|
||||
return;
|
||||
hasInit = true;
|
||||
makeRegistry(BLOCKS, Block.class, new ResourceLocation("air")).addCallback(BlockCallbacks.INSTANCE).create();
|
||||
makeRegistry(ITEMS, Item.class, new ResourceLocation("air")).addCallback(ItemCallbacks.INSTANCE).create();
|
||||
makeRegistry(POTIONS, Effect.class ).create();
|
||||
makeRegistry(BIOMES, Biome.class ).create();
|
||||
makeRegistry(SOUNDEVENTS, SoundEvent.class ).create();
|
||||
makeRegistry(POTIONTYPES, Potion.class, new ResourceLocation("empty")).create();
|
||||
makeRegistry(ENCHANTMENTS, Enchantment.class ).create();
|
||||
makeRegistry(ENTITIES, EntityType.class, new ResourceLocation("pig")).create();
|
||||
makeRegistry(TILEENTITIES, TileEntityType.class).disableSaving().create();
|
||||
|
||||
// Game objects
|
||||
makeRegistry(BLOCKS, Block.class, new ResourceLocation("air")).addCallback(BlockCallbacks.INSTANCE).legacyName("blocks").create();
|
||||
makeRegistry(FLUIDS, Fluid.class, new ResourceLocation("empty")).create();
|
||||
makeRegistry(ITEMS, Item.class, new ResourceLocation("air")).addCallback(ItemCallbacks.INSTANCE).legacyName("items").create();
|
||||
makeRegistry(POTIONS, Effect.class).legacyName("potions").create();
|
||||
makeRegistry(BIOMES, Biome.class).legacyName("biomes").create();
|
||||
makeRegistry(SOUNDEVENTS, SoundEvent.class).legacyName("soundevents").create();
|
||||
makeRegistry(POTIONTYPES, Potion.class, new ResourceLocation("empty")).legacyName("potiontypes").create();
|
||||
makeRegistry(ENCHANTMENTS, Enchantment.class).legacyName("enchantments").create();
|
||||
makeRegistry(ENTITIES, EntityType.class, new ResourceLocation("pig")).legacyName("entities").create();
|
||||
makeRegistry(TILEENTITIES, TileEntityType.class).disableSaving().legacyName("tileentities").create();
|
||||
makeRegistry(PARTICLE_TYPES, ParticleType.class).disableSaving().create();
|
||||
makeRegistry(CONTAINERS, ContainerType.class).disableSaving().create();
|
||||
makeRegistry(PAINTING_TYPES, PaintingType.class, new ResourceLocation("kebab")).create();
|
||||
makeRegistry(RECIPE_SERIALIZERS, IRecipeSerializer.class).disableSaving().create();
|
||||
makeRegistry(STAT_TYPES, StatType.class).create();
|
||||
|
||||
// Villagers
|
||||
makeRegistry(PROFESSIONS, VillagerProfession.class, new ResourceLocation("none")).create();
|
||||
makeRegistry(POI_TYPES, PointOfInterestType.class, new ResourceLocation("unemployed")).disableSync().create();
|
||||
makeRegistry(MEMORY_MODULE_TYPES, MemoryModuleType.class, new ResourceLocation("dummy")).disableSync().create();
|
||||
makeRegistry(SENSOR_TYPES, SensorType.class, new ResourceLocation("dummy")).disableSaving().disableSync().create();
|
||||
makeRegistry(SCHEDULES, Schedule.class).disableSaving().disableSync().create();
|
||||
makeRegistry(ACTIVITIES, Activity.class).disableSaving().disableSync().create();
|
||||
|
||||
// Worldgen
|
||||
makeRegistry(WORLD_CARVERS, WorldCarver.class).disableSaving().disableSync().create();
|
||||
makeRegistry(SURFACE_BUILDERS, SurfaceBuilder.class).disableSaving().disableSync().create();
|
||||
makeRegistry(FEATURES, Feature.class).disableSaving().disableSync().create();
|
||||
makeRegistry(DECORATORS, Placement.class).disableSaving().disableSync().create();
|
||||
makeRegistry(BIOME_PROVIDER_TYPES, BiomeProviderType.class).disableSaving().disableSync().create();
|
||||
makeRegistry(CHUNK_GENERATOR_TYPES, ChunkGeneratorType.class).disableSaving().disableSync().create();
|
||||
makeRegistry(CHUNK_STATUS, ChunkStatus.class, new ResourceLocation("empty")).disableSaving().disableSync().create();
|
||||
|
||||
// Custom forge registries
|
||||
makeRegistry(MODDIMENSIONS, ModDimension.class ).disableSaving().create();
|
||||
makeRegistry(SERIALIZERS, DataSerializerEntry.class, 256 /*vanilla space*/, MAX_VARINT).disableSaving().disableOverrides().addCallback(SerializerCallbacks.INSTANCE).create();
|
||||
}
|
||||
|
@ -580,6 +649,11 @@ public class GameData
|
|||
RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.dump(name));
|
||||
RegistryManager.ACTIVE.registries.forEach((name, reg) -> reg.resetDelegates());
|
||||
|
||||
// Update legacy names
|
||||
snapshot = snapshot.entrySet().stream()
|
||||
.sorted(Map.Entry.comparingByKey()) // FIXME Registries need dependency ordering, this makes sure blocks are done before items (for ItemCallbacks) but it's lazy as hell
|
||||
.collect(Collectors.toMap(e -> RegistryManager.ACTIVE.updateLegacyName(e.getKey()), Map.Entry::getValue, (k1, k2) -> k1, LinkedHashMap::new));
|
||||
|
||||
if (isLocalWorld)
|
||||
{
|
||||
List<ResourceLocation> missingRegs = snapshot.keySet().stream().filter(name -> !RegistryManager.ACTIVE.registries.containsKey(name)).collect(Collectors.toList());
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
|
||||
package net.minecraftforge.registries;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
|
@ -48,6 +50,7 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
|||
private boolean allowModifications = false;
|
||||
private DummyFactory<T> dummyFactory;
|
||||
private MissingFactory<T> missingFactory;
|
||||
private Set<ResourceLocation> legacyNames = new HashSet<>();
|
||||
|
||||
public RegistryBuilder<T> setName(ResourceLocation name)
|
||||
{
|
||||
|
@ -165,6 +168,17 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
|||
return this;
|
||||
}
|
||||
|
||||
public RegistryBuilder<T> legacyName(String name)
|
||||
{
|
||||
return legacyName(new ResourceLocation(name));
|
||||
}
|
||||
|
||||
public RegistryBuilder<T> legacyName(ResourceLocation name)
|
||||
{
|
||||
this.legacyNames.add(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IForgeRegistry<T> create()
|
||||
{
|
||||
return RegistryManager.ACTIVE.createRegistry(registryName, this);
|
||||
|
@ -297,4 +311,9 @@ public class RegistryBuilder<T extends IForgeRegistryEntry<T>>
|
|||
{
|
||||
return sync;
|
||||
}
|
||||
|
||||
public Set<ResourceLocation> getLegacyNames()
|
||||
{
|
||||
return legacyNames;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ package net.minecraftforge.registries;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -50,6 +51,7 @@ public class RegistryManager
|
|||
private BiMap<Class<? extends IForgeRegistryEntry<?>>, ResourceLocation> superTypes = HashBiMap.create();
|
||||
private Set<ResourceLocation> persisted = Sets.newHashSet();
|
||||
private Set<ResourceLocation> synced = Sets.newHashSet();
|
||||
private Map<ResourceLocation, ResourceLocation> legacyNames = new HashMap<>();
|
||||
private final String name;
|
||||
|
||||
public RegistryManager(String name)
|
||||
|
@ -84,6 +86,19 @@ public class RegistryManager
|
|||
return this.registries.inverse().get(reg);
|
||||
}
|
||||
|
||||
public <V extends IForgeRegistryEntry<V>> ResourceLocation updateLegacyName(ResourceLocation legacyName)
|
||||
{
|
||||
while (getRegistry(legacyName) == null)
|
||||
{
|
||||
legacyName = legacyNames.get(legacyName);
|
||||
if (legacyName == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return legacyName;
|
||||
}
|
||||
|
||||
public <V extends IForgeRegistryEntry<V>> ForgeRegistry<V> getRegistry(ResourceLocation key, RegistryManager other)
|
||||
{
|
||||
if (!this.registries.containsKey(key))
|
||||
|
@ -97,6 +112,9 @@ public class RegistryManager
|
|||
this.persisted.add(key);
|
||||
if (other.synced.contains(key))
|
||||
this.synced.add(key);
|
||||
other.legacyNames.entrySet().stream()
|
||||
.filter(e -> e.getValue().equals(key))
|
||||
.forEach(e -> addLegacyName(e.getKey(), e.getValue()));
|
||||
}
|
||||
return getRegistry(key);
|
||||
}
|
||||
|
@ -120,9 +138,20 @@ public class RegistryManager
|
|||
this.persisted.add(name);
|
||||
if (builder.getSync())
|
||||
this.synced.add(name);
|
||||
for (ResourceLocation legacyName : builder.getLegacyNames())
|
||||
addLegacyName(legacyName, name);
|
||||
return getRegistry(name);
|
||||
}
|
||||
|
||||
private void addLegacyName(ResourceLocation legacyName, ResourceLocation name)
|
||||
{
|
||||
if (this.legacyNames.containsKey(legacyName))
|
||||
{
|
||||
throw new IllegalArgumentException("Legacy name conflict for registry " + name + ", upgrade path must be linear: " + legacyName);
|
||||
}
|
||||
this.legacyNames.put(legacyName, name);
|
||||
}
|
||||
|
||||
private void findSuperTypes(Class<?> type, Set<Class<?>> types)
|
||||
{
|
||||
if (type == null || type == Object.class)
|
||||
|
|
|
@ -93,6 +93,12 @@ public net.minecraft.util.DamageSource *() #All methods public, most are already
|
|||
# GoalSelector
|
||||
public net.minecraft.entity.ai.goal.GoalSelector field_75782_a # taskEntries
|
||||
public net.minecraft.entity.ai.goal.GoalSelector$EntityAITaskEntry
|
||||
# MemoryModuleType
|
||||
public net.minecraft.entity.ai.brain.memory.MemoryModuleType <init>(Ljava/util/Optional;)V
|
||||
# SensorType
|
||||
public net.minecraft.entity.ai.brain.sensor.SensorType <init>(Ljava/util/function/Supplier;)V
|
||||
# Activity
|
||||
public net.minecraft.entity.ai.brain.schedule.Activity <init>(Ljava/lang/String;)V
|
||||
# ExperienceOrbEntity
|
||||
public net.minecraft.entity.item.ExperienceOrbEntity field_70530_e # xpValue
|
||||
# Village
|
||||
|
@ -104,6 +110,8 @@ public net.minecraft.world.chunk.ServerChunkProvider field_186029_c # chunkGener
|
|||
public net.minecraft.world.chunk.ServerChunkProvider field_73244_f # loadedChunkHashMap
|
||||
#public net.minecraft.world.chunk.ServerChunkProvider field_73245_g # loadedChunks
|
||||
public net.minecraft.world.chunk.ServerChunkProvider field_73251_h # worldObj
|
||||
# ChunkStatus
|
||||
public net.minecraft.world.chunk.ChunkStatus <init>(Ljava/lang/String;Lnet/minecraft/world/chunk/ChunkStatus;ILjava/util/EnumSet;Lnet/minecraft/world/chunk/ChunkStatus$Type;Lnet/minecraft/world/chunk/ChunkStatus$IGenerationWorker;Lnet/minecraft/world/chunk/ChunkStatus$ILoadingWorker;)V
|
||||
|
||||
# ItemRenderer
|
||||
protected net.minecraft.client.renderer.entity.ItemRenderer func_177078_a(Lnet/minecraft/item/ItemStack;)I # getMiniItemCount
|
||||
|
@ -231,6 +239,12 @@ public net.minecraft.client.gui.SlotGui field_148155_a # width - needed for conf
|
|||
public net.minecraft.client.gui.SlotGui field_148158_l # height - needed for config GUI stuff
|
||||
public net.minecraft.client.gui.SlotGui field_148160_j # headerPadding - needed for config GUI stuff
|
||||
|
||||
# VillagerProfession
|
||||
public net.minecraft.entity.merchant.villager.VillagerProfession <init>(Ljava/lang/String;Lnet/minecraft/village/PointOfInterestType;Lcom/google/common/collect/ImmutableSet;Lcom/google/common/collect/ImmutableSet;)V
|
||||
# PointOFInterestType
|
||||
public net.minecraft.village.PointOfInterestType <init>(Ljava/lang/String;Ljava/util/Set;ILnet/minecraft/util/SoundEvent;Ljava/util/function/Predicate;)V
|
||||
public net.minecraft.village.PointOfInterestType <init>(Ljava/lang/String;Ljava/util/Set;ILnet/minecraft/util/SoundEvent;)V
|
||||
|
||||
# Villager Traid Classes
|
||||
public net.minecraft.entity.passive.VillagerEntity$EmeraldForItems
|
||||
public net.minecraft.entity.passive.VillagerEntity$ITradeList
|
||||
|
@ -388,3 +402,7 @@ public net.minecraft.world.gen.ChunkGeneratorType$Settings
|
|||
|
||||
#IChunkGeneratorFactory
|
||||
public net.minecraft.world.gen.IChunkGeneratorFactory
|
||||
|
||||
#ParticleType ctors
|
||||
public net.minecraft.particles.ParticleType <init>(ZLnet/minecraft/particles/IParticleData$IDeserializer;)V
|
||||
public net.minecraft.particles.BasicParticleType <init>(Z)V
|
||||
|
|
Loading…
Reference in a new issue