Add forge registries for applicable new registry types

Expose constructors for all forge registry entries
Also, remove deprecation on ItemCameraTransforms/TransformType
This commit is contained in:
tterrag 2020-05-23 13:42:56 -04:00
parent d5cb0935e9
commit f0bab0fb38
10 changed files with 96 additions and 22 deletions

View File

@ -11,7 +11,7 @@
List<BakedQuad> func_200117_a(@Nullable BlockState p_200117_1_, @Nullable Direction p_200117_2_, Random p_200117_3_);
boolean func_177555_b();
@@ -21,9 +23,12 @@
@@ -21,9 +23,13 @@
boolean func_188618_c();
@ -20,6 +20,7 @@
TextureAtlasSprite func_177554_e();
- ItemCameraTransforms func_177552_f();
+ /**@deprecated Forge: Use {@link net.minecraftforge.client.extensions.IForgeBakedModel#handlePerspective(net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType, com.mojang.blaze3d.matrix.MatrixStack)} instead */
+ @Deprecated
+ default ItemCameraTransforms func_177552_f() { return ItemCameraTransforms.field_178357_a; }

View File

@ -1,17 +1,6 @@
--- a/net/minecraft/client/renderer/model/ItemCameraTransforms.java
+++ b/net/minecraft/client/renderer/model/ItemCameraTransforms.java
@@ -9,6 +9,10 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
+/**
+ * @deprecated use {@link net.minecraft.client.renderer.model.IBakedModel#handlePerspective(TransformType)} instead
+ */
+@Deprecated
@OnlyIn(Dist.CLIENT)
public class ItemCameraTransforms {
public static final ItemCameraTransforms field_178357_a = new ItemCameraTransforms();
@@ -25,6 +29,7 @@
@@ -25,6 +25,7 @@
this(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a);
}
@ -19,7 +8,7 @@
public ItemCameraTransforms(ItemCameraTransforms p_i46443_1_) {
this.field_188036_k = p_i46443_1_.field_188036_k;
this.field_188037_l = p_i46443_1_.field_188037_l;
@@ -36,6 +41,7 @@
@@ -36,6 +37,7 @@
this.field_181700_p = p_i46443_1_.field_181700_p;
}
@ -27,7 +16,7 @@
public ItemCameraTransforms(ItemTransformVec3f p_i46569_1_, ItemTransformVec3f p_i46569_2_, ItemTransformVec3f p_i46569_3_, ItemTransformVec3f p_i46569_4_, ItemTransformVec3f p_i46569_5_, ItemTransformVec3f p_i46569_6_, ItemTransformVec3f p_i46569_7_, ItemTransformVec3f p_i46569_8_) {
this.field_188036_k = p_i46569_1_;
this.field_188037_l = p_i46569_2_;
@@ -47,6 +53,7 @@
@@ -47,6 +49,7 @@
this.field_181700_p = p_i46569_8_;
}

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/util/registry/Registry.java
+++ b/net/minecraft/util/registry/Registry.java
@@ -70,47 +70,51 @@
@@ -70,88 +70,90 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -64,9 +64,20 @@
+ @Deprecated public static final Registry<Biome> field_212624_m = forge("biome", Biome.class, () -> {
return Biomes.field_180279_ad;
});
public static final Registry<BlockStateProviderType<?>> field_229387_t_ = func_222935_a("block_state_provider_type", () -> {
@@ -125,33 +129,31 @@
public static final Registry<TreeDecoratorType<?>> field_229390_w_ = func_222935_a("tree_decorator_type", () -> {
- public static final Registry<BlockStateProviderType<?>> field_229387_t_ = func_222935_a("block_state_provider_type", () -> {
+ @Deprecated public static final Registry<BlockStateProviderType<?>> field_229387_t_ = forge("block_state_provider_type", BlockStateProviderType.class, () -> {
return BlockStateProviderType.field_227394_a_;
});
- public static final Registry<BlockPlacerType<?>> field_229388_u_ = func_222935_a("block_placer_type", () -> {
+ @Deprecated public static final Registry<BlockPlacerType<?>> field_229388_u_ = forge("block_placer_type", BlockPlacerType.class, () -> {
return BlockPlacerType.field_227259_a_;
});
- public static final Registry<FoliagePlacerType<?>> field_229389_v_ = func_222935_a("foliage_placer_type", () -> {
+ @Deprecated public static final Registry<FoliagePlacerType<?>> field_229389_v_ = forge("foliage_placer_type", FoliagePlacerType.class, () -> {
return FoliagePlacerType.field_227386_a_;
});
- public static final Registry<TreeDecoratorType<?>> field_229390_w_ = func_222935_a("tree_decorator_type", () -> {
+ @Deprecated public static final Registry<TreeDecoratorType<?>> field_229390_w_ = forge("tree_decorator_type", TreeDecoratorType.class, () -> {
return TreeDecoratorType.field_227426_b_;
});
- public static final Registry<ParticleType<? extends IParticleData>> field_212632_u = func_222935_a("particle_type", () -> {

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/blockplacer/BlockPlacerType.java
+++ b/net/minecraft/world/gen/blockplacer/BlockPlacerType.java
@@ -4,7 +4,7 @@
import java.util.function.Function;
import net.minecraft.util.registry.Registry;
-public class BlockPlacerType<P extends BlockPlacer> {
+public class BlockPlacerType<P extends BlockPlacer> extends net.minecraftforge.registries.ForgeRegistryEntry<BlockPlacerType<?>> {
public static final BlockPlacerType<SimpleBlockPlacer> field_227259_a_ = func_227264_a_("simple_block_placer", SimpleBlockPlacer::new);
public static final BlockPlacerType<DoublePlantBlockPlacer> field_227260_b_ = func_227264_a_("double_plant_placer", DoublePlantBlockPlacer::new);
public static final BlockPlacerType<ColumnBlockPlacer> field_227261_c_ = func_227264_a_("column_placer", ColumnBlockPlacer::new);

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java
+++ b/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java
@@ -4,7 +4,7 @@
import java.util.function.Function;
import net.minecraft.util.registry.Registry;
-public class BlockStateProviderType<P extends BlockStateProvider> {
+public class BlockStateProviderType<P extends BlockStateProvider> extends net.minecraftforge.registries.ForgeRegistryEntry<BlockStateProviderType<?>> {
public static final BlockStateProviderType<SimpleBlockStateProvider> field_227394_a_ = func_227400_a_("simple_state_provider", SimpleBlockStateProvider::new);
public static final BlockStateProviderType<WeightedBlockStateProvider> field_227395_b_ = func_227400_a_("weighted_state_provider", WeightedBlockStateProvider::new);
public static final BlockStateProviderType<PlainFlowerBlockStateProvider> field_227396_c_ = func_227400_a_("plain_flower_provider", PlainFlowerBlockStateProvider::new);

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java
+++ b/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java
@@ -4,7 +4,7 @@
import java.util.function.Function;
import net.minecraft.util.registry.Registry;
-public class FoliagePlacerType<P extends FoliagePlacer> {
+public class FoliagePlacerType<P extends FoliagePlacer> extends net.minecraftforge.registries.ForgeRegistryEntry<FoliagePlacerType<?>> {
public static final FoliagePlacerType<BlobFoliagePlacer> field_227386_a_ = func_227392_a_("blob_foliage_placer", BlobFoliagePlacer::new);
public static final FoliagePlacerType<SpruceFoliagePlacer> field_227387_b_ = func_227392_a_("spruce_foliage_placer", SpruceFoliagePlacer::new);
public static final FoliagePlacerType<PineFoliagePlacer> field_227388_c_ = func_227392_a_("pine_foliage_placer", PineFoliagePlacer::new);

View File

@ -0,0 +1,11 @@
--- a/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java
+++ b/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java
@@ -4,7 +4,7 @@
import java.util.function.Function;
import net.minecraft.util.registry.Registry;
-public class TreeDecoratorType<P extends TreeDecorator> {
+public class TreeDecoratorType<P extends TreeDecorator> extends net.minecraftforge.registries.ForgeRegistryEntry<TreeDecoratorType<?>> {
public static final TreeDecoratorType<TrunkVineTreeDecorator> field_227425_a_ = func_227432_a_("trunk_vine", TrunkVineTreeDecorator::new);
public static final TreeDecoratorType<LeaveVineTreeDecorator> field_227426_b_ = func_227432_a_("leave_vine", LeaveVineTreeDecorator::new);
public static final TreeDecoratorType<CocoaTreeDecorator> field_227427_c_ = func_227432_a_("cocoa", CocoaTreeDecorator::new);

View File

@ -44,10 +44,14 @@ 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.blockplacer.BlockPlacerType;
import net.minecraft.world.gen.blockstateprovider.BlockStateProviderType;
import net.minecraft.world.gen.carver.WorldCarver;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.foliageplacer.FoliagePlacerType;
import net.minecraft.world.gen.placement.Placement;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.treedecorator.TreeDecoratorType;
import net.minecraftforge.common.ModDimension;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.fml.common.registry.GameRegistry;
@ -94,7 +98,11 @@ public class ForgeRegistries
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);
public static final IForgeRegistry<BlockStateProviderType<?>> BLOCK_STATE_PROVIDER_TYPES = RegistryManager.ACTIVE.getRegistry(BlockStateProviderType.class);
public static final IForgeRegistry<BlockPlacerType<?>> BLOCK_PLAYER_TYPES = RegistryManager.ACTIVE.getRegistry(BlockPlacerType.class);
public static final IForgeRegistry<FoliagePlacerType<?>> FOLIAGE_PLAYER_TYPES = RegistryManager.ACTIVE.getRegistry(FoliagePlacerType.class);
public static final IForgeRegistry<TreeDecoratorType<?>> TREE_DECORATOR_TYPES = RegistryManager.ACTIVE.getRegistry(TreeDecoratorType.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);

View File

@ -56,11 +56,15 @@ 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.blockplacer.BlockPlacerType;
import net.minecraft.world.gen.blockstateprovider.BlockStateProviderType;
import net.minecraft.world.gen.carver.WorldCarver;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.structure.Structure;
import net.minecraft.world.gen.foliageplacer.FoliagePlacerType;
import net.minecraft.world.gen.placement.Placement;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.treedecorator.TreeDecoratorType;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.ModDimension;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
@ -141,7 +145,11 @@ public class GameData
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");
public static final ResourceLocation BLOCK_STATE_PROVIDER_TYPES = new ResourceLocation("block_state_provider_type");
public static final ResourceLocation BLOCK_PLACER_TYPES = new ResourceLocation("block_placer_type");
public static final ResourceLocation FOLIAGE_PLACER_TYPES = new ResourceLocation("foliage_placer_type");
public static final ResourceLocation TREE_DECORATOR_TYPES = new ResourceLocation("tree_decorator_type");
// Custom forge registries
public static final ResourceLocation MODDIMENSIONS = new ResourceLocation("forge:moddimensions");
public static final ResourceLocation SERIALIZERS = new ResourceLocation("minecraft:dataserializers");
@ -208,7 +216,11 @@ public class GameData
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();
makeRegistry(BLOCK_STATE_PROVIDER_TYPES, BlockStateProviderType.class).disableSaving().disableSync().create();
makeRegistry(BLOCK_PLACER_TYPES, BlockPlacerType.class).disableSaving().disableSync().create();
makeRegistry(FOLIAGE_PLACER_TYPES, FoliagePlacerType.class).disableSaving().disableSync().create();
makeRegistry(TREE_DECORATOR_TYPES, TreeDecoratorType.class).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();

View File

@ -106,6 +106,7 @@ public net.minecraft.entity.ai.brain.schedule.Activity <init>(Ljava/lang/String;
public net.minecraft.entity.ai.brain.sensor.SensorType <init>(Ljava/util/function/Supplier;)V
public net.minecraft.entity.item.ExperienceOrbEntity field_70530_e # xpValue
protected net.minecraft.entity.item.TNTEntity func_70515_d()V # explode - make it easier to extend TNTEntity with custom explosion logic
public net.minecraft.entity.merchant.villager.VillagerProcession <init>(Ljava/lang/String;Lnet/minecraft/village/PointOfInterestType;Lcom/google/common/collect/ImmutableSet;Lcom/google/common/collect/ImmutableSet;Lnet/minecraft/util/SoundEvent;)V
protected net.minecraft.entity.monster.AbstractSkeletonEntity func_190727_o()Lnet/minecraft/util/SoundEvent; # getStepSound - make AbstractSkeletonEntity implementable
protected net.minecraft.entity.monster.SkeletonEntity func_190727_o()Lnet/minecraft/util/SoundEvent; # getStepSound - make AbstractSkeletonEntity implementable
protected net.minecraft.entity.monster.StrayEntity func_190727_o()Lnet/minecraft/util/SoundEvent; # getStepSound - make AbstractSkeletonEntity implementable
@ -149,6 +150,9 @@ protected net.minecraft.util.ObjectIntIdentityMap field_148749_a # internal map
protected net.minecraft.util.ObjectIntIdentityMap field_195868_a # nextId
public net.minecraft.util.WeightedRandom$Item field_76292_a #probability
public net.minecraft.util.concurrent.ThreadTaskExecutor func_213165_a(Ljava/lang/Runnable;)Ljava/util/concurrent/CompletableFuture; # func_213165_a
public net.minecraft.village.PointOfInterestType func_221042_a(Lnet/minecraft/block/Block;)Ljava/util/Set; # getAllStates
public net.minecraft.village.PointOfInterestType <init>(Ljava/lang/String;Ljava/util/Set;ILjava/util/function/Predicate;I)V
public net.minecraft.village.PointOfInterestType <init>(Ljava/lang/String;Ljava/util/Set;II)V
public net.minecraft.world.GameRules func_223595_a(Ljava/lang/String;Lnet/minecraft/world/GameRules$RuleType;)Lnet/minecraft/world/GameRules$RuleKey; # register
protected net.minecraft.world.Teleporter field_77187_a # random
protected net.minecraft.world.Teleporter field_85192_a # world
@ -163,9 +167,14 @@ public net.minecraft.world.biome.Biome func_180626_a(Lnet/minecraft/util/math/Bl
public net.minecraft.world.biome.DeepFrozenOceanBiome func_180626_a(Lnet/minecraft/util/math/BlockPos;)F # getTemperature
public net.minecraft.world.biome.FrozenOceanBiome func_180626_a(Lnet/minecraft/util/math/BlockPos;)F # getTemperature
public net.minecraft.world.biome.provider.BiomeProvider field_201540_a # BIOMES_TO_SPAWN_IN
public net.minecraft.world.biome.provider.BiomeProviderType <init>(Ljava/util/function/Function;Ljava/util/function/Function;)V
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
public net.minecraft.world.gen.IChunkGeneratorFactory
public net.minecraft.world.gen.layer.LayerUtil func_202829_a(JLnet/minecraft/world/gen/layer/traits/IAreaTransformer1;Lnet/minecraft/world/gen/area/IAreaFactory;ILjava/util/function/LongFunction;)Lnet/minecraft/world/gen/area/IAreaFactory; # repeat
public net.minecraft.world.gen.blockplacer.BlockPlacerType <init>(Ljava/util/function/Function;)V
public net.minecraft.world.gen.blockstateprovider.BlockStateProviderType <init>(Ljava/util/function/Function;)V
public net.minecraft.world.gen.foliageplacer.FoliagePlacerType <init>(Ljava/util/function/Function;)V
public net.minecraft.world.gen.treedecorator.TreeDecoratorType <init>(Ljava/util/function/Function;)V
private-f net.minecraft.world.server.ChunkHolder field_219320_o # block update location
public net.minecraft.world.server.ServerChunkProvider field_186029_c # chunkGenerator
public net.minecraft.world.server.ServerChunkProvider field_73251_h # worldObj