diff --git a/build.gradle b/build.gradle index 3c730e10a..95e1f5243 100644 --- a/build.gradle +++ b/build.gradle @@ -67,8 +67,8 @@ ext { } MAPPING_CHANNEL = 'snapshot' MAPPING_VERSION = '20200514-1.16' - MC_VERSION = '1.16.1' - MCP_VERSION = '20200625.160719' + MC_VERSION = '1.16.2' + MCP_VERSION = '20200812.004259' } project(':mcp') { @@ -211,7 +211,7 @@ project(':forge') { } ext { - SPEC_VERSION = '31.2' // This is overwritten by git tag, but here so dev time doesnt explode + SPEC_VERSION = '33.0' // This is overwritten by git tag, but here so dev time doesnt explode // The new versioning sceme is -.. // ForgeMC is a unique identifier for every MC version we have supported. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. diff --git a/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java.patch b/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java.patch index 463522084..bd830ef40 100644 --- a/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java.patch +++ b/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java.patch @@ -15,4 +15,4 @@ + public void func_230430_a_(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) { this.func_230446_a_(p_230430_1_); - this.func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215); + func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215); diff --git a/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch index 8eeea55b3..7a3250f31 100644 --- a/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch +++ b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch @@ -4,8 +4,8 @@ public void func_192113_a(ServerPlayerEntity p_192113_1_) { p_192113_1_.func_195068_e(this.field_192115_b); -- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, p_192113_1_.func_233580_cy_()).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f); -+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, p_192113_1_.func_233580_cy_()).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext +- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_237457_g_, p_192113_1_.func_213303_ch()).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f); ++ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_237457_g_, p_192113_1_.func_213303_ch()).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext boolean flag = false; for(ResourceLocation resourcelocation : this.field_192116_c) { diff --git a/patches/minecraft/net/minecraft/block/AbstractBlock.java.patch b/patches/minecraft/net/minecraft/block/AbstractBlock.java.patch index 99c995640..954e5f122 100644 --- a/patches/minecraft/net/minecraft/block/AbstractBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/AbstractBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/AbstractBlock.java +++ b/net/minecraft/block/AbstractBlock.java -@@ -59,7 +59,8 @@ +@@ -60,7 +60,8 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -10,7 +10,7 @@ protected static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP}; protected final Material field_149764_J; protected final boolean field_235688_at_; -@@ -86,6 +87,8 @@ +@@ -87,6 +88,8 @@ this.field_226887_g_ = p_i241196_1_.field_226894_k_; this.field_208621_p = p_i241196_1_.field_208772_j; this.field_235684_aB_ = p_i241196_1_; @@ -19,7 +19,7 @@ } @Deprecated -@@ -128,7 +131,7 @@ +@@ -129,7 +132,7 @@ @Deprecated public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) { @@ -28,7 +28,7 @@ p_196243_2_.func_175713_t(p_196243_3_); } -@@ -190,7 +193,7 @@ +@@ -191,7 +194,7 @@ @Deprecated public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) { @@ -37,7 +37,7 @@ } @Deprecated -@@ -293,8 +296,8 @@ +@@ -294,8 +297,8 @@ if (f == -1.0F) { return 0.0F; } else { @@ -48,7 +48,7 @@ } } -@@ -320,14 +323,14 @@ +@@ -321,14 +324,14 @@ return 0; } @@ -65,7 +65,7 @@ } return this.field_220085_g; -@@ -345,6 +348,10 @@ +@@ -346,6 +349,10 @@ return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P()); } @@ -76,7 +76,7 @@ public abstract static class AbstractBlockState extends StateHolder { private final int field_215708_d; private final boolean field_215709_e; -@@ -427,6 +434,8 @@ +@@ -428,6 +435,8 @@ return this.field_215708_d; } @@ -85,7 +85,7 @@ public boolean func_196958_f() { return this.field_235702_f_; } -@@ -435,6 +444,8 @@ +@@ -436,6 +445,8 @@ return this.field_235704_h_; } @@ -94,7 +94,7 @@ public BlockState func_185907_a(Rotation p_185907_1_) { return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_); } -@@ -786,6 +797,9 @@ +@@ -802,6 +813,9 @@ private ResourceLocation field_222381_j; private boolean field_226895_m_ = true; private boolean field_235813_o_; @@ -104,7 +104,7 @@ private AbstractBlock.IExtendedPositionPredicate> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> { return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14; }; -@@ -847,6 +861,8 @@ +@@ -863,6 +877,8 @@ abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_; abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_; abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_; @@ -113,7 +113,7 @@ return abstractblock$properties; } -@@ -861,6 +877,24 @@ +@@ -877,6 +893,24 @@ return this; } @@ -138,7 +138,7 @@ public AbstractBlock.Properties func_200941_a(float p_200941_1_) { this.field_200961_i = p_200941_1_; return this; -@@ -917,7 +951,7 @@ +@@ -933,7 +967,7 @@ } public AbstractBlock.Properties func_222379_b(Block p_222379_1_) { diff --git a/patches/minecraft/net/minecraft/block/AbstractFireBlock.java.patch b/patches/minecraft/net/minecraft/block/AbstractFireBlock.java.patch new file mode 100644 index 000000000..a91ea36d6 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/AbstractFireBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/block/AbstractFireBlock.java ++++ b/net/minecraft/block/AbstractFireBlock.java +@@ -124,6 +124,7 @@ + if (!p_220082_4_.func_203425_a(p_220082_1_.func_177230_c())) { + if (func_242649_a(p_220082_2_)) { + Optional optional = PortalSize.func_242964_a(p_220082_2_, p_220082_3_, Direction.Axis.X); ++ optional = net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_220082_2_, p_220082_3_, optional); + if (optional.isPresent()) { + optional.get().func_150859_c(); + return; diff --git a/patches/minecraft/net/minecraft/block/AbstractRailBlock.java.patch b/patches/minecraft/net/minecraft/block/AbstractRailBlock.java.patch index 575c20163..8dfda922f 100644 --- a/patches/minecraft/net/minecraft/block/AbstractRailBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/AbstractRailBlock.java.patch @@ -20,13 +20,13 @@ @@ -61,7 +62,7 @@ public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) { - if (!p_220069_2_.field_72995_K) { + if (!p_220069_2_.field_72995_K && p_220069_2_.func_180495_p(p_220069_3_).func_203425_a(this)) { - RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l()); + RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null); - if (func_235328_a_(p_220069_3_, p_220069_2_, railshape) && !p_220069_2_.func_175623_d(p_220069_3_)) { - if (!p_220069_6_) { - func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_); -@@ -113,7 +114,7 @@ + if (func_235328_a_(p_220069_3_, p_220069_2_, railshape)) { + func_220075_c(p_220069_1_, p_220069_2_, p_220069_3_); + p_220069_2_.func_217377_a(p_220069_3_, p_220069_6_); +@@ -110,7 +111,7 @@ public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) { if (!p_196243_5_) { super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_); @@ -35,7 +35,7 @@ p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this); } -@@ -132,5 +133,20 @@ +@@ -129,5 +130,20 @@ return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH); } diff --git a/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch b/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch index 37aabef79..2dba29c09 100644 --- a/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/AbstractTopPlantBlock.java +++ b/net/minecraft/block/AbstractTopPlantBlock.java -@@ -39,10 +39,11 @@ +@@ -32,10 +32,11 @@ } public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { diff --git a/patches/minecraft/net/minecraft/block/BambooBlock.java.patch b/patches/minecraft/net/minecraft/block/BambooBlock.java.patch index ee4b91c7b..316246c00 100644 --- a/patches/minecraft/net/minecraft/block/BambooBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/BambooBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/BambooBlock.java +++ b/net/minecraft/block/BambooBlock.java -@@ -101,8 +101,9 @@ +@@ -102,8 +102,9 @@ if (p_225542_1_.func_177229_b(field_220266_f) == 0) { if (p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) { int i = this.func_220260_b(p_225542_2_, p_225542_3_) + 1; diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index aa4991931..4270325b6 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/Block.java +++ b/net/minecraft/block/Block.java -@@ -52,9 +52,10 @@ +@@ -54,9 +54,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -22,7 +22,7 @@ this.field_176227_L = builder.func_235882_a_(Block::func_176223_P, BlockState::new); this.func_180632_j(this.field_176227_L.func_177621_b()); } -@@ -270,7 +273,7 @@ +@@ -261,7 +264,7 @@ } public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) { @@ -31,16 +31,16 @@ float f = 0.5F; double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; -@@ -282,7 +285,7 @@ +@@ -273,7 +276,7 @@ } - public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) { -- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) { -+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) { + public void func_180637_b(ServerWorld p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) { +- if (p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) { ++ if (p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) { while(p_180637_3_ > 0) { int i = ExperienceOrbEntity.func_70527_a(p_180637_3_); p_180637_3_ -= i; -@@ -292,6 +295,7 @@ +@@ -283,6 +286,7 @@ } @@ -48,7 +48,7 @@ public float func_149638_a() { return this.field_235689_au_; } -@@ -341,6 +345,7 @@ +@@ -332,6 +336,7 @@ p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D)); } @@ -56,7 +56,7 @@ public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) { return new ItemStack(this); } -@@ -372,6 +377,7 @@ +@@ -363,6 +368,7 @@ public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) { } @@ -64,7 +64,7 @@ public boolean func_149659_a(Explosion p_149659_1_) { return true; } -@@ -391,6 +397,7 @@ +@@ -382,6 +388,7 @@ return this.field_196275_y; } @@ -72,7 +72,7 @@ public SoundType func_220072_p(BlockState p_220072_1_) { return this.field_149762_H; } -@@ -400,7 +407,7 @@ +@@ -391,7 +398,7 @@ this.field_220086_i = Item.func_150898_a(this); } @@ -81,7 +81,7 @@ } public boolean func_208619_r() { -@@ -408,7 +415,7 @@ +@@ -399,7 +406,7 @@ } public String toString() { @@ -90,7 +90,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -419,6 +426,83 @@ +@@ -410,6 +417,83 @@ return this; } @@ -137,7 +137,7 @@ + } else if (net.minecraftforge.common.PlantType.CROP.equals(type)) { + return state.func_203425_a(Blocks.field_150458_ak); + } else if (net.minecraftforge.common.PlantType.CAVE.equals(type)) { -+ return Block.func_220056_d(state, world, pos, Direction.UP); ++ return state.func_224755_d(world, pos, Direction.UP); + } else if (net.minecraftforge.common.PlantType.PLAINS.equals(type)) { + return this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_230235_a_(this) || this.getBlock() == Blocks.field_150458_ak; + } else if (net.minecraftforge.common.PlantType.WATER.equals(type)) { diff --git a/patches/minecraft/net/minecraft/block/Blocks.java.patch b/patches/minecraft/net/minecraft/block/Blocks.java.patch index cd66baf7a..ad2a1c6e8 100644 --- a/patches/minecraft/net/minecraft/block/Blocks.java.patch +++ b/patches/minecraft/net/minecraft/block/Blocks.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/block/Blocks.java +++ b/net/minecraft/block/Blocks.java -@@ -26,6 +26,7 @@ - import net.minecraft.world.gen.feature.Feature; - import net.minecraft.world.gen.feature.HugeFungusConfig; +@@ -25,6 +25,7 @@ + import net.minecraft.world.IBlockReader; + import net.minecraft.world.gen.feature.Features; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class Blocks { public static final Block field_150350_a = func_222382_a("air", new AirBlock(AbstractBlock.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e().func_235859_g_())); public static final Block field_150348_b = func_222382_a("stone", new Block(AbstractBlock.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_235861_h_().func_200948_a(1.5F, 6.0F))); -@@ -120,7 +121,7 @@ +@@ -119,7 +120,7 @@ public static final Block field_196601_az = func_222382_a("green_bed", func_235422_a_(DyeColor.GREEN)); public static final Block field_196550_aA = func_222382_a("red_bed", func_235422_a_(DyeColor.RED)); public static final Block field_196551_aB = func_222382_a("black_bed", func_235422_a_(DyeColor.BLACK)); @@ -17,7 +17,7 @@ public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(AbstractBlock.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e))); public static final Block field_150320_F = func_222382_a("sticky_piston", func_235432_a_(true)); public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(AbstractBlock.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_235861_h_().func_200943_b(4.0F))); -@@ -938,15 +939,4 @@ +@@ -937,15 +938,4 @@ public static void func_235419_a_() { Block.field_176229_d.forEach(AbstractBlock.AbstractBlockState::func_215692_c); } diff --git a/patches/minecraft/net/minecraft/block/DetectorRailBlock.java.patch b/patches/minecraft/net/minecraft/block/DetectorRailBlock.java.patch index cc4984bde..50324f8f7 100644 --- a/patches/minecraft/net/minecraft/block/DetectorRailBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/DetectorRailBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/DetectorRailBlock.java +++ b/net/minecraft/block/DetectorRailBlock.java -@@ -129,6 +129,8 @@ +@@ -131,6 +131,8 @@ } List list1 = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, EntityPredicates.field_96566_b); diff --git a/patches/minecraft/net/minecraft/block/FireBlock.java.patch b/patches/minecraft/net/minecraft/block/FireBlock.java.patch index 519d71878..2139ce980 100644 --- a/patches/minecraft/net/minecraft/block/FireBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/FireBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/block/FireBlock.java +++ b/net/minecraft/block/FireBlock.java -@@ -76,13 +76,13 @@ +@@ -92,13 +92,13 @@ protected BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) { BlockPos blockpos = p_196448_2_.func_177977_b(); BlockState blockstate = p_196448_1_.func_180495_p(blockpos); - if (!this.func_196446_i(blockstate) && !blockstate.func_224755_d(p_196448_1_, blockpos, Direction.UP)) { -+ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !Block.func_220056_d(blockstate, p_196448_1_, blockpos, Direction.UP)) { ++ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !blockstate.func_224755_d(p_196448_1_, blockpos, Direction.UP)) { BlockState blockstate1 = this.func_176223_P(); for(Direction direction : Direction.values()) { @@ -16,7 +16,7 @@ } } -@@ -105,7 +105,7 @@ +@@ -121,7 +121,7 @@ } BlockState blockstate = p_225534_2_.func_180495_p(p_225534_3_.func_177977_b()); @@ -25,7 +25,7 @@ int i = p_225534_1_.func_177229_b(field_176543_a); if (!flag && p_225534_2_.func_72896_J() && this.func_176537_d(p_225534_2_, p_225534_3_) && p_225534_4_.nextFloat() < 0.2F + (float)i * 0.03F) { p_225534_2_.func_217377_a(p_225534_3_, false); -@@ -126,7 +126,7 @@ +@@ -142,7 +142,7 @@ return; } @@ -34,7 +34,7 @@ p_225534_2_.func_217377_a(p_225534_3_, false); return; } -@@ -134,12 +134,12 @@ +@@ -150,12 +150,12 @@ boolean flag1 = p_225534_2_.func_180502_D(p_225534_3_); int k = flag1 ? -50 : 0; @@ -53,7 +53,7 @@ BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable(); for(int l = -1; l <= 1; ++l) { -@@ -177,16 +177,18 @@ +@@ -193,16 +193,18 @@ return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d()); } @@ -74,7 +74,7 @@ if (p_176536_4_.nextInt(p_176536_3_) < i) { BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_); if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) { -@@ -196,11 +198,7 @@ +@@ -212,11 +214,7 @@ p_176536_1_.func_217377_a(p_176536_2_, false); } @@ -87,7 +87,7 @@ } } -@@ -212,7 +210,7 @@ +@@ -228,7 +226,7 @@ private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) { for(Direction direction : Direction.values()) { @@ -96,7 +96,7 @@ return true; } } -@@ -228,13 +226,14 @@ +@@ -244,13 +242,14 @@ for(Direction direction : Direction.values()) { BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction)); @@ -112,7 +112,7 @@ protected boolean func_196446_i(BlockState p_196446_1_) { return this.func_220275_r(p_196446_1_) > 0; } -@@ -253,10 +252,23 @@ +@@ -269,10 +268,23 @@ } private void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) { diff --git a/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch b/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch index 67ac9b896..fb2b960d2 100644 --- a/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/FlowingFluidBlock.java +++ b/net/minecraft/block/FlowingFluidBlock.java -@@ -31,10 +31,11 @@ +@@ -29,10 +29,11 @@ public class FlowingFluidBlock extends Block implements IBucketPickupHandler { public static final IntegerProperty field_176367_b = BlockStateProperties.field_208132_ag; @@ -13,7 +13,7 @@ public FlowingFluidBlock(FlowingFluid p_i49014_1_, AbstractBlock.Properties p_i49014_2_) { super(p_i49014_2_); this.field_204517_c = p_i49014_1_; -@@ -47,8 +48,21 @@ +@@ -45,8 +46,21 @@ this.field_212565_c.add(p_i49014_1_.func_207207_a(8, true)); this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0))); @@ -35,7 +35,7 @@ public VoxelShape func_220071_b(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, ISelectionContext p_220071_4_) { return p_220071_4_.func_216378_a(field_235510_c_, p_220071_3_, true) && p_220071_1_.func_177229_b(field_176367_b) == 0 && p_220071_4_.func_230426_a_(p_220071_2_.func_204610_c(p_220071_3_.func_177984_a()), this.field_204517_c) ? field_235510_c_ : VoxelShapes.func_197880_a(); } -@@ -71,6 +85,7 @@ +@@ -69,6 +83,7 @@ public FluidState func_204507_t(BlockState p_204507_1_) { int i = p_204507_1_.func_177229_b(field_176367_b); @@ -43,7 +43,7 @@ return this.field_212565_c.get(Math.min(i, 8)); } -@@ -122,13 +137,13 @@ +@@ -120,13 +135,13 @@ BlockPos blockpos = p_204515_2_.func_177972_a(direction); if (p_204515_1_.func_204610_c(blockpos).func_206884_a(FluidTags.field_206959_a)) { Block block = p_204515_1_.func_204610_c(p_204515_2_).func_206889_d() ? Blocks.field_150343_Z : Blocks.field_150347_e; @@ -59,9 +59,9 @@ this.func_180688_d(p_204515_1_, p_204515_2_); return false; } -@@ -166,4 +181,23 @@ +@@ -153,4 +168,23 @@ + return Fluids.field_204541_a; } - } + + // Forge start diff --git a/patches/minecraft/net/minecraft/block/MushroomBlock.java.patch b/patches/minecraft/net/minecraft/block/MushroomBlock.java.patch index e4105627c..83409f609 100644 --- a/patches/minecraft/net/minecraft/block/MushroomBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/MushroomBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/block/MushroomBlock.java +++ b/net/minecraft/block/MushroomBlock.java -@@ -63,7 +63,7 @@ - BlockPos blockpos = p_196260_3_.func_177977_b(); - BlockState blockstate = p_196260_2_.func_180495_p(blockpos); - if (!blockstate.func_203425_a(Blocks.field_150391_bh) && !blockstate.func_203425_a(Blocks.field_196661_l)) { +@@ -64,7 +64,7 @@ + if (blockstate.func_235714_a_(BlockTags.field_242171_aD)) { + return true; + } else { - return p_196260_2_.func_226659_b_(p_196260_3_, 0) < 13 && this.func_200014_a_(blockstate, p_196260_2_, blockpos); + return p_196260_2_.func_226659_b_(p_196260_3_, 0) < 13 && blockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.Direction.UP, this); - } else { - return true; } + } + diff --git a/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch b/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch deleted file mode 100644 index 1ded24af7..000000000 --- a/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/net/minecraft/block/NetherPortalBlock.java -+++ b/net/minecraft/block/NetherPortalBlock.java -@@ -70,7 +70,7 @@ - - public static boolean func_176548_d(IWorld p_176548_0_, BlockPos p_176548_1_) { - NetherPortalBlock.Size netherportalblock$size = func_201816_b(p_176548_0_, p_176548_1_); -- if (netherportalblock$size != null) { -+ if (netherportalblock$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_0_, p_176548_1_, netherportalblock$size)) { - netherportalblock$size.func_150859_c(); - return true; - } else { -@@ -241,12 +241,12 @@ - int i; - for(i = 0; i < 22; ++i) { - BlockPos blockpos = p_180120_1_.func_177967_a(p_180120_2_, i); -- if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).func_203425_a(Blocks.field_150343_Z)) { -+ if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).isPortalFrame(field_150867_a, blockpos.func_177977_b())) { - break; - } - } - -- return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).func_203425_a(Blocks.field_150343_Z) ? i : 0; -+ return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).isPortalFrame(field_150867_a, p_180120_1_.func_177967_a(p_180120_2_, i)) ? i : 0; - } - - public int func_181100_a() { -@@ -272,17 +272,17 @@ - } - - if (i == 0) { -- if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).func_203425_a(Blocks.field_150343_Z)) { -+ if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150863_d))) { - break label56; - } -- } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).func_203425_a(Blocks.field_150343_Z)) { -+ } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150866_c))) { - break label56; - } - } - } - - for(int j = 0; j < this.field_150868_h; ++j) { -- if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).func_203425_a(Blocks.field_150343_Z)) { -+ if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).isPortalFrame(field_150867_a, this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g))) { - this.field_150862_g = 0; - break; - } diff --git a/patches/minecraft/net/minecraft/block/OreBlock.java.patch b/patches/minecraft/net/minecraft/block/OreBlock.java.patch index 95b1928d5..920cec2c5 100644 --- a/patches/minecraft/net/minecraft/block/OreBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/OreBlock.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/block/OreBlock.java @@ -31,12 +31,10 @@ - public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { + public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_); - if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) { - int i = this.func_220281_a(p_220062_2_.field_73012_v); diff --git a/patches/minecraft/net/minecraft/block/PistonBlock.java.patch b/patches/minecraft/net/minecraft/block/PistonBlock.java.patch index 09369f973..a88b4e42c 100644 --- a/patches/minecraft/net/minecraft/block/PistonBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/PistonBlock.java.patch @@ -24,16 +24,16 @@ return true; } -@@ -230,7 +233,7 @@ +@@ -234,7 +237,7 @@ return false; } - return !p_185646_0_.func_177230_c().func_235695_q_(); + return !p_185646_0_.hasTileEntity(); - } else { - return false; } -@@ -271,7 +274,7 @@ + } else { + return false; +@@ -273,7 +276,7 @@ for(int k = list2.size() - 1; k >= 0; --k) { BlockPos blockpos2 = list2.get(k); BlockState blockstate1 = p_176319_1_.func_180495_p(blockpos2); @@ -42,7 +42,7 @@ func_220059_a(blockstate1, p_176319_1_, blockpos2, tileentity); p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18); ablockstate[j++] = blockstate1; -@@ -335,6 +338,10 @@ +@@ -337,6 +340,10 @@ return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N))); } diff --git a/patches/minecraft/net/minecraft/block/PortalSize.java.patch b/patches/minecraft/net/minecraft/block/PortalSize.java.patch new file mode 100644 index 000000000..9d282828f --- /dev/null +++ b/patches/minecraft/net/minecraft/block/PortalSize.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/block/PortalSize.java ++++ b/net/minecraft/block/PortalSize.java +@@ -16,7 +16,7 @@ + + public class PortalSize { + private static final AbstractBlock.IPositionPredicate field_242962_a = (p_242966_0_, p_242966_1_, p_242966_2_) -> { +- return p_242966_0_.func_203425_a(Blocks.field_150343_Z); ++ return p_242966_0_.isPortalFrame(p_242966_1_, p_242966_2_); + }; + private final IWorld field_150867_a; + private final Direction.Axis field_150865_b; diff --git a/patches/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch b/patches/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch index d71b325ab..5c5230173 100644 --- a/patches/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/block/RedstoneOreBlock.java @@ -71,11 +71,11 @@ - public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { + public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_); - if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) { - int i = 1 + p_220062_2_.field_73012_v.nextInt(5); diff --git a/patches/minecraft/net/minecraft/block/SpawnerBlock.java.patch b/patches/minecraft/net/minecraft/block/SpawnerBlock.java.patch index 646638993..30742c1dd 100644 --- a/patches/minecraft/net/minecraft/block/SpawnerBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/SpawnerBlock.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/block/SpawnerBlock.java @@ -18,10 +18,13 @@ - public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { + public void func_220062_a(BlockState p_220062_1_, ServerWorld p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) { super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_); - int i = 15 + p_220062_2_.field_73012_v.nextInt(15) + p_220062_2_.field_73012_v.nextInt(15); - this.func_180637_b(p_220062_2_, p_220062_3_, i); diff --git a/patches/minecraft/net/minecraft/block/VineBlock.java.patch b/patches/minecraft/net/minecraft/block/VineBlock.java.patch index 816bcb374..abcb3072b 100644 --- a/patches/minecraft/net/minecraft/block/VineBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/VineBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/VineBlock.java +++ b/net/minecraft/block/VineBlock.java -@@ -19,7 +19,7 @@ +@@ -22,7 +22,7 @@ import net.minecraft.world.IWorldReader; import net.minecraft.world.server.ServerWorld; @@ -9,7 +9,7 @@ public static final BooleanProperty field_176277_a = SixWayBlock.field_196496_z; public static final BooleanProperty field_176273_b = SixWayBlock.field_196488_a; public static final BooleanProperty field_176278_M = SixWayBlock.field_196490_b; -@@ -143,14 +143,14 @@ +@@ -152,14 +152,14 @@ } public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { @@ -26,7 +26,7 @@ Direction direction3 = direction.func_176746_e(); Direction direction4 = direction.func_176735_f(); boolean flag = p_225542_1_.func_177229_b(func_176267_a(direction3)); -@@ -207,7 +207,7 @@ +@@ -216,7 +216,7 @@ if (p_225542_3_.func_177956_o() > 0) { BlockPos blockpos1 = p_225542_3_.func_177977_b(); BlockState blockstate = p_225542_2_.func_180495_p(blockpos1); @@ -35,7 +35,7 @@ BlockState blockstate1 = blockstate.func_196958_f() ? this.func_176223_P() : blockstate; BlockState blockstate2 = this.func_196544_a(p_225542_1_, blockstate1, p_225542_4_); if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) { -@@ -313,4 +313,7 @@ +@@ -322,4 +322,7 @@ public static BooleanProperty func_176267_a(Direction p_176267_0_) { return field_196546_A.get(p_176267_0_); } diff --git a/patches/minecraft/net/minecraft/client/GameSettings.java.patch b/patches/minecraft/net/minecraft/client/GameSettings.java.patch index e633c6e9d..8333abf54 100644 --- a/patches/minecraft/net/minecraft/client/GameSettings.java.patch +++ b/patches/minecraft/net/minecraft/client/GameSettings.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/GameSettings.java +++ b/net/minecraft/client/GameSettings.java -@@ -164,6 +164,7 @@ +@@ -167,6 +167,7 @@ public boolean field_241568_aS_; public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) { @@ -8,7 +8,7 @@ this.field_74317_L = p_i46326_1_; this.field_74354_ai = new File(p_i46326_2_, "options.txt"); if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) { -@@ -507,7 +508,11 @@ +@@ -518,7 +519,11 @@ for(KeyBinding keybinding : this.field_74324_K) { if (s.equals("key_" + keybinding.func_151464_g())) { @@ -21,7 +21,7 @@ } } -@@ -554,6 +559,7 @@ +@@ -565,6 +570,7 @@ } public void func_74303_b() { @@ -29,7 +29,7 @@ try (PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.field_74354_ai), StandardCharsets.UTF_8))) { printwriter.println("version:" + SharedConstants.func_215069_a().getWorldVersion()); printwriter.println("autoJump:" + AbstractOption.field_216719_z.func_216741_b(this)); -@@ -635,7 +641,7 @@ +@@ -648,7 +654,7 @@ printwriter.println("syncChunkWrites:" + this.field_241568_aS_); for(KeyBinding keybinding : this.field_74324_K) { @@ -38,11 +38,10 @@ } for(SoundCategory soundcategory : SoundCategory.values()) { -@@ -733,4 +739,21 @@ - +@@ -747,6 +753,23 @@ p_198017_1_.func_198985_a(set); } -+ + + private void setForgeKeybindProperties() { + net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME; + field_74351_w.setKeyConflictContext(inGame); @@ -59,4 +58,7 @@ + field_151457_aa.setKeyConflictContext(inGame); + field_151458_ab.setKeyConflictContext(inGame); + } - } ++ + public PointOfView func_243230_g() { + return this.field_243228_bb; + } diff --git a/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch b/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch index c7f4ca024..50d77c861 100644 --- a/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch +++ b/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/KeyboardListener.java +++ b/net/minecraft/client/KeyboardListener.java -@@ -256,7 +256,9 @@ +@@ -255,7 +255,9 @@ } INestedGuiEventHandler inestedguieventhandler = this.field_197972_a.field_71462_r; @@ -11,7 +11,7 @@ if (this.field_197972_a.field_71474_y.field_152395_am.func_197976_a(p_197961_3_, p_197961_4_)) { this.field_197972_a.func_228018_at_().func_198077_g(); this.field_197972_a.field_71474_y.field_74353_u = this.field_197972_a.func_228018_at_().func_198113_j(); -@@ -275,6 +277,8 @@ +@@ -274,6 +276,8 @@ }); return; } @@ -20,7 +20,7 @@ } boolean flag = inestedguieventhandler == null || !(inestedguieventhandler.func_241217_q_() instanceof TextFieldWidget) || !((TextFieldWidget)inestedguieventhandler.func_241217_q_()).func_212955_f(); -@@ -294,10 +298,14 @@ +@@ -289,10 +293,14 @@ Screen.func_231153_a_(() -> { if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) { if (p_197961_5_ == 0) { @@ -37,7 +37,7 @@ } }, "keyPressed event handler", inestedguieventhandler.getClass().getCanonicalName()); -@@ -350,7 +358,7 @@ +@@ -345,7 +353,7 @@ } } } @@ -46,7 +46,7 @@ } } -@@ -360,12 +368,16 @@ +@@ -355,12 +363,16 @@ if (iguieventlistener != null && this.field_197972_a.func_213250_au() == null) { if (Character.charCount(p_197963_3_) == 1) { Screen.func_231153_a_(() -> { diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 0b8cc56c0..a471f90d4 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/Minecraft.java +++ b/net/minecraft/client/Minecraft.java -@@ -358,6 +358,7 @@ +@@ -357,6 +357,7 @@ public Minecraft(GameConfiguration p_i45547_1_) { super("Client"); field_71432_P = this; @@ -8,7 +8,7 @@ this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a; File file1 = p_i45547_1_.field_178744_c.field_178759_c; this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b; -@@ -370,7 +371,6 @@ +@@ -369,7 +370,6 @@ this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService(); this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a; field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a()); @@ -16,7 +16,7 @@ this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a; this.field_238175_ae_ = !p_i45547_1_.field_178741_d.field_239099_d_; this.field_238176_af_ = !p_i45547_1_.field_178741_d.field_239100_e_; -@@ -416,14 +416,15 @@ +@@ -415,14 +415,15 @@ this.field_195558_d.func_216526_a(this.field_71474_y.field_74350_i); this.field_71417_B = new MouseHelper(this); @@ -33,7 +33,7 @@ this.field_71474_y.func_198017_a(this.field_110448_aq); this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab); this.field_110451_am.func_219534_a(this.field_135017_as); -@@ -463,6 +464,7 @@ +@@ -462,6 +463,7 @@ this.func_193986_ar(); this.field_110451_am.func_219534_a(this.field_193995_ae); this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o); @@ -41,7 +41,7 @@ this.field_110451_am.func_219534_a(this.field_71452_i); this.field_213272_aL = new PaintingSpriteUploader(this.field_71446_o); this.field_110451_am.func_219534_a(this.field_213272_aL); -@@ -470,7 +472,8 @@ +@@ -469,7 +471,8 @@ this.field_110451_am.func_219534_a(this.field_213273_aM); this.field_241557_ar_ = new GPUWarning(); this.field_110451_am.func_219534_a(this.field_241557_ar_); @@ -51,7 +51,7 @@ this.field_184132_p = new DebugRenderer(this); RenderSystem.setErrorCallback(this::func_195545_a); if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) { -@@ -482,11 +485,6 @@ +@@ -481,11 +484,6 @@ this.field_195558_d.func_224798_d(this.field_71474_y.field_225307_E); this.field_195558_d.func_227801_c_(); this.func_213226_a(); @@ -63,7 +63,7 @@ ResourceLoadProgressGui.func_212970_a(this); List list = this.field_110448_aq.func_232623_f_(); -@@ -495,7 +493,14 @@ +@@ -494,7 +492,14 @@ if (SharedConstants.field_206244_b) { this.func_213256_aB(); } @@ -79,7 +79,7 @@ }); }, false)); } -@@ -534,7 +539,7 @@ +@@ -533,7 +538,7 @@ } private void func_229988_a_(Throwable p_229988_1_) { @@ -88,7 +88,7 @@ ITextComponent itextcomponent; if (p_229988_1_ instanceof SimpleReloadableResourceManager.FailedPackException) { itextcomponent = new StringTextComponent(((SimpleReloadableResourceManager.FailedPackException)p_229988_1_).func_241203_a().func_195762_a()); -@@ -618,7 +623,7 @@ +@@ -621,7 +626,7 @@ return Stream.of(Registry.field_212630_s.func_177774_c(p_213251_0_.func_77973_b())); }); SearchTreeReloadable searchtreereloadable = new SearchTreeReloadable<>((p_213235_0_) -> { @@ -97,7 +97,7 @@ }); NonNullList nonnulllist = NonNullList.func_191196_a(); -@@ -688,13 +693,13 @@ +@@ -691,13 +696,13 @@ Bootstrap.func_179870_a(p_71377_0_.func_71502_e()); if (p_71377_0_.func_71497_f() != null) { Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_0_.func_71497_f()); @@ -114,7 +114,7 @@ } } -@@ -703,6 +708,7 @@ +@@ -706,6 +711,7 @@ return this.field_71474_y.field_211842_aO; } @@ -122,7 +122,7 @@ public CompletableFuture func_213237_g() { if (this.field_213276_aV != null) { return this.field_213276_aV; -@@ -791,10 +797,6 @@ +@@ -794,10 +800,6 @@ } public void func_147108_a(@Nullable Screen p_147108_1_) { @@ -133,7 +133,7 @@ if (p_147108_1_ == null && this.field_71441_e == null) { p_147108_1_ = new MainMenuScreen(); } else if (p_147108_1_ == null && this.field_71439_g.func_233643_dh_()) { -@@ -805,6 +807,14 @@ +@@ -808,6 +810,14 @@ } } @@ -148,7 +148,7 @@ if (p_147108_1_ instanceof MainMenuScreen || p_147108_1_ instanceof MultiplayerScreen) { this.field_71474_y.field_74330_P = false; this.field_71456_v.func_146158_b().func_146231_a(true); -@@ -936,11 +946,13 @@ +@@ -939,11 +949,13 @@ RenderSystem.enableCull(); this.field_71424_I.func_76319_b(); if (!this.field_71454_w) { @@ -162,16 +162,15 @@ } if (this.field_238174_aV_ != null) { -@@ -1039,7 +1051,7 @@ +@@ -1042,6 +1054,7 @@ Framebuffer framebuffer = this.func_147110_a(); framebuffer.func_216491_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l(), field_142025_a); -- this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l()); -+ if (this.field_71460_t!=null) this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l()); ++ if (this.field_71460_t != null) + this.field_71460_t.func_147704_a(this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l()); this.field_71417_B.func_198021_g(); } - -@@ -1227,11 +1239,21 @@ +@@ -1230,11 +1243,21 @@ if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) { BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x; BlockPos blockpos = blockraytraceresult.func_216350_a(); @@ -195,7 +194,7 @@ } } -@@ -1250,6 +1272,8 @@ +@@ -1253,6 +1276,8 @@ } } else if (!this.field_71439_g.func_184838_M()) { @@ -204,7 +203,7 @@ switch(this.field_71476_x.func_216346_c()) { case ENTITY: this.field_71442_b.func_78764_a(this.field_71439_g, ((EntityRayTraceResult)this.field_71476_x).func_216348_a()); -@@ -1257,7 +1281,7 @@ +@@ -1260,7 +1285,7 @@ case BLOCK: BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x; BlockPos blockpos = blockraytraceresult.func_216350_a(); @@ -213,7 +212,7 @@ this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b()); break; } -@@ -1267,8 +1291,10 @@ +@@ -1270,8 +1295,10 @@ } this.field_71439_g.func_184821_cY(); @@ -224,7 +223,7 @@ this.field_71439_g.func_184609_a(Hand.MAIN_HAND); } } -@@ -1283,6 +1309,11 @@ +@@ -1286,6 +1313,11 @@ } for(Hand hand : Hand.values()) { @@ -236,7 +235,7 @@ ItemStack itemstack = this.field_71439_g.func_184586_b(hand); if (this.field_71476_x != null) { switch(this.field_71476_x.func_216346_c()) { -@@ -1296,6 +1327,7 @@ +@@ -1299,6 +1331,7 @@ if (actionresulttype.func_226246_a_()) { if (actionresulttype.func_226247_b_()) { @@ -244,7 +243,7 @@ this.field_71439_g.func_184609_a(hand); } -@@ -1308,6 +1340,7 @@ +@@ -1311,6 +1344,7 @@ ActionResultType actionresulttype1 = this.field_71442_b.func_217292_a(this.field_71439_g, this.field_71441_e, hand, blockraytraceresult); if (actionresulttype1.func_226246_a_()) { if (actionresulttype1.func_226247_b_()) { @@ -252,7 +251,7 @@ this.field_71439_g.func_184609_a(hand); if (!itemstack.func_190926_b() && (itemstack.func_190916_E() != i || this.field_71442_b.func_78758_h())) { this.field_71460_t.field_78516_c.func_187460_a(hand); -@@ -1323,6 +1356,9 @@ +@@ -1326,6 +1360,9 @@ } } @@ -262,7 +261,7 @@ if (!itemstack.func_190926_b()) { ActionResultType actionresulttype2 = this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand); if (actionresulttype2.func_226246_a_()) { -@@ -1349,6 +1385,8 @@ +@@ -1352,6 +1389,8 @@ --this.field_71467_ac; } @@ -271,7 +270,7 @@ this.field_71424_I.func_76320_a("gui"); if (!this.field_71445_n) { this.field_71456_v.func_73831_a(); -@@ -1465,6 +1503,8 @@ +@@ -1468,6 +1507,8 @@ this.field_71424_I.func_219895_b("keyboard"); this.field_195559_v.func_204870_b(); this.field_71424_I.func_76319_b(); @@ -280,7 +279,7 @@ } private void func_184117_aA() { -@@ -1696,7 +1736,12 @@ +@@ -1697,7 +1738,12 @@ networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_229998_0_) -> { })); networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN)); @@ -294,7 +293,7 @@ this.field_71453_ak = networkmanager; } else { this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> { -@@ -1770,6 +1815,7 @@ +@@ -1771,6 +1817,7 @@ } public void func_71403_a(ClientWorld p_71403_1_) { @@ -302,7 +301,7 @@ WorkingScreen workingscreen = new WorkingScreen(); workingscreen.func_200210_a(new TranslationTextComponent("connect.joining")); this.func_213241_c(workingscreen); -@@ -1801,10 +1847,12 @@ +@@ -1802,10 +1849,12 @@ IntegratedServer integratedserver = this.field_71437_Z; this.field_71437_Z = null; this.field_71460_t.func_190564_k(); @@ -315,7 +314,7 @@ if (integratedserver != null) { this.field_71424_I.func_76320_a("waitForServer"); -@@ -1819,6 +1867,7 @@ +@@ -1820,6 +1869,7 @@ this.field_71456_v.func_181029_i(); this.field_71422_O = null; this.field_71455_al = false; @@ -323,7 +322,7 @@ this.field_213274_aO.func_216815_b(); } -@@ -1849,6 +1898,7 @@ +@@ -1850,6 +1900,7 @@ this.field_71452_i.func_78870_a(p_213257_1_); TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_); this.func_230150_b_(); @@ -331,7 +330,7 @@ } public boolean func_238216_r_() { -@@ -1894,112 +1944,9 @@ +@@ -1895,112 +1946,9 @@ private void func_147112_ai() { if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) { @@ -447,7 +446,7 @@ } } -@@ -2081,6 +2028,7 @@ +@@ -2090,6 +2038,7 @@ return field_71432_P; } @@ -455,16 +454,16 @@ public CompletableFuture func_213245_w() { return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> { return p_229993_0_; -@@ -2388,7 +2336,7 @@ +@@ -2397,7 +2346,7 @@ supplier = func_228022_c_(supplier); } -- return new ClientResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_); -+ return new ClientResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_, p_228011_3_.isHidden()); +- return new ResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_); ++ return new ResourcePackInfo(p_228011_0_, p_228011_1_, supplier, p_228011_3_, p_228011_4_, p_228011_5_, p_228011_6_, p_228011_3_.isHidden()); } private static Supplier func_228021_b_(Supplier p_228021_0_) { -@@ -2407,6 +2355,14 @@ +@@ -2416,6 +2365,14 @@ this.field_175617_aL.func_229355_a_(p_228020_1_); } @@ -478,4 +477,4 @@ + @OnlyIn(Dist.CLIENT) public static final class PackManager implements AutoCloseable { - private final ResourcePackList field_238221_a_; + private final ResourcePackList field_238221_a_; diff --git a/patches/minecraft/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java.patch b/patches/minecraft/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java.patch index de496ed5c..7093be2c4 100644 --- a/patches/minecraft/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java +++ b/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java -@@ -113,7 +113,7 @@ +@@ -114,7 +114,7 @@ f = 1.0F; } @@ -9,11 +9,11 @@ int i = this.func_184612_cw(); float f1 = (float)i / 20.0F; if (f1 > 1.0F) { -@@ -125,6 +125,6 @@ +@@ -126,6 +126,6 @@ f *= 1.0F - f1 * 0.15F; } -- return f; +- return MathHelper.func_219799_g(Minecraft.func_71410_x().field_71474_y.field_243227_aN, 1.0F, f); + return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f); } } diff --git a/patches/minecraft/net/minecraft/client/entity/player/ClientPlayerEntity.java.patch b/patches/minecraft/net/minecraft/client/entity/player/ClientPlayerEntity.java.patch index c153878e9..173bd6b91 100644 --- a/patches/minecraft/net/minecraft/client/entity/player/ClientPlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/player/ClientPlayerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/entity/player/ClientPlayerEntity.java +++ b/net/minecraft/client/entity/player/ClientPlayerEntity.java -@@ -133,6 +133,7 @@ +@@ -134,6 +134,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -8,7 +8,7 @@ return false; } -@@ -479,6 +480,11 @@ +@@ -457,6 +458,11 @@ } public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) { @@ -20,7 +20,7 @@ this.field_70170_p.func_184134_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false); } -@@ -617,6 +623,7 @@ +@@ -595,6 +601,7 @@ boolean flag2 = this.func_223110_ee(); this.field_239203_ch_ = !this.field_71075_bZ.field_75100_b && !this.func_203007_ba() && this.func_213298_c(Pose.CROUCHING) && (this.func_225608_bj_() || !this.func_70608_bn() && !this.func_213298_c(Pose.STANDING)); this.field_71158_b.func_225607_a_(this.func_228354_I_()); @@ -28,25 +28,7 @@ this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b); if (this.func_184587_cr() && !this.func_184218_aH()) { this.field_71158_b.field_78902_a *= 0.2F; -@@ -631,11 +638,12 @@ - this.field_71158_b.field_78901_c = true; - } - -- if (!this.field_70145_X) { -- this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D); -- this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D); -- this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D); -- this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, this.func_226278_cu_() + 0.5D, this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D); -+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this); -+ if (!this.field_70145_X && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { -+ this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D); -+ this.func_213282_i(this.func_226277_ct_() - (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D); -+ this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() - (double)this.func_213311_cf() * 0.35D); -+ this.func_213282_i(this.func_226277_ct_() + (double)this.func_213311_cf() * 0.35D, event.getMinY(), this.func_226281_cx_() + (double)this.func_213311_cf() * 0.35D); - } - - if (flag1) { -@@ -689,7 +697,7 @@ +@@ -667,7 +674,7 @@ if (this.field_71158_b.field_78901_c && !flag7 && !flag && !this.field_71075_bZ.field_75100_b && !this.func_184218_aH() && !this.func_70617_f_()) { ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST); @@ -55,8 +37,8 @@ this.field_71174_a.func_147297_a(new CEntityActionPacket(this, CEntityActionPacket.Action.START_FALL_FLYING)); } } -@@ -985,4 +993,16 @@ - return this.field_204230_bP; +@@ -975,4 +982,16 @@ + return super.func_241843_o(p_241843_1_); } } + diff --git a/patches/minecraft/net/minecraft/client/gui/IngameGui.java.patch b/patches/minecraft/net/minecraft/client/gui/IngameGui.java.patch index cad08f718..11ba3cb1f 100644 --- a/patches/minecraft/net/minecraft/client/gui/IngameGui.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/IngameGui.java.patch @@ -1,6 +1,15 @@ --- a/net/minecraft/client/gui/IngameGui.java +++ b/net/minecraft/client/gui/IngameGui.java -@@ -416,6 +416,9 @@ +@@ -78,7 +78,7 @@ + protected static final ResourceLocation field_110329_b = new ResourceLocation("textures/misc/vignette.png"); + protected static final ResourceLocation field_110330_c = new ResourceLocation("textures/gui/widgets.png"); + protected static final ResourceLocation field_110328_d = new ResourceLocation("textures/misc/pumpkinblur.png"); +- protected static final ITextComponent field_243249_e = new TranslationTextComponent("demo.demoExpired"); ++ private static final ITextComponent field_243249_e = new TranslationTextComponent("demo.demoExpired"); + protected final Random field_73842_c = new Random(); + protected final Minecraft field_73839_d; + protected final ItemRenderer field_73841_b; +@@ -414,6 +414,9 @@ for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) { Effect effect = effectinstance.func_188419_a(); @@ -10,7 +19,7 @@ if (effectinstance.func_205348_f()) { int k = this.field_194811_H; int l = 1; -@@ -453,6 +456,7 @@ +@@ -451,6 +454,7 @@ RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1); func_238470_a_(p_238444_1_, j1 + 3, k1 + 3, this.func_230927_p_(), 18, 18, textureatlassprite); }); @@ -18,7 +27,7 @@ } } -@@ -577,7 +581,8 @@ +@@ -575,7 +579,8 @@ iformattabletextcomponent.func_240699_a_(TextFormatting.ITALIC); } @@ -28,22 +37,22 @@ int j = (this.field_194811_H - i) / 2; int k = this.field_194812_I - 59; if (!this.field_73839_d.field_71442_b.func_78755_b()) { -@@ -594,7 +599,13 @@ +@@ -592,7 +597,13 @@ RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); func_238467_a_(p_238453_1_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.field_73839_d.field_71474_y.func_216839_a(0)); -- this.func_175179_f().func_238407_a_(p_238453_1_, iformattabletextcomponent, (float)j, (float)k, 16777215 + (l << 24)); +- this.func_175179_f().func_243246_a(p_238453_1_, iformattabletextcomponent, (float)j, (float)k, 16777215 + (l << 24)); + FontRenderer font = field_92016_l.func_77973_b().getFontRenderer(field_92016_l); + if (font == null) { -+ this.func_175179_f().func_238407_a_(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24)); ++ this.func_175179_f().func_243246_a(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24)); + } else { + j = (this.field_194811_H - font.func_238414_a_(highlightTip)) / 2; -+ font.func_238407_a_(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24)); ++ font.func_243246_a(p_238453_1_, highlightTip, (float)j, (float)k, 16777215 + (l << 24)); + } RenderSystem.disableBlend(); RenderSystem.popMatrix(); } -@@ -1057,7 +1068,7 @@ +@@ -1055,7 +1066,7 @@ ItemStack itemstack = this.field_73839_d.field_71439_g.field_71071_by.func_70448_g(); if (itemstack.func_190926_b()) { this.field_92017_k = 0; diff --git a/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementsScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementsScreen.java.patch index e22029d93..acdc5feb5 100644 --- a/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementsScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementsScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/advancements/AdvancementsScreen.java +++ b/net/minecraft/client/gui/advancements/AdvancementsScreen.java -@@ -25,6 +25,7 @@ +@@ -29,6 +29,7 @@ private final Map field_191947_i = Maps.newLinkedHashMap(); private AdvancementTabGui field_191940_s; private boolean field_191944_v; @@ -8,7 +8,7 @@ public AdvancementsScreen(ClientAdvancementManager p_i47383_1_) { super(NarratorChatListener.field_216868_a); -@@ -40,7 +41,13 @@ +@@ -44,7 +45,13 @@ } else { this.field_191946_h.func_194230_a(this.field_191940_s == null ? null : this.field_191940_s.func_193935_c(), true); } @@ -23,7 +23,7 @@ } public void func_231164_f_() { -@@ -58,7 +65,7 @@ +@@ -62,7 +69,7 @@ int j = (this.field_230709_l_ - 140) / 2; for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) { @@ -32,7 +32,7 @@ this.field_191946_h.func_194230_a(advancementtabgui.func_193935_c(), true); break; } -@@ -82,6 +89,12 @@ +@@ -86,6 +93,12 @@ int i = (this.field_230708_k_ - 252) / 2; int j = (this.field_230709_l_ - 140) / 2; this.func_230446_a_(p_230430_1_); @@ -40,12 +40,12 @@ + net.minecraft.util.text.ITextComponent page = new net.minecraft.util.text.StringTextComponent(String.format("%d / %d", tabPage + 1, maxPages + 1)); + int width = this.field_230712_o_.func_238414_a_(page); + RenderSystem.disableLighting(); -+ this.field_230712_o_.func_238407_a_(p_230430_1_, page, i + (252 / 2) - (width / 2), j - 44, -1); ++ this.field_230712_o_.func_238407_a_(p_230430_1_, page.func_241878_f(), i + (252 / 2) - (width / 2), j - 44, -1); + } this.func_238696_c_(p_230430_1_, p_230430_2_, p_230430_3_, i, j); this.func_238695_a_(p_230430_1_, i, j); this.func_238697_d_(p_230430_1_, p_230430_2_, p_230430_3_, i, j); -@@ -129,6 +142,7 @@ +@@ -132,6 +145,7 @@ this.field_230706_i_.func_110434_K().func_110577_a(field_191945_g); for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) { @@ -53,7 +53,7 @@ advancementtabgui.func_238683_a_(p_238695_1_, p_238695_2_, p_238695_3_, advancementtabgui == this.field_191940_s); } -@@ -136,6 +150,7 @@ +@@ -139,6 +153,7 @@ RenderSystem.defaultBlendFunc(); for(AdvancementTabGui advancementtabgui1 : this.field_191947_i.values()) { @@ -61,7 +61,7 @@ advancementtabgui1.func_191796_a(p_238695_2_, p_238695_3_, this.field_230707_j_); } -@@ -158,7 +173,7 @@ +@@ -161,7 +176,7 @@ if (this.field_191947_i.size() > 1) { for(AdvancementTabGui advancementtabgui : this.field_191947_i.values()) { diff --git a/patches/minecraft/net/minecraft/client/gui/overlay/BossOverlayGui.java.patch b/patches/minecraft/net/minecraft/client/gui/overlay/BossOverlayGui.java.patch index 75d8e4bf0..e93141f5e 100644 --- a/patches/minecraft/net/minecraft/client/gui/overlay/BossOverlayGui.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/overlay/BossOverlayGui.java.patch @@ -13,7 +13,7 @@ @@ -40,7 +43,9 @@ int i1 = i / 2 - l / 2; int j1 = j - 9; - this.field_184059_f.field_71466_p.func_238407_a_(p_238484_1_, itextcomponent, (float)i1, (float)j1, 16777215); + this.field_184059_f.field_71466_p.func_243246_a(p_238484_1_, itextcomponent, (float)i1, (float)j1, 16777215); - j += 10 + 9; + } + j += event.getIncrement(); diff --git a/patches/minecraft/net/minecraft/client/gui/overlay/DebugOverlayGui.java.patch b/patches/minecraft/net/minecraft/client/gui/overlay/DebugOverlayGui.java.patch index de1d83c97..7e017d224 100644 --- a/patches/minecraft/net/minecraft/client/gui/overlay/DebugOverlayGui.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/overlay/DebugOverlayGui.java.patch @@ -4,7 +4,7 @@ list.add(this.func_211534_a(entry)); } -- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_199717_a().func_199913_a(blockstate.func_177230_c())) { +- for(ResourceLocation resourcelocation : this.field_175242_a.func_147114_u().func_199724_l().func_241835_a().func_199913_a(blockstate.func_177230_c())) { + for(ResourceLocation resourcelocation : blockstate.func_177230_c().getTags()) { list.add("#" + resourcelocation); } @@ -13,7 +13,7 @@ list.add(this.func_211534_a(entry1)); } -- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_205704_c().func_199913_a(fluidstate.func_206886_c())) { +- for(ResourceLocation resourcelocation1 : this.field_175242_a.func_147114_u().func_199724_l().func_241837_c().func_199913_a(fluidstate.func_206886_c())) { + for(ResourceLocation resourcelocation1 : fluidstate.func_206886_c().getTags()) { list.add("#" + resourcelocation1); } diff --git a/patches/minecraft/net/minecraft/client/gui/recipebook/RecipeBookGui.java.patch b/patches/minecraft/net/minecraft/client/gui/recipebook/RecipeBookGui.java.patch index 8e2b3dfb9..56b182bc3 100644 --- a/patches/minecraft/net/minecraft/client/gui/recipebook/RecipeBookGui.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/recipebook/RecipeBookGui.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/client/gui/recipebook/RecipeBookGui.java +++ b/net/minecraft/client/gui/recipebook/RecipeBookGui.java -@@ -92,7 +92,7 @@ +@@ -95,7 +95,7 @@ this.func_205702_a(); this.field_193018_j.clear(); -- for(RecipeBookCategories recipebookcategories : ClientRecipeBook.func_216769_b(this.field_201522_g)) { +- for(RecipeBookCategories recipebookcategories : RecipeBookCategories.func_243236_a(this.field_201522_g.func_241850_m())) { + for(RecipeBookCategories recipebookcategories : this.field_201522_g.getRecipeBookCategories()) { this.field_193018_j.add(new RecipeTabToggleWidget(recipebookcategories)); } -@@ -425,7 +425,7 @@ +@@ -433,7 +433,7 @@ languagemanager.func_135045_a(language); this.field_191888_F.field_71474_y.field_74363_ab = language.getCode(); diff --git a/patches/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch index 76bb4bb80..612270849 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/client/gui/screen/CreateWorldScreen.java +++ b/net/minecraft/client/gui/screen/CreateWorldScreen.java -@@ -384,6 +384,7 @@ - if (path != null) { +@@ -542,6 +542,7 @@ File file1 = path.toFile(); - ResourcePackList resourcepacklist = new ResourcePackList<>(ResourcePackInfo::new, new ServerPackFinder(), new FolderPackFinder(file1, IPackNameDecorator.field_232625_a_)); -+ net.minecraftforge.fml.packs.ResourcePackLoader.loadResourcePacks(resourcepacklist, net.minecraftforge.fml.server.ServerLifecycleHooks::buildPackFinder); - resourcepacklist.func_198983_a(); - resourcepacklist.func_198985_a(this.field_238933_b_.func_234884_a_()); - this.field_230706_i_.func_147108_a(new DataPackScreen(this, resourcepacklist, this::func_241621_a_, file1)); + if (this.field_243416_G == null) { + this.field_243416_G = new ResourcePackList(new ServerPackFinder(), new FolderPackFinder(file1, IPackNameDecorator.field_232625_a_)); ++ net.minecraftforge.fml.packs.ResourcePackLoader.loadResourcePacks(this.field_243416_G, net.minecraftforge.fml.server.ServerLifecycleHooks::buildPackFinder); + this.field_243416_G.func_198983_a(); + } + diff --git a/patches/minecraft/net/minecraft/client/gui/screen/LanguageScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/LanguageScreen.java.patch index e148c981d..b9d7e2849 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/LanguageScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/LanguageScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screen/LanguageScreen.java +++ b/net/minecraft/client/gui/screen/LanguageScreen.java -@@ -43,7 +43,7 @@ +@@ -45,7 +45,7 @@ if (languagescreen$list$languageentry != null && !languagescreen$list$languageentry.field_214398_b.getCode().equals(this.field_146454_h.func_135041_c().getCode())) { this.field_146454_h.func_135045_a(languagescreen$list$languageentry.field_214398_b); this.field_228183_b_.field_74363_ab = languagescreen$list$languageentry.field_214398_b.getCode(); diff --git a/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch index 6f576f9aa..e693c1a76 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch @@ -34,7 +34,7 @@ this.func_140005_i(); }, button$itooltip))).field_230693_o_ = flag; } -@@ -222,6 +228,7 @@ +@@ -229,6 +235,7 @@ this.field_230706_i_.func_110434_K().func_110577_a(field_194400_H); func_238463_a_(p_230430_1_, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16); @@ -42,22 +42,23 @@ if (this.field_73975_c != null) { RenderSystem.pushMatrix(); RenderSystem.translatef((float)(this.field_230708_k_ / 2 + 90), 70.0F, 0.0F); -@@ -244,7 +251,13 @@ +@@ -251,7 +258,14 @@ s = s + I18n.func_135052_a("menu.modded"); } -- this.func_238476_c_(p_230430_1_, this.field_230712_o_, s, 2, this.field_230709_l_ - 10, 16777215 | l); +- func_238476_c_(p_230430_1_, this.field_230712_o_, s, 2, this.field_230709_l_ - 10, 16777215 | l); + net.minecraftforge.fml.BrandingControl.forEachLine(true, true, (brdline, brd) -> -+ this.func_238476_c_(p_230430_1_, this.field_230712_o_, brd, 2, this.field_230709_l_ - ( 10 + brdline * (this.field_230712_o_.field_78288_b + 1)), 16777215 | l) ++ func_238476_c_(p_230430_1_, this.field_230712_o_, brd, 2, this.field_230709_l_ - ( 10 + brdline * (this.field_230712_o_.field_78288_b + 1)), 16777215 | l) + ); + + net.minecraftforge.fml.BrandingControl.forEachAboveCopyrightLine((brdline, brd) -> -+ this.func_238476_c_(p_230430_1_, this.field_230712_o_, brd, this.field_230708_k_ - field_230712_o_.func_78256_a(brd), this.field_230709_l_ - (10 + (brdline + 1) * ( this.field_230712_o_.field_78288_b + 1)), 16777215 | l) ++ func_238476_c_(p_230430_1_, this.field_230712_o_, brd, this.field_230708_k_ - field_230712_o_.func_78256_a(brd), this.field_230709_l_ - (10 + (brdline + 1) * ( this.field_230712_o_.field_78288_b + 1)), 16777215 | l) + ); - this.func_238476_c_(p_230430_1_, this.field_230712_o_, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_230709_l_ - 10, 16777215 | l); ++ + func_238476_c_(p_230430_1_, this.field_230712_o_, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_230709_l_ - 10, 16777215 | l); if (p_230430_2_ > this.field_193979_N && p_230430_2_ < this.field_193979_N + this.field_193978_M && p_230430_3_ > this.field_230709_l_ - 10 && p_230430_3_ < this.field_230709_l_) { func_238467_a_(p_230430_1_, this.field_193979_N, this.field_230709_l_ - 1, this.field_193979_N + this.field_193978_M, this.field_230709_l_, 16777215 | l); -@@ -258,6 +271,7 @@ +@@ -265,6 +279,7 @@ if (this.func_183501_a() && f1 >= 1.0F) { this.field_183503_M.func_230430_a_(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_); } diff --git a/patches/minecraft/net/minecraft/client/gui/screen/OptionsScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/OptionsScreen.java.patch index c731c146d..c778f0524 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/OptionsScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/OptionsScreen.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/gui/screen/OptionsScreen.java +++ b/net/minecraft/client/gui/screen/OptionsScreen.java @@ -146,4 +146,12 @@ - this.func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_230704_d_, this.field_230708_k_ / 2, 15, 16777215); + func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_230704_d_, this.field_230708_k_ / 2, 15, 16777215); super.func_230430_a_(p_230430_1_, p_230430_2_, p_230430_3_, p_230430_4_); } + diff --git a/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch index a09a60683..ac5eee9b5 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screen/PackLoadingManager.java +++ b/net/minecraft/client/gui/screen/PackLoadingManager.java -@@ -135,6 +135,11 @@ +@@ -134,6 +134,11 @@ public void func_230468_k_() { this.func_238879_a_(1); } @@ -12,7 +12,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -230,5 +235,7 @@ +@@ -229,5 +234,7 @@ boolean func_230469_o_(); boolean func_230470_p_(); diff --git a/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch index 9ef9525c8..9e81765a9 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/client/gui/screen/PackScreen.java +++ b/net/minecraft/client/gui/screen/PackScreen.java -@@ -84,7 +84,7 @@ +@@ -129,7 +129,7 @@ - private void func_238899_a_(ResourcePackList p_238899_1_, Stream p_238899_2_) { + private void func_238899_a_(net.minecraft.client.gui.widget.list.ResourcePackList p_238899_1_, Stream p_238899_2_) { p_238899_1_.func_231039_at__().clear(); - p_238899_2_.forEach((p_238898_2_) -> { + p_238899_2_.filter(PackLoadingManager.IPack::notHidden).forEach((p_238898_2_) -> { - p_238899_1_.func_231039_at__().add(new ResourcePackList.ResourcePackEntry(this.field_230706_i_, p_238899_1_, this, p_238898_2_)); + p_238899_1_.func_231039_at__().add(new net.minecraft.client.gui.widget.list.ResourcePackList.ResourcePackEntry(this.field_230706_i_, p_238899_1_, this, p_238898_2_)); }); } diff --git a/patches/minecraft/net/minecraft/client/gui/screen/Screen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/Screen.java.patch index eeb69c4b6..4b75fa09f 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/Screen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/Screen.java.patch @@ -4,28 +4,26 @@ } protected void func_230457_a_(MatrixStack p_230457_1_, ItemStack p_230457_2_, int p_230457_3_, int p_230457_4_) { -- this.func_238654_b_(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_); +- this.func_243308_b(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_); + FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_); + net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_); -+ this.renderToolTip(p_230457_1_, this.func_231151_a_(p_230457_2_), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font)); ++ this.renderToolTip(p_230457_1_, Lists.transform(this.func_231151_a_(p_230457_2_), ITextComponent::func_241878_f), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font)); + net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip(); } public List func_231151_a_(ItemStack p_231151_1_) { -@@ -125,7 +128,11 @@ +@@ -129,6 +132,10 @@ } - public void func_238654_b_(MatrixStack p_238654_1_, List p_238654_2_, int p_238654_3_, int p_238654_4_) { -- if (!p_238654_2_.isEmpty()) { + public void func_238654_b_(MatrixStack p_238654_1_, List p_238654_2_, int p_238654_3_, int p_238654_4_) { + this.renderToolTip(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230712_o_); + } -+ public void renderToolTip(MatrixStack p_238654_1_, List p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) { -+ net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230708_k_, field_230709_l_, -1, font); -+ if (false && !p_238654_2_.isEmpty()) { ++ public void renderToolTip(MatrixStack p_238654_1_, List p_238654_2_, int p_238654_3_, int p_238654_4_, FontRenderer font) { ++ //net.minecraftforge.fml.client.gui.GuiUtils.drawHoveringText(p_238654_1_, p_238654_2_, p_238654_3_, p_238654_4_, field_230708_k_, field_230709_l_, -1, font); + if (!p_238654_2_.isEmpty()) { int i = 0; - for(ITextProperties itextproperties : p_238654_2_) { -@@ -285,9 +292,12 @@ +@@ -289,9 +296,12 @@ } public void func_231159_b_(String p_231159_1_, boolean p_231159_2_) { @@ -38,7 +36,7 @@ this.field_230706_i_.field_71439_g.func_71165_d(p_231159_1_); } -@@ -298,10 +308,17 @@ +@@ -302,10 +312,17 @@ this.field_230712_o_ = p_231158_1_.field_71466_p; this.field_230708_k_ = p_231158_2_; this.field_230709_l_ = p_231158_3_; @@ -56,7 +54,7 @@ } public List func_231039_at__() { -@@ -324,6 +341,7 @@ +@@ -328,6 +345,7 @@ public void func_238651_a_(MatrixStack p_238651_1_, int p_238651_2_) { if (this.field_230706_i_.field_71441_e != null) { this.func_238468_a_(p_238651_1_, 0, 0, this.field_230708_k_, this.field_230709_l_, -1072689136, -804253680); @@ -64,7 +62,7 @@ } else { this.func_231165_f_(p_238651_2_); } -@@ -342,6 +360,7 @@ +@@ -346,6 +364,7 @@ bufferbuilder.func_225582_a_((double)this.field_230708_k_, 0.0D, 0.0D).func_225583_a_((float)this.field_230708_k_ / 32.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d(); bufferbuilder.func_225582_a_(0.0D, 0.0D, 0.0D).func_225583_a_(0.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d(); tessellator.func_78381_a(); @@ -72,7 +70,7 @@ } public boolean func_231177_au__() { -@@ -428,4 +447,8 @@ +@@ -432,4 +451,8 @@ public void func_230476_a_(List p_230476_1_) { } diff --git a/patches/minecraft/net/minecraft/client/gui/screen/ServerSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/ServerSelectionList.java.patch index 75eef95a0..fb819cbcd 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/ServerSelectionList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/ServerSelectionList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screen/ServerSelectionList.java +++ b/net/minecraft/client/gui/screen/ServerSelectionList.java -@@ -302,6 +302,8 @@ +@@ -310,6 +310,8 @@ this.field_148303_c.func_238854_b_(list1); } diff --git a/patches/minecraft/net/minecraft/client/gui/screen/inventory/ContainerScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/inventory/ContainerScreen.java.patch index fac8a5f49..42984cd40 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/inventory/ContainerScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/inventory/ContainerScreen.java.patch @@ -105,19 +105,20 @@ this.func_184098_a(slot, k, p_231048_5_, ClickType.CLONE); } else { boolean flag1 = k != -999 && (InputMappings.func_216506_a(Minecraft.func_71410_x().func_228018_at_().func_198092_i(), 340) || InputMappings.func_216506_a(Minecraft.func_71410_x().func_228018_at_().func_198092_i(), 344)); -@@ -534,19 +544,26 @@ +@@ -530,34 +540,39 @@ } public boolean func_231046_a_(int p_231046_1_, int p_231046_2_, int p_231046_3_) { + InputMappings.Input mouseKey = InputMappings.func_197954_a(p_231046_1_, p_231046_2_); if (super.func_231046_a_(p_231046_1_, p_231046_2_, p_231046_3_)) { return true; -- } else if (p_231046_1_ != 256 && !this.field_230706_i_.field_71474_y.field_151445_Q.func_197976_a(p_231046_1_, p_231046_2_)) { +- } else if (this.field_230706_i_.field_71474_y.field_151445_Q.func_197976_a(p_231046_1_, p_231046_2_)) { ++ } else if (this.field_230706_i_.field_71474_y.field_151445_Q.isActiveAndMatches(mouseKey)) { + this.func_231175_as__(); + return true; + } else { - this.func_195363_d(p_231046_1_, p_231046_2_); -+ } else if (p_231046_1_ != 256 && !this.field_230706_i_.field_71474_y.field_151445_Q.isActiveAndMatches(mouseKey)) { -+ boolean handled = false;// Forge MC-146650: Needs to return true when the key is handled. -+ if (this.func_195363_d(p_231046_1_, p_231046_2_)) -+ handled = true; ++ boolean handled = this.func_195363_d(p_231046_1_, p_231046_2_);// Forge MC-146650: Needs to return true when the key is handled if (this.field_147006_u != null && this.field_147006_u.func_75216_d()) { - if (this.field_230706_i_.field_71474_y.field_74322_I.func_197976_a(p_231046_1_, p_231046_2_)) { + if (this.field_230706_i_.field_71474_y.field_74322_I.isActiveAndMatches(mouseKey)) { @@ -129,15 +130,13 @@ + handled = true; } + } else if (this.field_230706_i_.field_71474_y.field_74316_C.isActiveAndMatches(mouseKey)) { -+ handled = true; // Forge MC-146650: Emulate MC bug, so we don't drop from hotbar when pressing drop without hovering over a item. ++ handled = true; // Forge MC-146650: Emulate MC bug, so we don't drop from hotbar when pressing drop without hovering over a item. } - return true; + return handled; - } else { - this.field_230706_i_.field_71439_g.func_71053_j(); - return true; -@@ -555,13 +572,13 @@ + } + } protected boolean func_195363_d(int p_195363_1_, int p_195363_2_) { if (this.field_230706_i_.field_71439_g.field_71071_by.func_70445_o().func_190926_b() && this.field_147006_u != null) { @@ -153,11 +152,10 @@ this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, i, ClickType.SWAP); return true; } -@@ -592,4 +609,16 @@ - public T func_212873_a_() { +@@ -589,6 +604,18 @@ return this.field_147002_h; } -+ + + @javax.annotation.Nullable + public Slot getSlotUnderMouse() { return this.field_147006_u; } + public int getGuiLeft() { return field_147003_i; } @@ -169,4 +167,7 @@ + public int getSlotColor(int index) { + return slotColor; + } - } ++ + public void func_231175_as__() { + this.field_230706_i_.field_71439_g.func_71053_j(); + super.func_231175_as__(); diff --git a/patches/minecraft/net/minecraft/client/gui/screen/inventory/CreativeScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/inventory/CreativeScreen.java.patch index c4ce4ad7c..ebde76dd1 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/inventory/CreativeScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/inventory/CreativeScreen.java.patch @@ -80,8 +80,8 @@ - if (itemgroup.func_78019_g()) { + if (itemgroup != null && itemgroup.func_78019_g()) { RenderSystem.disableBlend(); -- this.field_230712_o_.func_238421_b_(p_230451_1_, I18n.func_135052_a(itemgroup.func_78024_c()), 8.0F, 6.0F, 4210752); -+ this.field_230712_o_.func_238421_b_(p_230451_1_, I18n.func_135052_a(itemgroup.func_78024_c()), 8.0F, 6.0F, itemgroup.getLabelColor()); +- this.field_230712_o_.func_243248_b(p_230451_1_, itemgroup.func_242392_c(), 8.0F, 6.0F, 4210752); ++ this.field_230712_o_.func_243248_b(p_230451_1_, itemgroup.func_242392_c(), 8.0F, 6.0F, itemgroup.getLabelColor()); } } @@ -154,11 +154,11 @@ break; } } -+ if (!rendered && !func_238809_a_(p_230430_1_, ItemGroup.field_78027_g, p_230430_2_, p_230430_3_)) -+ func_238809_a_(p_230430_1_, ItemGroup.field_78036_m, p_230430_2_, p_230430_3_); ++ if (!rendered && !this.func_238809_a_(p_230430_1_, ItemGroup.field_78027_g, p_230430_2_, p_230430_3_)) ++ this.func_238809_a_(p_230430_1_, ItemGroup.field_78036_m, p_230430_2_, p_230430_3_); if (this.field_147064_C != null && field_147058_w == ItemGroup.field_78036_m.func_78021_a() && this.func_195359_a(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, (double)p_230430_2_, (double)p_230430_3_)) { - this.func_238652_a_(p_230430_1_, new TranslationTextComponent("inventory.binSlot"), p_230430_2_, p_230430_3_); + this.func_238652_a_(p_230430_1_, field_243345_D, p_230430_2_, p_230430_3_); } + if (maxPages != 0) { @@ -166,7 +166,7 @@ + RenderSystem.disableLighting(); + this.func_230926_e_(300); + this.field_230707_j_.field_77023_b = 300.0F; -+ field_230712_o_.func_238407_a_(p_230430_1_, page, field_147003_i + (field_146999_f / 2) - (field_230712_o_.func_238414_a_(page) / 2), field_147009_r - 44, -1); ++ field_230712_o_.func_238407_a_(p_230430_1_, page.func_241878_f(), field_147003_i + (field_146999_f / 2) - (field_230712_o_.func_238414_a_(page) / 2), field_147009_r - 44, -1); + this.func_230926_e_(0); + this.field_230707_j_.field_77023_b = 0.0F; + } @@ -175,13 +175,13 @@ this.func_230459_a_(p_230430_1_, p_230430_2_, p_230430_3_); } @@ -612,7 +670,10 @@ - list1.add(1, (new TranslationTextComponent(itemgroup.func_78024_c())).func_240699_a_(TextFormatting.BLUE)); + list1.add(1, itemgroup.func_242392_c().func_230532_e_().func_240699_a_(TextFormatting.BLUE)); } -- this.func_238654_b_(p_230457_1_, list1, p_230457_3_, p_230457_4_); +- this.func_243308_b(p_230457_1_, list1, p_230457_3_, p_230457_4_); + net.minecraft.client.gui.FontRenderer font = p_230457_2_.func_77973_b().getFontRenderer(p_230457_2_); + net.minecraftforge.fml.client.gui.GuiUtils.preItemToolTip(p_230457_2_); -+ this.renderToolTip(p_230457_1_, list1, p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font)); ++ this.renderToolTip(p_230457_1_, Lists.transform(list1, ITextComponent::func_241878_f), p_230457_3_, p_230457_4_, (font == null ? this.field_230712_o_ : font)); + net.minecraftforge.fml.client.gui.GuiUtils.postItemToolTip(); } else { super.func_230457_a_(p_230457_1_, p_230457_2_, p_230457_3_, p_230457_4_); diff --git a/patches/minecraft/net/minecraft/client/gui/widget/Widget.java.patch b/patches/minecraft/net/minecraft/client/gui/widget/Widget.java.patch index bba5b1a7a..aeb0a0456 100644 --- a/patches/minecraft/net/minecraft/client/gui/widget/Widget.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/widget/Widget.java.patch @@ -6,7 +6,7 @@ this.func_230441_a_(p_230431_1_, minecraft, p_230431_2_, p_230431_3_); - int j = this.field_230693_o_ ? 16777215 : 10526880; + int j = getFGColor(); - this.func_238472_a_(p_230431_1_, fontrenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, j | MathHelper.func_76123_f(this.field_230695_q_ * 255.0F) << 24); + func_238472_a_(p_230431_1_, fontrenderer, this.func_230458_i_(), this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, j | MathHelper.func_76123_f(this.field_230695_q_ * 255.0F) << 24); } @@ -206,6 +206,14 @@ diff --git a/patches/minecraft/net/minecraft/client/gui/widget/list/KeyBindingList.java.patch b/patches/minecraft/net/minecraft/client/gui/widget/list/KeyBindingList.java.patch index 73332c680..7856aeced 100644 --- a/patches/minecraft/net/minecraft/client/gui/widget/list/KeyBindingList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/widget/list/KeyBindingList.java.patch @@ -29,7 +29,7 @@ @@ -114,7 +115,7 @@ public void func_230432_a_(MatrixStack p_230432_1_, int p_230432_2_, int p_230432_3_, int p_230432_4_, int p_230432_5_, int p_230432_6_, int p_230432_7_, int p_230432_8_, boolean p_230432_9_, float p_230432_10_) { boolean flag = KeyBindingList.this.field_148191_k.field_146491_f == this.field_148282_b; - KeyBindingList.this.field_230668_b_.field_71466_p.func_238422_b_(p_230432_1_, this.field_148283_c, (float)(p_230432_4_ + 90 - KeyBindingList.this.field_148188_n), (float)(p_230432_3_ + p_230432_6_ / 2 - 9 / 2), 16777215); + KeyBindingList.this.field_230668_b_.field_71466_p.func_243248_b(p_230432_1_, this.field_148283_c, (float)(p_230432_4_ + 90 - KeyBindingList.this.field_148188_n), (float)(p_230432_3_ + p_230432_6_ / 2 - 9 / 2), 16777215); - this.field_148281_e.field_230690_l_ = p_230432_4_ + 190; + this.field_148281_e.field_230690_l_ = p_230432_4_ + 190 + 20; this.field_148281_e.field_230691_m_ = p_230432_3_; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch index d725645a3..d98dd9b70 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/PlayerController.java +++ b/net/minecraft/client/multiplayer/PlayerController.java -@@ -94,6 +94,7 @@ +@@ -93,6 +93,7 @@ } public boolean func_187103_a(BlockPos p_187103_1_) { @@ -8,7 +8,7 @@ if (this.field_78776_a.field_71439_g.func_223729_a(this.field_78776_a.field_71441_e, p_187103_1_, this.field_78779_k)) { return false; } else { -@@ -105,12 +106,11 @@ +@@ -104,12 +105,11 @@ Block block = blockstate.func_177230_c(); if ((block instanceof CommandBlockBlock || block instanceof StructureBlock || block instanceof JigsawBlock) && !this.field_78776_a.field_71439_g.func_195070_dx()) { return false; @@ -23,7 +23,7 @@ if (flag) { block.func_176206_d(world, p_187103_1_, blockstate); } -@@ -131,21 +131,25 @@ +@@ -130,21 +130,25 @@ BlockState blockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_); this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, blockstate, 1.0F); this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180511_1_, p_180511_2_); @@ -50,7 +50,7 @@ if (flag && blockstate1.func_185903_a(this.field_78776_a.field_71439_g, this.field_78776_a.field_71439_g.field_70170_p, p_180511_1_) >= 1.0F) { this.func_187103_a(p_180511_1_); } else { -@@ -185,22 +189,24 @@ +@@ -184,22 +188,24 @@ BlockState blockstate1 = this.field_78776_a.field_71441_e.func_180495_p(p_180512_1_); this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180512_1_, blockstate1, 1.0F); this.func_225324_a(CPlayerDiggingPacket.Action.START_DESTROY_BLOCK, p_180512_1_, p_180512_2_); @@ -77,7 +77,7 @@ if (this.field_78770_f >= 1.0F) { this.field_78778_j = false; this.func_225324_a(CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK, p_180512_1_, p_180512_2_); -@@ -219,7 +225,8 @@ +@@ -218,7 +224,8 @@ } public float func_78757_d() { @@ -87,7 +87,7 @@ } public void func_78765_e() { -@@ -236,7 +243,7 @@ +@@ -235,7 +242,7 @@ ItemStack itemstack = this.field_78776_a.field_71439_g.func_184614_ca(); boolean flag = this.field_85183_f.func_190926_b() && itemstack.func_190926_b(); if (!this.field_85183_f.func_190926_b() && !itemstack.func_190926_b()) { @@ -96,7 +96,7 @@ } return p_178893_1_.equals(this.field_178895_c) && flag; -@@ -258,13 +265,27 @@ +@@ -257,13 +264,27 @@ return ActionResultType.FAIL; } else { ItemStack itemstack = p_217292_1_.func_184586_b(p_217292_3_); @@ -126,7 +126,7 @@ ActionResultType actionresulttype = p_217292_2_.func_180495_p(blockpos).func_227031_a_(p_217292_2_, p_217292_1_, p_217292_3_, p_217292_4_); if (actionresulttype.func_226246_a_()) { this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_)); -@@ -273,8 +294,8 @@ +@@ -272,8 +293,8 @@ } this.field_78774_b.func_147297_a(new CPlayerTryUseItemOnBlockPacket(p_217292_3_, p_217292_4_)); @@ -136,7 +136,7 @@ ActionResultType actionresulttype1; if (this.field_78779_k.func_77145_d()) { int i = itemstack.func_190916_E(); -@@ -302,11 +323,14 @@ +@@ -301,11 +322,14 @@ if (p_187101_1_.func_184811_cZ().func_185141_a(itemstack.func_77973_b())) { return ActionResultType.PASS; } else { @@ -151,7 +151,7 @@ } return actionresult.func_188397_a(); -@@ -335,6 +359,9 @@ +@@ -334,6 +358,9 @@ public ActionResultType func_187097_a(PlayerEntity p_187097_1_, Entity p_187097_2_, Hand p_187097_3_) { this.func_78750_j(); this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187097_2_, p_187097_3_, p_187097_1_.func_225608_bj_())); @@ -161,7 +161,7 @@ return this.field_78779_k == GameType.SPECTATOR ? ActionResultType.PASS : p_187097_1_.func_190775_a(p_187097_2_, p_187097_3_); } -@@ -342,6 +369,9 @@ +@@ -341,6 +368,9 @@ this.func_78750_j(); Vector3d vector3d = p_187102_3_.func_216347_e().func_178786_a(p_187102_2_.func_226277_ct_(), p_187102_2_.func_226278_cu_(), p_187102_2_.func_226281_cx_()); this.field_78774_b.func_147297_a(new CUseEntityPacket(p_187102_2_, p_187102_4_, vector3d, p_187102_1_.func_225608_bj_())); diff --git a/patches/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch b/patches/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch index ce3024d69..e228c301a 100644 --- a/patches/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/network/login/ClientLoginNetHandler.java +++ b/net/minecraft/client/network/login/ClientLoginNetHandler.java -@@ -98,6 +98,7 @@ +@@ -99,6 +99,7 @@ this.field_209525_d.accept(new TranslationTextComponent("connect.joining")); this.field_175091_e = p_147390_1_.func_179730_a(); this.field_147393_d.func_150723_a(ProtocolType.PLAY); @@ -8,7 +8,7 @@ this.field_147393_d.func_150719_a(new ClientPlayNetHandler(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e)); } -@@ -126,6 +127,7 @@ +@@ -127,6 +128,7 @@ } public void func_209521_a(SCustomPayloadLoginPacket p_209521_1_) { diff --git a/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch b/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch index 3d3957436..e4cccc701 100644 --- a/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/network/play/ClientPlayNetHandler.java +++ b/net/minecraft/client/network/play/ClientPlayNetHandler.java -@@ -388,6 +388,7 @@ +@@ -384,6 +384,7 @@ this.field_147299_f.field_184132_p.func_217737_a(); this.field_147299_f.field_71439_g.func_70065_x(); @@ -8,7 +8,7 @@ int i = p_147282_1_.func_149197_c(); this.field_147300_g.func_217408_a(i, this.field_147299_f.field_71439_g); this.field_147299_f.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_147299_f.field_71474_y); -@@ -399,6 +400,7 @@ +@@ -395,6 +396,7 @@ this.field_147299_f.field_71439_g.func_228355_a_(p_147282_1_.func_229743_k_()); this.field_147299_f.field_71442_b.func_78746_a(p_147282_1_.func_149198_e()); this.field_147299_f.field_71442_b.func_241675_a_(p_147282_1_.func_241786_f_()); @@ -16,7 +16,7 @@ this.field_147299_f.field_71474_y.func_82879_c(); this.field_147302_e.func_179290_a(new CCustomPayloadPacket(CCustomPayloadPacket.field_210344_a, (new PacketBuffer(Unpooled.buffer())).func_180714_a(ClientBrandRetriever.getClientModName()))); this.field_147299_f.func_213229_ar().func_216814_a(); -@@ -745,7 +747,7 @@ +@@ -734,7 +736,7 @@ BlockPos blockpos = new BlockPos(compoundnbt.func_74762_e("x"), compoundnbt.func_74762_e("y"), compoundnbt.func_74762_e("z")); TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos); if (tileentity != null) { @@ -25,7 +25,7 @@ } } -@@ -844,7 +846,9 @@ +@@ -815,7 +817,9 @@ public void func_147251_a(SChatPacket p_147251_1_) { PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f); @@ -36,7 +36,7 @@ } public void func_147279_a(SAnimateHandPacket p_147279_1_) { -@@ -1034,8 +1038,10 @@ +@@ -1004,8 +1008,10 @@ clientplayerentity1.func_233645_dx_().func_233784_a_(clientplayerentity.func_233645_dx_()); } @@ -47,7 +47,7 @@ this.field_147300_g.func_217408_a(i, clientplayerentity1); clientplayerentity1.field_70177_z = -180.0F; clientplayerentity1.field_71158_b = new MovementInputFromOptions(this.field_147299_f.field_71474_y); -@@ -1161,6 +1167,12 @@ +@@ -1131,6 +1137,12 @@ if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) { ((CommandBlockScreen)this.field_147299_f.field_71462_r).func_184075_a(); @@ -60,15 +60,15 @@ } } -@@ -1329,6 +1341,7 @@ - clientrecipebook.func_199644_c(); +@@ -1299,6 +1311,7 @@ + clientrecipebook.func_243196_a(this.field_199528_o.func_199510_b()); clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a); imutablesearchtree.func_194040_a(); + net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(this.field_199528_o); } public void func_200232_a(SPlayerLookPacket p_200232_1_) { -@@ -1409,7 +1422,7 @@ +@@ -1376,7 +1389,7 @@ PacketThreadUtil.func_218797_a(p_147260_1_, this, this.field_147299_f); Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d()); if (entity instanceof LivingEntity) { @@ -77,15 +77,7 @@ if (effect != null) { EffectInstance effectinstance = new EffectInstance(effect, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f(), p_147260_1_.func_205527_h()); effectinstance.func_100012_b(p_147260_1_.func_149429_c()); -@@ -1423,6 +1436,7 @@ - this.field_199725_m = p_199723_1_.func_199858_a(); - if (!this.field_147302_e.func_150731_c()) { - this.field_199725_m.func_232980_f_(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this.field_199725_m)); - } - - this.field_147299_f.func_213253_a(SearchTreeManager.field_215360_b).func_194040_a(); -@@ -1909,10 +1923,12 @@ +@@ -1883,10 +1896,12 @@ int l5 = packetbuffer.readInt(); this.field_147299_f.field_184132_p.field_229018_q_.func_229022_a_(blockpos8, l3, s10, l5); } else { diff --git a/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch index 1b5fc5099..c287e18e1 100644 --- a/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/FogRenderer.java +++ b/net/minecraft/client/renderer/FogRenderer.java -@@ -158,17 +158,28 @@ +@@ -156,17 +156,28 @@ } float f9 = Math.min(1.0F / field_205093_c, Math.min(1.0F / field_205094_d, 1.0F / field_205095_e)); @@ -29,27 +29,26 @@ RenderSystem.clearColor(field_205093_c, field_205094_d, field_205095_e, 0.0F); } -@@ -177,10 +188,18 @@ +@@ -174,10 +185,17 @@ + RenderSystem.fogDensity(0.0F); RenderSystem.fogMode(GlStateManager.FogMode.EXP2); } - -- public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) { -+ @Deprecated // FORGE: Pass in partialTicks -+ public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) { -+ setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0); -+ } +- ++ @Deprecated // FORGE: Pass in partialTicks + public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) { ++ setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0); ++ } + -+ public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) { ++ public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) { FluidState fluidstate = p_228372_0_.func_216771_k(); Entity entity = p_228372_0_.func_216773_g(); - boolean flag = fluidstate.func_206886_c() != Fluids.field_204541_a; + float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(p_228372_1_, p_228372_0_, partialTicks, 0.1F); + if (hook >= 0) RenderSystem.fogDensity(hook); + else if (fluidstate.func_206884_a(FluidTags.field_206959_a)) { float f = 1.0F; f = 0.05F; -@@ -231,6 +250,7 @@ +@@ -228,6 +246,7 @@ RenderSystem.fogEnd(f3); RenderSystem.fogMode(GlStateManager.FogMode.LINEAR); RenderSystem.setupNvFogDistance(); diff --git a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch index ef9b9ed35..99d007cb8 100644 --- a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/GameRenderer.java +++ b/net/minecraft/client/renderer/GameRenderer.java -@@ -132,6 +132,8 @@ +@@ -135,6 +135,8 @@ this.func_175069_a(new ResourceLocation("shaders/post/spider.json")); } else if (p_175066_1_ instanceof EndermanEntity) { this.func_175069_a(new ResourceLocation("shaders/post/invert.json")); @@ -9,7 +9,7 @@ } } -@@ -307,7 +309,7 @@ +@@ -310,7 +312,7 @@ d0 = d0 * 60.0D / 70.0D; } @@ -18,7 +18,7 @@ } } -@@ -476,7 +478,7 @@ +@@ -486,7 +488,7 @@ } } else if (this.field_78531_r.field_71462_r != null) { try { @@ -27,10 +27,10 @@ } catch (Throwable throwable) { CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Rendering screen"); CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Screen render details"); -@@ -589,9 +591,16 @@ +@@ -595,9 +597,16 @@ Matrix4f matrix4f = matrixstack.func_227866_c_().func_227870_a_(); this.func_228379_a_(matrix4f); - activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), this.field_78531_r.field_71474_y.field_74320_O > 0, this.field_78531_r.field_71474_y.field_74320_O == 2, p_228378_1_); + activerenderinfo.func_216772_a(this.field_78531_r.field_71441_e, (Entity)(this.field_78531_r.func_175606_aa() == null ? this.field_78531_r.field_71439_g : this.field_78531_r.func_175606_aa()), !this.field_78531_r.field_71474_y.func_243230_g().func_243192_a(), this.field_78531_r.field_71474_y.func_243230_g().func_243193_b(), p_228378_1_); + + net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup cameraSetup = net.minecraftforge.client.ForgeHooksClient.onCameraSetup(this, activerenderinfo, p_228378_1_); + activerenderinfo.setAnglesInternal(cameraSetup.getYaw(), cameraSetup.getPitch()); @@ -44,7 +44,7 @@ this.field_78531_r.func_213239_aq().func_219895_b("hand"); if (this.field_175074_C) { RenderSystem.clear(256, Minecraft.field_142025_a); -@@ -671,4 +680,9 @@ +@@ -709,4 +718,9 @@ public OverlayTexture func_228385_m_() { return this.field_228375_t_; } diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 7bf595297..cfbda0458 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -39,7 +39,7 @@ } p_229111_4_.func_227865_b_(); -@@ -172,7 +174,7 @@ +@@ -176,7 +178,7 @@ float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; @@ -48,7 +48,7 @@ } } -@@ -263,6 +265,7 @@ +@@ -267,6 +269,7 @@ crashreportcategory.func_189529_a("Item Type", () -> { return String.valueOf((Object)p_239387_2_.func_77973_b()); }); @@ -56,7 +56,7 @@ crashreportcategory.func_189529_a("Item Damage", () -> { return String.valueOf(p_239387_2_.func_77952_i()); }); -@@ -294,18 +297,16 @@ +@@ -298,18 +301,16 @@ irendertypebuffer$impl.func_228461_a_(); } @@ -79,7 +79,7 @@ this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255); this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255); RenderSystem.enableBlend(); -@@ -343,4 +344,9 @@ +@@ -347,4 +348,9 @@ public void func_195410_a(IResourceManager p_195410_1_) { this.field_175059_m.func_178085_b(); } diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderState.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderState.java.patch deleted file mode 100644 index b25dda632..000000000 --- a/patches/minecraft/net/minecraft/client/renderer/RenderState.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/client/renderer/RenderState.java -+++ b/net/minecraft/client/renderer/RenderState.java -@@ -255,7 +255,7 @@ - private final float field_228574_Q_; - - public AlphaState(float p_i225974_1_) { -- super("alpha", () -> { -+ super("alpha", () -> { // FORGE: fix MC-167447 - if (p_i225974_1_ > 0.0F) { - RenderSystem.enableAlphaTest(); - RenderSystem.alphaFunc(516, p_i225974_1_); diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index 6c1b19215..a27e36b06 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/WorldRenderer.java +++ b/net/minecraft/client/renderer/WorldRenderer.java -@@ -812,7 +812,7 @@ +@@ -830,7 +830,7 @@ this.field_147595_R = true; BlockPos blockpos2 = chunkrenderdispatcher$chunkrender4.func_178568_j().func_177982_a(8, 8, 8); boolean flag1 = blockpos2.func_177951_i(blockpos) < 768.0D; @@ -9,7 +9,7 @@ this.field_175009_l.add(chunkrenderdispatcher$chunkrender4); } else { this.field_72777_q.func_213239_aq().func_76320_a("build near"); -@@ -897,13 +897,13 @@ +@@ -915,13 +915,13 @@ float f = p_228426_7_.func_205001_m(); boolean flag1 = this.field_72777_q.field_71441_e.func_239132_a_().func_230493_a_(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d1)) || this.field_72777_q.field_71456_v.func_184046_j().func_184056_f(); if (this.field_72777_q.field_71474_y.field_151451_c >= 4) { @@ -25,7 +25,7 @@ iprofiler.func_219895_b("terrain_setup"); this.func_228437_a_(p_228426_6_, clippinghelper, flag, this.field_228409_ai_++, this.field_72777_q.field_71439_g.func_175149_v()); iprofiler.func_219895_b("updatechunks"); -@@ -924,7 +924,9 @@ +@@ -942,7 +942,9 @@ this.func_174967_a(p_228426_3_ + l1); iprofiler.func_219895_b("terrain"); this.func_228441_a_(RenderType.func_228639_c_(), p_228426_1_, d0, d1, d2); @@ -35,7 +35,7 @@ this.func_228441_a_(RenderType.func_228643_e_(), p_228426_1_, d0, d1, d2); if (this.field_72769_h.func_239132_a_().func_239217_c_()) { RenderHelper.func_237533_a_(p_228426_1_.func_227866_c_().func_227870_a_()); -@@ -994,6 +996,7 @@ +@@ -1010,6 +1012,7 @@ List list = worldrenderer$localrenderinformationcontainer.field_178036_a.func_178571_g().func_178485_b(); if (!list.isEmpty()) { for(TileEntity tileentity1 : list) { @@ -43,7 +43,7 @@ BlockPos blockpos3 = tileentity1.func_174877_v(); IRenderTypeBuffer irendertypebuffer1 = irendertypebuffer$impl; p_228426_1_.func_227860_a_(); -@@ -1019,6 +1022,7 @@ +@@ -1035,6 +1038,7 @@ synchronized(this.field_181024_n) { for(TileEntity tileentity : this.field_181024_n) { @@ -51,7 +51,7 @@ BlockPos blockpos2 = tileentity.func_174877_v(); p_228426_1_.func_227860_a_(); p_228426_1_.func_227861_a_((double)blockpos2.func_177958_n() - d0, (double)blockpos2.func_177956_o() - d1, (double)blockpos2.func_177952_p() - d2); -@@ -1069,7 +1073,8 @@ +@@ -1084,7 +1088,8 @@ iprofiler.func_219895_b("outline"); BlockPos blockpos = ((BlockRayTraceResult)raytraceresult).func_216350_a(); BlockState blockstate = this.field_72769_h.func_180495_p(blockpos); @@ -61,7 +61,7 @@ IVertexBuilder ivertexbuilder2 = irendertypebuffer$impl.getBuffer(RenderType.func_228659_m_()); this.func_228429_a_(p_228426_1_, ivertexbuilder2, p_228426_6_.func_216773_g(), d0, d1, d2, blockpos, blockstate); } -@@ -2056,7 +2061,12 @@ +@@ -2076,7 +2081,12 @@ this.field_175008_n.func_217628_a(p_215319_1_, p_215319_2_, p_215319_3_, p_215319_4_); } @@ -74,7 +74,7 @@ ISound isound = this.field_147593_P.get(p_184377_2_); if (isound != null) { this.field_72777_q.func_147118_V().func_147683_b(isound); -@@ -2064,7 +2074,7 @@ +@@ -2084,7 +2094,7 @@ } if (p_184377_1_ != null) { @@ -83,7 +83,7 @@ if (musicdiscitem != null) { this.field_72777_q.field_71456_v.func_238451_a_(musicdiscitem.func_234801_g_()); } -@@ -2212,7 +2222,7 @@ +@@ -2232,7 +2242,7 @@ break; case 1010: if (Item.func_150899_d(p_180439_4_) instanceof MusicDiscItem) { @@ -92,7 +92,7 @@ } else { this.func_184377_a((SoundEvent)null, p_180439_3_); } -@@ -2362,8 +2372,8 @@ +@@ -2382,8 +2392,8 @@ break; case 2001: BlockState blockstate = Block.func_196257_b(p_180439_4_); @@ -103,7 +103,7 @@ this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false); } -@@ -2511,7 +2521,7 @@ +@@ -2531,7 +2541,7 @@ } else { int i = p_228420_0_.func_226658_a_(LightType.SKY, p_228420_2_); int j = p_228420_0_.func_226658_a_(LightType.BLOCK, p_228420_2_); @@ -112,7 +112,7 @@ if (j < k) { j = k; } -@@ -2550,6 +2560,11 @@ +@@ -2570,6 +2580,11 @@ return this.field_239226_J_; } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/EntityRendererManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/EntityRendererManager.java.patch index a316bf42b..c0f540ca5 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/EntityRendererManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/EntityRendererManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/entity/EntityRendererManager.java +++ b/net/minecraft/client/renderer/entity/EntityRendererManager.java -@@ -187,7 +187,10 @@ +@@ -188,7 +188,10 @@ this.field_178637_m = new PlayerRenderer(this); this.field_178636_l.put("default", this.field_178637_m); this.field_178636_l.put("slim", new PlayerRenderer(this, true)); @@ -11,7 +11,7 @@ for(EntityType entitytype : Registry.field_212629_r) { if (entitytype != EntityType.field_200729_aH && !this.field_78729_o.containsKey(entitytype)) { throw new IllegalStateException("No renderer registered for " + Registry.field_212629_r.func_177774_c(entitytype)); -@@ -449,4 +452,8 @@ +@@ -450,4 +453,8 @@ public FontRenderer func_78716_a() { return this.field_78736_p; } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch index 58f9444f8..0e0e50418 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/entity/layers/ElytraLayer.java +++ b/net/minecraft/client/renderer/entity/layers/ElytraLayer.java -@@ -29,7 +29,7 @@ +@@ -30,7 +30,7 @@ public void func_225628_a_(MatrixStack p_225628_1_, IRenderTypeBuffer p_225628_2_, int p_225628_3_, T p_225628_4_, float p_225628_5_, float p_225628_6_, float p_225628_7_, float p_225628_8_, float p_225628_9_, float p_225628_10_) { ItemStack itemstack = p_225628_4_.func_184582_a(EquipmentSlotType.CHEST); @@ -9,7 +9,7 @@ ResourceLocation resourcelocation; if (p_225628_4_ instanceof AbstractClientPlayerEntity) { AbstractClientPlayerEntity abstractclientplayerentity = (AbstractClientPlayerEntity)p_225628_4_; -@@ -38,10 +38,10 @@ +@@ -39,10 +39,10 @@ } else if (abstractclientplayerentity.func_152122_n() && abstractclientplayerentity.func_110303_q() != null && abstractclientplayerentity.func_175148_a(PlayerModelPart.CAPE)) { resourcelocation = abstractclientplayerentity.func_110303_q(); } else { @@ -22,7 +22,7 @@ } p_225628_1_.func_227860_a_(); -@@ -53,4 +53,29 @@ +@@ -54,4 +54,29 @@ p_225628_1_.func_227865_b_(); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch index d59f86e15..1f73150b2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/texture/TextureManager.java +++ b/net/minecraft/client/renderer/texture/TextureManager.java -@@ -145,6 +145,7 @@ +@@ -157,6 +157,7 @@ public void func_147645_c(ResourceLocation p_147645_1_) { Texture texture = this.func_229267_b_(p_147645_1_); if (texture != null) { diff --git a/patches/minecraft/net/minecraft/client/resources/ClientLanguageMap.java.patch b/patches/minecraft/net/minecraft/client/resources/ClientLanguageMap.java.patch index 4cbb0a11f..70f9c279c 100644 --- a/patches/minecraft/net/minecraft/client/resources/ClientLanguageMap.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/ClientLanguageMap.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/client/resources/ClientLanguageMap.java +++ b/net/minecraft/client/resources/ClientLanguageMap.java -@@ -116,4 +116,9 @@ - return p_239500_1_; - } +@@ -78,4 +78,9 @@ + public IReorderingProcessor func_241870_a(ITextProperties p_241870_1_) { + return BidiReorderer.func_243508_a(p_241870_1_, this.field_239496_d_); } -+ ++ + @Override + public Map getLanguageData() { + return field_239495_c_; diff --git a/patches/minecraft/net/minecraft/client/resources/ClientResourcePackInfo.java.patch b/patches/minecraft/net/minecraft/client/resources/ClientResourcePackInfo.java.patch deleted file mode 100644 index d941410b5..000000000 --- a/patches/minecraft/net/minecraft/client/resources/ClientResourcePackInfo.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/minecraft/client/resources/ClientResourcePackInfo.java -+++ b/net/minecraft/client/resources/ClientResourcePackInfo.java -@@ -24,13 +24,23 @@ - @Nullable - private ResourceLocation field_195810_b; - -+ @Deprecated - public ClientResourcePackInfo(String p_i232485_1_, boolean p_i232485_2_, Supplier p_i232485_3_, IResourcePack p_i232485_4_, PackMetadataSection p_i232485_5_, ResourcePackInfo.Priority p_i232485_6_, IPackNameDecorator p_i232485_7_) { -- super(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_); -+ this(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_, false); -+ } -+ -+ public ClientResourcePackInfo(String p_i232485_1_, boolean p_i232485_2_, Supplier p_i232485_3_, IResourcePack p_i232485_4_, PackMetadataSection p_i232485_5_, ResourcePackInfo.Priority p_i232485_6_, IPackNameDecorator p_i232485_7_, boolean hidden) { -+ super(p_i232485_1_, p_i232485_2_, p_i232485_3_, p_i232485_4_, p_i232485_5_, p_i232485_6_, p_i232485_7_, hidden); - this.field_195809_a = func_239491_a_(p_i232485_4_); - } - -+ @Deprecated - public ClientResourcePackInfo(String p_i232486_1_, boolean p_i232486_2_, Supplier p_i232486_3_, ITextComponent p_i232486_4_, ITextComponent p_i232486_5_, PackCompatibility p_i232486_6_, ResourcePackInfo.Priority p_i232486_7_, boolean p_i232486_8_, IPackNameDecorator p_i232486_9_, @Nullable NativeImage p_i232486_10_) { -- super(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_); -+ this(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_, p_i232486_10_, false); -+ } -+ -+ public ClientResourcePackInfo(String p_i232486_1_, boolean p_i232486_2_, Supplier p_i232486_3_, ITextComponent p_i232486_4_, ITextComponent p_i232486_5_, PackCompatibility p_i232486_6_, ResourcePackInfo.Priority p_i232486_7_, boolean p_i232486_8_, IPackNameDecorator p_i232486_9_, @Nullable NativeImage p_i232486_10_, boolean hidden) { -+ super(p_i232486_1_, p_i232486_2_, p_i232486_3_, p_i232486_4_, p_i232486_5_, p_i232486_6_, p_i232486_7_, p_i232486_8_, p_i232486_9_, hidden); - this.field_195809_a = p_i232486_10_; - } - diff --git a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch index 7359d0953..e5ec2943d 100644 --- a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch @@ -26,11 +26,10 @@ } this.func_147611_b(); -@@ -280,4 +290,30 @@ - GlStateManager.func_227658_a_(i, p_216493_1_); +@@ -281,6 +291,32 @@ this.func_147609_e(); } -+ + + + /*================================ FORGE START ================================================*/ + private boolean stencilEnabled = false; @@ -56,4 +55,7 @@ + return this.stencilEnabled; + } + /*================================ FORGE END ================================================*/ - } ++ + public int func_242996_f() { + return this.field_147617_g; + } diff --git a/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch index 52450ee71..170a2bd08 100644 --- a/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/shader/ShaderGroup.java +++ b/net/minecraft/client/shader/ShaderGroup.java -@@ -157,7 +157,8 @@ +@@ -164,7 +164,8 @@ throw new JSONException("Render target '" + s4 + "' can't be used as depth buffer"); } diff --git a/patches/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch index 3b85d51e4..88ac84cf6 100644 --- a/patches/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch @@ -10,7 +10,7 @@ this.field_216556_l = p_i50988_2_; IResource iresource = null; -@@ -142,7 +143,8 @@ +@@ -149,7 +150,8 @@ public static ShaderLoader func_216542_a(IResourceManager p_216542_0_, ShaderLoader.ShaderType p_216542_1_, String p_216542_2_) throws IOException { ShaderLoader shaderloader = p_216542_1_.func_148064_d().get(p_216542_2_); if (shaderloader == null) { diff --git a/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch b/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch index 91752f9da..8ed76c4d5 100644 --- a/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/world/ClientWorld.java +++ b/net/minecraft/client/world/ClientWorld.java -@@ -103,6 +103,8 @@ - this.func_239136_a_(new BlockPos(8, 64, 8)); +@@ -104,6 +104,8 @@ + this.func_239136_a_(new BlockPos(8, 64, 8), 0.0F); this.func_72966_v(); this.func_72947_a(); + this.gatherCapabilities(); @@ -9,7 +9,7 @@ } public DimensionRenderInfo func_239132_a_() { -@@ -185,6 +187,7 @@ +@@ -186,6 +188,7 @@ this.func_217381_Z().func_194340_a(() -> { return Registry.field_212629_r.func_177774_c(p_217418_1_.func_200600_R()).toString(); }); @@ -17,7 +17,7 @@ p_217418_1_.func_70071_h_(); this.func_217381_Z().func_76319_b(); } -@@ -284,9 +287,11 @@ +@@ -285,9 +288,11 @@ } private void func_217424_b(int p_217424_1_, Entity p_217424_2_) { @@ -29,7 +29,7 @@ } public void func_217413_d(int p_217413_1_) { -@@ -305,6 +310,8 @@ +@@ -306,6 +311,8 @@ } this.field_217431_w.remove(p_217414_1_); @@ -38,7 +38,7 @@ } public void func_217417_b(Chunk p_217417_1_) { -@@ -447,6 +454,11 @@ +@@ -448,6 +455,11 @@ } public void func_184148_a(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) { @@ -50,7 +50,7 @@ if (p_184148_1_ == this.field_73037_M.field_71439_g) { this.func_184134_a(p_184148_2_, p_184148_4_, p_184148_6_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_, false); } -@@ -454,6 +466,11 @@ +@@ -455,6 +467,11 @@ } public void func_217384_a(@Nullable PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) { diff --git a/patches/minecraft/net/minecraft/command/Commands.java.patch b/patches/minecraft/net/minecraft/command/Commands.java.patch index 6aa0bbb92..30cf9fbb6 100644 --- a/patches/minecraft/net/minecraft/command/Commands.java.patch +++ b/patches/minecraft/net/minecraft/command/Commands.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/command/Commands.java +++ b/net/minecraft/command/Commands.java -@@ -183,6 +183,7 @@ +@@ -186,6 +186,7 @@ if (p_i232148_1_.field_237219_d_) { PublishCommand.func_198581_a(this.field_197062_b); } @@ -8,7 +8,7 @@ this.field_197062_b.findAmbiguities((p_201302_1_, p_201302_2_, p_201302_3_, p_201302_4_) -> { field_197061_a.warn("Ambiguity between arguments {} and {} with inputs: {}", this.field_197062_b.getPath(p_201302_2_), this.field_197062_b.getPath(p_201302_3_), p_201302_4_); -@@ -202,6 +203,14 @@ +@@ -205,6 +206,14 @@ try { try { diff --git a/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch b/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch index bcbca2830..5e4de2cbd 100644 --- a/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch +++ b/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/command/arguments/BlockStateParser.java +++ b/net/minecraft/command/arguments/BlockStateParser.java -@@ -170,7 +170,7 @@ +@@ -169,7 +169,7 @@ - private boolean func_212598_k(TagCollection p_212598_1_) { + private boolean func_212598_k(ITagCollection p_212598_1_) { if (this.field_197270_l != null) { - return this.field_197270_l.func_177230_c().func_235695_q_(); + return this.field_197270_l.hasTileEntity(); } else { if (this.field_199833_p != null) { ITag itag = p_212598_1_.func_199910_a(this.field_199833_p); -@@ -293,7 +293,7 @@ +@@ -283,7 +283,7 @@ p_197255_1_.suggest(String.valueOf('[')); } diff --git a/patches/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch b/patches/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch index c91e2dbca..1799f9d6b 100644 --- a/patches/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch +++ b/patches/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/loot/EntityLootTables.java +++ b/net/minecraft/data/loot/EntityLootTables.java -@@ -51,7 +51,7 @@ +@@ -50,7 +50,7 @@ return LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(p_218583_0_))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(TableLootEntry.func_216171_a(EntityType.field_200737_ac.func_220348_g()))); } @@ -9,31 +9,26 @@ this.func_218582_a(EntityType.field_200789_c, LootTable.func_216119_b()); this.func_218582_a(EntityType.field_200791_e, LootTable.func_216119_b()); this.func_218582_a(EntityType.field_226289_e_, LootTable.func_216119_b()); -@@ -141,8 +141,12 @@ - this.func_218582_a(EntityType.field_233588_G_, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151147_al).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(2.0F, 4.0F))).func_212841_b_(Smelt.func_215953_b().func_212840_b_(EntityHasProperty.func_215999_a(LootContext.EntityTarget.THIS, field_218586_a))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151116_aA).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 1.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F)))))); +@@ -141,11 +141,15 @@ this.func_218582_a(EntityType.field_233591_ai_, LootTable.func_216119_b()); + this.func_218582_a(EntityType.field_242287_aj, LootTable.func_216119_b()); this.func_218582_a(EntityType.field_200727_aF, LootTable.func_216119_b().func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151078_bh).func_212841_b_(SetCount.func_215932_a(RandomValueRange.func_215837_a(0.0F, 2.0F))).func_212841_b_(LootingEnchantBonus.func_215915_a(RandomValueRange.func_215837_a(0.0F, 1.0F))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151042_j)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151172_bF)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151174_bG)).func_212840_b_(KilledByPlayer.func_215994_b()).func_212840_b_(RandomChanceWithLooting.func_216003_a(0.025F, 0.01F)))); + } + + public void accept(BiConsumer p_accept_1_) { + this.addTables(); Set set = Sets.newHashSet(); -- Iterator iterator = Registry.field_212629_r.iterator(); -+ Iterator iterator = getKnownEntities().iterator(); - EntityType entitytype; - ResourceLocation resourcelocation; -@@ -154,7 +158,7 @@ - - entitytype = (EntityType)iterator.next(); - resourcelocation = entitytype.func_220348_g(); +- for(EntityType entitytype : Registry.field_212629_r) { ++ for(EntityType entitytype : getKnownEntities()) { + ResourceLocation resourcelocation = entitytype.func_220348_g(); - if (!field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC) { + if (isNonLiving(entitytype)) { if (resourcelocation != LootTables.field_186419_a && this.field_218587_b.remove(resourcelocation) != null) { - break; + throw new IllegalStateException(String.format("Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.field_212629_r.func_177774_c(entitytype))); } -@@ -171,6 +175,14 @@ - throw new IllegalStateException(String.format("Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.field_212629_r.func_177774_c(entitytype))); +@@ -162,6 +166,14 @@ + this.field_218587_b.forEach(p_accept_1_::accept); } + protected Iterable> getKnownEntities() { @@ -41,7 +36,7 @@ + } + + protected boolean isNonLiving(EntityType entitytype) { -+ return !field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC; ++ return !field_222944_b.contains(entitytype) && entitytype.func_220339_d() == EntityClassification.MISC; + } + protected void func_218582_a(EntityType p_218582_1_, LootTable.Builder p_218582_2_) { diff --git a/patches/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch b/patches/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch index a0f54047d..6d89cf02d 100644 --- a/patches/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch +++ b/patches/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/dispenser/IDispenseItemBehavior.java +++ b/net/minecraft/dispenser/IDispenseItemBehavior.java -@@ -371,8 +371,9 @@ +@@ -373,8 +373,9 @@ world.func_175656_a(blockpos, AbstractFireBlock.func_235326_a_(world, blockpos)); } else if (CampfireBlock.func_241470_h_(blockstate)) { world.func_175656_a(blockpos, blockstate.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true))); diff --git a/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch index 420e09ec9..91995e463 100644 --- a/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch @@ -9,7 +9,7 @@ BlockState blockstate2 = p_185266_1_.func_180495_p(blockpos); - if (blockstate2.func_185904_a() == Material.field_151586_h && blockstate2.func_177229_b(FlowingFluidBlock.field_176367_b) == 0 && blockstate.func_196955_c(p_185266_1_, blockpos) && p_185266_1_.func_226663_a_(blockstate, blockpos, ISelectionContext.func_216377_a())) { + boolean isFull = blockstate2.func_177230_c() == Blocks.field_150355_j && blockstate2.func_177229_b(FlowingFluidBlock.field_176367_b) == 0; //TODO: Forge, modded waters? -+ if (blockstate2.func_185904_a() == Material.field_151586_h && isFull && blockstate.func_196955_c(p_185266_1_, blockpos) && p_185266_1_.func_226663_a_(blockstate, blockpos, ISelectionContext.func_216377_a()) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_185266_0_, net.minecraftforge.common.util.BlockSnapshot.create(p_185266_1_, blockpos), net.minecraft.util.Direction.UP)) { ++ if (blockstate2.func_185904_a() == Material.field_151586_h && isFull && blockstate.func_196955_c(p_185266_1_, blockpos) && p_185266_1_.func_226663_a_(blockstate, blockpos, ISelectionContext.func_216377_a()) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_185266_0_, net.minecraftforge.common.util.BlockSnapshot.create(p_185266_1_.func_234923_W_(), p_185266_1_, blockpos), net.minecraft.util.Direction.UP)) { p_185266_1_.func_175656_a(blockpos, blockstate); p_185266_1_.func_205220_G_().func_205360_a(blockpos, Blocks.field_185778_de, MathHelper.func_76136_a(p_185266_0_.func_70681_au(), 60, 120)); } diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index bccc3e3bd..17f9de4f7 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/Entity.java +++ b/net/minecraft/entity/Entity.java -@@ -107,12 +107,13 @@ +@@ -109,12 +109,13 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -15,7 +15,7 @@ private final EntityType field_200606_g; private int field_145783_c = field_213331_b.incrementAndGet(); public boolean field_70156_m; -@@ -138,6 +139,7 @@ +@@ -140,6 +141,7 @@ public boolean field_70124_G; public boolean field_70133_I; protected Vector3d field_213328_B = Vector3d.field_186680_a; @@ -23,7 +23,7 @@ public boolean field_70128_L; public float field_70141_P; public float field_70140_Q; -@@ -198,6 +200,7 @@ +@@ -195,6 +197,7 @@ private float field_213326_aJ; public Entity(EntityType p_i48580_1_, World p_i48580_2_) { @@ -31,7 +31,7 @@ this.field_200606_g = p_i48580_1_; this.field_70170_p = p_i48580_2_; this.field_213325_aI = p_i48580_1_.func_220334_j(); -@@ -213,7 +216,9 @@ +@@ -211,7 +214,9 @@ this.field_70180_af.func_187214_a(field_189655_aD, false); this.field_70180_af.func_187214_a(field_213330_X, Pose.STANDING); this.func_70088_a(); @@ -42,7 +42,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -305,7 +310,13 @@ +@@ -317,7 +322,13 @@ } public void func_70106_y() { @@ -58,13 +58,13 @@ public void func_213301_b(Pose p_213301_1_) { @@ -330,6 +341,7 @@ - public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) { - this.func_226288_n_(p_70107_1_, p_70107_3_, p_70107_5_); + public boolean func_233562_a_(Entity p_233562_1_, double p_233562_2_) { + double d0 = p_233562_1_.field_233557_ao_.field_72450_a - this.field_233557_ao_.field_72450_a; + if (this.isAddedToWorld() && !this.field_70170_p.field_72995_K && field_70170_p instanceof ServerWorld) ((ServerWorld)this.field_70170_p).func_217464_b(this); // Forge - Process chunk registration after moving. - float f = this.field_213325_aI.field_220315_a / 2.0F; - float f1 = this.field_213325_aI.field_220316_b; - this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f)); -@@ -542,7 +554,7 @@ + double d1 = p_233562_1_.field_233557_ao_.field_72448_b - this.field_233557_ao_.field_72448_b; + double d2 = p_233562_1_.field_233557_ao_.field_72449_c - this.field_233557_ao_.field_72449_c; + return d0 * d0 + d1 * d1 + d2 * d2 < p_233562_2_ * p_233562_2_; +@@ -560,7 +572,7 @@ this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(func_213296_b(vector3d)) * 0.6D); this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2) * 0.6D); @@ -73,7 +73,7 @@ this.field_70150_b = this.func_203009_ad(); if (this.func_70090_H()) { Entity entity = this.func_184207_aI() && this.func_184179_bs() != null ? this.func_184179_bs() : this; -@@ -557,7 +569,7 @@ +@@ -575,7 +587,7 @@ } else { this.func_180429_a(blockpos, blockstate); } @@ -82,7 +82,7 @@ this.field_191959_ay = this.func_191954_d(this.field_82151_R); } } -@@ -574,8 +586,9 @@ +@@ -591,8 +603,9 @@ float f2 = this.func_225515_ai_(); this.func_213317_d(this.func_213322_ci().func_216372_d((double)f2, 1.0D, (double)f2)); @@ -94,7 +94,7 @@ }) && this.field_190534_ay <= 0) { this.func_241209_g_(-this.func_190531_bD()); } -@@ -594,11 +607,10 @@ +@@ -611,11 +624,10 @@ int j = MathHelper.func_76128_c(this.field_233557_ao_.field_72448_b - (double)0.2F); int k = MathHelper.func_76128_c(this.field_233557_ao_.field_72449_c); BlockPos blockpos = new BlockPos(i, j, k); @@ -108,7 +108,7 @@ return blockpos1; } } -@@ -784,6 +796,7 @@ +@@ -801,6 +813,7 @@ public void func_174829_m() { AxisAlignedBB axisalignedbb = this.func_174813_aQ(); this.func_226288_n_((axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D, axisalignedbb.field_72338_b, (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D); @@ -116,7 +116,7 @@ } protected SoundEvent func_184184_Z() { -@@ -832,7 +845,7 @@ +@@ -849,7 +862,7 @@ protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) { if (!p_180429_2_.func_185904_a().func_76224_d()) { BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()); @@ -125,7 +125,7 @@ this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b()); } } -@@ -1048,9 +1061,10 @@ +@@ -1056,9 +1069,10 @@ int k = MathHelper.func_76128_c(this.func_226281_cx_()); BlockPos blockpos = new BlockPos(i, j, k); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -137,7 +137,7 @@ } } -@@ -1356,6 +1370,7 @@ +@@ -1377,6 +1391,7 @@ if (this.field_184238_ar) { p_189511_1_.func_74757_a("Glowing", this.field_184238_ar); } @@ -145,7 +145,7 @@ if (!this.field_184236_aF.isEmpty()) { ListNBT listnbt = new ListNBT(); -@@ -1367,6 +1382,10 @@ +@@ -1388,6 +1403,10 @@ p_189511_1_.func_218657_a("Tags", listnbt); } @@ -156,7 +156,7 @@ this.func_213281_b(p_189511_1_); if (this.func_184207_aI()) { ListNBT listnbt1 = new ListNBT(); -@@ -1437,6 +1456,9 @@ +@@ -1458,6 +1477,9 @@ this.func_174810_b(p_70020_1_.func_74767_n("Silent")); this.func_189654_d(p_70020_1_.func_74767_n("NoGravity")); this.func_184195_f(p_70020_1_.func_74767_n("Glowing")); @@ -166,7 +166,7 @@ if (p_70020_1_.func_150297_b("Tags", 9)) { this.field_184236_aF.clear(); ListNBT listnbt3 = p_70020_1_.func_150295_c("Tags", 8); -@@ -1525,6 +1547,8 @@ +@@ -1546,6 +1568,8 @@ } else { ItemEntity itementity = new ItemEntity(this.field_70170_p, this.func_226277_ct_(), this.func_226278_cu_() + (double)p_70099_2_, this.func_226281_cx_(), p_70099_1_); itementity.func_174869_p(); @@ -175,7 +175,7 @@ this.field_70170_p.func_217376_c(itementity); return itementity; } -@@ -1558,6 +1582,7 @@ +@@ -1582,6 +1606,7 @@ public void func_70098_U() { this.func_213317_d(Vector3d.field_186680_a); @@ -183,7 +183,7 @@ this.func_70071_h_(); if (this.func_184218_aH()) { this.func_184187_bx().func_184232_k(this); -@@ -1603,6 +1628,7 @@ +@@ -1627,6 +1652,7 @@ } } @@ -191,7 +191,7 @@ if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) { if (this.func_184218_aH()) { this.func_184210_p(); -@@ -1635,6 +1661,7 @@ +@@ -1659,6 +1685,7 @@ public void func_233575_bb_() { if (this.field_184239_as != null) { Entity entity = this.field_184239_as; @@ -199,7 +199,7 @@ this.field_184239_as = null; entity.func_184225_p(this); } -@@ -1799,6 +1826,7 @@ +@@ -1816,6 +1843,7 @@ return !this.func_184188_bt().isEmpty(); } @@ -207,7 +207,7 @@ public boolean func_205710_ba() { return true; } -@@ -2015,7 +2043,7 @@ +@@ -2032,7 +2060,7 @@ } protected ITextComponent func_225513_by_() { @@ -216,7 +216,7 @@ } public boolean func_70028_i(Entity p_70028_1_) { -@@ -2072,10 +2100,15 @@ +@@ -2087,6 +2115,10 @@ @Nullable public Entity func_241206_a_(ServerWorld p_241206_1_) { @@ -227,58 +227,37 @@ if (this.field_70170_p instanceof ServerWorld && !this.field_70128_L) { this.field_70170_p.func_217381_Z().func_76320_a("changeDimension"); this.func_213319_R(); - this.field_70170_p.func_217381_Z().func_76320_a("reposition"); -+ Entity transportedEntity = teleporter.placeEntity(this, (ServerWorld) this.field_70170_p, p_241206_1_, this.field_70177_z, spawnPortal -> { //Forge: Start vanilla logic - Vector3d vector3d = this.func_213322_ci(); - float f = 0.0F; - BlockPos blockpos; -@@ -2105,6 +2138,7 @@ - d1 = MathHelper.func_151237_a(d1, d4, d6); - Vector3d vector3d1 = this.func_181014_aG(); - blockpos = new BlockPos(d0, this.func_226278_cu_(), d1); -+ if (spawnPortal) { - BlockPattern.PortalInfo blockpattern$portalinfo = p_241206_1_.func_85176_s().func_222272_a(blockpos, vector3d, this.func_181012_aH(), vector3d1.field_72450_a, vector3d1.field_72448_b, this instanceof PlayerEntity); - if (blockpattern$portalinfo == null) { - return null; -@@ -2113,6 +2147,7 @@ - blockpos = new BlockPos(blockpattern$portalinfo.field_222505_a); - vector3d = blockpattern$portalinfo.field_222506_b; - f = (float)blockpattern$portalinfo.field_222507_c; -+ } - } - - this.field_70170_p.func_217381_Z().func_219895_b("reloading"); -@@ -2126,13 +2161,15 @@ - ServerWorld.func_241121_a_(p_241206_1_); +@@ -2095,6 +2127,7 @@ + if (portalinfo == null) { + return null; + } else { ++ Entity transportedEntity = teleporter.placeEntity(this, (ServerWorld) this.field_70170_p, p_241206_1_, this.field_70177_z, spawnPortal -> { //Forge: Start vanilla logic + this.field_70170_p.func_217381_Z().func_219895_b("reloading"); + Entity entity = this.func_200600_R().func_200721_a(p_241206_1_); + if (entity != null) { +@@ -2102,17 +2135,19 @@ + entity.func_70012_b(portalinfo.field_222505_a.field_72450_a, portalinfo.field_222505_a.field_72448_b, portalinfo.field_222505_a.field_72449_c, portalinfo.field_242960_c, entity.field_70125_A); + entity.func_213317_d(portalinfo.field_222506_b); + p_241206_1_.func_217460_e(entity); +- if (p_241206_1_.func_234923_W_() == World.field_234920_i_) { ++ if (spawnPortal && p_241206_1_.func_234923_W_() == World.field_234920_i_) { + ServerWorld.func_241121_a_(p_241206_1_); + } } - } -+ return entity; -+ });//Forge: End vanilla logic ++ return entity; ++ }); //Forge: End vanilla logic - this.func_241204_bJ_(); - this.field_70170_p.func_217381_Z().func_76319_b(); - ((ServerWorld)this.field_70170_p).func_82742_i(); - p_241206_1_.func_82742_i(); - this.field_70170_p.func_217381_Z().func_76319_b(); -- return entity; -+ return transportedEntity; + this.func_241204_bJ_(); + this.field_70170_p.func_217381_Z().func_76319_b(); + ((ServerWorld)this.field_70170_p).func_82742_i(); + p_241206_1_.func_82742_i(); + this.field_70170_p.func_217381_Z().func_76319_b(); +- return entity; ++ return transportedEntity; + } } else { return null; - } -@@ -2159,10 +2196,12 @@ - } - - public Vector3d func_181014_aG() { -+ if (this.field_181017_ao == null) return Vector3d.field_186680_a; - return this.field_181017_ao; - } - - public Direction func_181012_aH() { -+ if (this.field_181018_ap == null) return Direction.NORTH; - return this.field_181018_ap; - } - -@@ -2295,7 +2334,7 @@ +@@ -2322,7 +2357,7 @@ Pose pose = this.func_213283_Z(); EntitySize entitysize1 = this.func_213305_a(pose); this.field_213325_aI = entitysize1; @@ -287,7 +266,7 @@ if (entitysize1.field_220315_a < entitysize.field_220315_a) { double d0 = (double)entitysize1.field_220315_a / 2.0D; this.func_174826_a(new AxisAlignedBB(this.func_226277_ct_() - d0, this.func_226278_cu_(), this.func_226281_cx_() - d0, this.func_226277_ct_() + d0, this.func_226278_cu_() + (double)entitysize1.field_220316_b, this.func_226281_cx_() + d0)); -@@ -2769,6 +2808,7 @@ +@@ -2796,6 +2831,7 @@ this.field_233555_aA_ = true; } @@ -295,7 +274,7 @@ } -@@ -2779,4 +2819,69 @@ +@@ -2811,4 +2847,69 @@ public interface IMoveCallback { void accept(Entity p_accept_1_, double p_accept_2_, double p_accept_4_, double p_accept_6_); } diff --git a/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch b/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch index 0b567c859..cc8455438 100644 --- a/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/entity/EntitySpawnPlacementRegistry.java +++ b/net/minecraft/entity/EntitySpawnPlacementRegistry.java @@ -147,10 +147,26 @@ - boolean test(EntityType p_test_1_, IWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_); + boolean test(EntityType p_test_1_, IServerWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_); } - public static enum PlacementType { diff --git a/patches/minecraft/net/minecraft/entity/EntityType.java.patch b/patches/minecraft/net/minecraft/entity/EntityType.java.patch index 151cc4c8a..a7372c108 100644 --- a/patches/minecraft/net/minecraft/entity/EntityType.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/EntityType.java +++ b/net/minecraft/entity/EntityType.java -@@ -141,7 +141,7 @@ +@@ -143,7 +143,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ private static final Logger field_200731_aJ = LogManager.getLogger(); public static final EntityType field_200788_b = func_200712_a("area_effect_cloud", EntityType.Builder.func_220322_a(AreaEffectCloudEntity::new, EntityClassification.MISC).func_220320_c().func_220321_a(6.0F, 0.5F).func_233606_a_(10).func_233608_b_(Integer.MAX_VALUE)); public static final EntityType field_200789_c = func_200712_a("armor_stand", EntityType.Builder.func_220322_a(ArmorStandEntity::new, EntityClassification.MISC).func_220321_a(0.5F, 1.975F).func_233606_a_(10)); -@@ -267,6 +267,12 @@ +@@ -270,6 +270,12 @@ private ResourceLocation field_220358_bg; private final EntitySize field_220359_bi; @@ -22,7 +22,7 @@ private static EntityType func_200712_a(String p_200712_0_, EntityType.Builder p_200712_1_) { return Registry.func_218325_a(Registry.field_212629_r, p_200712_0_, p_200712_1_.func_206830_a(p_200712_0_)); } -@@ -280,6 +286,9 @@ +@@ -283,6 +289,9 @@ } public EntityType(EntityType.IFactory p_i231489_1_, EntityClassification p_i231489_2_, boolean p_i231489_3_, boolean p_i231489_4_, boolean p_i231489_5_, boolean p_i231489_6_, ImmutableSet p_i231489_7_, EntitySize p_i231489_8_, int p_i231489_9_, int p_i231489_10_) { @@ -32,7 +32,7 @@ this.field_200732_aK = p_i231489_1_; this.field_220355_ba = p_i231489_2_; this.field_225438_be = p_i231489_6_; -@@ -290,6 +299,10 @@ +@@ -293,6 +302,10 @@ this.field_220359_bi = p_i231489_8_; this.field_233594_bl_ = p_i231489_9_; this.field_233595_bm_ = p_i231489_10_; @@ -43,15 +43,15 @@ } @Nullable -@@ -300,6 +313,7 @@ - @Nullable - public T func_220342_a(World p_220342_1_, @Nullable CompoundNBT p_220342_2_, @Nullable ITextComponent p_220342_3_, @Nullable PlayerEntity p_220342_4_, BlockPos p_220342_5_, SpawnReason p_220342_6_, boolean p_220342_7_, boolean p_220342_8_) { +@@ -304,6 +317,7 @@ + public T func_220342_a(ServerWorld p_220342_1_, @Nullable CompoundNBT p_220342_2_, @Nullable ITextComponent p_220342_3_, @Nullable PlayerEntity p_220342_4_, BlockPos p_220342_5_, SpawnReason p_220342_6_, boolean p_220342_7_, boolean p_220342_8_) { T t = this.func_220349_b(p_220342_1_, p_220342_2_, p_220342_3_, p_220342_4_, p_220342_5_, p_220342_6_, p_220342_7_, p_220342_8_); -+ if (t instanceof net.minecraft.entity.MobEntity && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((net.minecraft.entity.MobEntity) t, p_220342_1_, p_220342_5_.func_177958_n(), p_220342_5_.func_177956_o(), p_220342_5_.func_177952_p(), null, p_220342_6_)) return null; - p_220342_1_.func_217376_c(t); - return t; - } -@@ -498,14 +512,23 @@ + if (t != null) { ++ if (t instanceof net.minecraft.entity.MobEntity && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((net.minecraft.entity.MobEntity) t, p_220342_1_, p_220342_5_.func_177958_n(), p_220342_5_.func_177956_o(), p_220342_5_.func_177952_p(), null, p_220342_6_)) return null; + p_220342_1_.func_242417_l(t); + } + +@@ -504,14 +518,23 @@ } public int func_233602_m_() { @@ -75,7 +75,7 @@ return this != field_200729_aH && this != field_200770_J && this != field_200760_az && this != field_200791_e && this != field_200766_F && this != field_200768_H && this != field_200782_V && this != field_200801_o && this != field_200805_s; } -@@ -513,6 +536,19 @@ +@@ -519,6 +542,19 @@ return p_220341_1_.func_230235_a_(this); } @@ -95,7 +95,7 @@ public static class Builder { private final EntityType.IFactory field_200709_a; private final EntityClassification field_220324_b; -@@ -525,6 +561,11 @@ +@@ -531,6 +567,11 @@ private int field_233605_i_ = 3; private EntitySize field_220326_f = EntitySize.func_220314_b(0.6F, 1.8F); @@ -107,7 +107,7 @@ private Builder(EntityType.IFactory p_i50479_1_, EntityClassification p_i50479_2_) { this.field_200709_a = p_i50479_1_; this.field_220324_b = p_i50479_2_; -@@ -581,12 +622,36 @@ +@@ -587,12 +628,36 @@ return this; } diff --git a/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch b/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch index 525d358ed..a0cbd44ef 100644 --- a/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/LivingEntity.java +++ b/net/minecraft/entity/LivingEntity.java -@@ -116,7 +116,9 @@ +@@ -117,7 +117,9 @@ public abstract class LivingEntity extends Entity { private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); private static final UUID field_233625_c_ = UUID.fromString("87f46a96-686f-4796-b035-22e16ee9e038"); @@ -10,7 +10,7 @@ protected static final DataParameter field_184621_as = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187191_a); private static final DataParameter field_184632_c = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187193_c); private static final DataParameter field_184633_f = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187192_b); -@@ -244,7 +246,7 @@ +@@ -245,7 +247,7 @@ } public static AttributeModifierMap.MutableAttribute func_233639_cI_() { @@ -19,7 +19,7 @@ } protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, BlockState p_184231_4_, BlockPos p_184231_5_) { -@@ -259,9 +261,10 @@ +@@ -260,9 +262,10 @@ if (!this.field_70170_p.field_72995_K && this.field_70143_R > 3.0F && p_184231_3_) { float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F); @@ -31,7 +31,7 @@ ((ServerWorld)this.field_70170_p).func_195598_a(new BlockParticleData(ParticleTypes.field_197611_d, p_184231_4_), this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), i, 0.0D, 0.0D, 0.0D, (double)0.15F); } } -@@ -329,7 +332,7 @@ +@@ -330,7 +333,7 @@ } } @@ -40,7 +40,7 @@ this.func_184210_p(); } } else if (this.func_70086_ai() < this.func_205010_bg()) { -@@ -474,7 +477,7 @@ +@@ -475,7 +478,7 @@ protected void func_70609_aI() { ++this.field_70725_aQ; if (this.field_70725_aQ == 20) { @@ -49,7 +49,7 @@ for(int i = 0; i < 20; ++i) { double d0 = this.field_70146_Z.nextGaussian() * 0.02D; -@@ -667,7 +670,7 @@ +@@ -668,7 +671,7 @@ if (!effectinstance.func_76455_a(this, () -> { this.func_70695_b(effectinstance, true); })) { @@ -58,7 +58,7 @@ iterator.remove(); this.func_70688_c(effectinstance); } -@@ -716,8 +719,10 @@ +@@ -717,8 +720,10 @@ this.func_82142_c(false); } else { Collection collection = this.field_70713_bf.values(); @@ -71,7 +71,7 @@ this.func_82142_c(this.func_70644_a(Effects.field_76441_p)); } -@@ -781,7 +786,9 @@ +@@ -782,7 +787,9 @@ boolean flag; for(flag = false; iterator.hasNext(); flag = true) { @@ -82,7 +82,7 @@ iterator.remove(); } -@@ -811,6 +818,7 @@ +@@ -812,6 +819,7 @@ return false; } else { EffectInstance effectinstance = this.field_70713_bf.get(p_195064_1_.func_188419_a()); @@ -90,7 +90,7 @@ if (effectinstance == null) { this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_); this.func_70670_a(p_195064_1_); -@@ -825,6 +833,9 @@ +@@ -826,6 +834,9 @@ } public boolean func_70687_e(EffectInstance p_70687_1_) { @@ -100,7 +100,7 @@ if (this.func_70668_bt() == CreatureAttribute.field_223223_b_) { Effect effect = p_70687_1_.func_188419_a(); if (effect == Effects.field_76428_l || effect == Effects.field_76436_u) { -@@ -858,6 +869,7 @@ +@@ -859,6 +870,7 @@ } public boolean func_195063_d(Effect p_195063_1_) { @@ -108,7 +108,7 @@ EffectInstance effectinstance = this.func_184596_c(p_195063_1_); if (effectinstance != null) { this.func_70688_c(effectinstance); -@@ -894,6 +906,8 @@ +@@ -895,6 +907,8 @@ } public void func_70691_i(float p_70691_1_) { @@ -117,7 +117,7 @@ float f = this.func_110143_aJ(); if (f > 0.0F) { this.func_70606_j(f + p_70691_1_); -@@ -914,6 +928,7 @@ +@@ -915,6 +929,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -125,7 +125,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (this.field_70170_p.field_72995_K) { -@@ -980,8 +995,8 @@ +@@ -981,8 +996,8 @@ if (entity1 instanceof PlayerEntity) { this.field_70718_bc = 100; this.field_70717_bb = (PlayerEntity)entity1; @@ -136,7 +136,7 @@ if (wolfentity.func_70909_n()) { this.field_70718_bc = 100; LivingEntity livingentity = wolfentity.func_70902_q(); -@@ -1163,6 +1178,7 @@ +@@ -1165,6 +1180,7 @@ } public void func_70645_a(DamageSource p_70645_1_) { @@ -144,7 +144,7 @@ if (!this.field_70128_L && !this.field_70729_aU) { Entity entity = p_70645_1_.func_76346_g(); LivingEntity livingentity = this.func_94060_bK(); -@@ -1194,10 +1210,10 @@ +@@ -1196,10 +1212,10 @@ if (!this.field_70170_p.field_72995_K) { boolean flag = false; if (p_226298_1_ instanceof WitherEntity) { @@ -157,7 +157,7 @@ this.field_70170_p.func_180501_a(blockpos, blockstate, 3); flag = true; } -@@ -1214,13 +1230,10 @@ +@@ -1216,13 +1232,10 @@ protected void func_213345_d(DamageSource p_213345_1_) { Entity entity = p_213345_1_.func_76346_g(); @@ -174,7 +174,7 @@ boolean flag = this.field_70718_bc > 0; if (this.func_230282_cS_() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e)) { this.func_213354_a(p_213345_1_, flag); -@@ -1229,6 +1242,10 @@ +@@ -1231,6 +1244,10 @@ this.func_213337_cE(); this.func_226294_cV_(); @@ -185,7 +185,7 @@ } protected void func_213337_cE() { -@@ -1238,6 +1255,7 @@ +@@ -1240,6 +1257,7 @@ if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e))) { int i = this.func_70693_a(this.field_70717_bb); @@ -193,7 +193,7 @@ while(i > 0) { int j = ExperienceOrbEntity.func_70527_a(i); i -= j; -@@ -1258,7 +1276,8 @@ +@@ -1260,7 +1278,8 @@ ResourceLocation resourcelocation = this.func_213346_cF(); LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(resourcelocation); LootContext.Builder lootcontext$builder = this.func_213363_a(p_213354_2_, p_213354_1_); @@ -203,12 +203,11 @@ } protected LootContext.Builder func_213363_a(boolean p_213363_1_, DamageSource p_213363_2_) { -@@ -1271,6 +1290,12 @@ +@@ -1273,6 +1292,11 @@ } public void func_233627_a_(float p_233627_1_, double p_233627_2_, double p_233627_4_) { -+ //TODO, Vanilla removed the attacker entity from this method, 1.15-mcp: knockBack -+ net.minecraftforge.event.entity.living.LivingKnockBackEvent event = net.minecraftforge.common.ForgeHooks.onLivingKnockBack(this, null, p_233627_1_, p_233627_2_, p_233627_4_); ++ net.minecraftforge.event.entity.living.LivingKnockBackEvent event = net.minecraftforge.common.ForgeHooks.onLivingKnockBack(this, p_233627_1_, p_233627_2_, p_233627_4_); + if(event.isCanceled()) return; + p_233627_1_ = event.getStrength(); + p_233627_2_ = event.getRatioX(); @@ -216,7 +215,7 @@ p_233627_1_ = (float)((double)p_233627_1_ * (1.0D - this.func_233637_b_(Attributes.field_233820_c_))); if (!(p_233627_1_ <= 0.0F)) { this.field_70160_al = true; -@@ -1320,16 +1345,7 @@ +@@ -1322,16 +1346,7 @@ } else { BlockPos blockpos = this.func_233580_cy_(); BlockState blockstate = this.func_213339_cH(); @@ -234,7 +233,7 @@ } } -@@ -1353,6 +1369,11 @@ +@@ -1355,6 +1370,11 @@ } public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) { @@ -246,7 +245,7 @@ boolean flag = super.func_225503_b_(p_225503_1_, p_225503_2_); int i = this.func_225508_e_(p_225503_1_, p_225503_2_); if (i > 0) { -@@ -1376,9 +1397,10 @@ +@@ -1378,9 +1398,10 @@ int i = MathHelper.func_76128_c(this.func_226277_ct_()); int j = MathHelper.func_76128_c(this.func_226278_cu_() - (double)0.2F); int k = MathHelper.func_76128_c(this.func_226281_cx_()); @@ -260,7 +259,7 @@ this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F); } -@@ -1446,6 +1468,8 @@ +@@ -1448,6 +1469,8 @@ protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { if (!this.func_180431_b(p_70665_1_)) { @@ -269,7 +268,7 @@ p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); float f2 = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); -@@ -1455,10 +1479,11 @@ +@@ -1457,10 +1480,11 @@ ((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f * 10.0F)); } @@ -282,7 +281,7 @@ this.func_110149_m(this.func_110139_bj() - f2); } } -@@ -1512,6 +1537,8 @@ +@@ -1514,6 +1538,8 @@ } public void func_226292_a_(Hand p_226292_1_, boolean p_226292_2_) { @@ -291,7 +290,7 @@ if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) { this.field_110158_av = -1; this.field_82175_bq = true; -@@ -1846,15 +1873,16 @@ +@@ -1848,15 +1874,16 @@ } this.field_70160_al = true; @@ -310,11 +309,11 @@ } protected float func_189749_co() { -@@ -1868,11 +1896,15 @@ +@@ -1870,11 +1897,15 @@ public void func_213352_e(Vector3d p_213352_1_) { if (this.func_70613_aW() || this.func_184186_bw()) { double d0 = 0.08D; -+ ModifiableAttributeInstance gravity = this.func_110148_a(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get()); ++ ModifiableAttributeInstance gravity = this.func_110148_a(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get()); boolean flag = this.func_213322_ci().field_72448_b <= 0.0D; if (flag && this.func_70644_a(Effects.field_204839_B)) { - d0 = 0.01D; @@ -327,7 +326,7 @@ FluidState fluidstate = this.field_70170_p.func_204610_c(this.func_233580_cy_()); if (this.func_70090_H() && this.func_241208_cS_() && !this.func_230285_a_(fluidstate.func_206886_c())) { -@@ -1897,6 +1929,7 @@ +@@ -1899,6 +1930,7 @@ f5 = 0.96F; } @@ -335,7 +334,7 @@ this.func_213309_a(f6, p_213352_1_); this.func_213315_a(MoverType.SELF, this.func_213322_ci()); Vector3d vector3d6 = this.func_213322_ci(); -@@ -1975,7 +2008,7 @@ +@@ -1977,7 +2009,7 @@ } } else { BlockPos blockpos = this.func_226270_aj_(); @@ -344,7 +343,7 @@ float f4 = this.field_70122_E ? f3 * 0.91F : 0.91F; Vector3d vector3d5 = this.func_233633_a_(p_213352_1_, f3); double d2 = vector3d5.field_72448_b; -@@ -2075,6 +2108,7 @@ +@@ -2077,6 +2109,7 @@ } public void func_70071_h_() { @@ -352,7 +351,7 @@ super.func_70071_h_(); this.func_184608_ct(); this.func_205014_p(); -@@ -2230,6 +2264,7 @@ +@@ -2232,6 +2265,7 @@ ItemStack itemstack1 = this.func_184582_a(equipmentslottype); if (!ItemStack.func_77989_b(itemstack1, itemstack)) { @@ -360,7 +359,7 @@ if (map == null) { map = Maps.newEnumMap(EquipmentSlotType.class); } -@@ -2434,6 +2469,8 @@ +@@ -2436,6 +2470,8 @@ boolean flag = this.func_70083_f(7); if (flag && !this.field_70122_E && !this.func_184218_aH() && !this.func_70644_a(Effects.field_188424_y)) { ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST); @@ -369,7 +368,7 @@ if (itemstack.func_77973_b() == Items.field_185160_cR && ElytraItem.func_185069_d(itemstack)) { flag = true; if (!this.field_70170_p.field_72995_K && (this.field_184629_bo + 1) % 20 == 0) { -@@ -2658,8 +2695,16 @@ +@@ -2668,8 +2704,16 @@ private void func_184608_ct() { if (this.func_184587_cr()) { @@ -388,7 +387,7 @@ this.field_184627_bm.func_222121_b(this.field_70170_p, this, this.func_184605_cv()); if (this.func_226299_p_()) { this.func_226293_b_(this.field_184627_bm, 5); -@@ -2707,8 +2752,10 @@ +@@ -2717,8 +2761,10 @@ public void func_184598_c(Hand p_184598_1_) { ItemStack itemstack = this.func_184586_b(p_184598_1_); if (!itemstack.func_190926_b() && !this.func_184587_cr()) { @@ -400,7 +399,7 @@ if (!this.field_70170_p.field_72995_K) { this.func_204802_c(1, true); this.func_204802_c(2, p_184598_1_ == Hand.OFF_HAND); -@@ -2768,6 +2815,9 @@ +@@ -2778,6 +2824,9 @@ vector3d1 = vector3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F)); vector3d1 = vector3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F)); vector3d1 = vector3d1.func_72441_c(this.func_226277_ct_(), this.func_226280_cw_(), this.func_226281_cx_()); @@ -410,18 +409,17 @@ this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vector3d1.field_72450_a, vector3d1.field_72448_b, vector3d1.field_72449_c, vector3d.field_72450_a, vector3d.field_72448_b + 0.05D, vector3d.field_72449_c); } -@@ -2779,7 +2829,9 @@ +@@ -2790,7 +2839,8 @@ } else { if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) { this.func_226293_b_(this.field_184627_bm, 16); -- this.func_184611_a(this.func_184600_cs(), this.field_184627_bm.func_77950_b(this.field_70170_p, this)); +- ItemStack itemstack = this.field_184627_bm.func_77950_b(this.field_70170_p, this); + ItemStack copy = this.field_184627_bm.func_77946_l(); -+ ItemStack stack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, copy, func_184605_cv(), this.field_184627_bm.func_77950_b(this.field_70170_p, this)); -+ this.func_184611_a(this.func_184600_cs(), stack); - this.func_184602_cy(); - } - -@@ -2800,7 +2852,11 @@ ++ ItemStack itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, copy, func_184605_cv(), this.field_184627_bm.func_77950_b(this.field_70170_p, this)); + if (itemstack != this.field_184627_bm) { + this.func_184611_a(hand, itemstack); + } +@@ -2815,7 +2865,11 @@ public void func_184597_cx() { if (!this.field_184627_bm.func_190926_b()) { @@ -433,7 +431,7 @@ if (this.field_184627_bm.func_222122_m()) { this.func_184608_ct(); } -@@ -2949,8 +3005,8 @@ +@@ -2964,8 +3018,8 @@ } BlockState blockstate = this.field_70170_p.func_180495_p(p_213342_1_); @@ -444,7 +442,7 @@ } this.func_213301_b(Pose.SLEEPING); -@@ -2966,15 +3022,15 @@ +@@ -2981,15 +3035,15 @@ private boolean func_213359_p() { return this.func_213374_dv().map((p_241350_1_) -> { @@ -460,10 +458,10 @@ - this.field_70170_p.func_180501_a(p_241348_1_, blockstate.func_206870_a(BedBlock.field_176471_b, Boolean.valueOf(false)), 3); + if (blockstate.isBed(field_70170_p, p_241348_1_, this)) { + blockstate.setBedOccupied(field_70170_p, p_241348_1_, this, false); - Vector3d vector3d1 = BedBlock.func_220172_a(this.func_200600_R(), this.field_70170_p, p_241348_1_, 0).orElseGet(() -> { + Vector3d vector3d1 = BedBlock.func_242652_a(this.func_200600_R(), this.field_70170_p, p_241348_1_, this.field_70177_z).orElseGet(() -> { BlockPos blockpos = p_241348_1_.func_177984_a(); return new Vector3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D); -@@ -2993,7 +3049,9 @@ +@@ -3012,7 +3066,9 @@ @OnlyIn(Dist.CLIENT) public Direction func_213376_dz() { BlockPos blockpos = this.func_213374_dv().orElse((BlockPos)null); @@ -474,11 +472,10 @@ } public boolean func_70094_T() { -@@ -3062,4 +3120,58 @@ - public void func_213334_d(Hand p_213334_1_) { +@@ -3082,6 +3138,60 @@ this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND); } -+ + + /* ==== FORGE START ==== */ + /*** + * Removes all potion effects that have curativeItem as a curative item for its effect @@ -532,4 +529,7 @@ + handlers[x].invalidate(); + } + } - } ++ + @OnlyIn(Dist.CLIENT) + public AxisAlignedBB func_184177_bl() { + if (this.func_184582_a(EquipmentSlotType.HEAD).func_77973_b() == Items.field_196151_dA) { diff --git a/patches/minecraft/net/minecraft/entity/MobEntity.java.patch b/patches/minecraft/net/minecraft/entity/MobEntity.java.patch index 1497d3db2..ea709c77c 100644 --- a/patches/minecraft/net/minecraft/entity/MobEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/MobEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/MobEntity.java +++ b/net/minecraft/entity/MobEntity.java -@@ -197,6 +197,7 @@ +@@ -198,6 +198,7 @@ public void func_70624_b(@Nullable LivingEntity p_70624_1_) { this.field_70696_bz = p_70624_1_; @@ -8,7 +8,7 @@ } public boolean func_213358_a(EntityType p_213358_1_) { -@@ -485,7 +486,7 @@ +@@ -486,7 +487,7 @@ public void func_70636_d() { super.func_70636_d(); this.field_70170_p.func_217381_Z().func_76320_a("looting"); @@ -17,7 +17,7 @@ for(ItemEntity itementity : this.field_70170_p.func_217357_a(ItemEntity.class, this.func_174813_aQ().func_72314_b(1.0D, 0.0D, 1.0D))) { if (!itementity.field_70128_L && !itementity.func_92059_d().func_190926_b() && !itementity.func_174874_s() && this.func_230293_i_(itementity.func_92059_d())) { this.func_175445_a(itementity); -@@ -638,6 +639,14 @@ +@@ -639,6 +640,14 @@ this.func_70106_y(); } else if (!this.func_104002_bU() && !this.func_213392_I()) { Entity entity = this.field_70170_p.func_217362_a(this, -1.0D); @@ -32,7 +32,7 @@ if (entity != null) { double d0 = entity.func_70068_e(this); int i = this.func_200600_R().func_220339_d().func_233671_f_(); -@@ -877,6 +886,8 @@ +@@ -878,6 +887,8 @@ } public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) { @@ -41,7 +41,7 @@ Item item = p_184640_0_.func_77973_b(); if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof BlockItem) || !(((BlockItem)item).func_179223_d() instanceof AbstractSkullBlock))) { if (item instanceof ArmorItem) { -@@ -884,7 +895,7 @@ +@@ -885,7 +896,7 @@ } else if (item == Items.field_185160_cR) { return EquipmentSlotType.CHEST; } else { diff --git a/patches/minecraft/net/minecraft/entity/ai/attributes/GlobalEntityTypeAttributes.java.patch b/patches/minecraft/net/minecraft/entity/ai/attributes/GlobalEntityTypeAttributes.java.patch index 28b3fb6c9..e915866a3 100644 --- a/patches/minecraft/net/minecraft/entity/ai/attributes/GlobalEntityTypeAttributes.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/attributes/GlobalEntityTypeAttributes.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/entity/ai/attributes/GlobalEntityTypeAttributes.java +++ b/net/minecraft/entity/ai/attributes/GlobalEntityTypeAttributes.java -@@ -71,13 +71,19 @@ +@@ -72,13 +72,19 @@ public class GlobalEntityTypeAttributes { private static final Logger field_233832_a_ = LogManager.getLogger(); - private static final Map, AttributeModifierMap> field_233833_b_ = ImmutableMap., AttributeModifierMap>builder().put(EntityType.field_200789_c, LivingEntity.func_233639_cI_().func_233813_a_()).put(EntityType.field_200791_e, BatEntity.func_234175_m_().func_233813_a_()).put(EntityType.field_226289_e_, BeeEntity.func_234182_eX_().func_233813_a_()).put(EntityType.field_200792_f, BlazeEntity.func_234276_m_().func_233813_a_()).put(EntityType.field_220360_g, CatEntity.func_234184_eY_().func_233813_a_()).put(EntityType.field_200794_h, CaveSpiderEntity.func_234277_m_().func_233813_a_()).put(EntityType.field_200795_i, ChickenEntity.func_234187_eI_().func_233813_a_()).put(EntityType.field_203780_j, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_200796_j, CowEntity.func_234188_eI_().func_233813_a_()).put(EntityType.field_200797_k, CreeperEntity.func_234278_m_().func_233813_a_()).put(EntityType.field_205137_n, DolphinEntity.func_234190_eK_().func_233813_a_()).put(EntityType.field_200798_l, AbstractChestedHorseEntity.func_234234_eJ_().func_233813_a_()).put(EntityType.field_204724_o, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_200800_n, ElderGuardianEntity.func_234283_m_().func_233813_a_()).put(EntityType.field_200803_q, EndermanEntity.func_234287_m_().func_233813_a_()).put(EntityType.field_200804_r, EndermiteEntity.func_234288_m_().func_233813_a_()).put(EntityType.field_200802_p, EnderDragonEntity.func_234257_m_().func_233813_a_()).put(EntityType.field_200806_t, EvokerEntity.func_234289_eI_().func_233813_a_()).put(EntityType.field_220356_B, FoxEntity.func_234192_eI_().func_233813_a_()).put(EntityType.field_200811_y, GhastEntity.func_234290_eH_().func_233813_a_()).put(EntityType.field_200812_z, GiantEntity.func_234291_m_().func_233813_a_()).put(EntityType.field_200761_A, GuardianEntity.func_234292_eK_().func_233813_a_()).put(EntityType.field_233588_G_, HoglinEntity.func_234362_eI_().func_233813_a_()).put(EntityType.field_200762_B, AbstractHorseEntity.func_234237_fg_().func_233813_a_()).put(EntityType.field_200763_C, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_200764_D, IllusionerEntity.func_234293_eI_().func_233813_a_()).put(EntityType.field_200757_aw, IronGolemEntity.func_234200_m_().func_233813_a_()).put(EntityType.field_200769_I, LlamaEntity.func_234244_fu_().func_233813_a_()).put(EntityType.field_200771_K, MagmaCubeEntity.func_234294_m_().func_233813_a_()).put(EntityType.field_200780_T, CowEntity.func_234188_eI_().func_233813_a_()).put(EntityType.field_200779_S, AbstractChestedHorseEntity.func_234234_eJ_().func_233813_a_()).put(EntityType.field_200781_U, OcelotEntity.func_234201_eI_().func_233813_a_()).put(EntityType.field_220353_aa, PandaEntity.func_234204_eW_().func_233813_a_()).put(EntityType.field_200783_W, ParrotEntity.func_234213_eS_().func_233813_a_()).put(EntityType.field_203097_aH, MonsterEntity.func_234295_eP_().func_233813_a_()).put(EntityType.field_200784_X, PigEntity.func_234215_eI_().func_233813_a_()).put(EntityType.field_233591_ai_, PiglinEntity.func_234420_eI_().func_233813_a_()).put(EntityType.field_220350_aJ, PillagerEntity.func_234296_eI_().func_233813_a_()).put(EntityType.field_200729_aH, PlayerEntity.func_234570_el_().func_233813_a_()).put(EntityType.field_200786_Z, PolarBearEntity.func_234219_eI_().func_233813_a_()).put(EntityType.field_203779_Z, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_200736_ab, RabbitEntity.func_234224_eJ_().func_233813_a_()).put(EntityType.field_220352_aU, RavagerEntity.func_234297_m_().func_233813_a_()).put(EntityType.field_203778_ae, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_200737_ac, SheepEntity.func_234225_eI_().func_233813_a_()).put(EntityType.field_200738_ad, ShulkerEntity.func_234300_m_().func_233813_a_()).put(EntityType.field_200740_af, SilverfishEntity.func_234301_m_().func_233813_a_()).put(EntityType.field_200741_ag, AbstractSkeletonEntity.func_234275_m_().func_233813_a_()).put(EntityType.field_200742_ah, SkeletonHorseEntity.func_234250_eJ_().func_233813_a_()).put(EntityType.field_200743_ai, MonsterEntity.func_234295_eP_().func_233813_a_()).put(EntityType.field_200745_ak, SnowGolemEntity.func_234226_m_().func_233813_a_()).put(EntityType.field_200748_an, SpiderEntity.func_234305_eI_().func_233813_a_()).put(EntityType.field_200749_ao, SquidEntity.func_234227_m_().func_233813_a_()).put(EntityType.field_200750_ap, AbstractSkeletonEntity.func_234275_m_().func_233813_a_()).put(EntityType.field_233589_aE_, StriderEntity.func_234317_eK_().func_233813_a_()).put(EntityType.field_220354_ax, LlamaEntity.func_234244_fu_().func_233813_a_()).put(EntityType.field_204262_at, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_203099_aq, TurtleEntity.func_234228_eK_().func_233813_a_()).put(EntityType.field_200755_au, VexEntity.func_234321_m_().func_233813_a_()).put(EntityType.field_200756_av, VillagerEntity.func_234551_eU_().func_233813_a_()).put(EntityType.field_200758_ax, VindicatorEntity.func_234322_eI_().func_233813_a_()).put(EntityType.field_220351_aK, MobEntity.func_233666_p_().func_233813_a_()).put(EntityType.field_200759_ay, WitchEntity.func_234323_eI_().func_233813_a_()).put(EntityType.field_200760_az, WitherEntity.func_234258_eI_().func_233813_a_()).put(EntityType.field_200722_aA, AbstractSkeletonEntity.func_234275_m_().func_233813_a_()).put(EntityType.field_200724_aC, WolfEntity.func_234233_eS_().func_233813_a_()).put(EntityType.field_233590_aW_, ZoglinEntity.func_234339_m_().func_233813_a_()).put(EntityType.field_200725_aD, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_200726_aE, ZombieHorseEntity.func_234256_eJ_().func_233813_a_()).put(EntityType.field_200727_aF, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_233592_ba_, ZombifiedPiglinEntity.func_234352_eU_().func_233813_a_()).build(); + private static final Map, AttributeModifierMap> field_233833_b_ = ImmutableMap., AttributeModifierMap>builder().put(EntityType.field_200789_c, LivingEntity.func_233639_cI_().func_233813_a_()).put(EntityType.field_200791_e, BatEntity.func_234175_m_().func_233813_a_()).put(EntityType.field_226289_e_, BeeEntity.func_234182_eX_().func_233813_a_()).put(EntityType.field_200792_f, BlazeEntity.func_234276_m_().func_233813_a_()).put(EntityType.field_220360_g, CatEntity.func_234184_eY_().func_233813_a_()).put(EntityType.field_200794_h, CaveSpiderEntity.func_234277_m_().func_233813_a_()).put(EntityType.field_200795_i, ChickenEntity.func_234187_eI_().func_233813_a_()).put(EntityType.field_203780_j, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_200796_j, CowEntity.func_234188_eI_().func_233813_a_()).put(EntityType.field_200797_k, CreeperEntity.func_234278_m_().func_233813_a_()).put(EntityType.field_205137_n, DolphinEntity.func_234190_eK_().func_233813_a_()).put(EntityType.field_200798_l, AbstractChestedHorseEntity.func_234234_eJ_().func_233813_a_()).put(EntityType.field_204724_o, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_200800_n, ElderGuardianEntity.func_234283_m_().func_233813_a_()).put(EntityType.field_200803_q, EndermanEntity.func_234287_m_().func_233813_a_()).put(EntityType.field_200804_r, EndermiteEntity.func_234288_m_().func_233813_a_()).put(EntityType.field_200802_p, EnderDragonEntity.func_234257_m_().func_233813_a_()).put(EntityType.field_200806_t, EvokerEntity.func_234289_eI_().func_233813_a_()).put(EntityType.field_220356_B, FoxEntity.func_234192_eI_().func_233813_a_()).put(EntityType.field_200811_y, GhastEntity.func_234290_eH_().func_233813_a_()).put(EntityType.field_200812_z, GiantEntity.func_234291_m_().func_233813_a_()).put(EntityType.field_200761_A, GuardianEntity.func_234292_eK_().func_233813_a_()).put(EntityType.field_233588_G_, HoglinEntity.func_234362_eI_().func_233813_a_()).put(EntityType.field_200762_B, AbstractHorseEntity.func_234237_fg_().func_233813_a_()).put(EntityType.field_200763_C, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_200764_D, IllusionerEntity.func_234293_eI_().func_233813_a_()).put(EntityType.field_200757_aw, IronGolemEntity.func_234200_m_().func_233813_a_()).put(EntityType.field_200769_I, LlamaEntity.func_234244_fu_().func_233813_a_()).put(EntityType.field_200771_K, MagmaCubeEntity.func_234294_m_().func_233813_a_()).put(EntityType.field_200780_T, CowEntity.func_234188_eI_().func_233813_a_()).put(EntityType.field_200779_S, AbstractChestedHorseEntity.func_234234_eJ_().func_233813_a_()).put(EntityType.field_200781_U, OcelotEntity.func_234201_eI_().func_233813_a_()).put(EntityType.field_220353_aa, PandaEntity.func_234204_eW_().func_233813_a_()).put(EntityType.field_200783_W, ParrotEntity.func_234213_eS_().func_233813_a_()).put(EntityType.field_203097_aH, MonsterEntity.func_234295_eP_().func_233813_a_()).put(EntityType.field_200784_X, PigEntity.func_234215_eI_().func_233813_a_()).put(EntityType.field_233591_ai_, PiglinEntity.func_234420_eI_().func_233813_a_()).put(EntityType.field_242287_aj, PiglinBruteEntity.func_242344_eS().func_233813_a_()).put(EntityType.field_220350_aJ, PillagerEntity.func_234296_eI_().func_233813_a_()).put(EntityType.field_200729_aH, PlayerEntity.func_234570_el_().func_233813_a_()).put(EntityType.field_200786_Z, PolarBearEntity.func_234219_eI_().func_233813_a_()).put(EntityType.field_203779_Z, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_200736_ab, RabbitEntity.func_234224_eJ_().func_233813_a_()).put(EntityType.field_220352_aU, RavagerEntity.func_234297_m_().func_233813_a_()).put(EntityType.field_203778_ae, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_200737_ac, SheepEntity.func_234225_eI_().func_233813_a_()).put(EntityType.field_200738_ad, ShulkerEntity.func_234300_m_().func_233813_a_()).put(EntityType.field_200740_af, SilverfishEntity.func_234301_m_().func_233813_a_()).put(EntityType.field_200741_ag, AbstractSkeletonEntity.func_234275_m_().func_233813_a_()).put(EntityType.field_200742_ah, SkeletonHorseEntity.func_234250_eJ_().func_233813_a_()).put(EntityType.field_200743_ai, MonsterEntity.func_234295_eP_().func_233813_a_()).put(EntityType.field_200745_ak, SnowGolemEntity.func_234226_m_().func_233813_a_()).put(EntityType.field_200748_an, SpiderEntity.func_234305_eI_().func_233813_a_()).put(EntityType.field_200749_ao, SquidEntity.func_234227_m_().func_233813_a_()).put(EntityType.field_200750_ap, AbstractSkeletonEntity.func_234275_m_().func_233813_a_()).put(EntityType.field_233589_aE_, StriderEntity.func_234317_eK_().func_233813_a_()).put(EntityType.field_220354_ax, LlamaEntity.func_234244_fu_().func_233813_a_()).put(EntityType.field_204262_at, AbstractFishEntity.func_234176_m_().func_233813_a_()).put(EntityType.field_203099_aq, TurtleEntity.func_234228_eK_().func_233813_a_()).put(EntityType.field_200755_au, VexEntity.func_234321_m_().func_233813_a_()).put(EntityType.field_200756_av, VillagerEntity.func_234551_eU_().func_233813_a_()).put(EntityType.field_200758_ax, VindicatorEntity.func_234322_eI_().func_233813_a_()).put(EntityType.field_220351_aK, MobEntity.func_233666_p_().func_233813_a_()).put(EntityType.field_200759_ay, WitchEntity.func_234323_eI_().func_233813_a_()).put(EntityType.field_200760_az, WitherEntity.func_234258_eI_().func_233813_a_()).put(EntityType.field_200722_aA, AbstractSkeletonEntity.func_234275_m_().func_233813_a_()).put(EntityType.field_200724_aC, WolfEntity.func_234233_eS_().func_233813_a_()).put(EntityType.field_233590_aW_, ZoglinEntity.func_234339_m_().func_233813_a_()).put(EntityType.field_200725_aD, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_200726_aE, ZombieHorseEntity.func_234256_eJ_().func_233813_a_()).put(EntityType.field_200727_aF, ZombieEntity.func_234342_eQ_().func_233813_a_()).put(EntityType.field_233592_ba_, ZombifiedPiglinEntity.func_234352_eU_().func_233813_a_()).build(); + private static final Map, AttributeModifierMap> FORGE_ATTRIBUTES = new java.util.HashMap, AttributeModifierMap>(); + + public static AttributeModifierMap put(EntityType type, AttributeModifierMap map) { diff --git a/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch b/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch index 536147dcc..b70ec7f37 100644 --- a/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/entity/effect/LightningBoltEntity.java +++ b/net/minecraft/entity/effect/LightningBoltEntity.java -@@ -82,6 +82,7 @@ +@@ -83,6 +83,7 @@ List list = this.field_70170_p.func_175674_a(this, new AxisAlignedBB(this.func_226277_ct_() - 3.0D, this.func_226278_cu_() - 3.0D, this.func_226281_cx_() - 3.0D, this.func_226277_ct_() + 3.0D, this.func_226278_cu_() + 6.0D + 3.0D, this.func_226281_cx_() + 3.0D), Entity::func_70089_S); for(Entity entity : list) { + if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) - entity.func_70077_a(this); + entity.func_241841_a((ServerWorld)this.field_70170_p, this); } diff --git a/patches/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch index 5232c3e5e..1bfa17c3e 100644 --- a/patches/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/ArmorStandEntity.java +++ b/net/minecraft/entity/item/ArmorStandEntity.java -@@ -55,7 +55,7 @@ +@@ -60,7 +60,7 @@ public static final DataParameter field_184806_f = EntityDataManager.func_187226_a(ArmorStandEntity.class, DataSerializers.field_187199_i); public static final DataParameter field_184807_g = EntityDataManager.func_187226_a(ArmorStandEntity.class, DataSerializers.field_187199_i); private static final Predicate field_184798_bv = (p_200617_0_) -> { diff --git a/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch index 0c4aa2468..641e12607 100644 --- a/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/BoatEntity.java +++ b/net/minecraft/entity/item/BoatEntity.java -@@ -467,7 +467,7 @@ +@@ -468,7 +468,7 @@ blockpos$mutable.func_181079_c(l1, k2, i2); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos$mutable); if (!(blockstate.func_177230_c() instanceof LilyPadBlock) && VoxelShapes.func_197879_c(blockstate.func_196952_d(this.field_70170_p, blockpos$mutable).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.field_223238_i_)) { @@ -9,7 +9,7 @@ ++k1; } } -@@ -820,6 +820,16 @@ +@@ -817,6 +817,16 @@ return this.field_184469_aF == BoatEntity.Status.UNDER_WATER || this.field_184469_aF == BoatEntity.Status.UNDER_FLOWING_WATER; } diff --git a/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch index 37575400d..4bef57295 100644 --- a/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/HangingEntity.java +++ b/net/minecraft/entity/item/HangingEntity.java -@@ -119,6 +119,8 @@ +@@ -120,6 +120,8 @@ int j1 = (j - 1) / -2; blockpos$mutable.func_189533_g(blockpos).func_189534_c(direction, k + i1).func_189534_c(Direction.UP, l + j1); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos$mutable); diff --git a/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch index a80066fa5..ce4bd3638 100644 --- a/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch @@ -27,17 +27,7 @@ if (this.func_92059_d().func_190926_b()) { this.func_70106_y(); } else { -@@ -107,7 +113,8 @@ - this.func_213315_a(MoverType.SELF, this.func_213322_ci()); - float f = 0.98F; - if (this.field_70122_E) { -- f = this.field_70170_p.func_180495_p(new BlockPos(this.func_226277_ct_(), this.func_226278_cu_() - 1.0D, this.func_226281_cx_())).func_177230_c().func_208618_m() * 0.98F; -+ BlockPos pos = new BlockPos(this.func_226277_ct_(), this.func_226278_cu_() - 1.0D, this.func_226281_cx_()); -+ f = this.field_70170_p.func_180495_p(pos).getSlipperiness(this.field_70170_p, pos, this) * 0.98F; - } - - this.func_213317_d(this.func_213322_ci().func_216372_d((double)f, 0.98D, (double)f)); -@@ -140,7 +147,14 @@ +@@ -144,7 +150,14 @@ } } @@ -53,7 +43,7 @@ this.func_70106_y(); } -@@ -198,6 +212,8 @@ +@@ -202,6 +215,8 @@ return false; } else if (p_226532_1_.func_77942_o() ^ p_226532_0_.func_77942_o()) { return false; @@ -62,7 +52,7 @@ } else { return !p_226532_1_.func_77942_o() || p_226532_1_.func_77978_p().equals(p_226532_0_.func_77978_p()); } -@@ -231,6 +247,7 @@ +@@ -235,6 +250,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -70,7 +60,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (!this.func_92059_d().func_190926_b() && this.func_92059_d().func_77973_b() == Items.field_151156_bN && p_70097_1_.func_94541_c()) { -@@ -252,6 +269,7 @@ +@@ -256,6 +272,7 @@ p_213281_1_.func_74777_a("Health", (short)this.field_70291_e); p_213281_1_.func_74777_a("Age", (short)this.field_70292_b); p_213281_1_.func_74777_a("PickupDelay", (short)this.field_145804_b); @@ -78,7 +68,7 @@ if (this.func_200214_m() != null) { p_213281_1_.func_186854_a("Thrower", this.func_200214_m()); } -@@ -272,6 +290,7 @@ +@@ -276,6 +293,7 @@ if (p_70037_1_.func_74764_b("PickupDelay")) { this.field_145804_b = p_70037_1_.func_74765_d("PickupDelay"); } @@ -86,7 +76,7 @@ if (p_70037_1_.func_186855_b("Owner")) { this.field_145802_g = p_70037_1_.func_186857_a("Owner"); -@@ -291,10 +310,18 @@ +@@ -295,10 +313,18 @@ public void func_70100_b_(PlayerEntity p_70100_1_) { if (!this.field_70170_p.field_72995_K) { @@ -106,7 +96,7 @@ p_70100_1_.func_71001_a(this, i); if (itemstack.func_190926_b()) { this.func_70106_y(); -@@ -318,8 +345,8 @@ +@@ -322,8 +348,8 @@ } @Nullable @@ -117,7 +107,7 @@ if (!this.field_70170_p.field_72995_K && entity instanceof ItemEntity) { ((ItemEntity)entity).func_85054_d(); } -@@ -392,7 +419,7 @@ +@@ -396,7 +422,7 @@ public void func_174870_v() { this.func_174871_r(); diff --git a/patches/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch index 7e5b947a2..b2d3039a2 100644 --- a/patches/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/LeashKnotEntity.java +++ b/net/minecraft/entity/item/LeashKnotEntity.java -@@ -44,6 +44,7 @@ +@@ -45,6 +45,7 @@ protected void func_174856_o() { this.func_226288_n_((double)this.field_174861_a.func_177958_n() + 0.5D, (double)this.field_174861_a.func_177956_o() + 0.5D, (double)this.field_174861_a.func_177952_p() + 0.5D); diff --git a/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch index 6463747ab..4bd426e6f 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java +++ b/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java -@@ -47,7 +47,7 @@ +@@ -48,7 +48,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -9,7 +9,7 @@ private static final DataParameter field_184265_a = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187192_b); private static final DataParameter field_184266_b = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187192_b); private static final DataParameter field_184267_c = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187193_c); -@@ -88,6 +88,7 @@ +@@ -89,6 +89,7 @@ private double field_70507_ar; @OnlyIn(Dist.CLIENT) private double field_70506_as; @@ -17,12 +17,7 @@ protected AbstractMinecartEntity(EntityType p_i48538_1_, World p_i48538_2_) { super(p_i48538_1_, p_i48538_2_); -@@ -134,11 +135,12 @@ - - @Nullable - public AxisAlignedBB func_70114_g(Entity p_70114_1_) { -+ if (getCollisionHandler() != null) return getCollisionHandler().getCollisionBox(this, p_70114_1_); - return p_70114_1_.func_70104_M() ? p_70114_1_.func_174813_aQ() : null; +@@ -138,7 +139,7 @@ } public boolean func_70104_M() { @@ -30,8 +25,8 @@ + return canBePushed; } - public double func_70042_X() { -@@ -304,9 +306,9 @@ + protected Vector3d func_241839_a(Direction.Axis p_241839_1_, TeleportationRepositioner.Result p_241839_2_) { +@@ -307,9 +308,9 @@ BlockPos blockpos = new BlockPos(i, j, k); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -43,7 +38,7 @@ this.func_96095_a(i, j, k, blockstate.func_177229_b(PoweredRailBlock.field_176569_M)); } } else { -@@ -331,8 +333,11 @@ +@@ -334,8 +335,11 @@ } this.func_70101_b(this.field_70177_z, this.field_70125_A); @@ -57,7 +52,7 @@ if (!list.isEmpty()) { for(int l = 0; l < list.size(); ++l) { Entity entity1 = list.get(l); -@@ -344,7 +349,7 @@ +@@ -347,7 +351,7 @@ } } } else { @@ -66,15 +61,7 @@ if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof AbstractMinecartEntity) { entity.func_70108_f(this); } -@@ -352,6 +357,7 @@ - } - - this.func_233566_aG_(); -+ //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartUpdateEvent(this, this.getCurrentRailPosition())); - } - } - -@@ -363,16 +369,23 @@ +@@ -372,16 +376,23 @@ } protected void func_180459_n() { @@ -100,7 +87,7 @@ } } -@@ -387,29 +400,29 @@ +@@ -396,29 +407,29 @@ boolean flag = false; boolean flag1 = false; AbstractRailBlock abstractrailblock = (AbstractRailBlock)p_180460_2_.func_177230_c(); @@ -136,7 +123,7 @@ ++d1; } -@@ -440,7 +453,7 @@ +@@ -449,7 +460,7 @@ } } @@ -145,7 +132,7 @@ double d22 = Math.sqrt(func_213296_b(this.func_213322_ci())); if (d22 < 0.03D) { this.func_213317_d(Vector3d.field_186680_a); -@@ -469,10 +482,7 @@ +@@ -478,10 +489,7 @@ d0 = d23 + d4 * d14; d2 = d10 + d5 * d14; this.func_70107_b(d0, d1, d2); @@ -157,7 +144,7 @@ if (vector3i.func_177956_o() != 0 && MathHelper.func_76128_c(this.func_226277_ct_()) - p_180460_1_.func_177958_n() == vector3i.func_177958_n() && MathHelper.func_76128_c(this.func_226281_cx_()) - p_180460_1_.func_177952_p() == vector3i.func_177952_p()) { this.func_70107_b(this.func_226277_ct_(), this.func_226278_cu_() + (double)vector3i.func_177956_o(), this.func_226281_cx_()); } else if (vector3i1.func_177956_o() != 0 && MathHelper.func_76128_c(this.func_226277_ct_()) - p_180460_1_.func_177958_n() == vector3i1.func_177958_n() && MathHelper.func_76128_c(this.func_226281_cx_()) - p_180460_1_.func_177952_p() == vector3i1.func_177952_p()) { -@@ -500,7 +510,10 @@ +@@ -509,7 +517,10 @@ this.func_213293_j(d26 * (double)(j - p_180460_1_.func_177958_n()), vector3d5.field_72448_b, d26 * (double)(i - p_180460_1_.func_177952_p())); } @@ -169,7 +156,7 @@ Vector3d vector3d6 = this.func_213322_ci(); double d27 = Math.sqrt(func_213296_b(vector3d6)); if (d27 > 0.01D) { -@@ -555,7 +568,7 @@ +@@ -564,7 +575,7 @@ BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (AbstractRailBlock.func_208487_j(blockstate)) { @@ -178,7 +165,7 @@ p_70495_3_ = (double)j; if (railshape.func_208092_c()) { p_70495_3_ = (double)(j + 1); -@@ -594,7 +607,7 @@ +@@ -603,7 +614,7 @@ BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (AbstractRailBlock.func_208487_j(blockstate)) { @@ -187,7 +174,7 @@ Pair pair = func_226573_a_(railshape); Vector3i vector3i = pair.getFirst(); Vector3i vector3i1 = pair.getSecond(); -@@ -657,6 +670,11 @@ +@@ -666,6 +677,11 @@ } public void func_70108_f(Entity p_70108_1_) { @@ -199,7 +186,7 @@ if (!this.field_70170_p.field_72995_K) { if (!p_70108_1_.field_70145_X && !this.field_70145_X) { if (!this.func_184196_w(p_70108_1_)) { -@@ -692,11 +710,11 @@ +@@ -701,11 +717,11 @@ Vector3d vector3d2 = this.func_213322_ci(); Vector3d vector3d3 = p_70108_1_.func_213322_ci(); @@ -213,7 +200,7 @@ p_70108_1_.func_213317_d(vector3d3.func_216372_d(0.2D, 1.0D, 0.2D)); p_70108_1_.func_70024_g(vector3d2.field_72450_a + d0, 0.0D, vector3d2.field_72449_c + d1); this.func_213317_d(vector3d2.func_216372_d(0.95D, 1.0D, 0.95D)); -@@ -802,6 +820,40 @@ +@@ -811,6 +827,40 @@ return new SSpawnObjectPacket(this); } diff --git a/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch index 0e3115357..bf23568af 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java +++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java -@@ -111,17 +111,19 @@ +@@ -118,17 +118,19 @@ } @Nullable @@ -24,25 +24,25 @@ } protected void func_213281_b(CompoundNBT p_213281_1_) { -@@ -150,6 +152,8 @@ +@@ -157,6 +159,8 @@ } public ActionResultType func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { + ActionResultType ret = super.func_184230_a(p_184230_1_, p_184230_2_); + if (ret.func_226246_a_()) return ret; p_184230_1_.func_213829_a(this); - return ActionResultType.func_233537_a_(this.field_70170_p.field_72995_K); - } -@@ -173,6 +177,8 @@ + if (!p_184230_1_.field_70170_p.field_72995_K) { + PiglinTasks.func_234478_a_(p_184230_1_, true); +@@ -185,6 +189,8 @@ this.field_184290_c = null; - LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, this.func_233580_cy_()).func_216016_a(this.field_184291_d); + LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_237457_g_, this.func_213303_ch()).func_216016_a(this.field_184291_d); + // Forge: add this entity to loot context, however, currently Vanilla uses 'this' for the player creating the chests. So we take over 'killer_entity' for this. + lootcontext$builder.func_216015_a(LootParameters.field_216284_d, this); if (p_184288_1_ != null) { lootcontext$builder.func_186469_a(p_184288_1_.func_184817_da()).func_216015_a(LootParameters.field_216281_a, p_184288_1_); } -@@ -203,4 +209,17 @@ +@@ -215,4 +221,17 @@ } protected abstract Container func_213968_a(int p_213968_1_, PlayerInventory p_213968_2_); diff --git a/patches/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch b/patches/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch index 639af3f36..f6b6b3870 100644 --- a/patches/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java +++ b/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java -@@ -164,9 +164,9 @@ +@@ -165,9 +165,9 @@ } @Nullable diff --git a/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch b/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch index 6783c5024..e8f89fa4e 100644 --- a/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/merchant/villager/VillagerEntity.java +++ b/net/minecraft/entity/merchant/villager/VillagerEntity.java -@@ -240,7 +240,7 @@ +@@ -241,7 +241,7 @@ public ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_) { ItemStack itemstack = p_230254_1_.func_184586_b(p_230254_2_); @@ -9,7 +9,7 @@ if (this.func_70631_g_()) { this.func_213756_es(); return ActionResultType.func_233537_a_(this.field_70170_p.field_72995_K); -@@ -628,7 +628,8 @@ +@@ -634,7 +634,8 @@ } protected ITextComponent func_225513_by_() { diff --git a/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch index a6c85aab2..ecb37f9ee 100644 --- a/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/CreeperEntity.java +++ b/net/minecraft/entity/monster/CreeperEntity.java -@@ -215,7 +215,7 @@ +@@ -216,7 +216,7 @@ private void func_146077_cc() { if (!this.field_70170_p.field_72995_K) { diff --git a/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch index aa47f3240..8d4c119e8 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/EndermanEntity.java +++ b/net/minecraft/entity/monster/EndermanEntity.java -@@ -100,7 +100,6 @@ +@@ -98,7 +98,6 @@ } public void func_70624_b(@Nullable LivingEntity p_70624_1_) { @@ -8,7 +8,7 @@ ModifiableAttributeInstance modifiableattributeinstance = this.func_110148_a(Attributes.field_233821_d_); if (p_70624_1_ == null) { this.field_184721_by = 0; -@@ -115,6 +114,7 @@ +@@ -113,6 +112,7 @@ } } @@ -16,7 +16,7 @@ } protected void func_70088_a() { -@@ -188,7 +188,7 @@ +@@ -186,7 +186,7 @@ private boolean func_70821_d(PlayerEntity p_70821_1_) { ItemStack itemstack = p_70821_1_.field_71071_by.field_70460_b.get(3); @@ -25,7 +25,7 @@ return false; } else { Vector3d vector3d = p_70821_1_.func_70676_i(1.0F).func_72432_b(); -@@ -267,7 +267,9 @@ +@@ -265,7 +265,9 @@ boolean flag = blockstate.func_185904_a().func_76230_c(); boolean flag1 = blockstate.func_204520_s().func_206884_a(FluidTags.field_206959_a); if (flag && !flag1) { @@ -36,7 +36,7 @@ if (flag2 && !this.func_174814_R()) { this.field_70170_p.func_184148_a((PlayerEntity)null, this.field_70169_q, this.field_70167_r, this.field_70166_s, SoundEvents.field_187534_aX, this.func_184176_by(), 1.0F, 1.0F); this.func_184185_a(SoundEvents.field_187534_aX, 1.0F, 1.0F); -@@ -431,7 +433,7 @@ +@@ -429,7 +431,7 @@ public boolean func_75250_a() { if (this.field_179475_a.func_195405_dq() == null) { return false; @@ -46,24 +46,24 @@ } else { return this.field_179475_a.func_70681_au().nextInt(2000) == 0; @@ -449,7 +451,7 @@ - BlockPos blockpos1 = blockpos.func_177977_b(); - BlockState blockstate1 = iworld.func_180495_p(blockpos1); BlockState blockstate2 = this.field_179475_a.func_195405_dq(); -- if (blockstate2 != null && this.func_220836_a(iworld, blockpos, blockstate2, blockstate, blockstate1, blockpos1)) { -+ if (blockstate2 != null && this.func_220836_a(iworld, blockpos, blockstate2, blockstate, blockstate1, blockpos1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(field_179475_a, net.minecraftforge.common.util.BlockSnapshot.create(iworld, blockpos1), net.minecraft.util.Direction.UP)) { - iworld.func_180501_a(blockpos, blockstate2, 3); - this.field_179475_a.func_195406_b((BlockState)null); - } -@@ -457,7 +459,7 @@ + if (blockstate2 != null) { + blockstate2 = Block.func_199770_b(blockstate2, this.field_179475_a.field_70170_p, blockpos); +- if (this.func_220836_a(world, blockpos, blockstate2, blockstate, blockstate1, blockpos1)) { ++ if (this.func_220836_a(world, blockpos, blockstate2, blockstate, blockstate1, blockpos1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(field_179475_a, net.minecraftforge.common.util.BlockSnapshot.create(world.func_234923_W_(), world, blockpos1), net.minecraft.util.Direction.UP)) { + world.func_180501_a(blockpos, blockstate2, 3); + this.field_179475_a.func_195406_b((BlockState)null); + } +@@ -458,7 +460,7 @@ } - private boolean func_220836_a(IWorldReader p_220836_1_, BlockPos p_220836_2_, BlockState p_220836_3_, BlockState p_220836_4_, BlockState p_220836_5_, BlockPos p_220836_6_) { -- return p_220836_4_.func_196958_f() && !p_220836_5_.func_196958_f() && p_220836_5_.func_235785_r_(p_220836_1_, p_220836_6_) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_); -+ return p_220836_4_.isAir(p_220836_1_, p_220836_2_) && !p_220836_5_.isAir(p_220836_1_, p_220836_6_) && p_220836_5_.func_235785_r_(p_220836_1_, p_220836_6_) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_); + private boolean func_220836_a(World p_220836_1_, BlockPos p_220836_2_, BlockState p_220836_3_, BlockState p_220836_4_, BlockState p_220836_5_, BlockPos p_220836_6_) { +- return p_220836_4_.func_196958_f() && !p_220836_5_.func_196958_f() && !p_220836_5_.func_203425_a(Blocks.field_150357_h) && p_220836_5_.func_235785_r_(p_220836_1_, p_220836_6_) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_) && p_220836_1_.func_72839_b(this.field_179475_a, AxisAlignedBB.func_241549_a_(Vector3d.func_237491_b_(p_220836_2_))).isEmpty(); ++ return p_220836_4_.isAir(p_220836_1_, p_220836_2_) && !p_220836_5_.isAir(p_220836_1_, p_220836_6_) && !p_220836_5_.func_203425_a(Blocks.field_150357_h) && p_220836_5_.func_235785_r_(p_220836_1_, p_220836_6_) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_) && p_220836_1_.func_72839_b(this.field_179475_a, AxisAlignedBB.func_241549_a_(Vector3d.func_237491_b_(p_220836_2_))).isEmpty(); } } -@@ -499,7 +501,7 @@ +@@ -500,7 +502,7 @@ public boolean func_75250_a() { if (this.field_179473_a.func_195405_dq() != null) { return false; diff --git a/patches/minecraft/net/minecraft/entity/monster/HoglinEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/HoglinEntity.java.patch index cabe8c071..2a9a9c975 100644 --- a/patches/minecraft/net/minecraft/entity/monster/HoglinEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/HoglinEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/HoglinEntity.java +++ b/net/minecraft/entity/monster/HoglinEntity.java -@@ -275,8 +275,8 @@ +@@ -279,8 +279,8 @@ return hoglinentity; } diff --git a/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch index 49e74a0af..b82ba6221 100644 --- a/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/SlimeEntity.java +++ b/net/minecraft/entity/monster/SlimeEntity.java -@@ -125,6 +125,7 @@ +@@ -127,6 +127,7 @@ if (this.field_70122_E && !this.field_175452_bi) { int i = this.func_70809_q(); @@ -8,7 +8,7 @@ for(int j = 0; j < i * 8; ++j) { float f = this.field_70146_Z.nextFloat() * ((float)Math.PI * 2F); float f1 = this.field_70146_Z.nextFloat() * 0.5F + 0.5F; -@@ -176,9 +177,10 @@ +@@ -178,9 +179,10 @@ return (EntityType)super.func_200600_R(); } @@ -21,7 +21,7 @@ ITextComponent itextcomponent = this.func_200201_e(); boolean flag = this.func_175446_cd(); float f = (float)i / 4.0F; -@@ -202,7 +204,7 @@ +@@ -204,7 +206,7 @@ } } @@ -30,7 +30,7 @@ } public void func_70108_f(Entity p_70108_1_) { -@@ -323,6 +325,12 @@ +@@ -324,6 +326,12 @@ return super.func_213305_a(p_213305_1_).func_220313_a(0.255F * (float)this.func_70809_q()); } diff --git a/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch index 864a3187e..9b4b29a3b 100644 --- a/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/ZombieEntity.java +++ b/net/minecraft/entity/monster/ZombieEntity.java -@@ -260,12 +260,16 @@ +@@ -268,12 +268,16 @@ livingentity = (LivingEntity)p_70097_1_.func_76346_g(); } @@ -19,15 +19,15 @@ for(int l = 0; l < 50; ++l) { int i1 = i + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1); int j1 = j + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1); -@@ -277,6 +281,7 @@ +@@ -284,6 +288,7 @@ + if (WorldEntitySpawner.func_209382_a(entityspawnplacementregistry$placementtype, this.field_70170_p, blockpos, entitytype) && EntitySpawnPlacementRegistry.func_223515_a(entitytype, serverworld, SpawnReason.REINFORCEMENT, blockpos, this.field_70170_p.field_73012_v)) { zombieentity.func_70107_b((double)i1, (double)j1, (double)k1); if (!this.field_70170_p.func_217358_a((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_226668_i_(zombieentity) && this.field_70170_p.func_226669_j_(zombieentity) && !this.field_70170_p.func_72953_d(zombieentity.func_174813_aQ())) { - this.field_70170_p.func_217376_c(zombieentity); + if (livingentity != null) zombieentity.func_70624_b(livingentity); - zombieentity.func_213386_a(this.field_70170_p, this.field_70170_p.func_175649_E(zombieentity.func_233580_cy_()), SpawnReason.REINFORCEMENT, (ILivingEntityData)null, (CompoundNBT)null); - this.func_110148_a(Attributes.field_233829_l_).func_233769_c_(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, AttributeModifier.Operation.ADDITION)); -@@ -463,7 +468,7 @@ + zombieentity.func_213386_a(serverworld, this.field_70170_p.func_175649_E(zombieentity.func_233580_cy_()), SpawnReason.REINFORCEMENT, (ILivingEntityData)null, (CompoundNBT)null); + serverworld.func_242417_l(zombieentity); +@@ -448,7 +453,7 @@ } public static boolean func_241399_a_(Random p_241399_0_) { @@ -36,7 +36,7 @@ } protected void func_207304_a(float p_207304_1_) { -@@ -483,7 +488,7 @@ +@@ -468,7 +473,7 @@ } protected void func_230291_eT_() { diff --git a/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinEntity.java.patch index 8ff7eb7d0..bec12b47e 100644 --- a/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/piglin/PiglinEntity.java +++ b/net/minecraft/entity/monster/piglin/PiglinEntity.java -@@ -367,7 +367,7 @@ +@@ -307,7 +307,7 @@ } protected void func_234439_n_(ItemStack p_234439_1_) { diff --git a/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinTasks.java.patch b/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinTasks.java.patch index beadfd89d..34730ddaa 100644 --- a/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinTasks.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/piglin/PiglinTasks.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/entity/monster/piglin/PiglinTasks.java +++ b/net/minecraft/entity/monster/piglin/PiglinTasks.java -@@ -231,7 +231,7 @@ +@@ -232,7 +232,7 @@ ItemStack itemstack = p_234477_0_.func_184586_b(Hand.OFF_HAND); p_234477_0_.func_184611_a(Hand.OFF_HAND, ItemStack.field_190927_a); - if (p_234477_0_.func_234421_eJ_()) { + if (p_234477_0_.func_242337_eM()) { - boolean flag = func_234492_b_(itemstack.func_77973_b()); + boolean flag = itemstack.isPiglinCurrency(); if (p_234477_1_ && flag) { func_234475_a_(p_234477_0_, func_234524_k_(p_234477_0_)); } else if (!flag) { -@@ -317,7 +317,7 @@ +@@ -318,7 +318,7 @@ return false; } else if (func_234453_C_(p_234474_0_) && p_234474_0_.func_213375_cj().func_218191_a(MemoryModuleType.field_234103_o_)) { return false; @@ -18,16 +18,16 @@ return func_234455_E_(p_234474_0_); } else { boolean flag = p_234474_0_.func_234437_l_(p_234474_1_); -@@ -417,7 +417,7 @@ +@@ -418,7 +418,7 @@ } protected static boolean func_234489_b_(PiglinEntity p_234489_0_, ItemStack p_234489_1_) { -- return !func_234453_C_(p_234489_0_) && !func_234451_A_(p_234489_0_) && p_234489_0_.func_234421_eJ_() && func_234492_b_(p_234489_1_.func_77973_b()); -+ return !func_234453_C_(p_234489_0_) && !func_234451_A_(p_234489_0_) && p_234489_0_.func_234421_eJ_() && p_234489_1_.isPiglinCurrency(); +- return !func_234453_C_(p_234489_0_) && !func_234451_A_(p_234489_0_) && p_234489_0_.func_242337_eM() && func_234492_b_(p_234489_1_.func_77973_b()); ++ return !func_234453_C_(p_234489_0_) && !func_234451_A_(p_234489_0_) && p_234489_0_.func_242337_eM() && p_234489_1_.isPiglinCurrency(); } protected static void func_234468_a_(PiglinEntity p_234468_0_, LivingEntity p_234468_1_) { -@@ -518,7 +518,7 @@ +@@ -519,7 +519,7 @@ public static boolean func_234460_a_(LivingEntity p_234460_0_) { for(ItemStack itemstack : p_234460_0_.func_184193_aE()) { Item item = itemstack.func_77973_b(); diff --git a/patches/minecraft/net/minecraft/entity/passive/AnimalEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/AnimalEntity.java.patch index 2341fd81f..151adbb93 100644 --- a/patches/minecraft/net/minecraft/entity/passive/AnimalEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/AnimalEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/AnimalEntity.java +++ b/net/minecraft/entity/passive/AnimalEntity.java -@@ -120,7 +120,7 @@ +@@ -121,7 +121,7 @@ ItemStack itemstack = p_230254_1_.func_184586_b(p_230254_2_); if (this.func_70877_b(itemstack)) { int i = this.func_70874_b(); @@ -9,7 +9,7 @@ this.func_175505_a(p_230254_1_, itemstack); this.func_146082_f(p_230254_1_); return ActionResultType.SUCCESS; -@@ -147,7 +147,7 @@ +@@ -148,7 +148,7 @@ } @@ -18,21 +18,21 @@ return this.field_70881_d <= 0; } -@@ -198,6 +198,17 @@ +@@ -199,6 +199,17 @@ - public void func_234177_a_(World p_234177_1_, AnimalEntity p_234177_2_) { - AgeableEntity ageableentity = this.func_90011_a(p_234177_2_); -+ final net.minecraftforge.event.entity.living.BabyEntitySpawnEvent event = new net.minecraftforge.event.entity.living.BabyEntitySpawnEvent(this, p_234177_2_, ageableentity); -+ final boolean cancelled = net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ ageableentity = event.getChild(); -+ if (cancelled) { -+ //Reset the "inLove" state for the animals -+ this.func_70873_a(6000); -+ p_234177_2_.func_70873_a(6000); -+ this.func_70875_t(); -+ p_234177_2_.func_70875_t(); -+ return; -+ } + public void func_234177_a_(ServerWorld p_234177_1_, AnimalEntity p_234177_2_) { + AgeableEntity ageableentity = this.func_241840_a(p_234177_1_, p_234177_2_); ++ final net.minecraftforge.event.entity.living.BabyEntitySpawnEvent event = new net.minecraftforge.event.entity.living.BabyEntitySpawnEvent(this, p_234177_2_, ageableentity); ++ final boolean cancelled = net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ ageableentity = event.getChild(); ++ if (cancelled) { ++ //Reset the "inLove" state for the animals ++ this.func_70873_a(6000); ++ p_234177_2_.func_70873_a(6000); ++ this.func_70875_t(); ++ p_234177_2_.func_70875_t(); ++ return; ++ } if (ageableentity != null) { ServerPlayerEntity serverplayerentity = this.func_191993_do(); if (serverplayerentity == null && p_234177_2_.func_191993_do() != null) { diff --git a/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch index 824f1e5bb..47e91c7df 100644 --- a/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/FoxEntity.java +++ b/net/minecraft/entity/passive/FoxEntity.java -@@ -760,7 +760,7 @@ +@@ -761,7 +761,7 @@ } protected void func_220730_m() { @@ -9,21 +9,21 @@ BlockState blockstate = FoxEntity.this.field_70170_p.func_180495_p(this.field_179494_b); if (blockstate.func_203425_a(Blocks.field_222434_lW)) { int i = blockstate.func_177229_b(SweetBerryBushBlock.field_220125_a); -@@ -999,6 +999,17 @@ - +@@ -1001,6 +1001,17 @@ protected void func_75388_i() { - FoxEntity foxentity = (FoxEntity)this.field_75390_d.func_90011_a(this.field_75391_e); -+ final net.minecraftforge.event.entity.living.BabyEntitySpawnEvent event = new net.minecraftforge.event.entity.living.BabyEntitySpawnEvent(field_75390_d, field_75391_e, foxentity); -+ final boolean cancelled = net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ foxentity = (FoxEntity) event.getChild(); -+ if (cancelled) { -+ //Reset the "inLove" state for the animals -+ this.field_75390_d.func_70873_a(6000); -+ this.field_75391_e.func_70873_a(6000); -+ this.field_75390_d.func_70875_t(); -+ this.field_75391_e.func_70875_t(); -+ return; -+ } + ServerWorld serverworld = (ServerWorld)this.field_75394_a; + FoxEntity foxentity = (FoxEntity)this.field_75390_d.func_241840_a(serverworld, this.field_75391_e); ++ final net.minecraftforge.event.entity.living.BabyEntitySpawnEvent event = new net.minecraftforge.event.entity.living.BabyEntitySpawnEvent(field_75390_d, field_75391_e, foxentity); ++ final boolean cancelled = net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ foxentity = (FoxEntity) event.getChild(); ++ if (cancelled) { ++ //Reset the "inLove" state for the animals ++ this.field_75390_d.func_70873_a(6000); ++ this.field_75391_e.func_70873_a(6000); ++ this.field_75390_d.func_70875_t(); ++ this.field_75391_e.func_70875_t(); ++ return; ++ } if (foxentity != null) { ServerPlayerEntity serverplayerentity = this.field_75390_d.func_191993_do(); ServerPlayerEntity serverplayerentity1 = this.field_75391_e.func_191993_do(); diff --git a/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch index c7f3cd7d6..9aaa70400 100644 --- a/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/OcelotEntity.java +++ b/net/minecraft/entity/passive/OcelotEntity.java -@@ -161,7 +161,7 @@ +@@ -163,7 +163,7 @@ if ((this.field_70914_e == null || this.field_70914_e.func_75277_f()) && !this.func_213530_dX() && this.func_70877_b(itemstack) && p_230254_1_.func_70068_e(this) < 9.0D) { this.func_175505_a(p_230254_1_, itemstack); if (!this.field_70170_p.field_72995_K) { diff --git a/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch index fa4ba82a0..720f26f9f 100644 --- a/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/ParrotEntity.java +++ b/net/minecraft/entity/passive/ParrotEntity.java -@@ -235,7 +235,7 @@ +@@ -237,7 +237,7 @@ } if (!this.field_70170_p.field_72995_K) { diff --git a/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch index e61e964c5..a9da8afea 100644 --- a/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/RabbitEntity.java +++ b/net/minecraft/entity/passive/RabbitEntity.java -@@ -498,7 +498,7 @@ +@@ -500,7 +500,7 @@ public boolean func_75250_a() { if (this.field_179496_a <= 0) { diff --git a/patches/minecraft/net/minecraft/entity/passive/SheepEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/SheepEntity.java.patch index cb0fd41b3..e1f8e7666 100644 --- a/patches/minecraft/net/minecraft/entity/passive/SheepEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/SheepEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/SheepEntity.java +++ b/net/minecraft/entity/passive/SheepEntity.java -@@ -60,7 +60,7 @@ +@@ -61,7 +61,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -9,7 +9,7 @@ private static final DataParameter field_184774_bv = EntityDataManager.func_187226_a(SheepEntity.class, DataSerializers.field_187191_a); private static final Map field_200206_bz = Util.func_200696_a(Maps.newEnumMap(DyeColor.class), (p_203402_0_) -> { p_203402_0_.put(DyeColor.WHITE, Blocks.field_196556_aL); -@@ -215,7 +215,7 @@ +@@ -216,7 +216,7 @@ public ActionResultType func_230254_b_(PlayerEntity p_230254_1_, Hand p_230254_2_) { ItemStack itemstack = p_230254_1_.func_184586_b(p_230254_2_); @@ -18,7 +18,7 @@ if (!this.field_70170_p.field_72995_K && this.func_230262_K__()) { this.func_230263_a_(SoundCategory.PLAYERS); itemstack.func_222118_a(1, p_230254_1_, (p_213613_1_) -> { -@@ -360,4 +360,26 @@ +@@ -361,4 +361,26 @@ protected float func_213348_b(Pose p_213348_1_, EntitySize p_213348_2_) { return 0.95F * p_213348_2_.field_220316_b; } diff --git a/patches/minecraft/net/minecraft/entity/passive/TurtleEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/TurtleEntity.java.patch index b601db5e2..697a7a64c 100644 --- a/patches/minecraft/net/minecraft/entity/passive/TurtleEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/TurtleEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/TurtleEntity.java +++ b/net/minecraft/entity/passive/TurtleEntity.java -@@ -233,8 +233,8 @@ +@@ -235,8 +235,8 @@ this.func_184185_a(soundevent, 0.15F, 1.0F); } diff --git a/patches/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch index d649dce16..17b59c682 100644 --- a/patches/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/WolfEntity.java +++ b/net/minecraft/entity/passive/WolfEntity.java -@@ -340,7 +340,7 @@ +@@ -347,7 +347,7 @@ itemstack.func_190918_g(1); } diff --git a/patches/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch index 18340129b..cbb7e677f 100644 --- a/patches/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/horse/AbstractHorseEntity.java +++ b/net/minecraft/entity/passive/horse/AbstractHorseEntity.java -@@ -275,6 +275,7 @@ +@@ -276,6 +276,7 @@ this.field_110296_bG.func_110134_a(this); this.func_230275_fc_(); @@ -8,7 +8,7 @@ } protected void func_230275_fc_() { -@@ -333,9 +334,9 @@ +@@ -334,9 +335,9 @@ protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) { if (!p_180429_2_.func_185904_a().func_76224_d()) { BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()); @@ -20,7 +20,7 @@ } if (this.func_184207_aI() && this.field_190688_bE) { -@@ -693,6 +694,7 @@ +@@ -694,6 +695,7 @@ this.func_213293_j(vector3d.field_72450_a, d1, vector3d.field_72449_c); this.func_110255_k(true); this.field_70160_al = true; diff --git a/patches/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch index 23dc0b28d..c2b33ef33 100644 --- a/patches/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/horse/HorseEntity.java +++ b/net/minecraft/entity/passive/horse/HorseEntity.java -@@ -138,6 +138,8 @@ +@@ -139,6 +139,8 @@ this.func_184185_a(SoundEvents.field_187705_cn, p_190680_1_.func_185843_a() * 0.6F, p_190680_1_.func_185847_b()); } diff --git a/patches/minecraft/net/minecraft/entity/passive/horse/LlamaEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/horse/LlamaEntity.java.patch index b3ba062d5..bbd88ed1c 100644 --- a/patches/minecraft/net/minecraft/entity/passive/horse/LlamaEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/horse/LlamaEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/horse/LlamaEntity.java +++ b/net/minecraft/entity/passive/horse/LlamaEntity.java -@@ -179,7 +179,7 @@ +@@ -181,7 +181,7 @@ i = 90; j = 6; f = 10.0F; diff --git a/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch index 4188b3939..656f0bba0 100644 --- a/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch @@ -15,8 +15,8 @@ + private final java.util.Collection prefixes = new java.util.LinkedList<>(); + private final java.util.Collection suffixes = new java.util.LinkedList<>(); - public PlayerEntity(World p_i231577_1_, BlockPos p_i231577_2_, GameProfile p_i231577_3_) { - super(EntityType.field_200729_aH, p_i231577_1_); + public PlayerEntity(World p_i241920_1_, BlockPos p_i241920_2_, float p_i241920_3_, GameProfile p_i241920_4_) { + super(EntityType.field_200729_aH, p_i241920_1_); @@ -175,7 +178,7 @@ } @@ -178,7 +178,7 @@ this.func_184611_a(p_190775_2_, ItemStack.field_190927_a); } -@@ -1007,6 +1032,7 @@ +@@ -1011,6 +1036,7 @@ } public void func_71059_n(Entity p_71059_1_) { @@ -186,7 +186,7 @@ if (p_71059_1_.func_70075_an()) { if (!p_71059_1_.func_85031_j(this)) { float f = (float)this.func_233637_b_(Attributes.field_233823_f_); -@@ -1034,8 +1060,10 @@ +@@ -1038,8 +1064,10 @@ boolean flag2 = flag && this.field_70143_R > 0.0F && !this.field_70122_E && !this.func_70617_f_() && !this.func_70090_H() && !this.func_70644_a(Effects.field_76440_q) && !this.func_184218_aH() && p_71059_1_ instanceof LivingEntity; flag2 = flag2 && !this.func_70051_ag(); @@ -198,7 +198,7 @@ } f = f + f1; -@@ -1123,8 +1151,10 @@ +@@ -1127,8 +1155,10 @@ } if (!this.field_70170_p.field_72995_K && !itemstack1.func_190926_b() && entity instanceof LivingEntity) { @@ -209,7 +209,7 @@ this.func_184611_a(Hand.MAIN_HAND, ItemStack.field_190927_a); } } -@@ -1166,7 +1196,7 @@ +@@ -1170,7 +1200,7 @@ } if (this.field_70146_Z.nextFloat() < f) { @@ -218,7 +218,7 @@ this.func_184602_cy(); this.field_70170_p.func_72960_a(this, (byte)30); } -@@ -1192,8 +1222,9 @@ +@@ -1196,8 +1226,9 @@ public void func_71004_bE() { } @@ -230,7 +230,7 @@ this.field_71069_bz.func_75134_a(this); if (this.field_71070_bA != null) { this.field_71070_bA.func_75134_a(this); -@@ -1216,6 +1247,7 @@ +@@ -1220,6 +1251,7 @@ } public void func_225652_a_(boolean p_225652_1_, boolean p_225652_2_) { @@ -238,18 +238,18 @@ super.func_213366_dy(); if (this.field_70170_p instanceof ServerWorld && p_225652_2_) { ((ServerWorld)this.field_70170_p).func_72854_c(); -@@ -1238,8 +1270,8 @@ +@@ -1242,8 +1274,8 @@ } return optional; -- } else if (block instanceof BedBlock && BedBlock.func_235330_a_(p_234567_0_)) { -- return BedBlock.func_220172_a(EntityType.field_200729_aH, p_234567_0_, p_234567_1_, 0); -+ } else if (blockstate.isBed(p_234567_0_, p_234567_1_, null) && BedBlock.func_235330_a_(p_234567_0_)) { -+ return blockstate.getBedSpawnPosition(EntityType.field_200729_aH, p_234567_0_, p_234567_1_, null); - } else if (!p_234567_2_) { +- } else if (block instanceof BedBlock && BedBlock.func_235330_a_(p_242374_0_)) { +- return BedBlock.func_242652_a(EntityType.field_200729_aH, p_242374_0_, p_242374_1_, p_242374_2_); ++ } else if (blockstate.isBed(p_242374_0_, p_242374_1_, null) && BedBlock.func_235330_a_(p_242374_0_)) { ++ return blockstate.getBedSpawnPosition(EntityType.field_200729_aH, p_242374_0_, p_242374_1_, p_242374_2_, null); + } else if (!p_242374_3_) { return Optional.empty(); } else { -@@ -1421,6 +1453,7 @@ +@@ -1425,6 +1457,7 @@ public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) { if (this.field_71075_bZ.field_75101_c) { @@ -257,7 +257,7 @@ return false; } else { if (p_225503_1_ >= 2.0F) { -@@ -1434,7 +1467,7 @@ +@@ -1438,7 +1471,7 @@ public boolean func_226566_ei_() { if (!this.field_70122_E && !this.func_184613_cA() && !this.func_70090_H() && !this.func_70644_a(Effects.field_188424_y)) { ItemStack itemstack = this.func_184582_a(EquipmentSlotType.CHEST); @@ -266,7 +266,7 @@ this.func_226567_ej_(); return true; } -@@ -1475,6 +1508,10 @@ +@@ -1479,6 +1512,10 @@ } public void func_195068_e(int p_195068_1_) { @@ -277,7 +277,7 @@ this.func_85039_t(p_195068_1_); this.field_71106_cc += (float)p_195068_1_ / (float)this.func_71050_bK(); this.field_71067_cb = MathHelper.func_76125_a(this.field_71067_cb + p_195068_1_, 0, Integer.MAX_VALUE); -@@ -1503,7 +1540,7 @@ +@@ -1507,7 +1544,7 @@ } public void func_192024_a(ItemStack p_192024_1_, int p_192024_2_) { @@ -286,7 +286,7 @@ if (this.field_71068_ca < 0) { this.field_71068_ca = 0; this.field_71106_cc = 0.0F; -@@ -1514,6 +1551,10 @@ +@@ -1518,6 +1555,10 @@ } public void func_82242_a(int p_82242_1_) { @@ -297,7 +297,7 @@ this.field_71068_ca += p_82242_1_; if (this.field_71068_ca < 0) { this.field_71068_ca = 0; -@@ -1704,7 +1745,11 @@ +@@ -1708,7 +1749,11 @@ } public ITextComponent func_145748_c_() { @@ -310,7 +310,7 @@ return this.func_208016_c(iformattabletextcomponent); } -@@ -1956,4 +2001,45 @@ +@@ -1987,4 +2032,45 @@ return this.field_221260_g; } } @@ -323,7 +323,7 @@ + public Collection getSuffixes() { + return this.suffixes; + } -+ ++ + private ITextComponent displayname = null; + /** + * Force the displayed name to refresh, by firing {@link net.minecraftforge.event.entity.player.PlayerEvent.NameFormat}, using the real player name as event parameter. diff --git a/patches/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch b/patches/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch index 91625cb4f..35699da3f 100644 --- a/patches/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/player/PlayerInventory.java +++ b/net/minecraft/entity/player/PlayerInventory.java -@@ -188,7 +188,8 @@ +@@ -187,7 +187,8 @@ int i = p_191973_2_.func_190916_E(); ItemStack itemstack = this.func_70301_a(p_191973_1_); if (itemstack.func_190926_b()) { @@ -10,7 +10,7 @@ if (p_191973_2_.func_77942_o()) { itemstack.func_77982_d(p_191973_2_.func_77978_p().func_74737_b()); } -@@ -239,7 +240,7 @@ +@@ -238,7 +239,7 @@ } } } @@ -19,7 +19,7 @@ } public boolean func_70441_a(ItemStack p_70441_1_) { -@@ -292,6 +293,8 @@ +@@ -287,6 +288,8 @@ } catch (Throwable throwable) { CrashReport crashreport = CrashReport.func_85055_a(throwable, "Adding item to inventory"); CrashReportCategory crashreportcategory = crashreport.func_85058_a("Item being added"); diff --git a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch index 9d92794f2..fd9b254cf 100644 --- a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/player/ServerPlayerEntity.java +++ b/net/minecraft/entity/player/ServerPlayerEntity.java -@@ -464,6 +464,7 @@ +@@ -471,6 +471,7 @@ } public void func_70645_a(DamageSource p_70645_1_) { @@ -8,7 +8,7 @@ boolean flag = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223609_l); if (flag) { ITextComponent itextcomponent = this.func_110142_aN().func_151521_b(); -@@ -596,13 +597,14 @@ +@@ -614,13 +615,14 @@ } @Nullable @@ -26,7 +26,7 @@ if (!this.field_71136_j) { this.field_71136_j = true; this.field_71135_a.func_147359_a(new SChangeGameStatePacket(SChangeGameStatePacket.field_241768_e_, this.field_192040_cp ? 0.0F : 1.0F)); -@@ -616,8 +618,9 @@ +@@ -634,14 +636,15 @@ this.field_71135_a.func_147359_a(new SServerDifficultyPacket(iworldinfo.func_176130_y(), iworldinfo.func_176123_z())); PlayerList playerlist = this.field_71133_b.func_184103_al(); playerlist.func_187243_f(this); @@ -34,38 +34,36 @@ - this.field_70128_L = false; + serverworld.removeEntity(this, true); //Forge: the player entity is moved to the new world, NOT cloned. So keep the data alive with no matching invalidate call. + this.revive(); -+ Entity e = teleporter.placeEntity(this, serverworld, p_241206_1_, this.field_70177_z, spawnPortal -> {//Forge: Start vanilla logic - double d0 = this.func_226277_ct_(); - double d1 = this.func_226278_cu_(); - double d2 = this.func_226281_cx_(); -@@ -666,7 +669,7 @@ - ServerWorld.func_241121_a_(p_241206_1_); - this.func_70012_b((double)i, (double)j, (double)k, f1, 0.0F); - this.func_213317_d(Vector3d.field_186680_a); -- } else if (!p_241206_1_.func_85176_s().func_222268_a(this, f2)) { -+ } else if (spawnPortal && !p_241206_1_.func_85176_s().func_222268_a(this, f2)) { - p_241206_1_.func_85176_s().func_85188_a(this); - p_241206_1_.func_85176_s().func_222268_a(this, f2); + PortalInfo portalinfo = this.func_241829_a(p_241206_1_); + if (portalinfo != null) { ++ Entity e = teleporter.placeEntity(this, serverworld, p_241206_1_, this.field_70177_z, spawnPortal -> {//Forge: Start vanilla logic + serverworld.func_217381_Z().func_76320_a("moving"); + if (registrykey == World.field_234918_g_ && p_241206_1_.func_234923_W_() == World.field_234919_h_) { + this.field_193110_cw = this.func_213303_ch(); +- } else if (p_241206_1_.func_234923_W_() == World.field_234920_i_) { ++ } else if (spawnPortal && p_241206_1_.func_234923_W_() == World.field_234920_i_) { + this.func_242110_a(p_241206_1_, new BlockPos(portalinfo.field_222505_a)); + } + +@@ -653,6 +656,9 @@ + this.func_225653_b_(portalinfo.field_222505_a.field_72450_a, portalinfo.field_222505_a.field_72448_b, portalinfo.field_222505_a.field_72449_c); + serverworld.func_217381_Z().func_76319_b(); + this.func_213846_b(serverworld); ++ return this;//forge: this is part of the ITeleporter patch ++ });//Forge: End vanilla logic ++ if (e != this) throw new java.lang.IllegalArgumentException(String.format("Teleporter %s returned not the player entity but instead %s, expected PlayerEntity %s", teleporter, e, this)); + this.field_71134_c.func_73080_a(p_241206_1_); + this.field_71135_a.func_147359_a(new SPlayerAbilitiesPacket(this.field_71075_bZ)); + playerlist.func_72354_b(this, p_241206_1_); +@@ -666,6 +672,7 @@ + this.field_71144_ck = -1; + this.field_71149_ch = -1.0F; + this.field_71146_ci = -1; ++ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, registrykey, p_241206_1_.func_234923_W_()); } -@@ -676,6 +679,9 @@ - p_241206_1_.func_217447_b(this); - this.func_213846_b(serverworld); - this.field_71135_a.func_147364_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), f1, f); -+ return this;//forge: this is part of the ITeleporter patch -+ });//Forge: End vanilla logic -+ if (e != this) throw new java.lang.IllegalArgumentException(String.format("Teleporter %s returned not the player entity but instead %s, expected PlayerEntity %s", teleporter, e, this)); - this.field_71134_c.func_73080_a(p_241206_1_); - this.field_71135_a.func_147359_a(new SPlayerAbilitiesPacket(this.field_71075_bZ)); - playerlist.func_72354_b(this, p_241206_1_); -@@ -689,6 +695,7 @@ - this.field_71144_ck = -1; - this.field_71149_ch = -1.0F; - this.field_71146_ci = -1; -+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, registrykey, p_241206_1_.func_234923_W_()); + return this; - } - } -@@ -731,6 +738,9 @@ +@@ -739,6 +746,9 @@ } public Either func_213819_a(BlockPos p_213819_1_) { @@ -75,16 +73,16 @@ Direction direction = this.field_70170_p.func_180495_p(p_213819_1_).func_177229_b(HorizontalBlock.field_185512_D); if (!this.func_70608_bn() && this.func_70089_S()) { if (!this.field_70170_p.func_230315_m_().func_236043_f_()) { -@@ -741,7 +751,7 @@ +@@ -749,7 +759,7 @@ return Either.left(PlayerEntity.SleepResult.OBSTRUCTED); } else { - this.func_241153_a_(this.field_70170_p.func_234923_W_(), p_213819_1_, false, true); + this.func_242111_a(this.field_70170_p.func_234923_W_(), p_213819_1_, this.field_70177_z, false, true); - if (this.field_70170_p.func_72935_r()) { + if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, optAt)) { return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW); } else { if (!this.func_184812_l_()) { -@@ -775,6 +785,7 @@ +@@ -783,6 +793,7 @@ } private boolean func_241147_a_(BlockPos p_241147_1_, Direction p_241147_2_) { @@ -92,7 +90,7 @@ return this.func_241158_g_(p_241147_1_) || this.func_241158_g_(p_241147_1_.func_177972_a(p_241147_2_.func_176734_d())); } -@@ -874,6 +885,7 @@ +@@ -882,6 +893,7 @@ this.field_71135_a.func_147359_a(new SOpenWindowPacket(container.field_75152_c, container.func_216957_a(), p_213829_1_.func_145748_c_())); container.func_75132_a(this); this.field_71070_bA = container; @@ -100,7 +98,7 @@ return OptionalInt.of(this.field_71139_cq); } } -@@ -892,6 +904,7 @@ +@@ -900,6 +912,7 @@ this.field_71135_a.func_147359_a(new SOpenHorseWindowPacket(this.field_71139_cq, p_184826_2_.func_70302_i_(), p_184826_1_.func_145782_y())); this.field_71070_bA = new HorseInventoryContainer(this.field_71139_cq, this.field_71071_by, p_184826_2_, p_184826_1_); this.field_71070_bA.func_75132_a(this); @@ -108,7 +106,7 @@ } public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) { -@@ -949,6 +962,7 @@ +@@ -957,6 +970,7 @@ public void func_71128_l() { this.field_71070_bA.func_75134_a(this); @@ -116,7 +114,7 @@ this.field_71070_bA = this.field_71069_bz; } -@@ -1075,6 +1089,13 @@ +@@ -1081,6 +1095,13 @@ this.field_193110_cw = p_193104_1_.field_193110_cw; this.func_192029_h(p_193104_1_.func_192023_dk()); this.func_192031_i(p_193104_1_.func_192025_dl()); @@ -130,7 +128,7 @@ } protected void func_70670_a(EffectInstance p_70670_1_) { -@@ -1181,6 +1202,7 @@ +@@ -1187,6 +1208,7 @@ this.field_71140_co = p_147100_1_.func_149520_f(); this.func_184212_Q().func_187227_b(field_184827_bp, (byte)p_147100_1_.func_149521_d()); this.func_184212_Q().func_187227_b(field_184828_bq, (byte)(p_147100_1_.func_186991_f() == HandSide.LEFT ? 0 : 1)); @@ -138,7 +136,7 @@ } public ChatVisibility func_147096_v() { -@@ -1291,14 +1313,14 @@ +@@ -1297,14 +1319,14 @@ this.func_184210_p(); if (p_200619_1_ == this.field_70170_p) { this.field_71135_a.func_147364_a(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_); @@ -146,7 +144,7 @@ + } else if (net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_200619_1_.func_234923_W_())) { ServerWorld serverworld = this.func_71121_q(); IWorldInfo iworldinfo = p_200619_1_.func_72912_H(); - this.field_71135_a.func_147359_a(new SRespawnPacket(p_200619_1_.func_234922_V_(), p_200619_1_.func_234923_W_(), BiomeManager.func_235200_a_(p_200619_1_.func_72905_C()), this.field_71134_c.func_73081_b(), this.field_71134_c.func_241815_c_(), p_200619_1_.func_234925_Z_(), p_200619_1_.func_241109_A_(), true)); + this.field_71135_a.func_147359_a(new SRespawnPacket(p_200619_1_.func_230315_m_(), p_200619_1_.func_234923_W_(), BiomeManager.func_235200_a_(p_200619_1_.func_72905_C()), this.field_71134_c.func_73081_b(), this.field_71134_c.func_241815_c_(), p_200619_1_.func_234925_Z_(), p_200619_1_.func_241109_A_(), true)); this.field_71135_a.func_147359_a(new SServerDifficultyPacket(iworldinfo.func_176130_y(), iworldinfo.func_176123_z())); this.field_71133_b.func_184103_al().func_187243_f(this); - serverworld.func_217434_e(this); @@ -156,7 +154,7 @@ this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_); this.func_70029_a(p_200619_1_); p_200619_1_.func_217446_a(this); -@@ -1307,6 +1329,7 @@ +@@ -1313,6 +1335,7 @@ this.field_71134_c.func_73080_a(p_200619_1_); this.field_71133_b.func_184103_al().func_72354_b(this, p_200619_1_); this.field_71133_b.func_184103_al().func_72385_f(this); @@ -164,15 +162,15 @@ } } -@@ -1325,6 +1348,7 @@ +@@ -1335,6 +1358,7 @@ } - public void func_241153_a_(RegistryKey p_241153_1_, @Nullable BlockPos p_241153_2_, boolean p_241153_3_, boolean p_241153_4_) { -+ if (net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, p_241153_2_ == null ? World.field_234918_g_ : p_241153_1_, p_241153_2_, p_241153_3_)) return; - if (p_241153_2_ != null) { - boolean flag = p_241153_2_.equals(this.field_241138_cr_) && p_241153_1_.equals(this.field_241137_cq_); - if (p_241153_4_ && !flag) { -@@ -1375,6 +1399,8 @@ + public void func_242111_a(RegistryKey p_242111_1_, @Nullable BlockPos p_242111_2_, float p_242111_3_, boolean p_242111_4_, boolean p_242111_5_) { ++ if (net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, p_242111_2_ == null ? World.field_234918_g_ : p_242111_1_, p_242111_2_, p_242111_4_)) return; + if (p_242111_2_ != null) { + boolean flag = p_242111_2_.equals(this.field_241138_cr_) && p_242111_1_.equals(this.field_241137_cq_); + if (p_242111_5_ && !flag) { +@@ -1387,6 +1411,8 @@ if (itementity == null) { return null; } else { @@ -181,7 +179,7 @@ this.field_70170_p.func_217376_c(itementity); ItemStack itemstack = itementity.func_92059_d(); if (p_146097_3_) { -@@ -1388,4 +1414,13 @@ +@@ -1400,4 +1426,13 @@ return itementity; } } diff --git a/patches/minecraft/net/minecraft/entity/projectile/DamagingProjectileEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/DamagingProjectileEntity.java.patch index 414bd4dd1..68a4f5985 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/DamagingProjectileEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/DamagingProjectileEntity.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/entity/projectile/DamagingProjectileEntity.java +++ b/net/minecraft/entity/projectile/DamagingProjectileEntity.java -@@ -69,7 +69,7 @@ +@@ -68,7 +68,7 @@ } - RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_, RayTraceContext.BlockMode.COLLIDER); + RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_); - if (raytraceresult.func_216346_c() != RayTraceResult.Type.MISS) { + if (raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) { this.func_70227_a(raytraceresult); diff --git a/patches/minecraft/net/minecraft/entity/projectile/FishingBobberEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/FishingBobberEntity.java.patch index 66eb90220..14eb502a6 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/FishingBobberEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/FishingBobberEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/projectile/FishingBobberEntity.java +++ b/net/minecraft/entity/projectile/FishingBobberEntity.java -@@ -234,8 +234,8 @@ +@@ -233,8 +233,8 @@ private boolean func_234600_a_(PlayerEntity p_234600_1_) { ItemStack itemstack = p_234600_1_.func_184614_ca(); ItemStack itemstack1 = p_234600_1_.func_184592_cb(); @@ -11,7 +11,7 @@ if (!p_234600_1_.field_70128_L && p_234600_1_.func_70089_S() && (flag || flag1) && !(this.func_70068_e(p_234600_1_) > 1024.0D)) { return false; } else { -@@ -301,7 +301,7 @@ +@@ -300,7 +300,7 @@ double d1 = (double)((float)MathHelper.func_76128_c(this.func_226278_cu_()) + 1.0F); double d2 = this.func_226281_cx_() + (double)(f2 * (float)this.field_146038_az * 0.1F); BlockState blockstate = serverworld.func_180495_p(new BlockPos(d0, d1 - 1.0D, d2)); @@ -20,7 +20,7 @@ if (this.field_70146_Z.nextFloat() < 0.15F) { serverworld.func_195598_a(ParticleTypes.field_197612_e, d0, d1 - (double)0.1F, d2, 1, (double)f1, 0.1D, (double)f2, 0.0D); } -@@ -337,7 +337,7 @@ +@@ -336,7 +336,7 @@ double d5 = (double)((float)MathHelper.func_76128_c(this.func_226278_cu_()) + 1.0F); double d6 = this.func_226281_cx_() + (double)(MathHelper.func_76134_b(f6) * f7 * 0.1F); BlockState blockstate1 = serverworld.func_180495_p(new BlockPos(d4, d5 - 1.0D, d6)); @@ -29,7 +29,7 @@ serverworld.func_195598_a(ParticleTypes.field_218422_X, d4, d5, d6, 2 + this.field_70146_Z.nextInt(2), (double)0.1F, 0.0D, (double)0.1F, 0.0D); } } -@@ -408,6 +408,7 @@ +@@ -407,6 +407,7 @@ PlayerEntity playerentity = this.func_234606_i_(); if (!this.field_70170_p.field_72995_K && playerentity != null) { int i = 0; @@ -37,10 +37,10 @@ if (this.field_146043_c != null) { this.func_184527_k(); CriteriaTriggers.field_204811_D.func_204820_a((ServerPlayerEntity)playerentity, p_146034_1_, this, Collections.emptyList()); -@@ -415,8 +416,15 @@ +@@ -414,8 +415,15 @@ i = this.field_146043_c instanceof ItemEntity ? 3 : 5; } else if (this.field_146045_ax > 0) { - LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, this.func_233580_cy_()).func_216015_a(LootParameters.field_216289_i, p_146034_1_).func_216015_a(LootParameters.field_216281_a, this).func_216023_a(this.field_70146_Z).func_186469_a((float)this.field_191518_aw + playerentity.func_184817_da()); + LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_237457_g_, this.func_213303_ch()).func_216015_a(LootParameters.field_216289_i, p_146034_1_).func_216015_a(LootParameters.field_216281_a, this).func_216023_a(this.field_70146_Z).func_186469_a((float)this.field_191518_aw + playerentity.func_184817_da()); + lootcontext$builder.func_216015_a(LootParameters.field_216284_d, this.func_234616_v_()).func_216015_a(LootParameters.field_216281_a, this); LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(LootTables.field_186387_al); List list = loottable.func_216113_a(lootcontext$builder.func_216022_a(LootParameterSets.field_216262_c)); @@ -53,7 +53,7 @@ CriteriaTriggers.field_204811_D.func_204820_a((ServerPlayerEntity)playerentity, p_146034_1_, this, list); for(ItemStack itemstack : list) { -@@ -441,7 +449,7 @@ +@@ -440,7 +448,7 @@ } this.func_70106_y(); @@ -62,7 +62,7 @@ } else { return 0; } -@@ -468,8 +476,9 @@ +@@ -467,8 +475,9 @@ return false; } diff --git a/patches/minecraft/net/minecraft/entity/projectile/LlamaSpitEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/LlamaSpitEntity.java.patch index 37a64af08..65992f439 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/LlamaSpitEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/LlamaSpitEntity.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/entity/projectile/LlamaSpitEntity.java +++ b/net/minecraft/entity/projectile/LlamaSpitEntity.java -@@ -47,7 +47,7 @@ +@@ -46,7 +46,7 @@ super.func_70071_h_(); Vector3d vector3d = this.func_213322_ci(); - RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_, RayTraceContext.BlockMode.OUTLINE); + RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_); - if (raytraceresult != null) { + if (raytraceresult != null && raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) { this.func_70227_a(raytraceresult); diff --git a/patches/minecraft/net/minecraft/entity/projectile/ShulkerBulletEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/ShulkerBulletEntity.java.patch index 097e06f50..abb143b6a 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/ShulkerBulletEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/ShulkerBulletEntity.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/entity/projectile/ShulkerBulletEntity.java +++ b/net/minecraft/entity/projectile/ShulkerBulletEntity.java -@@ -214,7 +214,7 @@ +@@ -213,7 +213,7 @@ } - RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_, RayTraceContext.BlockMode.COLLIDER); + RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_); - if (raytraceresult.func_216346_c() != RayTraceResult.Type.MISS) { + if (raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) { this.func_70227_a(raytraceresult); diff --git a/patches/minecraft/net/minecraft/entity/projectile/ThrowableEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/ThrowableEntity.java.patch index d4745414a..085367618 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/ThrowableEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/ThrowableEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/projectile/ThrowableEntity.java +++ b/net/minecraft/entity/projectile/ThrowableEntity.java -@@ -64,7 +64,7 @@ +@@ -63,7 +63,7 @@ } } diff --git a/patches/minecraft/net/minecraft/fluid/WaterFluid.java.patch b/patches/minecraft/net/minecraft/fluid/WaterFluid.java.patch index edc375a32..4b6fb3057 100644 --- a/patches/minecraft/net/minecraft/fluid/WaterFluid.java.patch +++ b/patches/minecraft/net/minecraft/fluid/WaterFluid.java.patch @@ -6,6 +6,6 @@ protected void func_205580_a(IWorld p_205580_1_, BlockPos p_205580_2_, BlockState p_205580_3_) { - TileEntity tileentity = p_205580_3_.func_177230_c().func_235695_q_() ? p_205580_1_.func_175625_s(p_205580_2_) : null; + TileEntity tileentity = p_205580_3_.hasTileEntity() ? p_205580_1_.func_175625_s(p_205580_2_) : null; - Block.func_220059_a(p_205580_3_, p_205580_1_.func_201672_e(), p_205580_2_, tileentity); + Block.func_220059_a(p_205580_3_, p_205580_1_, p_205580_2_, tileentity); } diff --git a/patches/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch b/patches/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch index 166ad22be..78b206fbf 100644 --- a/patches/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch +++ b/patches/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/inventory/container/PlayerContainer.java +++ b/net/minecraft/inventory/container/PlayerContainer.java -@@ -50,7 +50,7 @@ +@@ -51,7 +51,7 @@ } public boolean func_75214_a(ItemStack p_75214_1_) { diff --git a/patches/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch b/patches/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch index 021a03c2f..ef20af90c 100644 --- a/patches/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch +++ b/patches/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch @@ -1,11 +1,13 @@ --- a/net/minecraft/inventory/container/RecipeBookContainer.java +++ b/net/minecraft/inventory/container/RecipeBookContainer.java -@@ -31,4 +31,8 @@ - +@@ -33,6 +33,10 @@ @OnlyIn(Dist.CLIENT) public abstract int func_203721_h(); -+ + + public java.util.List getRecipeBookCategories() { -+ return net.minecraft.client.util.ClientRecipeBook.func_216769_b(this); ++ return net.minecraft.client.util.RecipeBookCategories.func_243236_a(this.func_241850_m()); + } ++ + @OnlyIn(Dist.CLIENT) + public abstract RecipeBookCategory func_241850_m(); } diff --git a/patches/minecraft/net/minecraft/item/BoneMealItem.java.patch b/patches/minecraft/net/minecraft/item/BoneMealItem.java.patch index e216d207e..17183b105 100644 --- a/patches/minecraft/net/minecraft/item/BoneMealItem.java.patch +++ b/patches/minecraft/net/minecraft/item/BoneMealItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/BoneMealItem.java +++ b/net/minecraft/item/BoneMealItem.java -@@ -27,7 +27,7 @@ +@@ -30,7 +30,7 @@ World world = p_195939_1_.func_195991_k(); BlockPos blockpos = p_195939_1_.func_195995_a(); BlockPos blockpos1 = blockpos.func_177972_a(p_195939_1_.func_196000_l()); @@ -9,7 +9,7 @@ if (!world.field_72995_K) { world.func_217379_c(2005, blockpos, 0); } -@@ -48,8 +48,17 @@ +@@ -51,8 +51,17 @@ } } @@ -27,18 +27,7 @@ if (blockstate.func_177230_c() instanceof IGrowable) { IGrowable igrowable = (IGrowable)blockstate.func_177230_c(); if (igrowable.func_176473_a(p_195966_1_, p_195966_2_, blockstate, p_195966_1_.field_72995_K)) { -@@ -87,7 +96,9 @@ - } - } - -- if (biome == Biomes.field_203614_T || biome == Biomes.field_203617_W) { -+ // FORGE: Use BiomeDictionary here to allow modded warm ocean biomes to spawn coral from bonemeal -+ if (net.minecraftforge.common.BiomeDictionary.hasType(biome, net.minecraftforge.common.BiomeDictionary.Type.OCEAN) -+ && net.minecraftforge.common.BiomeDictionary.hasType(biome, net.minecraftforge.common.BiomeDictionary.Type.HOT)) { - if (i == 0 && p_203173_3_ != null && p_203173_3_.func_176740_k().func_176722_c()) { - blockstate = BlockTags.field_211922_B.func_205596_a(p_203173_1_.field_73012_v).func_176223_P().func_206870_a(DeadCoralWallFanBlock.field_211884_b, p_203173_3_); - } else if (field_77697_d.nextInt(4) == 0) { -@@ -126,7 +137,7 @@ +@@ -128,7 +137,7 @@ } BlockState blockstate = p_195965_0_.func_180495_p(p_195965_1_); diff --git a/patches/minecraft/net/minecraft/item/BucketItem.java.patch b/patches/minecraft/net/minecraft/item/BucketItem.java.patch index f58850473..1b743702a 100644 --- a/patches/minecraft/net/minecraft/item/BucketItem.java.patch +++ b/patches/minecraft/net/minecraft/item/BucketItem.java.patch @@ -38,7 +38,7 @@ + SoundEvent soundevent = this.field_77876_a.getAttributes().getEmptySound(); + if (soundevent == null) soundevent = fluid.func_207185_a(FluidTags.field_206960_b) ? SoundEvents.field_187633_N : SoundEvents.field_187630_M; + p_77659_2_.func_184185_a(soundevent, 1.0F, 1.0F); - ItemStack itemstack1 = DrinkHelper.func_241445_a_(itemstack, p_77659_2_, new ItemStack(fluid.func_204524_b())); + ItemStack itemstack1 = DrinkHelper.func_242398_a(itemstack, p_77659_2_, new ItemStack(fluid.func_204524_b())); if (!p_77659_1_.field_72995_K) { CriteriaTriggers.field_204813_j.func_204817_a((ServerPlayerEntity)p_77659_2_, new ItemStack(fluid.func_204524_b())); @@ -69,7 +86,7 @@ diff --git a/patches/minecraft/net/minecraft/item/DyeColor.java.patch b/patches/minecraft/net/minecraft/item/DyeColor.java.patch index b145a5762..fd588abbc 100644 --- a/patches/minecraft/net/minecraft/item/DyeColor.java.patch +++ b/patches/minecraft/net/minecraft/item/DyeColor.java.patch @@ -4,7 +4,7 @@ private final int field_196066_w; private final float[] field_193352_x; private final int field_196067_y; -+ private final net.minecraft.tags.ITag tag; ++ private final net.minecraft.tags.ITag.INamedTag tag; private final int field_218390_z; private DyeColor(int p_i50049_3_, String p_i50049_4_, int p_i50049_5_, MaterialColor p_i50049_6_, int p_i50049_7_, int p_i50049_8_) { @@ -25,7 +25,7 @@ + return field_193351_w; + } + -+ public net.minecraft.tags.ITag getTag() { ++ public net.minecraft.tags.ITag.INamedTag getTag() { + return tag; + } + diff --git a/patches/minecraft/net/minecraft/item/FishBucketItem.java.patch b/patches/minecraft/net/minecraft/item/FishBucketItem.java.patch index f51581a39..4e8ee76e5 100644 --- a/patches/minecraft/net/minecraft/item/FishBucketItem.java.patch +++ b/patches/minecraft/net/minecraft/item/FishBucketItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/FishBucketItem.java +++ b/net/minecraft/item/FishBucketItem.java -@@ -26,11 +26,19 @@ +@@ -27,11 +27,19 @@ public class FishBucketItem extends BucketItem { private final EntityType field_203794_a; @@ -18,9 +18,9 @@ + } + public void func_203792_a(World p_203792_1_, ItemStack p_203792_2_, BlockPos p_203792_3_) { - if (!p_203792_1_.field_72995_K) { - this.func_205357_b(p_203792_1_, p_203792_2_, p_203792_3_); -@@ -79,4 +87,9 @@ + if (p_203792_1_ instanceof ServerWorld) { + this.func_205357_b((ServerWorld)p_203792_1_, p_203792_2_, p_203792_3_); +@@ -80,4 +88,9 @@ } } diff --git a/patches/minecraft/net/minecraft/item/ItemGroup.java.patch b/patches/minecraft/net/minecraft/item/ItemGroup.java.patch index 411c9d11e..55e8ed512 100644 --- a/patches/minecraft/net/minecraft/item/ItemGroup.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemGroup.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/ItemGroup.java +++ b/net/minecraft/item/ItemGroup.java -@@ -104,11 +104,14 @@ +@@ -107,12 +107,15 @@ private EnchantmentType[] field_111230_s = new EnchantmentType[0]; private ItemStack field_151245_t; @@ -11,13 +11,14 @@ public ItemGroup(int p_i1853_1_, String p_i1853_2_) { - this.field_78033_n = p_i1853_1_; this.field_78034_o = p_i1853_2_; + this.field_242391_q = new TranslationTextComponent("itemGroup." + p_i1853_2_); this.field_151245_t = ItemStack.field_190927_a; - field_78032_a[p_i1853_1_] = this; + this.field_78033_n = addGroupSafe(p_i1853_1_, this); } @OnlyIn(Dist.CLIENT) -@@ -179,11 +182,13 @@ +@@ -178,11 +181,13 @@ @OnlyIn(Dist.CLIENT) public int func_78020_k() { @@ -31,7 +32,7 @@ return this.field_78033_n < 6; } -@@ -220,4 +225,58 @@ +@@ -219,4 +224,58 @@ } } @@ -72,11 +73,11 @@ + public int getSlotColor() { + return -2130706433; + } -+ ++ + public static synchronized int getGroupCountSafe() { + return ItemGroup.field_78032_a.length; + } -+ ++ + private static synchronized int addGroupSafe(int index, ItemGroup newGroup) { + if(index == -1) { + index = field_78032_a.length; diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 249842677..56ebe8119 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -74,7 +74,7 @@ } public ActionResultType func_196084_a(ItemUseContext p_196084_1_) { -+ if (!p_196084_1_.field_196006_g.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(p_196084_1_); ++ if (!p_196084_1_.func_195991_k().field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(p_196084_1_); + return onItemUse(p_196084_1_, (c) -> func_77973_b().func_195939_a(p_196084_1_)); + } + @@ -198,7 +198,7 @@ return list; } -@@ -802,7 +826,7 @@ +@@ -817,7 +841,7 @@ } } } else { @@ -207,7 +207,7 @@ } return multimap; -@@ -939,6 +963,35 @@ +@@ -954,6 +978,35 @@ return this.func_77973_b().func_219971_r(); } diff --git a/patches/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch b/patches/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch index 1dd2da6b9..ef460cffe 100644 --- a/patches/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch @@ -20,8 +20,8 @@ + else { String s1 = JSONUtils.func_151200_h(p_199425_2_, "result"); ResourceLocation resourcelocation = new ResourceLocation(s1); -- ItemStack itemstack = new ItemStack(Registry.field_212630_s.func_218349_b(resourcelocation).orElseThrow(() -> { -+ itemstack = new ItemStack(Registry.field_212630_s.func_218349_b(resourcelocation).orElseThrow(() -> { +- ItemStack itemstack = new ItemStack(Registry.field_212630_s.func_241873_b(resourcelocation).orElseThrow(() -> { ++ itemstack = new ItemStack(Registry.field_212630_s.func_241873_b(resourcelocation).orElseThrow(() -> { return new IllegalStateException("Item: " + s1 + " does not exist"); })); + } diff --git a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch index 900631fbc..5cefb4e98 100644 --- a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch @@ -99,7 +99,7 @@ } + if (list.size() == 0 && !net.minecraftforge.common.ForgeConfig.SERVER.treatEmptyTagsAsAir.get()) { -+ list.add(new ItemStack(net.minecraft.block.Blocks.field_180401_cv).func_200302_a(new net.minecraft.util.text.StringTextComponent("Empty Tag: " + TagCollectionManager.func_232928_e_().func_232925_b_().func_232975_b_(this.field_199800_a).toString()))); ++ list.add(new ItemStack(net.minecraft.block.Blocks.field_180401_cv).func_200302_a(new net.minecraft.util.text.StringTextComponent("Empty Tag: " + TagCollectionManager.func_242178_a().func_241836_b().func_232975_b_(this.field_199800_a).toString()))); + } return list; } diff --git a/patches/minecraft/net/minecraft/loot/LootParameterSets.java.patch b/patches/minecraft/net/minecraft/loot/LootParameterSets.java.patch index 475f7b819..3f7862a67 100644 --- a/patches/minecraft/net/minecraft/loot/LootParameterSets.java.patch +++ b/patches/minecraft/net/minecraft/loot/LootParameterSets.java.patch @@ -3,16 +3,16 @@ @@ -12,6 +12,7 @@ }); public static final LootParameterSet field_216261_b = func_216253_a("chest", (p_216259_0_) -> { - p_216259_0_.func_216269_a(LootParameters.field_216286_f).func_216271_b(LootParameters.field_216281_a); + p_216259_0_.func_216269_a(LootParameters.field_237457_g_).func_216271_b(LootParameters.field_216281_a); + p_216259_0_.func_216271_b(LootParameters.field_216284_d); //Forge: Chest Minecarts can have killers. }); public static final LootParameterSet field_227557_c_ = func_216253_a("command", (p_216250_0_) -> { - p_216250_0_.func_216269_a(LootParameters.field_216286_f).func_216271_b(LootParameters.field_216281_a); + p_216250_0_.func_216269_a(LootParameters.field_237457_g_).func_216271_b(LootParameters.field_216281_a); @@ -21,6 +22,7 @@ }); public static final LootParameterSet field_216262_c = func_216253_a("fishing", (p_216258_0_) -> { - p_216258_0_.func_216269_a(LootParameters.field_216286_f).func_216269_a(LootParameters.field_216289_i).func_216271_b(LootParameters.field_216281_a); + p_216258_0_.func_216269_a(LootParameters.field_237457_g_).func_216269_a(LootParameters.field_216289_i).func_216271_b(LootParameters.field_216281_a); + p_216258_0_.func_216271_b(LootParameters.field_216284_d).func_216271_b(LootParameters.field_216281_a); //Forge: Allow fisher, and bobber }); public static final LootParameterSet field_216263_d = func_216253_a("entity", (p_216251_0_) -> { - p_216251_0_.func_216269_a(LootParameters.field_216281_a).func_216269_a(LootParameters.field_216286_f).func_216269_a(LootParameters.field_216283_c).func_216271_b(LootParameters.field_216284_d).func_216271_b(LootParameters.field_216285_e).func_216271_b(LootParameters.field_216282_b); + p_216251_0_.func_216269_a(LootParameters.field_216281_a).func_216269_a(LootParameters.field_237457_g_).func_216269_a(LootParameters.field_216283_c).func_216271_b(LootParameters.field_216284_d).func_216271_b(LootParameters.field_216285_e).func_216271_b(LootParameters.field_216282_b); diff --git a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch index 5055d8d3f..9af0d3334 100644 --- a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/nbt/CompressedStreamTools.java +++ b/net/minecraft/nbt/CompressedStreamTools.java -@@ -92,10 +92,12 @@ +@@ -106,10 +106,12 @@ private static INBT func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException { byte b0 = p_152455_0_.readByte(); diff --git a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch index 15a9249eb..d92895773 100644 --- a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/NetworkManager.java +++ b/net/minecraft/network/NetworkManager.java -@@ -74,6 +74,7 @@ +@@ -75,6 +75,7 @@ private float field_211397_t; private int field_211398_u; private boolean field_211399_v; @@ -8,7 +8,7 @@ public NetworkManager(PacketDirection p_i46004_1_) { this.field_179294_g = p_i46004_1_; -@@ -83,6 +84,7 @@ +@@ -84,6 +85,7 @@ super.channelActive(p_channelActive_1_); this.field_150746_k = p_channelActive_1_.channel(); this.field_150743_l = this.field_150746_k.remoteAddress(); @@ -16,7 +16,7 @@ try { this.func_150723_a(ProtocolType.HANDSHAKING); -@@ -171,7 +173,7 @@ +@@ -172,7 +174,7 @@ ++this.field_211395_r; if (protocoltype1 != protocoltype) { field_150735_g.debug("Disabled auto read"); @@ -25,7 +25,7 @@ } if (this.field_150746_k.eventLoop().inEventLoop()) { -@@ -255,7 +257,9 @@ +@@ -260,7 +262,9 @@ @OnlyIn(Dist.CLIENT) public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) { @@ -35,7 +35,7 @@ Class oclass; LazyValue lazyvalue; if (Epoll.isAvailable() && p_181124_2_) { -@@ -282,6 +286,7 @@ +@@ -287,6 +291,7 @@ @OnlyIn(Dist.CLIENT) public static NetworkManager func_150722_a(SocketAddress p_150722_0_) { final NetworkManager networkmanager = new NetworkManager(PacketDirection.CLIENTBOUND); @@ -43,7 +43,7 @@ (new Bootstrap()).group(field_179296_e.func_179281_c()).handler(new ChannelInitializer() { protected void initChannel(Channel p_initChannel_1_) throws Exception { p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); -@@ -373,6 +378,14 @@ +@@ -377,6 +382,14 @@ return this.field_211397_t; } diff --git a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch index d680e83f4..08c72919c 100644 --- a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch @@ -29,6 +29,6 @@ - p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(NetworkSystem.this)).addLast("splitter", new NettyVarint21FrameDecoder()).addLast("decoder", new NettyPacketDecoder(PacketDirection.SERVERBOUND)).addLast("prepender", new NettyVarint21FrameEncoder()).addLast("encoder", new NettyPacketEncoder(PacketDirection.CLIENTBOUND)); + p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(READ_TIMEOUT)).addLast("legacy_query", new LegacyPingHandler(NetworkSystem.this)).addLast("splitter", new NettyVarint21FrameDecoder()).addLast("decoder", new NettyPacketDecoder(PacketDirection.SERVERBOUND)).addLast("prepender", new NettyVarint21FrameEncoder()).addLast("encoder", new NettyPacketEncoder(PacketDirection.CLIENTBOUND)); - NetworkManager networkmanager = new NetworkManager(PacketDirection.SERVERBOUND); + int i = NetworkSystem.this.field_151273_d.func_241871_k(); + NetworkManager networkmanager = (NetworkManager)(i > 0 ? new RateLimitedNetworkManager(i) : new NetworkManager(PacketDirection.SERVERBOUND)); NetworkSystem.this.field_151272_f.add(networkmanager); - p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); diff --git a/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch b/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch index 4718c51fb..5dcae1c50 100644 --- a/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch +++ b/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch @@ -9,7 +9,7 @@ private final ByteBuf field_150794_a; public PacketBuffer(ByteBuf p_i45154_1_) { -@@ -288,6 +288,15 @@ +@@ -292,6 +292,15 @@ } public PacketBuffer func_150788_a(ItemStack p_150788_1_) { @@ -25,7 +25,7 @@ if (p_150788_1_.func_190926_b()) { this.writeBoolean(false); } else { -@@ -297,7 +306,7 @@ +@@ -301,7 +310,7 @@ this.writeByte(p_150788_1_.func_190916_E()); CompoundNBT compoundnbt = null; if (item.func_77645_m() || item.func_77651_p()) { @@ -34,7 +34,7 @@ } this.func_150786_a(compoundnbt); -@@ -313,7 +322,7 @@ +@@ -317,7 +326,7 @@ int i = this.func_150792_a(); int j = this.readByte(); ItemStack itemstack = new ItemStack(Item.func_150899_d(i), j); diff --git a/patches/minecraft/net/minecraft/network/datasync/DataSerializers.java.patch b/patches/minecraft/net/minecraft/network/datasync/DataSerializers.java.patch index b94bcaa2b..abae47226 100644 --- a/patches/minecraft/net/minecraft/network/datasync/DataSerializers.java.patch +++ b/patches/minecraft/net/minecraft/network/datasync/DataSerializers.java.patch @@ -15,7 +15,7 @@ } public static int func_187188_b(IDataSerializer p_187188_0_) { -- return field_187204_n.func_186815_a(p_187188_0_); +- return field_187204_n.func_148757_b(p_187188_0_); + return net.minecraftforge.common.ForgeHooks.getSerializerId(p_187188_0_, field_187204_n); } diff --git a/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch b/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch index ae74f82e0..b4752cdf2 100644 --- a/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/play/ServerPlayNetHandler.java +++ b/net/minecraft/network/play/ServerPlayNetHandler.java -@@ -347,9 +347,11 @@ +@@ -348,9 +348,11 @@ } entity.func_70080_a(d3, d4, d5, f, f1); @@ -12,7 +12,7 @@ this.field_147371_a.func_179290_a(new SMoveVehiclePacket(entity)); return; } -@@ -366,7 +368,7 @@ +@@ -367,7 +369,7 @@ } private boolean func_241162_a_(Entity p_241162_1_) { @@ -21,7 +21,7 @@ } public void func_184339_a(CConfirmTeleportPacket p_184339_1_) { -@@ -887,7 +889,9 @@ +@@ -881,7 +883,9 @@ Direction direction = blockraytraceresult.func_216354_b(); this.field_147369_b.func_143004_u(); if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) { @@ -32,7 +32,7 @@ ActionResultType actionresulttype = this.field_147369_b.field_71134_c.func_219441_a(this.field_147369_b, serverworld, itemstack, hand, blockraytraceresult); if (direction == Direction.UP && !actionresulttype.func_226246_a_() && blockpos.func_177956_o() >= this.field_147367_d.func_71207_Z() - 1 && func_241166_a_(this.field_147369_b, itemstack)) { ITextComponent itextcomponent = (new TranslationTextComponent("build.tooHigh", this.field_147367_d.func_71207_Z())).func_240699_a_(TextFormatting.RED); -@@ -1020,7 +1024,9 @@ +@@ -1014,7 +1018,9 @@ if (s.startsWith("/")) { this.func_147361_d(s); } else { @@ -43,7 +43,7 @@ this.field_147367_d.func_184103_al().func_232641_a_(itextcomponent, ChatType.CHAT, this.field_147369_b.func_110124_au()); } -@@ -1109,6 +1115,7 @@ +@@ -1104,6 +1110,7 @@ if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT) { optional = Optional.of(this.field_147369_b.func_190775_a(entity, hand)); } else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT_AT) { @@ -51,7 +51,7 @@ optional = Optional.of(entity.func_184199_a(this.field_147369_b, p_147340_1_.func_179712_b(), hand)); } else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.ATTACK) { if (entity instanceof ItemEntity || entity instanceof ExperienceOrbEntity || entity instanceof AbstractArrowEntity || entity == this.field_147369_b) { -@@ -1320,6 +1327,8 @@ +@@ -1315,6 +1322,8 @@ } public void func_147349_a(CCustomPayloadPacket p_147349_1_) { diff --git a/patches/minecraft/net/minecraft/network/play/server/SCommandListPacket.java.patch b/patches/minecraft/net/minecraft/network/play/server/SCommandListPacket.java.patch index 34a406a83..238f88650 100644 --- a/patches/minecraft/net/minecraft/network/play/server/SCommandListPacket.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/SCommandListPacket.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/network/play/server/SCommandListPacket.java +++ b/net/minecraft/network/play/server/SCommandListPacket.java -@@ -110,6 +110,9 @@ - String s = p_197695_1_.func_150789_c(32767); - ArgumentType argumenttype = ArgumentTypes.func_197486_a(p_197695_1_); +@@ -119,6 +119,9 @@ + String s = p_197695_0_.func_150789_c(32767); + ArgumentType argumenttype = ArgumentTypes.func_197486_a(p_197695_0_); if (argumenttype == null) { -+ if ((p_197695_2_ & 16) != 0) { // FORGE: Flush unused suggestion data -+ p_197695_1_.func_192575_l(); ++ if ((i & 16) != 0) { // FORGE: Flush unused suggestion data ++ p_197695_0_.func_192575_l(); + } return null; } else { diff --git a/patches/minecraft/net/minecraft/network/play/server/STagsListPacket.java.patch b/patches/minecraft/net/minecraft/network/play/server/STagsListPacket.java.patch deleted file mode 100644 index b118057c1..000000000 --- a/patches/minecraft/net/minecraft/network/play/server/STagsListPacket.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/network/play/server/STagsListPacket.java -+++ b/net/minecraft/network/play/server/STagsListPacket.java -@@ -19,7 +19,7 @@ - } - - public void func_148837_a(PacketBuffer p_148837_1_) throws IOException { -- this.field_199859_a = NetworkTagManager.func_199714_b(p_148837_1_); -+ this.field_199859_a = NetworkTagManager.readSafe(p_148837_1_); - } - - public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { diff --git a/patches/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch b/patches/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch index 7767d3c73..92dfc30d6 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch +++ b/patches/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/pathfinding/PathNodeType.java +++ b/net/minecraft/pathfinding/PathNodeType.java -@@ -34,4 +34,13 @@ +@@ -35,4 +35,13 @@ public float func_186289_a() { return this.field_186307_r; } diff --git a/patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch b/patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch index ca7ef63af..5e5217a1b 100644 --- a/patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch +++ b/patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/pathfinding/WalkNodeProcessor.java +++ b/net/minecraft/pathfinding/WalkNodeProcessor.java -@@ -478,9 +478,11 @@ +@@ -463,9 +463,11 @@ protected static PathNodeType func_237238_b_(IBlockReader p_237238_0_, BlockPos p_237238_1_) { BlockState blockstate = p_237238_0_.func_180495_p(p_237238_1_); diff --git a/patches/minecraft/net/minecraft/resources/DataPackRegistries.java.patch b/patches/minecraft/net/minecraft/resources/DataPackRegistries.java.patch index d3cf8f9c5..79d6306f4 100644 --- a/patches/minecraft/net/minecraft/resources/DataPackRegistries.java.patch +++ b/patches/minecraft/net/minecraft/resources/DataPackRegistries.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/resources/DataPackRegistries.java +++ b/net/minecraft/resources/DataPackRegistries.java -@@ -31,6 +31,7 @@ +@@ -32,6 +32,7 @@ this.field_240952_b_.func_219534_a(this.field_240957_g_); this.field_240952_b_.func_219534_a(this.field_240959_i_); this.field_240952_b_.func_219534_a(this.field_240958_h_); diff --git a/patches/minecraft/net/minecraft/resources/ResourcePackInfo.java.patch b/patches/minecraft/net/minecraft/resources/ResourcePackInfo.java.patch index 099ddb028..47d886a68 100644 --- a/patches/minecraft/net/minecraft/resources/ResourcePackInfo.java.patch +++ b/patches/minecraft/net/minecraft/resources/ResourcePackInfo.java.patch @@ -9,7 +9,7 @@ @Nullable @@ -53,7 +54,12 @@ - return (T)null; + return null; } + @Deprecated diff --git a/patches/minecraft/net/minecraft/resources/ResourcePackList.java.patch b/patches/minecraft/net/minecraft/resources/ResourcePackList.java.patch index 4ce9ddc43..2e3cff3a3 100644 --- a/patches/minecraft/net/minecraft/resources/ResourcePackList.java.patch +++ b/patches/minecraft/net/minecraft/resources/ResourcePackList.java.patch @@ -2,14 +2,14 @@ +++ b/net/minecraft/resources/ResourcePackList.java @@ -22,7 +22,7 @@ - public ResourcePackList(ResourcePackInfo.IFactory p_i231423_1_, IPackFinder... p_i231423_2_) { + public ResourcePackList(ResourcePackInfo.IFactory p_i231423_1_, IPackFinder... p_i231423_2_) { this.field_198990_d = p_i231423_1_; - this.field_198987_a = ImmutableSet.copyOf(p_i231423_2_); + this.field_198987_a = new java.util.HashSet<>(java.util.Arrays.asList(p_i231423_2_)); } - public void func_198983_a() { -@@ -85,6 +85,10 @@ + public ResourcePackList(IPackFinder... p_i241886_1_) { +@@ -89,6 +89,10 @@ return this.field_198988_b.get(p_198981_1_); } diff --git a/patches/minecraft/net/minecraft/server/Main.java.patch b/patches/minecraft/net/minecraft/server/Main.java.patch index 868da9683..ac07d9636 100644 --- a/patches/minecraft/net/minecraft/server/Main.java.patch +++ b/patches/minecraft/net/minecraft/server/Main.java.patch @@ -9,24 +9,26 @@ try { OptionSet optionset = optionparser.parse(p_main_0_); -@@ -79,32 +81,36 @@ +@@ -79,33 +81,38 @@ optionparser.printHelpOn(System.err); return; } + Path path1 = Paths.get("eula.txt"); + ServerEula servereula = new ServerEula(path1); -+ if (!optionset.has(optionspec1) && !servereula.func_154346_a()) { + ++ if (!servereula.func_154346_a()) { + field_240759_a_.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); + return; + } - ++ CrashReport.func_230188_h_(); Bootstrap.func_151354_b(); Bootstrap.func_218821_c(); Util.func_240994_l_(); + if (!optionset.has(optionspec1)) net.minecraftforge.fml.server.ServerModLoader.load(); // Load mods before we load almost anything else anymore. Single spot now. Only loads if they haven't passed the initserver param + DynamicRegistries.Impl dynamicregistries$impl = DynamicRegistries.func_239770_b_(); Path path = Paths.get("server.properties"); - ServerPropertiesProvider serverpropertiesprovider = new ServerPropertiesProvider(path); + ServerPropertiesProvider serverpropertiesprovider = new ServerPropertiesProvider(dynamicregistries$impl, path); serverpropertiesprovider.func_219035_b(); - Path path1 = Paths.get("eula.txt"); - ServerEula servereula = new ServerEula(path1); @@ -47,13 +49,13 @@ PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(file1, MinecraftServer.field_152367_a.getName())); String s = Optional.ofNullable(optionset.valueOf(optionspec10)).orElse(serverpropertiesprovider.func_219034_a().field_219021_o); + if (s == null || s.isEmpty() || new File(file1, s).getAbsolutePath().equals(new File(s).getAbsolutePath())) { -+ field_240759_a_.error("Invalid world directory specified, must not be null, empty or the same directory as your universe! " + s); -+ return; ++ field_240759_a_.error("Invalid world directory specified, must not be null, empty or the same directory as your universe! " + s); ++ return; + } SaveFormat saveformat = SaveFormat.func_237269_a_(file1.toPath()); SaveFormat.LevelSave saveformat$levelsave = saveformat.func_237274_c_(s); MinecraftServer.func_240777_a_(saveformat$levelsave); -@@ -170,6 +176,7 @@ +@@ -170,6 +177,7 @@ Thread thread = new Thread("Server Shutdown Thread") { public void run() { dedicatedserver.func_71263_m(true); diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 349697d63..7f5615b5d 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -226,7 +226,7 @@ +@@ -225,7 +225,7 @@ public static S func_240784_a_(Function p_240784_0_) { AtomicReference atomicreference = new AtomicReference<>(); @@ -9,23 +9,23 @@ atomicreference.get().func_240802_v_(); }, "Server thread"); thread.setUncaughtExceptionHandler((p_240779_0_, p_240779_1_) -> { -@@ -380,6 +380,7 @@ +@@ -373,6 +373,7 @@ worldborder.func_177737_a(new IBorderListener.Impl(serverworld1.func_175723_af())); - this.field_71305_c.put(registrykey2, serverworld1); + this.field_71305_c.put(registrykey1, serverworld1); } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(field_71305_c.get(registrykey1))); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(field_71305_c.get(registrykey))); } } -@@ -391,6 +392,7 @@ +@@ -384,6 +385,7 @@ } else if (p_240786_3_) { - p_240786_1_.func_176143_a(BlockPos.field_177992_a.func_177984_a()); + p_240786_1_.func_176143_a(BlockPos.field_177992_a.func_177984_a(), 0.0F); } else { + if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(p_240786_0_, p_240786_1_)) return; BiomeProvider biomeprovider = chunkgenerator.func_202090_b(); - List list = biomeprovider.func_76932_a(); Random random = new Random(p_240786_0_.func_72905_C()); -@@ -569,6 +571,7 @@ + BlockPos blockpos = biomeprovider.func_225531_a_(0, p_240786_0_.func_181545_F(), 0, 256, (p_244265_0_) -> { +@@ -563,6 +565,7 @@ for(ServerWorld serverworld1 : this.func_212370_w()) { if (serverworld1 != null) { try { @@ -33,7 +33,7 @@ serverworld1.close(); } catch (IOException ioexception1) { field_147145_h.error("Exception closing the level", (Throwable)ioexception1); -@@ -617,6 +620,7 @@ +@@ -611,6 +614,7 @@ protected void func_240802_v_() { try { if (this.func_71197_b()) { @@ -41,7 +41,7 @@ this.field_211151_aa = Util.func_211177_b(); this.field_147147_p.func_151315_a(new StringTextComponent(this.field_71286_C)); this.field_147147_p.func_151321_a(new ServerStatusResponse.Version(SharedConstants.func_215069_a().getName(), SharedConstants.func_215069_a().getProtocolVersion())); -@@ -646,7 +650,10 @@ +@@ -640,7 +644,10 @@ this.func_240795_b_(longtickdetector); this.field_71296_Q = true; } @@ -52,7 +52,7 @@ this.func_71228_a((CrashReport)null); } } catch (Throwable throwable1) { -@@ -665,6 +672,7 @@ +@@ -659,6 +666,7 @@ field_147145_h.error("We were unable to save this crash report to disk."); } @@ -60,7 +60,7 @@ this.func_71228_a(crashreport); } finally { try { -@@ -673,6 +681,7 @@ +@@ -667,6 +675,7 @@ } catch (Throwable throwable) { field_147145_h.error("Exception stopping the server", throwable); } finally { @@ -68,7 +68,7 @@ this.func_71240_o(); } -@@ -774,6 +783,7 @@ +@@ -768,6 +777,7 @@ protected void func_71217_p(BooleanSupplier p_71217_1_) { long i = Util.func_211178_c(); @@ -76,7 +76,7 @@ ++this.field_71315_w; this.func_71190_q(p_71217_1_); if (i - this.field_147142_T >= 5000000000L) { -@@ -788,6 +798,7 @@ +@@ -782,6 +792,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); this.field_147147_p.func_151318_b().func_151330_a(agameprofile); @@ -84,7 +84,7 @@ } if (this.field_71315_w % 6000 == 0) { -@@ -815,6 +826,7 @@ +@@ -809,6 +820,7 @@ long i1 = Util.func_211178_c(); this.field_213215_ap.func_181747_a(i1 - i); this.field_71304_b.func_76319_b(); @@ -92,7 +92,7 @@ } protected void func_71190_q(BooleanSupplier p_71190_1_) { -@@ -822,7 +834,8 @@ +@@ -816,7 +828,8 @@ this.func_193030_aL().func_73660_a(); this.field_71304_b.func_219895_b("levels"); @@ -102,7 +102,7 @@ this.field_71304_b.func_194340_a(() -> { return serverworld + " " + serverworld.func_234923_W_().func_240901_a_(); }); -@@ -833,6 +846,7 @@ +@@ -827,6 +840,7 @@ } this.field_71304_b.func_76320_a("tick"); @@ -110,7 +110,7 @@ try { serverworld.func_72835_b(p_71190_1_); -@@ -841,9 +855,11 @@ +@@ -835,9 +849,11 @@ serverworld.func_72914_a(crashreport); throw new ReportedException(crashreport); } @@ -122,7 +122,7 @@ } this.field_71304_b.func_219895_b("connection"); -@@ -918,7 +934,7 @@ +@@ -912,7 +928,7 @@ } public String getServerModName() { @@ -131,7 +131,7 @@ } public CrashReport func_71230_b(CrashReport p_71230_1_) { -@@ -931,6 +947,7 @@ +@@ -925,6 +941,7 @@ p_71230_1_.func_85056_g().func_189529_a("Data Packs", () -> { StringBuilder stringbuilder = new StringBuilder(); @@ -139,7 +139,7 @@ for(ResourcePackInfo resourcepackinfo : this.field_195577_ad.func_198980_d()) { if (stringbuilder.length() > 0) { stringbuilder.append(", "); -@@ -1275,6 +1292,7 @@ +@@ -1271,6 +1288,7 @@ this.func_184103_al().func_193244_w(); this.field_200258_al.func_240946_a_(this.field_195576_ac.func_240960_a_()); this.field_240765_ak_.func_195410_a(this.field_195576_ac.func_240970_h_()); @@ -147,10 +147,10 @@ }, this); if (this.func_213162_bc()) { this.func_213161_c(completablefuture::isDone); -@@ -1284,10 +1302,13 @@ +@@ -1280,10 +1298,13 @@ } - public static DatapackCodec func_240772_a_(ResourcePackList p_240772_0_, DatapackCodec p_240772_1_, boolean p_240772_2_) { + public static DatapackCodec func_240772_a_(ResourcePackList p_240772_0_, DatapackCodec p_240772_1_, boolean p_240772_2_) { + net.minecraftforge.fml.packs.ResourcePackLoader.loadResourcePacks(p_240772_0_, net.minecraftforge.fml.server.ServerLifecycleHooks::buildPackFinder); p_240772_0_.func_198983_a(); + DatapackCodec.field_234880_a_.addModPacks(net.minecraftforge.common.ForgeHooks.getModPacks()); @@ -163,7 +163,7 @@ } else { Set set = Sets.newLinkedHashSet(); -@@ -1437,6 +1458,31 @@ +@@ -1433,6 +1454,31 @@ public abstract boolean func_213199_b(GameProfile p_213199_1_); @@ -195,12 +195,14 @@ public void func_223711_a(Path p_223711_1_) throws IOException { Path path = p_223711_1_.resolve("levels"); -@@ -1564,4 +1610,8 @@ - public IServerConfiguration func_240793_aU_() { +@@ -1561,6 +1607,10 @@ return this.field_240768_i_; } -+ + + public DataPackRegistries getDataPackRegistries() { + return field_195576_ac; + } - } ++ + public DynamicRegistries func_244267_aX() { + return this.field_240767_f_; + } diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index 0b8a99c47..71c1f249d 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -77,6 +77,7 @@ +@@ -76,6 +76,7 @@ public boolean func_71197_b() throws IOException { Thread thread = new Thread("Server console handler") { public void run() { @@ -8,7 +8,7 @@ BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); String s1; -@@ -159,11 +160,13 @@ +@@ -158,11 +159,13 @@ SkullTileEntity.func_184293_a(this.func_152358_ax()); SkullTileEntity.func_184294_a(this.func_147130_as()); PlayerProfileCache.func_187320_a(this.func_71266_T()); @@ -22,7 +22,7 @@ if (serverproperties.field_219027_u != null) { this.func_200252_aR().func_223585_a(GameRules.field_223620_w).func_223570_a(serverproperties.field_219027_u, this); } -@@ -189,11 +192,12 @@ +@@ -186,11 +189,12 @@ } Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a()); @@ -36,7 +36,7 @@ } } -@@ -506,6 +510,11 @@ +@@ -507,6 +511,11 @@ return false; } diff --git a/patches/minecraft/net/minecraft/server/dedicated/PropertyManager.java.patch b/patches/minecraft/net/minecraft/server/dedicated/PropertyManager.java.patch index bf14788b6..323ad6609 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/PropertyManager.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/PropertyManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/dedicated/PropertyManager.java +++ b/net/minecraft/server/dedicated/PropertyManager.java -@@ -38,7 +38,7 @@ +@@ -39,7 +39,7 @@ public void func_218970_c(Path p_218970_1_) { try (OutputStream outputstream = Files.newOutputStream(p_218970_1_)) { diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index b8a3c0488..38cbe29e6 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/integrated/IntegratedServer.java +++ b/net/minecraft/server/integrated/IntegratedServer.java -@@ -59,9 +59,10 @@ +@@ -58,9 +58,10 @@ this.func_71245_h(true); field_147148_h.info("Generating keypair"); this.func_71253_a(CryptManager.func_75891_b()); @@ -12,7 +12,7 @@ } public void func_71217_p(BooleanSupplier p_71217_1_) { -@@ -171,6 +172,7 @@ +@@ -174,6 +175,7 @@ } public void func_71263_m(boolean p_71263_1_) { diff --git a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch index b18d812c9..fd74a742b 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/server/management/PlayerList.java +++ b/net/minecraft/server/management/PlayerList.java -@@ -107,6 +107,7 @@ +@@ -110,6 +110,7 @@ private GameType field_72410_m; private boolean field_72407_n; private int field_72408_o; + private final List playersView = java.util.Collections.unmodifiableList(field_72404_b); - public PlayerList(MinecraftServer p_i231425_1_, IDynamicRegistries.Impl p_i231425_2_, PlayerData p_i231425_3_, int p_i231425_4_) { + public PlayerList(MinecraftServer p_i231425_1_, DynamicRegistries.Impl p_i231425_2_, PlayerData p_i231425_3_, int p_i231425_4_) { this.field_72400_f = p_i231425_1_; -@@ -143,6 +144,7 @@ +@@ -146,6 +147,7 @@ IWorldInfo iworldinfo = serverworld1.func_72912_H(); this.func_72381_a(p_72355_2_, (ServerPlayerEntity)null, serverworld1); ServerPlayNetHandler serverplaynethandler = new ServerPlayNetHandler(this.field_72400_f, p_72355_1_, p_72355_2_); @@ -16,7 +16,7 @@ GameRules gamerules = serverworld1.func_82736_K(); boolean flag = gamerules.func_223586_b(GameRules.field_226683_z_); boolean flag1 = gamerules.func_223586_b(GameRules.field_223612_o); -@@ -167,7 +169,7 @@ +@@ -170,7 +172,7 @@ this.func_232641_a_(iformattabletextcomponent.func_240699_a_(TextFormatting.YELLOW), ChatType.SYSTEM, Util.field_240973_b_); serverplaynethandler.func_147364_a(p_72355_2_.func_226277_ct_(), p_72355_2_.func_226278_cu_(), p_72355_2_.func_226281_cx_(), p_72355_2_.field_70177_z, p_72355_2_.field_70125_A); @@ -25,7 +25,7 @@ this.field_177454_f.put(p_72355_2_.func_110124_au(), p_72355_2_); this.func_148540_a(new SPlayerListItemPacket(SPlayerListItemPacket.Action.ADD_PLAYER, p_72355_2_)); -@@ -222,6 +224,7 @@ +@@ -225,6 +227,7 @@ } p_72355_2_.func_71116_b(); @@ -33,7 +33,7 @@ } protected void func_96456_a(ServerScoreboard p_96456_1_, ServerPlayerEntity p_96456_2_) { -@@ -282,6 +285,7 @@ +@@ -285,6 +288,7 @@ compoundnbt1 = compoundnbt; p_72380_1_.func_70020_e(compoundnbt); field_148546_d.debug("loading single player"); @@ -41,7 +41,7 @@ } else { compoundnbt1 = this.field_72412_k.func_237336_b_(p_72380_1_); } -@@ -290,6 +294,7 @@ +@@ -293,6 +297,7 @@ } protected void func_72391_b(ServerPlayerEntity p_72391_1_) { @@ -49,7 +49,7 @@ this.field_72412_k.func_237335_a_(p_72391_1_); ServerStatisticsManager serverstatisticsmanager = this.field_148547_k.get(p_72391_1_.func_110124_au()); if (serverstatisticsmanager != null) { -@@ -304,6 +309,7 @@ +@@ -307,6 +312,7 @@ } public void func_72367_e(ServerPlayerEntity p_72367_1_) { @@ -57,7 +57,7 @@ ServerWorld serverworld = p_72367_1_.func_71121_q(); p_72367_1_.func_195066_a(Stats.field_75947_j); this.func_72391_b(p_72367_1_); -@@ -327,7 +333,7 @@ +@@ -330,7 +336,7 @@ p_72367_1_.func_213319_R(); serverworld.func_217434_e(p_72367_1_); p_72367_1_.func_192039_O().func_192745_a(); @@ -66,7 +66,7 @@ this.field_72400_f.func_201300_aS().func_201382_b(p_72367_1_); UUID uuid = p_72367_1_.func_110124_au(); ServerPlayerEntity serverplayerentity = this.field_177454_f.get(uuid); -@@ -397,8 +403,8 @@ +@@ -400,8 +406,8 @@ } public ServerPlayerEntity func_232644_a_(ServerPlayerEntity p_232644_1_, boolean p_232644_2_) { @@ -75,9 +75,9 @@ + this.removePlayer(p_232644_1_); + p_232644_1_.func_71121_q().removePlayer(p_232644_1_, true); // Forge: keep data until copyFrom called BlockPos blockpos = p_232644_1_.func_241140_K_(); + float f = p_232644_1_.func_242109_L(); boolean flag = p_232644_1_.func_241142_M_(); - ServerWorld serverworld = this.field_72400_f.func_71218_a(p_232644_1_.func_241141_L_()); -@@ -420,6 +426,7 @@ +@@ -424,6 +430,7 @@ ServerPlayerEntity serverplayerentity = new ServerPlayerEntity(this.field_72400_f, serverworld1, p_232644_1_.func_146103_bH(), playerinteractionmanager); serverplayerentity.field_71135_a = p_232644_1_.field_71135_a; serverplayerentity.func_193104_a(p_232644_1_, p_232644_2_); @@ -85,7 +85,7 @@ serverplayerentity.func_145769_d(p_232644_1_.func_145782_y()); serverplayerentity.func_184819_a(p_232644_1_.func_184591_cq()); -@@ -451,10 +458,11 @@ +@@ -465,10 +472,11 @@ this.func_72354_b(serverplayerentity, serverworld1); this.func_187243_f(serverplayerentity); serverworld1.func_217433_d(serverplayerentity); @@ -95,10 +95,10 @@ serverplayerentity.func_71116_b(); serverplayerentity.func_70606_j(serverplayerentity.func_110143_aJ()); + net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerRespawnEvent(serverplayerentity, p_232644_2_); - if (flag1) { + if (flag2) { serverplayerentity.field_71135_a.func_147359_a(new SPlaySoundEffectPacket(SoundEvents.field_232818_ms_, SoundCategory.BLOCKS, (double)blockpos.func_177958_n(), (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p(), 1.0F, 1.0F)); } -@@ -772,7 +780,7 @@ +@@ -786,7 +794,7 @@ } public List func_181057_v() { @@ -107,7 +107,7 @@ } @Nullable -@@ -802,4 +810,12 @@ +@@ -816,4 +824,12 @@ public boolean func_206257_x() { return this.field_72407_n; } diff --git a/patches/minecraft/net/minecraft/stats/StatType.java.patch b/patches/minecraft/net/minecraft/stats/StatType.java.patch index a2c7f74f4..21da750c1 100644 --- a/patches/minecraft/net/minecraft/stats/StatType.java.patch +++ b/patches/minecraft/net/minecraft/stats/StatType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/stats/StatType.java +++ b/net/minecraft/stats/StatType.java -@@ -7,7 +7,7 @@ +@@ -10,7 +10,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -8,4 +8,4 @@ +public class StatType extends net.minecraftforge.registries.ForgeRegistryEntry> implements Iterable> { private final Registry field_199082_a; private final Map> field_199083_b = new IdentityHashMap<>(); - + @Nullable diff --git a/patches/minecraft/net/minecraft/tags/FluidTags.java.patch b/patches/minecraft/net/minecraft/tags/FluidTags.java.patch new file mode 100644 index 000000000..efddbbec7 --- /dev/null +++ b/patches/minecraft/net/minecraft/tags/FluidTags.java.patch @@ -0,0 +1,12 @@ +--- a/net/minecraft/tags/FluidTags.java ++++ b/net/minecraft/tags/FluidTags.java +@@ -16,4 +16,9 @@ + public static List> func_241280_c_() { + return field_206961_c.func_241288_c_(); + } ++ ++ //Forge: Readd this stripped getter like the other tag classes ++ public static ITagCollection func_226157_a_() { ++ return field_206961_c.func_232939_b_(); ++ } + } diff --git a/patches/minecraft/net/minecraft/tags/ITag.java.patch b/patches/minecraft/net/minecraft/tags/ITag.java.patch index 474a56f11..7728af753 100644 --- a/patches/minecraft/net/minecraft/tags/ITag.java.patch +++ b/patches/minecraft/net/minecraft/tags/ITag.java.patch @@ -24,7 +24,7 @@ public Optional> func_232959_a_(Function> p_232959_1_, Function p_232959_2_) { ImmutableSet.Builder builder = ImmutableSet.builder(); -@@ -108,6 +118,7 @@ +@@ -103,6 +113,7 @@ this.field_232953_a_.clear(); } @@ -32,7 +32,7 @@ list.forEach((p_232958_2_) -> { this.field_232953_a_.add(new ITag.Proxy(p_232958_2_, p_232956_2_)); }); -@@ -119,11 +130,20 @@ +@@ -135,11 +146,20 @@ JsonArray jsonarray = new JsonArray(); for(ITag.Proxy itag$proxy : this.field_232953_a_) { @@ -54,15 +54,15 @@ return jsonobject; } } -@@ -162,6 +182,7 @@ +@@ -178,6 +198,7 @@ public String toString() { return this.field_232969_a_.toString(); } + @Override public boolean equals(Object o) { return o == this || (o instanceof ITag.ItemEntry && java.util.Objects.equals(this.field_232969_a_, ((ITag.ItemEntry) o).field_232969_a_)); } } - public static class Proxy { -@@ -206,5 +227,6 @@ + public static class OptionalItemEntry implements ITag.ITagEntry { +@@ -278,5 +299,6 @@ public String toString() { return "#" + this.field_200163_a; } diff --git a/patches/minecraft/net/minecraft/tags/ITagCollectionSupplier.java.patch b/patches/minecraft/net/minecraft/tags/ITagCollectionSupplier.java.patch new file mode 100644 index 000000000..d688b2db0 --- /dev/null +++ b/patches/minecraft/net/minecraft/tags/ITagCollectionSupplier.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/tags/ITagCollectionSupplier.java ++++ b/net/minecraft/tags/ITagCollectionSupplier.java +@@ -22,6 +22,7 @@ + default void func_242212_e() { + TagRegistryManager.func_242193_a(this); + Blocks.func_235419_a_(); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this)); + } + + default void func_242210_a(PacketBuffer p_242210_1_) { diff --git a/patches/minecraft/net/minecraft/tags/NetworkTagManager.java.patch b/patches/minecraft/net/minecraft/tags/NetworkTagManager.java.patch deleted file mode 100644 index 7889d1c1e..000000000 --- a/patches/minecraft/net/minecraft/tags/NetworkTagManager.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/net/minecraft/tags/NetworkTagManager.java -+++ b/net/minecraft/tags/NetworkTagManager.java -@@ -47,8 +47,19 @@ - this.field_215299_d.func_200042_a(p_199716_1_); - } - -+ /* -+ * Reads a list of Network Tag Collections from the packet, but supports missing/empty tags. -+ * If the tag is missing, it will either return an empty tag when requested, or a tag with default values. -+ */ -+ public static NetworkTagManager readSafe(PacketBuffer buffer) { -+ return read(buffer, net.minecraftforge.common.util.ForgeNetworkTagManager.create()); -+ } -+ - public static NetworkTagManager func_199714_b(PacketBuffer p_199714_0_) { -- NetworkTagManager networktagmanager = new NetworkTagManager(); -+ return read(p_199714_0_, new NetworkTagManager()); -+ } -+ -+ private static NetworkTagManager read(PacketBuffer p_199714_0_, NetworkTagManager networktagmanager) { - networktagmanager.func_199717_a().func_200043_b(p_199714_0_); - networktagmanager.func_199715_b().func_200043_b(p_199714_0_); - networktagmanager.func_205704_c().func_200043_b(p_199714_0_); -@@ -86,5 +97,6 @@ - FluidTags.func_206953_a(this.field_205705_c); - EntityTypeTags.func_219759_a(this.field_215299_d); - Blocks.func_235419_a_(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this)); - } - } diff --git a/patches/minecraft/net/minecraft/tags/TagCollection.java.patch b/patches/minecraft/net/minecraft/tags/TagCollection.java.patch deleted file mode 100644 index 1e0f13e6d..000000000 --- a/patches/minecraft/net/minecraft/tags/TagCollection.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/tags/TagCollection.java -+++ b/net/minecraft/tags/TagCollection.java -@@ -167,4 +167,8 @@ - public Map> func_200039_c() { - return this.field_199921_d; - } -+ -+ public Function> getEntryLookup() { -+ return this.field_200040_e; -+ } - } diff --git a/patches/minecraft/net/minecraft/tags/TagRegistry.java.patch b/patches/minecraft/net/minecraft/tags/TagRegistry.java.patch index f78847b76..c92136f0a 100644 --- a/patches/minecraft/net/minecraft/tags/TagRegistry.java.patch +++ b/patches/minecraft/net/minecraft/tags/TagRegistry.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tags/TagRegistry.java +++ b/net/minecraft/tags/TagRegistry.java -@@ -22,6 +22,7 @@ +@@ -23,6 +23,7 @@ public ITag.INamedTag func_232937_a_(String p_232937_1_) { TagRegistry.NamedTag namedtag = new TagRegistry.NamedTag<>(new ResourceLocation(p_232937_1_)); @@ -8,3 +8,14 @@ this.field_232931_c_.add(namedtag); return namedtag; } +@@ -93,5 +94,10 @@ + public List func_230236_b_() { + return this.func_232944_c_().func_230236_b_(); + } ++ ++ @Override ++ public String toString() { ++ return "NamedTag[" + func_230234_a_().toString() + ']'; ++ } + } + } diff --git a/patches/minecraft/net/minecraft/tileentity/AbstractFurnaceTileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/AbstractFurnaceTileEntity.java.patch index 39e954a03..644c93a6d 100644 --- a/patches/minecraft/net/minecraft/tileentity/AbstractFurnaceTileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/AbstractFurnaceTileEntity.java.patch @@ -8,28 +8,7 @@ public static Map func_214001_f() { Map map = Maps.newLinkedHashMap(); func_213996_a(map, Items.field_151129_at, 20000); -@@ -104,18 +105,8 @@ - func_213992_a(map, ItemTags.field_202899_i, 150); - func_213992_a(map, ItemTags.field_212188_k, 300); - func_213992_a(map, ItemTags.field_202900_j, 300); -- func_213996_a(map, Blocks.field_180407_aO, 300); -- func_213996_a(map, Blocks.field_180404_aQ, 300); -- func_213996_a(map, Blocks.field_180408_aP, 300); -- func_213996_a(map, Blocks.field_180403_aR, 300); -- func_213996_a(map, Blocks.field_180406_aS, 300); -- func_213996_a(map, Blocks.field_180405_aT, 300); -- func_213996_a(map, Blocks.field_180390_bo, 300); -- func_213996_a(map, Blocks.field_180392_bq, 300); -- func_213996_a(map, Blocks.field_180391_bp, 300); -- func_213996_a(map, Blocks.field_180386_br, 300); -- func_213996_a(map, Blocks.field_180385_bs, 300); -- func_213996_a(map, Blocks.field_180387_bt, 300); -+ func_213992_a(map, net.minecraftforge.common.Tags.Items.FENCES_WOODEN, 300); -+ func_213992_a(map, net.minecraftforge.common.Tags.Items.FENCE_GATES_WOODEN, 300); - func_213996_a(map, Blocks.field_196586_al, 300); - func_213996_a(map, Blocks.field_150342_X, 300); - func_213996_a(map, Blocks.field_222428_lQ, 300); -@@ -184,13 +175,13 @@ +@@ -184,13 +185,13 @@ return this.field_214018_j > 0; } @@ -47,7 +26,7 @@ this.field_214019_k = this.func_213997_a(this.field_214012_a.get(1)); CompoundNBT compoundnbt = p_230337_2_.func_74775_l("RecipesUsed"); -@@ -202,9 +193,9 @@ +@@ -202,9 +203,9 @@ public CompoundNBT func_189515_b(CompoundNBT p_189515_1_) { super.func_189515_b(p_189515_1_); @@ -60,7 +39,7 @@ ItemStackHelper.func_191282_a(p_189515_1_, this.field_214012_a); CompoundNBT compoundnbt = new CompoundNBT(); this.field_214022_n.forEach((p_235643_1_, p_235643_2_) -> { -@@ -230,12 +221,14 @@ +@@ -230,12 +231,14 @@ this.field_214019_k = this.field_214018_j; if (this.func_214006_r()) { flag1 = true; @@ -77,7 +56,7 @@ } } } -@@ -279,10 +272,10 @@ +@@ -279,10 +282,10 @@ return true; } else if (!itemstack1.func_77969_a(itemstack)) { return false; @@ -90,7 +69,7 @@ } } } else { -@@ -298,7 +291,7 @@ +@@ -298,7 +301,7 @@ if (itemstack2.func_190926_b()) { this.field_214012_a.set(2, itemstack1.func_77946_l()); } else if (itemstack2.func_77973_b() == itemstack1.func_77973_b()) { @@ -99,7 +78,7 @@ } if (!this.field_145850_b.field_72995_K) { -@@ -318,7 +311,7 @@ +@@ -318,7 +321,7 @@ return 0; } else { Item item = p_213997_1_.func_77973_b(); @@ -108,7 +87,7 @@ } } -@@ -327,7 +320,7 @@ +@@ -327,7 +330,7 @@ } public static boolean func_213991_b(ItemStack p_213991_0_) { @@ -117,7 +96,7 @@ } public int[] func_180463_a(Direction p_180463_1_) { -@@ -474,4 +467,27 @@ +@@ -474,4 +477,27 @@ } } diff --git a/patches/minecraft/net/minecraft/tileentity/PistonTileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/PistonTileEntity.java.patch index 5dd8af426..2608bda63 100644 --- a/patches/minecraft/net/minecraft/tileentity/PistonTileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/PistonTileEntity.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/tileentity/PistonTileEntity.java +++ b/net/minecraft/tileentity/PistonTileEntity.java -@@ -107,7 +107,7 @@ +@@ -108,7 +108,7 @@ List list = this.field_145850_b.func_72839_b((Entity)null, AabbHelper.func_227019_a_(axisalignedbb, direction, d0).func_111270_a(axisalignedbb)); if (!list.isEmpty()) { List list1 = voxelshape.func_197756_d(); - boolean flag = this.field_200231_a.func_203425_a(Blocks.field_180399_cE); + boolean flag = this.field_200231_a.isSlimeBlock(); //TODO: is this patch really needed the logic of the original seems sound revisit later + Iterator iterator = list.iterator(); - for(Entity entity : list) { - if (entity.func_184192_z() != PushReaction.IGNORE) { + while(true) { diff --git a/patches/minecraft/net/minecraft/util/RegistryKey.java.patch b/patches/minecraft/net/minecraft/util/RegistryKey.java.patch index b0533dc38..2138df2b9 100644 --- a/patches/minecraft/net/minecraft/util/RegistryKey.java.patch +++ b/patches/minecraft/net/minecraft/util/RegistryKey.java.patch @@ -9,7 +9,7 @@ private static final Map> field_240898_a_ = Collections.synchronizedMap(Maps.newIdentityHashMap()); private final ResourceLocation field_240899_b_; private final ResourceLocation field_240900_c_; -@@ -44,4 +44,15 @@ +@@ -48,4 +48,15 @@ return func_240903_a_(p_240902_0_, p_240907_1_); }; } diff --git a/patches/minecraft/net/minecraft/util/registry/Bootstrap.java.patch b/patches/minecraft/net/minecraft/util/registry/Bootstrap.java.patch index 17dfc6f80..7751a1f43 100644 --- a/patches/minecraft/net/minecraft/util/registry/Bootstrap.java.patch +++ b/patches/minecraft/net/minecraft/util/registry/Bootstrap.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/util/registry/Bootstrap.java +++ b/net/minecraft/util/registry/Bootstrap.java @@ -46,6 +46,7 @@ + PotionBrewing.func_185207_a(); EntityOptions.func_197445_a(); IDispenseItemBehavior.func_218401_c(); - ArgumentTypes.func_197483_a(); + if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context + ArgumentTypes.func_197483_a(); + TagRegistryManager.func_242197_b(); func_179868_d(); - } - } -@@ -101,7 +102,6 @@ - }); +@@ -103,7 +104,6 @@ + Commands.func_242986_b(); } - GlobalEntityTypeAttributes.func_233834_a_(); diff --git a/patches/minecraft/net/minecraft/util/registry/Registry.java.patch b/patches/minecraft/net/minecraft/util/registry/Registry.java.patch index 0ad83a19c..02f1ab35d 100644 --- a/patches/minecraft/net/minecraft/util/registry/Registry.java.patch +++ b/patches/minecraft/net/minecraft/util/registry/Registry.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/util/registry/Registry.java +++ b/net/minecraft/util/registry/Registry.java -@@ -85,6 +85,10 @@ +@@ -94,6 +94,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -11,180 +11,202 @@ public abstract class Registry implements Codec, Keyable, IObjectIntIterable { protected static final Logger field_212616_e = LogManager.getLogger(); private static final Map> field_218376_a = Maps.newLinkedHashMap(); -@@ -141,64 +145,64 @@ +@@ -133,43 +137,43 @@ public static final RegistryKey> field_239698_ad_ = func_239741_a_("dimension_type"); public static final RegistryKey> field_239699_ae_ = func_239741_a_("dimension"); public static final RegistryKey> field_239700_af_ = func_239741_a_("dimension"); - public static final Registry field_212633_v = func_239746_a_(field_239708_i_, () -> { -+ @Deprecated public static final Registry field_212633_v = forge(field_239708_i_, SoundEvent.class, () -> { ++ @Deprecated public static final Registry field_212633_v = forge(field_239708_i_, () -> { return SoundEvents.field_187638_cR; }); - public static final DefaultedRegistry field_212619_h = func_239745_a_(field_239709_j_, "empty", () -> { -+ @Deprecated public static final DefaultedRegistry field_212619_h = forgeDefaulted(field_239709_j_, Fluid.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_212619_h = forge(field_239709_j_, "empty", () -> { return Fluids.field_204541_a; }); - public static final Registry field_212631_t = func_239746_a_(field_239710_k_, () -> { -+ @Deprecated public static final Registry field_212631_t = forge(field_239710_k_, Effect.class, () -> { ++ @Deprecated public static final Registry field_212631_t = forge(field_239710_k_, () -> { return Effects.field_188425_z; }); - public static final DefaultedRegistry field_212618_g = func_239745_a_(field_239711_l_, "air", () -> { -+ @Deprecated public static final DefaultedRegistry field_212618_g = forgeDefaulted(field_239711_l_, Block.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_212618_g = forge(field_239711_l_, "air", () -> { return Blocks.field_150350_a; }); - public static final Registry field_212628_q = func_239746_a_(field_239712_m_, () -> { -+ @Deprecated public static final Registry field_212628_q = forge(field_239712_m_, Enchantment.class, () -> { ++ @Deprecated public static final Registry field_212628_q = forge(field_239712_m_, () -> { return Enchantments.field_185308_t; }); - public static final DefaultedRegistry> field_212629_r = func_239745_a_(field_239713_n_, "pig", () -> { -+ @Deprecated public static final DefaultedRegistry> field_212629_r = forgeDefaulted(field_239713_n_, EntityType.class, () -> { ++ @Deprecated public static final DefaultedRegistry> field_212629_r = forge(field_239713_n_, "pig", () -> { return EntityType.field_200784_X; }); - public static final DefaultedRegistry field_212630_s = func_239745_a_(field_239714_o_, "air", () -> { -+ @Deprecated public static final DefaultedRegistry field_212630_s = forgeDefaulted(field_239714_o_, Item.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_212630_s = forge(field_239714_o_, "air", () -> { return Items.field_190931_a; }); - public static final DefaultedRegistry field_212621_j = func_239745_a_(field_239715_p_, "empty", () -> { -+ @Deprecated public static final DefaultedRegistry field_212621_j = forgeDefaulted(field_239715_p_, Potion.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_212621_j = forge(field_239715_p_, "empty", () -> { return Potions.field_185229_a; }); -- public static final Registry> field_218377_o = func_239746_a_(field_239716_q_, () -> { -+ @Deprecated public static final Registry> field_218377_o = forge(field_239716_q_, WorldCarver.class, () -> { - return WorldCarver.field_222709_a; - }); -- public static final Registry> field_218378_p = func_239746_a_(field_239717_r_, () -> { -+ @Deprecated public static final Registry> field_218378_p = forge(field_239717_r_, SurfaceBuilder.class, () -> { - return SurfaceBuilder.field_215396_G; - }); -- public static final Registry> field_218379_q = func_239746_a_(field_239718_s_, () -> { -+ @Deprecated public static final Registry> field_218379_q = forge(field_239718_s_, Feature.class, () -> { - return Feature.field_202290_aj; - }); -- public static final Registry> field_218380_r = func_239746_a_(field_239719_t_, () -> { -+ @Deprecated public static final Registry> field_218380_r = forge(field_239719_t_, Placement.class, () -> { - return Placement.field_215022_h; - }); -- public static final Registry field_212624_m = func_239746_a_(field_239720_u_, () -> { -+ @Deprecated public static final Registry field_212624_m = forge(field_239720_u_, Biome.class, () -> { - return Biomes.field_180279_ad; - }); -- public static final Registry> field_229387_t_ = func_239746_a_(field_239721_v_, () -> { -+ @Deprecated public static final Registry> field_229387_t_ = forge(field_239721_v_, BlockStateProviderType.class, () -> { - return BlockStateProviderType.field_227394_a_; - }); -- public static final Registry> field_229388_u_ = func_239746_a_(field_239722_w_, () -> { -+ @Deprecated public static final Registry> field_229388_u_ = forge(field_239722_w_, BlockPlacerType.class, () -> { - return BlockPlacerType.field_227259_a_; - }); -- public static final Registry> field_229389_v_ = func_239746_a_(field_239723_x_, () -> { -+ @Deprecated public static final Registry> field_229389_v_ = forge(field_239723_x_, FoliagePlacerType.class, () -> { - return FoliagePlacerType.field_227386_a_; - }); - public static final Registry> field_239701_aw_ = func_239746_a_(field_239724_y_, () -> { - return TrunkPlacerType.field_236920_a_; - }); -- public static final Registry> field_229390_w_ = func_239746_a_(field_239725_z_, () -> { -+ @Deprecated public static final Registry> field_229390_w_ = forge(field_239725_z_, TreeDecoratorType.class, () -> { - return TreeDecoratorType.field_227426_b_; - }); - public static final Registry> field_239702_ay_ = func_239746_a_(field_239663_A_, () -> { - return FeatureSizeType.field_236711_a_; - }); - public static final Registry> field_212632_u = func_239746_a_(field_239664_B_, () -> { -+ @Deprecated public static final Registry> field_212632_u = forge(field_239664_B_, ParticleType.class, () -> { ++ @Deprecated public static final Registry> field_212632_u = forge(field_239664_B_, () -> { return ParticleTypes.field_197611_d; }); - public static final Registry> field_239689_aA_ = func_239742_a_(field_239665_C_, Lifecycle.stable(), () -> { -@@ -207,19 +211,19 @@ - public static final Registry> field_239690_aB_ = func_239742_a_(field_239666_D_, Lifecycle.stable(), () -> { - return ChunkGenerator.field_235948_a_; - }); - public static final Registry> field_212626_o = func_239746_a_(field_239667_E_, () -> { -+ @Deprecated public static final Registry> field_212626_o = forge(field_239667_E_, TileEntityType.class, () -> { ++ @Deprecated public static final Registry> field_212626_o = forge(field_239667_E_, () -> { return TileEntityType.field_200971_b; }); - public static final DefaultedRegistry field_212620_i = func_239745_a_(field_239668_F_, "kebab", () -> { -+ @Deprecated public static final DefaultedRegistry field_212620_i = forgeDefaulted(field_239668_F_, PaintingType.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_212620_i = forge(field_239668_F_, "kebab", () -> { return PaintingType.field_200843_b; }); public static final Registry field_212623_l = func_239746_a_(field_239669_G_, () -> { return Stats.field_75953_u; }); - public static final DefaultedRegistry field_218360_A = func_239745_a_(field_239670_H_, "empty", () -> { -+ @Deprecated public static final DefaultedRegistry field_218360_A = forgeDefaulted(field_239670_H_, ChunkStatus.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_218360_A = forge(field_239670_H_, "empty", () -> { return ChunkStatus.field_223226_a_; }); -- public static final Registry> field_218361_B = func_239746_a_(field_239671_I_, () -> { -+ @Deprecated public static final Registry> field_218361_B = forge(field_239671_I_, Structure.class, () -> { - return Structure.field_236367_c_; - }); - public static final Registry field_218362_C = func_239746_a_(field_239672_J_, () -> { -@@ -237,40 +241,40 @@ - public static final Registry> field_218365_F = func_239746_a_(field_239676_N_, () -> { - return IJigsawDeserializer.field_214931_e; + public static final Registry> field_218363_D = func_239746_a_(field_239673_K_, () -> { +@@ -178,40 +182,40 @@ + public static final Registry> field_239691_aJ_ = func_239746_a_(field_239674_L_, () -> { + return IPosRuleTests.field_237103_a_; }); - public static final Registry> field_218366_G = func_239746_a_(field_239677_O_, () -> { -+ @Deprecated public static final Registry> field_218366_G = forge(field_239677_O_, ContainerType.class, () -> { ++ @Deprecated public static final Registry> field_218366_G = forge(field_239677_O_, () -> { return ContainerType.field_221514_h; }); public static final Registry> field_218367_H = func_239746_a_(field_239678_P_, () -> { return IRecipeType.field_222149_a; }); - public static final Registry> field_218368_I = func_239746_a_(field_239679_Q_, () -> { -+ @Deprecated public static final Registry> field_218368_I = forge(field_239679_Q_, IRecipeSerializer.class, () -> { ++ @Deprecated public static final Registry> field_218368_I = forge(field_239679_Q_, () -> { return IRecipeSerializer.field_222158_b; }); - public static final Registry field_239692_aP_ = func_239746_a_(field_239680_R_, () -> { -+ @Deprecated public static final Registry field_239692_aP_ = forge(field_239680_R_, Attribute.class, () -> { ++ @Deprecated public static final Registry field_239692_aP_ = forge(field_239680_R_, () -> { return Attributes.field_233828_k_; }); - public static final Registry> field_212634_w = func_239746_a_(field_239681_S_, () -> { -+ @Deprecated public static final Registry> field_212634_w = forge(field_239681_S_, StatType.class, () -> { ++ @Deprecated public static final Registry> field_212634_w = forge(field_239681_S_, () -> { return Stats.field_75929_E; }); - public static final DefaultedRegistry field_218369_K = func_239745_a_(field_239682_T_, "plains", () -> { - return IVillagerType.field_221175_c; + public static final DefaultedRegistry field_218369_K = func_239745_a_(field_239682_T_, "plains", () -> { + return VillagerType.field_221175_c; }); - public static final DefaultedRegistry field_218370_L = func_239745_a_(field_239683_U_, "none", () -> { -+ @Deprecated public static final DefaultedRegistry field_218370_L = forgeDefaulted(field_239683_U_, VillagerProfession.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_218370_L = forge(field_239683_U_, "none", () -> { return VillagerProfession.field_221151_a; }); - public static final DefaultedRegistry field_218371_M = func_239745_a_(field_239684_V_, "unemployed", () -> { -+ @Deprecated public static final DefaultedRegistry field_218371_M = forgeDefaulted(field_239684_V_, PointOfInterestType.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_218371_M = forge(field_239684_V_, "unemployed", () -> { return PointOfInterestType.field_221054_b; }); - public static final DefaultedRegistry> field_218372_N = func_239745_a_(field_239685_W_, "dummy", () -> { -+ @Deprecated public static final DefaultedRegistry> field_218372_N = forgeDefaulted(field_239685_W_, MemoryModuleType.class, () -> { ++ @Deprecated public static final DefaultedRegistry> field_218372_N = forge(field_239685_W_, "dummy", () -> { return MemoryModuleType.field_220940_a; }); - public static final DefaultedRegistry> field_218373_O = func_239745_a_(field_239686_X_, "dummy", () -> { -+ @Deprecated public static final DefaultedRegistry> field_218373_O = forgeDefaulted(field_239686_X_, SensorType.class, () -> { ++ @Deprecated public static final DefaultedRegistry> field_218373_O = forge(field_239686_X_, "dummy", () -> { return SensorType.field_220997_a; }); - public static final Registry field_218374_P = func_239746_a_(field_239687_Y_, () -> { -+ @Deprecated public static final Registry field_218374_P = forge(field_239687_Y_, Schedule.class, () -> { ++ @Deprecated public static final Registry field_218374_P = forge(field_239687_Y_, () -> { return Schedule.field_221383_a; }); - public static final Registry field_218375_Q = func_239746_a_(field_239688_Z_, () -> { -+ @Deprecated public static final Registry field_218375_Q = forge(field_239688_Z_, Activity.class, () -> { ++ @Deprecated public static final Registry field_218375_Q = forge(field_239688_Z_, () -> { return Activity.field_221366_b; }); public static final Registry field_239693_aY_ = func_239746_a_(field_239695_aa_, () -> { -@@ -407,6 +411,18 @@ - return ((MutableRegistry)p_218343_0_).func_218382_a(p_218343_1_, RegistryKey.func_240903_a_(p_218343_0_.field_239703_b_, new ResourceLocation(p_218343_2_)), p_218343_3_); +@@ -232,19 +236,19 @@ + public static final RegistryKey> field_243555_ax = func_239741_a_("worldgen/template_pool"); + public static final RegistryKey> field_239720_u_ = func_239741_a_("worldgen/biome"); + public static final RegistryKey>> field_239717_r_ = func_239741_a_("worldgen/surface_builder"); +- public static final Registry> field_218378_p = func_239746_a_(field_239717_r_, () -> { ++ @Deprecated public static final Registry> field_218378_p = forge(field_239717_r_, () -> { + return SurfaceBuilder.field_215396_G; + }); + public static final RegistryKey>> field_239716_q_ = func_239741_a_("worldgen/carver"); +- public static final Registry> field_218377_o = func_239746_a_(field_239716_q_, () -> { ++ @Deprecated public static final Registry> field_218377_o = forge(field_239716_q_, () -> { + return WorldCarver.field_222709_a; + }); + public static final RegistryKey>> field_239718_s_ = func_239741_a_("worldgen/feature"); +- public static final Registry> field_218379_q = func_239746_a_(field_239718_s_, () -> { ++ @Deprecated public static final Registry> field_218379_q = forge(field_239718_s_, () -> { + return Feature.field_202290_aj; + }); + public static final RegistryKey>> field_239671_I_ = func_239741_a_("worldgen/structure_feature"); +- public static final Registry> field_218361_B = func_239746_a_(field_239671_I_, () -> { ++ @Deprecated public static final Registry> field_218361_B = forge(field_239671_I_, () -> { + return Structure.field_236367_c_; + }); + public static final RegistryKey> field_239672_J_ = func_239741_a_("worldgen/structure_piece"); +@@ -252,7 +256,7 @@ + return IStructurePieceType.field_214782_c; + }); + public static final RegistryKey>> field_239719_t_ = func_239741_a_("worldgen/decorator"); +- public static final Registry> field_218380_r = func_239746_a_(field_239719_t_, () -> { ++ @Deprecated public static final Registry> field_218380_r = forge(field_239719_t_, () -> { + return Placement.field_215022_h; + }); + public static final RegistryKey>> field_239721_v_ = func_239741_a_("worldgen/block_state_provider_type"); +@@ -265,19 +269,19 @@ + public static final RegistryKey>> field_239666_D_ = func_239741_a_("worldgen/chunk_generator"); + public static final RegistryKey>> field_239675_M_ = func_239741_a_("worldgen/structure_processor"); + public static final RegistryKey>> field_239676_N_ = func_239741_a_("worldgen/structure_pool_element"); +- public static final Registry> field_229387_t_ = func_239746_a_(field_239721_v_, () -> { ++ @Deprecated public static final Registry> field_229387_t_ = forge(field_239721_v_, () -> { + return BlockStateProviderType.field_227394_a_; + }); +- public static final Registry> field_229388_u_ = func_239746_a_(field_239722_w_, () -> { ++ @Deprecated public static final Registry> field_229388_u_ = forge(field_239722_w_, () -> { + return BlockPlacerType.field_227259_a_; + }); +- public static final Registry> field_229389_v_ = func_239746_a_(field_239723_x_, () -> { ++ @Deprecated public static final Registry> field_229389_v_ = forge(field_239723_x_, () -> { + return FoliagePlacerType.field_227386_a_; + }); + public static final Registry> field_239701_aw_ = func_239746_a_(field_239724_y_, () -> { + return TrunkPlacerType.field_236920_a_; + }); +- public static final Registry> field_229390_w_ = func_239746_a_(field_239725_z_, () -> { ++ @Deprecated public static final Registry> field_229390_w_ = forge(field_239725_z_, () -> { + return TreeDecoratorType.field_227426_b_; + }); + public static final Registry> field_239702_ay_ = func_239746_a_(field_239663_A_, () -> { +@@ -323,18 +327,34 @@ + return func_239742_a_(p_239746_0_, Lifecycle.experimental(), p_239746_1_); } -+ private static > Registry forge(RegistryKey> key, Class cls, Supplier def) { -+ return func_239743_a_(key, net.minecraftforge.registries.GameData.getWrapper(cls), def); ++ private static > Registry forge(RegistryKey> key, Supplier def) { ++ return forge(key, Lifecycle.experimental(), def); + } + -+ private static > DefaultedRegistry forgeDefaulted(RegistryKey> key, Class cls, Supplier def) { -+ return Registry.func_239743_a_(key, net.minecraftforge.registries.GameData.getWrapperDefaulted(cls), def); + private static DefaultedRegistry func_239745_a_(RegistryKey> p_239745_0_, String p_239745_1_, Supplier p_239745_2_) { + return func_239744_a_(p_239745_0_, p_239745_1_, Lifecycle.experimental(), p_239745_2_); + } + ++ private static > DefaultedRegistry forge(RegistryKey> key, String defKey, Supplier def) { ++ return forge(key, defKey, Lifecycle.experimental(), def); + } + -+ public final RegistryKey> getRegistryKey() { -+ return field_239703_b_; + private static Registry func_239742_a_(RegistryKey> p_239742_0_, Lifecycle p_239742_1_, Supplier p_239742_2_) { + return func_239743_a_(p_239742_0_, new SimpleRegistry<>(p_239742_0_, p_239742_1_), p_239742_2_, p_239742_1_); + } + ++ private static > Registry forge(RegistryKey> key, Lifecycle cycle, Supplier def) { ++ return func_239743_a_(key, net.minecraftforge.registries.GameData.getWrapper(key, cycle), def, cycle); + } + - static { - field_218376_a.forEach((p_239747_0_, p_239747_1_) -> { - if (p_239747_1_.get() == null) { + private static DefaultedRegistry func_239744_a_(RegistryKey> p_239744_0_, String p_239744_1_, Lifecycle p_239744_2_, Supplier p_239744_3_) { + return func_239743_a_(p_239744_0_, new DefaultedRegistry<>(p_239744_1_, p_239744_0_, p_239744_2_), p_239744_3_, p_239744_2_); + } + ++ private static > DefaultedRegistry forge(RegistryKey> key, String defKey, Lifecycle cycle, Supplier def) { ++ return func_239743_a_(key, net.minecraftforge.registries.GameData.getWrapper(key, cycle, defKey), def, cycle); ++ } ++ + private static > R func_239743_a_(RegistryKey> p_239743_0_, R p_239743_1_, Supplier p_239743_2_, Lifecycle p_239743_3_) { + ResourceLocation resourcelocation = p_239743_0_.func_240901_a_(); + field_218376_a.put(resourcelocation, p_239743_2_); diff --git a/patches/minecraft/net/minecraft/util/text/LanguageMap.java.patch b/patches/minecraft/net/minecraft/util/text/LanguageMap.java.patch index 9cd762e9e..7c6fc2fe3 100644 --- a/patches/minecraft/net/minecraft/util/text/LanguageMap.java.patch +++ b/patches/minecraft/net/minecraft/util/text/LanguageMap.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/util/text/LanguageMap.java +++ b/net/minecraft/util/text/LanguageMap.java -@@ -36,7 +36,8 @@ +@@ -40,7 +40,8 @@ field_201045_a.error("Couldn't read strings from /assets/minecraft/lang/en_us.json", (Throwable)ioexception); } @@ -10,9 +10,9 @@ return new LanguageMap() { public String func_230503_a_(String p_230503_1_) { return map.getOrDefault(p_230503_1_, p_230503_1_); -@@ -54,6 +55,11 @@ - public String func_230504_a_(String p_230504_1_, boolean p_230504_2_) { - return p_230504_1_; +@@ -63,6 +64,11 @@ + }, Style.field_240709_b_).isPresent(); + }; } + + @Override @@ -22,11 +22,13 @@ }; } -@@ -84,4 +90,7 @@ - public abstract boolean func_230505_b_(); - - public abstract String func_230504_a_(String p_230504_1_, boolean p_230504_2_); +@@ -84,6 +90,9 @@ + public static void func_240594_a_(LanguageMap p_240594_0_) { + field_240592_d_ = p_240594_0_; + } + + // FORGE START + public Map getLanguageData() { return ImmutableMap.of(); } - } + + public abstract String func_230503_a_(String p_230503_1_); + diff --git a/patches/minecraft/net/minecraft/util/text/Style.java.patch b/patches/minecraft/net/minecraft/util/text/Style.java.patch index ba653d3a3..7f82d11d3 100644 --- a/patches/minecraft/net/minecraft/util/text/Style.java.patch +++ b/patches/minecraft/net/minecraft/util/text/Style.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/util/text/Style.java +++ b/net/minecraft/util/text/Style.java -@@ -118,6 +118,18 @@ - return new Style(this.field_150247_b, this.field_150248_c, p_240722_1_, this.field_150246_e, this.field_150243_f, this.field_150244_g, this.field_150251_h, this.field_150252_i, this.field_179990_j, this.field_240710_l_); +@@ -125,6 +125,18 @@ + return new Style(this.field_150247_b, this.field_150248_c, this.field_150245_d, p_244282_1_, this.field_150243_f, this.field_150244_g, this.field_150251_h, this.field_150252_i, this.field_179990_j, this.field_240710_l_); } + public Style setUnderlined(@Nullable Boolean underlined) { diff --git a/patches/minecraft/net/minecraft/village/VillageSiege.java.patch b/patches/minecraft/net/minecraft/village/VillageSiege.java.patch index c360419a0..29a8ed0ed 100644 --- a/patches/minecraft/net/minecraft/village/VillageSiege.java.patch +++ b/patches/minecraft/net/minecraft/village/VillageSiege.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/village/VillageSiege.java +++ b/net/minecraft/village/VillageSiege.java -@@ -75,7 +75,9 @@ +@@ -78,7 +78,9 @@ this.field_75532_g = blockpos.func_177958_n() + MathHelper.func_76141_d(MathHelper.func_76134_b(f) * 32.0F); this.field_75538_h = blockpos.func_177956_o(); this.field_75539_i = blockpos.func_177952_p() + MathHelper.func_76141_d(MathHelper.func_76126_a(f) * 32.0F); @@ -11,7 +11,7 @@ this.field_75534_e = 0; this.field_75533_d = 20; break; -@@ -95,7 +97,7 @@ +@@ -98,7 +100,7 @@ if (vector3d != null) { ZombieEntity zombieentity; try { @@ -19,4 +19,4 @@ + zombieentity = EntityType.field_200725_aD.func_200721_a(p_75530_1_); //Forge: Direct Initialization is deprecated, use EntityType. zombieentity.func_213386_a(p_75530_1_, p_75530_1_.func_175649_E(zombieentity.func_233580_cy_()), SpawnReason.EVENT, (ILivingEntityData)null, (CompoundNBT)null); } catch (Exception exception) { - exception.printStackTrace(); + field_242320_a.warn("Failed to create zombie for village siege at {}", vector3d, exception); diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index 1983440a1..bb7d56077 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/world/Explosion.java +++ b/net/minecraft/world/Explosion.java -@@ -57,6 +57,7 @@ - private final IExplosionContext field_234893_k_; +@@ -58,6 +58,7 @@ + private final ExplosionContext field_234893_k_; private final List field_77281_g = Lists.newArrayList(); private final Map field_77288_k = Maps.newHashMap(); + private final Vector3d position; @OnlyIn(Dist.CLIENT) public Explosion(World p_i45752_1_, @Nullable Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) { -@@ -85,6 +86,7 @@ +@@ -86,6 +87,7 @@ this.field_222260_b = p_i231610_13_; this.field_199593_j = p_i231610_3_ == null ? DamageSource.func_94539_a(this) : p_i231610_3_; this.field_234893_k_ = p_i231610_4_ == null ? this.func_234894_a_(p_i231610_2_) : p_i231610_4_; + this.position = new Vector3d(this.field_77284_b, this.field_77285_c, this.field_77282_d); } - private IExplosionContext func_234894_a_(@Nullable Entity p_234894_1_) { -@@ -175,6 +177,7 @@ + private ExplosionContext func_234894_a_(@Nullable Entity p_234894_1_) { +@@ -176,6 +178,7 @@ int j2 = MathHelper.func_76128_c(this.field_77282_d - (double)f2 - 1.0D); int j1 = MathHelper.func_76128_c(this.field_77282_d + (double)f2 + 1.0D); List list = this.field_77287_j.func_72839_b(this.field_77283_e, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); @@ -24,7 +24,7 @@ Vector3d vector3d = new Vector3d(this.field_77284_b, this.field_77285_c, this.field_77282_d); for(int k2 = 0; k2 < list.size(); ++k2) { -@@ -233,11 +236,11 @@ +@@ -234,11 +237,11 @@ for(BlockPos blockpos : this.field_77281_g) { BlockState blockstate = this.field_77287_j.func_180495_p(blockpos); Block block = blockstate.func_177230_c(); @@ -36,10 +36,10 @@ - TileEntity tileentity = block.func_235695_q_() ? this.field_77287_j.func_175625_s(blockpos) : null; + if (blockstate.canDropFromExplosion(this.field_77287_j, blockpos, this) && this.field_77287_j instanceof ServerWorld) { + TileEntity tileentity = blockstate.hasTileEntity() ? this.field_77287_j.func_175625_s(blockpos) : null; - LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_77287_j)).func_216023_a(this.field_77287_j.field_73012_v).func_216015_a(LootParameters.field_216286_f, blockpos).func_216015_a(LootParameters.field_216289_i, ItemStack.field_190927_a).func_216021_b(LootParameters.field_216288_h, tileentity).func_216021_b(LootParameters.field_216281_a, this.field_77283_e); + LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_77287_j)).func_216023_a(this.field_77287_j.field_73012_v).func_216015_a(LootParameters.field_237457_g_, Vector3d.func_237489_a_(blockpos)).func_216015_a(LootParameters.field_216289_i, ItemStack.field_190927_a).func_216021_b(LootParameters.field_216288_h, tileentity).func_216021_b(LootParameters.field_216281_a, this.field_77283_e); if (this.field_222260_b == Explosion.Mode.DESTROY) { lootcontext$builder.func_216015_a(LootParameters.field_216290_j, this.field_77280_f); -@@ -248,8 +251,7 @@ +@@ -249,8 +252,7 @@ }); } @@ -49,7 +49,7 @@ this.field_77287_j.func_217381_Z().func_76319_b(); } } -@@ -323,6 +325,15 @@ +@@ -324,6 +326,15 @@ return this.field_77281_g; } diff --git a/patches/minecraft/net/minecraft/world/DefaultExplosionContext.java.patch b/patches/minecraft/net/minecraft/world/ExplosionContext.java.patch similarity index 84% rename from patches/minecraft/net/minecraft/world/DefaultExplosionContext.java.patch rename to patches/minecraft/net/minecraft/world/ExplosionContext.java.patch index 0b2fd64db..e98e3c763 100644 --- a/patches/minecraft/net/minecraft/world/DefaultExplosionContext.java.patch +++ b/patches/minecraft/net/minecraft/world/ExplosionContext.java.patch @@ -1,8 +1,8 @@ ---- a/net/minecraft/world/DefaultExplosionContext.java -+++ b/net/minecraft/world/DefaultExplosionContext.java -@@ -9,7 +9,7 @@ - INSTANCE; +--- a/net/minecraft/world/ExplosionContext.java ++++ b/net/minecraft/world/ExplosionContext.java +@@ -7,7 +7,7 @@ + public class ExplosionContext { public Optional func_230312_a_(Explosion p_230312_1_, IBlockReader p_230312_2_, BlockPos p_230312_3_, BlockState p_230312_4_, FluidState p_230312_5_) { - return p_230312_4_.func_196958_f() && p_230312_5_.func_206888_e() ? Optional.empty() : Optional.of(Math.max(p_230312_4_.func_177230_c().func_149638_a(), p_230312_5_.func_210200_l())); + return p_230312_4_.isAir(p_230312_2_, p_230312_3_) && p_230312_5_.func_206888_e() ? Optional.empty() : Optional.of(Math.max(p_230312_4_.getExplosionResistance(p_230312_2_, p_230312_3_, p_230312_1_), p_230312_5_.getExplosionResistance(p_230312_2_, p_230312_3_, p_230312_1_))); diff --git a/patches/minecraft/net/minecraft/world/IBlockReader.java.patch b/patches/minecraft/net/minecraft/world/IBlockReader.java.patch index eac97204e..6ed7f80b4 100644 --- a/patches/minecraft/net/minecraft/world/IBlockReader.java.patch +++ b/patches/minecraft/net/minecraft/world/IBlockReader.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/IBlockReader.java +++ b/net/minecraft/world/IBlockReader.java -@@ -25,7 +25,7 @@ +@@ -26,7 +26,7 @@ FluidState func_204610_c(BlockPos p_204610_1_); default int func_217298_h(BlockPos p_217298_1_) { diff --git a/patches/minecraft/net/minecraft/world/Teleporter.java.patch b/patches/minecraft/net/minecraft/world/Teleporter.java.patch index 56fdd3c84..92bb108f9 100644 --- a/patches/minecraft/net/minecraft/world/Teleporter.java.patch +++ b/patches/minecraft/net/minecraft/world/Teleporter.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/Teleporter.java +++ b/net/minecraft/world/Teleporter.java -@@ -23,7 +23,7 @@ +@@ -19,7 +19,7 @@ import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.TicketType; -public class Teleporter { +public class Teleporter implements net.minecraftforge.common.util.ITeleporter { protected final ServerWorld field_85192_a; - protected final Random field_77187_a; + public Teleporter(ServerWorld p_i1963_1_) { diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 337a8d938..bd5e14ea6 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/World.java +++ b/net/minecraft/world/World.java -@@ -65,7 +65,7 @@ +@@ -63,7 +63,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ protected static final Logger field_195596_d = LogManager.getLogger(); public static final Codec> field_234917_f_ = ResourceLocation.field_240908_a_.xmap(RegistryKey.func_240902_a_(Registry.field_239699_ae_), RegistryKey::func_240901_a_); public static final RegistryKey field_234918_g_ = RegistryKey.func_240903_a_(Registry.field_239699_ae_, new ResourceLocation("overworld")); -@@ -75,7 +75,7 @@ +@@ -73,7 +73,7 @@ public final List field_147482_g = Lists.newArrayList(); public final List field_175730_i = Lists.newArrayList(); protected final List field_147484_a = Lists.newArrayList(); @@ -18,20 +18,20 @@ private final Thread field_217407_c; private final boolean field_234916_c_; private int field_73008_k; -@@ -95,8 +95,12 @@ +@@ -92,8 +92,12 @@ + private final WorldBorder field_175728_M; private final BiomeManager field_226689_w_; private final RegistryKey field_73011_w; - private final RegistryKey field_234915_C_; + public boolean restoringBlockSnapshots = false; + public boolean captureBlockSnapshots = false; + public java.util.ArrayList capturedBlockSnapshots = new java.util.ArrayList<>(); - protected World(ISpawnWorldInfo p_i231617_1_, RegistryKey p_i231617_2_, RegistryKey p_i231617_3_, DimensionType p_i231617_4_, Supplier p_i231617_5_, boolean p_i231617_6_, boolean p_i231617_7_, long p_i231617_8_) { + protected World(ISpawnWorldInfo p_i241925_1_, RegistryKey p_i241925_2_, final DimensionType p_i241925_3_, Supplier p_i241925_4_, boolean p_i241925_5_, boolean p_i241925_6_, long p_i241925_7_) { + super(World.class); - this.field_72984_F = p_i231617_5_; - this.field_72986_A = p_i231617_1_; - this.field_234921_x_ = p_i231617_4_; -@@ -222,17 +226,45 @@ + this.field_72984_F = p_i241925_4_; + this.field_72986_A = p_i241925_1_; + this.field_234921_x_ = p_i241925_3_; +@@ -180,17 +184,45 @@ } else { Chunk chunk = this.func_175726_f(p_241211_1_); Block block = p_241211_2_.func_177230_c(); @@ -39,7 +39,7 @@ + p_241211_1_ = p_241211_1_.func_185334_h(); // Forge - prevent mutable BlockPos leaks + net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; + if (this.captureBlockSnapshots && !this.field_72995_K) { -+ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.create(this, p_241211_1_, p_241211_3_); ++ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.create(this.field_73011_w, this, p_241211_1_, p_241211_3_); + this.capturedBlockSnapshots.add(blockSnapshot); + } + @@ -53,8 +53,8 @@ return false; } else { BlockState blockstate1 = this.func_180495_p(p_241211_1_); -- if (blockstate1 != blockstate && (blockstate1.func_200016_a(this, p_241211_1_) != blockstate.func_200016_a(this, p_241211_1_) || blockstate1.func_185906_d() != blockstate.func_185906_d() || blockstate1.func_215691_g() || blockstate.func_215691_g())) { -+ if (blockstate1 != blockstate && (blockstate1.func_200016_a(this, p_241211_1_) != oldOpacity || blockstate1.getLightValue(this, p_241211_1_) != oldLight || blockstate1.func_215691_g() || blockstate.func_215691_g())) { +- if ((p_241211_3_ & 128) == 0 && blockstate1 != blockstate && (blockstate1.func_200016_a(this, p_241211_1_) != blockstate.func_200016_a(this, p_241211_1_) || blockstate1.func_185906_d() != blockstate.func_185906_d() || blockstate1.func_215691_g() || blockstate.func_215691_g())) { ++ if ((p_241211_3_ & 128) == 0 && blockstate1 != blockstate && (blockstate1.func_200016_a(this, p_241211_1_) != oldOpacity || blockstate1.getLightValue(this, p_241211_1_) != oldLight || blockstate1.func_215691_g() || blockstate.func_215691_g())) { this.func_217381_Z().func_76320_a("queueCheckLight"); this.func_72863_F().func_212863_j_().func_215568_a(p_241211_1_); this.func_217381_Z().func_76319_b(); @@ -78,7 +78,7 @@ if (blockstate1 == p_241211_2_) { if (blockstate != blockstate1) { this.func_225319_b(p_241211_1_, blockstate, blockstate1); -@@ -258,8 +290,6 @@ +@@ -216,8 +248,6 @@ this.func_217393_a(p_241211_1_, blockstate, blockstate1); } @@ -87,7 +87,7 @@ } } } -@@ -274,7 +304,7 @@ +@@ -232,7 +262,7 @@ public boolean func_241212_a_(BlockPos p_241212_1_, boolean p_241212_2_, @Nullable Entity p_241212_3_, int p_241212_4_) { BlockState blockstate = this.func_180495_p(p_241212_1_); @@ -96,7 +96,7 @@ return false; } else { FluidState fluidstate = this.func_204610_c(p_241212_1_); -@@ -283,7 +313,7 @@ +@@ -241,7 +271,7 @@ } if (p_241212_2_) { @@ -105,7 +105,7 @@ Block.func_220054_a(blockstate, this, p_241212_1_, tileentity, p_241212_3_, ItemStack.field_190927_a); } -@@ -301,6 +331,8 @@ +@@ -259,6 +289,8 @@ } public void func_195593_d(BlockPos p_195593_1_, Block p_195593_2_) { @@ -114,7 +114,7 @@ this.func_190524_a(p_195593_1_.func_177976_e(), p_195593_2_, p_195593_1_); this.func_190524_a(p_195593_1_.func_177974_f(), p_195593_2_, p_195593_1_); this.func_190524_a(p_195593_1_.func_177977_b(), p_195593_2_, p_195593_1_); -@@ -310,6 +342,11 @@ +@@ -268,6 +300,11 @@ } public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, Direction p_175695_3_) { @@ -126,7 +126,7 @@ if (p_175695_3_ != Direction.WEST) { this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_); } -@@ -347,9 +384,9 @@ +@@ -305,9 +342,9 @@ CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated"); crashreportcategory.func_189529_a("Source block type", () -> { try { @@ -138,7 +138,7 @@ } }); CrashReportCategory.func_175750_a(crashreportcategory, p_190524_1_, blockstate); -@@ -433,10 +470,12 @@ +@@ -391,10 +428,12 @@ } public boolean func_175700_a(TileEntity p_175700_1_) { @@ -151,7 +151,7 @@ } boolean flag = this.field_147482_g.add(p_175700_1_); -@@ -444,6 +483,8 @@ +@@ -402,6 +441,8 @@ this.field_175730_i.add(p_175700_1_); } @@ -160,7 +160,7 @@ if (this.field_72995_K) { BlockPos blockpos = p_175700_1_.func_174877_v(); BlockState blockstate = this.func_180495_p(blockpos); -@@ -455,6 +496,7 @@ +@@ -413,6 +454,7 @@ public void func_147448_a(Collection p_147448_1_) { if (this.field_147481_N) { @@ -168,7 +168,7 @@ this.field_147484_a.addAll(p_147448_1_); } else { for(TileEntity tileentity : p_147448_1_) { -@@ -467,13 +509,14 @@ +@@ -425,13 +467,14 @@ public void func_217391_K() { IProfiler iprofiler = this.func_217381_Z(); iprofiler.func_76320_a("blockEntities"); @@ -184,7 +184,7 @@ Iterator iterator = this.field_175730_i.iterator(); while(iterator.hasNext()) { -@@ -482,8 +525,9 @@ +@@ -440,8 +483,9 @@ BlockPos blockpos = tileentity.func_174877_v(); if (this.func_72863_F().func_222866_a(blockpos) && this.func_175723_af().func_177746_a(blockpos)) { try { @@ -195,7 +195,7 @@ }); if (tileentity.func_200662_C().func_223045_a(this.func_180495_p(blockpos).func_177230_c())) { ((ITickableTileEntity)tileentity).func_73660_a(); -@@ -496,8 +540,16 @@ +@@ -454,8 +498,16 @@ CrashReport crashreport = CrashReport.func_85055_a(throwable, "Ticking block entity"); CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block entity being ticked"); tileentity.func_145828_a(crashreportcategory); @@ -212,7 +212,7 @@ } } -@@ -505,7 +557,10 @@ +@@ -463,7 +515,10 @@ iterator.remove(); this.field_147482_g.remove(tileentity); if (this.func_175667_e(tileentity.func_174877_v())) { @@ -224,7 +224,7 @@ } } } -@@ -537,12 +592,15 @@ +@@ -495,12 +550,15 @@ public void func_217390_a(Consumer p_217390_1_, Entity p_217390_2_) { try { @@ -240,15 +240,15 @@ } } -@@ -556,6 +614,7 @@ +@@ -514,6 +572,7 @@ - public Explosion func_230546_a_(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable IExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) { + public Explosion func_230546_a_(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) { Explosion explosion = new Explosion(this, p_230546_1_, p_230546_2_, p_230546_3_, p_230546_4_, p_230546_6_, p_230546_8_, p_230546_10_, p_230546_11_, p_230546_12_); + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.func_77278_a(); explosion.func_77279_a(true); return explosion; -@@ -604,6 +663,7 @@ +@@ -562,6 +621,7 @@ public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) { if (!func_189509_E(p_175690_1_)) { @@ -256,19 +256,17 @@ if (p_175690_2_ != null && !p_175690_2_.func_145837_r()) { if (this.field_147481_N) { p_175690_2_.func_226984_a_(this, p_175690_1_); -@@ -619,8 +679,9 @@ +@@ -577,7 +637,8 @@ this.field_147484_a.add(p_175690_2_); } else { - this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_); -- this.func_175700_a(p_175690_2_); -+ Chunk chunk = this.func_175726_f(p_175690_1_); -+ if (chunk != null) chunk.func_177426_a(p_175690_1_, p_175690_2_); -+ this.func_175700_a(p_175690_2_); ++ Chunk chunk = this.func_175726_f(p_175690_1_); ++ if (chunk != null) chunk.func_177426_a(p_175690_1_, p_175690_2_); + this.func_175700_a(p_175690_2_); } } - -@@ -632,6 +693,8 @@ +@@ -590,6 +651,8 @@ if (tileentity != null && this.field_147481_N) { tileentity.func_145843_s(); this.field_147484_a.remove(tileentity); @@ -277,7 +275,7 @@ } else { if (tileentity != null) { this.field_147484_a.remove(tileentity); -@@ -641,7 +704,7 @@ +@@ -599,7 +662,7 @@ this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_); } @@ -286,7 +284,7 @@ } public boolean func_195588_v(BlockPos p_195588_1_) { -@@ -694,10 +757,10 @@ +@@ -652,10 +715,10 @@ public List func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate p_175674_3_) { this.func_217381_Z().func_230035_c_("getEntities"); List list = Lists.newArrayList(); @@ -301,7 +299,7 @@ AbstractChunkProvider abstractchunkprovider = this.func_72863_F(); for(int i1 = i; i1 <= j; ++i1) { -@@ -714,10 +777,10 @@ +@@ -672,10 +735,10 @@ public List func_217394_a(@Nullable EntityType p_217394_1_, AxisAlignedBB p_217394_2_, Predicate p_217394_3_) { this.func_217381_Z().func_230035_c_("getEntities"); @@ -316,7 +314,7 @@ List list = Lists.newArrayList(); for(int i1 = i; i1 < j; ++i1) { -@@ -734,10 +797,10 @@ +@@ -692,10 +755,10 @@ public List func_175647_a(Class p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate p_175647_3_) { this.func_217381_Z().func_230035_c_("getEntities"); @@ -331,7 +329,7 @@ List list = Lists.newArrayList(); AbstractChunkProvider abstractchunkprovider = this.func_72863_F(); -@@ -755,10 +818,10 @@ +@@ -713,10 +776,10 @@ public List func_225316_b(Class p_225316_1_, AxisAlignedBB p_225316_2_, @Nullable Predicate p_225316_3_) { this.func_217381_Z().func_230035_c_("getLoadedEntities"); @@ -346,16 +344,15 @@ List list = Lists.newArrayList(); AbstractChunkProvider abstractchunkprovider = this.func_72863_F(); -@@ -781,7 +844,7 @@ - if (this.func_175667_e(p_175646_1_)) { +@@ -740,6 +803,7 @@ this.func_175726_f(p_175646_1_).func_76630_e(); } -- + + this.func_175666_e(p_175646_1_, func_180495_p(p_175646_1_).func_177230_c()); //Notify neighbors of changes } public int func_181545_F() { -@@ -830,7 +893,7 @@ +@@ -784,7 +848,7 @@ public int func_175651_c(BlockPos p_175651_1_, Direction p_175651_2_) { BlockState blockstate = this.func_180495_p(p_175651_1_); int i = blockstate.func_185911_a(this, p_175651_1_, p_175651_2_); @@ -364,7 +361,7 @@ } public boolean func_175640_z(BlockPos p_175640_1_) { -@@ -985,16 +1048,15 @@ +@@ -939,16 +1003,15 @@ public abstract Scoreboard func_96441_U(); public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) { @@ -385,7 +382,7 @@ blockstate.func_215697_a(this, blockpos, p_175666_2_, p_175666_1_, false); } } -@@ -1075,6 +1137,18 @@ +@@ -1025,6 +1088,18 @@ return this.field_226689_w_; } diff --git a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch index 57a8b2b2d..e1b7c1428 100644 --- a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch @@ -1,33 +1,6 @@ --- a/net/minecraft/world/biome/Biome.java +++ b/net/minecraft/world/biome/Biome.java -@@ -68,7 +68,7 @@ - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - --public class Biome { -+public class Biome extends net.minecraftforge.registries.ForgeRegistryEntry { - public static final Logger field_150586_aC = LogManager.getLogger(); - public static final Codec field_235051_b_ = RecordCodecBuilder.create((p_235064_0_) -> { - return p_235064_0_.group(Biome.RainType.field_235121_d_.fieldOf("precipitation").forGetter((p_235088_0_) -> { -@@ -221,7 +221,7 @@ - } - - protected void func_201866_a(EntityClassification p_201866_1_, Biome.SpawnListEntry p_201866_2_) { -- this.field_201880_ax.get(p_201866_1_).add(p_201866_2_); -+ this.field_201880_ax.computeIfAbsent(p_201866_1_, k -> Lists.newArrayList()).add(p_201866_2_); - } - - protected void func_235059_a_(EntityType p_235059_1_, double p_235059_2_, double p_235059_4_) { -@@ -229,7 +229,7 @@ - } - - public List func_76747_a(EntityClassification p_76747_1_) { -- return this.field_201880_ax.get(p_76747_1_); -+ return this.field_201880_ax.computeIfAbsent(p_76747_1_, k -> Lists.newArrayList()); - } - - @Nullable -@@ -308,7 +308,7 @@ +@@ -200,7 +200,7 @@ } else { if (p_201850_2_.func_177956_o() >= 0 && p_201850_2_.func_177956_o() < 256 && p_201850_1_.func_226658_a_(LightType.BLOCK, p_201850_2_) < 10) { BlockState blockstate = p_201850_1_.func_180495_p(p_201850_2_); @@ -36,26 +9,3 @@ return true; } } -@@ -589,6 +589,22 @@ - } - } - -+ public Biome getRiver() { -+ if (this == Biomes.field_76774_n) return Biomes.field_76777_m; -+ if (this == Biomes.field_76789_p || this == Biomes.field_76788_q) return Biomes.field_76788_q; -+ return Biomes.field_76781_i; -+ } -+ -+ @Nullable -+ public Biome getHill(net.minecraft.world.gen.INoiseRandom rand) { -+ return null; -+ } -+ -+ @Nullable -+ public Biome getEdge(net.minecraft.world.gen.INoiseRandom rand, Biome northBiome, Biome westBiome, Biome southBiome, Biome eastBiome) { -+ return null; -+ } -+ - public static class Builder { - @Nullable - private ConfiguredSurfaceBuilder field_205422_a; diff --git a/patches/minecraft/net/minecraft/world/biome/Biomes.java.patch b/patches/minecraft/net/minecraft/world/biome/Biomes.java.patch deleted file mode 100644 index 59953600e..000000000 --- a/patches/minecraft/net/minecraft/world/biome/Biomes.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/world/biome/Biomes.java -+++ b/net/minecraft/world/biome/Biomes.java -@@ -4,8 +4,10 @@ - import net.minecraft.util.ResourceLocation; - import net.minecraft.util.registry.Registry; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public abstract class Biomes { - public static final Biome field_76771_b = func_222369_a(0, "ocean", new OceanBiome()); -+ @net.minecraftforge.registries.ObjectHolder("minecraft:ocean") - public static final Biome field_180279_ad = field_76771_b; - public static final Biome field_76772_c = func_222369_a(1, "plains", new PlainsBiome()); - public static final Biome field_76769_d = func_222369_a(2, "desert", new DesertBiome()); diff --git a/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch b/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch index d099755cc..6fc6eae77 100644 --- a/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch +++ b/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/end/DragonFightManager.java +++ b/net/minecraft/world/end/DragonFightManager.java -@@ -85,6 +85,7 @@ +@@ -84,6 +84,7 @@ this.field_186117_k = p_i231901_4_.func_74767_n("DragonKilled"); this.field_186118_l = p_i231901_4_.func_74767_n("PreviouslyKilled"); @@ -8,7 +8,7 @@ if (p_i231901_4_.func_74767_n("IsRespawning")) { this.field_186122_p = DragonSpawnState.START; } -@@ -119,6 +120,7 @@ +@@ -118,6 +119,7 @@ compoundnbt.func_74757_a("DragonKilled", this.field_186117_k); compoundnbt.func_74757_a("PreviouslyKilled", this.field_186118_l); @@ -16,7 +16,7 @@ if (this.field_186121_o != null) { compoundnbt.func_218657_a("ExitPortalLocation", NBTUtil.func_186859_a(this.field_186121_o)); } -@@ -491,6 +493,13 @@ +@@ -490,6 +492,13 @@ endercrystalentity.func_184516_a((BlockPos)null); } } diff --git a/patches/minecraft/net/minecraft/world/gen/DebugChunkGenerator.java.patch b/patches/minecraft/net/minecraft/world/gen/DebugChunkGenerator.java.patch index d4122ec51..612734892 100644 --- a/patches/minecraft/net/minecraft/world/gen/DebugChunkGenerator.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/DebugChunkGenerator.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/DebugChunkGenerator.java +++ b/net/minecraft/world/gen/DebugChunkGenerator.java -@@ -101,4 +101,10 @@ +@@ -103,4 +103,10 @@ return blockstate; } diff --git a/patches/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch b/patches/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch index b49eb936f..0655cdfa5 100644 --- a/patches/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/NoiseChunkGenerator.java +++ b/net/minecraft/world/gen/NoiseChunkGenerator.java -@@ -520,8 +520,8 @@ +@@ -525,8 +525,8 @@ objectlistiterator1.back(objectlist1.size()); BlockState blockstate = this.func_236086_a_(d18, i2); if (blockstate != field_222562_i) { diff --git a/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch b/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch index 580453c44..646dea48d 100644 --- a/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/WorldGenRegion.java +++ b/net/minecraft/world/gen/WorldGenRegion.java -@@ -165,11 +165,11 @@ +@@ -170,11 +170,11 @@ public boolean func_241212_a_(BlockPos p_241212_1_, boolean p_241212_2_, @Nullable Entity p_241212_3_, int p_241212_4_) { BlockState blockstate = this.func_180495_p(p_241212_1_); @@ -14,7 +14,7 @@ Block.func_220054_a(blockstate, this.field_201689_f, p_241212_1_, tileentity, p_241212_3_, ItemStack.field_190927_a); } -@@ -189,11 +189,11 @@ +@@ -194,11 +194,11 @@ if (compoundnbt != null) { if ("DUMMY".equals(compoundnbt.func_74779_i("id"))) { Block block = blockstate.func_177230_c(); @@ -28,7 +28,7 @@ } else { tileentity = TileEntity.func_235657_b_(blockstate, compoundnbt); } -@@ -204,7 +204,7 @@ +@@ -209,7 +209,7 @@ } } @@ -37,7 +37,7 @@ field_208303_a.warn("Tried to access a block entity before it was created. {}", (Object)p_175625_1_); } -@@ -220,9 +220,9 @@ +@@ -225,9 +225,9 @@ } Block block = p_241211_2_.func_177230_c(); @@ -49,7 +49,7 @@ } else { CompoundNBT compoundnbt = new CompoundNBT(); compoundnbt.func_74768_a("x", p_241211_1_.func_177958_n()); -@@ -231,7 +231,7 @@ +@@ -236,7 +236,7 @@ compoundnbt.func_74778_a("id", "DUMMY"); ichunk.func_201591_a(compoundnbt); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch index 29625c97b..b3d32a2ed 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java +++ b/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java -@@ -20,7 +20,7 @@ +@@ -19,7 +19,7 @@ protected void func_227210_a_(IWorld p_227210_1_, Random p_227210_2_, BlockPos p_227210_3_, BigMushroomFeatureConfig p_227210_4_, int p_227210_5_, BlockPos.Mutable p_227210_6_) { for(int i = 0; i < p_227210_5_; ++i) { p_227210_6_.func_189533_g(p_227210_3_).func_189534_c(Direction.UP, i); @@ -9,7 +9,7 @@ this.func_230367_a_(p_227210_1_, p_227210_6_, p_227210_4_.field_227273_b_.func_225574_a_(p_227210_2_, p_227210_3_)); } } -@@ -49,7 +49,7 @@ +@@ -48,7 +48,7 @@ for(int l = -k; l <= k; ++l) { for(int i1 = -k; i1 <= k; ++i1) { BlockState blockstate = p_227209_1_.func_180495_p(p_227209_4_.func_239621_a_(p_227209_2_, l, j, i1)); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch index b104b73e8..b4221344b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/DungeonsFeature.java +++ b/net/minecraft/world/gen/feature/DungeonsFeature.java -@@ -124,6 +124,6 @@ +@@ -123,6 +123,6 @@ } private EntityType func_201043_a(Random p_201043_1_) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/Feature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/Feature.java.patch index 76c9d2324..f268dde28 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/Feature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/Feature.java.patch @@ -1,16 +1,16 @@ --- a/net/minecraft/world/gen/feature/Feature.java +++ b/net/minecraft/world/gen/feature/Feature.java -@@ -17,7 +17,7 @@ - import net.minecraft.world.gen.feature.structure.StructureManager; - import net.minecraft.world.gen.placement.CountConfig; +@@ -15,7 +15,7 @@ + import net.minecraft.world.gen.feature.structure.BasaltDeltasStructure; + import net.minecraft.world.gen.feature.structure.NetherackBlobReplacementStructure; -public abstract class Feature { +public abstract class Feature extends net.minecraftforge.registries.ForgeRegistryEntry> { public static final Feature field_227245_q_ = func_214468_a("no_op", new NoOpFeature(NoFeatureConfig.field_236558_a_)); public static final Feature field_236291_c_ = func_214468_a("tree", new TreeFeature(BaseTreeFeatureConfig.field_236676_a_)); public static final FlowersFeature field_227247_y_ = func_214468_a("flower", new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_)); -@@ -100,11 +100,11 @@ - public abstract boolean func_230362_a_(ISeedReader p_230362_1_, StructureManager p_230362_2_, ChunkGenerator p_230362_3_, Random p_230362_4_, BlockPos p_230362_5_, FC p_230362_6_); +@@ -97,11 +97,11 @@ + public abstract boolean func_241855_a(ISeedReader p_241855_1_, ChunkGenerator p_241855_2_, Random p_241855_3_, BlockPos p_241855_4_, FC p_241855_5_); protected static boolean func_227249_a_(Block p_227249_0_) { - return p_227249_0_ == Blocks.field_150348_b || p_227249_0_ == Blocks.field_196650_c || p_227249_0_ == Blocks.field_196654_e || p_227249_0_ == Blocks.field_196656_g; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch index 769b95f78..3c1d7b91b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java +++ b/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java -@@ -27,7 +27,7 @@ +@@ -26,7 +26,7 @@ for(int i = 0; i < 1500; ++i) { - BlockPos blockpos = p_230362_5_.func_177982_a(p_230362_4_.nextInt(8) - p_230362_4_.nextInt(8), -p_230362_4_.nextInt(12), p_230362_4_.nextInt(8) - p_230362_4_.nextInt(8)); -- if (p_230362_1_.func_180495_p(blockpos).func_196958_f()) { -+ if (p_230362_1_.func_180495_p(blockpos).isAir(p_230362_1_, blockpos)) { + BlockPos blockpos = p_241855_4_.func_177982_a(p_241855_3_.nextInt(8) - p_241855_3_.nextInt(8), -p_241855_3_.nextInt(12), p_241855_3_.nextInt(8) - p_241855_3_.nextInt(8)); +- if (p_241855_1_.func_180495_p(blockpos).func_196958_f()) { ++ if (p_241855_1_.func_180495_p(blockpos).isAir(p_241855_1_, blockpos)) { int j = 0; for(Direction direction : Direction.values()) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch index 781e3c5d9..c4874ab71 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch @@ -1,28 +1,28 @@ --- a/net/minecraft/world/gen/feature/IceSpikeFeature.java +++ b/net/minecraft/world/gen/feature/IceSpikeFeature.java -@@ -43,14 +43,14 @@ - if ((i1 == 0 && j1 == 0 || !(f1 * f1 + f2 * f2 > f * f)) && (i1 != -l && i1 != l && j1 != -l && j1 != l || !(p_230362_4_.nextFloat() > 0.75F))) { - BlockState blockstate = p_230362_1_.func_180495_p(p_230362_5_.func_177982_a(i1, k, j1)); +@@ -42,14 +42,14 @@ + if ((i1 == 0 && j1 == 0 || !(f1 * f1 + f2 * f2 > f * f)) && (i1 != -l && i1 != l && j1 != -l && j1 != l || !(p_241855_3_.nextFloat() > 0.75F))) { + BlockState blockstate = p_241855_1_.func_180495_p(p_241855_4_.func_177982_a(i1, k, j1)); Block block = blockstate.func_177230_c(); - if (blockstate.func_196958_f() || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { -+ if (blockstate.isAir(p_230362_1_, p_230362_5_.func_177982_a(i1, k, j1)) || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { - this.func_230367_a_(p_230362_1_, p_230362_5_.func_177982_a(i1, k, j1), Blocks.field_150403_cj.func_176223_P()); ++ if (blockstate.isAir(p_241855_1_, p_241855_4_.func_177982_a(i1, k, j1)) || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { + this.func_230367_a_(p_241855_1_, p_241855_4_.func_177982_a(i1, k, j1), Blocks.field_150403_cj.func_176223_P()); } if (k != 0 && l > 1) { - blockstate = p_230362_1_.func_180495_p(p_230362_5_.func_177982_a(i1, -k, j1)); + blockstate = p_241855_1_.func_180495_p(p_241855_4_.func_177982_a(i1, -k, j1)); block = blockstate.func_177230_c(); - if (blockstate.func_196958_f() || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { -+ if (blockstate.isAir(p_230362_1_, p_230362_5_.func_177982_a(i1, -k, j1)) || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { - this.func_230367_a_(p_230362_1_, p_230362_5_.func_177982_a(i1, -k, j1), Blocks.field_150403_cj.func_176223_P()); ++ if (blockstate.isAir(p_241855_1_, p_241855_4_.func_177982_a(i1, -k, j1)) || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { + this.func_230367_a_(p_241855_1_, p_241855_4_.func_177982_a(i1, -k, j1), Blocks.field_150403_cj.func_176223_P()); } } -@@ -77,7 +77,7 @@ +@@ -76,7 +76,7 @@ while(blockpos.func_177956_o() > 50) { - BlockState blockstate1 = p_230362_1_.func_180495_p(blockpos); + BlockState blockstate1 = p_241855_1_.func_180495_p(blockpos); Block block1 = blockstate1.func_177230_c(); - if (!blockstate1.func_196958_f() && !func_227250_b_(block1) && block1 != Blocks.field_196604_cC && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) { -+ if (!blockstate1.isAir(p_230362_1_, blockpos) && !func_227250_b_(block1) && block1 != Blocks.field_196604_cC && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) { ++ if (!blockstate1.isAir(p_241855_1_, blockpos) && !func_227250_b_(block1) && block1 != Blocks.field_196604_cC && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) { break; } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/OreFeatureConfig.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/OreFeatureConfig.java.patch deleted file mode 100644 index 872104bbe..000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/OreFeatureConfig.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/minecraft/world/gen/feature/OreFeatureConfig.java -+++ b/net/minecraft/world/gen/feature/OreFeatureConfig.java -@@ -31,7 +31,7 @@ - this.field_202442_b = p_i51473_1_; - } - -- public static enum FillerBlockType implements IStringSerializable { -+ public static enum FillerBlockType implements IStringSerializable, net.minecraftforge.common.IExtensibleEnum { - NATURAL_STONE("natural_stone", (p_214739_0_) -> { - if (p_214739_0_ == null) { - return false; -@@ -68,6 +68,16 @@ - return field_214741_c.get(p_214736_0_); - } - -+ public static FillerBlockType create(String enumName, String p_i50618_3_, Predicate p_i50618_4_) { -+ throw new IllegalStateException("Enum not extended"); -+ } -+ -+ @Override -+ @Deprecated -+ public void init() { -+ field_214741_c.put(func_214737_a(), this); -+ } -+ - public Predicate func_214738_b() { - return this.field_214743_e; - } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch index 32bfb95d9..ecbe86857 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/gen/feature/SpringFeature.java +++ b/net/minecraft/world/gen/feature/SpringFeature.java -@@ -20,7 +20,7 @@ +@@ -19,7 +19,7 @@ return false; } else { - BlockState blockstate = p_230362_1_.func_180495_p(p_230362_5_); -- if (!blockstate.func_196958_f() && !p_230362_6_.field_227366_f_.contains(blockstate.func_177230_c())) { -+ if (!blockstate.isAir(p_230362_1_, p_230362_5_) && !p_230362_6_.field_227366_f_.contains(blockstate.func_177230_c())) { + BlockState blockstate = p_241855_1_.func_180495_p(p_241855_4_); +- if (!blockstate.func_196958_f() && !p_241855_5_.field_227366_f_.contains(blockstate.func_177230_c())) { ++ if (!blockstate.isAir(p_241855_1_, p_241855_4_) && !p_241855_5_.field_227366_f_.contains(blockstate.func_177230_c())) { return false; } else { int i = 0; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch index 48d2b51f5..741324cde 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java +++ b/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java -@@ -86,7 +86,7 @@ +@@ -104,7 +104,7 @@ return this.field_214953_e.size(); } @@ -9,7 +9,7 @@ TERRAIN_MATCHING("terrain_matching", ImmutableList.of(new GravityStructureProcessor(Heightmap.Type.WORLD_SURFACE_WG, -1))), RIGID("rigid", ImmutableList.of()); -@@ -117,5 +117,15 @@ +@@ -135,5 +135,15 @@ public String func_176610_l() { return this.field_214940_d; } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch index 7c8b8aba3..3cb103413 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java +++ b/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java -@@ -113,7 +113,7 @@ +@@ -106,7 +106,7 @@ if (!template.func_237146_a_(p_230378_2_, p_230378_5_, p_230378_6_, placementsettings, p_230378_9_, 18)) { return false; } else { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch index b02248dda..dd98a8fec 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/gen/feature/structure/MineshaftPieces.java +++ b/net/minecraft/world/gen/feature/structure/MineshaftPieces.java -@@ -208,7 +208,7 @@ +@@ -207,7 +207,7 @@ - protected boolean func_186167_a(IWorld p_186167_1_, MutableBoundingBox p_186167_2_, Random p_186167_3_, int p_186167_4_, int p_186167_5_, int p_186167_6_, ResourceLocation p_186167_7_) { + protected boolean func_186167_a(ISeedReader p_186167_1_, MutableBoundingBox p_186167_2_, Random p_186167_3_, int p_186167_4_, int p_186167_5_, int p_186167_6_, ResourceLocation p_186167_7_) { BlockPos blockpos = new BlockPos(this.func_74865_a(p_186167_4_, p_186167_6_), this.func_74862_a(p_186167_5_), this.func_74873_b(p_186167_4_, p_186167_6_)); - if (p_186167_2_.func_175898_b(blockpos) && p_186167_1_.func_180495_p(blockpos).func_196958_f() && !p_186167_1_.func_180495_p(blockpos.func_177977_b()).func_196958_f()) { + if (p_186167_2_.func_175898_b(blockpos) && p_186167_1_.func_180495_p(blockpos).isAir(p_186167_1_, blockpos) && !p_186167_1_.func_180495_p(blockpos.func_177977_b()).isAir(p_186167_1_, blockpos.func_177977_b())) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/structure/Structure.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/structure/Structure.java.patch index 251ec740e..fdbc40458 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/structure/Structure.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/structure/Structure.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/structure/Structure.java +++ b/net/minecraft/world/gen/feature/structure/Structure.java -@@ -35,7 +35,7 @@ +@@ -38,7 +38,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch index abc6a2d48..d3537edbd 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/structure/StructureStart.java +++ b/net/minecraft/world/gen/feature/structure/StructureStart.java -@@ -83,6 +83,9 @@ +@@ -84,6 +84,9 @@ public CompoundNBT func_143021_a(int p_143021_1_, int p_143021_2_) { CompoundNBT compoundnbt = new CompoundNBT(); if (this.func_75069_d()) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch index 6e4e4233c..53e0fe5b2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/template/Template.java +++ b/net/minecraft/world/gen/feature/template/Template.java -@@ -189,6 +189,10 @@ +@@ -190,6 +190,10 @@ return func_207669_a(p_186266_1_, p_186266_0_.func_186212_b(), p_186266_0_.func_186215_c(), p_186266_0_.func_207664_d()); } @@ -8,10 +8,10 @@ + return func_207667_a(pos, placementIn.func_186212_b(), placementIn.func_186215_c(), placementIn.func_207664_d()); + } + - public void func_237144_a_(IWorld p_237144_1_, BlockPos p_237144_2_, PlacementSettings p_237144_3_, Random p_237144_4_) { + public void func_237144_a_(IServerWorld p_237144_1_, BlockPos p_237144_2_, PlacementSettings p_237144_3_, Random p_237144_4_) { p_237144_3_.func_186224_i(); this.func_237152_b_(p_237144_1_, p_237144_2_, p_237144_3_, p_237144_4_); -@@ -214,7 +218,7 @@ +@@ -215,7 +219,7 @@ int i1 = Integer.MIN_VALUE; int j1 = Integer.MIN_VALUE; @@ -20,7 +20,7 @@ BlockPos blockpos = template$blockinfo.field_186242_a; if (mutableboundingbox == null || mutableboundingbox.func_175898_b(blockpos)) { FluidState fluidstate = p_237146_4_.func_204763_l() ? p_237146_1_.func_204610_c(blockpos) : null; -@@ -329,7 +333,7 @@ +@@ -330,7 +334,7 @@ } if (!p_237146_4_.func_186221_e()) { @@ -29,7 +29,7 @@ } return true; -@@ -358,14 +362,19 @@ +@@ -359,14 +363,19 @@ }); } @@ -50,11 +50,11 @@ } if (template$blockinfo1 != null) { -@@ -376,13 +385,30 @@ +@@ -377,13 +386,30 @@ return list; } -- private void func_237143_a_(IWorld p_237143_1_, BlockPos p_237143_2_, Mirror p_237143_3_, Rotation p_237143_4_, BlockPos p_237143_5_, @Nullable MutableBoundingBox p_237143_6_, boolean p_237143_7_) { +- private void func_237143_a_(IServerWorld p_237143_1_, BlockPos p_237143_2_, Mirror p_237143_3_, Rotation p_237143_4_, BlockPos p_237143_5_, @Nullable MutableBoundingBox p_237143_6_, boolean p_237143_7_) { - for(Template.EntityInfo template$entityinfo : this.field_186271_b) { - BlockPos blockpos = func_207669_a(template$entityinfo.field_186248_b, p_237143_3_, p_237143_4_, p_237143_5_).func_177971_a(p_237143_2_); - if (p_237143_6_ == null || p_237143_6_.func_175898_b(blockpos)) { @@ -75,7 +75,7 @@ + return list; + } + -+ private void addEntitiesToWorld(IWorld p_237143_1_, BlockPos p_237143_2_, PlacementSettings placementIn) { ++ private void addEntitiesToWorld(IServerWorld p_237143_1_, BlockPos p_237143_2_, PlacementSettings placementIn) { + for(Template.EntityInfo template$entityinfo : processEntityInfos(this, p_237143_1_, p_237143_2_, placementIn, this.field_186271_b)) { + BlockPos blockpos = func_207669_a(template$entityinfo.field_186248_b, placementIn.func_186212_b(), placementIn.func_186215_c(), placementIn.func_207664_d()).func_177971_a(p_237143_2_); + blockpos = template$entityinfo.field_186248_b; // FORGE: Position will have already been transformed by processEntityInfos @@ -87,17 +87,17 @@ ListNBT listnbt = new ListNBT(); listnbt.add(DoubleNBT.func_229684_a_(vector3d1.field_72450_a)); listnbt.add(DoubleNBT.func_229684_a_(vector3d1.field_72448_b)); -@@ -390,10 +416,10 @@ +@@ -391,10 +417,10 @@ compoundnbt.func_218657_a("Pos", listnbt); compoundnbt.func_82580_o("UUID"); - func_215382_a(p_237143_1_, compoundnbt).ifPresent((p_237147_6_) -> { -- float f = p_237147_6_.func_184217_a(p_237143_3_); -- f = f + (p_237147_6_.field_70177_z - p_237147_6_.func_184229_a(p_237143_4_)); -+ float f = p_237147_6_.func_184217_a(placementIn.func_186212_b()); -+ f = f + (p_237147_6_.field_70177_z - p_237147_6_.func_184229_a(placementIn.func_186215_c())); - p_237147_6_.func_70012_b(vector3d1.field_72450_a, vector3d1.field_72448_b, vector3d1.field_72449_c, f, p_237147_6_.field_70125_A); -- if (p_237143_7_ && p_237147_6_ instanceof MobEntity) { -+ if (placementIn.func_237134_m_() && p_237147_6_ instanceof MobEntity) { - ((MobEntity)p_237147_6_).func_213386_a(p_237143_1_, p_237143_1_.func_175649_E(new BlockPos(vector3d1)), SpawnReason.STRUCTURE, (ILivingEntityData)null, compoundnbt); + func_215382_a(p_237143_1_, compoundnbt).ifPresent((p_242927_6_) -> { +- float f = p_242927_6_.func_184217_a(p_237143_3_); +- f = f + (p_242927_6_.field_70177_z - p_242927_6_.func_184229_a(p_237143_4_)); ++ float f = p_242927_6_.func_184217_a(placementIn.func_186212_b()); ++ f = f + (p_242927_6_.field_70177_z - p_242927_6_.func_184229_a(placementIn.func_186215_c())); + p_242927_6_.func_70012_b(vector3d1.field_72450_a, vector3d1.field_72448_b, vector3d1.field_72449_c, f, p_242927_6_.field_70125_A); +- if (p_237143_7_ && p_242927_6_ instanceof MobEntity) { ++ if (placementIn.func_237134_m_() && p_242927_6_ instanceof MobEntity) { + ((MobEntity)p_242927_6_).func_213386_a(p_237143_1_, p_237143_1_.func_175649_E(new BlockPos(vector3d1)), SpawnReason.STRUCTURE, (ILivingEntityData)null, compoundnbt); } diff --git a/patches/minecraft/net/minecraft/world/gen/layer/BiomeLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/BiomeLayer.java.patch deleted file mode 100644 index cf943137d..000000000 --- a/patches/minecraft/net/minecraft/world/gen/layer/BiomeLayer.java.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- a/net/minecraft/world/gen/layer/BiomeLayer.java -+++ b/net/minecraft/world/gen/layer/BiomeLayer.java -@@ -28,12 +28,28 @@ - private static final int[] field_202746_t = new int[]{field_202730_d, field_202729_c, field_202741_o, field_202736_j}; - private static final int[] field_202747_u = new int[]{field_202731_e, field_202731_e, field_202731_e, field_202742_p}; - private int[] field_151623_c = field_202744_r; -+ private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; - - public BiomeLayer(boolean p_i232147_1_) { -- if (p_i232147_1_) { -- this.field_151623_c = field_202743_q; -+ for (net.minecraftforge.common.BiomeManager.BiomeType type : net.minecraftforge.common.BiomeManager.BiomeType.values()) { -+ com.google.common.collect.ImmutableList biomesToAdd = net.minecraftforge.common.BiomeManager.getBiomes(type); -+ if (biomes[type.ordinal()] == null) biomes[type.ordinal()] = new java.util.ArrayList(); -+ if (biomesToAdd != null) biomes[type.ordinal()].addAll(biomesToAdd); - } - -+ int desertIdx = net.minecraftforge.common.BiomeManager.BiomeType.DESERT.ordinal(); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76769_d, 30)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_150588_X, 20)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76772_c, 10)); -+ if (p_i232147_1_) { -+ biomes[desertIdx].clear(); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76769_d, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76767_f, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76770_e, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76780_h, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76772_c, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76768_g, 10)); -+ } - } - - public int func_202726_a(INoiseRandom p_202726_1_, int p_202726_2_) { -@@ -46,21 +62,21 @@ - return p_202726_1_.func_202696_a(3) == 0 ? field_202733_g : field_202734_h; - } - -- return this.field_151623_c[p_202726_1_.func_202696_a(this.field_151623_c.length)]; -+ return Registry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT, p_202726_1_)); - case 2: - if (i > 0) { - return field_202732_f; - } - -- return field_202745_s[p_202726_1_.func_202696_a(field_202745_s.length)]; -+ return Registry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM, p_202726_1_)); - case 3: - if (i > 0) { - return field_202737_k; - } - -- return field_202746_t[p_202726_1_.func_202696_a(field_202746_t.length)]; -+ return Registry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL, p_202726_1_)); - case 4: -- return field_202747_u[p_202726_1_.func_202696_a(field_202747_u.length)]; -+ return Registry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY, p_202726_1_)); - default: - return field_202735_i; - } -@@ -68,4 +84,11 @@ - return p_202726_2_; - } - } -+ -+ private net.minecraft.world.biome.Biome getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType type, INoiseRandom context) { -+ java.util.List biomeList = biomes[type.ordinal()]; -+ int totalWeight = net.minecraft.util.WeightedRandom.func_76272_a(biomeList); -+ int weight = net.minecraftforge.common.BiomeManager.isTypeListModded(type) ? context.func_202696_a(totalWeight) : context.func_202696_a(totalWeight / 10) * 10; -+ return net.minecraft.util.WeightedRandom.func_180166_a(biomeList, weight).biome; -+ } - } diff --git a/patches/minecraft/net/minecraft/world/gen/layer/HillsLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/HillsLayer.java.patch deleted file mode 100644 index 1eda51a99..000000000 --- a/patches/minecraft/net/minecraft/world/gen/layer/HillsLayer.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/world/gen/layer/HillsLayer.java -+++ b/net/minecraft/world/gen/layer/HillsLayer.java -@@ -59,7 +59,10 @@ - - if (p_215723_1_.func_202696_a(3) == 0 || k == 0) { - int l = i; -- if (i == field_202799_f) { -+ Biome biome = Registry.field_212624_m.func_148745_a(i); -+ Biome hill = biome == null ? null : biome.getHill(p_215723_1_); -+ if (hill != null) l = Registry.field_212624_m.func_148757_b(hill); -+ else if (i == field_202799_f) { - l = field_202800_g; - } else if (i == field_202803_j) { - l = field_202804_k; diff --git a/patches/minecraft/net/minecraft/world/gen/layer/MixRiverLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/MixRiverLayer.java.patch deleted file mode 100644 index 922fa6b45..000000000 --- a/patches/minecraft/net/minecraft/world/gen/layer/MixRiverLayer.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/world/gen/layer/MixRiverLayer.java -+++ b/net/minecraft/world/gen/layer/MixRiverLayer.java -@@ -22,11 +22,7 @@ - if (LayerUtil.func_202827_a(i)) { - return i; - } else if (j == field_202725_h) { -- if (i == field_202721_d) { -- return field_202720_c; -- } else { -- return i != field_202722_e && i != field_202723_f ? j & 255 : field_202723_f; -- } -+ return Registry.field_212624_m.func_148757_b(Registry.field_212624_m.func_148745_a(i).getRiver()); - } else { - return i; - } diff --git a/patches/minecraft/net/minecraft/world/gen/layer/ShoreLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/ShoreLayer.java.patch deleted file mode 100644 index d0ffc1e0a..000000000 --- a/patches/minecraft/net/minecraft/world/gen/layer/ShoreLayer.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/gen/layer/ShoreLayer.java -+++ b/net/minecraft/world/gen/layer/ShoreLayer.java -@@ -34,6 +34,9 @@ - - public int func_202748_a(INoiseRandom p_202748_1_, int p_202748_2_, int p_202748_3_, int p_202748_4_, int p_202748_5_, int p_202748_6_) { - Biome biome = Registry.field_212624_m.func_148745_a(p_202748_6_); -+ Biome edgeBiome = biome.getEdge(p_202748_1_, Registry.field_212624_m.func_148745_a(p_202748_2_), Registry.field_212624_m.func_148745_a(p_202748_3_), Registry.field_212624_m.func_148745_a(p_202748_4_), Registry.field_212624_m.func_148745_a(p_202748_5_)); -+ if (edgeBiome != null) return Registry.field_212624_m.func_148757_b(edgeBiome); -+ - if (p_202748_6_ == field_202784_r) { - if (LayerUtil.func_203631_b(p_202748_2_) || LayerUtil.func_203631_b(p_202748_3_) || LayerUtil.func_203631_b(p_202748_4_) || LayerUtil.func_203631_b(p_202748_5_)) { - return field_202785_s; diff --git a/patches/minecraft/net/minecraft/world/gen/placement/Placement.java.patch b/patches/minecraft/net/minecraft/world/gen/placement/Placement.java.patch index a21057921..30bdd8a9b 100644 --- a/patches/minecraft/net/minecraft/world/gen/placement/Placement.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/placement/Placement.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/gen/placement/Placement.java +++ b/net/minecraft/world/gen/placement/Placement.java -@@ -14,7 +14,7 @@ - import net.minecraft.world.gen.feature.structure.StructureManager; - import org.apache.commons.lang3.mutable.MutableBoolean; +@@ -8,7 +8,7 @@ + import net.minecraft.world.gen.feature.FeatureSpreadConfig; + import net.minecraft.world.gen.feature.WorldDecoratingHelper; -public abstract class Placement { +public abstract class Placement extends net.minecraftforge.registries.ForgeRegistryEntry> { public static final Placement field_215022_h = func_214999_a("nope", new Passthrough(NoPlacementConfig.field_236555_a_)); - public static final Placement field_215015_a = func_214999_a("count_heightmap", new AtSurface(FrequencyConfig.field_236971_a_)); - public static final Placement field_215016_b = func_214999_a("count_top_solid", new TopSolid(FrequencyConfig.field_236971_a_)); + public static final Placement field_242898_b = func_214999_a("chance", new ChancePlacement(ChanceConfig.field_236950_a_)); + public static final Placement field_242899_c = func_214999_a("count", new CountPlacement(FeatureSpreadConfig.field_242797_a)); diff --git a/patches/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch b/patches/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch index 07e246ef8..baa79a1be 100644 --- a/patches/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch @@ -6,6 +6,6 @@ -public abstract class SurfaceBuilder { +public abstract class SurfaceBuilder extends net.minecraftforge.registries.ForgeRegistryEntry> { - 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(); + private static final BlockState field_215410_g = Blocks.field_150346_d.func_176223_P(); + private static final BlockState field_215411_h = Blocks.field_196658_i.func_176223_P(); + private static final BlockState field_215412_i = Blocks.field_196661_l.func_176223_P(); diff --git a/patches/minecraft/net/minecraft/world/raid/Raid.java.patch b/patches/minecraft/net/minecraft/world/raid/Raid.java.patch index 7d36acbae..cf40bfdad 100644 --- a/patches/minecraft/net/minecraft/world/raid/Raid.java.patch +++ b/patches/minecraft/net/minecraft/world/raid/Raid.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/raid/Raid.java +++ b/net/minecraft/world/raid/Raid.java -@@ -768,7 +768,7 @@ +@@ -769,7 +769,7 @@ } } @@ -9,7 +9,7 @@ VINDICATOR(EntityType.field_200758_ax, new int[]{0, 0, 2, 0, 1, 4, 2, 5}), EVOKER(EntityType.field_200806_t, new int[]{0, 0, 0, 0, 0, 1, 1, 2}), PILLAGER(EntityType.field_220350_aJ, new int[]{0, 4, 3, 3, 4, 4, 4, 2}), -@@ -783,5 +783,19 @@ +@@ -784,5 +784,19 @@ this.field_221285_g = p_i50602_3_; this.field_221286_h = p_i50602_4_; } diff --git a/patches/minecraft/net/minecraft/world/server/ChunkHolder.java.patch b/patches/minecraft/net/minecraft/world/server/ChunkHolder.java.patch index 3437b7576..e87f923d2 100644 --- a/patches/minecraft/net/minecraft/world/server/ChunkHolder.java.patch +++ b/patches/minecraft/net/minecraft/world/server/ChunkHolder.java.patch @@ -1,51 +1,11 @@ --- a/net/minecraft/world/server/ChunkHolder.java +++ b/net/minecraft/world/server/ChunkHolder.java -@@ -135,7 +135,7 @@ - Chunk chunk = this.func_219298_c(); - if (chunk != null) { - this.field_219322_q |= 1 << (p_241819_2_ >> 4); -- if (this.field_219321_p < 64) { -+ { //Forge; Cache everything, so always run - short short1 = (short)(p_241819_1_ << 12 | p_241819_3_ << 8 | p_241819_2_); +@@ -204,7 +204,7 @@ + } - for(int i = 0; i < this.field_219321_p; ++i) { -@@ -144,6 +144,8 @@ - } - } + private void func_244385_a(World p_244385_1_, BlockPos p_244385_2_, BlockState p_244385_3_) { +- if (p_244385_3_.func_177230_c().func_235695_q_()) { ++ if (p_244385_3_.hasTileEntity()) { + this.func_219305_a(p_244385_1_, p_244385_2_); + } -+ if (this.field_219321_p == this.field_219320_o.length) -+ this.field_219320_o = java.util.Arrays.copyOf(this.field_219320_o, this.field_219320_o.length << 1); - this.field_219320_o[this.field_219321_p++] = short1; - } - -@@ -166,7 +168,7 @@ - public void func_219274_a(Chunk p_219274_1_) { - if (this.field_219321_p != 0 || this.field_219325_t != 0 || this.field_219324_s != 0) { - World world = p_219274_1_.func_177412_p(); -- if (this.field_219321_p < 64 && (this.field_219325_t != 0 || this.field_219324_s != 0)) { -+ if (this.field_219321_p < net.minecraftforge.common.ForgeConfig.SERVER.clumpingThreshold.get() && (this.field_219325_t != 0 || this.field_219324_s != 0)) { - this.func_219293_a(new SUpdateLightPacket(p_219274_1_.func_76632_l(), this.field_219326_u, this.field_219325_t, this.field_219324_s, false), true); - this.field_219325_t = 0; - this.field_219324_s = 0; -@@ -178,10 +180,10 @@ - int k = (this.field_219320_o[0] >> 8 & 15) + this.field_219319_n.field_77275_b * 16; - BlockPos blockpos = new BlockPos(i, j, k); - this.func_219293_a(new SChangeBlockPacket(world, blockpos), false); -- if (world.func_180495_p(blockpos).func_177230_c().func_235695_q_()) { -+ if (world.func_180495_p(blockpos).hasTileEntity()) { - this.func_219305_a(world, blockpos); - } -- } else if (this.field_219321_p == 64) { -+ } else if (this.field_219321_p >= net.minecraftforge.common.ForgeConfig.SERVER.clumpingThreshold.get()) { - this.func_219293_a(new SChunkDataPacket(p_219274_1_, this.field_219322_q, false), false); - } else if (this.field_219321_p != 0) { - this.func_219293_a(new SMultiBlockChangePacket(this.field_219321_p, this.field_219320_o, p_219274_1_), false); -@@ -191,7 +193,7 @@ - int j1 = this.field_219320_o[l] & 255; - int k1 = (this.field_219320_o[l] >> 8 & 15) + this.field_219319_n.field_77275_b * 16; - BlockPos blockpos1 = new BlockPos(i1, j1, k1); -- if (world.func_180495_p(blockpos1).func_177230_c().func_235695_q_()) { -+ if (world.func_180495_p(blockpos1).hasTileEntity()) { - this.func_219305_a(world, blockpos1); - } - } diff --git a/patches/minecraft/net/minecraft/world/server/ChunkManager.java.patch b/patches/minecraft/net/minecraft/world/server/ChunkManager.java.patch index ec6050d5b..98b6bac2f 100644 --- a/patches/minecraft/net/minecraft/world/server/ChunkManager.java.patch +++ b/patches/minecraft/net/minecraft/world/server/ChunkManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/server/ChunkManager.java +++ b/net/minecraft/world/server/ChunkManager.java -@@ -406,6 +406,7 @@ +@@ -400,6 +400,7 @@ if (this.field_219253_g.remove(p_219212_1_, p_219212_3_) && p_219185_5_ != null) { if (p_219185_5_ instanceof Chunk) { ((Chunk)p_219185_5_).func_177417_c(false); @@ -8,7 +8,7 @@ } this.func_219229_a(p_219185_5_); -@@ -607,6 +608,7 @@ +@@ -601,6 +602,7 @@ if (list != null) { list.forEach(chunk::func_76622_b); } @@ -16,7 +16,7 @@ } return chunk; -@@ -684,6 +686,7 @@ +@@ -678,6 +680,7 @@ this.field_219255_i.func_217381_Z().func_230035_c_("chunkSave"); CompoundNBT compoundnbt = ChunkSerializer.func_222645_a(this.field_219255_i, p_219229_1_); @@ -24,7 +24,7 @@ this.func_219100_a(chunkpos, compoundnbt); this.func_241088_a_(chunkpos, chunkstatus.func_202129_d()); return true; -@@ -740,6 +743,7 @@ +@@ -734,6 +737,7 @@ protected void func_219199_a(ServerPlayerEntity p_219199_1_, ChunkPos p_219199_2_, IPacket[] p_219199_3_, boolean p_219199_4_, boolean p_219199_5_) { if (p_219199_1_.field_70170_p == this.field_219255_i) { diff --git a/patches/minecraft/net/minecraft/world/server/ServerWorld.java.patch b/patches/minecraft/net/minecraft/world/server/ServerWorld.java.patch index 3521064d6..ea1095f0e 100644 --- a/patches/minecraft/net/minecraft/world/server/ServerWorld.java.patch +++ b/patches/minecraft/net/minecraft/world/server/ServerWorld.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/server/ServerWorld.java +++ b/net/minecraft/world/server/ServerWorld.java -@@ -136,7 +136,7 @@ +@@ -138,7 +138,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,15 +9,15 @@ public static final BlockPos field_241108_a_ = new BlockPos(100, 50, 0); private static final Logger field_147491_a = LogManager.getLogger(); private final Int2ObjectMap field_217498_x = new Int2ObjectLinkedOpenHashMap<>(); -@@ -166,6 +166,7 @@ +@@ -168,6 +168,7 @@ private final DragonFightManager field_241105_O_; private final StructureManager field_241106_P_; private final boolean field_241107_Q_; + private net.minecraftforge.common.util.WorldCapabilityData capabilityData; - public ServerWorld(MinecraftServer p_i232604_1_, Executor p_i232604_2_, SaveFormat.LevelSave p_i232604_3_, IServerWorldInfo p_i232604_4_, RegistryKey p_i232604_5_, RegistryKey p_i232604_6_, DimensionType p_i232604_7_, IChunkStatusListener p_i232604_8_, ChunkGenerator p_i232604_9_, boolean p_i232604_10_, long p_i232604_11_, List p_i232604_13_, boolean p_i232604_14_) { - super(p_i232604_4_, p_i232604_5_, p_i232604_6_, p_i232604_7_, p_i232604_1_::func_213185_aS, false, p_i232604_10_, p_i232604_11_); -@@ -193,7 +194,7 @@ + public ServerWorld(MinecraftServer p_i241885_1_, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo p_i241885_4_, RegistryKey p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List p_i241885_12_, boolean p_i241885_13_) { + super(p_i241885_4_, p_i241885_5_, p_i241885_6_, p_i241885_1_::func_213185_aS, false, p_i241885_9_, p_i241885_10_); +@@ -195,7 +196,7 @@ } else { this.field_241105_O_ = null; } @@ -26,7 +26,7 @@ } public void func_241113_a_(int p_241113_1_, int p_241113_2_, boolean p_241113_3_, boolean p_241113_4_) { -@@ -289,15 +290,19 @@ +@@ -291,15 +292,19 @@ this.field_73061_a.func_184103_al().func_232642_a_(new SChangeGameStatePacket(SChangeGameStatePacket.field_241772_i_, this.field_73017_q), this.func_234923_W_()); } @@ -50,7 +50,7 @@ } if (this.field_73068_P && this.field_217491_A.stream().noneMatch((p_241132_0_) -> { -@@ -305,8 +310,8 @@ +@@ -307,8 +312,8 @@ })) { this.field_73068_P = false; if (this.func_82736_K().func_223586_b(GameRules.field_223607_j)) { @@ -61,7 +61,7 @@ } this.func_229856_ab_(); -@@ -397,7 +402,7 @@ +@@ -399,7 +404,7 @@ if (entity1.field_70128_L) { this.func_217454_n(entity1); objectiterator.remove(); @@ -70,7 +70,7 @@ } iprofiler.func_76319_b(); -@@ -468,6 +473,7 @@ +@@ -470,6 +475,7 @@ BlockPos blockpos2 = this.func_205770_a(Heightmap.Type.MOTION_BLOCKING, this.func_217383_a(i, 0, j, 15)); BlockPos blockpos3 = blockpos2.func_177977_b(); Biome biome = this.func_226691_t_(blockpos2); @@ -78,7 +78,7 @@ if (biome.func_201848_a(this, blockpos3)) { this.func_175656_a(blockpos3, Blocks.field_150432_aD.func_176223_P()); } -@@ -591,9 +597,10 @@ +@@ -593,9 +599,10 @@ ++p_217479_1_.field_70173_aa; IProfiler iprofiler = this.func_217381_Z(); iprofiler.func_194340_a(() -> { @@ -90,7 +90,7 @@ p_217479_1_.func_70071_h_(); iprofiler.func_76319_b(); } -@@ -680,6 +687,7 @@ +@@ -682,6 +689,7 @@ p_217445_1_.func_200209_c(new TranslationTextComponent("menu.savingChunks")); } @@ -98,7 +98,7 @@ serverchunkprovider.func_217210_a(p_217445_2_); } } -@@ -770,6 +778,7 @@ +@@ -772,6 +780,7 @@ } private void func_217448_f(ServerPlayerEntity p_217448_1_) { @@ -106,7 +106,7 @@ Entity entity = this.field_175741_N.get(p_217448_1_.func_110124_au()); if (entity != null) { field_147491_a.warn("Force-added player with duplicate UUID {}", (Object)p_217448_1_.func_110124_au().toString()); -@@ -794,6 +803,7 @@ +@@ -796,6 +805,7 @@ } else if (this.func_217478_l(p_72838_1_)) { return false; } else { @@ -114,7 +114,7 @@ IChunk ichunk = this.func_217353_a(MathHelper.func_76128_c(p_72838_1_.func_226277_ct_() / 16.0D), MathHelper.func_76128_c(p_72838_1_.func_226281_cx_() / 16.0D), ChunkStatus.field_222617_m, p_72838_1_.field_98038_p); if (!(ichunk instanceof Chunk)) { return false; -@@ -809,6 +819,7 @@ +@@ -811,6 +821,7 @@ if (this.func_217478_l(p_217440_1_)) { return false; } else { @@ -122,7 +122,7 @@ this.func_217465_m(p_217440_1_); return true; } -@@ -844,12 +855,17 @@ +@@ -874,12 +885,17 @@ } @@ -141,7 +141,7 @@ this.field_175741_N.remove(p_217484_1_.func_110124_au()); this.func_72863_F().func_217226_b(p_217484_1_); -@@ -863,6 +879,8 @@ +@@ -893,6 +909,8 @@ this.field_217495_I.remove(((MobEntity)p_217484_1_).func_70661_as()); } @@ -150,7 +150,7 @@ } private void func_217465_m(Entity p_217465_1_) { -@@ -883,15 +901,19 @@ +@@ -913,15 +931,19 @@ } } @@ -171,7 +171,7 @@ } } -@@ -904,8 +926,11 @@ +@@ -934,8 +956,11 @@ } public void func_217434_e(ServerPlayerEntity p_217434_1_) { @@ -185,7 +185,7 @@ this.func_72854_c(); } -@@ -924,10 +949,20 @@ +@@ -954,10 +979,20 @@ } public void func_184148_a(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) { @@ -206,15 +206,15 @@ this.field_73061_a.func_184103_al().func_148543_a(p_217384_1_, p_217384_2_.func_226277_ct_(), p_217384_2_.func_226278_cu_(), p_217384_2_.func_226281_cx_(), p_217384_5_ > 1.0F ? (double)(16.0F * p_217384_5_) : 16.0D, this.func_234923_W_(), new SSpawnMovingSoundEffectPacket(p_217384_3_, p_217384_4_, p_217384_2_, p_217384_5_, p_217384_6_)); } -@@ -963,6 +998,7 @@ +@@ -993,6 +1028,7 @@ - public Explosion func_230546_a_(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable IExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) { + public Explosion func_230546_a_(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) { Explosion explosion = new Explosion(this, p_230546_1_, p_230546_2_, p_230546_3_, p_230546_4_, p_230546_6_, p_230546_8_, p_230546_10_, p_230546_11_, p_230546_12_); + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.func_77278_a(); explosion.func_77279_a(false); if (p_230546_12_ == Explosion.Mode.NONE) { -@@ -1331,4 +1367,14 @@ +@@ -1379,4 +1415,14 @@ p_241121_0_.func_175656_a(p_241122_1_, Blocks.field_150343_Z.func_176223_P()); }); } diff --git a/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch b/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch index 9377123cf..3d6d1acbb 100644 --- a/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch @@ -1,20 +1,20 @@ --- a/net/minecraft/world/spawner/AbstractSpawner.java +++ b/net/minecraft/world/spawner/AbstractSpawner.java -@@ -128,11 +128,12 @@ - entity.func_70012_b(entity.func_226277_ct_(), entity.func_226278_cu_(), entity.func_226281_cx_(), world.field_73012_v.nextFloat() * 360.0F, 0.0F); - if (entity instanceof MobEntity) { - MobEntity mobentity = (MobEntity)entity; -- if (!mobentity.func_213380_a(world, SpawnReason.SPAWNER) || !mobentity.func_205019_a(world)) { -+ if (!net.minecraftforge.event.ForgeEventFactory.canEntitySpawnSpawner(mobentity, world, (float)entity.func_226277_ct_(), (float)entity.func_226278_cu_(), (float)entity.func_226281_cx_(), this)) { - continue; - } +@@ -131,11 +131,12 @@ + entity.func_70012_b(entity.func_226277_ct_(), entity.func_226278_cu_(), entity.func_226281_cx_(), world.field_73012_v.nextFloat() * 360.0F, 0.0F); + if (entity instanceof MobEntity) { + MobEntity mobentity = (MobEntity)entity; +- if (!mobentity.func_213380_a(world, SpawnReason.SPAWNER) || !mobentity.func_205019_a(world)) { ++ if (!net.minecraftforge.event.ForgeEventFactory.canEntitySpawnSpawner(mobentity, world, (float)entity.func_226277_ct_(), (float)entity.func_226278_cu_(), (float)entity.func_226281_cx_(), this)) { + continue; + } - if (this.field_98282_f.func_185277_b().func_186856_d() == 1 && this.field_98282_f.func_185277_b().func_150297_b("id", 8)) { + if (this.field_98282_f.func_185277_b().func_186856_d() == 1 && this.field_98282_f.func_185277_b().func_150297_b("id", 8)) { + if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mobentity, world, (float)entity.func_226277_ct_(), (float)entity.func_226278_cu_(), (float)entity.func_226281_cx_(), this, SpawnReason.SPAWNER)) - ((MobEntity)entity).func_213386_a(world, world.func_175649_E(entity.func_233580_cy_()), SpawnReason.SPAWNER, (ILivingEntityData)null, (CompoundNBT)null); + ((MobEntity)entity).func_213386_a(serverworld, world.func_175649_E(entity.func_233580_cy_()), SpawnReason.SPAWNER, (ILivingEntityData)null, (CompoundNBT)null); + } } - } -@@ -285,4 +286,9 @@ +@@ -283,4 +284,9 @@ public double func_177223_e() { return this.field_98284_d; } diff --git a/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch b/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch index e571e1068..d110f5d9a 100644 --- a/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/spawner/WorldEntitySpawner.java +++ b/net/minecraft/world/spawner/WorldEntitySpawner.java -@@ -83,7 +83,7 @@ - } +@@ -82,7 +82,7 @@ + } while(mobentity.func_104002_bU() || mobentity.func_213392_I()); final Entity entity_f = entity; - EntityClassification entityclassification = entity.func_200600_R().func_220339_d(); @@ -9,7 +9,7 @@ if (entityclassification != EntityClassification.MISC) { BlockPos blockpos = entity.func_233580_cy_(); long i = ChunkPos.func_77272_a(blockpos.func_177958_n() >> 4, blockpos.func_177952_p() >> 4); -@@ -171,13 +171,15 @@ +@@ -169,13 +169,15 @@ } mobentity.func_70012_b(d0, (double)i, d1, p_234966_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); @@ -20,22 +20,22 @@ ilivingentitydata = mobentity.func_213386_a(p_234966_1_, p_234966_1_.func_175649_E(mobentity.func_233580_cy_()), SpawnReason.NATURAL, ilivingentitydata, (CompoundNBT)null); ++j; ++l1; - p_234966_1_.func_217376_c(mobentity); + p_234966_1_.func_242417_l(mobentity); p_234966_5_.run(mobentity, p_234966_2_); - if (j >= mobentity.func_70641_bl()) { + if (j >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(mobentity)) { return; } -@@ -255,6 +257,7 @@ +@@ -253,6 +255,7 @@ return null; } else { - List list = func_241463_a_(p_234977_0_, p_234977_1_, p_234977_2_, p_234977_3_, p_234977_5_, biome); + List list = func_241463_a_(p_234977_0_, p_234977_1_, p_234977_2_, p_234977_3_, p_234977_5_, biome); + list = net.minecraftforge.event.ForgeEventFactory.getPotentialSpawns(p_234977_0_, p_234977_3_, p_234977_5_, list); return list.isEmpty() ? null : WeightedRandom.func_76271_a(p_234977_4_, list); } } -@@ -294,6 +297,13 @@ +@@ -292,6 +295,13 @@ if (p_209382_0_ == EntitySpawnPlacementRegistry.PlacementType.NO_RESTRICTIONS) { return true; } else if (p_209382_3_ != null && p_209382_1_.func_175723_af().func_177746_a(p_209382_2_)) { @@ -49,7 +49,7 @@ BlockState blockstate = p_209382_1_.func_180495_p(p_209382_2_); FluidState fluidstate = p_209382_1_.func_204610_c(p_209382_2_); BlockPos blockpos = p_209382_2_.func_177984_a(); -@@ -306,14 +316,12 @@ +@@ -304,14 +314,12 @@ case ON_GROUND: default: BlockState blockstate1 = p_209382_1_.func_180495_p(blockpos1); @@ -65,11 +65,11 @@ } } -@@ -356,6 +364,7 @@ +@@ -355,6 +363,7 @@ entity.func_70012_b(d0, (double)blockpos.func_177956_o(), d1, p_77191_4_.nextFloat() * 360.0F, 0.0F); if (entity instanceof MobEntity) { MobEntity mobentity = (MobEntity)entity; + if (net.minecraftforge.common.ForgeHooks.canEntitySpawn(mobentity, p_77191_0_, d0, blockpos.func_177956_o(), d1, null, SpawnReason.CHUNK_GENERATION) == -1) continue; if (mobentity.func_213380_a(p_77191_0_, SpawnReason.CHUNK_GENERATION) && mobentity.func_205019_a(p_77191_0_)) { ilivingentitydata = mobentity.func_213386_a(p_77191_0_, p_77191_0_.func_175649_E(mobentity.func_233580_cy_()), SpawnReason.CHUNK_GENERATION, ilivingentitydata, (CompoundNBT)null); - p_77191_0_.func_217376_c(mobentity); + p_77191_0_.func_242417_l(mobentity); diff --git a/patches/minecraft/net/minecraft/world/storage/PlayerData.java.patch b/patches/minecraft/net/minecraft/world/storage/PlayerData.java.patch index ee473921f..5f0d88899 100644 --- a/patches/minecraft/net/minecraft/world/storage/PlayerData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/PlayerData.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/storage/PlayerData.java +++ b/net/minecraft/world/storage/PlayerData.java -@@ -33,6 +33,7 @@ +@@ -31,6 +31,7 @@ File file2 = new File(this.field_237333_c_, p_237335_1_.func_189512_bd() + ".dat"); File file3 = new File(this.field_237333_c_, p_237335_1_.func_189512_bd() + ".dat_old"); Util.func_240977_a_(file2, file1, file3); @@ -8,7 +8,7 @@ } catch (Exception exception) { field_237332_b_.warn("Failed to save player data for {}", (Object)p_237335_1_.func_200200_C_().getString()); } -@@ -56,6 +57,7 @@ +@@ -54,6 +55,7 @@ int i = compoundnbt.func_150297_b("DataVersion", 3) ? compoundnbt.func_74762_e("DataVersion") : -1; p_237336_1_.func_70020_e(NBTUtil.func_210822_a(this.field_237331_a_, DefaultTypeReferences.PLAYER, compoundnbt, i)); } @@ -16,7 +16,7 @@ return compoundnbt; } -@@ -74,4 +76,8 @@ +@@ -72,4 +74,8 @@ return astring; } diff --git a/patches/minecraft/net/minecraft/world/storage/SaveFormat.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveFormat.java.patch index b8afa03b2..178a734ea 100644 --- a/patches/minecraft/net/minecraft/world/storage/SaveFormat.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/SaveFormat.java.patch @@ -1,38 +1,38 @@ --- a/net/minecraft/world/storage/SaveFormat.java +++ b/net/minecraft/world/storage/SaveFormat.java -@@ -169,6 +169,10 @@ +@@ -182,6 +182,10 @@ } private static BiFunction func_237270_b_(DynamicOps p_237270_0_, DatapackCodec p_237270_1_) { -+ return func_237270_b_(p_237270_0_, p_237270_1_, null); ++ return getReader(p_237270_0_, p_237270_1_, null); + } + -+ private static BiFunction func_237270_b_(DynamicOps p_237270_0_, DatapackCodec p_237270_1_, @Nullable LevelSave levelSave) { - return (p_237261_2_, p_237261_3_) -> { ++ private static BiFunction getReader(DynamicOps p_237270_0_, DatapackCodec p_237270_1_, @Nullable LevelSave levelSave) { + return (p_242976_2_, p_242976_3_) -> { try { - CompoundNBT compoundnbt = CompressedStreamTools.func_74796_a(new FileInputStream(p_237261_2_)); -@@ -180,7 +184,10 @@ - Pair pair = func_237259_a_(dynamic, p_237261_3_, i); + CompoundNBT compoundnbt = CompressedStreamTools.func_244263_a(p_242976_2_); +@@ -193,7 +197,10 @@ + Pair pair = func_237259_a_(dynamic, p_242976_3_, i); VersionData versiondata = VersionData.func_237324_a_(dynamic); WorldSettings worldsettings = WorldSettings.func_234951_a_(dynamic, p_237270_1_); -- return ServerWorldInfo.func_237369_a_(dynamic, p_237261_3_, i, compoundnbt2, worldsettings, versiondata, pair.getFirst(), pair.getSecond()); -+ ServerWorldInfo info = ServerWorldInfo.func_237369_a_(dynamic, p_237261_3_, i, compoundnbt2, worldsettings, versiondata, pair.getFirst(), pair.getSecond()); +- return ServerWorldInfo.func_237369_a_(dynamic, p_242976_3_, i, compoundnbt2, worldsettings, versiondata, pair.getFirst(), pair.getSecond()); ++ ServerWorldInfo info = ServerWorldInfo.func_237369_a_(dynamic, p_242976_3_, i, compoundnbt2, worldsettings, versiondata, pair.getFirst(), pair.getSecond()); + if (levelSave != null) + net.minecraftforge.fml.WorldPersistenceHooks.handleWorldDataLoad(levelSave, info, compoundnbt); + return info; } catch (Exception exception) { - field_215785_a.error("Exception reading {}", p_237261_2_, exception); + field_215785_a.error("Exception reading {}", p_242976_2_, exception); return null; -@@ -301,7 +308,7 @@ +@@ -314,7 +321,7 @@ @Nullable public IServerConfiguration func_237284_a_(DynamicOps p_237284_1_, DatapackCodec p_237284_2_) { this.func_237301_i_(); - return SaveFormat.this.func_237266_a_(this.field_237279_c_.toFile(), SaveFormat.func_237270_b_(p_237284_1_, p_237284_2_)); -+ return SaveFormat.this.func_237266_a_(this.field_237279_c_.toFile(), SaveFormat.func_237270_b_(p_237284_1_, p_237284_2_, this)); ++ return SaveFormat.this.func_237266_a_(this.field_237279_c_.toFile(), SaveFormat.getReader(p_237284_1_, p_237284_2_, this)); } @Nullable -@@ -322,6 +329,8 @@ +@@ -335,6 +342,8 @@ CompoundNBT compoundnbt1 = new CompoundNBT(); compoundnbt1.func_218657_a("Data", compoundnbt); @@ -40,8 +40,8 @@ + try { File file2 = File.createTempFile("level", ".dat", file1); - CompressedStreamTools.func_74799_a(compoundnbt1, new FileOutputStream(file2)); -@@ -339,6 +348,10 @@ + CompressedStreamTools.func_244264_a(compoundnbt1, file2); +@@ -352,6 +361,10 @@ return this.field_237279_c_.resolve("icon.png").toFile(); } diff --git a/patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch index 0e8ce906d..b57c9c7e3 100644 --- a/patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/storage/WorldSavedData.java +++ b/net/minecraft/world/storage/WorldSavedData.java -@@ -9,7 +9,7 @@ +@@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ private static final Logger field_215159_a = LogManager.getLogger(); private final String field_76190_i; private boolean field_76189_a; -@@ -53,4 +53,14 @@ +@@ -52,4 +52,14 @@ this.func_76186_a(false); } } diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java index f5f311743..8cb5d1c4e 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java @@ -64,16 +64,8 @@ public class ModFileInfo implements IModFileInfo, IConfigurable this.modLoaderVersion = config.getConfigElement("loaderVersion") .map(MavenVersionAdapter::createFromVersionSpec) .orElseThrow(()->new InvalidModFileException("Missing ModLoader version in file", this)); - String mcVersion = StringSubstitutor.replace("${global.mcVersion}", null); - if ("1.16.1".equals(mcVersion)) { - this.license = config.getConfigElement("license").orElse("All Rights Reserved (Default License, Modder Please specify)"); - } else { - throw new IllegalStateException("Code exists that should not in " + mcVersion + " Delete other case."); - } - /* Make license non-optional in >1.16.1, delete the above if, and uncomment the below lines when updating. this.license = config.getConfigElement("license") .orElseThrow(()->new InvalidModFileException("Missing License, please supply a license.", this)); - */ this.showAsResourcePack = config.getConfigElement("showAsResourcePack").orElse(false); this.properties = config.getConfigElement("properties"). map(UnmodifiableConfig::valueMap).orElse(Collections.emptyMap()); diff --git a/src/generated/resources/data/minecraft/recipes/brewing_stand.json b/src/generated/resources/data/minecraft/recipes/brewing_stand.json deleted file mode 100644 index 60586eb3e..000000000 --- a/src/generated/resources/data/minecraft/recipes/brewing_stand.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " B ", - "###" - ], - "key": { - "B": { - "item": "minecraft:blaze_rod" - }, - "#": { - "tag": "forge:cobblestone" - } - }, - "result": { - "item": "minecraft:brewing_stand" - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java b/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java index 88f299889..bff8c6e4a 100644 --- a/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java +++ b/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java @@ -19,13 +19,11 @@ package net.minecraftforge.client.event; +import net.minecraft.client.Minecraft; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.math.MathHelper; import net.minecraftforge.eventbus.api.Event; -/** - * Author: MachineMuse (Claire Semple) - * Created: 6:07 PM, 9/5/13 - */ public class FOVUpdateEvent extends Event { private final PlayerEntity entity; @@ -36,7 +34,7 @@ public class FOVUpdateEvent extends Event { this.entity = entity; this.fov = fov; - this.setNewfov(fov); + this.setNewfov(MathHelper.lerp(Minecraft.getInstance().gameSettings.field_243227_aN, 1.0F, fov)); } public PlayerEntity getEntity() diff --git a/src/main/java/net/minecraftforge/client/event/PlayerSPPushOutOfBlocksEvent.java b/src/main/java/net/minecraftforge/client/event/PlayerSPPushOutOfBlocksEvent.java deleted file mode 100644 index 0001feee2..000000000 --- a/src/main/java/net/minecraftforge/client/event/PlayerSPPushOutOfBlocksEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Minecraft Forge - * Copyright (c) 2016-2020. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package net.minecraftforge.client.event; - -import net.minecraft.entity.player.PlayerEntity; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.eventbus.api.Cancelable; - -/** - * This event is called before the pushOutOfBlocks calls in EntityPlayerSP. - * - * Cancelling the event will prevent pushOutOfBlocks from being called. - */ -@Cancelable -public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent -{ - private double minY; - - public PlayerSPPushOutOfBlocksEvent(PlayerEntity player) - { - super(player); - this.minY = player.getPosY() + 0.5D; - } - - public void setMinY(double value) { - this.minY = value; - } - - public double getMinY() { - return this.minY; - } -} diff --git a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java index ac2cece1a..73985db50 100644 --- a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java +++ b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java @@ -283,7 +283,7 @@ public class ForgeIngameGui extends IngameGui ItemStack itemstack = this.mc.player.inventory.armorItemInSlot(3); - if (this.mc.gameSettings.thirdPersonView == 0 && !itemstack.isEmpty()) + if (this.mc.gameSettings.func_243230_g().func_243192_a() && !itemstack.isEmpty()) { Item item = itemstack.getItem(); if (item == Blocks.CARVED_PUMPKIN.asItem()) @@ -684,7 +684,7 @@ public class ForgeIngameGui extends IngameGui RenderSystem.defaultBlendFunc(); int color = (animateOverlayMessageColor ? MathHelper.hsvToRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE); func_238448_a_(mStack, fontrenderer, -4, fontrenderer.func_238414_a_(overlayMessage), 16777215 | (opacity << 24)); - fontrenderer.func_238422_b_(mStack, overlayMessage, -fontrenderer.func_238414_a_(overlayMessage) / 2, -4, color | (opacity << 24)); + fontrenderer.func_238422_b_(mStack, overlayMessage.func_241878_f(), -fontrenderer.func_238414_a_(overlayMessage) / 2, -4, color | (opacity << 24)); RenderSystem.disableBlend(); RenderSystem.popMatrix(); } @@ -719,13 +719,13 @@ public class ForgeIngameGui extends IngameGui RenderSystem.pushMatrix(); RenderSystem.scalef(4.0F, 4.0F, 4.0F); int l = opacity << 24 & -16777216; - this.getFontRenderer().func_238407_a_(mStack, this.displayedTitle, (float)(-this.getFontRenderer().func_238414_a_(this.displayedTitle) / 2), -10.0F, 16777215 | l); + this.getFontRenderer().func_238407_a_(mStack, this.displayedTitle.func_241878_f(), (float)(-this.getFontRenderer().func_238414_a_(this.displayedTitle) / 2), -10.0F, 16777215 | l); RenderSystem.popMatrix(); if (this.displayedSubTitle != null) { RenderSystem.pushMatrix(); RenderSystem.scalef(2.0F, 2.0F, 2.0F); - this.getFontRenderer().func_238407_a_(mStack, this.displayedSubTitle, (float)(-this.getFontRenderer().func_238414_a_(this.displayedSubTitle) / 2), 5.0F, 16777215 | l); + this.getFontRenderer().func_238407_a_(mStack, this.displayedSubTitle.func_241878_f(), (float)(-this.getFontRenderer().func_238414_a_(this.displayedSubTitle) / 2), 5.0F, 16777215 | l); RenderSystem.popMatrix(); } RenderSystem.disableBlend(); diff --git a/src/main/java/net/minecraftforge/common/BiomeDictionary.java b/src/main/java/net/minecraftforge/common/BiomeDictionary.java index 7b87d74c9..8b00ea171 100644 --- a/src/main/java/net/minecraftforge/common/BiomeDictionary.java +++ b/src/main/java/net/minecraftforge/common/BiomeDictionary.java @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - +/* Biomes are completely redone in 1.16.2, reevaluate package net.minecraftforge.common; import java.util.*; @@ -48,25 +48,25 @@ public class BiomeDictionary private static final Map byName = new HashMap(); private static Collection allTypes = Collections.unmodifiableCollection(byName.values()); - /*Temperature-based tags. Specifying neither implies a biome is temperate*/ + /*Temperature-based tags. Specifying neither implies a biome is temperate* / public static final Type HOT = new Type("HOT"); public static final Type COLD = new Type("COLD"); - /*Tags specifying the amount of vegetation a biome has. Specifying neither implies a biome to have moderate amounts*/ + //Tags specifying the amount of vegetation a biome has. Specifying neither implies a biome to have moderate amounts* / public static final Type SPARSE = new Type("SPARSE"); public static final Type DENSE = new Type("DENSE"); - /*Tags specifying how moist a biome is. Specifying neither implies the biome as having moderate humidity*/ + //Tags specifying how moist a biome is. Specifying neither implies the biome as having moderate humidity* / public static final Type WET = new Type("WET"); public static final Type DRY = new Type("DRY"); /*Tree-based tags, SAVANNA refers to dry, desert-like trees (Such as Acacia), CONIFEROUS refers to snowy trees (Such as Spruce) and JUNGLE refers to jungle trees. - * Specifying no tag implies a biome has temperate trees (Such as Oak)*/ + * Specifying no tag implies a biome has temperate trees (Such as Oak)* / public static final Type SAVANNA = new Type("SAVANNA"); public static final Type CONIFEROUS = new Type("CONIFEROUS"); public static final Type JUNGLE = new Type("JUNGLE"); - /*Tags specifying the nature of a biome*/ + /*Tags specifying the nature of a biome* / public static final Type SPOOKY = new Type("SPOOKY"); public static final Type DEAD = new Type("DEAD"); public static final Type LUSH = new Type("LUSH"); @@ -80,10 +80,10 @@ public class BiomeDictionary public static final Type RIVER = new Type("RIVER"); /** * A general tag for all water-based biomes. Shown as present if OCEAN or RIVER are. - **/ + ** / public static final Type WATER = new Type("WATER", OCEAN, RIVER); - /*Generic types which a biome can be*/ + /*Generic types which a biome can be* / public static final Type MESA = new Type("MESA"); public static final Type FOREST = new Type("FOREST"); public static final Type PLAINS = new Type("PLAINS"); @@ -96,7 +96,7 @@ public class BiomeDictionary public static final Type BEACH = new Type("BEACH"); public static final Type VOID = new Type("VOID"); - /*Tags specifying the dimension a biome generates in. Specifying none implies a biome that generates in a modded dimension*/ + /*Tags specifying the dimension a biome generates in. Specifying none implies a biome that generates in a modded dimension* / public static final Type OVERWORLD = new Type("OVERWORLD"); public static final Type NETHER = new Type("NETHER"); public static final Type END = new Type("END"); @@ -116,7 +116,7 @@ public class BiomeDictionary /** * Gets the name for this type. - */ + * / public String getName() { return name; @@ -143,7 +143,7 @@ public class BiomeDictionary * * @param name The name of this Type * @return An instance of Type for this name. - */ + * / public static Type getType(String name, Type... subTypes) { name = name.toUpperCase(); @@ -157,7 +157,7 @@ public class BiomeDictionary /** * @return An unmodifiable collection of all current biome types. - */ + * / public static Collection getAll() { return allTypes; @@ -192,7 +192,7 @@ public class BiomeDictionary /** * Adds the given types to the biome. * - */ + * / public static void addTypes(Biome biome, Type... types) { Preconditions.checkArgument(ForgeRegistries.BIOMES.containsValue(biome), "Cannot add types to unregistered biome %s", biome); @@ -213,7 +213,7 @@ public class BiomeDictionary /** * Gets the set of biomes that have the given type. * - */ + * / @Nonnull public static Set getBiomes(Type type) { @@ -223,7 +223,7 @@ public class BiomeDictionary /** * Gets the set of types that have been added to the given biome. * - */ + * / @Nonnull public static Set getTypes(Biome biome) { @@ -235,7 +235,7 @@ public class BiomeDictionary * Checks if the two given biomes have types in common. * * @return returns true if a common type is found, false otherwise - */ + * / public static boolean areSimilar(Biome biomeA, Biome biomeB) { for (Type type : getTypes(biomeA)) @@ -252,7 +252,7 @@ public class BiomeDictionary /** * Checks if the given type has been added to the given biome. * - */ + * / public static boolean hasType(Biome biome, Type type) { return getTypes(biome).contains(type); @@ -261,7 +261,7 @@ public class BiomeDictionary /** * Checks if any type has been added to the given biome. * - */ + * / public static boolean hasAnyType(Biome biome) { return !getBiomeInfo(biome).types.isEmpty(); @@ -272,7 +272,7 @@ public class BiomeDictionary * If a biome's types are requested and no types have been added to the biome so far, the biome's types * will be determined and added using this method. * - */ + * / public static void makeBestGuess(Biome biome) { Type type = Type.fromVanilla(biome.getCategory()); @@ -337,7 +337,7 @@ public class BiomeDictionary /** * Ensure that at least one type has been added to the given biome. - */ + * / static void ensureHasTypes(Biome biome) { if (!hasAnyType(biome)) @@ -369,79 +369,79 @@ public class BiomeDictionary private static void registerVanillaBiomes() { - addTypes(Biomes.OCEAN, OCEAN, OVERWORLD); - addTypes(Biomes.PLAINS, PLAINS, OVERWORLD); - addTypes(Biomes.DESERT, HOT, DRY, SANDY, OVERWORLD); - addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS, OVERWORLD); - addTypes(Biomes.FOREST, FOREST, OVERWORLD); - addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD); - addTypes(Biomes.SWAMP, WET, SWAMP, OVERWORLD); - addTypes(Biomes.RIVER, RIVER, OVERWORLD); - addTypes(Biomes.field_235254_j_, HOT, DRY, NETHER); - addTypes(Biomes.THE_END, COLD, DRY, END); - addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY, OVERWORLD); - addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY, OVERWORLD); - addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND, OVERWORLD); - addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN, OVERWORLD); - addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE, OVERWORLD); - addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE, OVERWORLD); - addTypes(Biomes.BEACH, BEACH, OVERWORLD); - addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS, OVERWORLD); - addTypes(Biomes.WOODED_HILLS, FOREST, HILLS, OVERWORLD); - addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD); - addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN, OVERWORLD); - addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE, OVERWORLD); - addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS, OVERWORLD); - addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE, OVERWORLD); - addTypes(Biomes.DEEP_OCEAN, OCEAN, OVERWORLD); - addTypes(Biomes.STONE_SHORE, BEACH, OVERWORLD); - addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY, OVERWORLD); - addTypes(Biomes.BIRCH_FOREST, FOREST, OVERWORLD); - addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS, OVERWORLD); - addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST, OVERWORLD); - addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY, OVERWORLD); - addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS, OVERWORLD); - addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD); - addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD); - addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE, OVERWORLD); - addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE, OVERWORLD); - addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE, OVERWORLD, PLATEAU); - addTypes(Biomes.BADLANDS, MESA, SANDY, DRY, OVERWORLD); - addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SANDY, DRY, SPARSE, OVERWORLD, PLATEAU); - addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY, DRY, OVERWORLD, PLATEAU); - addTypes(Biomes.SMALL_END_ISLANDS, END); - addTypes(Biomes.END_MIDLANDS, END); - addTypes(Biomes.END_HIGHLANDS, END); - addTypes(Biomes.END_BARRENS, END); - addTypes(Biomes.WARM_OCEAN, OCEAN, HOT, OVERWORLD); - addTypes(Biomes.LUKEWARM_OCEAN, OCEAN, OVERWORLD); - addTypes(Biomes.COLD_OCEAN, OCEAN, COLD, OVERWORLD); - addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT, OVERWORLD); - addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN, OVERWORLD); - addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD, OVERWORLD); - addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD, OVERWORLD); - addTypes(Biomes.THE_VOID, VOID); - addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE, OVERWORLD); - addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE, OVERWORLD); - addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD); - addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE, OVERWORLD); - addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE, OVERWORLD); - addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE, OVERWORLD); - addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE, OVERWORLD); - addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE, OVERWORLD, MODIFIED); - addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE, OVERWORLD, MODIFIED); - addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE, OVERWORLD); - addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE, OVERWORLD); - addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE, OVERWORLD); - addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE, OVERWORLD); - addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE, OVERWORLD); - addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE, OVERWORLD); - addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD, MODIFIED); - addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE, OVERWORLD); - addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE, OVERWORLD, PLATEAU); - addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD); - addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE, OVERWORLD, PLATEAU, MODIFIED); - addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD, PLATEAU, MODIFIED); + addTypes(Biomes.OCEAN, OCEAN, OVERWORLD); + addTypes(Biomes.PLAINS, PLAINS, OVERWORLD); + addTypes(Biomes.DESERT, HOT, DRY, SANDY, OVERWORLD); + addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS, OVERWORLD); + addTypes(Biomes.FOREST, FOREST, OVERWORLD); + addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD); + addTypes(Biomes.SWAMP, WET, SWAMP, OVERWORLD); + addTypes(Biomes.RIVER, RIVER, OVERWORLD); + addTypes(Biomes.field_235254_j_, HOT, DRY, NETHER); + addTypes(Biomes.THE_END, COLD, DRY, END); + addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY, OVERWORLD); + addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY, OVERWORLD); + addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND, OVERWORLD); + addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN, OVERWORLD); + addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE, OVERWORLD); + addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE, OVERWORLD); + addTypes(Biomes.BEACH, BEACH, OVERWORLD); + addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS, OVERWORLD); + addTypes(Biomes.WOODED_HILLS, FOREST, HILLS, OVERWORLD); + addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD); + addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN, OVERWORLD); + addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE, OVERWORLD); + addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS, OVERWORLD); + addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE, OVERWORLD); + addTypes(Biomes.DEEP_OCEAN, OCEAN, OVERWORLD); + addTypes(Biomes.STONE_SHORE, BEACH, OVERWORLD); + addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY, OVERWORLD); + addTypes(Biomes.BIRCH_FOREST, FOREST, OVERWORLD); + addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS, OVERWORLD); + addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST, OVERWORLD); + addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY, OVERWORLD); + addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS, OVERWORLD); + addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD); + addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD); + addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE, OVERWORLD); + addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE, OVERWORLD); + addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE, OVERWORLD, PLATEAU); + addTypes(Biomes.BADLANDS, MESA, SANDY, DRY, OVERWORLD); + addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SANDY, DRY, SPARSE, OVERWORLD, PLATEAU); + addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY, DRY, OVERWORLD, PLATEAU); + addTypes(Biomes.SMALL_END_ISLANDS, END); + addTypes(Biomes.END_MIDLANDS, END); + addTypes(Biomes.END_HIGHLANDS, END); + addTypes(Biomes.END_BARRENS, END); + addTypes(Biomes.WARM_OCEAN, OCEAN, HOT, OVERWORLD); + addTypes(Biomes.LUKEWARM_OCEAN, OCEAN, OVERWORLD); + addTypes(Biomes.COLD_OCEAN, OCEAN, COLD, OVERWORLD); + addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT, OVERWORLD); + addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN, OVERWORLD); + addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD, OVERWORLD); + addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD, OVERWORLD); + addTypes(Biomes.THE_VOID, VOID); + addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE, OVERWORLD); + addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE, OVERWORLD); + addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD); + addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE, OVERWORLD); + addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE, OVERWORLD); + addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE, OVERWORLD); + addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE, OVERWORLD); + addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE, OVERWORLD, MODIFIED); + addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE, OVERWORLD, MODIFIED); + addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE, OVERWORLD); + addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE, OVERWORLD); + addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE, OVERWORLD); + addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE, OVERWORLD); + addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE, OVERWORLD); + addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE, OVERWORLD); + addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD, MODIFIED); + addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE, OVERWORLD); + addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE, OVERWORLD, PLATEAU); + addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD); + addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE, OVERWORLD, PLATEAU, MODIFIED); + addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD, PLATEAU, MODIFIED); if (DEBUG) { @@ -452,3 +452,4 @@ public class BiomeDictionary } } } +*/ diff --git a/src/main/java/net/minecraftforge/common/BiomeManager.java b/src/main/java/net/minecraftforge/common/BiomeManager.java index 33fcdd779..8c5472aea 100644 --- a/src/main/java/net/minecraftforge/common/BiomeManager.java +++ b/src/main/java/net/minecraftforge/common/BiomeManager.java @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - +/* Biomes are completely redone in 1.16.2, reevaluate package net.minecraftforge.common; import java.util.ArrayList; @@ -241,3 +241,4 @@ public class BiomeManager } } } +*/ diff --git a/src/main/java/net/minecraftforge/common/ForgeConfig.java b/src/main/java/net/minecraftforge/common/ForgeConfig.java index 940e00a32..0bead7c58 100644 --- a/src/main/java/net/minecraftforge/common/ForgeConfig.java +++ b/src/main/java/net/minecraftforge/common/ForgeConfig.java @@ -46,8 +46,6 @@ public class ForgeConfig public final IntValue dimensionUnloadQueueDelay; - public final IntValue clumpingThreshold; - public final BooleanValue treatEmptyTagsAsAir; public final BooleanValue fixAdvancementLoading; @@ -101,12 +99,6 @@ public class ForgeConfig .translation("forge.configgui.dimensionUnloadQueueDelay") .defineInRange("dimensionUnloadQueueDelay", 0, 0, Integer.MAX_VALUE); - clumpingThreshold = builder - .comment("Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024.") - .translation("forge.configgui.clumpingThreshold") - .worldRestart() - .defineInRange("clumpingThreshold", 64, 64, 1024); - treatEmptyTagsAsAir = builder .comment("Vanilla will treat crafting recipes using empty tags as air, and allow you to craft with nothing in that slot. This changes empty tags to use BARRIER as the item. To prevent crafting with air.") .translation("forge.configgui.treatEmptyTagsAsAir") diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 17027ff34..c8f10bcea 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -318,9 +318,9 @@ public class ForgeHooks return !MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount)); } - public static LivingKnockBackEvent onLivingKnockBack(LivingEntity target, Entity attacker, float strength, double ratioX, double ratioZ) + public static LivingKnockBackEvent onLivingKnockBack(LivingEntity target, float strength, double ratioX, double ratioZ) { - LivingKnockBackEvent event = new LivingKnockBackEvent(target, attacker, strength, ratioX, ratioZ); + LivingKnockBackEvent event = new LivingKnockBackEvent(target, strength, ratioX, ratioZ); MinecraftForge.EVENT_BUS.post(event); return event; } diff --git a/src/main/java/net/minecraftforge/common/Tags.java b/src/main/java/net/minecraftforge/common/Tags.java index 45b421368..6c2145ed2 100644 --- a/src/main/java/net/minecraftforge/common/Tags.java +++ b/src/main/java/net/minecraftforge/common/Tags.java @@ -19,18 +19,12 @@ package net.minecraftforge.common; -import java.util.Arrays; -import java.util.stream.Collectors; - import net.minecraft.block.Block; +import net.minecraft.item.DyeColor; import net.minecraft.item.Item; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ITag; import net.minecraft.tags.ItemTags; -import net.minecraft.util.RegistryKey; -import net.minecraft.util.registry.Registry; -import net.minecraftforge.common.util.ForgeNetworkTagManager; -import net.minecraftforge.registries.IForgeRegistryEntry; public class Tags { @@ -52,10 +46,10 @@ public class Tags public static final ITag.INamedTag DIRT = tag("dirt"); public static final ITag.INamedTag END_STONES = tag("end_stones"); public static final ITag.INamedTag FENCE_GATES = tag("fence_gates"); - public static final ITag.INamedTag FENCE_GATES_WOODEN = defaulted("fence_gates/wooden", net.minecraft.block.Blocks.OAK_FENCE_GATE, net.minecraft.block.Blocks.BIRCH_FENCE_GATE, net.minecraft.block.Blocks.SPRUCE_FENCE_GATE, net.minecraft.block.Blocks.JUNGLE_FENCE_GATE, net.minecraft.block.Blocks.DARK_OAK_FENCE_GATE, net.minecraft.block.Blocks.ACACIA_FENCE_GATE); + public static final ITag.INamedTag FENCE_GATES_WOODEN = tag("fence_gates/wooden"); public static final ITag.INamedTag FENCES = tag("fences"); public static final ITag.INamedTag FENCES_NETHER_BRICK = tag("fences/nether_brick"); - public static final ITag.INamedTag FENCES_WOODEN = defaulted("fences/wooden", net.minecraft.block.Blocks.OAK_FENCE, net.minecraft.block.Blocks.BIRCH_FENCE, net.minecraft.block.Blocks.SPRUCE_FENCE, net.minecraft.block.Blocks.JUNGLE_FENCE, net.minecraft.block.Blocks.DARK_OAK_FENCE, net.minecraft.block.Blocks.ACACIA_FENCE); + public static final ITag.INamedTag FENCES_WOODEN = tag("fences/wooden"); public static final ITag.INamedTag GLASS = tag("glass"); public static final ITag.INamedTag GLASS_BLACK = tag("glass/black"); @@ -130,12 +124,6 @@ public class Tags { return BlockTags.makeWrapperTag("forge:" + name); } - - @SuppressWarnings("deprecation") - private static ITag.INamedTag defaulted(String name, Block... values) - { - return ForgeNetworkTagManager.defaulted(Registry.field_239711_l_, tag(name), Arrays.asList(values).stream().map(e -> e.getRegistryName()).collect(Collectors.toSet())); - } } public static class Items @@ -162,32 +150,32 @@ public class Tags public static final ITag.INamedTag DUSTS_GLOWSTONE = tag("dusts/glowstone"); public static final ITag.INamedTag DYES = tag("dyes"); - public static final ITag.INamedTag DYES_BLACK = tag("dyes/black"); - public static final ITag.INamedTag DYES_RED = tag("dyes/red"); - public static final ITag.INamedTag DYES_GREEN = tag("dyes/green"); - public static final ITag.INamedTag DYES_BROWN = tag("dyes/brown"); - public static final ITag.INamedTag DYES_BLUE = tag("dyes/blue"); - public static final ITag.INamedTag DYES_PURPLE = tag("dyes/purple"); - public static final ITag.INamedTag DYES_CYAN = tag("dyes/cyan"); - public static final ITag.INamedTag DYES_LIGHT_GRAY = tag("dyes/light_gray"); - public static final ITag.INamedTag DYES_GRAY = tag("dyes/gray"); - public static final ITag.INamedTag DYES_PINK = tag("dyes/pink"); - public static final ITag.INamedTag DYES_LIME = tag("dyes/lime"); - public static final ITag.INamedTag DYES_YELLOW = tag("dyes/yellow"); - public static final ITag.INamedTag DYES_LIGHT_BLUE = tag("dyes/light_blue"); - public static final ITag.INamedTag DYES_MAGENTA = tag("dyes/magenta"); - public static final ITag.INamedTag DYES_ORANGE = tag("dyes/orange"); - public static final ITag.INamedTag DYES_WHITE = tag("dyes/white"); + public static final ITag.INamedTag DYES_BLACK = DyeColor.BLACK.getTag(); + public static final ITag.INamedTag DYES_RED = DyeColor.RED.getTag(); + public static final ITag.INamedTag DYES_GREEN = DyeColor.GREEN.getTag(); + public static final ITag.INamedTag DYES_BROWN = DyeColor.BROWN.getTag(); + public static final ITag.INamedTag DYES_BLUE = DyeColor.BLUE.getTag(); + public static final ITag.INamedTag DYES_PURPLE = DyeColor.PURPLE.getTag(); + public static final ITag.INamedTag DYES_CYAN = DyeColor.CYAN.getTag(); + public static final ITag.INamedTag DYES_LIGHT_GRAY = DyeColor.LIGHT_GRAY.getTag(); + public static final ITag.INamedTag DYES_GRAY = DyeColor.GRAY.getTag(); + public static final ITag.INamedTag DYES_PINK = DyeColor.PINK.getTag(); + public static final ITag.INamedTag DYES_LIME = DyeColor.LIME.getTag(); + public static final ITag.INamedTag DYES_YELLOW = DyeColor.YELLOW.getTag(); + public static final ITag.INamedTag DYES_LIGHT_BLUE = DyeColor.LIGHT_BLUE.getTag(); + public static final ITag.INamedTag DYES_MAGENTA = DyeColor.MAGENTA.getTag(); + public static final ITag.INamedTag DYES_ORANGE = DyeColor.ORANGE.getTag(); + public static final ITag.INamedTag DYES_WHITE = DyeColor.WHITE.getTag(); public static final ITag.INamedTag EGGS = tag("eggs"); public static final ITag.INamedTag END_STONES = tag("end_stones"); public static final ITag.INamedTag ENDER_PEARLS = tag("ender_pearls"); public static final ITag.INamedTag FEATHERS = tag("feathers"); public static final ITag.INamedTag FENCE_GATES = tag("fence_gates"); - public static final ITag.INamedTag FENCE_GATES_WOODEN = defaulted("fence_gates/wooden", Blocks.FENCE_GATES_WOODEN); + public static final ITag.INamedTag FENCE_GATES_WOODEN = tag("fence_gates/wooden"); public static final ITag.INamedTag FENCES = tag("fences"); public static final ITag.INamedTag FENCES_NETHER_BRICK = tag("fences/nether_brick"); - public static final ITag.INamedTag FENCES_WOODEN = defaulted("fences/wooden", Blocks.FENCES_WOODEN); + public static final ITag.INamedTag FENCES_WOODEN = tag("fences/wooden"); public static final ITag.INamedTag GEMS = tag("gems"); public static final ITag.INamedTag GEMS_DIAMOND = tag("gems/diamond"); public static final ITag.INamedTag GEMS_EMERALD = tag("gems/emerald"); @@ -293,11 +281,5 @@ public class Tags { return ItemTags.makeWrapperTag("forge:" + name); } - - @SuppressWarnings("deprecation") - private static ITag.INamedTag defaulted(String name, ITag.INamedTag parent) - { - return ForgeNetworkTagManager.defaulted(Registry.field_239714_o_, tag(name), RegistryKey.func_240903_a_(Registry.field_239711_l_, parent.func_230234_a_())); - } } } diff --git a/src/main/java/net/minecraftforge/common/crafting/conditions/TagEmptyCondition.java b/src/main/java/net/minecraftforge/common/crafting/conditions/TagEmptyCondition.java index 7ddbb94d8..4df7e2966 100644 --- a/src/main/java/net/minecraftforge/common/crafting/conditions/TagEmptyCondition.java +++ b/src/main/java/net/minecraftforge/common/crafting/conditions/TagEmptyCondition.java @@ -23,8 +23,6 @@ import com.google.gson.JsonObject; import net.minecraft.item.Item; import net.minecraft.tags.ITag; -import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag; import net.minecraft.tags.TagCollectionManager; import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; @@ -58,7 +56,7 @@ public class TagEmptyCondition implements ICondition @Override public boolean test() { - ITag tag = TagCollectionManager.func_232928_e_().func_232925_b_().get(tag_name); + ITag tag = TagCollectionManager.func_242178_a().func_241836_b().get(tag_name); return tag == null || tag.func_230236_b_().isEmpty(); } diff --git a/src/main/java/net/minecraftforge/common/data/LanguageProvider.java b/src/main/java/net/minecraftforge/common/data/LanguageProvider.java index 060a52111..e3a39f7bb 100644 --- a/src/main/java/net/minecraftforge/common/data/LanguageProvider.java +++ b/src/main/java/net/minecraftforge/common/data/LanguageProvider.java @@ -119,6 +119,7 @@ public abstract class LanguageProvider implements IDataProvider { add(key.getName(), name); } + /* public void addBiome(Supplier key, String name) { add(key.get(), name); } @@ -126,6 +127,7 @@ public abstract class LanguageProvider implements IDataProvider { public void add(Biome key, String name) { add(key.getTranslationKey(), name); } + */ public void addEffect(Supplier key, String name) { add(key.get(), name); diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index dd23d2f22..148e5ff2b 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -242,14 +242,15 @@ public interface IForgeBlock * @param state The current state * @param world The current world * @param pos Block position in world + * @param orientation The direction the entity is facing while getting into bed. * @param sleeper The sleeper or camera entity, null in some cases. * @return The spawn position */ - default Optional getBedSpawnPosition(EntityType entityType, BlockState state, IWorldReader world, BlockPos pos, @Nullable LivingEntity sleeper) + default Optional getBedSpawnPosition(EntityType entityType, BlockState state, IWorldReader world, BlockPos pos, float orientation, @Nullable LivingEntity sleeper) { if (world instanceof World) { - return BedBlock.func_220172_a(entityType, world,pos,0); + return BedBlock.func_242652_a(entityType, world, pos, orientation); } return Optional.empty(); @@ -516,7 +517,7 @@ public interface IForgeBlock * @param pos Block position in world * @return True, to support being part of a nether portal frame, false otherwise. */ - default boolean isPortalFrame(BlockState state, IWorldReader world, BlockPos pos) + default boolean isPortalFrame(BlockState state, IBlockReader world, BlockPos pos) { return state.isIn(Blocks.OBSIDIAN); } @@ -890,7 +891,7 @@ public interface IForgeBlock { return state.getBlock() instanceof BreakableBlock || state.getBlock() instanceof LeavesBlock; } - + /** * Returns the state that this block should transform into when right clicked by a tool. * For example: Used to determine if an axe can strip, a shovel can path, or a hoe can till. diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java index 46791f24a..d548c976b 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java @@ -195,12 +195,13 @@ public interface IForgeBlockState * * @param world The current world * @param pos Block position in world + * @param orientation The direction the entity is facing while getting into bed. * @param sleeper The sleeper or camera entity, null in some cases. * @return The spawn position */ - default Optional getBedSpawnPosition(EntityType type, IWorldReader world, BlockPos pos, @Nullable LivingEntity sleeper) + default Optional getBedSpawnPosition(EntityType type, IWorldReader world, BlockPos pos, float orientation, @Nullable LivingEntity sleeper) { - return getBlockState().getBlock().getBedSpawnPosition(type, getBlockState(), world, pos, sleeper); + return getBlockState().getBlock().getBedSpawnPosition(type, getBlockState(), world, pos, orientation, sleeper); } /** @@ -428,7 +429,7 @@ public interface IForgeBlockState * @param pos Block position in world * @return True, to support being part of a nether portal frame, false otherwise. */ - default boolean isPortalFrame(IWorldReader world, BlockPos pos) + default boolean isPortalFrame(IBlockReader world, BlockPos pos) { return getBlockState().getBlock().isPortalFrame(getBlockState(), world, pos); } @@ -778,7 +779,7 @@ public interface IForgeBlockState { return getBlockState().getBlock().shouldDisplayFluidOverlay(getBlockState(), world, pos, fluidState); } - + /** * Returns the state that this block should transform into when right clicked by a tool. * For example: Used to determine if an axe can strip, a shovel can path, or a hoe can till. diff --git a/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java b/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java index 9fb5d19b4..d6640a658 100644 --- a/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java +++ b/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java @@ -56,28 +56,28 @@ public class BlockSnapshot private WeakReference world; private String toString = null; - private BlockSnapshot(IWorld world, BlockPos pos, BlockState state, @Nullable CompoundNBT nbt, int flags) + private BlockSnapshot(RegistryKey dim, IWorld world, BlockPos pos, BlockState state, @Nullable CompoundNBT nbt, int flags) { - this.dim = world.getWorld().func_234923_W_(); + this.dim = dim; this.pos = pos.toImmutable(); this.block = state; this.flags = flags; this.nbt = nbt; - this.world = new WeakReference<>(world); + this.world = new WeakReference<>(world); if (DEBUG) System.out.println("Created " + this.toString()); } - public static BlockSnapshot create(IWorld world, BlockPos pos) + public static BlockSnapshot create(RegistryKey dim, IWorld world, BlockPos pos) { - return create(world, pos, 3); + return create(dim, world, pos, 3); } - public static BlockSnapshot create(IWorld world, BlockPos pos, int flag) + public static BlockSnapshot create(RegistryKey dim, IWorld world, BlockPos pos, int flag) { - return new BlockSnapshot(world, pos, world.getBlockState(pos), getTileNBT(world.getTileEntity(pos)), flag); + return new BlockSnapshot(dim, world, pos, world.getBlockState(pos), getTileNBT(world.getTileEntity(pos)), flag); } @Nullable @@ -88,8 +88,8 @@ public class BlockSnapshot public BlockState getCurrentBlock() { - IWorld world = getWorld(); - return world == null ? Blocks.AIR.getDefaultState() : world.getBlockState(this.pos); + IWorld world = getWorld(); + return world == null ? Blocks.AIR.getDefaultState() : world.getBlockState(this.pos); } @Nullable @@ -175,10 +175,10 @@ public class BlockSnapshot final BlockSnapshot other = (BlockSnapshot) obj; return this.dim.equals(other.dim) && - this.pos.equals(other.pos) && - this.block == other.block && - this.flags == other.flags && - Objects.equals(this.nbt, other.nbt); + this.pos.equals(other.pos) && + this.block == other.block && + this.flags == other.flags && + Objects.equals(this.nbt, other.nbt); } @Override @@ -196,18 +196,18 @@ public class BlockSnapshot @Override public String toString() { - if (toString == null) - { - this.toString = - "BlockSnapshot[" + - "World:" + this.dim.func_240901_a_() + ',' + - "Pos: " + this.pos + ',' + - "State: " + this.block + ',' + - "Flags: " + this.flags + ',' + - "NBT: " + (this.nbt == null ? "null" : this.nbt.toString()) + - ']'; - } - return this.toString; + if (toString == null) + { + this.toString = + "BlockSnapshot[" + + "World:" + this.dim.func_240901_a_() + ',' + + "Pos: " + this.pos + ',' + + "State: " + this.block + ',' + + "Flags: " + this.flags + ',' + + "NBT: " + (this.nbt == null ? "null" : this.nbt.toString()) + + ']'; + } + return this.toString; } public BlockPos getPos() { return pos; } diff --git a/src/main/java/net/minecraftforge/common/util/ForgeNetworkTagManager.java b/src/main/java/net/minecraftforge/common/util/ForgeNetworkTagManager.java deleted file mode 100644 index a26106ce7..000000000 --- a/src/main/java/net/minecraftforge/common/util/ForgeNetworkTagManager.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Minecraft Forge - * Copyright (c) 2016-2020. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package net.minecraftforge.common.util; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.annotation.Nullable; - -import com.google.common.collect.ImmutableSet; - -import net.minecraft.tags.ITag; -import net.minecraft.tags.NetworkTagCollection; -import net.minecraft.tags.NetworkTagManager; -import net.minecraft.tags.Tag; -import net.minecraft.util.RegistryKey; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.registry.Registry; - -@Deprecated //For Forge's internal use only. -public class ForgeNetworkTagManager extends NetworkTagManager -{ - private static Map, Set> defaults = new HashMap<>(); - - /** - * Returns a new instance of this tag manager, again, only exposed for Forge's Hook use. - */ - public static NetworkTagManager create() - { - return new ForgeNetworkTagManager(); - } - - /** - * This will provide default tags if the server side does not send us one. - * Note: If they DO send us a empty one, this DOES NOT override that. - * This is 100% intended to be only used by Forge tto make sure our tags behave correctly on vanilla servers for the edge cases where we use tags for in-game loogic. - * Notably: Furnace burnables. - */ - public static ITag.INamedTag defaulted(RegistryKey> type, ITag.INamedTag tag, Set values) - { - defaults.put(RegistryKey.func_240903_a_(type, tag.func_230234_a_()), ImmutableSet.copyOf(values)); - return tag; - } - - /** - * Copies the resource key from the parent tag to a new one. - * This simplifies the item variants of block tags. - * WILL explode if the parent hasn't been defaulted. - */ - public static ITag.INamedTag defaulted(RegistryKey> type, ITag.INamedTag tag, RegistryKey parent) - { - RegistryKey regKey = RegistryKey.func_240903_a_(type, tag.func_230234_a_()); - Set other = defaults.get(parent); - if (other == null) - throw new IllegalStateException("Attempted to set nested default without setting parent: " + regKey + " -> " + parent); - defaults.put(regKey, other); - return tag; - } - - private ForgeNetworkTagManager() - { - this.blocks = new ForgeNetworkTagCollection<>(Registry.BLOCK, "tags/blocks", "block"); - this.items = new ForgeNetworkTagCollection<>(Registry.ITEM, "tags/items", "item"); - this.fluids = new ForgeNetworkTagCollection<>(Registry.FLUID, "tags/fluids", "fluid"); - this.entityTypes = new ForgeNetworkTagCollection<>(Registry.ENTITY_TYPE, "tags/entity_types", "entity_type"); - } - - private static class ForgeNetworkTagCollection extends NetworkTagCollection - { - private final ITag EMPTY = Tag.func_241284_a_(); - private final Registry registry; - private final Map> cache = new HashMap<>(); - - public ForgeNetworkTagCollection(Registry registry, String path, String name) - { - super(registry, path, name); - this.registry = registry; - } - - @Override - @Nullable - public ITag get(ResourceLocation key) - { - ITag ret = super.get(key); - if (ret == null) - { - ret = cache.get(key); - if (ret == null) { - RegistryKey regKey = RegistryKey.func_240903_a_(this.registry.getRegistryKey(), key); - Set defaults = ForgeNetworkTagManager.defaults.get(regKey); - if (defaults == null) - { - ret = EMPTY; - } - else - { - Set values = defaults.stream().map(getEntryLookup()).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toSet()); - ret = Tag.func_241286_a_(values); - } - this.cache.put(key, ret); - } - } - - return ret; - } - } - -} diff --git a/src/main/java/net/minecraftforge/common/util/ReverseTagWrapper.java b/src/main/java/net/minecraftforge/common/util/ReverseTagWrapper.java index 80cd87c5d..68ea0d43a 100644 --- a/src/main/java/net/minecraftforge/common/util/ReverseTagWrapper.java +++ b/src/main/java/net/minecraftforge/common/util/ReverseTagWrapper.java @@ -26,19 +26,19 @@ import java.util.Set; import java.util.function.Supplier; import net.minecraft.tags.ITag; -import net.minecraft.tags.TagCollection; +import net.minecraft.tags.ITagCollection; import net.minecraft.util.ResourceLocation; public class ReverseTagWrapper { private final T target; - private final Supplier> colSupplier; + private final Supplier> colSupplier; //This map is immutable we track its identity change. private Map> colCache; private Set cache = null; - public ReverseTagWrapper(T target, Supplier> colSupplier) + public ReverseTagWrapper(T target, Supplier> colSupplier) { this.target = target; this.colSupplier = colSupplier; @@ -46,11 +46,11 @@ public class ReverseTagWrapper public Set getTagNames() { - TagCollection collection = colSupplier.get(); - if (cache == null || colCache != collection.getTagMap()) // Identity equals. + ITagCollection collection = colSupplier.get(); + if (cache == null || colCache != collection.func_241833_a()) // Identity equals. { this.cache = Collections.unmodifiableSet(new HashSet<>(collection.getOwningTags(target))); - this.colCache = collection.getTagMap(); + this.colCache = collection.func_241833_a(); } return this.cache; } diff --git a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java index 35d3b1f9d..0430157d1 100644 --- a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java +++ b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -29,6 +29,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.block.NetherPortalBlock; +import net.minecraft.block.PortalSize; import net.minecraft.block.BlockState; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.command.CommandSource; @@ -79,6 +80,7 @@ import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraft.world.WorldSettings; import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.MobSpawnInfo; import net.minecraft.world.storage.IServerWorldInfo; import net.minecraft.world.storage.PlayerData; import net.minecraftforge.api.distmarker.Dist; @@ -232,7 +234,7 @@ public class ForgeEventFactory } @Nullable - public static List getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, List oldList) + public static List getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, List oldList) { WorldEvent.PotentialSpawns event = new WorldEvent.PotentialSpawns(world, type, pos, oldList); if (MinecraftForge.EVENT_BUS.post(event)) @@ -363,7 +365,7 @@ public class ForgeEventFactory } return 0; } - + @Nullable public static BlockState onToolUse(BlockState originalState, World world, BlockPos pos, PlayerEntity player, ItemStack stack, ToolType toolType) { @@ -670,9 +672,10 @@ public class ForgeEventFactory return result == Result.DEFAULT ? def : result == Result.ALLOW; } - public static boolean onTrySpawnPortal(IWorld world, BlockPos pos, NetherPortalBlock.Size size) + public static Optional onTrySpawnPortal(IWorld world, BlockPos pos, Optional size) { - return MinecraftForge.EVENT_BUS.post(new BlockEvent.PortalSpawnEvent(world, pos, world.getBlockState(pos), size)); + if (!size.isPresent()) return size; + return MinecraftForge.EVENT_BUS.post(new BlockEvent.PortalSpawnEvent(world, pos, world.getBlockState(pos), size.get())) ? size : Optional.empty(); } public static int onEnchantmentLevelSet(World world, BlockPos pos, int enchantRow, int power, ItemStack itemStack, int level) @@ -740,7 +743,7 @@ public class ForgeEventFactory MinecraftForge.EVENT_BUS.post(event); return event.getListeners(); } - + public static void onCommandRegister(CommandDispatcher dispatcher, Commands.EnvironmentType environment) { RegisterCommandsEvent event = new RegisterCommandsEvent(dispatcher, environment); diff --git a/src/main/java/net/minecraftforge/event/TagsUpdatedEvent.java b/src/main/java/net/minecraftforge/event/TagsUpdatedEvent.java index 23d2abe89..c90e4473c 100644 --- a/src/main/java/net/minecraftforge/event/TagsUpdatedEvent.java +++ b/src/main/java/net/minecraftforge/event/TagsUpdatedEvent.java @@ -19,22 +19,21 @@ package net.minecraftforge.event; -import net.minecraft.tags.NetworkTagManager; +import net.minecraft.tags.ITagCollectionSupplier; import net.minecraftforge.eventbus.api.Event; /** - * Fired on the client when {@link NetworkTagManager} has all of its tags synced from the server to the client (just after a client has connected). - * Fired on the server when {@link NetworkTagManager} has read all tags from disk (during a data reload). + * Fired on the client when {@link ITagCollectionSupplier} has all of its tags synced from the server to the client (just after a client has connected). + * Fired on the server when {@link ITagCollectionSupplier} has read all tags from disk (during a data reload). * This event is fired on the {@link MinecraftForge#EVENT_BUS} * On the client, this event fires on the Client Thread. * On the server, this event may be fired on the Server Thread, or an async reloader thread. */ public class TagsUpdatedEvent extends Event { - - private final NetworkTagManager manager; - - public TagsUpdatedEvent(NetworkTagManager manager) + private final ITagCollectionSupplier manager; + + public TagsUpdatedEvent(ITagCollectionSupplier manager) { this.manager = manager; } @@ -42,7 +41,7 @@ public class TagsUpdatedEvent extends Event /** * @return The network tag manager that has been updated with newly received tags. */ - public NetworkTagManager getTagManager() + public ITagCollectionSupplier getTagManager() { return manager; } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingKnockBackEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingKnockBackEvent.java index 6d734b219..854cc2e8f 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingKnockBackEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingKnockBackEvent.java @@ -51,40 +51,31 @@ import net.minecraftforge.eventbus.api.Cancelable; @Cancelable public class LivingKnockBackEvent extends LivingEvent { - protected Entity attacker; protected float strength; protected double ratioX, ratioZ; - protected final Entity originalAttacker; protected final float originalStrength; protected final double originalRatioX, originalRatioZ; - public LivingKnockBackEvent(LivingEntity target, Entity attacker, float strength, double ratioX, double ratioZ) + public LivingKnockBackEvent(LivingEntity target, float strength, double ratioX, double ratioZ) { super(target); - this.attacker = this.originalAttacker = attacker; this.strength = this.originalStrength = strength; this.ratioX = this.originalRatioX = ratioX; this.ratioZ = this.originalRatioZ = ratioZ; } - public Entity getAttacker() {return this.attacker;} - public float getStrength() {return this.strength;} public double getRatioX() {return this.ratioX;} public double getRatioZ() {return this.ratioZ;} - public Entity getOriginalAttacker() {return this.originalAttacker;} - public float getOriginalStrength() {return this.originalStrength;} public double getOriginalRatioX() {return this.originalRatioX;} public double getOriginalRatioZ() {return this.originalRatioZ;} - public void setAttacker(Entity attacker) {this.attacker = attacker;} - public void setStrength(float strength) {this.strength = strength;} public void setRatioX(double ratioX) {this.ratioX = ratioX;} diff --git a/src/main/java/net/minecraftforge/event/world/BlockEvent.java b/src/main/java/net/minecraftforge/event/world/BlockEvent.java index 95a024c70..98026ec17 100644 --- a/src/main/java/net/minecraftforge/event/world/BlockEvent.java +++ b/src/main/java/net/minecraftforge/event/world/BlockEvent.java @@ -23,6 +23,7 @@ import java.util.EnumSet; import java.util.List; import net.minecraft.block.NetherPortalBlock; +import net.minecraft.block.PortalSize; import net.minecraft.block.BlockState; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -432,24 +433,24 @@ public class BlockEvent extends Event @Cancelable public static class PortalSpawnEvent extends BlockEvent { - private final NetherPortalBlock.Size size; + private final PortalSize size; - public PortalSpawnEvent(IWorld world, BlockPos pos, BlockState state, NetherPortalBlock.Size size) + public PortalSpawnEvent(IWorld world, BlockPos pos, BlockState state, PortalSize size) { super(world, pos, state); this.size = size; } - public NetherPortalBlock.Size getPortalSize() + public PortalSize getPortalSize() { return size; } } - + /** * Fired when when this block is right clicked by a tool to change its state. * For example: Used to determine if an axe can strip, a shovel can path, or a hoe can till. - * + * * This event is {@link Cancelable}. If canceled, this will prevent the tool * from changing the block's state. */ @@ -481,7 +482,7 @@ public class BlockEvent extends Event public ItemStack getHeldItemStack() { return stack; - } + } /**Gets the current type of the tool being compared against.*/ public ToolType getToolType() diff --git a/src/main/java/net/minecraftforge/event/world/WorldEvent.java b/src/main/java/net/minecraftforge/event/world/WorldEvent.java index 97ac16532..0335071f3 100644 --- a/src/main/java/net/minecraftforge/event/world/WorldEvent.java +++ b/src/main/java/net/minecraftforge/event/world/WorldEvent.java @@ -31,7 +31,7 @@ import net.minecraft.util.IProgressUpdate; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.WorldSettings; -import net.minecraft.world.biome.Biome.SpawnListEntry; +import net.minecraft.world.biome.MobSpawnInfo; import net.minecraft.world.storage.IServerWorldInfo; import net.minecraftforge.eventbus.api.Cancelable; import net.minecraftforge.eventbus.api.Event; @@ -128,17 +128,17 @@ public class WorldEvent extends Event { private final EntityClassification type; private final BlockPos pos; - private final List list; + private final List list; - public PotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, List oldList) + public PotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, List oldList) { super(world); this.pos = pos; this.type = type; if (oldList != null) - this.list = new ArrayList(oldList); + this.list = new ArrayList<>(oldList); else - this.list = new ArrayList(); + this.list = new ArrayList<>(); } public EntityClassification getType() @@ -151,7 +151,7 @@ public class WorldEvent extends Event return pos; } - public List getList() + public List getList() { return list; } diff --git a/src/main/java/net/minecraftforge/fluids/ForgeFlowingFluid.java b/src/main/java/net/minecraftforge/fluids/ForgeFlowingFluid.java index 847834e60..c70909e78 100644 --- a/src/main/java/net/minecraftforge/fluids/ForgeFlowingFluid.java +++ b/src/main/java/net/minecraftforge/fluids/ForgeFlowingFluid.java @@ -91,7 +91,7 @@ public abstract class ForgeFlowingFluid extends FlowingFluid protected void beforeReplacingBlock(IWorld worldIn, BlockPos pos, BlockState state) { TileEntity tileentity = state.getBlock().hasTileEntity(state) ? worldIn.getTileEntity(pos) : null; - Block.spawnDrops(state, worldIn.getWorld(), pos, tileentity); + Block.spawnDrops(state, worldIn, pos, tileentity); } @Override diff --git a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java index 6ac4e79cf..b49df05a1 100644 --- a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java +++ b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java @@ -41,7 +41,6 @@ import org.apache.logging.log4j.Logger; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; -import net.minecraft.client.resources.ClientResourcePackInfo; import net.minecraft.client.resources.DownloadingPackFinder; import net.minecraft.profiler.IProfiler; import net.minecraft.resources.data.PackMetadataSection; @@ -80,7 +79,7 @@ public class ClientModLoader private static LoadingFailedException error; private static EarlyLoaderGUI earlyLoaderGUI; - public static void begin(final Minecraft minecraft, final ResourcePackList defaultResourcePacks, final IReloadableResourceManager mcResourceManager, DownloadingPackFinder metadataSerializer) + public static void begin(final Minecraft minecraft, final ResourcePackList defaultResourcePacks, final IReloadableResourceManager mcResourceManager, DownloadingPackFinder metadataSerializer) { // force log4j to shutdown logging in a shutdown hook. This is because we disable default shutdown hook so the server properly logs it's shutdown Runtime.getRuntime().addShutdownHook(new Thread(LogManager::shutdown)); @@ -184,18 +183,18 @@ public class ClientModLoader return loading; } - private static ResourcePackLoader.IPackInfoFinder buildPackFinder(Map modResourcePacks, BiConsumer packSetter) { + private static ResourcePackLoader.IPackInfoFinder buildPackFinder(Map modResourcePacks, BiConsumer packSetter) { return (packList, factory) -> clientPackFinder(modResourcePacks, packSetter, packList, factory); } - private static void clientPackFinder(Map modResourcePacks, BiConsumer packSetter, Consumer consumer, ResourcePackInfo.IFactory factory) { + private static void clientPackFinder(Map modResourcePacks, BiConsumer packSetter, Consumer consumer, ResourcePackInfo.IFactory factory) { List hiddenPacks = new ArrayList<>(); for (Entry e : modResourcePacks.entrySet()) { IModInfo mod = e.getKey().getModInfos().get(0); if (Objects.equals(mod.getModId(), "minecraft")) continue; // skip the minecraft "mod" final String name = "mod:" + mod.getModId(); - final T packInfo = ResourcePackInfo.createResourcePack(name, false, e::getValue, factory, ResourcePackInfo.Priority.BOTTOM, IPackNameDecorator.field_232625_a_); + final ResourcePackInfo packInfo = ResourcePackInfo.createResourcePack(name, false, e::getValue, factory, ResourcePackInfo.Priority.BOTTOM, IPackNameDecorator.field_232625_a_); if (packInfo == null) { // Vanilla only logs an error, instead of propagating, so handle null and warn that something went wrong ModLoader.get().addWarning(new ModLoadingWarning(mod, ModLoadingStage.ERROR, "fml.modloading.brokenresources", e.getKey())); @@ -209,7 +208,7 @@ public class ClientModLoader hiddenPacks.add(e.getValue()); } } - final T packInfo = ResourcePackInfo.createResourcePack("mod_resources", true, () -> new DelegatingResourcePack("mod_resources", "Mod Resources", + final ResourcePackInfo packInfo = ResourcePackInfo.createResourcePack("mod_resources", true, () -> new DelegatingResourcePack("mod_resources", "Mod Resources", new PackMetadataSection(new TranslationTextComponent("fml.resources.modresources", hiddenPacks.size()), 5), hiddenPacks), factory, ResourcePackInfo.Priority.BOTTOM, IPackNameDecorator.field_232625_a_); consumer.accept(packInfo); diff --git a/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java b/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java index f55286147..c1bf4c20a 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/GuiUtils.java @@ -27,6 +27,7 @@ import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; +import net.minecraft.util.IReorderingProcessor; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.vector.Matrix4f; import net.minecraft.util.text.ITextProperties; @@ -240,7 +241,8 @@ public class GuiUtils cachedTooltipStack = ItemStack.EMPTY; } - public static void drawHoveringText(MatrixStack mStack, List textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font) + /* + public static void drawHoveringText(MatrixStack mStack, List textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font) { drawHoveringText(mStack, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth, DEFAULT_BACKGROUND_COLOR, DEFAULT_BORDER_COLOR_START, DEFAULT_BORDER_COLOR_END, font); } @@ -263,8 +265,8 @@ public class GuiUtils * @param borderColorEnd The ending color of the box border. The border color will be smoothly interpolated * between the start and end values. * @param font the font for drawing the text in the tooltip box - */ - public static void drawHoveringText(MatrixStack mStack, List textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, + * / + public static void drawHoveringText(MatrixStack mStack, List textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, int backgroundColor, int borderColorStart, int borderColorEnd, FontRenderer font) { drawHoveringText(cachedTooltipStack, mStack, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth, backgroundColor, borderColorStart, borderColorEnd, font); @@ -279,9 +281,9 @@ public class GuiUtils * Use this version if calling from somewhere where ItemStack context is available. * * @see #drawHoveringText(MatrixStack, List, int, int, int, int, int, int, int, int, FontRenderer) - */ + * / //TODO, Validate rendering is the same as the original - public static void drawHoveringText(@Nonnull final ItemStack stack, MatrixStack mStack, List textLines, int mouseX, int mouseY, + public static void drawHoveringText(@Nonnull final ItemStack stack, MatrixStack mStack, List textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, int backgroundColor, int borderColorStart, int borderColorEnd, FontRenderer font) { @@ -301,7 +303,7 @@ public class GuiUtils RenderSystem.disableDepthTest(); int tooltipTextWidth = 0; - for (ITextProperties textLine : textLines) + for (IReorderingProcessor textLine : textLines) { int textLineWidth = font.func_238414_a_(textLine); if (textLineWidth > tooltipTextWidth) @@ -422,6 +424,7 @@ public class GuiUtils RenderSystem.enableRescaleNormal(); } } + */ public static void drawGradientRect(Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { diff --git a/src/main/java/net/minecraftforge/fml/client/gui/screen/LoadingErrorScreen.java b/src/main/java/net/minecraftforge/fml/client/gui/screen/LoadingErrorScreen.java index 097f409aa..ecd2f1cec 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/screen/LoadingErrorScreen.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/screen/LoadingErrorScreen.java @@ -25,6 +25,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.screen.ErrorScreen; import net.minecraft.client.gui.widget.list.ExtendedList; +import net.minecraft.util.IReorderingProcessor; import net.minecraft.util.Util; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextProperties; @@ -100,8 +101,8 @@ public class LoadingErrorScreen extends ErrorScreen { } private void drawMultiLineCenteredString(MatrixStack mStack, FontRenderer fr, ITextComponent str, int x, int y) { - for (ITextProperties s : fr.func_238425_b_(str, this.field_230708_k_)) { - fr.func_238407_a_(mStack, s, (float) (x - fr.func_238414_a_(s) / 2.0), y, 0xFFFFFF); + for (IReorderingProcessor s : fr.func_238425_b_(str, this.field_230708_k_)) { + fr.func_238407_a_(mStack, s, (float) (x - fr.func_243245_a(s) / 2.0), y, 0xFFFFFF); y+=fr.FONT_HEIGHT; } } @@ -148,11 +149,11 @@ public class LoadingErrorScreen extends ErrorScreen { @Override public void func_230432_a_(MatrixStack mStack, int entryIdx, int top, int left, final int entryWidth, final int entryHeight, final int mouseX, final int mouseY, final boolean p_194999_5_, final float partialTicks) { FontRenderer font = Minecraft.getInstance().fontRenderer; - final List strings = font.func_238425_b_(message, LoadingEntryList.this.field_230670_d_); + final List strings = font.func_238425_b_(message, LoadingEntryList.this.field_230670_d_); int y = top + 2; for (int i = 0; i < Math.min(strings.size(), 2); i++) { if (center) - font.func_238422_b_(mStack, strings.get(i), left + (field_230670_d_) - font.func_238414_a_(strings.get(i)) / 2F, y, 0xFFFFFF); + font.func_238422_b_(mStack, strings.get(i), left + (field_230670_d_) - font.func_243245_a(strings.get(i)) / 2F, y, 0xFFFFFF); else font.func_238422_b_(mStack, strings.get(i), left + 5, y, 0xFFFFFF); y += font.FONT_HEIGHT; diff --git a/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java b/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java index 45f9d6898..36b77d6d2 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/screen/ModListScreen.java @@ -51,6 +51,7 @@ import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.client.renderer.texture.NativeImage; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.resources.I18n; +import net.minecraft.util.IReorderingProcessor; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Util; import net.minecraftforge.client.gui.ScrollPanel; @@ -130,7 +131,7 @@ public class ModListScreen extends Screen class InfoPanel extends ScrollPanel { private ResourceLocation logoPath; private Size2i logoDims = new Size2i(0, 0); - private List lines = Collections.emptyList(); + private List lines = Collections.emptyList(); InfoPanel(Minecraft mcIn, int widthIn, int heightIn, int topIn) { @@ -151,9 +152,9 @@ public class ModListScreen extends Screen this.lines = Collections.emptyList(); } - private List resizeContent(List lines) + private List resizeContent(List lines) { - List ret = new ArrayList<>(); + List ret = new ArrayList<>(); for (String line : lines) { if (line == null) @@ -166,7 +167,7 @@ public class ModListScreen extends Screen int maxTextLength = this.width - 12; if (maxTextLength >= 0) { - ret.addAll(field_230712_o_.func_238420_b_().func_238362_b_(chat, maxTextLength, Style.field_240709_b_)); + ret.addAll(LanguageMap.getInstance().func_244260_a(field_230712_o_.func_238420_b_().func_238362_b_(chat, maxTextLength, Style.field_240709_b_))); } } return ret; @@ -201,7 +202,7 @@ public class ModListScreen extends Screen relativeY += headerHeight + PADDING; } - for (ITextProperties line : lines) + for (IReorderingProcessor line : lines) { if (line != null) { @@ -231,10 +232,10 @@ public class ModListScreen extends Screen if (lineIdx >= lines.size() || lineIdx < 1) return null; - ITextProperties line = lines.get(lineIdx-1); + IReorderingProcessor line = lines.get(lineIdx-1); if (line != null) { - return field_230712_o_.func_238420_b_().func_238357_a_(line, mouseX); + return field_230712_o_.func_238420_b_().func_243239_a(line, mouseX); } return null; } @@ -375,7 +376,7 @@ public class ModListScreen extends Screen ITextComponent text = new TranslationTextComponent("fml.menu.mods.search"); int x = modList.getLeft() + ((modList.getRight() - modList.getLeft()) / 2) - (getFontRenderer().func_238414_a_(text) / 2); - getFontRenderer().func_238422_b_(mStack, text, x, search.field_230691_m_ - getFontRenderer().FONT_HEIGHT, 0xFFFFFF); + getFontRenderer().func_238422_b_(mStack, text.func_241878_f(), x, search.field_230691_m_ - getFontRenderer().FONT_HEIGHT, 0xFFFFFF); this.search.func_230430_a_(mStack, mouseX , mouseY, partialTicks); super.func_230430_a_(mStack, mouseX, mouseY, partialTicks); } diff --git a/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java b/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java index 7962f509f..64a9676dd 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/widget/ExtendedButton.java @@ -66,7 +66,7 @@ public class ExtendedButton extends Button //TODO, srg names make it hard to figure out how to append to an ITextProperties from this trim operation, wraping this in StringTextComponent is kinda dirty. buttonText = new StringTextComponent(mc.fontRenderer.func_238417_a_(buttonText, field_230688_j_ - 6 - ellipsisWidth).getString() + "..."); - this.func_238472_a_(mStack, mc.fontRenderer, buttonText, this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, getFGColor()); + func_238472_a_(mStack, mc.fontRenderer, buttonText, this.field_230690_l_ + this.field_230688_j_ / 2, this.field_230691_m_ + (this.field_230689_k_ - 8) / 2, getFGColor()); } } } diff --git a/src/main/java/net/minecraftforge/fml/client/gui/widget/ModListWidget.java b/src/main/java/net/minecraftforge/fml/client/gui/widget/ModListWidget.java index 8299030da..882ef8188 100644 --- a/src/main/java/net/minecraftforge/fml/client/gui/widget/ModListWidget.java +++ b/src/main/java/net/minecraftforge/fml/client/gui/widget/ModListWidget.java @@ -26,6 +26,8 @@ import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.gui.widget.list.ExtendedList; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.ITextProperties; +import net.minecraft.util.text.LanguageMap; import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.fml.client.gui.screen.ModListScreen; import net.minecraftforge.versions.forge.ForgeVersion; @@ -90,8 +92,8 @@ public class ModListWidget extends ExtendedList ITextComponent version = new StringTextComponent(stripControlCodes(MavenVersionStringHelper.artifactVersionToString(modInfo.getVersion()))); VersionChecker.CheckResult vercheck = VersionChecker.getResult(modInfo); FontRenderer font = this.parent.getFontRenderer(); - font.func_238422_b_(mStack, font.func_238417_a_(name, listWidth),left + 3, top + 2, 0xFFFFFF); - font.func_238422_b_(mStack, font.func_238417_a_(version, listWidth), left + 3 , top + 2 + font.FONT_HEIGHT, 0xCCCCCC); + font.func_238422_b_(mStack, LanguageMap.getInstance().func_241870_a(ITextProperties.func_240655_a_(font.func_238417_a_(name, listWidth))), left + 3, top + 2, 0xFFFFFF); + font.func_238422_b_(mStack, LanguageMap.getInstance().func_241870_a(ITextProperties.func_240655_a_(font.func_238417_a_(version, listWidth))), left + 3, top + 2 + font.FONT_HEIGHT, 0xCCCCCC); if (vercheck.status.shouldDraw()) { //TODO: Consider adding more icons for visualization diff --git a/src/main/java/net/minecraftforge/fml/packs/ResourcePackLoader.java b/src/main/java/net/minecraftforge/fml/packs/ResourcePackLoader.java index 35c401d20..591c5d4a8 100644 --- a/src/main/java/net/minecraftforge/fml/packs/ResourcePackLoader.java +++ b/src/main/java/net/minecraftforge/fml/packs/ResourcePackLoader.java @@ -36,6 +36,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import net.minecraft.resources.IPackFinder; import net.minecraft.resources.ResourcePackInfo; +import net.minecraft.resources.ResourcePackInfo.IFactory; import net.minecraft.resources.ResourcePackList; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.loading.moddiscovery.ModFile; @@ -44,7 +45,7 @@ import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo; public class ResourcePackLoader { private static Map modResourcePacks; - private static ResourcePackList resourcePackList; + private static ResourcePackList resourcePackList; public static Optional getResourcePackFor(String modId) { @@ -52,7 +53,7 @@ public class ResourcePackLoader map(ModFileInfo::getFile).map(mf->modResourcePacks.get(mf)); } - public static void loadResourcePacks(ResourcePackList resourcePacks, BiFunction, BiConsumer, IPackInfoFinder> packFinder) { + public static void loadResourcePacks(ResourcePackList resourcePacks, BiFunction, BiConsumer, IPackInfoFinder> packFinder) { resourcePackList = resourcePacks; modResourcePacks = ModList.get().getModFiles().stream(). filter(mf->!Objects.equals(mf.getModLoader(),"minecraft")). @@ -96,8 +97,8 @@ public class ResourcePackLoader }; } - public interface IPackInfoFinder { - void addPackInfos(Consumer consumer, ResourcePackInfo.IFactory factory); + public interface IPackInfoFinder { + void addPackInfos(Consumer consumer, IFactory factory); } // SO GROSS - DON'T @ me bro @@ -110,7 +111,7 @@ public class ResourcePackLoader } @Override - public void func_230230_a_(Consumer consumer, ResourcePackInfo.IFactory factory) + public void func_230230_a_(Consumer consumer, IFactory factory) { wrapped.addPackInfos(consumer, factory); } diff --git a/src/main/java/net/minecraftforge/fml/server/ServerLifecycleHooks.java b/src/main/java/net/minecraftforge/fml/server/ServerLifecycleHooks.java index 107ab5d04..7b58a2f31 100644 --- a/src/main/java/net/minecraftforge/fml/server/ServerLifecycleHooks.java +++ b/src/main/java/net/minecraftforge/fml/server/ServerLifecycleHooks.java @@ -214,17 +214,17 @@ public class ServerLifecycleHooks //INTERNAL MODDERS DO NOT USE @Deprecated - public static ResourcePackLoader.IPackInfoFinder buildPackFinder(Map modResourcePacks, BiConsumer packSetter) { + public static ResourcePackLoader.IPackInfoFinder buildPackFinder(Map modResourcePacks, BiConsumer packSetter) { return (packList, factory) -> serverPackFinder(modResourcePacks, packSetter, packList, factory); } - private static void serverPackFinder(Map modResourcePacks, BiConsumer packSetter, Consumer consumer, ResourcePackInfo.IFactory factory) { + private static void serverPackFinder(Map modResourcePacks, BiConsumer packSetter, Consumer consumer, ResourcePackInfo.IFactory factory) { for (Entry e : modResourcePacks.entrySet()) { IModInfo mod = e.getKey().getModInfos().get(0); if (Objects.equals(mod.getModId(), "minecraft")) continue; // skip the minecraft "mod" final String name = "mod:" + mod.getModId(); - final T packInfo = ResourcePackInfo.createResourcePack(name, true, e::getValue, factory, ResourcePackInfo.Priority.BOTTOM, IPackNameDecorator.field_232625_a_); + final ResourcePackInfo packInfo = ResourcePackInfo.createResourcePack(name, true, e::getValue, factory, ResourcePackInfo.Priority.BOTTOM, IPackNameDecorator.field_232625_a_); if (packInfo == null) { // Vanilla only logs an error, instead of propagating, so handle null and warn that something went wrong ModLoader.get().addWarning(new ModLoadingWarning(mod, ModLoadingStage.ERROR, "fml.modloading.brokenresources", e.getKey())); diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java index 612beea92..56e97ffcb 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java @@ -32,6 +32,7 @@ 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.util.registry.Registry; import net.minecraft.village.PointOfInterestType; import net.minecraft.item.Item; import net.minecraft.item.crafting.IRecipeSerializer; @@ -40,6 +41,8 @@ import net.minecraft.potion.Effect; import net.minecraft.potion.Potion; import net.minecraft.stats.StatType; import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkStatus; @@ -70,7 +73,6 @@ public class ForgeRegistries public static final IForgeRegistry FLUIDS = RegistryManager.ACTIVE.getRegistry(Fluid.class); public static final IForgeRegistry ITEMS = RegistryManager.ACTIVE.getRegistry(Item.class); public static final IForgeRegistry POTIONS = RegistryManager.ACTIVE.getRegistry(Effect.class); - public static final IForgeRegistry BIOMES = RegistryManager.ACTIVE.getRegistry(Biome.class); public static final IForgeRegistry SOUND_EVENTS = RegistryManager.ACTIVE.getRegistry(SoundEvent.class); public static final IForgeRegistry POTION_TYPES = RegistryManager.ACTIVE.getRegistry(Potion.class); public static final IForgeRegistry ENCHANTMENTS = RegistryManager.ACTIVE.getRegistry(Enchantment.class); @@ -96,7 +98,6 @@ public class ForgeRegistries public static final IForgeRegistry> SURFACE_BUILDERS = RegistryManager.ACTIVE.getRegistry(SurfaceBuilder.class); public static final IForgeRegistry> FEATURES = RegistryManager.ACTIVE.getRegistry(Feature.class); public static final IForgeRegistry> DECORATORS = RegistryManager.ACTIVE.getRegistry(Placement.class); -// public static final IForgeRegistry> CHUNK_GENERATOR_TYPES = RegistryManager.ACTIVE.getRegistry(ChunkGeneratorType.class); public static final IForgeRegistry CHUNK_STATUS = RegistryManager.ACTIVE.getRegistry(ChunkStatus.class); public static final IForgeRegistry> STRUCTURE_FEATURES = RegistryManager.ACTIVE.getRegistry(Structure.class); public static final IForgeRegistry> BLOCK_STATE_PROVIDER_TYPES = RegistryManager.ACTIVE.getRegistry(BlockStateProviderType.class); @@ -108,11 +109,57 @@ public class ForgeRegistries public static final IForgeRegistry DATA_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(DataSerializerEntry.class); public static final IForgeRegistry> LOOT_MODIFIER_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(GlobalLootModifierSerializer.class); + public static final class Keys { + //Vanilla + public static final RegistryKey> BLOCKS = key("block"); + public static final RegistryKey> FLUIDS = key("fluid"); + public static final RegistryKey> ITEMS = key("item"); + public static final RegistryKey> EFFECTS = key("mob_effect"); + public static final RegistryKey> POTIONS = key("potion"); + public static final RegistryKey> ATTRIBUTES = key("attribute"); + public static final RegistryKey>> STAT_TYPES = key("stat_type"); + public static final RegistryKey> SOUND_EVENTS = key("sound_event"); + public static final RegistryKey> ENCHANTMENTS = key("enchantment"); + public static final RegistryKey>> ENTITY_TYPES = key("entity_type"); + public static final RegistryKey> PAINTING_TYPES = key("motive"); + public static final RegistryKey>> PARTICLE_TYPES = key("particle_type"); + public static final RegistryKey>> CONTAINER_TYPES = key("menu"); + public static final RegistryKey>> TILE_ENTITY_TYPES = key("block_entity_type"); + public static final RegistryKey>> RECIPE_SERIALIZERS = key("recipe_serializer"); + public static final RegistryKey> VILLAGER_PROFESSIONS = key("villager_profession"); + public static final RegistryKey> POI_TYPES = key("point_of_interest_type"); + public static final RegistryKey>> MEMORY_MODULE_TYPES = key("memory_module_type"); + public static final RegistryKey>> SENSOR_TYPES = key("sensor_type"); + public static final RegistryKey> SCHEDULES = key("schedule"); + public static final RegistryKey> ACTIVITIES = key("activity"); + public static final RegistryKey>> WORLD_CARVERS = key("worldgen/carver"); + public static final RegistryKey>> SURFACE_BUILDERS = key("worldgen/surface_builder"); + public static final RegistryKey>> FEATURES = key("worldgen/feature"); + public static final RegistryKey>> DECORATORS = key("worldgen/decorator"); + public static final RegistryKey> CHUNK_STATUS = key("chunk_status"); + public static final RegistryKey>> STRUCTURE_FEATURES = key("worldgen/structure_feature"); + public static final RegistryKey>> BLOCK_STATE_PROVIDER_TYPES = key("worldgen/block_state_provider_type"); + public static final RegistryKey>> BLOCK_PLACER_TYPES = key("worldgen/block_placer_type"); + public static final RegistryKey>> FOLIAGE_PLACER_TYPES = key("worldgen/foliage_placer_type"); + public static final RegistryKey>> TREE_DECORATOR_TYPES = key("worldgen/tree_decorator_type"); + + //Forge + public static final RegistryKey> DATA_SERIALIZERS = key("data_serializers"); + public static final RegistryKey>> LOOT_MODIFIER_SERIALIZERS = key("forge:loot_modifier_serializers"); + + private static RegistryKey> key(String name) + { + return RegistryKey.func_240904_a_(new ResourceLocation(name)); + } + private static void init() {} + } + /** * This function is just to make sure static inializers in other classes have run and setup their registries before we query them. */ private static void init() { + Keys.init(); GameData.init(); Bootstrap.register(); Tags.init(); diff --git a/src/main/java/net/minecraftforge/registries/GameData.java b/src/main/java/net/minecraftforge/registries/GameData.java index 57359fc84..7d599a4c1 100644 --- a/src/main/java/net/minecraftforge/registries/GameData.java +++ b/src/main/java/net/minecraftforge/registries/GameData.java @@ -20,6 +20,7 @@ package net.minecraftforge.registries; import com.google.common.collect.*; +import com.mojang.serialization.Lifecycle; import net.minecraft.block.AirBlock; import net.minecraft.block.Block; @@ -48,13 +49,13 @@ import net.minecraft.state.StateContainer; import net.minecraft.stats.StatType; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.ObjectIntIdentityMap; +import net.minecraft.util.RegistryKey; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.registry.DefaultedRegistry; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.SimpleRegistry; import net.minecraft.village.PointOfInterestType; -import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.gen.DebugChunkGenerator; import net.minecraft.world.gen.blockplacer.BlockPlacerType; @@ -97,6 +98,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import static net.minecraftforge.registries.ForgeRegistry.REGISTRIES; +import static net.minecraftforge.registries.ForgeRegistries.Keys.*; /** * INTERNAL ONLY @@ -105,53 +107,6 @@ import static net.minecraftforge.registries.ForgeRegistry.REGISTRIES; public class GameData { private static final Logger LOGGER = LogManager.getLogger(); - - // Vanilla registries - // Names used here match those in net.minecraft.util.Registry - - // Game objects - private static final ResourceLocation BLOCKS = new ResourceLocation("block"); - private static final ResourceLocation FLUIDS = new ResourceLocation("fluid"); - private static final ResourceLocation ITEMS = new ResourceLocation("item"); - private static final ResourceLocation POTIONS = new ResourceLocation("mob_effect"); - private static final ResourceLocation BIOMES = new ResourceLocation("biome"); - private static final ResourceLocation SOUNDEVENTS = new ResourceLocation("sound_event"); - private static final ResourceLocation POTIONTYPES = new ResourceLocation("potion"); - private static final ResourceLocation ENCHANTMENTS = new ResourceLocation("enchantment"); - private static final ResourceLocation ENTITIES = new ResourceLocation("entity_type"); - private static final ResourceLocation TILEENTITIES = new ResourceLocation("block_entity_type"); - private static final ResourceLocation PARTICLE_TYPES = new ResourceLocation("particle_type"); - private static final ResourceLocation CONTAINERS = new ResourceLocation("menu"); - private static final ResourceLocation PAINTING_TYPES = new ResourceLocation("motive"); // sic - private static final ResourceLocation RECIPE_SERIALIZERS = new ResourceLocation("recipe_serializer"); - private static final ResourceLocation ATTRIBUTES = new ResourceLocation("attribute"); - private static final ResourceLocation STAT_TYPES = new ResourceLocation("stat_type"); - - // Villages - private static final ResourceLocation PROFESSIONS = new ResourceLocation("villager_profession"); - private static final ResourceLocation POI_TYPES = new ResourceLocation("point_of_interest_type"); - private static final ResourceLocation MEMORY_MODULE_TYPES = new ResourceLocation("memory_module_type"); - private static final ResourceLocation SENSOR_TYPES = new ResourceLocation("sensor_type"); - private static final ResourceLocation SCHEDULES = new ResourceLocation("schedule"); - private static final ResourceLocation ACTIVITIES = new ResourceLocation("activities"); - - // Worldgen - private static final ResourceLocation WORLD_CARVERS = new ResourceLocation("carver"); - private static final ResourceLocation SURFACE_BUILDERS = new ResourceLocation("surface_builder"); - private static final ResourceLocation FEATURES = new ResourceLocation("feature"); - private static final ResourceLocation DECORATORS = new ResourceLocation("decorator"); - private static final ResourceLocation BIOME_PROVIDER_TYPES = new ResourceLocation("biome_source_type"); - private static final ResourceLocation CHUNK_STATUS = new ResourceLocation("chunk_status"); - private static final ResourceLocation STRUCTURE_FEATURES = new ResourceLocation("structure_feature"); - private static final ResourceLocation BLOCK_STATE_PROVIDER_TYPES = new ResourceLocation("block_state_provider_type"); - private static final ResourceLocation BLOCK_PLACER_TYPES = new ResourceLocation("block_placer_type"); - private static final ResourceLocation FOLIAGE_PLACER_TYPES = new ResourceLocation("foliage_placer_type"); - private static final ResourceLocation TREE_DECORATOR_TYPES = new ResourceLocation("tree_decorator_type"); - - // Custom forge registries - private static final ResourceLocation SERIALIZERS = new ResourceLocation("minecraft:dataserializers"); - private static final ResourceLocation LOOT_MODIFIER_SERIALIZERS = new ResourceLocation("forge:loot_modifier_serializers"); - private static final int MAX_VARINT = Integer.MAX_VALUE - 1; //We were told it is their intention to have everything in a reg be unlimited, so assume that until we find cases where it isnt. private static final ResourceLocation BLOCK_TO_ITEM = new ResourceLocation("minecraft:blocktoitemmap"); @@ -167,7 +122,6 @@ public class GameData init(); } - @SuppressWarnings("unchecked") public static void init() { if (DISABLE_VANILLA_REGISTRIES) @@ -180,78 +134,80 @@ public class GameData hasInit = true; // 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(BLOCKS, Block.class, "air").addCallback(BlockCallbacks.INSTANCE).legacyName("blocks").create(); + makeRegistry(FLUIDS, Fluid.class, "empty").create(); + makeRegistry(ITEMS, Item.class, "air").addCallback(ItemCallbacks.INSTANCE).legacyName("items").create(); + makeRegistry(EFFECTS, Effect.class ).legacyName("potions").create(); + //makeRegistry(BIOMES, Biome.class).legacyName("biomes").create(); + makeRegistry(SOUND_EVENTS, SoundEvent.class).legacyName("soundevents").create(); + makeRegistry(POTIONS, Potion.class, "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(ENTITY_TYPES, c(EntityType.class), "pig").legacyName("entities").create(); + makeRegistry(TILE_ENTITY_TYPES, c(TileEntityType.class)).disableSaving().legacyName("tileentities").create(); + makeRegistry(PARTICLE_TYPES, c(ParticleType.class)).disableSaving().create(); + makeRegistry(CONTAINER_TYPES, c(ContainerType.class)).disableSaving().create(); + makeRegistry(PAINTING_TYPES, PaintingType.class, "kebab").create(); + makeRegistry(RECIPE_SERIALIZERS, c(IRecipeSerializer.class)).disableSaving().create(); makeRegistry(ATTRIBUTES, Attribute.class).onValidate(AttributeCallbacks.INSTANCE).disableSaving().disableSync().create(); - makeRegistry(STAT_TYPES, StatType.class).create(); + makeRegistry(STAT_TYPES, c(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(VILLAGER_PROFESSIONS, VillagerProfession.class, "none").create(); + makeRegistry(POI_TYPES, PointOfInterestType.class, "unemployed").disableSync().create(); + makeRegistry(MEMORY_MODULE_TYPES, c(MemoryModuleType.class), "dummy").disableSync().create(); + makeRegistry(SENSOR_TYPES, c(SensorType.class), "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).addCallback(FeatureCallbacks.INSTANCE).disableSaving().create(); - makeRegistry(DECORATORS, Placement.class).disableSaving().disableSync().create(); - makeRegistry(CHUNK_STATUS, ChunkStatus.class, new ResourceLocation("empty")).disableSaving().disableSync().create(); - makeRegistry(STRUCTURE_FEATURES, Structure.class).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(); + makeRegistry(WORLD_CARVERS, c(WorldCarver.class)).disableSaving().disableSync().create(); + makeRegistry(SURFACE_BUILDERS, c(SurfaceBuilder.class)).disableSaving().disableSync().create(); + makeRegistry(FEATURES, c(Feature.class)).addCallback(FeatureCallbacks.INSTANCE).disableSaving().create(); + makeRegistry(DECORATORS, c(Placement.class)).disableSaving().disableSync().create(); + makeRegistry(CHUNK_STATUS, ChunkStatus.class, "empty").disableSaving().disableSync().create(); + makeRegistry(STRUCTURE_FEATURES, c(Structure.class)).disableSaving().disableSync().create(); + makeRegistry(BLOCK_STATE_PROVIDER_TYPES, c(BlockStateProviderType.class)).disableSaving().disableSync().create(); + makeRegistry(BLOCK_PLACER_TYPES, c(BlockPlacerType.class)).disableSaving().disableSync().create(); + makeRegistry(FOLIAGE_PLACER_TYPES, c(FoliagePlacerType.class)).disableSaving().disableSync().create(); + makeRegistry(TREE_DECORATOR_TYPES, c(TreeDecoratorType.class)).disableSaving().disableSync().create(); // Custom forge registries - makeRegistry(SERIALIZERS, DataSerializerEntry.class, 256 /*vanilla space*/, MAX_VARINT).disableSaving().disableOverrides().addCallback(SerializerCallbacks.INSTANCE).create(); - makeRegistry(LOOT_MODIFIER_SERIALIZERS, GlobalLootModifierSerializer.class).disableSaving().disableSync().create(); + makeRegistry(DATA_SERIALIZERS, DataSerializerEntry.class, 256 /*vanilla space*/, MAX_VARINT).disableSaving().disableOverrides().addCallback(SerializerCallbacks.INSTANCE).create(); + makeRegistry(LOOT_MODIFIER_SERIALIZERS, c(GlobalLootModifierSerializer.class)).disableSaving().disableSync().create(); + } + @SuppressWarnings("unchecked") //Ugly hack to let us pass in a typed Class object. Remove when we remove type specific references. + private static Class c(Class cls) { return (Class)cls; } + + private static > RegistryBuilder makeRegistry(RegistryKey> key, Class type) + { + return new RegistryBuilder().setName(key.func_240901_a_()).setType(type).setMaxID(MAX_VARINT).addCallback(new NamespacedWrapper.Factory()); + } + private static > RegistryBuilder makeRegistry(RegistryKey> key, Class type, int min, int max) + { + return new RegistryBuilder().setName(key.func_240901_a_()).setType(type).setIDRange(min, max).addCallback(new NamespacedWrapper.Factory()); + } + private static > RegistryBuilder makeRegistry(RegistryKey> key, Class type, String _default) + { + return new RegistryBuilder().setName(key.func_240901_a_()).setType(type).setMaxID(MAX_VARINT).addCallback(new NamespacedDefaultedWrapper.Factory()).setDefaultKey(new ResourceLocation(_default)); } - private static > RegistryBuilder makeRegistry(ResourceLocation name, Class type) + public static > SimpleRegistry getWrapper(RegistryKey> key, Lifecycle lifecycle) { - return new RegistryBuilder().setName(name).setType(type).setMaxID(MAX_VARINT).addCallback(new NamespacedWrapper.Factory()); - } - private static > RegistryBuilder makeRegistry(ResourceLocation name, Class type, int min, int max) - { - return new RegistryBuilder().setName(name).setType(type).setIDRange(min, max).addCallback(new NamespacedWrapper.Factory()); - } - private static > RegistryBuilder makeRegistry(ResourceLocation name, Class type, ResourceLocation _default) - { - return new RegistryBuilder().setName(name).setType(type).setMaxID(MAX_VARINT).addCallback(new NamespacedDefaultedWrapper.Factory()).setDefaultKey(_default); - } - - public static > DefaultedRegistry getWrapperDefaulted(Class cls) - { - IForgeRegistry reg = RegistryManager.ACTIVE.getRegistry(cls); - Validate.notNull(reg, "Attempted to get vanilla wrapper for unknown registry: " + cls.toString()); + IForgeRegistry reg = RegistryManager.ACTIVE.getRegistry(key); + Validate.notNull(reg, "Attempted to get vanilla wrapper for unknown registry: " + key.toString()); @SuppressWarnings("unchecked") - DefaultedRegistry ret = reg.getSlaveMap(NamespacedDefaultedWrapper.Factory.ID, NamespacedDefaultedWrapper.class); - Validate.notNull(ret, "Attempted to get vanilla wrapper for registry created incorrectly: " + cls.toString()); + SimpleRegistry ret = reg.getSlaveMap(NamespacedWrapper.Factory.ID, NamespacedWrapper.class); + Validate.notNull(ret, "Attempted to get vanilla wrapper for registry created incorrectly: " + key.toString()); return ret; } - public static > SimpleRegistry getWrapper(Class cls) + public static > DefaultedRegistry getWrapper(RegistryKey> key, Lifecycle lifecycle, String defKey) { - IForgeRegistry reg = RegistryManager.ACTIVE.getRegistry(cls); - Validate.notNull(reg, "Attempted to get vanilla wrapper for unknown registry: " + cls.toString()); + IForgeRegistry reg = RegistryManager.ACTIVE.getRegistry(key); + Validate.notNull(reg, "Attempted to get vanilla wrapper for unknown registry: " + key.toString()); @SuppressWarnings("unchecked") - SimpleRegistry ret = reg.getSlaveMap(NamespacedWrapper.Factory.ID, NamespacedWrapper.class); - Validate.notNull(ret, "Attempted to get vanilla wrapper for registry created incorrectly: " + cls.toString()); + DefaultedRegistry ret = reg.getSlaveMap(NamespacedDefaultedWrapper.Factory.ID, NamespacedDefaultedWrapper.class); + Validate.notNull(ret, "Attempted to get vanilla wrapper for registry created incorrectly: " + key.toString()); return ret; } @@ -435,7 +391,7 @@ public class GameData final ClearableObjectIntIdentityMap idMap = new ClearableObjectIntIdentityMap() { @Override - public int get(BlockState key) + public int getId(BlockState key) { Integer integer = (Integer)this.identityMap.get(key); // There are some cases where this map is queried to serialize a state that is valid, @@ -852,11 +808,11 @@ public class GameData keys.sort((o1, o2) -> String.valueOf(o1).compareToIgnoreCase(String.valueOf(o2))); //Move Blocks to first, and Items to second. - keys.remove(BLOCKS); - keys.remove(ITEMS); + keys.remove(BLOCKS.func_240901_a_()); + keys.remove(ITEMS.func_240901_a_()); - keys.add(0, BLOCKS); - keys.add(1, ITEMS); + keys.add(0, BLOCKS.func_240901_a_()); + keys.add(1, ITEMS.func_240901_a_()); for (int i = 0, keysSize = keys.size(); i < keysSize; i++) { final ResourceLocation rl = keys.get(i); if (!filter.test(rl)) continue; diff --git a/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java b/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java index 0beb821ea..50b7787a0 100644 --- a/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java +++ b/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java @@ -22,6 +22,7 @@ package net.minecraftforge.registries; import java.util.Collection; import java.util.Iterator; import java.util.Optional; +import java.util.OptionalInt; import java.util.Random; import java.util.Set; @@ -50,7 +51,7 @@ class NamespacedDefaultedWrapper> extends Defau } @Override - public V register(int id, RegistryKey key, V value) + public V register(int id, RegistryKey key, V value, Lifecycle lifecycle) { if (locked) throw new IllegalStateException("Can not register to a locked registry. Modder should use Forge Register methods."); @@ -67,14 +68,22 @@ class NamespacedDefaultedWrapper> extends Defau } @Override - public V register(RegistryKey key, V value) + public V register(RegistryKey key, V value, Lifecycle lifecycle) { - return register(-1, key, value); + return register(-1, key, value, lifecycle); + } + + @Override + public V func_241874_a(OptionalInt id, RegistryKey key, V value, Lifecycle lifecycle) { + int wanted = -1; + if (id.isPresent() && getByValue(id.getAsInt()) != null) + wanted = id.getAsInt(); + return register(wanted, key, value, lifecycle); } // Reading Functions @Override - public Optional getValue(@Nullable ResourceLocation name) + public Optional func_241873_b(@Nullable ResourceLocation name) { return Optional.ofNullable( this.delegate.getRaw(name)); //get without default } @@ -112,12 +121,6 @@ class NamespacedDefaultedWrapper> extends Defau return this.delegate.getValue(id); } - @Override - public boolean func_230518_b_(int id) - { - return this.getByValue(id) != null; - } - @Override public Iterator iterator() { diff --git a/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java b/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java index 977d5d489..1e4fcca5f 100644 --- a/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java +++ b/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java @@ -22,6 +22,7 @@ package net.minecraftforge.registries; import java.util.Collection; import java.util.Iterator; import java.util.Optional; +import java.util.OptionalInt; import java.util.Random; import java.util.Set; import javax.annotation.Nullable; @@ -43,12 +44,12 @@ class NamespacedWrapper> extends SimpleRegistry public NamespacedWrapper(ForgeRegistry owner) { - super(RegistryKey.func_240904_a_(owner.getRegistryName()), Lifecycle.experimental()); + super(RegistryKey.func_240904_a_(owner.getRegistryName()), Lifecycle.experimental()); this.delegate = owner; } @Override - public V register(int id, RegistryKey key, V value) + public V register(int id, RegistryKey key, V value, Lifecycle lifecycle) { if (locked) throw new IllegalStateException("Can not register to a locked registry. Modder should use Forge Register methods."); @@ -65,9 +66,17 @@ class NamespacedWrapper> extends SimpleRegistry } @Override - public R register(RegistryKey key, R value) + public R register(RegistryKey key, R value, Lifecycle lifecycle) { - return register(-1, key, value); + return register(-1, key, value, lifecycle); + } + + @Override + public V func_241874_a(OptionalInt id, RegistryKey key, V value, Lifecycle lifecycle) { + int wanted = -1; + if (id.isPresent() && getByValue(id.getAsInt()) != null) + wanted = id.getAsInt(); + return register(wanted, key, value, lifecycle); } // Reading Functions @@ -79,7 +88,7 @@ class NamespacedWrapper> extends SimpleRegistry } @Override - public Optional getValue(@Nullable ResourceLocation name) + public Optional func_241873_b(@Nullable ResourceLocation name) { return Optional.ofNullable( this.delegate.getRaw(name)); //get without default } diff --git a/src/main/java/net/minecraftforge/registries/RegistryManager.java b/src/main/java/net/minecraftforge/registries/RegistryManager.java index 59dbb0120..b247e5c7c 100644 --- a/src/main/java/net/minecraftforge/registries/RegistryManager.java +++ b/src/main/java/net/minecraftforge/registries/RegistryManager.java @@ -32,7 +32,9 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; +import net.minecraft.util.RegistryKey; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.Registry; import net.minecraftforge.fml.network.FMLHandshakeMessages; import net.minecraftforge.registries.ForgeRegistry.Snapshot; import org.apache.commons.lang3.tuple.Pair; @@ -75,6 +77,11 @@ public class RegistryManager return (ForgeRegistry)this.registries.get(key); } + public > ForgeRegistry getRegistry(RegistryKey> key) + { + return getRegistry(key.func_240901_a_()); + } + public > IForgeRegistry getRegistry(Class cls) { return getRegistry(superTypes.get(cls)); diff --git a/src/main/java/net/minecraftforge/server/command/CommandDimensions.java b/src/main/java/net/minecraftforge/server/command/CommandDimensions.java index fc517860c..6f4df9842 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandDimensions.java +++ b/src/main/java/net/minecraftforge/server/command/CommandDimensions.java @@ -22,11 +22,14 @@ package net.minecraftforge.server.command; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.Registry; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.world.DimensionType; import net.minecraft.world.server.ServerWorld; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -42,9 +45,11 @@ public class CommandDimensions .requires(cs->cs.hasPermissionLevel(0)) //permission .executes(ctx -> { ctx.getSource().sendFeedback(new TranslationTextComponent("commands.forge.dimensions.list"), true); + final Registry reg = ctx.getSource().func_241861_q().func_243612_b(Registry.field_239698_ad_); + Map> types = new HashMap<>(); for (ServerWorld dim : ctx.getSource().getServer().getWorlds()) { - types.computeIfAbsent(dim.func_234922_V_().func_240901_a_(), k -> new ArrayList<>()).add(dim.func_234923_W_().func_240901_a_()); + types.computeIfAbsent(reg.getKey(dim.func_230315_m_()), k -> new ArrayList<>()).add(dim.func_234923_W_().func_240901_a_()); } types.keySet().stream().sorted().forEach(key -> { diff --git a/src/main/java/net/minecraftforge/server/command/CommandTps.java b/src/main/java/net/minecraftforge/server/command/CommandTps.java index cf7c46458..7af38d236 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandTps.java +++ b/src/main/java/net/minecraftforge/server/command/CommandTps.java @@ -25,7 +25,9 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.command.arguments.DimensionArgument; +import net.minecraft.util.registry.Registry; import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.world.DimensionType; import net.minecraft.world.server.ServerWorld; class CommandTps @@ -61,9 +63,10 @@ class CommandTps if (times == null) // Null means the world is unloaded. Not invalid. That's taken car of by DimensionArgument itself. times = UNLOADED; + final Registry reg = cs.func_241861_q().func_243612_b(Registry.field_239698_ad_); double worldTickTime = mean(times) * 1.0E-6D; double worldTPS = Math.min(1000.0 / worldTickTime, 20); - cs.sendFeedback(new TranslationTextComponent("commands.forge.tps.summary.named", dim.func_234923_W_().func_240901_a_().toString(), dim.func_234922_V_().func_240901_a_().toString(), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), false); + cs.sendFeedback(new TranslationTextComponent("commands.forge.tps.summary.named", dim.func_234923_W_().func_240901_a_().toString(), reg.getKey(dim.func_230315_m_()), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), false); return 1; } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index add645eda..cc36824f8 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -92,7 +92,7 @@ public net.minecraft.block.WitherSkeletonSkullBlock (Lnet/minecraft/block/ public net.minecraft.block.WitherSkeletonWallSkullBlock (Lnet/minecraft/block/AbstractBlock$Properties;)V public net.minecraft.block.WoodButtonBlock (Lnet/minecraft/block/AbstractBlock$Properties;)V #endgroup -public net.minecraft.block.Block func_180637_b(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;I)V # dropXpOnBlockBreak +public net.minecraft.block.Block func_180637_b(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/util/math/BlockPos;I)V # dropXpOnBlockBreak public net.minecraft.block.FireBlock func_220274_q(Lnet/minecraft/block/BlockState;)I # func_220274_q public net.minecraft.block.FireBlock func_220275_r(Lnet/minecraft/block/BlockState;)I # func_220275_r public-f net.minecraft.client.GameSettings field_74324_K # keyBindings @@ -122,6 +122,7 @@ protected net.minecraft.client.gui.IngameGui field_184050_w protected net.minecraft.client.gui.IngameGui field_191743_I protected net.minecraft.client.gui.IngameGui field_194811_H protected net.minecraft.client.gui.IngameGui field_194812_I +protected net.minecraft.client.gui.IngameGui field_243249_e protected net.minecraft.client.gui.IngameGui field_73837_f protected net.minecraft.client.gui.IngameGui field_73838_g protected net.minecraft.client.gui.IngameGui field_73839_d @@ -291,23 +292,17 @@ public net.minecraft.village.PointOfInterestType (Ljava/lang/String;Ljava/ public net.minecraft.village.PointOfInterestType (Ljava/lang/String;Ljava/util/Set;ILjava/util/function/Predicate;I)V public net.minecraft.village.PointOfInterestType func_221042_a(Lnet/minecraft/block/Block;)Ljava/util/Set; # getAllStates public net.minecraft.world.GameRules func_234903_a_(Ljava/lang/String;Lnet/minecraft/world/GameRules$Category;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 public net.minecraft.world.World field_73003_n #prevRainingStrength public net.minecraft.world.World field_73004_o #rainingStrength public net.minecraft.world.World field_73017_q #thunderingStrength public net.minecraft.world.World field_73018_p #prevThunderingStrength -public net.minecraft.world.biome.Biome func_180626_a(Lnet/minecraft/util/math/BlockPos;)F # getTemperature -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.chunk.ChunkStatus (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 -private-f net.minecraft.world.gen.DebugChunkGenerator field_177464_a #ALL_VALID_STATES private-f net.minecraft.world.gen.DebugChunkGenerator field_177462_b #GRID_WIDTH +private-f net.minecraft.world.gen.DebugChunkGenerator field_177464_a #ALL_VALID_STATES private-f net.minecraft.world.gen.DebugChunkGenerator field_181039_c #GRID_HEIGHT 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 private-f net.minecraft.world.raid.Raid$WaveMember field_221284_f # VALUES -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 -public net.minecraft.world.storage.FolderName (Ljava/lang/String;)V # constructor +public net.minecraft.world.storage.FolderName (Ljava/lang/String;)V # constructor \ No newline at end of file diff --git a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java index c2f5f6d55..2ea574e0b 100644 --- a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java +++ b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java @@ -221,7 +221,7 @@ public class DataGeneratorTest { add(Blocks.STONE, "Stone"); add(Items.DIAMOND, "Diamond"); - add(Biomes.BEACH, "Beach"); + //add(Biomes.BEACH, "Beach"); add(Effects.POISON, "Poison"); add(Enchantments.SHARPNESS, "Sharpness"); add(EntityType.CAT, "Cat"); @@ -273,8 +273,8 @@ public class DataGeneratorTest } private static final Set IGNORED_MODELS = ImmutableSet.of("test_generated_model", "test_block_model", - "fishing_rod", "fishing_rod_cast" // Vanilla doesn't generate these yet, so they don't match due to having the minecraft domain - ); + "fishing_rod", "fishing_rod_cast" // Vanilla doesn't generate these yet, so they don't match due to having the minecraft domain + ); @Override public void act(DirectoryCache cache) throws IOException @@ -652,23 +652,23 @@ public class DataGeneratorTest } } } - + JsonElement generatedTextures = generated.remove("textures"); JsonElement vanillaTextures = existing.remove("textures"); if (generatedTextures == null && vanillaTextures != null) { - ret.add("Model " + loc + " is missing textures"); + ret.add("Model " + loc + " is missing textures"); } else if (generatedTextures != null && vanillaTextures == null) { - ret.add("Model " + loc + " has textures when vanilla equivalent does not"); + ret.add("Model " + loc + " has textures when vanilla equivalent does not"); } else if (generatedTextures != null) { // Both must be non-null - for (Map.Entry e : generatedTextures.getAsJsonObject().entrySet()) { - String vanillaTexture = vanillaTextures.getAsJsonObject().get(e.getKey()).getAsString(); - if (!e.getValue().getAsString().equals(vanillaTexture)) { - ret.add("Texture for variable '" + e.getKey() + "' for model " + loc + " does not match vanilla equivalent"); - } - } - if (generatedTextures.getAsJsonObject().size() != vanillaTextures.getAsJsonObject().size()) { - ret.add("Model " + loc + " is missing textures from vanilla equivalent"); - } + for (Map.Entry e : generatedTextures.getAsJsonObject().entrySet()) { + String vanillaTexture = vanillaTextures.getAsJsonObject().get(e.getKey()).getAsString(); + if (!e.getValue().getAsString().equals(vanillaTexture)) { + ret.add("Texture for variable '" + e.getKey() + "' for model " + loc + " does not match vanilla equivalent"); + } + } + if (generatedTextures.getAsJsonObject().size() != vanillaTextures.getAsJsonObject().size()) { + ret.add("Model " + loc + " is missing textures from vanilla equivalent"); + } } if (!existing.equals(generated)) { diff --git a/src/test/java/net/minecraftforge/debug/world/ModdedOverworldBiomesTest.java b/src/test/java/net/minecraftforge/debug/world/ModdedOverworldBiomesTest.java deleted file mode 100644 index 43c515656..000000000 --- a/src/test/java/net/minecraftforge/debug/world/ModdedOverworldBiomesTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package net.minecraftforge.debug.world; - -import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.Biome.Category; -import net.minecraft.world.biome.Biome.RainType; -import net.minecraft.world.biome.BiomeAmbience; -import net.minecraft.world.biome.MoodSoundAmbience; -import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; -import net.minecraftforge.common.BiomeManager; -import net.minecraftforge.common.BiomeManager.BiomeEntry; -import net.minecraftforge.common.BiomeManager.BiomeType; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; - -@Mod(value = ModdedOverworldBiomesTest.MOD_ID) -public class ModdedOverworldBiomesTest -{ - public static final String MOD_ID = "modded_overworld_biomes_test"; - public static final boolean ENABLE = true; - - private static DeferredRegister BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, MOD_ID); - private static RegistryObject redBiome = BIOMES.register("red_biome", () -> new Biome(new Biome.Builder() - .surfaceBuilder(SurfaceBuilder.DEFAULT, SurfaceBuilder.GRASS_DIRT_GRAVEL_CONFIG).precipitation(RainType.RAIN) - .depth(1f).scale(1f).temperature(1f).downfall(1f).category(Category.PLAINS) - .func_235097_a_(new BiomeAmbience.Builder().func_235246_b_(4159204).func_235248_c_(329011) - .func_235239_a_(12638463).func_235243_a_(MoodSoundAmbience.field_235027_b_).func_235238_a_()) - .parent((String) null)) - { - @Override - public int getGrassColor(double posX, double posZ) - { - return 0xff0000; - } - }); - - public ModdedOverworldBiomesTest() - { - if (ENABLE) { - FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); - IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); - BIOMES.register(modBus); - } - } - - private void setup(final FMLCommonSetupEvent event) - { - BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(redBiome.get(), 200)); - } - -}