diff --git a/patches/minecraft/net/minecraft/advancements/Advancement.java.patch b/patches/minecraft/net/minecraft/advancements/Advancement.java.patch new file mode 100644 index 000000000..00ab2f733 --- /dev/null +++ b/patches/minecraft/net/minecraft/advancements/Advancement.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/advancements/Advancement.java ++++ b/net/minecraft/advancements/Advancement.java +@@ -309,6 +309,7 @@ + } + + public static Advancement.Builder func_241043_a_(JsonObject p_241043_0_, ConditionArrayParser p_241043_1_) { ++ if (!net.minecraftforge.common.crafting.ConditionalAdvancement.processConditions(p_241043_0_)) return null; + ResourceLocation resourcelocation = p_241043_0_.has("parent") ? new ResourceLocation(JSONUtils.func_151200_h(p_241043_0_, "parent")) : null; + DisplayInfo displayinfo = p_241043_0_.has("display") ? DisplayInfo.func_192294_a(JSONUtils.func_152754_s(p_241043_0_, "display")) : null; + AdvancementRewards advancementrewards = p_241043_0_.has("rewards") ? AdvancementRewards.func_241096_a_(JSONUtils.func_152754_s(p_241043_0_, "rewards")) : AdvancementRewards.field_192114_a; diff --git a/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch new file mode 100644 index 000000000..49c1c70e2 --- /dev/null +++ b/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/advancements/AdvancementManager.java ++++ b/net/minecraft/advancements/AdvancementManager.java +@@ -36,6 +36,10 @@ + try { + JsonObject jsonobject = JSONUtils.func_151210_l(p_240923_3_, "advancement"); + Advancement.Builder advancement$builder = Advancement.Builder.func_241043_a_(jsonobject, new ConditionArrayParser(p_240923_2_, this.field_240922_d_)); ++ if (advancement$builder == null) { ++ field_192782_a.debug("Skipping loading advancement {} as it's conditions were not met", p_240923_2_); ++ return; ++ } + map.put(p_240923_2_, advancement$builder); + } catch (IllegalArgumentException | JsonParseException jsonparseexception) { + field_192782_a.error("Parsing error loading custom advancement {}: {}", p_240923_2_, jsonparseexception.getMessage()); diff --git a/patches_old/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch similarity index 56% rename from patches_old/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch rename to patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch index 4502c8003..8eeea55b3 100644 --- a/patches_old/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch +++ b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/advancements/AdvancementRewards.java +++ b/net/minecraft/advancements/AdvancementRewards.java -@@ -43,7 +43,7 @@ +@@ -39,7 +39,7 @@ 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, new BlockPos(p_192113_1_)).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, new BlockPos(p_192113_1_)).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_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 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 5f7b4cc4e..b5b7e8f59 100644 --- a/patches/minecraft/net/minecraft/block/AbstractBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/AbstractBlock.java.patch @@ -82,7 +82,25 @@ public abstract static class AbstractBlockState extends StateHolder { private final int field_215708_d; private final boolean field_215709_e; -@@ -786,6 +794,7 @@ +@@ -427,6 +435,8 @@ + return this.field_215708_d; + } + ++ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */ ++ @Deprecated + public boolean func_196958_f() { + return this.field_235702_f_; + } +@@ -435,6 +445,8 @@ + return this.field_235704_h_; + } + ++ /** @deprecated use {@link BlockState#rotate(IWorld, BlockPos, Rotation) */ ++ @Deprecated + 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 +798,7 @@ private ResourceLocation field_222381_j; private boolean field_226895_m_ = true; private boolean field_235813_o_; diff --git a/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch b/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch new file mode 100644 index 000000000..37aabef79 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/AbstractTopPlantBlock.java.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/block/AbstractTopPlantBlock.java ++++ b/net/minecraft/block/AbstractTopPlantBlock.java +@@ -39,10 +39,11 @@ + } + + public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { +- if (p_225542_1_.func_177229_b(field_235502_d_) < 25 && p_225542_4_.nextDouble() < this.field_235503_e_) { ++ if (p_225542_1_.func_177229_b(field_235502_d_) < 25 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_.func_177972_a(this.field_235498_a_), p_225542_2_.func_180495_p(p_225542_3_.func_177972_a(this.field_235498_a_)),p_225542_4_.nextDouble() < this.field_235503_e_)) { + BlockPos blockpos = p_225542_3_.func_177972_a(this.field_235498_a_); + if (this.func_230334_h_(p_225542_2_.func_180495_p(blockpos))) { + p_225542_2_.func_175656_a(blockpos, p_225542_1_.func_235896_a_(field_235502_d_)); ++ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, blockpos, p_225542_2_.func_180495_p(blockpos)); + } + } + diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 614d8e2df..549669183 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -1,16 +1,18 @@ --- a/net/minecraft/block/Block.java +++ b/net/minecraft/block/Block.java -@@ -52,8 +52,9 @@ +@@ -52,9 +52,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class Block extends AbstractBlock implements IItemProvider { +public class Block extends AbstractBlock implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock { protected static final Logger field_196273_d = LogManager.getLogger(); +- public static final ObjectIntIdentityMap field_176229_d = new ObjectIntIdentityMap<>(); + @Deprecated //Forge: Do not use, use GameRegistry - public static final ObjectIntIdentityMap field_176229_d = new ObjectIntIdentityMap<>(); ++ public static final ObjectIntIdentityMap field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap(); private static final LoadingCache field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader() { public Boolean load(VoxelShape p_load_1_) { + return !VoxelShapes.func_197879_c(VoxelShapes.func_197868_b(), p_load_1_, IBooleanFunction.field_223236_g_); @@ -270,7 +271,7 @@ } @@ -79,7 +81,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -419,6 +424,73 @@ +@@ -419,6 +424,77 @@ return this; } @@ -111,7 +113,7 @@ + net.minecraftforge.common.PlantType type = plantable.getPlantType(world, pos.func_177972_a(facing)); + + if (plant.func_177230_c() == Blocks.field_150434_aF) -+ return this.getBlock() == Blocks.field_150434_aF || this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_196611_F; ++ return state.func_203425_a(Blocks.field_150434_aF) || state.func_203425_a(Blocks.field_150354_m) || state.func_203425_a(Blocks.field_196611_F); + + if (plant.func_177230_c() == Blocks.field_196608_cF && this == Blocks.field_196608_cF) + return true; @@ -122,16 +124,20 @@ + switch (type) { + case Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof GlazedTerracottaBlock; + case Nether: return this.getBlock() == Blocks.field_150425_aM; -+ case Crop: return this.getBlock() == Blocks.field_150458_ak; ++ case Crop: return state.func_203425_a(Blocks.field_150458_ak); + case Cave: return Block.func_220056_d(state, world, pos, Direction.UP); + case Plains: return this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_230235_a_(this) || this.getBlock() == Blocks.field_150458_ak; + case Water: return state.func_185904_a() == net.minecraft.block.material.Material.field_151586_h; //&& state.getValue(BlockLiquidWrapper) + case Beach: -+ boolean isBeach = this.getBlock() == Blocks.field_196658_i || net.minecraftforge.common.Tags.Blocks.DIRT.func_230235_a_(this) || this.getBlock() == Blocks.field_150354_m; -+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == net.minecraft.block.material.Material.field_151586_h || -+ world.func_180495_p(pos.func_177976_e()).func_185904_a() == net.minecraft.block.material.Material.field_151586_h || -+ world.func_180495_p(pos.func_177978_c()).func_185904_a() == net.minecraft.block.material.Material.field_151586_h || -+ world.func_180495_p(pos.func_177968_d()).func_185904_a() == net.minecraft.block.material.Material.field_151586_h); ++ boolean isBeach = state.func_203425_a(Blocks.field_196658_i) || net.minecraftforge.common.Tags.Blocks.DIRT.func_230235_a_(this) || state.func_203425_a(Blocks.field_150354_m) || state.func_203425_a(Blocks.field_196611_F); ++ boolean hasWater = false; ++ for (Direction face : Direction.Plane.HORIZONTAL) { ++ BlockState blockState = world.func_180495_p(pos.func_177972_a(face)); ++ net.minecraft.fluid.FluidState fluidState = world.func_204610_c(pos.func_177972_a(face)); ++ hasWater |= blockState.func_203425_a(Blocks.field_185778_de); ++ hasWater |= fluidState.func_206884_a(net.minecraft.tags.FluidTags.field_206959_a); ++ if(hasWater) break; //No point continuing. ++ } + return isBeach && hasWater; + } + return false; diff --git a/patches/minecraft/net/minecraft/block/Blocks.java.patch b/patches/minecraft/net/minecraft/block/Blocks.java.patch index 1cb852b30..cd66baf7a 100644 --- a/patches/minecraft/net/minecraft/block/Blocks.java.patch +++ b/patches/minecraft/net/minecraft/block/Blocks.java.patch @@ -8,3 +8,28 @@ 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 @@ + 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)); +- public static final Block field_196552_aC = func_222382_a("powered_rail", new PoweredRailBlock(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_196552_aC = func_222382_a("powered_rail", new PoweredRailBlock(AbstractBlock.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true)); + 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 @@ + public static void func_235419_a_() { + Block.field_176229_d.forEach(AbstractBlock.AbstractBlockState::func_215692_c); + } +- +- static { +- for(Block block : Registry.field_212618_g) { +- for(BlockState blockstate : block.func_176194_O().func_177619_a()) { +- Block.field_176229_d.func_195867_b(blockstate); +- } +- +- block.func_220068_i(); +- } +- +- } + } diff --git a/patches/minecraft/net/minecraft/block/CactusBlock.java.patch b/patches/minecraft/net/minecraft/block/CactusBlock.java.patch index 0716650f7..2ce854935 100644 --- a/patches/minecraft/net/minecraft/block/CactusBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/CactusBlock.java.patch @@ -35,6 +35,15 @@ } } } +@@ -84,7 +87,7 @@ + } + + BlockState blockstate1 = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); +- return (blockstate1.func_203425_a(Blocks.field_150434_aF) || blockstate1.func_203425_a(Blocks.field_150354_m) || blockstate1.func_203425_a(Blocks.field_196611_F)) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d(); ++ return blockstate1.canSustainPlant(p_196260_2_, p_196260_3_, Direction.UP, this) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d(); + } + + public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) { @@ -98,4 +101,14 @@ public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) { return false; diff --git a/patches/minecraft/net/minecraft/block/CampfireBlock.java.patch b/patches/minecraft/net/minecraft/block/CampfireBlock.java.patch new file mode 100644 index 000000000..4c0160f50 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/CampfireBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/block/CampfireBlock.java ++++ b/net/minecraft/block/CampfireBlock.java +@@ -181,7 +181,7 @@ + public void func_220066_a(World p_220066_1_, BlockState p_220066_2_, BlockRayTraceResult p_220066_3_, ProjectileEntity p_220066_4_) { + if (!p_220066_1_.field_72995_K && p_220066_4_.func_70027_ad()) { + Entity entity = p_220066_4_.func_234616_v_(); +- boolean flag = entity == null || entity instanceof PlayerEntity || p_220066_1_.func_82736_K().func_223586_b(GameRules.field_223599_b); ++ boolean flag = entity == null || entity instanceof PlayerEntity || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_220066_1_, entity); + if (flag && !p_220066_2_.func_177229_b(field_220101_b) && !p_220066_2_.func_177229_b(field_220103_d)) { + BlockPos blockpos = p_220066_3_.func_216350_a(); + p_220066_1_.func_180501_a(blockpos, p_220066_2_.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)), 11); diff --git a/patches/minecraft/net/minecraft/block/CocoaBlock.java.patch b/patches/minecraft/net/minecraft/block/CocoaBlock.java.patch new file mode 100644 index 000000000..74fe292c0 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/CocoaBlock.java.patch @@ -0,0 +1,16 @@ +--- a/net/minecraft/block/CocoaBlock.java ++++ b/net/minecraft/block/CocoaBlock.java +@@ -35,10 +35,11 @@ + } + + public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { +- if (p_225542_2_.field_73012_v.nextInt(5) == 0) { ++ if (true) { + int i = p_225542_1_.func_177229_b(field_176501_a); +- if (i < 2) { ++ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_2_.field_73012_v.nextInt(5) == 0)) { + p_225542_2_.func_180501_a(p_225542_3_, p_225542_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2); ++ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, p_225542_3_, p_225542_1_); + } + } + diff --git a/patches/minecraft/net/minecraft/block/CropsBlock.java.patch b/patches/minecraft/net/minecraft/block/CropsBlock.java.patch index 8c9543009..241d0c09b 100644 --- a/patches/minecraft/net/minecraft/block/CropsBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/CropsBlock.java.patch @@ -1,6 +1,34 @@ --- a/net/minecraft/block/CropsBlock.java +++ b/net/minecraft/block/CropsBlock.java -@@ -133,7 +133,7 @@ +@@ -61,12 +61,14 @@ + } + + public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { ++ if (!p_225542_2_.isAreaLoaded(p_225542_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light + if (p_225542_2_.func_226659_b_(p_225542_3_, 0) >= 9) { + int i = this.func_185527_x(p_225542_1_); + if (i < this.func_185526_g()) { + float f = func_180672_a(this, p_225542_2_, p_225542_3_); +- if (p_225542_4_.nextInt((int)(25.0F / f) + 1) == 0) { ++ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_.nextInt((int)(25.0F / f) + 1) == 0)) { + p_225542_2_.func_180501_a(p_225542_3_, this.func_185528_e(i + 1), 2); ++ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, p_225542_3_, p_225542_1_); + } + } + } +@@ -95,9 +97,9 @@ + for(int j = -1; j <= 1; ++j) { + float f1 = 0.0F; + BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j)); +- if (blockstate.func_203425_a(Blocks.field_150458_ak)) { ++ if (blockstate.canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.Direction.UP, (net.minecraftforge.common.IPlantable) p_180672_0_)) { + f1 = 1.0F; +- if (blockstate.func_177229_b(FarmlandBlock.field_176531_a) > 0) { ++ if (blockstate.isFertile(p_180672_1_, p_180672_2_.func_177982_a(i, 0, j))) { + f1 = 3.0F; + } + } +@@ -133,7 +135,7 @@ } public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) { diff --git a/patches/minecraft/net/minecraft/block/DoublePlantBlock.java.patch b/patches/minecraft/net/minecraft/block/DoublePlantBlock.java.patch index c88faf5f6..d21129c04 100644 --- a/patches/minecraft/net/minecraft/block/DoublePlantBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/DoublePlantBlock.java.patch @@ -1,14 +1,5 @@ --- a/net/minecraft/block/DoublePlantBlock.java +++ b/net/minecraft/block/DoublePlantBlock.java -@@ -39,7 +39,7 @@ - @Nullable - public BlockState func_196258_a(BlockItemUseContext p_196258_1_) { - BlockPos blockpos = p_196258_1_.func_195995_a(); -- return blockpos.func_177956_o() < 255 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null; -+ return blockpos.func_177956_o() < 255 /*TODO context.getWorld().getDimension().getHeight() - 1*/ && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null; - } - - public void func_180633_a(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_) { @@ -51,6 +51,7 @@ return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_); } else { diff --git a/patches_old/minecraft/net/minecraft/block/EnchantingTableBlock.java.patch b/patches/minecraft/net/minecraft/block/EnchantingTableBlock.java.patch similarity index 86% rename from patches_old/minecraft/net/minecraft/block/EnchantingTableBlock.java.patch rename to patches/minecraft/net/minecraft/block/EnchantingTableBlock.java.patch index 17888d44b..7871f227f 100644 --- a/patches_old/minecraft/net/minecraft/block/EnchantingTableBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/EnchantingTableBlock.java.patch @@ -4,8 +4,8 @@ if (p_180655_4_.nextInt(16) == 0) { for(int k = 0; k <= 1; ++k) { BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j); -- if (p_180655_2_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150342_X) { -+ if (p_180655_2_.func_180495_p(blockpos).getEnchantPowerBonus(p_180655_2_, p_180655_3_) > 0) { +- if (p_180655_2_.func_180495_p(blockpos).func_203425_a(Blocks.field_150342_X)) { ++ if (p_180655_2_.func_180495_p(blockpos).getEnchantPowerBonus(p_180655_2_, blockpos) > 0) { if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2))) { break; } diff --git a/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch b/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch index 0b5bd8651..56579e483 100644 --- a/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch @@ -43,6 +43,22 @@ return this.field_212565_c.get(Math.min(i, 8)); } +@@ -122,13 +137,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; +- p_204515_1_.func_175656_a(p_204515_2_, block.func_176223_P()); ++ p_204515_1_.func_175656_a(p_204515_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_204515_1_, p_204515_2_, p_204515_2_, block.func_176223_P())); + this.func_180688_d(p_204515_1_, p_204515_2_); + return false; + } + + if (flag && p_204515_1_.func_180495_p(blockpos).func_203425_a(Blocks.field_205164_gk)) { +- p_204515_1_.func_175656_a(p_204515_2_, Blocks.field_235337_cO_.func_176223_P()); ++ p_204515_1_.func_175656_a(p_204515_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_204515_1_, p_204515_2_, p_204515_2_, Blocks.field_235337_cO_.func_176223_P())); + this.func_180688_d(p_204515_1_, p_204515_2_); + return false; + } @@ -166,4 +181,23 @@ } diff --git a/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch b/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch index dc55d7401..1ded24af7 100644 --- a/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch @@ -9,3 +9,39 @@ 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/NoteBlock.java.patch b/patches/minecraft/net/minecraft/block/NoteBlock.java.patch index c77e2f8aa..ce9d85663 100644 --- a/patches/minecraft/net/minecraft/block/NoteBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/NoteBlock.java.patch @@ -9,7 +9,18 @@ p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0); } -@@ -76,6 +76,9 @@ +@@ -60,7 +60,9 @@ + if (p_225533_2_.field_72995_K) { + return ActionResultType.SUCCESS; + } else { +- p_225533_1_ = p_225533_1_.func_235896_a_(field_196485_c); ++ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_225533_2_, p_225533_3_, p_225533_1_, p_225533_1_.func_177229_b(field_196485_c), p_225533_1_.func_235896_a_(field_196485_c).func_177229_b(field_196485_c)); ++ if (_new == -1) return ActionResultType.FAIL; ++ p_225533_1_ = p_225533_1_.func_206870_a(field_196485_c, _new); + p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3); + this.func_196482_a(p_225533_2_, p_225533_3_); + p_225533_4_.func_195066_a(Stats.field_188087_U); +@@ -76,6 +78,9 @@ } public boolean func_189539_a(BlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) { diff --git a/patches/minecraft/net/minecraft/block/SaplingBlock.java.patch b/patches/minecraft/net/minecraft/block/SaplingBlock.java.patch index ededb1e1d..7757b7725 100644 --- a/patches/minecraft/net/minecraft/block/SaplingBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/SaplingBlock.java.patch @@ -8,11 +8,11 @@ this.func_226942_a_(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_); } -@@ -39,6 +40,7 @@ +@@ -38,6 +39,7 @@ + if (p_226942_3_.func_177229_b(field_176479_b) == 0) { p_226942_1_.func_180501_a(p_226942_2_, p_226942_3_.func_235896_a_(field_176479_b), 4); } else { - this.field_196387_c.func_230339_a_(p_226942_1_, p_226942_1_.func_72863_F().func_201711_g(), p_226942_2_, p_226942_3_, p_226942_4_); + if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_226942_1_, p_226942_4_, p_226942_2_)) return; + this.field_196387_c.func_230339_a_(p_226942_1_, p_226942_1_.func_72863_F().func_201711_g(), p_226942_2_, p_226942_3_, p_226942_4_); } - } diff --git a/patches/minecraft/net/minecraft/block/SugarCaneBlock.java.patch b/patches/minecraft/net/minecraft/block/SugarCaneBlock.java.patch index 5cfe32e5f..1db4cd743 100644 --- a/patches/minecraft/net/minecraft/block/SugarCaneBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/SugarCaneBlock.java.patch @@ -9,7 +9,22 @@ public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X; protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D); -@@ -63,6 +63,8 @@ +@@ -43,12 +43,14 @@ + + if (i < 3) { + int j = p_225542_1_.func_177229_b(field_176355_a); ++ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, true)) { + if (j == 15) { + p_225542_2_.func_175656_a(p_225542_3_.func_177984_a(), this.func_176223_P()); + p_225542_2_.func_180501_a(p_225542_3_, p_225542_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4); + } else { + p_225542_2_.func_180501_a(p_225542_3_, p_225542_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4); + } ++ } + } + } + +@@ -63,6 +65,8 @@ } public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { @@ -18,7 +33,7 @@ BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); if (blockstate.func_177230_c() == this) { return true; -@@ -86,4 +88,14 @@ +@@ -86,4 +90,14 @@ protected void func_206840_a(StateContainer.Builder p_206840_1_) { p_206840_1_.func_206894_a(field_176355_a); } diff --git a/patches/minecraft/net/minecraft/block/SweetBerryBushBlock.java.patch b/patches/minecraft/net/minecraft/block/SweetBerryBushBlock.java.patch new file mode 100644 index 000000000..e7d1cc8a2 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/SweetBerryBushBlock.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/block/SweetBerryBushBlock.java ++++ b/net/minecraft/block/SweetBerryBushBlock.java +@@ -52,8 +52,9 @@ + + public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { + int i = p_225542_1_.func_177229_b(field_220125_a); +- if (i < 3 && p_225542_4_.nextInt(5) == 0 && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) { ++ if (i < 3 && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_,p_225542_4_.nextInt(5) == 0)) { + p_225542_2_.func_180501_a(p_225542_3_, p_225542_1_.func_206870_a(field_220125_a, Integer.valueOf(i + 1)), 2); ++ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, p_225542_3_, p_225542_1_); + } + + } diff --git a/patches/minecraft/net/minecraft/block/TNTBlock.java.patch b/patches/minecraft/net/minecraft/block/TNTBlock.java.patch index 219824b4e..f5758c179 100644 --- a/patches/minecraft/net/minecraft/block/TNTBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/TNTBlock.java.patch @@ -1,6 +1,22 @@ --- a/net/minecraft/block/TNTBlock.java +++ b/net/minecraft/block/TNTBlock.java -@@ -41,7 +41,7 @@ +@@ -29,10 +29,14 @@ + this.func_180632_j(this.func_176223_P().func_206870_a(field_212569_a, Boolean.valueOf(false))); + } + ++ public void catchFire(BlockState state, World world, BlockPos pos, @Nullable net.minecraft.util.Direction face, @Nullable LivingEntity igniter) { ++ func_196535_a(world, pos, igniter); ++ } ++ + public void func_220082_b(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_) { + if (!p_220082_4_.func_203425_a(p_220082_1_.func_177230_c())) { + if (p_220082_2_.func_175640_z(p_220082_3_)) { +- func_196534_a(p_220082_2_, p_220082_3_); ++ catchFire(p_220082_1_, p_220082_2_, p_220082_3_, null, null); + p_220082_2_.func_217377_a(p_220082_3_, false); + } + +@@ -41,7 +45,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_.func_175640_z(p_220069_3_)) { @@ -9,7 +25,7 @@ p_220069_2_.func_217377_a(p_220069_3_, false); } -@@ -49,7 +49,7 @@ +@@ -49,7 +53,7 @@ public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) { if (!p_176208_1_.func_201670_d() && !p_176208_4_.func_184812_l_() && p_176208_3_.func_177229_b(field_212569_a)) { @@ -18,7 +34,7 @@ } super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_); -@@ -63,10 +63,12 @@ +@@ -63,10 +67,12 @@ } } @@ -31,7 +47,7 @@ private static void func_196535_a(World p_196535_0_, BlockPos p_196535_1_, @Nullable LivingEntity p_196535_2_) { if (!p_196535_0_.field_72995_K) { TNTEntity tntentity = new TNTEntity(p_196535_0_, (double)p_196535_1_.func_177958_n() + 0.5D, (double)p_196535_1_.func_177956_o(), (double)p_196535_1_.func_177952_p() + 0.5D, p_196535_2_); -@@ -81,7 +83,7 @@ +@@ -81,7 +87,7 @@ if (item != Items.field_151033_d && item != Items.field_151059_bz) { return super.func_225533_a_(p_225533_1_, p_225533_2_, p_225533_3_, p_225533_4_, p_225533_5_, p_225533_6_); } else { @@ -40,7 +56,7 @@ p_225533_2_.func_180501_a(p_225533_3_, Blocks.field_150350_a.func_176223_P(), 11); if (!p_225533_4_.func_184812_l_()) { if (item == Items.field_151033_d) { -@@ -102,7 +104,7 @@ +@@ -102,7 +108,7 @@ Entity entity = p_220066_4_.func_234616_v_(); if (p_220066_4_.func_70027_ad()) { BlockPos blockpos = p_220066_3_.func_216350_a(); diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index dde2074f5..4adc23476 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -289,10 +289,11 @@ worldloadprogressscreen.func_231023_e_(); this.func_195542_b(false); -@@ -1697,6 +1740,12 @@ +@@ -1696,7 +1739,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)); - networkmanager.func_179290_a(new CLoginStartPacket(this.func_110432_I().func_148256_e())); +- networkmanager.func_179290_a(new CLoginStartPacket(this.func_110432_I().func_148256_e())); + com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e(); + if (!this.func_110432_I().hasCachedProperties()) { + gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. @@ -302,7 +303,7 @@ this.field_71453_ak = networkmanager; } else { this.func_241559_a_(p_238195_6_, p_238195_1_, flag, () -> { -@@ -1770,6 +1819,7 @@ +@@ -1770,6 +1818,7 @@ } public void func_71403_a(ClientWorld p_71403_1_) { @@ -310,7 +311,7 @@ WorkingScreen workingscreen = new WorkingScreen(); workingscreen.func_200210_a(new TranslationTextComponent("connect.joining")); this.func_213241_c(workingscreen); -@@ -1801,10 +1851,12 @@ +@@ -1801,10 +1850,12 @@ IntegratedServer integratedserver = this.field_71437_Z; this.field_71437_Z = null; this.field_71460_t.func_190564_k(); @@ -323,7 +324,7 @@ if (integratedserver != null) { this.field_71424_I.func_76320_a("waitForServer"); -@@ -1819,6 +1871,7 @@ +@@ -1819,6 +1870,7 @@ this.field_71456_v.func_181029_i(); this.field_71422_O = null; this.field_71455_al = false; @@ -331,7 +332,7 @@ this.field_213274_aO.func_216815_b(); } -@@ -1849,6 +1902,7 @@ +@@ -1849,6 +1901,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_(); @@ -339,7 +340,7 @@ } public boolean func_238216_r_() { -@@ -1894,112 +1948,9 @@ +@@ -1894,112 +1947,9 @@ private void func_147112_ai() { if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) { @@ -455,7 +456,7 @@ } } -@@ -2081,6 +2032,7 @@ +@@ -2081,6 +2031,7 @@ return field_71432_P; } @@ -463,7 +464,7 @@ public CompletableFuture func_213245_w() { return this.func_213169_a(this::func_213237_g).thenCompose((p_229993_0_) -> { return p_229993_0_; -@@ -2388,7 +2340,7 @@ +@@ -2388,7 +2339,7 @@ supplier = func_228022_c_(supplier); } @@ -472,7 +473,7 @@ } private static Supplier func_228021_b_(Supplier p_228021_0_) { -@@ -2407,6 +2359,14 @@ +@@ -2407,6 +2358,14 @@ this.field_175617_aL.func_229355_a_(p_228020_1_); } diff --git a/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch new file mode 100644 index 000000000..a09a60683 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/screen/PackLoadingManager.java.patch @@ -0,0 +1,22 @@ +--- a/net/minecraft/client/gui/screen/PackLoadingManager.java ++++ b/net/minecraft/client/gui/screen/PackLoadingManager.java +@@ -135,6 +135,11 @@ + public void func_230468_k_() { + this.func_238879_a_(1); + } ++ ++ @Override ++ public boolean notHidden() { ++ return !field_238878_b_.isHidden(); ++ } + } + + @OnlyIn(Dist.CLIENT) +@@ -230,5 +235,7 @@ + boolean func_230469_o_(); + + boolean func_230470_p_(); ++ ++ default boolean notHidden() { return true; } + } + } diff --git a/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch new file mode 100644 index 000000000..9ef9525c8 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/screen/PackScreen.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/gui/screen/PackScreen.java ++++ b/net/minecraft/client/gui/screen/PackScreen.java +@@ -84,7 +84,7 @@ + + private void func_238899_a_(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_)); + }); + } 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 b513aaef6..d8d7aa294 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 @@ -200,7 +200,7 @@ + for (int idx = start; idx < end; idx++) { + ItemGroup itemgroup1 = ItemGroup.field_78032_a[idx]; + if (itemgroup1 != null && itemgroup1.func_78021_a() != field_147058_w) { -+ this.field_230706_i_.func_110434_K().func_110577_a(itemgroup1.getBackgroundImage()); ++ this.field_230706_i_.func_110434_K().func_110577_a(itemgroup1.getTabsImage()); this.func_238808_a_(p_230450_1_, itemgroup1); } } @@ -253,16 +253,7 @@ this.func_238474_b_(p_238808_1_, l, i1, j, k, 28, 32); this.field_230707_j_.field_77023_b = 100.0F; l = l + 6; -@@ -769,6 +852,8 @@ - for(int i = 0; i < 5; ++i) { - for(int j = 0; j < 9; ++j) { - this.func_75146_a(new CreativeScreen.LockedSlot(CreativeScreen.field_195378_x, i * 9 + j, 9 + j * 18, 18 + i * 18)); -+ RenderSystem.color3f(1F, 1F, 1F); //Forge: Reset color in case Items change it. -+ RenderSystem.enableBlend(); //Forge: Make sure blend is enabled else tabs show a white border. - } - } - -@@ -884,6 +969,22 @@ +@@ -884,6 +967,22 @@ public boolean func_82869_a(PlayerEntity p_82869_1_) { return this.field_148332_b.func_82869_a(p_82869_1_); } diff --git a/patches/minecraft/net/minecraft/client/gui/widget/list/AbstractList.java.patch b/patches/minecraft/net/minecraft/client/gui/widget/list/AbstractList.java.patch index 5a6d82c87..9aa63efaa 100644 --- a/patches/minecraft/net/minecraft/client/gui/widget/list/AbstractList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/widget/list/AbstractList.java.patch @@ -8,8 +8,8 @@ + public int getHeight() { return this.field_230671_e_; } + public int getTop() { return this.field_230672_i_; } + public int getBottom() { return this.field_230673_j_; } -+ public int getLeft() { return this.field_230674_k_; } -+ public int getRight() { return this.field_230675_l_; } ++ public int getLeft() { return this.field_230675_l_; } ++ public int getRight() { return this.field_230674_k_; } + @OnlyIn(Dist.CLIENT) public abstract static class AbstractListEntry> implements IGuiEventListener { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch index ab9b9644a..d725645a3 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerController.java.patch @@ -82,7 +82,7 @@ public float func_78757_d() { - return this.field_78779_k.func_77145_d() ? 5.0F : 4.5F; -+ float attrib = (float)field_78776_a.field_71439_g.func_110148_a(PlayerEntity.REACH_DISTANCE).func_111126_e(); ++ float attrib = (float)field_78776_a.field_71439_g.func_110148_a(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).func_111126_e(); + return this.field_78779_k.func_77145_d() ? attrib : attrib - 0.5F; } 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 c96ab6447..d95272c61 100644 --- a/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch @@ -16,7 +16,27 @@ 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(); -@@ -1034,8 +1036,10 @@ +@@ -745,7 +747,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) { +- tileentity.func_230337_a_(this.field_147300_g.func_180495_p(blockpos), compoundnbt); ++ tileentity.handleUpdateTag(this.field_147300_g.func_180495_p(blockpos), compoundnbt); + } + } + +@@ -844,7 +846,9 @@ + + public void func_147251_a(SChatPacket p_147251_1_) { + PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f); +- this.field_147299_f.field_71456_v.func_238450_a_(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c(), p_147251_1_.func_240810_e_()); ++ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c()); ++ if (message == null) return; ++ this.field_147299_f.field_71456_v.func_238450_a_(p_147251_1_.func_192590_c(), message, p_147251_1_.func_240810_e_()); + } + + public void func_147279_a(SAnimateHandPacket p_147279_1_) { +@@ -1034,8 +1038,10 @@ clientplayerentity1.func_233645_dx_().func_233784_a_(clientplayerentity.func_233645_dx_()); } @@ -27,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 +1165,12 @@ +@@ -1161,6 +1167,12 @@ if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) { ((CommandBlockScreen)this.field_147299_f.field_71462_r).func_184075_a(); @@ -40,7 +60,7 @@ } } -@@ -1329,6 +1339,7 @@ +@@ -1329,6 +1341,7 @@ clientrecipebook.func_199644_c(); clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a); imutablesearchtree.func_194040_a(); @@ -48,7 +68,7 @@ } public void func_200232_a(SPlayerLookPacket p_200232_1_) { -@@ -1409,7 +1420,7 @@ +@@ -1409,7 +1422,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) { @@ -57,7 +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()); -@@ -1426,6 +1437,7 @@ +@@ -1426,6 +1439,7 @@ } this.field_147299_f.func_213253_a(SearchTreeManager.field_215360_b).func_194040_a(); @@ -65,7 +85,7 @@ } public void func_175098_a(SCombatPacket p_175098_1_) { -@@ -1909,10 +1921,12 @@ +@@ -1909,10 +1923,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/GameRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch index 4e96f16b2..ef9b9ed35 100644 --- a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch @@ -18,15 +18,16 @@ } } -@@ -477,6 +479,7 @@ +@@ -476,7 +478,7 @@ + } } else if (this.field_78531_r.field_71462_r != null) { try { - this.field_78531_r.field_71462_r.func_230430_a_(matrixstack, i, j, this.field_78531_r.func_193989_ak()); +- this.field_78531_r.field_71462_r.func_230430_a_(matrixstack, i, j, this.field_78531_r.func_193989_ak()); + net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, matrixstack, i, j, this.field_78531_r.func_193989_ak()); } catch (Throwable throwable) { CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Rendering screen"); CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Screen render details"); -@@ -589,9 +592,16 @@ +@@ -589,9 +591,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_); @@ -43,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 +681,9 @@ +@@ -671,4 +680,9 @@ public OverlayTexture func_228385_m_() { return this.field_228375_t_; } diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch index 44ca7cbb3..e3d9172e3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch @@ -125,7 +125,7 @@ BufferBuilder bufferbuilder2 = p_228940_5_.func_228366_a_(rendertype1); if (p_228940_4_.field_178501_c.add(rendertype1)) { ChunkRender.this.func_228923_a_(bufferbuilder2); -@@ -500,7 +524,7 @@ +@@ -500,14 +524,16 @@ matrixstack.func_227860_a_(); matrixstack.func_227861_a_((double)(blockpos2.func_177958_n() & 15), (double)(blockpos2.func_177956_o() & 15), (double)(blockpos2.func_177952_p() & 15)); @@ -134,11 +134,11 @@ p_228940_4_.field_178498_d = false; p_228940_4_.field_178500_b.add(rendertype1); } -@@ -508,6 +532,8 @@ + matrixstack.func_227865_b_(); } ++ } } -+ } + net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null); if (p_228940_4_.field_178500_b.contains(RenderType.func_228645_f_())) { diff --git a/patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch similarity index 62% rename from patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch rename to patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch index ff55bdb6e..52450ee71 100644 --- a/patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/client/shader/ShaderGroup.java +++ b/net/minecraft/client/shader/ShaderGroup.java -@@ -143,7 +143,8 @@ - String s3 = JSONUtils.func_151200_h(jsonobject1, "id"); - Framebuffer framebuffer2 = this.func_148017_a(s3); - if (framebuffer2 == null) { -- ResourceLocation resourcelocation = new ResourceLocation("textures/effect/" + s3 + ".png"); -+ ResourceLocation rl = ResourceLocation.func_208304_a(s3); +@@ -157,7 +157,8 @@ + throw new JSONException("Render target '" + s4 + "' can't be used as depth buffer"); + } + +- ResourceLocation resourcelocation = new ResourceLocation("textures/effect/" + s4 + ".png"); ++ ResourceLocation rl = ResourceLocation.func_208304_a(s4); + ResourceLocation resourcelocation = new ResourceLocation(rl.func_110624_b(), "textures/effect/" + rl.func_110623_a() + ".png"); IResource iresource = null; diff --git a/patches/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch b/patches/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch index b4cad6e6d..1e75e60ee 100644 --- a/patches/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch @@ -9,16 +9,15 @@ return false; } else if (p_212832_2_.func_213700_eh().func_221130_b() != VillagerProfession.field_221156_f) { return false; -@@ -117,7 +117,12 @@ +@@ -117,6 +117,11 @@ } else if (itemstack.func_77973_b() == Items.field_185163_cU) { p_212833_1_.func_180501_a(this.field_220422_a, Blocks.field_185773_cZ.func_176223_P(), 3); flag = true; -+ } else if (itemstack.func_77973_b() instanceof net.minecraftforge.common.IPlantable) { -+ if (((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlantType(p_212833_1_, field_220422_a) == net.minecraftforge.common.PlantType.Crop) { -+ p_212833_1_.func_180501_a(field_220422_a, ((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlant(p_212833_1_, field_220422_a), 3); -+ flag = true; ++ } else if (itemstack.func_77973_b() instanceof net.minecraftforge.common.IPlantable) { ++ if (((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlantType(p_212833_1_, field_220422_a) == net.minecraftforge.common.PlantType.Crop) { ++ p_212833_1_.func_180501_a(field_220422_a, ((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlant(p_212833_1_, field_220422_a), 3); ++ flag = true; ++ } } -+ } } - if (flag) { diff --git a/patches/minecraft/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java.patch b/patches/minecraft/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java.patch new file mode 100644 index 000000000..888058855 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java ++++ b/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java +@@ -36,7 +36,7 @@ + } + + protected boolean func_188498_f() { +- return this.field_188499_a.func_233631_a_(Items.field_151031_f); ++ return this.field_188499_a.func_233634_a_(item -> item instanceof BowItem); + } + + public boolean func_75253_b() { diff --git a/patches_old/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch b/patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch similarity index 94% rename from patches_old/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch rename to patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch index 7625f5383..4edd54286 100644 --- a/patches_old/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch @@ -5,9 +5,9 @@ BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); Block block = blockstate.func_177230_c(); - if (!blockstate.func_196958_f() && blockstate.func_185904_a() != Material.field_151581_o) { -- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) && !BlockTags.field_219754_W.func_199685_a_(block)) { +- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) && !BlockTags.field_219754_W.func_230235_a_(block)) { + if (!blockstate.isAir(this.field_70170_p, blockpos) && blockstate.func_185904_a() != Material.field_151581_o) { -+ if (net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_70170_p, blockpos, this) && !BlockTags.field_219754_W.func_199685_a_(block)) { ++ if (net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_70170_p, blockpos, this) && !BlockTags.field_219754_W.func_230235_a_(block)) { flag1 = this.field_70170_p.func_217377_a(blockpos, false) || flag1; } else { flag = true; diff --git a/patches/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch index 7fbb36a83..dfc867113 100644 --- a/patches/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch @@ -18,3 +18,19 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else { +@@ -151,13 +153,14 @@ + public void func_70100_b_(PlayerEntity p_70100_1_) { + if (!this.field_70170_p.field_72995_K) { + if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerXpEvent.PickupXp(p_70100_1_, this))) return; + p_70100_1_.field_71090_bL = 2; + p_70100_1_.func_71001_a(this, 1); + Entry entry = EnchantmentHelper.func_234844_a_(Enchantments.field_185296_A, p_70100_1_, ItemStack::func_77951_h); + if (entry != null) { + ItemStack itemstack = entry.getValue(); + if (!itemstack.func_190926_b() && itemstack.func_77951_h()) { +- int i = Math.min(this.func_184514_c(this.field_70530_e), itemstack.func_77952_i()); ++ int i = Math.min((int)(this.field_70530_e * itemstack.getXpRepairRatio()), itemstack.func_77952_i()); + this.field_70530_e -= this.func_184515_b(i); + itemstack.func_196085_b(itemstack.func_77952_i() - i); + } diff --git a/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch index f7d52f5cf..d8d416ef4 100644 --- a/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/ItemEntity.java.patch @@ -57,7 +57,7 @@ return false; } else if (p_226532_1_.func_77942_o() ^ p_226532_0_.func_77942_o()) { return false; -+ }else if (!p_226532_0_.areCapsCompatible(p_226532_1_)) { ++ } else if (!p_226532_0_.areCapsCompatible(p_226532_1_)) { + return false; } else { return !p_226532_1_.func_77942_o() || p_226532_1_.func_77978_p().equals(p_226532_0_.func_77978_p()); @@ -86,7 +86,7 @@ if (!this.func_92059_d().func_190926_b()) { p_213281_1_.func_218657_a("Item", this.func_92059_d().func_77955_b(new CompoundNBT())); -@@ -291,12 +310,21 @@ +@@ -291,10 +310,18 @@ public void func_70100_b_(PlayerEntity p_70100_1_) { if (!this.field_70170_p.field_72995_K) { @@ -105,11 +105,8 @@ + net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerItemPickupEvent(p_70100_1_, this, copy); p_70100_1_.func_71001_a(this, i); if (itemstack.func_190926_b()) { -+ p_70100_1_.func_71001_a(this, i); this.func_70106_y(); - itemstack.func_190920_e(i); - } -@@ -392,7 +420,7 @@ +@@ -392,7 +419,7 @@ public void func_174870_v() { this.func_174871_r(); 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 1a3d57629..6463747ab 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch @@ -31,15 +31,19 @@ } public double func_70042_X() { -@@ -291,6 +293,7 @@ - } +@@ -304,9 +306,9 @@ - } else { -+ //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartUpdateEvent(this, this.getCurrentRailPosition())); - if (!this.func_189652_ae()) { - this.func_213317_d(this.func_213322_ci().func_72441_c(0.0D, -0.04D, 0.0D)); - } -@@ -331,8 +334,11 @@ + BlockPos blockpos = new BlockPos(i, j, k); + BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); +- if (AbstractRailBlock.func_208487_j(blockstate)) { ++ if (canUseRail() && AbstractRailBlock.func_208487_j(blockstate)) { + this.func_180460_a(blockpos, blockstate); +- if (blockstate.func_203425_a(Blocks.field_150408_cc)) { ++ if (blockstate.func_177230_c() instanceof PoweredRailBlock && ((PoweredRailBlock) blockstate.func_177230_c()).isActivatorRail()) { + this.func_96095_a(i, j, k, blockstate.func_177229_b(PoweredRailBlock.field_176569_M)); + } + } else { +@@ -331,8 +333,11 @@ } this.func_70101_b(this.field_70177_z, this.field_70125_A); @@ -53,7 +57,7 @@ if (!list.isEmpty()) { for(int l = 0; l < list.size(); ++l) { Entity entity1 = list.get(l); -@@ -344,7 +350,7 @@ +@@ -344,7 +349,7 @@ } } } else { @@ -62,7 +66,77 @@ if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof AbstractMinecartEntity) { entity.func_70108_f(this); } -@@ -440,7 +446,7 @@ +@@ -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 @@ + } + + protected void func_180459_n() { +- double d0 = this.func_174898_m(); ++ double d0 = field_70122_E ? this.func_174898_m() : getMaxSpeedAirLateral(); + Vector3d vector3d = this.func_213322_ci(); + this.func_213293_j(MathHelper.func_151237_a(vector3d.field_72450_a, -d0, d0), vector3d.field_72448_b, MathHelper.func_151237_a(vector3d.field_72449_c, -d0, d0)); + if (this.field_70122_E) { + this.func_213317_d(this.func_213322_ci().func_186678_a(0.5D)); + } + ++ if (getMaxSpeedAirVertical() > 0 && func_213322_ci().field_72448_b > getMaxSpeedAirVertical()) { ++ if(Math.abs(func_213322_ci().field_72450_a) < 0.3f && Math.abs(func_213322_ci().field_72449_c) < 0.3f) ++ func_213317_d(new Vector3d(func_213322_ci().field_72450_a, 0.15f, func_213322_ci().field_72449_c)); ++ else ++ func_213317_d(new Vector3d(func_213322_ci().field_72450_a, getMaxSpeedAirVertical(), func_213322_ci().field_72449_c)); ++ } ++ + this.func_213315_a(MoverType.SELF, this.func_213322_ci()); + if (!this.field_70122_E) { +- this.func_213317_d(this.func_213322_ci().func_186678_a(0.95D)); ++ this.func_213317_d(this.func_213322_ci().func_186678_a(getDragAir())); + } + + } +@@ -387,29 +400,29 @@ + boolean flag = false; + boolean flag1 = false; + AbstractRailBlock abstractrailblock = (AbstractRailBlock)p_180460_2_.func_177230_c(); +- if (abstractrailblock == Blocks.field_196552_aC) { ++ if (abstractrailblock instanceof PoweredRailBlock && !((PoweredRailBlock) abstractrailblock).isActivatorRail()) { + flag = p_180460_2_.func_177229_b(PoweredRailBlock.field_176569_M); + flag1 = !flag; + } + + double d3 = 0.0078125D; + Vector3d vector3d1 = this.func_213322_ci(); +- RailShape railshape = p_180460_2_.func_177229_b(abstractrailblock.func_176560_l()); ++ RailShape railshape = ((AbstractRailBlock)p_180460_2_.func_177230_c()).getRailDirection(p_180460_2_, this.field_70170_p, p_180460_1_, this); + switch(railshape) { + case ASCENDING_EAST: +- this.func_213317_d(vector3d1.func_72441_c(-0.0078125D, 0.0D, 0.0D)); ++ this.func_213317_d(vector3d1.func_72441_c(-1 * getSlopeAdjustment(), 0.0D, 0.0D)); + ++d1; + break; + case ASCENDING_WEST: +- this.func_213317_d(vector3d1.func_72441_c(0.0078125D, 0.0D, 0.0D)); ++ this.func_213317_d(vector3d1.func_72441_c(getSlopeAdjustment(), 0.0D, 0.0D)); + ++d1; + break; + case ASCENDING_NORTH: +- this.func_213317_d(vector3d1.func_72441_c(0.0D, 0.0D, 0.0078125D)); ++ this.func_213317_d(vector3d1.func_72441_c(0.0D, 0.0D, getSlopeAdjustment())); + ++d1; + break; + case ASCENDING_SOUTH: +- this.func_213317_d(vector3d1.func_72441_c(0.0D, 0.0D, -0.0078125D)); ++ this.func_213317_d(vector3d1.func_72441_c(0.0D, 0.0D, -1 * getSlopeAdjustment())); + ++d1; + } + +@@ -440,7 +453,7 @@ } } @@ -71,7 +145,19 @@ double d22 = Math.sqrt(func_213296_b(this.func_213322_ci())); if (d22 < 0.03D) { this.func_213317_d(Vector3d.field_186680_a); -@@ -500,7 +506,10 @@ +@@ -469,10 +482,7 @@ + d0 = d23 + d4 * d14; + d2 = d10 + d5 * d14; + this.func_70107_b(d0, d1, d2); +- double d24 = this.func_184207_aI() ? 0.75D : 1.0D; +- double d25 = this.func_174898_m(); +- vector3d1 = this.func_213322_ci(); +- this.func_213315_a(MoverType.SELF, new Vector3d(MathHelper.func_151237_a(d24 * vector3d1.field_72450_a, -d25, d25), 0.0D, MathHelper.func_151237_a(d24 * vector3d1.field_72449_c, -d25, d25))); ++ this.moveMinecartOnRail(p_180460_1_); + 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 @@ 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())); } @@ -83,7 +169,7 @@ Vector3d vector3d6 = this.func_213322_ci(); double d27 = Math.sqrt(func_213296_b(vector3d6)); if (d27 > 0.01D) { -@@ -555,7 +564,7 @@ +@@ -555,7 +568,7 @@ BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (AbstractRailBlock.func_208487_j(blockstate)) { @@ -92,7 +178,7 @@ p_70495_3_ = (double)j; if (railshape.func_208092_c()) { p_70495_3_ = (double)(j + 1); -@@ -594,7 +603,7 @@ +@@ -594,7 +607,7 @@ BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (AbstractRailBlock.func_208487_j(blockstate)) { @@ -101,7 +187,7 @@ Pair pair = func_226573_a_(railshape); Vector3i vector3i = pair.getFirst(); Vector3i vector3i1 = pair.getSecond(); -@@ -657,6 +666,11 @@ +@@ -657,6 +670,11 @@ } public void func_70108_f(Entity p_70108_1_) { @@ -113,7 +199,21 @@ 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_)) { -@@ -802,6 +816,40 @@ +@@ -692,11 +710,11 @@ + + Vector3d vector3d2 = this.func_213322_ci(); + Vector3d vector3d3 = p_70108_1_.func_213322_ci(); +- if (((AbstractMinecartEntity)p_70108_1_).func_184264_v() == AbstractMinecartEntity.Type.FURNACE && this.func_184264_v() != AbstractMinecartEntity.Type.FURNACE) { ++ if (((AbstractMinecartEntity)p_70108_1_).isPoweredCart() && !this.isPoweredCart()) { + this.func_213317_d(vector3d2.func_216372_d(0.2D, 1.0D, 0.2D)); + this.func_70024_g(vector3d3.field_72450_a - d0, 0.0D, vector3d3.field_72449_c - d1); + p_70108_1_.func_213317_d(vector3d3.func_216372_d(0.95D, 1.0D, 0.95D)); +- } else if (((AbstractMinecartEntity)p_70108_1_).func_184264_v() != AbstractMinecartEntity.Type.FURNACE && this.func_184264_v() == AbstractMinecartEntity.Type.FURNACE) { ++ } else if (!((AbstractMinecartEntity)p_70108_1_).isPoweredCart() && this.isPoweredCart()) { + 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 @@ return new SSpawnObjectPacket(this); } diff --git a/patches/minecraft/net/minecraft/entity/item/minecart/CommandBlockMinecartEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/minecart/CommandBlockMinecartEntity.java.patch new file mode 100644 index 000000000..fdccc6398 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/item/minecart/CommandBlockMinecartEntity.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/entity/item/minecart/CommandBlockMinecartEntity.java ++++ b/net/minecraft/entity/item/minecart/CommandBlockMinecartEntity.java +@@ -73,6 +73,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; + return this.field_145824_a.func_175574_a(p_184230_1_); + } + 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 b00054709..e50e99af2 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch @@ -1,15 +1,32 @@ --- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java +++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java -@@ -151,6 +151,8 @@ - - public ActionResultType func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { - p_184230_1_.func_213829_a(this); -+ ActionResultType ret = super.func_184230_a(p_184230_1_, p_184230_2_); -+ if (ret.func_226246_a_()) return ret; - return ActionResultType.func_233537_a_(this.field_70170_p.field_72995_K); +@@ -116,12 +116,14 @@ + return super.func_241206_a_(p_241206_1_); } -@@ -173,6 +175,8 @@ +- public void func_70106_y() { ++ @Override ++ public void remove(boolean keepData) { + if (!this.field_70170_p.field_72995_K && this.field_94112_b) { + InventoryHelper.func_180176_a(this.field_70170_p, this, this); + } + +- super.func_70106_y(); ++ super.remove(keepData); ++ if (!keepData) itemHandler.invalidate(); + } + + protected void func_213281_b(CompoundNBT p_213281_1_) { +@@ -150,6 +152,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 @@ 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); @@ -18,7 +35,7 @@ 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 +207,17 @@ +@@ -203,4 +209,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/VillagerEntity.java.patch b/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch index 3be0cc437..6783c5024 100644 --- a/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/entity/merchant/villager/VillagerEntity.java +++ b/net/minecraft/entity/merchant/villager/VillagerEntity.java +@@ -240,7 +240,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_); +- if (itemstack.func_77973_b() != Items.field_196172_da && this.func_70089_S() && !this.func_213716_dX() && !this.func_70608_bn()) { ++ if (itemstack.func_77973_b() != Items.field_196172_da && this.func_70089_S() && !this.func_213716_dX() && !this.func_70608_bn() && !p_230254_1_.func_226563_dT_()) { + 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 @@ } diff --git a/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch index 334fa8364..3682acc2d 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch @@ -45,6 +45,15 @@ iworld.func_180501_a(blockpos, blockstate2, 3); this.field_179475_a.func_195406_b((BlockState)null); } +@@ -457,7 +459,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_); + } + } + @@ -499,7 +501,7 @@ public boolean func_75250_a() { if (this.field_179473_a.func_195405_dq() != null) { diff --git a/patches/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch index 1777ad53b..1071e36f9 100644 --- a/patches/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch @@ -9,7 +9,15 @@ if (blockstate.func_203425_a(Blocks.field_196603_bb)) { Direction direction = blockstate.func_177229_b(PistonBlock.field_176387_N); if (this.field_70170_p.func_175623_d(blockpos.func_177972_a(direction))) { -@@ -249,6 +249,7 @@ +@@ -219,6 +219,7 @@ + this.func_226286_f_((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p() + 0.5D); + double d2 = 0.5D - (double)MathHelper.func_76126_a((0.5F + this.field_184706_by) * (float)Math.PI) * 0.5D; + double d0 = 0.5D - (double)MathHelper.func_76126_a((0.5F + this.field_184705_bx) * (float)Math.PI) * 0.5D; ++ if (this.isAddedToWorld() && this.field_70170_p instanceof net.minecraft.world.server.ServerWorld) ((net.minecraft.world.server.ServerWorld)this.field_70170_p).func_217464_b(this); // Forge - Process chunk registration after moving. + Direction direction2 = this.func_184696_cZ().func_176734_d(); + this.func_174826_a((new AxisAlignedBB(this.func_226277_ct_() - 0.5D, this.func_226278_cu_(), this.func_226281_cx_() - 0.5D, this.func_226277_ct_() + 0.5D, this.func_226278_cu_() + 1.0D, this.func_226281_cx_() + 0.5D)).func_72321_a((double)direction2.func_82601_c() * d2, (double)direction2.func_96559_d() * d2, (double)direction2.func_82599_e() * d2)); + double d1 = d2 - d0; +@@ -249,6 +250,7 @@ super.func_70107_b(p_70107_1_, p_70107_3_, p_70107_5_); if (this.field_70180_af != null && this.field_70173_aa != 0) { Optional optional = this.field_70180_af.func_187225_a(field_184701_b); @@ -17,7 +25,7 @@ Optional optional1 = Optional.of(new BlockPos(p_70107_1_, p_70107_3_, p_70107_5_)); if (!optional1.equals(optional)) { this.field_70180_af.func_187227_b(field_184701_b, optional1); -@@ -282,7 +283,14 @@ +@@ -282,7 +284,14 @@ BlockPos blockpos1 = blockpos.func_177982_a(8 - this.field_70146_Z.nextInt(17), 8 - this.field_70146_Z.nextInt(17), 8 - this.field_70146_Z.nextInt(17)); if (blockpos1.func_177956_o() > 0 && this.field_70170_p.func_175623_d(blockpos1) && this.field_70170_p.func_175723_af().func_177746_a(blockpos1) && this.field_70170_p.func_226665_a__(this, new AxisAlignedBB(blockpos1))) { Direction direction = this.func_234299_g_(blockpos1); @@ -32,7 +40,7 @@ this.field_70180_af.func_187227_b(field_184700_a, direction); this.func_184185_a(SoundEvents.field_187791_eX, 1.0F, 1.0F); this.field_70180_af.func_187227_b(field_184701_b, Optional.of(blockpos1)); -@@ -306,7 +314,6 @@ +@@ -306,7 +315,6 @@ this.field_70760_ar = 0.0F; this.field_70761_aq = 0.0F; } diff --git a/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch index 1aa7c75c8..864a3187e 100644 --- a/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch @@ -1,6 +1,25 @@ --- a/net/minecraft/entity/monster/ZombieEntity.java +++ b/net/minecraft/entity/monster/ZombieEntity.java -@@ -277,6 +277,7 @@ +@@ -260,12 +260,16 @@ + livingentity = (LivingEntity)p_70097_1_.func_76346_g(); + } + +- if (livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_233637_b_(Attributes.field_233829_l_) && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) { + int i = MathHelper.func_76128_c(this.func_226277_ct_()); + int j = MathHelper.func_76128_c(this.func_226278_cu_()); + int k = MathHelper.func_76128_c(this.func_226281_cx_()); +- ZombieEntity zombieentity = new ZombieEntity(this.field_70170_p); + ++ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent event = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, livingentity, this.func_110148_a(Attributes.field_233829_l_).func_111126_e()); ++ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return true; ++ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || ++ livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(Attributes.field_233829_l_).func_111126_e() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) { ++ ZombieEntity zombieentity = event.getCustomSummonedAid() != null && event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ? event.getCustomSummonedAid() : EntityType.field_200725_aD.func_200721_a(this.field_70170_p); ++ + 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 @@ 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); @@ -8,3 +27,21 @@ 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 @@ + } + + public static boolean func_241399_a_(Random p_241399_0_) { +- return p_241399_0_.nextFloat() < 0.05F; ++ return p_241399_0_.nextFloat() < net.minecraftforge.common.ForgeConfig.SERVER.zombieBabyChance.get(); + } + + protected void func_207304_a(float p_207304_1_) { +@@ -483,7 +488,7 @@ + } + + protected void func_230291_eT_() { +- this.func_110148_a(Attributes.field_233829_l_).func_111128_a(this.field_70146_Z.nextDouble() * (double)0.1F); ++ this.func_110148_a(Attributes.field_233829_l_).func_111128_a(this.field_70146_Z.nextDouble() * net.minecraftforge.common.ForgeConfig.SERVER.zombieBaseSummonChance.get()); + } + + public double func_70033_W() { 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 411867bbb..0256f5747 100644 --- a/patches/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch @@ -7,17 +7,29 @@ + this.itemHandler = net.minecraftforge.common.util.LazyOptional.of(() -> new net.minecraftforge.items.wrapper.InvWrapper(this.field_110296_bG)); int i = Math.min(inventory.func_70302_i_(), this.field_110296_bG.func_70302_i_()); - if (this.func_184207_aI() && this.field_190688_bE) { -@@ -672,6 +673,7 @@ - this.func_213293_j(vec3d.field_72450_a, d1, vec3d.field_72449_c); - this.func_110255_k(true); - this.field_70160_al = true; -+ net.minecraftforge.common.ForgeHooks.onLivingJump(this); - if (f1 > 0.0F) { - float f2 = MathHelper.func_76126_a(this.field_70177_z * ((float)Math.PI / 180F)); - float f3 = MathHelper.func_76134_b(this.field_70177_z * ((float)Math.PI / 180F)); -@@ -947,4 +949,22 @@ + for(int j = 0; j < i; ++j) { +@@ -275,6 +276,7 @@ + this.field_110296_bG.func_110134_a(this); + this.func_230275_fc_(); ++ this.itemHandler = net.minecraftforge.common.util.LazyOptional.of(() -> new net.minecraftforge.items.wrapper.InvWrapper(this.field_110296_bG)); + } + + protected void func_230275_fc_() { +@@ -333,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()); +- SoundType soundtype = p_180429_2_.func_215695_r(); ++ SoundType soundtype = p_180429_2_.getSoundType(field_70170_p, p_180429_1_, this); + if (blockstate.func_203425_a(Blocks.field_150433_aE)) { +- soundtype = blockstate.func_215695_r(); ++ soundtype = blockstate.getSoundType(field_70170_p, p_180429_1_, this); + } + + if (this.func_184207_aI() && this.field_190688_bE) { +@@ -1010,4 +1012,22 @@ + this.func_230273_eI_(); return super.func_213386_a(p_213386_1_, p_213386_2_, p_213386_3_, p_213386_4_, p_213386_5_); } + diff --git a/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch index 6521589e8..240fb89fd 100644 --- a/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch @@ -1,35 +1,32 @@ --- a/net/minecraft/entity/player/PlayerEntity.java +++ b/net/minecraft/entity/player/PlayerEntity.java -@@ -110,6 +110,10 @@ +@@ -110,6 +110,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; public abstract class PlayerEntity extends LivingEntity { + public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; -+ protected java.util.HashMap spawnPosMap = new java.util.HashMap<>(); -+ protected java.util.HashMap spawnForcedMap = new java.util.HashMap<>(); -+ public static final net.minecraft.entity.ai.attributes.Attribute REACH_DISTANCE = new net.minecraft.entity.ai.attributes.RangedAttribute( "generic.reachDistance", 5.0D, 0.0D, 1024.0D).func_233753_a_(true); public static final EntitySize field_213835_bs = EntitySize.func_220314_b(0.6F, 1.8F); private static final Map field_213836_b = ImmutableMap.builder().put(Pose.STANDING, field_213835_bs).put(Pose.SLEEPING, field_213377_as).put(Pose.FALL_FLYING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SWIMMING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SPIN_ATTACK, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.CROUCHING, EntitySize.func_220314_b(0.6F, 1.5F)).put(Pose.DYING, EntitySize.func_220311_c(0.2F, 0.2F)).build(); private static final DataParameter field_184829_a = EntityDataManager.func_187226_a(PlayerEntity.class, DataSerializers.field_187193_c); -@@ -150,6 +154,8 @@ +@@ -150,6 +151,8 @@ private final CooldownTracker field_184832_bU = this.func_184815_l(); @Nullable public FishingBobberEntity field_71104_cf; -+ private final java.util.Collection prefixes = new java.util.LinkedList(); -+ private final java.util.Collection suffixes = new java.util.LinkedList(); ++ 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_); -@@ -175,7 +181,7 @@ +@@ -175,7 +178,7 @@ } public static AttributeModifierMap.MutableAttribute func_234570_el_() { - return LivingEntity.func_233639_cI_().func_233815_a_(Attributes.field_233823_f_, 1.0D).func_233815_a_(Attributes.field_233821_d_, (double)0.1F).func_233814_a_(Attributes.field_233825_h_).func_233814_a_(Attributes.field_233828_k_); -+ return LivingEntity.func_233639_cI_().func_233815_a_(Attributes.field_233823_f_, 1.0D).func_233815_a_(Attributes.field_233821_d_, (double)0.1F).func_233814_a_(Attributes.field_233825_h_).func_233814_a_(Attributes.field_233828_k_).func_233814_a_(REACH_DISTANCE); ++ return LivingEntity.func_233639_cI_().func_233815_a_(Attributes.field_233823_f_, 1.0D).func_233815_a_(Attributes.field_233821_d_, (double)0.1F).func_233814_a_(Attributes.field_233825_h_).func_233814_a_(Attributes.field_233828_k_).func_233814_a_(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()); } protected void func_70088_a() { -@@ -189,6 +195,7 @@ +@@ -189,6 +192,7 @@ } public void func_70071_h_() { @@ -37,7 +34,7 @@ this.field_70145_X = this.func_175149_v(); if (this.func_175149_v()) { this.field_70122_E = false; -@@ -204,7 +211,7 @@ +@@ -204,7 +208,7 @@ this.field_71076_b = 100; } @@ -46,7 +43,7 @@ this.func_225652_a_(false, true); } } else if (this.field_71076_b > 0) { -@@ -258,6 +265,7 @@ +@@ -258,6 +262,7 @@ this.func_203041_m(); this.field_184832_bU.func_185144_a(); this.func_213832_dB(); @@ -54,7 +51,7 @@ } public boolean func_226563_dT_() { -@@ -550,6 +558,7 @@ +@@ -550,6 +555,7 @@ } public void func_70645_a(DamageSource p_70645_1_) { @@ -62,7 +59,7 @@ super.func_70645_a(p_70645_1_); this.func_226264_Z_(); if (!this.func_175149_v()) { -@@ -603,12 +612,14 @@ +@@ -603,12 +609,14 @@ } public boolean func_225609_n_(boolean p_225609_1_) { @@ -79,7 +76,7 @@ } @Nullable -@@ -646,7 +657,12 @@ +@@ -646,7 +654,12 @@ } } @@ -92,42 +89,21 @@ float f = this.field_71071_by.func_184438_a(p_184813_1_); if (f > 1.0F) { int i = EnchantmentHelper.func_185293_e(this); -@@ -733,6 +749,13 @@ - p_213281_1_.func_74768_a("DataVersion", SharedConstants.func_215069_a().getWorldVersion()); - p_213281_1_.func_218657_a("Inventory", this.field_71071_by.func_70442_a(new ListNBT())); - p_213281_1_.func_74768_a("SelectedItemSlot", this.field_71071_by.field_70461_c); -+ p_213281_1_.func_150295_c("Spawns", 10).forEach(e -> { -+ CompoundNBT data = (CompoundNBT)e; -+ ResourceLocation dim = new ResourceLocation(data.func_74779_i("Dim")); -+ this.spawnPosMap.put(dim, new BlockPos(data.func_74762_e("SpawnX"), data.func_74762_e("SpawnY"), data.func_74762_e("SpawnZ"))); -+ this.spawnForcedMap.put(dim, data.func_74767_n("SpawnForced")); -+ }); -+ - p_213281_1_.func_74777_a("SleepTimer", (short)this.field_71076_b); - p_213281_1_.func_74776_a("XpP", this.field_71106_cc); - p_213281_1_.func_74768_a("XpLevel", this.field_71068_ca); -@@ -750,6 +773,20 @@ - p_213281_1_.func_218657_a("ShoulderEntityRight", this.func_192025_dl()); +@@ -688,11 +701,12 @@ + f /= 5.0F; } -+ ListNBT spawnlist = new ListNBT(); -+ spawnPosMap.forEach((dim, pos) -> { -+ if (pos != null) { -+ CompoundNBT data = new CompoundNBT(); -+ data.func_74778_a("Dim", dim.toString()); -+ data.func_74768_a("SpawnX", pos.func_177958_n()); -+ data.func_74768_a("SpawnY", pos.func_177956_o()); -+ data.func_74768_a("SpawnZ", pos.func_177952_p()); -+ data.func_74757_a("SpawnForced", spawnForcedMap.getOrDefault(dim, false)); -+ spawnlist.add(data); -+ } -+ }); -+ p_213281_1_.func_218657_a("Spawns", spawnlist); -+ ++ f = net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(this, p_184813_1_, f, pos); + return f; } - public boolean func_180431_b(DamageSource p_180431_1_) { -@@ -767,6 +804,7 @@ + public boolean func_234569_d_(BlockState p_234569_1_) { +- return !p_234569_1_.func_235783_q_() || this.field_71071_by.func_70448_g().func_150998_b(p_234569_1_); ++ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_234569_1_, !p_234569_1_.func_235783_q_() || this.field_71071_by.func_70448_g().func_150998_b(p_234569_1_)); + } + + public void func_70037_a(CompoundNBT p_70037_1_) { +@@ -767,6 +781,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -135,7 +111,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) { -@@ -798,7 +836,7 @@ +@@ -798,7 +813,7 @@ protected void func_190629_c(LivingEntity p_190629_1_) { super.func_190629_c(p_190629_1_); @@ -144,7 +120,24 @@ this.func_190777_m(true); } -@@ -847,10 +885,13 @@ +@@ -819,7 +834,7 @@ + } + + protected void func_184590_k(float p_184590_1_) { +- if (this.field_184627_bm.func_77973_b() == Items.field_185159_cQ) { ++ if (this.field_184627_bm.isShield(this)) { + if (!this.field_70170_p.field_72995_K) { + this.func_71029_a(Stats.field_75929_E.func_199076_b(this.field_184627_bm.func_77973_b())); + } +@@ -829,6 +844,7 @@ + Hand hand = this.func_184600_cs(); + this.field_184627_bm.func_222118_a(i, this, (p_213833_1_) -> { + p_213833_1_.func_213334_d(hand); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, this.field_184627_bm, hand); + }); + if (this.field_184627_bm.func_190926_b()) { + if (hand == Hand.MAIN_HAND) { +@@ -847,10 +863,13 @@ protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { if (!this.func_180431_b(p_70665_1_)) { @@ -158,7 +151,7 @@ float f = p_70665_2_ - f2; if (f > 0.0F && f < 3.4028235E37F) { this.func_195067_a(Stats.field_212738_J, Math.round(f * 10.0F)); -@@ -909,6 +950,8 @@ +@@ -909,6 +928,8 @@ return ActionResultType.PASS; } else { @@ -167,7 +160,7 @@ ItemStack itemstack = this.func_184586_b(p_190775_2_); ItemStack itemstack1 = itemstack.func_77946_l(); ActionResultType actionresulttype = p_190775_1_.func_184230_a(this, p_190775_2_); -@@ -917,6 +960,9 @@ +@@ -917,6 +938,9 @@ itemstack.func_190920_e(itemstack1.func_190916_E()); } @@ -177,7 +170,7 @@ return actionresulttype; } else { if (!itemstack.func_190926_b() && p_190775_1_ instanceof LivingEntity) { -@@ -927,6 +973,7 @@ +@@ -927,6 +951,7 @@ ActionResultType actionresulttype1 = itemstack.func_111282_a_(this, (LivingEntity)p_190775_1_, p_190775_2_); if (actionresulttype1.func_226246_a_()) { if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) { @@ -185,7 +178,7 @@ this.func_184611_a(p_190775_2_, ItemStack.field_190927_a); } -@@ -1007,6 +1054,7 @@ +@@ -1007,6 +1032,7 @@ } public void func_71059_n(Entity p_71059_1_) { @@ -193,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 +1082,10 @@ +@@ -1034,8 +1060,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(); @@ -205,7 +198,7 @@ } f = f + f1; -@@ -1123,8 +1173,10 @@ +@@ -1123,8 +1151,10 @@ } if (!this.field_70170_p.field_72995_K && !itemstack1.func_190926_b() && entity instanceof LivingEntity) { @@ -216,7 +209,7 @@ this.func_184611_a(Hand.MAIN_HAND, ItemStack.field_190927_a); } } -@@ -1166,7 +1218,7 @@ +@@ -1166,7 +1196,7 @@ } if (this.field_70146_Z.nextFloat() < f) { @@ -225,7 +218,7 @@ this.func_184602_cy(); this.field_70170_p.func_72960_a(this, (byte)30); } -@@ -1192,8 +1244,9 @@ +@@ -1192,8 +1222,9 @@ public void func_71004_bE() { } @@ -237,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 +1269,7 @@ +@@ -1216,6 +1247,7 @@ } public void func_225652_a_(boolean p_225652_1_, boolean p_225652_2_) { @@ -245,7 +238,18 @@ super.func_213366_dy(); if (this.field_70170_p instanceof ServerWorld && p_225652_2_) { ((ServerWorld)this.field_70170_p).func_72854_c(); -@@ -1421,6 +1475,7 @@ +@@ -1238,8 +1270,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_) { + return Optional.empty(); + } else { +@@ -1421,6 +1453,7 @@ public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) { if (this.field_71075_bZ.field_75101_c) { @@ -253,7 +257,7 @@ return false; } else { if (p_225503_1_ >= 2.0F) { -@@ -1475,6 +1530,10 @@ +@@ -1475,6 +1508,10 @@ } public void func_195068_e(int p_195068_1_) { @@ -264,7 +268,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 +1562,7 @@ +@@ -1503,7 +1540,7 @@ } public void func_192024_a(ItemStack p_192024_1_, int p_192024_2_) { @@ -273,7 +277,7 @@ if (this.field_71068_ca < 0) { this.field_71068_ca = 0; this.field_71106_cc = 0.0F; -@@ -1514,6 +1573,10 @@ +@@ -1514,6 +1551,10 @@ } public void func_82242_a(int p_82242_1_) { @@ -284,17 +288,29 @@ this.field_71068_ca += p_82242_1_; if (this.field_71068_ca < 0) { this.field_71068_ca = 0; -@@ -1956,4 +2019,37 @@ +@@ -1704,7 +1745,10 @@ + } + + public ITextComponent func_145748_c_() { +- IFormattableTextComponent iformattabletextcomponent = ScorePlayerTeam.func_237500_a_(this.func_96124_cp(), this.func_200200_C_()); ++ IFormattableTextComponent iformattabletextcomponent = new StringTextComponent(""); ++ iformattabletextcomponent = prefixes.stream().reduce(iformattabletextcomponent, IFormattableTextComponent::func_230529_a_); ++ iformattabletextcomponent = iformattabletextcomponent.func_230529_a_(ScorePlayerTeam.func_237500_a_(this.func_96124_cp(), this.func_200200_C_())); ++ iformattabletextcomponent = suffixes.stream().reduce(iformattabletextcomponent, IFormattableTextComponent::func_230529_a_); + return this.func_208016_c(iformattabletextcomponent); + } + +@@ -1956,4 +2000,37 @@ return this.field_221260_g; } } + + // =========== FORGE START ==============// -+ public Collection getPrefixes() { ++ public Collection getPrefixes() { + return this.prefixes; + } + -+ public Collection getSuffixes() { ++ public Collection getSuffixes() { + return this.suffixes; + } + diff --git a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch index 56126b4ef..cbd1812a4 100644 --- a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch @@ -23,7 +23,41 @@ 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(); -@@ -731,6 +728,9 @@ +@@ -597,12 +594,13 @@ + + @Nullable + public Entity func_241206_a_(ServerWorld p_241206_1_) { ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_241206_1_.func_234923_W_())) return null; + this.field_184851_cj = true; + ServerWorld serverworld = this.func_71121_q(); + RegistryKey registrykey = serverworld.func_234923_W_(); + if (registrykey == World.field_234920_i_ && p_241206_1_.func_234923_W_() == World.field_234918_g_) { + this.func_213319_R(); +- this.func_71121_q().func_217434_e(this); ++ this.func_71121_q().removePlayer(this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom + 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 +614,8 @@ + 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); +- serverworld.func_217434_e(this); +- 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(); + double d0 = this.func_226277_ct_(); + double d1 = this.func_226278_cu_(); + double d2 = this.func_226281_cx_(); +@@ -689,6 +687,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 +730,9 @@ } public Either func_213819_a(BlockPos p_213819_1_) { @@ -33,7 +67,7 @@ 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_()) { -@@ -775,6 +775,7 @@ +@@ -775,6 +777,7 @@ } private boolean func_241147_a_(BlockPos p_241147_1_, Direction p_241147_2_) { @@ -41,7 +75,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 +875,7 @@ +@@ -874,6 +877,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; @@ -49,7 +83,7 @@ return OptionalInt.of(this.field_71139_cq); } } -@@ -892,6 +894,7 @@ +@@ -892,6 +896,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); @@ -57,7 +91,7 @@ } public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) { -@@ -949,6 +952,7 @@ +@@ -949,6 +954,7 @@ public void func_71128_l() { this.field_71070_bA.func_75134_a(this); @@ -65,14 +99,11 @@ this.field_71070_bA = this.field_71069_bz; } -@@ -1075,6 +1079,16 @@ +@@ -1075,6 +1081,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()); + -+ this.spawnPosMap = p_193104_1_.spawnPosMap; -+ this.spawnForcedMap = p_193104_1_.spawnForcedMap; -+ + //Copy over a section of the Entity Data from the old player. + //Allows mods to specify data that persists after players respawn. + CompoundNBT old = p_193104_1_.getPersistentData(); @@ -82,6 +113,32 @@ } protected void func_70670_a(EffectInstance p_70670_1_) { +@@ -1291,14 +1304,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_); +- } else { ++ } 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 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); +- this.field_70128_L = false; ++ serverworld.removePlayer(this, true); //Forge: The player entity itself is moved, and not cloned. So we need to keep the data alive with no matching invalidate call later. ++ this.revive(); + 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 +1320,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); ++ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, serverworld.func_234923_W_(), p_200619_1_.func_234923_W_()); + } + + } @@ -1375,6 +1389,8 @@ if (itementity == null) { return null; diff --git a/patches/minecraft/net/minecraft/entity/projectile/FireworkRocketEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/FireworkRocketEntity.java.patch new file mode 100644 index 000000000..e747249b6 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/projectile/FireworkRocketEntity.java.patch @@ -0,0 +1,16 @@ +--- a/net/minecraft/entity/projectile/FireworkRocketEntity.java ++++ b/net/minecraft/entity/projectile/FireworkRocketEntity.java +@@ -155,6 +155,13 @@ + + } + ++ @Override ++ protected void func_70227_a(RayTraceResult result) { ++ if (result.func_216346_c() == RayTraceResult.Type.MISS || !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, result)) { ++ super.func_70227_a(result); ++ } ++ } ++ + private void func_213893_k() { + this.field_70170_p.func_72960_a(this, (byte)17); + this.func_191510_k(); diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index b0108133e..0df3fa5df 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -63,7 +63,7 @@ float f7 = f2 * f4; - double d0 = 5.0D; - Vector3d vector3d1 = vector3d.func_72441_c((double)f6 * 5.0D, (double)f5 * 5.0D, (double)f7 * 5.0D); -+ double d0 = p_219968_1_.func_110148_a(PlayerEntity.REACH_DISTANCE).func_111126_e();; ++ double d0 = p_219968_1_.func_110148_a(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).func_111126_e();; + Vector3d vector3d1 = vector3d.func_72441_c((double)f6 * d0, (double)f5 * d0, (double)f7 * d0); return p_219968_0_.func_217299_a(new RayTraceContext(vector3d, vector3d1, RayTraceContext.BlockMode.OUTLINE, p_219968_2_, p_219968_1_)); } diff --git a/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch b/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch index 7a57a033d..ae74f82e0 100644 --- a/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch @@ -26,7 +26,7 @@ this.field_147369_b.func_143004_u(); if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) { - if (this.field_184362_y == null && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < 64.0D && serverworld.func_175660_a(this.field_147369_b, blockpos)) { -+ double dist = field_147369_b.func_110148_a(net.minecraft.entity.player.PlayerEntity.REACH_DISTANCE).func_111126_e() + 3; ++ double dist = field_147369_b.func_110148_a(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).func_111126_e() + 3; + dist *= dist; + if (this.field_184362_y == null && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < dist && serverworld.func_175660_a(this.field_147369_b, blockpos)) { ActionResultType actionresulttype = this.field_147369_b.field_71134_c.func_219441_a(this.field_147369_b, serverworld, itemstack, hand, blockraytraceresult); diff --git a/patches/minecraft/net/minecraft/server/Main.java.patch b/patches/minecraft/net/minecraft/server/Main.java.patch index f942dce50..0ab0d952e 100644 --- a/patches/minecraft/net/minecraft/server/Main.java.patch +++ b/patches/minecraft/net/minecraft/server/Main.java.patch @@ -8,6 +8,15 @@ try { OptionSet optionset = optionparser.parse(p_main_0_); +@@ -86,7 +87,7 @@ + Util.func_240994_l_(); + Path path = Paths.get("server.properties"); + ServerPropertiesProvider serverpropertiesprovider = new ServerPropertiesProvider(path); +- serverpropertiesprovider.func_219035_b(); ++ if (optionset.has(optionspec1) || !java.nio.file.Files.exists(path)) serverpropertiesprovider.func_219035_b(); + Path path1 = Paths.get("eula.txt"); + ServerEula servereula = new ServerEula(path1); + if (optionset.has(optionspec1)) { @@ -105,6 +106,10 @@ GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(file1, MinecraftServer.field_152367_a.getName())); @@ -19,3 +28,11 @@ 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 +175,7 @@ + Thread thread = new Thread("Server Shutdown Thread") { + public void run() { + dedicatedserver.func_71263_m(true); ++ LogManager.shutdown(); // we're manually managing the logging shutdown on the server. Make sure we do it here at the end. + } + }; + thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(field_240759_a_)); diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 2a7986280..45f911dbe 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -336,6 +336,8 @@ - ServerWorld serverworld = new ServerWorld(this, this.field_213217_au, this.field_71310_m, iserverworldinfo, World.field_234918_g_, registrykey, dimensiontype, p_240787_1_, chunkgenerator, flag, j, list, true); - this.field_71305_c.put(World.field_234918_g_, serverworld); - DimensionSavedDataManager dimensionsaveddatamanager = serverworld.func_217481_x(); -+ // Move factory creation earlier to prevent startupquery deadlock -+ IChunkStatusListener ichunkstatuslistener = this.field_213220_d.create(11); - this.func_213204_a(dimensionsaveddatamanager); - this.field_229733_al_ = new CommandStorage(dimensionsaveddatamanager); - WorldBorder worldborder = serverworld.func_175723_af(); -@@ -380,6 +382,7 @@ +@@ -226,7 +226,7 @@ + + public static S func_240784_a_(Function p_240784_0_) { + AtomicReference atomicreference = new AtomicReference<>(); +- Thread thread = new Thread(() -> { ++ Thread thread = new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, () -> { + atomicreference.get().func_240802_v_(); + }, "Server thread"); + thread.setUncaughtExceptionHandler((p_240779_0_, p_240779_1_) -> { +@@ -380,6 +380,7 @@ worldborder.func_177737_a(new IBorderListener.Impl(serverworld1.func_175723_af())); this.field_71305_c.put(registrykey2, serverworld1); } @@ -17,7 +17,7 @@ } } -@@ -391,6 +394,7 @@ +@@ -391,6 +392,7 @@ } else if (p_240786_3_) { p_240786_1_.func_176143_a(BlockPos.field_177992_a.func_177984_a()); } else { @@ -25,7 +25,7 @@ BiomeProvider biomeprovider = chunkgenerator.func_202090_b(); List list = biomeprovider.func_76932_a(); Random random = new Random(p_240786_0_.func_72905_C()); -@@ -569,6 +573,7 @@ +@@ -569,6 +571,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 +622,7 @@ +@@ -617,6 +620,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,9 +652,15 @@ +@@ -646,9 +650,15 @@ this.func_240795_b_(longtickdetector); this.field_71296_Q = true; } @@ -57,7 +57,7 @@ } catch (Throwable throwable1) { field_147145_h.error("Encountered an unexpected exception", throwable1); CrashReport crashreport; -@@ -665,6 +677,7 @@ +@@ -665,6 +675,7 @@ field_147145_h.error("We were unable to save this crash report to disk."); } @@ -65,7 +65,7 @@ this.func_71228_a(crashreport); } finally { try { -@@ -673,6 +686,7 @@ +@@ -673,6 +684,7 @@ } catch (Throwable throwable) { field_147145_h.error("Exception stopping the server", throwable); } finally { @@ -73,7 +73,7 @@ this.func_71240_o(); } -@@ -774,6 +788,7 @@ +@@ -774,6 +786,7 @@ protected void func_71217_p(BooleanSupplier p_71217_1_) { long i = Util.func_211178_c(); @@ -81,7 +81,7 @@ ++this.field_71315_w; this.func_71190_q(p_71217_1_); if (i - this.field_147142_T >= 5000000000L) { -@@ -788,6 +803,7 @@ +@@ -788,6 +801,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); this.field_147147_p.func_151318_b().func_151330_a(agameprofile); @@ -89,7 +89,7 @@ } if (this.field_71315_w % 6000 == 0) { -@@ -815,6 +831,7 @@ +@@ -815,6 +829,7 @@ long i1 = Util.func_211178_c(); this.field_213215_ap.func_181747_a(i1 - i); this.field_71304_b.func_76319_b(); @@ -97,7 +97,7 @@ } protected void func_71190_q(BooleanSupplier p_71190_1_) { -@@ -822,7 +839,8 @@ +@@ -822,7 +837,8 @@ this.func_193030_aL().func_73660_a(); this.field_71304_b.func_219895_b("levels"); @@ -107,7 +107,7 @@ this.field_71304_b.func_194340_a(() -> { return serverworld + " " + serverworld.func_234923_W_().func_240901_a_(); }); -@@ -833,6 +851,7 @@ +@@ -833,6 +849,7 @@ } this.field_71304_b.func_76320_a("tick"); @@ -115,6 +115,27 @@ try { serverworld.func_72835_b(p_71190_1_); +@@ -841,9 +858,11 @@ + serverworld.func_72914_a(crashreport); + throw new ReportedException(crashreport); + } ++ net.minecraftforge.fml.hooks.BasicEventHooks.onPostWorldTick(serverworld); + + this.field_71304_b.func_76319_b(); + this.field_71304_b.func_76319_b(); ++ perWorldTickTimes.computeIfAbsent(serverworld.func_234923_W_(), k -> new long[100])[this.field_71315_w % 100] = Util.func_211178_c() - tickStart; + } + + this.field_71304_b.func_219895_b("connection"); +@@ -918,7 +937,7 @@ + } + + public String getServerModName() { +- return "vanilla"; ++ return net.minecraftforge.fml.BrandingControl.getServerBranding(); + } + + public CrashReport func_71230_b(CrashReport p_71230_1_) { @@ -931,6 +950,7 @@ p_71230_1_.func_85056_g().func_189529_a("Data Packs", () -> { StringBuilder stringbuilder = new StringBuilder(); diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index d46982521..a88b4766b 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,6 +1,17 @@ --- a/net/minecraft/server/integrated/IntegratedServer.java +++ b/net/minecraft/server/integrated/IntegratedServer.java -@@ -171,6 +171,7 @@ +@@ -60,8 +60,9 @@ + field_147148_h.info("Generating keypair"); + this.func_71253_a(CryptManager.func_75891_b()); + this.func_240800_l__(); ++ if (!net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(this)) return false; + this.func_71205_p(this.func_71214_G() + " - " + this.func_240793_aU_().func_76065_j()); +- return true; ++ return net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarting(this); + } + + public void func_71217_p(BooleanSupplier p_71217_1_) { +@@ -171,6 +172,7 @@ } public void func_71263_m(boolean p_71263_1_) { diff --git a/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch index 2a0972cb2..3dd467cd9 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch @@ -23,7 +23,7 @@ double d2 = this.field_73090_b.func_226281_cx_() - ((double)p_225416_1_.func_177952_p() + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (d3 > 36.0D) { -+ double dist = field_73090_b.func_110148_a(net.minecraft.entity.player.PlayerEntity.REACH_DISTANCE).func_111126_e() + 1; ++ double dist = field_73090_b.func_110148_a(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).func_111126_e() + 1; + net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock event = net.minecraftforge.common.ForgeHooks.onLeftClickBlock(field_73090_b, p_225416_1_, p_225416_3_); + if (event.isCanceled() || (!this.func_73083_d() && event.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY)) { // Restore block and te data + field_73090_b.field_71135_a.func_147359_a(new SPlayerDiggingPacket(p_225416_1_, field_73092_a.func_180495_p(p_225416_1_), p_225416_2_, false, "mod canceled")); diff --git a/patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch b/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch similarity index 59% rename from patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch rename to patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch index 2f06251ec..4aa9ea518 100644 --- a/patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch +++ b/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch @@ -1,31 +1,27 @@ --- a/net/minecraft/util/ScreenShotHelper.java +++ b/net/minecraft/util/ScreenShotHelper.java -@@ -51,12 +51,25 @@ +@@ -50,13 +50,21 @@ file2 = new File(file1, p_228051_1_); } -+ + net.minecraftforge.client.event.ScreenshotEvent event = net.minecraftforge.client.ForgeHooksClient.onScreenshot(nativeimage, file2); + if (event.isCanceled()) { + p_228051_5_.accept(event.getCancelMessage()); + return; + } -+ + final File target = event.getScreenshotFile(); + - SimpleResource.field_199031_a.execute(() -> { + Util.func_240992_g_().execute(() -> { try { - nativeimage.func_209271_a(file2); -- ITextComponent itextcomponent = (new StringTextComponent(file2.getName())).func_211708_a(TextFormatting.UNDERLINE).func_211710_a((p_228050_1_) -> { -- p_228050_1_.func_150241_a(new ClickEvent(ClickEvent.Action.OPEN_FILE, file2.getAbsolutePath())); + nativeimage.func_209271_a(target); -+ ITextComponent itextcomponent = (new StringTextComponent(target.getName())).func_211708_a(TextFormatting.UNDERLINE).func_211710_a((p_228050_1_) -> { -+ p_228050_1_.func_150241_a(new ClickEvent(ClickEvent.Action.OPEN_FILE, target.getAbsolutePath())); + ITextComponent itextcomponent = (new StringTextComponent(file2.getName())).func_240699_a_(TextFormatting.UNDERLINE).func_240700_a_((p_238335_1_) -> { +- return p_238335_1_.func_240715_a_(new ClickEvent(ClickEvent.Action.OPEN_FILE, file2.getAbsolutePath())); ++ return p_238335_1_.func_240715_a_(new ClickEvent(ClickEvent.Action.OPEN_FILE, target.getAbsolutePath())); }); -+ +- p_228051_5_.accept(new TranslationTextComponent("screenshot.success", itextcomponent)); + if (event.getResultMessage() != null) + p_228051_5_.accept(event.getResultMessage()); -+ else - p_228051_5_.accept(new TranslationTextComponent("screenshot.success", itextcomponent)); } catch (Exception exception) { field_148261_a.warn("Couldn't save screenshot", (Throwable)exception); + p_228051_5_.accept(new TranslationTextComponent("screenshot.failure", exception.getMessage())); diff --git a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch index 4435294e8..bbf86f50b 100644 --- a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch @@ -9,15 +9,24 @@ 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_) -> { -@@ -283,7 +283,7 @@ - if (this.func_225486_c(p_201854_2_) >= 0.15F) { - return false; - } else { -- if (p_201854_2_.func_177956_o() >= 0 && p_201854_2_.func_177956_o() < 256 && p_201854_1_.func_226658_a_(LightType.BLOCK, p_201854_2_) < 10) { -+ if (p_201854_2_.func_177956_o() >= 0 && p_201854_2_.func_177956_o() < 256/*TODO worldIn.getDimension().getHeight()*/ && p_201854_1_.func_226658_a_(LightType.BLOCK, p_201854_2_) < 10) { - BlockState blockstate = p_201854_1_.func_180495_p(p_201854_2_); - FluidState fluidstate = p_201854_1_.func_204610_c(p_201854_2_); - if (fluidstate.func_206886_c() == Fluids.field_204546_a && blockstate.func_177230_c() instanceof FlowingFluidBlock) { +@@ -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 @@ } 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) { @@ -45,22 +54,3 @@ public static class Builder { @Nullable private ConfiguredSurfaceBuilder field_205422_a; -@@ -787,6 +798,18 @@ - } - } - -+ public static class FlowerEntry extends WeightedRandom.Item { -+ private final BlockState state; -+ public FlowerEntry(BlockState state, int weight) { -+ super(weight); -+ this.state = state; -+ } -+ -+ public BlockState getState() { -+ return state; -+ } -+ } -+ - public static enum TempCategory { - OCEAN("ocean"), - COLD("cold"), diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch deleted file mode 100644 index f809d4dd0..000000000 --- a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- a/net/minecraft/world/chunk/storage/RegionFile.java -+++ b/net/minecraft/world/chunk/storage/RegionFile.java -@@ -33,6 +33,7 @@ - private final IntBuffer field_76716_d; - private final IntBuffer field_227127_h_; - private final RegionBitmap field_227128_i_ = new RegionBitmap(); -+ private final Path filePath; - - public RegionFile(File p_i231893_1_, File p_i231893_2_, boolean p_i231893_3_) throws IOException { - this(p_i231893_1_.toPath(), p_i231893_2_.toPath(), RegionFileVersion.field_227159_b_, p_i231893_3_); -@@ -40,6 +41,7 @@ - - public RegionFile(Path p_i231894_1_, Path p_i231894_2_, RegionFileVersion p_i231894_3_, boolean p_i231894_4_) throws IOException { - this.field_227125_e_ = p_i231894_3_; -+ this.filePath = p_i231894_2_; - if (!Files.isDirectory(p_i231894_2_)) { - throw new IllegalArgumentException("Expected directory, got " + p_i231894_2_.toAbsolutePath()); - } else { -@@ -67,6 +69,8 @@ - if (k != 0) { - int l = func_227142_b_(k); - int i1 = func_227131_a_(k); -+ if (i1 == 255) -+ i1 = forgeGetRealLength(j, l); - this.field_227128_i_.func_227120_a_(l, i1); - } - } -@@ -75,6 +79,66 @@ - } - } - -+ private int forgeGetRealLength(int index, int offset) throws IOException { -+ int chunkX = index & 31; -+ int chunkZ = (index >> 5) & 31; -+ -+ ByteBuffer header = ByteBuffer.allocate(5); -+ this.field_76719_c.read(header, offset * 4096); -+ ((Buffer)header).flip(); -+ -+ if (header.remaining() < 5) { -+ field_227122_a_.error("Chunk {},{} in {} header is truncated: expected 5 but read {}", chunkX, chunkZ, this.filePath.getFileName(), header.remaining()); -+ return 255; -+ } -+ -+ return (header.getInt() + 4) / 4096 + 1; -+ } -+ -+ /** -+ * In 1.14, Forge added support for large chunks by allowing it to overflow the 255 section limit. -+ * Deferring the section size to the 'length' header in front of the chunk data. -+ * In 1.15, Mojang solved this issue by adding an external '.mcc' file for large chunks. -+ * Here, we attempt to detect and extract these large chunks from Forge's format to Vanilla's -+ */ -+ public RegionFile extractLargeChunks(ChunkPos pos) throws IOException { -+ ChunkPos regionBase = new ChunkPos(pos.func_222241_h() * 32, pos.func_222242_i() * 32); -+ for (int index = 0; index < 1024; index++) { -+ int offset = this.field_76716_d.get(index); -+ if (func_227131_a_(offset) != 255) //If it's not 255, then it's not possible to be a oversized chunk. Move on. -+ continue; -+ offset = func_227142_b_(offset); -+ -+ ChunkPos chunk = new ChunkPos(regionBase.field_77276_a + (index & 31), regionBase.field_77275_b + ((index >> 5) & 31)); -+ -+ ByteBuffer header = ByteBuffer.allocate(5); -+ this.field_76719_c.read(header, offset * 4096); -+ ((Buffer)header).flip(); -+ -+ if (header.remaining() < 5) { -+ field_227122_a_.error("Chunk {} in {} header is truncated: expected 5 but read {}", chunk, this.filePath.getFileName(), header.remaining()); -+ continue; -+ } -+ -+ int length = header.getInt(); -+ byte version = header.get(); -+ int sectors = (length + 4) / 4096 + 1; -+ if (sectors <= 255 || func_227130_a_(version)) -+ continue; //Not over sized, or already external -+ -+ ByteBuffer data = ByteBuffer.allocate(length + 4); -+ this.field_76719_c.read(data, offset * 4096); -+ ((Buffer)data).flip(); -+ -+ if (data.remaining() < length + 4) { -+ field_227122_a_.error("Chunk {} in {} is truncated: expected {} but read {}", chunk, this.filePath.getFileName(), length + 4, data.remaining()); -+ continue; -+ } -+ func_227135_a_(chunk, data); //Save the chunk data, it'll be spit out to an external file. -+ } -+ return this; -+ } -+ - private Path func_227145_e_(ChunkPos p_227145_1_) { - String s = "c." + p_227145_1_.field_77276_a + "." + p_227145_1_.field_77275_b + ".mcc"; - return this.field_227124_d_.resolve(s); -@@ -234,6 +298,7 @@ - int j = this.field_76716_d.get(i); - int k = func_227142_b_(j); - int l = func_227131_a_(j); -+ if (l == 255) l = forgeGetRealLength(i, k); //Forge: Old Forge fix, get real length, so we can free if needed - int i1 = p_227135_2_.remaining(); - int j1 = func_227144_c_(i1); - int k1; diff --git a/patches/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch b/patches/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch index a67278fa6..1be61e104 100644 --- a/patches/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch @@ -1,12 +1,8 @@ --- a/net/minecraft/world/gen/IWorldGenerationBaseReader.java +++ b/net/minecraft/world/gen/IWorldGenerationBaseReader.java -@@ -8,4 +8,9 @@ +@@ -8,4 +8,5 @@ boolean func_217375_a(BlockPos p_217375_1_, Predicate p_217375_2_); BlockPos func_205770_a(Heightmap.Type p_205770_1_, BlockPos p_205770_2_); + -+ //TODO, Dimensions.. -+// default int getMaxHeight() { -+// return this instanceof net.minecraft.world.IWorld ? ((net.minecraft.world.IWorld)this).getWorld().getDimension().getHeight() : 256; -+// } } 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 5995867f9..29625c97b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch @@ -9,12 +9,12 @@ 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_)); } } -@@ -38,7 +38,7 @@ - - protected boolean func_227209_a_(IWorld p_227209_1_, BlockPos p_227209_2_, int p_227209_3_, BlockPos.Mutable p_227209_4_, BigMushroomFeatureConfig p_227209_5_) { - int i = p_227209_2_.func_177956_o(); -- if (i >= 1 && i + p_227209_3_ + 1 < 256) { -+ if (i >= 1 && i + p_227209_3_ + 1 < 256/*TODO p_227209_1_.getMaxHeight()*/) { - Block block = p_227209_1_.func_180495_p(p_227209_2_.func_177977_b()).func_177230_c(); - if (!func_227250_b_(block)) { - return false; +@@ -49,7 +49,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)); +- if (!blockstate.func_196958_f() && !blockstate.func_235714_a_(BlockTags.field_206952_E)) { ++ if (!blockstate.isAir(p_227209_1_, p_227209_4_.func_239621_a_(p_227209_2_, l, j, i1)) && !blockstate.func_235714_a_(BlockTags.field_206952_E)) { + return false; + } + } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch index e5165d5e4..6fd57ccf2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch @@ -1,26 +1,10 @@ --- a/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java +++ b/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java -@@ -42,6 +42,7 @@ - public final int field_236680_i_; - public final boolean field_236681_j_; - public final Heightmap.Type field_236682_l_; -+ protected net.minecraftforge.common.IPlantable sapling = (net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196674_t; - - protected BaseTreeFeatureConfig(BlockStateProvider p_i232020_1_, BlockStateProvider p_i232020_2_, FoliagePlacer p_i232020_3_, AbstractTrunkPlacer p_i232020_4_, AbstractFeatureSizeType p_i232020_5_, List p_i232020_6_, int p_i232020_7_, boolean p_i232020_8_, Heightmap.Type p_i232020_9_) { - this.field_227368_m_ = p_i232020_1_; -@@ -55,6 +56,15 @@ - this.field_236682_l_ = p_i232020_9_; - } - -+ protected BaseTreeFeatureConfig setSapling(net.minecraftforge.common.IPlantable value) { -+ this.sapling = value; -+ return this; -+ } -+ -+ public net.minecraftforge.common.IPlantable getSapling() { -+ return this.sapling; -+ } -+ - public void func_227373_a_() { - this.field_227372_q_ = true; - } +@@ -32,6 +32,7 @@ + return p_236684_0_.field_236682_l_; + })).apply(p_236683_0_, BaseTreeFeatureConfig::new); + }); ++ //TODO: Review this, see if we can hook in the sapling into the Codec + public final BlockStateProvider field_227368_m_; + public final BlockStateProvider field_227369_n_; + public final List field_227370_o_; diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch similarity index 75% rename from patches_old/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch rename to patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch index 330750594..b104b73e8 100644 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/DungeonsFeature.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/world/gen/feature/DungeonsFeature.java +++ b/net/minecraft/world/gen/feature/DungeonsFeature.java -@@ -123,6 +123,6 @@ +@@ -124,6 +124,6 @@ } private EntityType func_201043_a(Random p_201043_1_) { -- return field_175916_b[p_201043_1_.nextInt(field_175916_b.length)]; +- return Util.func_240989_a_(field_175916_b, p_201043_1_); + return net.minecraftforge.common.DungeonHooks.getRandomDungeonMob(p_201043_1_); } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch new file mode 100644 index 000000000..769b95f78 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java ++++ b/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java +@@ -27,7 +27,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)) { + 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 8120c481c..781e3c5d9 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch @@ -1,5 +1,22 @@ --- 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)); + 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 (k != 0 && l > 1) { + blockstate = p_230362_1_.func_180495_p(p_230362_5_.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()); + } + } @@ -77,7 +77,7 @@ while(blockpos.func_177956_o() > 50) { BlockState blockstate1 = p_230362_1_.func_180495_p(blockpos); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch new file mode 100644 index 000000000..32bfb95d9 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/gen/feature/SpringFeature.java ++++ b/net/minecraft/world/gen/feature/SpringFeature.java +@@ -20,7 +20,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())) { + return false; + } else { + int i = 0; 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 new file mode 100644 index 000000000..7c8b8aba3 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java ++++ b/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java +@@ -113,7 +113,7 @@ + if (!template.func_237146_a_(p_230378_2_, p_230378_5_, p_230378_6_, placementsettings, p_230378_9_, 18)) { + return false; + } else { +- for(Template.BlockInfo template$blockinfo : Template.func_237145_a_(p_230378_2_, p_230378_5_, p_230378_6_, placementsettings, this.func_214857_a(p_230378_1_, p_230378_5_, p_230378_7_, false))) { ++ for(Template.BlockInfo template$blockinfo : Template.processBlockInfos(p_230378_2_, p_230378_5_, p_230378_6_, placementsettings, this.func_214857_a(p_230378_1_, p_230378_5_, p_230378_7_, false), template)) { + this.func_214846_a(p_230378_2_, template$blockinfo, p_230378_5_, p_230378_7_, p_230378_9_, p_230378_8_); + } + diff --git a/patches/minecraft/net/minecraft/world/gen/feature/template/StructureProcessor.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/template/StructureProcessor.java.patch new file mode 100644 index 000000000..548130a67 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/template/StructureProcessor.java.patch @@ -0,0 +1,41 @@ +--- a/net/minecraft/world/gen/feature/template/StructureProcessor.java ++++ b/net/minecraft/world/gen/feature/template/StructureProcessor.java +@@ -6,7 +6,37 @@ + + public abstract class StructureProcessor { + @Nullable +- public abstract Template.BlockInfo func_230386_a_(IWorldReader p_230386_1_, BlockPos p_230386_2_, BlockPos p_230386_3_, Template.BlockInfo p_230386_4_, Template.BlockInfo p_230386_5_, PlacementSettings p_230386_6_); ++ @Deprecated //Forge: Use process below, with the Template context ++ public Template.BlockInfo func_230386_a_(IWorldReader p_230386_1_, BlockPos p_230386_2_, BlockPos p_230386_3_, Template.BlockInfo p_230386_4_, Template.BlockInfo p_230386_5_, PlacementSettings p_230386_6_) { ++ return p_230386_5_; ++ } + + protected abstract IStructureProcessorType func_215192_a(); ++ ++ @Nullable ++ public Template.BlockInfo process(IWorldReader p_230386_1_, BlockPos p_230386_2_, BlockPos p_230386_3_, Template.BlockInfo p_230386_4_, Template.BlockInfo p_230386_5_, PlacementSettings p_230386_6_, @Nullable Template template) { ++ return func_230386_a_(p_230386_1_, p_230386_2_, p_230386_3_, p_230386_4_, p_230386_5_, p_230386_6_); ++ } ++ ++ /** ++ * FORGE: Add entity processing. ++ *

++ * Use this method to process entities from a structure in much the same way as ++ * blocks, parameters are analogous. ++ * ++ * @param world ++ * @param seedPos ++ * @param rawEntityInfo ++ * @param entityInfo ++ * @param placementSettings ++ * @param template ++ * ++ * @see #process(IWorldReader, BlockPos, ++ * net.minecraft.world.gen.feature.template.Template.BlockInfo, ++ * net.minecraft.world.gen.feature.template.Template.BlockInfo, ++ * PlacementSettings) ++ */ ++ public Template.EntityInfo processEntity(IWorldReader world, BlockPos seedPos, Template.EntityInfo rawEntityInfo, Template.EntityInfo entityInfo, PlacementSettings placementSettings, Template template) { ++ return entityInfo; ++ } + } 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 1f2c1e558..becf516cf 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,14 +1,103 @@ --- a/net/minecraft/world/gen/feature/template/Template.java +++ b/net/minecraft/world/gen/feature/template/Template.java -@@ -422,6 +422,11 @@ - } +@@ -189,6 +189,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()); } -+ // FORGE: Add overload accepting Vec3d -+ public static Vector3d transformedVec3d(PlacementSettings placementIn, Vector3d pos) { -+ return func_207667_a(pos, placementIn.func_186212_b(), placementIn.func_186215_c(), placementIn.func_207664_d()); -+ } ++ public static Vector3d transformedVec3d(PlacementSettings placementIn, Vector3d pos) { ++ return func_207667_a(pos, placementIn.func_186212_b(), placementIn.func_186215_c(), placementIn.func_207664_d()); ++ } + - public static BlockPos func_207669_a(BlockPos p_207669_0_, Mirror p_207669_1_, Rotation p_207669_2_, BlockPos p_207669_3_) { - int i = p_207669_0_.func_177958_n(); - int j = p_207669_0_.func_177956_o(); + public void func_237144_a_(IWorld 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 @@ + int i1 = Integer.MIN_VALUE; + int j1 = Integer.MIN_VALUE; + +- for(Template.BlockInfo template$blockinfo : func_237145_a_(p_237146_1_, p_237146_2_, p_237146_3_, p_237146_4_, list)) { ++ for(Template.BlockInfo template$blockinfo : processBlockInfos(p_237146_1_, p_237146_2_, p_237146_3_, p_237146_4_, list, this)) { + 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 @@ + } + + if (!p_237146_4_.func_186221_e()) { +- this.func_237143_a_(p_237146_1_, p_237146_2_, p_237146_4_.func_186212_b(), p_237146_4_.func_186215_c(), p_237146_4_.func_207664_d(), mutableboundingbox, p_237146_4_.func_237134_m_()); ++ this.addEntitiesToWorld(p_237146_1_, p_237146_2_, p_237146_4_); + } + + return true; +@@ -358,14 +362,19 @@ + }); + } + ++ @Deprecated //Use Forge version + public static List func_237145_a_(IWorld p_237145_0_, BlockPos p_237145_1_, BlockPos p_237145_2_, PlacementSettings p_237145_3_, List p_237145_4_) { ++ return processBlockInfos(p_237145_0_, p_237145_1_, p_237145_2_, p_237145_3_, p_237145_4_, null); ++ } ++ ++ public static List processBlockInfos(IWorld p_237145_0_, BlockPos p_237145_1_, BlockPos p_237145_2_, PlacementSettings p_237145_3_, List p_237145_4_, @Nullable Template template) { + List list = Lists.newArrayList(); + + for(Template.BlockInfo template$blockinfo : p_237145_4_) { + BlockPos blockpos = func_186266_a(p_237145_3_, template$blockinfo.field_186242_a).func_177971_a(p_237145_1_); + Template.BlockInfo template$blockinfo1 = new Template.BlockInfo(blockpos, template$blockinfo.field_186243_b, template$blockinfo.field_186244_c != null ? template$blockinfo.field_186244_c.func_74737_b() : null); + +- for(Iterator iterator = p_237145_3_.func_215221_j().iterator(); template$blockinfo1 != null && iterator.hasNext(); template$blockinfo1 = iterator.next().func_230386_a_(p_237145_0_, p_237145_1_, p_237145_2_, template$blockinfo, template$blockinfo1, p_237145_3_)) { ++ for(Iterator iterator = p_237145_3_.func_215221_j().iterator(); template$blockinfo1 != null && iterator.hasNext(); template$blockinfo1 = iterator.next().process(p_237145_0_, p_237145_1_, p_237145_2_, template$blockinfo, template$blockinfo1, p_237145_3_, template)) { + } + + if (template$blockinfo1 != null) { +@@ -376,13 +385,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_) { +- 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)) { ++ public static List processEntityInfos(@Nullable Template template, IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List p_215387_3_) { ++ List list = Lists.newArrayList(); ++ for(Template.EntityInfo entityInfo : p_215387_3_) { ++ Vector3d pos = transformedVec3d(p_215387_2_, entityInfo.field_186247_a).func_178787_e(Vector3d.func_237491_b_(p_215387_1_)); ++ BlockPos blockpos = func_186266_a(p_215387_2_, entityInfo.field_186248_b).func_177971_a(p_215387_1_); ++ Template.EntityInfo info = new Template.EntityInfo(pos, blockpos, entityInfo.field_186249_c); ++ for (StructureProcessor proc : p_215387_2_.func_215221_j()) { ++ info = proc.processEntity(p_215387_0_, p_215387_1_, entityInfo, info, p_215387_2_, template); ++ if (info == null) ++ break; ++ } ++ if (info != null) ++ list.add(info); ++ } ++ return list; ++ } ++ ++ private void addEntitiesToWorld(IWorld 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 ++ if (placementIn.func_186213_g() == null || placementIn.func_186213_g().func_175898_b(blockpos)) { + CompoundNBT compoundnbt = template$entityinfo.field_186249_c.func_74737_b(); +- Vector3d vector3d = func_207667_a(template$entityinfo.field_186247_a, p_237143_3_, p_237143_4_, p_237143_5_); +- Vector3d vector3d1 = vector3d.func_72441_c((double)p_237143_2_.func_177958_n(), (double)p_237143_2_.func_177956_o(), (double)p_237143_2_.func_177952_p()); ++ Vector3d vector3d1 = template$entityinfo.field_186247_a; // FORGE: Position will have already been transformed by processEntityInfos + 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 @@ + 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); + } + diff --git a/patches/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch b/patches/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch index d3d59883b..e379ded88 100644 --- a/patches/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch +++ b/patches/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch @@ -1,12 +1,10 @@ --- a/net/minecraft/world/lighting/BlockLightEngine.java +++ b/net/minecraft/world/lighting/BlockLightEngine.java -@@ -117,4 +117,11 @@ +@@ -117,4 +117,9 @@ this.field_215627_c.func_215532_c(); this.func_215469_a(Long.MAX_VALUE, p_215623_1_.func_218275_a(), 15 - p_215623_2_, true); } + -+ // FORGE START -+ + @Override + public int queuedUpdateSize() { + return field_215627_c.queuedUpdateSize(); diff --git a/patches/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch b/patches/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch index d368dd39b..103ea02e6 100644 --- a/patches/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch +++ b/patches/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch @@ -1,12 +1,10 @@ --- a/net/minecraft/world/lighting/LevelBasedGraph.java +++ b/net/minecraft/world/lighting/LevelBasedGraph.java -@@ -228,4 +228,10 @@ +@@ -228,4 +228,8 @@ protected abstract void func_215476_a(long p_215476_1_, int p_215476_3_); protected abstract int func_215480_b(long p_215480_1_, long p_215480_3_, int p_215480_5_); + -+ // FORGE START -+ + protected int queuedUpdateSize() { + return field_215488_c.size(); + } diff --git a/patches/minecraft/net/minecraft/world/lighting/LightEngine.java.patch b/patches/minecraft/net/minecraft/world/lighting/LightEngine.java.patch index 48a8ddd6b..a399a343b 100644 --- a/patches/minecraft/net/minecraft/world/lighting/LightEngine.java.patch +++ b/patches/minecraft/net/minecraft/world/lighting/LightEngine.java.patch @@ -1,11 +1,9 @@ --- a/net/minecraft/world/lighting/LightEngine.java +++ b/net/minecraft/world/lighting/LightEngine.java -@@ -215,4 +215,8 @@ +@@ -215,4 +215,6 @@ long i = SectionPos.func_218169_f(SectionPos.func_218166_b(p_223129_1_.field_77276_a, 0, p_223129_1_.field_77275_b)); this.field_215627_c.func_223113_c(i, p_223129_2_); } + -+ // FORGE START -+ + public abstract int queuedUpdateSize(); } diff --git a/patches/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch b/patches/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch index 1d8f9d7ff..f147d164c 100644 --- a/patches/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch +++ b/patches/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch @@ -1,12 +1,10 @@ --- a/net/minecraft/world/lighting/SkyLightEngine.java +++ b/net/minecraft/world/lighting/SkyLightEngine.java -@@ -228,4 +228,11 @@ +@@ -228,4 +228,9 @@ public String func_215614_b(long p_215614_1_) { return super.func_215614_b(p_215614_1_) + (this.field_215627_c.func_215549_m(p_215614_1_) ? "*" : ""); } + -+ // FORGE START -+ + @Override + public int queuedUpdateSize() { + return 0; diff --git a/patches_old/minecraft/net/minecraft/advancements/AdvancementList.java.patch b/patches_old/minecraft/net/minecraft/advancements/AdvancementList.java.patch deleted file mode 100644 index 28196dd64..000000000 --- a/patches_old/minecraft/net/minecraft/advancements/AdvancementList.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/advancements/AdvancementList.java -+++ b/net/minecraft/advancements/AdvancementList.java -@@ -96,6 +96,7 @@ - } - } - -+ net.minecraftforge.common.AdvancementLoadFix.buildSortedTrees(this.field_192093_c); - field_192091_a.info("Loaded {} advancements", (int)this.field_192092_b.size()); - } - diff --git a/patches_old/minecraft/net/minecraft/advancements/AdvancementManager.java.patch b/patches_old/minecraft/net/minecraft/advancements/AdvancementManager.java.patch deleted file mode 100644 index ff31f937d..000000000 --- a/patches_old/minecraft/net/minecraft/advancements/AdvancementManager.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/advancements/AdvancementManager.java -+++ b/net/minecraft/advancements/AdvancementManager.java -@@ -36,7 +36,11 @@ - Map map = Maps.newHashMap(); - p_212853_1_.forEach((p_223387_1_, p_223387_2_) -> { - try { -- Advancement.Builder advancement$builder = field_192783_b.fromJson(p_223387_2_, Advancement.Builder.class); -+ Advancement.Builder advancement$builder = net.minecraftforge.common.crafting.ConditionalAdvancement.read(field_192783_b, p_223387_1_, p_223387_2_); -+ if (advancement$builder == null) { -+ field_192782_a.info("Skipping loading advancement {} as it's conditions were not met", p_223387_1_); -+ return; -+ } - map.put(p_223387_1_, advancement$builder); - } catch (IllegalArgumentException | JsonParseException jsonparseexception) { - field_192782_a.error("Parsing error loading custom advancement {}: {}", p_223387_1_, jsonparseexception.getMessage()); diff --git a/patches_old/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch b/patches_old/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch deleted file mode 100644 index 0f1ac1daf..000000000 --- a/patches_old/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/net/minecraft/advancements/PlayerAdvancements.java -+++ b/net/minecraft/advancements/PlayerAdvancements.java -@@ -154,6 +154,7 @@ - } - - this.func_192748_e(); -+ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.field_192759_g, this.field_192760_h, this.field_192758_f, this.field_192761_i, this::func_192738_c); else - this.func_192752_d(); - this.func_192751_c(); - } -@@ -187,6 +188,8 @@ - } - - public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) { -+ // Forge: don't grant advancements for fake players -+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false; - boolean flag = false; - AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_); - boolean flag1 = advancementprogress.func_192105_a(); -@@ -199,6 +202,7 @@ - if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) { - this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j())); - } -+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_); - } - } - diff --git a/patches_old/minecraft/net/minecraft/advancements/criterion/ItemPredicate.java.patch b/patches_old/minecraft/net/minecraft/advancements/criterion/ItemPredicate.java.patch deleted file mode 100644 index f9b2a3da6..000000000 --- a/patches_old/minecraft/net/minecraft/advancements/criterion/ItemPredicate.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/net/minecraft/advancements/criterion/ItemPredicate.java -+++ b/net/minecraft/advancements/criterion/ItemPredicate.java -@@ -26,6 +26,8 @@ - import net.minecraft.util.registry.Registry; - - public class ItemPredicate { -+ private static final Map> custom_predicates = new java.util.HashMap<>(); -+ private static final Map> unmod_predicates = java.util.Collections.unmodifiableMap(custom_predicates); - public static final ItemPredicate field_192495_a = new ItemPredicate(); - @Nullable - private final Tag field_200018_b; -@@ -105,6 +107,11 @@ - public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) { - if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) { - JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item"); -+ if (jsonobject.has("type")) { -+ final ResourceLocation rl = new ResourceLocation(JSONUtils.func_151200_h(jsonobject, "type")); -+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject); -+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl); -+ } - MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count")); - MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability")); - if (jsonobject.has("data")) { -@@ -204,6 +211,14 @@ - } - } - -+ public static void register(ResourceLocation name, java.util.function.Function deserializer) { -+ custom_predicates.put(name, deserializer); -+ } -+ -+ public static Map> getPredicates() { -+ return unmod_predicates; -+ } -+ - public static class Builder { - private final List field_200312_a = Lists.newArrayList(); - private final List field_226657_b_ = Lists.newArrayList(); diff --git a/patches_old/minecraft/net/minecraft/block/BedBlock.java.patch b/patches_old/minecraft/net/minecraft/block/BedBlock.java.patch deleted file mode 100644 index ef1ae354f..000000000 --- a/patches_old/minecraft/net/minecraft/block/BedBlock.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/block/BedBlock.java -+++ b/net/minecraft/block/BedBlock.java -@@ -88,7 +88,9 @@ - } - } - -- if (p_225533_2_.field_73011_w.func_76567_e() && p_225533_2_.func_226691_t_(p_225533_3_) != Biomes.field_76778_j) { -+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_225533_2_.field_73011_w.canSleepAt(p_225533_4_, p_225533_3_); -+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) { -+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return ActionResultType.SUCCESS; - if (p_225533_1_.func_177229_b(field_176471_b)) { - if (!this.func_226861_a_(p_225533_2_, p_225533_3_)) { - p_225533_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true); diff --git a/patches_old/minecraft/net/minecraft/block/BlockState.java.patch b/patches_old/minecraft/net/minecraft/block/BlockState.java.patch deleted file mode 100644 index a0d2dfd38..000000000 --- a/patches_old/minecraft/net/minecraft/block/BlockState.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/net/minecraft/block/BlockState.java -+++ b/net/minecraft/block/BlockState.java -@@ -51,7 +51,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public class BlockState extends StateHolder implements IStateHolder { -+public class BlockState extends StateHolder implements IStateHolder, net.minecraftforge.common.extensions.IForgeBlockState { - @Nullable - private BlockState.Cache field_215707_c; - private final int field_215708_d; -@@ -106,10 +106,14 @@ - return this.field_215708_d; - } - -+ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */ -+ @Deprecated - public boolean func_196958_f() { - return this.func_177230_c().func_196261_e(this); - } - -+ /** @deprecated use {@link BlockState#rotate(IWorld, BlockPos, Rotation) */ -+ @Deprecated - public MaterialColor func_185909_g(IBlockReader p_185909_1_, BlockPos p_185909_2_) { - return this.func_177230_c().func_180659_g(this, p_185909_1_, p_185909_2_); - } diff --git a/patches_old/minecraft/net/minecraft/block/Blocks.java.patch b/patches_old/minecraft/net/minecraft/block/Blocks.java.patch deleted file mode 100644 index 0b40aa831..000000000 --- a/patches_old/minecraft/net/minecraft/block/Blocks.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/net/minecraft/block/Blocks.java -+++ b/net/minecraft/block/Blocks.java -@@ -14,6 +14,7 @@ - import net.minecraft.tileentity.TileEntityType; - import net.minecraft.util.registry.Registry; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public class Blocks { - public static final Block field_150350_a = func_222382_a("air", new AirBlock(Block.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e())); - public static final Block field_150348_b = func_222382_a("stone", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_200948_a(1.5F, 6.0F))); -@@ -105,7 +106,7 @@ - public static final Block field_196601_az = func_222382_a("green_bed", new BedBlock(DyeColor.GREEN, Block.Properties.func_200945_a(Material.field_151580_n).func_200947_a(SoundType.field_185848_a).func_200943_b(0.2F).func_226896_b_())); - public static final Block field_196550_aA = func_222382_a("red_bed", new BedBlock(DyeColor.RED, Block.Properties.func_200945_a(Material.field_151580_n).func_200947_a(SoundType.field_185848_a).func_200943_b(0.2F).func_226896_b_())); - public static final Block field_196551_aB = func_222382_a("black_bed", new BedBlock(DyeColor.BLACK, Block.Properties.func_200945_a(Material.field_151580_n).func_200947_a(SoundType.field_185848_a).func_200943_b(0.2F).func_226896_b_())); -- public static final Block field_196552_aC = func_222382_a("powered_rail", new PoweredRailBlock(Block.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_196552_aC = func_222382_a("powered_rail", new PoweredRailBlock(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true)); - public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(Block.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", new PistonBlock(true, Block.Properties.func_200945_a(Material.field_76233_E).func_200943_b(0.5F))); - public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(Block.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_200943_b(4.0F))); -@@ -701,16 +702,4 @@ - private static Block func_222382_a(String p_222382_0_, Block p_222382_1_) { - return Registry.func_218325_a(Registry.field_212618_g, p_222382_0_, p_222382_1_); - } -- -- static { -- for(Block block : Registry.field_212618_g) { -- for(BlockState blockstate : block.func_176194_O().func_177619_a()) { -- blockstate.func_215692_c(); -- Block.field_176229_d.func_195867_b(blockstate); -- } -- -- block.func_220068_i(); -- } -- -- } - } diff --git a/patches_old/minecraft/net/minecraft/block/BushBlock.java.patch b/patches_old/minecraft/net/minecraft/block/BushBlock.java.patch deleted file mode 100644 index 81b00dcdd..000000000 --- a/patches_old/minecraft/net/minecraft/block/BushBlock.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/block/BushBlock.java -+++ b/net/minecraft/block/BushBlock.java -@@ -7,7 +7,7 @@ - import net.minecraft.world.IWorld; - import net.minecraft.world.IWorldReader; - --public class BushBlock extends Block { -+public class BushBlock extends Block implements net.minecraftforge.common.IPlantable { - protected BushBlock(Block.Properties p_i48437_1_) { - super(p_i48437_1_); - } -@@ -23,6 +23,8 @@ - - public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { - BlockPos blockpos = p_196260_3_.func_177977_b(); -+ if (p_196260_1_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. -+ return p_196260_2_.func_180495_p(blockpos).canSustainPlant(p_196260_2_, blockpos, Direction.UP, this); - return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos); - } - -@@ -33,4 +35,11 @@ - public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) { - return p_196266_4_ == PathType.AIR && !this.field_196274_w ? true : super.func_196266_a(p_196266_1_, p_196266_2_, p_196266_3_, p_196266_4_); - } -+ -+ @Override -+ public BlockState getPlant(IBlockReader world, BlockPos pos) { -+ BlockState state = world.func_180495_p(pos); -+ if (state.func_177230_c() != this) return func_176223_P(); -+ return state; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/block/CactusBlock.java.patch b/patches_old/minecraft/net/minecraft/block/CactusBlock.java.patch deleted file mode 100644 index b38c7edc3..000000000 --- a/patches_old/minecraft/net/minecraft/block/CactusBlock.java.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/net/minecraft/block/CactusBlock.java -+++ b/net/minecraft/block/CactusBlock.java -@@ -19,7 +19,7 @@ - import net.minecraft.world.World; - import net.minecraft.world.server.ServerWorld; - --public class CactusBlock extends Block { -+public class CactusBlock extends Block implements net.minecraftforge.common.IPlantable { - public static final IntegerProperty field_176587_a = BlockStateProperties.field_208171_X; - protected static final VoxelShape field_196400_b = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D); - protected static final VoxelShape field_196401_c = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); -@@ -30,6 +30,7 @@ - } - - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { -+ if (!p_225534_2_.isAreaLoaded(p_225534_3_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update - if (!p_225534_1_.func_196955_c(p_225534_2_, p_225534_3_)) { - p_225534_2_.func_175655_b(p_225534_3_, true); - } else { -@@ -42,6 +43,7 @@ - - if (i < 3) { - int j = p_225534_1_.func_177229_b(field_176587_a); -+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, blockpos, p_225534_1_, true)) { - if (j == 15) { - p_225534_2_.func_175656_a(blockpos, this.func_176223_P()); - BlockState blockstate = p_225534_1_.func_206870_a(field_176587_a, Integer.valueOf(0)); -@@ -50,7 +52,8 @@ - } else { - p_225534_2_.func_180501_a(p_225534_3_, p_225534_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4); - } -- -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_); -+ } - } - } - } -@@ -81,8 +84,8 @@ - } - } - -- Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c(); -- return (block == Blocks.field_150434_aF || block == Blocks.field_150354_m || block == Blocks.field_196611_F) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d(); -+ BlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); -+ return soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), Direction.UP, this) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d(); - } - - public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) { -@@ -96,4 +99,14 @@ - public boolean func_196266_a(BlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) { - return false; - } -+ -+ @Override -+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) { -+ return net.minecraftforge.common.PlantType.Desert; -+ } -+ -+ @Override -+ public BlockState getPlant(IBlockReader world, BlockPos pos) { -+ return func_176223_P(); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/block/CampfireBlock.java.patch b/patches_old/minecraft/net/minecraft/block/CampfireBlock.java.patch deleted file mode 100644 index 41b532400..000000000 --- a/patches_old/minecraft/net/minecraft/block/CampfireBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/CampfireBlock.java -+++ b/net/minecraft/block/CampfireBlock.java -@@ -187,7 +187,7 @@ - boolean flag = p_220066_4_ instanceof AbstractFireballEntity || p_220066_4_ instanceof AbstractArrowEntity && p_220066_4_.func_70027_ad(); - if (flag) { - Entity entity = this.func_226913_a_(p_220066_4_); -- boolean flag1 = entity == null || entity instanceof PlayerEntity || p_220066_1_.func_82736_K().func_223586_b(GameRules.field_223599_b); -+ boolean flag1 = entity == null || entity instanceof PlayerEntity || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_220066_1_, entity); - if (flag1 && !p_220066_2_.func_177229_b(field_220101_b) && !p_220066_2_.func_177229_b(field_220103_d)) { - BlockPos blockpos = p_220066_3_.func_216350_a(); - p_220066_1_.func_180501_a(blockpos, p_220066_2_.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true)), 11); diff --git a/patches_old/minecraft/net/minecraft/block/ChorusFlowerBlock.java.patch b/patches_old/minecraft/net/minecraft/block/ChorusFlowerBlock.java.patch deleted file mode 100644 index c63573642..000000000 --- a/patches_old/minecraft/net/minecraft/block/ChorusFlowerBlock.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/net/minecraft/block/ChorusFlowerBlock.java -+++ b/net/minecraft/block/ChorusFlowerBlock.java -@@ -29,9 +29,9 @@ - p_225534_2_.func_175655_b(p_225534_3_, true); - } else { - BlockPos blockpos = p_225534_3_.func_177984_a(); -- if (p_225534_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) { -+ if (p_225534_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < p_225534_2_.func_201675_m().getHeight()) { - int i = p_225534_1_.func_177229_b(field_185607_a); -- if (i < 5) { -+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, blockpos, p_225534_1_, true)) { - boolean flag = false; - boolean flag1 = false; - BlockState blockstate = p_225534_2_.func_180495_p(p_225534_3_.func_177977_b()); -@@ -56,7 +56,7 @@ - if (j < 2 || j <= p_225534_4_.nextInt(flag1 ? 5 : 4)) { - flag = true; - } -- } else if (blockstate.func_196958_f()) { -+ } else if (blockstate.isAir(p_225534_2_, p_225534_3_.func_177977_b())) { - flag = true; - } - -@@ -88,7 +88,7 @@ - } else { - this.func_185605_c(p_225534_2_, p_225534_3_); - } -- -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_); - } - } - } -@@ -126,7 +126,7 @@ - BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); - Block block = blockstate.func_177230_c(); - if (block != this.field_196405_b && block != Blocks.field_150377_bs) { -- if (!blockstate.func_196958_f()) { -+ if (!blockstate.isAir(p_196260_2_, p_196260_3_.func_177977_b())) { - return false; - } else { - boolean flag = false; -@@ -139,7 +139,7 @@ - } - - flag = true; -- } else if (!blockstate1.func_196958_f()) { -+ } else if (!blockstate1.isAir(p_196260_2_, p_196260_3_.func_177972_a(direction))) { - return false; - } - } diff --git a/patches_old/minecraft/net/minecraft/block/CocoaBlock.java.patch b/patches_old/minecraft/net/minecraft/block/CocoaBlock.java.patch deleted file mode 100644 index 03ce2e6d2..000000000 --- a/patches_old/minecraft/net/minecraft/block/CocoaBlock.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/net/minecraft/block/CocoaBlock.java -+++ b/net/minecraft/block/CocoaBlock.java -@@ -30,10 +30,11 @@ - } - - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { -- if (p_225534_2_.field_73012_v.nextInt(5) == 0) { -+ if (true) { - int i = p_225534_1_.func_177229_b(field_176501_a); -- if (i < 2) { -+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_2_.field_73012_v.nextInt(5) == 0)) { - p_225534_2_.func_180501_a(p_225534_3_, p_225534_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_); - } - } - diff --git a/patches_old/minecraft/net/minecraft/block/ComparatorBlock.java.patch b/patches_old/minecraft/net/minecraft/block/ComparatorBlock.java.patch deleted file mode 100644 index d22d6ae69..000000000 --- a/patches_old/minecraft/net/minecraft/block/ComparatorBlock.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/minecraft/block/ComparatorBlock.java -+++ b/net/minecraft/block/ComparatorBlock.java -@@ -71,7 +71,7 @@ - blockstate = p_176397_1_.func_180495_p(blockpos); - if (blockstate.func_185912_n()) { - i = blockstate.func_185888_a(p_176397_1_, blockpos); -- } else if (blockstate.func_196958_f()) { -+ } else if (blockstate.isAir(p_176397_1_, blockpos)) { - ItemFrameEntity itemframeentity = this.func_176461_a(p_176397_1_, direction, blockpos); - if (itemframeentity != null) { - i = itemframeentity.func_174866_q(); -@@ -157,4 +157,16 @@ - protected void func_206840_a(StateContainer.Builder p_206840_1_) { - p_206840_1_.func_206894_a(field_185512_D, field_176463_b, field_196348_c); - } -+ -+ @Override -+ public boolean getWeakChanges(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos) { -+ return true; -+ } -+ -+ @Override -+ public void onNeighborChange(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, BlockPos neighbor) { -+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World && !((World)world).func_201670_d()) { -+ state.func_215697_a((World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor, false); -+ } -+ } - } diff --git a/patches_old/minecraft/net/minecraft/block/CropsBlock.java.patch b/patches_old/minecraft/net/minecraft/block/CropsBlock.java.patch deleted file mode 100644 index 262ecdb0b..000000000 --- a/patches_old/minecraft/net/minecraft/block/CropsBlock.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/net/minecraft/block/CropsBlock.java -+++ b/net/minecraft/block/CropsBlock.java -@@ -58,12 +58,14 @@ - - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { - super.func_225534_a_(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_); -+ if (!p_225534_2_.isAreaLoaded(p_225534_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light - if (p_225534_2_.func_226659_b_(p_225534_3_, 0) >= 9) { - int i = this.func_185527_x(p_225534_1_); - if (i < this.func_185526_g()) { - float f = func_180672_a(this, p_225534_2_, p_225534_3_); -- if (p_225534_4_.nextInt((int)(25.0F / f) + 1) == 0) { -+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_4_.nextInt((int)(25.0F / f) + 1) == 0)) { - p_225534_2_.func_180501_a(p_225534_3_, this.func_185528_e(i + 1), 2); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_); - } - } - } -@@ -92,9 +94,9 @@ - for(int j = -1; j <= 1; ++j) { - float f1 = 0.0F; - BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j)); -- if (blockstate.func_177230_c() == Blocks.field_150458_ak) { -+ if (blockstate.canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.Direction.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) { - f1 = 1.0F; -- if (blockstate.func_177229_b(FarmlandBlock.field_176531_a) > 0) { -+ if (blockstate.isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) { - f1 = 3.0F; - } - } -@@ -130,7 +132,7 @@ - } - - public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) { -- if (p_196262_4_ instanceof RavagerEntity && p_196262_2_.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (p_196262_4_ instanceof RavagerEntity && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_196262_2_, p_196262_4_)) { - p_196262_2_.func_225521_a_(p_196262_3_, true, p_196262_4_); - } - diff --git a/patches_old/minecraft/net/minecraft/block/DeadBushBlock.java.patch b/patches_old/minecraft/net/minecraft/block/DeadBushBlock.java.patch deleted file mode 100644 index 341a2ad7e..000000000 --- a/patches_old/minecraft/net/minecraft/block/DeadBushBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/DeadBushBlock.java -+++ b/net/minecraft/block/DeadBushBlock.java -@@ -5,7 +5,7 @@ - import net.minecraft.util.math.shapes.VoxelShape; - import net.minecraft.world.IBlockReader; - --public class DeadBushBlock extends BushBlock { -+public class DeadBushBlock extends BushBlock implements net.minecraftforge.common.IShearable { - protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); - - protected DeadBushBlock(Block.Properties p_i48418_1_) { diff --git a/patches_old/minecraft/net/minecraft/block/DetectorRailBlock.java.patch b/patches_old/minecraft/net/minecraft/block/DetectorRailBlock.java.patch deleted file mode 100644 index 2ba96d58b..000000000 --- a/patches_old/minecraft/net/minecraft/block/DetectorRailBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/DetectorRailBlock.java -+++ b/net/minecraft/block/DetectorRailBlock.java -@@ -129,6 +129,8 @@ - - public int func_180641_l(BlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) { - if (p_180641_1_.func_177229_b(field_176574_M)) { -+ List carts = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, null); -+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel(); - List list = this.func_200878_a(p_180641_2_, p_180641_3_, MinecartCommandBlockEntity.class, (Predicate)null); - if (!list.isEmpty()) { - return list.get(0).func_145822_e().func_145760_g(); diff --git a/patches_old/minecraft/net/minecraft/block/DoublePlantBlock.java.patch b/patches_old/minecraft/net/minecraft/block/DoublePlantBlock.java.patch deleted file mode 100644 index ecf90a095..000000000 --- a/patches_old/minecraft/net/minecraft/block/DoublePlantBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/net/minecraft/block/DoublePlantBlock.java -+++ b/net/minecraft/block/DoublePlantBlock.java -@@ -39,7 +39,7 @@ - @Nullable - public BlockState func_196258_a(BlockItemUseContext p_196258_1_) { - BlockPos blockpos = p_196258_1_.func_195995_a(); -- return blockpos.func_177956_o() < 255 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null; -+ return blockpos.func_177956_o() < p_196258_1_.func_195991_k().func_201675_m().getHeight() - 1 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null; - } - - public void func_180633_a(World p_180633_1_, BlockPos p_180633_2_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_) { -@@ -51,6 +51,7 @@ - return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_); - } else { - BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); -+ if (p_196260_1_.func_177230_c() != this) return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. - return blockstate.func_177230_c() == this && blockstate.func_177229_b(field_176492_b) == DoubleBlockHalf.LOWER; - } - } diff --git a/patches_old/minecraft/net/minecraft/block/DropperBlock.java.patch b/patches_old/minecraft/net/minecraft/block/DropperBlock.java.patch deleted file mode 100644 index 7271e5e1c..000000000 --- a/patches_old/minecraft/net/minecraft/block/DropperBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/DropperBlock.java -+++ b/net/minecraft/block/DropperBlock.java -@@ -37,7 +37,7 @@ - p_176439_1_.func_217379_c(1001, p_176439_2_, 0); - } else { - ItemStack itemstack = dispensertileentity.func_70301_a(i); -- if (!itemstack.func_190926_b()) { -+ if (!itemstack.func_190926_b() && net.minecraftforge.items.VanillaInventoryCodeHooks.dropperInsertHook(p_176439_1_, p_176439_2_, dispensertileentity, i, itemstack)) { - Direction direction = p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a); - IInventory iinventory = HopperTileEntity.func_195484_a(p_176439_1_, p_176439_2_.func_177972_a(direction)); - ItemStack itemstack1; diff --git a/patches_old/minecraft/net/minecraft/block/FallingBlock.java.patch b/patches_old/minecraft/net/minecraft/block/FallingBlock.java.patch deleted file mode 100644 index ddd32d0d6..000000000 --- a/patches_old/minecraft/net/minecraft/block/FallingBlock.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/block/FallingBlock.java -+++ b/net/minecraft/block/FallingBlock.java -@@ -29,7 +29,7 @@ - } - - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { -- if (func_185759_i(p_225534_2_.func_180495_p(p_225534_3_.func_177977_b())) && p_225534_3_.func_177956_o() >= 0) { -+ if (p_225534_2_.func_175623_d(p_225534_3_.func_177977_b()) || func_185759_i(p_225534_2_.func_180495_p(p_225534_3_.func_177977_b())) && p_225534_3_.func_177956_o() >= 0) { - FallingBlockEntity fallingblockentity = new FallingBlockEntity(p_225534_2_, (double)p_225534_3_.func_177958_n() + 0.5D, (double)p_225534_3_.func_177956_o(), (double)p_225534_3_.func_177952_p() + 0.5D, p_225534_2_.func_180495_p(p_225534_3_)); - this.func_149829_a(fallingblockentity); - p_225534_2_.func_217376_c(fallingblockentity); -@@ -59,7 +59,7 @@ - public void func_180655_c(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) { - if (p_180655_4_.nextInt(16) == 0) { - BlockPos blockpos = p_180655_3_.func_177977_b(); -- if (func_185759_i(p_180655_2_.func_180495_p(blockpos))) { -+ if (p_180655_2_.func_175623_d(blockpos) || func_185759_i(p_180655_2_.func_180495_p(blockpos))) { - double d0 = (double)p_180655_3_.func_177958_n() + (double)p_180655_4_.nextFloat(); - double d1 = (double)p_180655_3_.func_177956_o() - 0.05D; - double d2 = (double)p_180655_3_.func_177952_p() + (double)p_180655_4_.nextFloat(); diff --git a/patches_old/minecraft/net/minecraft/block/FarmlandBlock.java.patch b/patches_old/minecraft/net/minecraft/block/FarmlandBlock.java.patch deleted file mode 100644 index 63e203b01..000000000 --- a/patches_old/minecraft/net/minecraft/block/FarmlandBlock.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/net/minecraft/block/FarmlandBlock.java -+++ b/net/minecraft/block/FarmlandBlock.java -@@ -76,7 +76,7 @@ - } - - public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) { -- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) && p_180658_3_.func_213311_cf() * p_180658_3_.func_213311_cf() * p_180658_3_.func_213302_cg() > 0.512F) { -+ if (!p_180658_1_.field_72995_K && net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) { // Forge: Move logic to Entity#canTrample - func_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_); - } - -@@ -87,9 +87,9 @@ - p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_)); - } - -- private static boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) { -- Block block = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()).func_177230_c(); -- return block instanceof CropsBlock || block instanceof StemBlock || block instanceof AttachedStemBlock; -+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) { -+ BlockState state = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()); -+ return state.func_177230_c() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, p_176529_1_, Direction.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c()); - } - - private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) { -@@ -99,7 +99,7 @@ - } - } - -- return false; -+ return net.minecraftforge.common.FarmlandWaterManager.hasBlockWaterTicket(p_176530_0_, p_176530_1_); - } - - protected void func_206840_a(StateContainer.Builder p_206840_1_) { diff --git a/patches_old/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch b/patches_old/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch deleted file mode 100644 index 4b42092df..000000000 --- a/patches_old/minecraft/net/minecraft/block/FlowingFluidBlock.java.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/net/minecraft/block/FlowingFluidBlock.java -+++ b/net/minecraft/block/FlowingFluidBlock.java -@@ -31,9 +31,11 @@ - - public class FlowingFluidBlock extends Block implements IBucketPickupHandler { - public static final IntegerProperty field_176367_b = BlockStateProperties.field_208132_ag; -- protected final FlowingFluid field_204517_c; -+ private final FlowingFluid field_204517_c; - private final List field_212565_c; - -+ // Forge: Use the constructor that takes a supplier -+ @Deprecated - protected FlowingFluidBlock(FlowingFluid p_i49014_1_, Block.Properties p_i49014_2_) { - super(p_i49014_2_); - this.field_204517_c = p_i49014_1_; -@@ -46,8 +48,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))); -+ fluidStateCacheInitialized = true; -+ supplier = p_i49014_1_.delegate; - } - -+ /** -+ * @param supplier A fluid supplier such as {@link net.minecraftforge.fml.RegistryObject} -+ */ -+ public FlowingFluidBlock(java.util.function.Supplier supplier, Block.Properties p_i48368_1_) { -+ super(p_i48368_1_); -+ this.field_204517_c = null; -+ this.field_212565_c = Lists.newArrayList(); -+ this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176367_b, Integer.valueOf(0))); -+ this.supplier = supplier; -+ } -+ - public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) { - p_225542_2_.func_204610_c(p_225542_3_).func_206891_b(p_225542_2_, p_225542_3_, p_225542_4_); - } -@@ -62,6 +77,7 @@ - - public IFluidState func_204507_t(BlockState p_204507_1_) { - int i = p_204507_1_.func_177229_b(field_176367_b); -+ if (!fluidStateCacheInitialized) initFluidStateCache(); - return this.field_212565_c.get(Math.min(i, 8)); - } - -@@ -122,13 +138,13 @@ - if (flag) { - IFluidState ifluidstate = p_204515_1_.func_204610_c(p_204515_2_); - if (ifluidstate.func_206889_d()) { -- p_204515_1_.func_175656_a(p_204515_2_, Blocks.field_150343_Z.func_176223_P()); -+ p_204515_1_.func_175656_a(p_204515_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_204515_1_, p_204515_2_, p_204515_2_, Blocks.field_150343_Z.func_176223_P())); - this.func_180688_d(p_204515_1_, p_204515_2_); - return false; - } - - if (ifluidstate.func_215679_a(p_204515_1_, p_204515_2_) >= 0.44444445F) { -- p_204515_1_.func_175656_a(p_204515_2_, Blocks.field_150347_e.func_176223_P()); -+ p_204515_1_.func_175656_a(p_204515_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_204515_1_, p_204515_2_, p_204515_2_, Blocks.field_150347_e.func_176223_P())); - this.func_180688_d(p_204515_1_, p_204515_2_); - return false; - } -@@ -161,4 +177,23 @@ - } - - } -+ -+ // Forge start -+ private final java.util.function.Supplier supplier; -+ public FlowingFluid getFluid() { -+ return (FlowingFluid)supplier.get(); -+ } -+ -+ private boolean fluidStateCacheInitialized = false; -+ protected synchronized void initFluidStateCache() { -+ if (fluidStateCacheInitialized == false) { -+ this.field_212565_c.add(getFluid().func_207204_a(false)); -+ -+ for (int i = 1; i < 8; ++i) -+ this.field_212565_c.add(getFluid().func_207207_a(8 - i, false)); -+ -+ this.field_212565_c.add(getFluid().func_207207_a(8, true)); -+ fluidStateCacheInitialized = true; -+ } -+ } - } diff --git a/patches_old/minecraft/net/minecraft/block/ITileEntityProvider.java.patch b/patches_old/minecraft/net/minecraft/block/ITileEntityProvider.java.patch deleted file mode 100644 index bd96db3c6..000000000 --- a/patches_old/minecraft/net/minecraft/block/ITileEntityProvider.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/block/ITileEntityProvider.java -+++ b/net/minecraft/block/ITileEntityProvider.java -@@ -4,6 +4,7 @@ - import net.minecraft.tileentity.TileEntity; - import net.minecraft.world.IBlockReader; - -+@Deprecated //Forge: Do not use, use BlockState.hasTileEntity/Block.createTileEntity - public interface ITileEntityProvider { - @Nullable - TileEntity func_196283_a_(IBlockReader p_196283_1_); diff --git a/patches_old/minecraft/net/minecraft/block/KelpTopBlock.java.patch b/patches_old/minecraft/net/minecraft/block/KelpTopBlock.java.patch deleted file mode 100644 index 817d73ccd..000000000 --- a/patches_old/minecraft/net/minecraft/block/KelpTopBlock.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/block/KelpTopBlock.java -+++ b/net/minecraft/block/KelpTopBlock.java -@@ -52,8 +52,9 @@ - } else { - BlockPos blockpos = p_225534_3_.func_177984_a(); - BlockState blockstate = p_225534_2_.func_180495_p(blockpos); -- if (blockstate.func_177230_c() == Blocks.field_150355_j && p_225534_1_.func_177229_b(field_203163_a) < 25 && p_225534_4_.nextDouble() < 0.14D) { -+ if (blockstate.func_177230_c() == Blocks.field_150355_j && p_225534_1_.func_177229_b(field_203163_a) < 25 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, blockpos, p_225534_1_, p_225534_4_.nextDouble() < 0.14D)) { - p_225534_2_.func_175656_a(blockpos, p_225534_1_.func_177231_a(field_203163_a)); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, blockpos, p_225534_1_); - } - - } diff --git a/patches_old/minecraft/net/minecraft/block/LadderBlock.java.patch b/patches_old/minecraft/net/minecraft/block/LadderBlock.java.patch deleted file mode 100644 index 452bc5551..000000000 --- a/patches_old/minecraft/net/minecraft/block/LadderBlock.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/block/LadderBlock.java -+++ b/net/minecraft/block/LadderBlock.java -@@ -93,6 +93,11 @@ - return null; - } - -+ @Override -+ public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { -+ return true; -+ } -+ - public BlockState func_185499_a(BlockState p_185499_1_, Rotation p_185499_2_) { - return p_185499_1_.func_206870_a(field_176382_a, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176382_a))); - } diff --git a/patches_old/minecraft/net/minecraft/block/LeavesBlock.java.patch b/patches_old/minecraft/net/minecraft/block/LeavesBlock.java.patch deleted file mode 100644 index 2c446e407..000000000 --- a/patches_old/minecraft/net/minecraft/block/LeavesBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/LeavesBlock.java -+++ b/net/minecraft/block/LeavesBlock.java -@@ -18,7 +18,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public class LeavesBlock extends Block { -+public class LeavesBlock extends Block implements net.minecraftforge.common.IShearable { - public static final IntegerProperty field_208494_a = BlockStateProperties.field_208514_aa; - public static final BooleanProperty field_208495_b = BlockStateProperties.field_208515_s; - diff --git a/patches_old/minecraft/net/minecraft/block/MushroomBlock.java.patch b/patches_old/minecraft/net/minecraft/block/MushroomBlock.java.patch deleted file mode 100644 index b85d7d040..000000000 --- a/patches_old/minecraft/net/minecraft/block/MushroomBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/MushroomBlock.java -+++ b/net/minecraft/block/MushroomBlock.java -@@ -64,7 +64,7 @@ - BlockState blockstate = p_196260_2_.func_180495_p(blockpos); - Block block = blockstate.func_177230_c(); - if (block != Blocks.field_150391_bh && block != Blocks.field_196661_l) { -- 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_old/minecraft/net/minecraft/block/NetherPortalBlock.java.patch b/patches_old/minecraft/net/minecraft/block/NetherPortalBlock.java.patch deleted file mode 100644 index 7307175b9..000000000 --- a/patches_old/minecraft/net/minecraft/block/NetherPortalBlock.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/net/minecraft/block/NetherPortalBlock.java -+++ b/net/minecraft/block/NetherPortalBlock.java -@@ -69,7 +69,7 @@ - - public boolean func_176548_d(IWorld p_176548_1_, BlockPos p_176548_2_) { - NetherPortalBlock.Size netherportalblock$size = this.func_201816_b(p_176548_1_, p_176548_2_); -- if (netherportalblock$size != null) { -+ if (netherportalblock$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, netherportalblock$size)) { - netherportalblock$size.func_150859_c(); - return true; - } else { -@@ -241,13 +241,13 @@ - 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_177230_c() != 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(this.field_150867_a, blockpos.func_177977_b())) { - break; - } - } - -- Block block = this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).func_177230_c(); -- return block == Blocks.field_150343_Z ? i : 0; -+ BlockPos framePos = p_180120_1_.func_177967_a(p_180120_2_, i); -+ return this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos) ? i : 0; - } - - public int func_181100_a() { -@@ -274,13 +274,13 @@ - } - - if (i == 0) { -- block = this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).func_177230_c(); -- if (block != Blocks.field_150343_Z) { -+ BlockPos framePos = blockpos.func_177972_a(this.field_150863_d); -+ if (!this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos)) { - break label56; - } - } else if (i == this.field_150868_h - 1) { -- block = this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).func_177230_c(); -- if (block != Blocks.field_150343_Z) { -+ BlockPos framePos = blockpos.func_177972_a(this.field_150866_c); -+ if (!this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos)) { - break label56; - } - } -@@ -288,7 +288,8 @@ - } - - 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_177230_c() != Blocks.field_150343_Z) { -+ BlockPos framePos = this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g); -+ if (!this.field_150867_a.func_180495_p(framePos).isPortalFrame(this.field_150867_a, framePos)) { - this.field_150862_g = 0; - break; - } diff --git a/patches_old/minecraft/net/minecraft/block/NoteBlock.java.patch b/patches_old/minecraft/net/minecraft/block/NoteBlock.java.patch deleted file mode 100644 index 1050235fc..000000000 --- a/patches_old/minecraft/net/minecraft/block/NoteBlock.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/block/NoteBlock.java -+++ b/net/minecraft/block/NoteBlock.java -@@ -50,7 +50,7 @@ - } - - private void func_196482_a(World p_196482_1_, BlockPos p_196482_2_) { -- if (p_196482_1_.func_180495_p(p_196482_2_.func_177984_a()).func_196958_f()) { -+ if (p_196482_1_.func_175623_d(p_196482_2_.func_177984_a())) { - p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0); - } - -@@ -60,7 +60,9 @@ - if (p_225533_2_.field_72995_K) { - return ActionResultType.SUCCESS; - } else { -- p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c); -+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_225533_2_, p_225533_3_, p_225533_1_, p_225533_1_.func_177229_b(field_196485_c), p_225533_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c)); -+ if (_new == -1) return ActionResultType.FAIL; -+ p_225533_1_ = (BlockState)p_225533_1_.func_206870_a(field_196485_c, _new); - p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3); - this.func_196482_a(p_225533_2_, p_225533_3_); - p_225533_4_.func_195066_a(Stats.field_188087_U); -@@ -76,6 +78,9 @@ - } - - public boolean func_189539_a(BlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) { -+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_189539_2_, p_189539_3_, p_189539_1_, p_189539_1_.func_177229_b(field_196485_c), p_189539_1_.func_177229_b(field_196483_a)); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false; -+ p_189539_1_ = p_189539_1_.func_206870_a(field_196485_c, e.getVanillaNoteId()).func_206870_a(field_196483_a, e.getInstrument()); - int i = p_189539_1_.func_177229_b(field_196485_c); - float f = (float)Math.pow(2.0D, (double)(i - 12) / 12.0D); - p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, p_189539_1_.func_177229_b(field_196483_a).func_208088_a(), SoundCategory.RECORDS, 3.0F, f); diff --git a/patches_old/minecraft/net/minecraft/block/OreBlock.java.patch b/patches_old/minecraft/net/minecraft/block/OreBlock.java.patch deleted file mode 100644 index fee79b59a..000000000 --- a/patches_old/minecraft/net/minecraft/block/OreBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/net/minecraft/block/OreBlock.java -+++ b/net/minecraft/block/OreBlock.java -@@ -29,12 +29,10 @@ - - public void func_220062_a(BlockState p_220062_1_, World 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); -- if (i > 0) { -- this.func_180637_b(p_220062_2_, p_220062_3_, i); -- } -- } -+ } - -+ @Override -+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune, int silktouch) { -+ return silktouch == 0 ? this.func_220281_a(RANDOM) : 0; - } - } diff --git a/patches_old/minecraft/net/minecraft/block/PistonBlockStructureHelper.java.patch b/patches_old/minecraft/net/minecraft/block/PistonBlockStructureHelper.java.patch deleted file mode 100644 index 97e05a576..000000000 --- a/patches_old/minecraft/net/minecraft/block/PistonBlockStructureHelper.java.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- a/net/minecraft/block/PistonBlockStructureHelper.java -+++ b/net/minecraft/block/PistonBlockStructureHelper.java -@@ -48,7 +48,7 @@ - } else { - for(int i = 0; i < this.field_177258_e.size(); ++i) { - BlockPos blockpos = this.field_177258_e.get(i); -- if (func_227029_a_(this.field_177261_a.func_180495_p(blockpos).func_177230_c()) && !this.func_177250_b(blockpos)) { -+ if (this.field_177261_a.func_180495_p(blockpos).isStickyBlock() && !this.func_177250_b(blockpos)) { - return false; - } - } -@@ -57,24 +57,9 @@ - } - } - -- private static boolean func_227029_a_(Block p_227029_0_) { -- return p_227029_0_ == Blocks.field_180399_cE || p_227029_0_ == Blocks.field_226907_mc_; -- } -- -- private static boolean func_227030_a_(Block p_227030_0_, Block p_227030_1_) { -- if (p_227030_0_ == Blocks.field_226907_mc_ && p_227030_1_ == Blocks.field_180399_cE) { -- return false; -- } else if (p_227030_0_ == Blocks.field_180399_cE && p_227030_1_ == Blocks.field_226907_mc_) { -- return false; -- } else { -- return func_227029_a_(p_227030_0_) || func_227029_a_(p_227030_1_); -- } -- } -- - private boolean func_177251_a(BlockPos p_177251_1_, Direction p_177251_2_) { - BlockState blockstate = this.field_177261_a.func_180495_p(p_177251_1_); -- Block block = blockstate.func_177230_c(); -- if (blockstate.func_196958_f()) { -+ if (field_177261_a.func_175623_d(p_177251_1_)) { - return true; - } else if (!PistonBlock.func_185646_a(blockstate, this.field_177261_a, p_177251_1_, this.field_177257_d, false, p_177251_2_)) { - return true; -@@ -87,12 +72,12 @@ - if (i + this.field_177258_e.size() > 12) { - return false; - } else { -- while(func_227029_a_(block)) { -+ BlockState oldState; -+ while(blockstate.isStickyBlock()) { - BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i); -- Block block1 = block; -+ oldState = blockstate; - blockstate = this.field_177261_a.func_180495_p(blockpos); -- block = blockstate.func_177230_c(); -- if (blockstate.func_196958_f() || !func_227030_a_(block1, block) || !PistonBlock.func_185646_a(blockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) { -+ if (blockstate.isAir(this.field_177261_a, blockpos) || !oldState.canStickTo(blockstate) || !PistonBlock.func_185646_a(blockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) { - break; - } - -@@ -119,7 +104,7 @@ - - for(int k = 0; k <= j + l; ++k) { - BlockPos blockpos2 = this.field_177258_e.get(k); -- if (func_227029_a_(this.field_177261_a.func_180495_p(blockpos2).func_177230_c()) && !this.func_177250_b(blockpos2)) { -+ if (this.field_177261_a.func_180495_p(blockpos2).isStickyBlock() && !this.func_177250_b(blockpos2)) { - return false; - } - } -@@ -128,7 +113,7 @@ - } - - blockstate = this.field_177261_a.func_180495_p(blockpos1); -- if (blockstate.func_196958_f()) { -+ if (blockstate.isAir(field_177261_a, blockpos1)) { - return true; - } - -@@ -173,7 +158,7 @@ - if (direction.func_176740_k() != this.field_177257_d.func_176740_k()) { - BlockPos blockpos = p_177250_1_.func_177972_a(direction); - BlockState blockstate1 = this.field_177261_a.func_180495_p(blockpos); -- if (func_227030_a_(blockstate1.func_177230_c(), blockstate.func_177230_c()) && !this.func_177251_a(blockpos, direction)) { -+ if (blockstate1.canStickTo(blockstate) && !this.func_177251_a(blockpos, direction)) { - return false; - } - } diff --git a/patches_old/minecraft/net/minecraft/block/RailState.java.patch b/patches_old/minecraft/net/minecraft/block/RailState.java.patch deleted file mode 100644 index 59bee3cd9..000000000 --- a/patches_old/minecraft/net/minecraft/block/RailState.java.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/net/minecraft/block/RailState.java -+++ b/net/minecraft/block/RailState.java -@@ -15,14 +15,16 @@ - private BlockState field_196923_d; - private final boolean field_208513_e; - private final List field_196924_e = Lists.newArrayList(); -+ private final boolean canMakeSlopes; - - public RailState(World p_i47755_1_, BlockPos p_i47755_2_, BlockState p_i47755_3_) { - this.field_196920_a = p_i47755_1_; - this.field_196921_b = p_i47755_2_; - this.field_196923_d = p_i47755_3_; - this.field_196922_c = (AbstractRailBlock)p_i47755_3_.func_177230_c(); -- RailShape railshape = p_i47755_3_.func_177229_b(this.field_196922_c.func_176560_l()); -- this.field_208513_e = this.field_196922_c.func_208490_b(); -+ RailShape railshape = this.field_196922_c.getRailDirection(field_196923_d, p_i47755_1_, p_i47755_2_, null); -+ this.field_208513_e = !this.field_196922_c.isFlexibleRail(field_196923_d, p_i47755_1_, p_i47755_2_); -+ this.canMakeSlopes = this.field_196922_c.canMakeSlopes(field_196923_d, p_i47755_1_, p_i47755_2_); - this.func_208509_a(railshape); - } - -@@ -178,7 +180,7 @@ - } - } - -- if (railshape == RailShape.NORTH_SOUTH) { -+ if (railshape == RailShape.NORTH_SOUTH && canMakeSlopes) { - if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) { - railshape = RailShape.ASCENDING_NORTH; - } -@@ -188,7 +190,7 @@ - } - } - -- if (railshape == RailShape.EAST_WEST) { -+ if (railshape == RailShape.EAST_WEST && canMakeSlopes) { - if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) { - railshape = RailShape.ASCENDING_EAST; - } -@@ -304,7 +306,7 @@ - } - } - -- if (railshape == RailShape.NORTH_SOUTH) { -+ if (railshape == RailShape.NORTH_SOUTH && canMakeSlopes) { - if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) { - railshape = RailShape.ASCENDING_NORTH; - } -@@ -314,7 +316,7 @@ - } - } - -- if (railshape == RailShape.EAST_WEST) { -+ if (railshape == RailShape.EAST_WEST && canMakeSlopes) { - if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) { - railshape = RailShape.ASCENDING_EAST; - } diff --git a/patches_old/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch b/patches_old/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch deleted file mode 100644 index 71c810df0..000000000 --- a/patches_old/minecraft/net/minecraft/block/RedstoneOreBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/block/RedstoneOreBlock.java -+++ b/net/minecraft/block/RedstoneOreBlock.java -@@ -68,11 +68,11 @@ - - public void func_220062_a(BlockState p_220062_1_, World 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); -- this.func_180637_b(p_220062_2_, p_220062_3_, i); -- } -+ } - -+ @Override -+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune, int silktouch) { -+ return silktouch == 0 ? 1 + RANDOM.nextInt(5) : 0; - } - - @OnlyIn(Dist.CLIENT) diff --git a/patches_old/minecraft/net/minecraft/block/SaplingBlock.java.patch b/patches_old/minecraft/net/minecraft/block/SaplingBlock.java.patch deleted file mode 100644 index cc072f5e5..000000000 --- a/patches_old/minecraft/net/minecraft/block/SaplingBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/block/SaplingBlock.java -+++ b/net/minecraft/block/SaplingBlock.java -@@ -29,6 +29,7 @@ - - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { - super.func_225534_a_(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_); -+ if (!p_225534_2_.isAreaLoaded(p_225534_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light - if (p_225534_2_.func_201696_r(p_225534_3_.func_177984_a()) >= 9 && p_225534_4_.nextInt(7) == 0) { - this.func_226942_a_(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_4_); - } -@@ -39,6 +40,7 @@ - if (p_226942_3_.func_177229_b(field_176479_b) == 0) { - p_226942_1_.func_180501_a(p_226942_2_, p_226942_3_.func_177231_a(field_176479_b), 4); - } else { -+ if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_226942_1_, p_226942_4_, p_226942_2_)) return; - this.field_196387_c.func_225545_a_(p_226942_1_, p_226942_1_.func_72863_F().func_201711_g(), p_226942_2_, p_226942_3_, p_226942_4_); - } - diff --git a/patches_old/minecraft/net/minecraft/block/ScaffoldingBlock.java.patch b/patches_old/minecraft/net/minecraft/block/ScaffoldingBlock.java.patch deleted file mode 100644 index a13c597eb..000000000 --- a/patches_old/minecraft/net/minecraft/block/ScaffoldingBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/ScaffoldingBlock.java -+++ b/net/minecraft/block/ScaffoldingBlock.java -@@ -138,6 +138,8 @@ - return i; - } - -+ @Override public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; } -+ - static { - VoxelShape voxelshape = Block.func_208617_a(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D); - VoxelShape voxelshape1 = Block.func_208617_a(0.0D, 0.0D, 0.0D, 2.0D, 16.0D, 2.0D); diff --git a/patches_old/minecraft/net/minecraft/block/SeaGrassBlock.java.patch b/patches_old/minecraft/net/minecraft/block/SeaGrassBlock.java.patch deleted file mode 100644 index 9e15b84f7..000000000 --- a/patches_old/minecraft/net/minecraft/block/SeaGrassBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/SeaGrassBlock.java -+++ b/net/minecraft/block/SeaGrassBlock.java -@@ -17,7 +17,7 @@ - import net.minecraft.world.World; - import net.minecraft.world.server.ServerWorld; - --public class SeaGrassBlock extends BushBlock implements IGrowable, ILiquidContainer { -+public class SeaGrassBlock extends BushBlock implements IGrowable, ILiquidContainer, net.minecraftforge.common.IShearable { - protected static final VoxelShape field_207798_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D); - - protected SeaGrassBlock(Block.Properties p_i48780_1_) { diff --git a/patches_old/minecraft/net/minecraft/block/ShearableDoublePlantBlock.java.patch b/patches_old/minecraft/net/minecraft/block/ShearableDoublePlantBlock.java.patch deleted file mode 100644 index 18eac1d82..000000000 --- a/patches_old/minecraft/net/minecraft/block/ShearableDoublePlantBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/ShearableDoublePlantBlock.java -+++ b/net/minecraft/block/ShearableDoublePlantBlock.java -@@ -4,7 +4,7 @@ - import net.minecraft.state.EnumProperty; - import net.minecraft.state.properties.DoubleBlockHalf; - --public class ShearableDoublePlantBlock extends DoublePlantBlock { -+public class ShearableDoublePlantBlock extends DoublePlantBlock implements net.minecraftforge.common.IShearable { - public static final EnumProperty field_208063_b = DoublePlantBlock.field_176492_b; - - public ShearableDoublePlantBlock(Block.Properties p_i49975_1_) { diff --git a/patches_old/minecraft/net/minecraft/block/SpawnerBlock.java.patch b/patches_old/minecraft/net/minecraft/block/SpawnerBlock.java.patch deleted file mode 100644 index 646638993..000000000 --- a/patches_old/minecraft/net/minecraft/block/SpawnerBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/block/SpawnerBlock.java -+++ 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_) { - 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); - } - -+ @Override -+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune, int silktouch) { -+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); -+ } -+ - public BlockRenderType func_149645_b(BlockState p_149645_1_) { - return BlockRenderType.MODEL; - } diff --git a/patches_old/minecraft/net/minecraft/block/SpreadableSnowyDirtBlock.java.patch b/patches_old/minecraft/net/minecraft/block/SpreadableSnowyDirtBlock.java.patch deleted file mode 100644 index d46dc4046..000000000 --- a/patches_old/minecraft/net/minecraft/block/SpreadableSnowyDirtBlock.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/block/SpreadableSnowyDirtBlock.java -+++ b/net/minecraft/block/SpreadableSnowyDirtBlock.java -@@ -31,6 +31,7 @@ - - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { - if (!func_220257_b(p_225534_1_, p_225534_2_, p_225534_3_)) { -+ if (!p_225534_2_.isAreaLoaded(p_225534_3_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading - p_225534_2_.func_175656_a(p_225534_3_, Blocks.field_150346_d.func_176223_P()); - } else { - if (p_225534_2_.func_201696_r(p_225534_3_.func_177984_a()) >= 9) { diff --git a/patches_old/minecraft/net/minecraft/block/SugarCaneBlock.java.patch b/patches_old/minecraft/net/minecraft/block/SugarCaneBlock.java.patch deleted file mode 100644 index cd26ff88d..000000000 --- a/patches_old/minecraft/net/minecraft/block/SugarCaneBlock.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- a/net/minecraft/block/SugarCaneBlock.java -+++ b/net/minecraft/block/SugarCaneBlock.java -@@ -15,7 +15,7 @@ - import net.minecraft.world.IWorldReader; - import net.minecraft.world.server.ServerWorld; - --public class SugarCaneBlock extends Block { -+public class SugarCaneBlock extends Block implements net.minecraftforge.common.IPlantable { - public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X; - protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D); - -@@ -39,12 +39,15 @@ - - if (i < 3) { - int j = p_225534_1_.func_177229_b(field_176355_a); -+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, true)) { - if (j == 15) { - p_225534_2_.func_175656_a(p_225534_3_.func_177984_a(), this.func_176223_P()); - p_225534_2_.func_180501_a(p_225534_3_, p_225534_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4); - } else { - p_225534_2_.func_180501_a(p_225534_3_, p_225534_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4); - } -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_); -+ } - } - } - -@@ -59,6 +62,8 @@ - } - - public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { -+ BlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()); -+ if (soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), Direction.UP, this)) return true; - Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c(); - if (block == this) { - return true; -@@ -82,4 +87,14 @@ - protected void func_206840_a(StateContainer.Builder p_206840_1_) { - p_206840_1_.func_206894_a(field_176355_a); - } -+ -+ @Override -+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) { -+ return net.minecraftforge.common.PlantType.Beach; -+ } -+ -+ @Override -+ public BlockState getPlant(IBlockReader world, BlockPos pos) { -+ return func_176223_P(); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/block/SweetBerryBushBlock.java.patch b/patches_old/minecraft/net/minecraft/block/SweetBerryBushBlock.java.patch deleted file mode 100644 index 78f5c8986..000000000 --- a/patches_old/minecraft/net/minecraft/block/SweetBerryBushBlock.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/block/SweetBerryBushBlock.java -+++ b/net/minecraft/block/SweetBerryBushBlock.java -@@ -49,8 +49,9 @@ - public void func_225534_a_(BlockState p_225534_1_, ServerWorld p_225534_2_, BlockPos p_225534_3_, Random p_225534_4_) { - super.func_225534_a_(p_225534_1_, p_225534_2_, p_225534_3_, p_225534_4_); - int i = p_225534_1_.func_177229_b(field_220125_a); -- if (i < 3 && p_225534_4_.nextInt(5) == 0 && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9) { -+ if (i < 3 && p_225534_2_.func_226659_b_(p_225534_3_.func_177984_a(), 0) >= 9 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225534_2_, p_225534_3_, p_225534_1_, p_225534_4_.nextInt(5) == 0)) { - p_225534_2_.func_180501_a(p_225534_3_, p_225534_1_.func_206870_a(field_220125_a, Integer.valueOf(i + 1)), 2); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225534_2_, p_225534_3_, p_225534_1_); - } - - } diff --git a/patches_old/minecraft/net/minecraft/block/TNTBlock.java.patch b/patches_old/minecraft/net/minecraft/block/TNTBlock.java.patch deleted file mode 100644 index 96361ce46..000000000 --- a/patches_old/minecraft/net/minecraft/block/TNTBlock.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- a/net/minecraft/block/TNTBlock.java -+++ b/net/minecraft/block/TNTBlock.java -@@ -29,10 +29,14 @@ - this.func_180632_j(this.func_176223_P().func_206870_a(field_212569_a, Boolean.valueOf(false))); - } - -+ public void catchFire(BlockState state, World world, BlockPos pos, @Nullable net.minecraft.util.Direction face, @Nullable LivingEntity igniter) { -+ func_196535_a(world, pos, igniter); -+ } -+ - public void func_220082_b(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_) { - if (p_220082_4_.func_177230_c() != p_220082_1_.func_177230_c()) { - if (p_220082_2_.func_175640_z(p_220082_3_)) { -- func_196534_a(p_220082_2_, p_220082_3_); -+ catchFire(p_220082_1_, p_220082_2_, p_220082_3_, null, null); - p_220082_2_.func_217377_a(p_220082_3_, false); - } - -@@ -41,7 +45,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_.func_175640_z(p_220069_3_)) { -- func_196534_a(p_220069_2_, p_220069_3_); -+ catchFire(p_220069_1_, p_220069_2_, p_220069_3_, null, null); - p_220069_2_.func_217377_a(p_220069_3_, false); - } - -@@ -49,7 +53,7 @@ - - public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, BlockState p_176208_3_, PlayerEntity p_176208_4_) { - if (!p_176208_1_.func_201670_d() && !p_176208_4_.func_184812_l_() && p_176208_3_.func_177229_b(field_212569_a)) { -- func_196534_a(p_176208_1_, p_176208_2_); -+ catchFire(p_176208_3_, p_176208_1_, p_176208_2_, null, null); - } - - super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_); -@@ -63,10 +67,12 @@ - } - } - -+ @Deprecated //Forge: Prefer using IForgeBlock#catchFire - public static void func_196534_a(World p_196534_0_, BlockPos p_196534_1_) { - func_196535_a(p_196534_0_, p_196534_1_, (LivingEntity)null); - } - -+ @Deprecated //Forge: Prefer using IForgeBlock#catchFire - private static void func_196535_a(World p_196535_0_, BlockPos p_196535_1_, @Nullable LivingEntity p_196535_2_) { - if (!p_196535_0_.field_72995_K) { - TNTEntity tntentity = new TNTEntity(p_196535_0_, (double)p_196535_1_.func_177958_n() + 0.5D, (double)p_196535_1_.func_177956_o(), (double)p_196535_1_.func_177952_p() + 0.5D, p_196535_2_); -@@ -81,7 +87,7 @@ - if (item != Items.field_151033_d && item != Items.field_151059_bz) { - return super.func_225533_a_(p_225533_1_, p_225533_2_, p_225533_3_, p_225533_4_, p_225533_5_, p_225533_6_); - } else { -- func_196535_a(p_225533_2_, p_225533_3_, p_225533_4_); -+ catchFire(p_225533_1_, p_225533_2_, p_225533_3_, p_225533_6_.func_216354_b(), p_225533_4_); - p_225533_2_.func_180501_a(p_225533_3_, Blocks.field_150350_a.func_176223_P(), 11); - if (!p_225533_4_.func_184812_l_()) { - if (item == Items.field_151033_d) { -@@ -103,7 +109,7 @@ - Entity entity = abstractarrowentity.func_212360_k(); - if (abstractarrowentity.func_70027_ad()) { - BlockPos blockpos = p_220066_3_.func_216350_a(); -- func_196535_a(p_220066_1_, blockpos, entity instanceof LivingEntity ? (LivingEntity)entity : null); -+ catchFire(p_220066_2_, p_220066_1_, blockpos, null, entity instanceof LivingEntity ? (LivingEntity)entity : null); - p_220066_1_.func_217377_a(blockpos, false); - } - } diff --git a/patches_old/minecraft/net/minecraft/block/TallGrassBlock.java.patch b/patches_old/minecraft/net/minecraft/block/TallGrassBlock.java.patch deleted file mode 100644 index 9349ebe64..000000000 --- a/patches_old/minecraft/net/minecraft/block/TallGrassBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/TallGrassBlock.java -+++ b/net/minecraft/block/TallGrassBlock.java -@@ -8,7 +8,7 @@ - import net.minecraft.world.World; - import net.minecraft.world.server.ServerWorld; - --public class TallGrassBlock extends BushBlock implements IGrowable { -+public class TallGrassBlock extends BushBlock implements IGrowable, net.minecraftforge.common.IShearable { - protected static final VoxelShape field_196389_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); - - protected TallGrassBlock(Block.Properties p_i48310_1_) { diff --git a/patches_old/minecraft/net/minecraft/block/WebBlock.java.patch b/patches_old/minecraft/net/minecraft/block/WebBlock.java.patch deleted file mode 100644 index 49f30cc9e..000000000 --- a/patches_old/minecraft/net/minecraft/block/WebBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/WebBlock.java -+++ b/net/minecraft/block/WebBlock.java -@@ -5,7 +5,7 @@ - import net.minecraft.util.math.Vec3d; - import net.minecraft.world.World; - --public class WebBlock extends Block { -+public class WebBlock extends Block implements net.minecraftforge.common.IShearable { - public WebBlock(Block.Properties p_i48296_1_) { - super(p_i48296_1_); - } diff --git a/patches_old/minecraft/net/minecraft/block/trees/JungleTree.java.patch b/patches_old/minecraft/net/minecraft/block/trees/JungleTree.java.patch deleted file mode 100644 index 9c81b0b5d..000000000 --- a/patches_old/minecraft/net/minecraft/block/trees/JungleTree.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/block/trees/JungleTree.java -+++ b/net/minecraft/block/trees/JungleTree.java -@@ -12,7 +12,7 @@ - public class JungleTree extends BigTree { - @Nullable - protected ConfiguredFeature func_225546_b_(Random p_225546_1_, boolean p_225546_2_) { -- return (new TreeFeature(TreeFeatureConfig::func_227338_a_)).func_225566_b_(DefaultBiomeFeatures.field_226808_c_); -+ return (new TreeFeature(TreeFeatureConfig::deserializeJungle)).func_225566_b_(DefaultBiomeFeatures.field_226808_c_); - } - - @Nullable diff --git a/patches_old/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch b/patches_old/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch deleted file mode 100644 index 66abfb624..000000000 --- a/patches_old/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/client/ClientBrandRetriever.java -+++ b/net/minecraft/client/ClientBrandRetriever.java -@@ -6,6 +6,6 @@ - @OnlyIn(Dist.CLIENT) - public class ClientBrandRetriever { - public static String getClientModName() { -- return "vanilla"; -+ return net.minecraftforge.fml.BrandingControl.getClientBranding(); - } - } diff --git a/patches_old/minecraft/net/minecraft/client/MainWindow.java.patch b/patches_old/minecraft/net/minecraft/client/MainWindow.java.patch deleted file mode 100644 index bb6677bab..000000000 --- a/patches_old/minecraft/net/minecraft/client/MainWindow.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/client/MainWindow.java -+++ b/net/minecraft/client/MainWindow.java -@@ -86,7 +86,7 @@ - GLFW.glfwWindowHint(139266, 2); - GLFW.glfwWindowHint(139267, 0); - GLFW.glfwWindowHint(139272, 0); -- this.field_198119_f = GLFW.glfwCreateWindow(this.field_198129_p, this.field_198130_q, p_i51170_5_, this.field_198125_l && monitor != null ? monitor.func_197995_f() : 0L, 0L); -+ this.field_198119_f = net.minecraftforge.fml.loading.progress.EarlyProgressVisualization.INSTANCE.handOffWindow(()->this.field_198129_p, ()->this.field_198130_q, ()->p_i51170_5_, ()->this.field_198125_l && monitor != null ? monitor.func_197995_f() : 0L); - if (monitor != null) { - VideoMode videomode = monitor.func_197992_a(this.field_198125_l ? this.field_198124_k : Optional.empty()); - this.field_198120_g = this.field_198127_n = monitor.func_197989_c() + videomode.func_198064_a() / 2 - this.field_198129_p / 2; diff --git a/patches_old/minecraft/net/minecraft/client/gui/RenderComponentsUtil.java.patch b/patches_old/minecraft/net/minecraft/client/gui/RenderComponentsUtil.java.patch deleted file mode 100644 index 98e7099b4..000000000 --- a/patches_old/minecraft/net/minecraft/client/gui/RenderComponentsUtil.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/client/gui/RenderComponentsUtil.java -+++ b/net/minecraft/client/gui/RenderComponentsUtil.java -@@ -54,6 +54,7 @@ - s2 = ""; - s3 = s4; - } -+ s3 = TextFormatting.func_211164_a(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping. - - ITextComponent itextcomponent4 = (new StringTextComponent(s3)).func_150255_a(itextcomponent1.func_150256_b().func_150232_l()); - list1.add(j + 1, itextcomponent4); diff --git a/patches_old/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch b/patches_old/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch deleted file mode 100644 index c7e3725f7..000000000 --- a/patches_old/minecraft/net/minecraft/client/gui/screen/CreateWorldScreen.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/net/minecraft/client/gui/screen/CreateWorldScreen.java -+++ b/net/minecraft/client/gui/screen/CreateWorldScreen.java -@@ -145,14 +145,7 @@ - }); - this.field_146320_D.visible = false; - this.field_146322_F = this.addButton(new Button(this.width / 2 + 5, 120, 150, 20, I18n.func_135052_a("selectWorld.customizeType"), (p_214314_1_) -> { -- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c) { -- this.minecraft.func_147108_a(new CreateFlatWorldScreen(this, this.field_146334_a)); -- } -- -- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_205394_h) { -- this.minecraft.func_147108_a(new CreateBuffetWorldScreen(this, this.field_146334_a)); -- } -- -+ WorldType.field_77139_a[this.field_146331_K].onCustomizeButton(this.minecraft, CreateWorldScreen.this); - })); - this.field_146322_F.visible = false; - this.field_146321_E = this.addButton(new Button(this.width / 2 - 155, 151, 150, 20, I18n.func_135052_a("selectWorld.allowCommands"), (p_214315_1_) -> { -@@ -240,6 +233,8 @@ - } - } - -+ WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress(); -+ - WorldSettings worldsettings = new WorldSettings(i, this.field_228197_f_.field_228218_f_, this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]); - worldsettings.func_205390_a(Dynamic.convert(NBTDynamicOps.field_210820_a, JsonOps.INSTANCE, this.field_146334_a)); - if (this.field_146338_v && !this.field_146337_w) { diff --git a/patches_old/minecraft/net/minecraft/client/gui/screen/ResourcePacksScreen.java.patch b/patches_old/minecraft/net/minecraft/client/gui/screen/ResourcePacksScreen.java.patch deleted file mode 100644 index c6ef035d2..000000000 --- a/patches_old/minecraft/net/minecraft/client/gui/screen/ResourcePacksScreen.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/net/minecraft/client/gui/screen/ResourcePacksScreen.java -+++ b/net/minecraft/client/gui/screen/ResourcePacksScreen.java -@@ -86,11 +86,14 @@ - resourcepacklist.func_198983_a(); - List list = Lists.newArrayList(resourcepacklist.func_198978_b()); - list.removeAll(resourcepacklist.func_198980_d()); -+ list.removeIf(net.minecraft.resources.ResourcePackInfo::isHidden); // Forge: Hide some resource packs from the UI entirely - - for(ClientResourcePackInfo clientresourcepackinfo : list) { - this.field_146970_i.func_214365_a(new AbstractResourcePackList.ResourcePackEntry(this.field_146970_i, this, clientresourcepackinfo)); - } - -+ java.util.Collection enabledList = resourcepacklist.func_198980_d(); -+ enabledList.removeIf(net.minecraft.resources.ResourcePackInfo::isHidden); // Forge: Hide some resource packs from the UI entirely - for(ClientResourcePackInfo clientresourcepackinfo1 : Lists.reverse(Lists.newArrayList(resourcepacklist.func_198980_d()))) { - this.field_146967_r.func_214365_a(new AbstractResourcePackList.ResourcePackEntry(this.field_146967_r, this, clientresourcepackinfo1)); - } diff --git a/patches_old/minecraft/net/minecraft/client/multiplayer/ClientChunkProvider.java.patch b/patches_old/minecraft/net/minecraft/client/multiplayer/ClientChunkProvider.java.patch deleted file mode 100644 index 74522efd6..000000000 --- a/patches_old/minecraft/net/minecraft/client/multiplayer/ClientChunkProvider.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/client/multiplayer/ClientChunkProvider.java -+++ b/net/minecraft/client/multiplayer/ClientChunkProvider.java -@@ -59,6 +59,7 @@ - int i = this.field_217256_d.func_217191_a(p_73234_1_, p_73234_2_); - Chunk chunk = this.field_217256_d.func_217192_a(i); - if (func_217249_a(chunk, p_73234_1_, p_73234_2_)) { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload(chunk)); - this.field_217256_d.func_217190_a(i, chunk, (Chunk)null); - } - -@@ -112,6 +113,7 @@ - } - - this.field_73235_d.func_228323_e_(p_228313_1_, p_228313_2_); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk)); - return chunk; - } - } diff --git a/patches_old/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch b/patches_old/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch deleted file mode 100644 index 334cd67c3..000000000 --- a/patches_old/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/client/multiplayer/ServerData.java -+++ b/net/minecraft/client/multiplayer/ServerData.java -@@ -22,6 +22,7 @@ - private ServerData.ServerResourceMode field_152587_j = ServerData.ServerResourceMode.PROMPT; - private String field_147411_m; - private boolean field_181042_l; -+ public net.minecraftforge.fml.client.ExtendedServerListData forgeData = null; - - public ServerData(String p_i46420_1_, String p_i46420_2_, boolean p_i46420_3_) { - this.field_78847_a = p_i46420_1_; diff --git a/patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch b/patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch deleted file mode 100644 index 112890700..000000000 --- a/patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/client/network/ServerPinger.java -+++ b/net/minecraft/client/network/ServerPinger.java -@@ -120,6 +120,8 @@ - p_147224_1_.func_147407_a((String)null); - } - -+ net.minecraftforge.fml.client.ClientHooks.processForgeListPingData(serverstatusresponse, p_147224_1_); -+ - this.field_175092_e = Util.func_211177_b(); - networkmanager.func_179290_a(new CPingPacket(this.field_175092_e)); - this.field_147403_d = true; diff --git a/patches_old/minecraft/net/minecraft/client/network/handshake/ClientHandshakeNetHandler.java.patch b/patches_old/minecraft/net/minecraft/client/network/handshake/ClientHandshakeNetHandler.java.patch deleted file mode 100644 index 0316cf024..000000000 --- a/patches_old/minecraft/net/minecraft/client/network/handshake/ClientHandshakeNetHandler.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/client/network/handshake/ClientHandshakeNetHandler.java -+++ b/net/minecraft/client/network/handshake/ClientHandshakeNetHandler.java -@@ -20,6 +20,7 @@ - } - - public void func_147383_a(CHandshakePacket p_147383_1_) { -+ if (!net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerLogin(p_147383_1_, this.field_147384_b)) return; - this.field_147384_b.func_150723_a(p_147383_1_.func_149594_c()); - this.field_147384_b.func_150719_a(new ServerLoginNetHandler(this.field_147385_a, this.field_147384_b)); - } diff --git a/patches_old/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch b/patches_old/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch deleted file mode 100644 index ce3024d69..000000000 --- a/patches_old/minecraft/net/minecraft/client/network/login/ClientLoginNetHandler.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/client/network/login/ClientLoginNetHandler.java -+++ b/net/minecraft/client/network/login/ClientLoginNetHandler.java -@@ -98,6 +98,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); -+ net.minecraftforge.fml.network.NetworkHooks.handleClientLoginSuccess(this.field_147393_d); - 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 @@ - } - - public void func_209521_a(SCustomPayloadLoginPacket p_209521_1_) { -+ if (net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(p_209521_1_, this.field_147393_d)) return; - this.field_209525_d.accept(new TranslationTextComponent("connect.negotiating")); - this.field_147393_d.func_179290_a(new CCustomPayloadLoginPacket(p_209521_1_.func_209918_a(), (PacketBuffer)null)); - } diff --git a/patches_old/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch b/patches_old/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch deleted file mode 100644 index 1d23d4117..000000000 --- a/patches_old/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- a/net/minecraft/client/network/play/ClientPlayNetHandler.java -+++ b/net/minecraft/client/network/play/ClientPlayNetHandler.java -@@ -361,6 +361,7 @@ - - this.field_147299_f.field_184132_p.func_217737_a(); - this.field_147299_f.field_71439_g.func_70065_x(); -+ net.minecraftforge.fml.client.ClientHooks.firePlayerLogin(this.field_147299_f.field_71442_b, this.field_147299_f.field_71439_g, this.field_147299_f.func_147114_u().func_147298_b()); - 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); -@@ -372,6 +373,7 @@ - this.field_147299_f.field_71439_g.func_175150_k(p_147282_1_.func_179744_h()); - 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()); -+ net.minecraftforge.fml.network.NetworkHooks.sendMCRegistryPackets(field_147302_e, "PLAY_TO_SERVER"); - 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(); -@@ -727,7 +729,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) { -- tileentity.func_145839_a(compoundnbt); -+ tileentity.handleUpdateTag(compoundnbt); - } - } - -@@ -803,7 +805,9 @@ - - public void func_147251_a(SChatPacket p_147251_1_) { - PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f); -- this.field_147299_f.field_71456_v.func_191742_a(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c()); -+ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c()); -+ if (message == null) return; -+ this.field_147299_f.field_71456_v.func_191742_a(p_147251_1_.func_192590_c(), message); - } - - public void func_147279_a(SAnimateHandPacket p_147279_1_) { -@@ -983,8 +987,10 @@ - this.field_147299_f.field_175622_Z = clientplayerentity1; - clientplayerentity1.func_184212_Q().func_187218_a(clientplayerentity.func_184212_Q().func_187231_c()); - clientplayerentity1.func_110140_aT().func_226303_a_(clientplayerentity.func_110140_aT()); -+ clientplayerentity1.updateSyncFields(clientplayerentity); // Forge: fix MC-10657 - clientplayerentity1.func_70065_x(); - clientplayerentity1.func_175158_f(s); -+ net.minecraftforge.fml.client.ClientHooks.firePlayerRespawn(this.field_147299_f.field_71442_b, clientplayerentity, clientplayerentity1, clientplayerentity1.field_71174_a.func_147298_b()); - 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); -@@ -1105,6 +1111,12 @@ - boolean flag = i == 2 && tileentity instanceof CommandBlockTileEntity; - if (i == 1 && tileentity instanceof MobSpawnerTileEntity || flag || i == 3 && tileentity instanceof BeaconTileEntity || i == 4 && tileentity instanceof SkullTileEntity || i == 6 && tileentity instanceof BannerTileEntity || i == 7 && tileentity instanceof StructureBlockTileEntity || i == 8 && tileentity instanceof EndGatewayTileEntity || i == 9 && tileentity instanceof SignTileEntity || i == 11 && tileentity instanceof BedTileEntity || i == 5 && tileentity instanceof ConduitTileEntity || i == 12 && tileentity instanceof JigsawTileEntity || i == 13 && tileentity instanceof CampfireTileEntity || i == 14 && tileentity instanceof BeehiveTileEntity) { - tileentity.func_145839_a(p_147273_1_.func_148857_g()); -+ } else { -+ if(tileentity == null) { -+ field_147301_d.error("Received invalid update packet for null tile entity at {} with data: {}", p_147273_1_.func_179823_a(), p_147273_1_.func_148857_g()); -+ return; -+ } -+ tileentity.onDataPacket(field_147302_e, p_147273_1_); - } - - if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) { -@@ -1276,6 +1288,7 @@ - clientrecipebook.func_199644_c(); - 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_) { -@@ -1356,7 +1369,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) { -- Effect effect = Effect.func_188412_a(p_147260_1_.func_149427_e()); -+ Effect effect = Effect.func_188412_a(p_147260_1_.func_149427_e() & 0xFF); - 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()); -@@ -1376,6 +1389,7 @@ - } - - this.field_147299_f.func_213253_a(SearchTreeManager.field_215360_b).func_194040_a(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this.field_199725_m)); - } - - public void func_175098_a(SCombatPacket p_175098_1_) { -@@ -1851,10 +1865,12 @@ - int l5 = packetbuffer.readInt(); - this.field_147299_f.field_184132_p.field_229018_q_.func_229022_a_(blockpos7, l3, s10, l5); - } else { -- field_147301_d.warn("Unknown custom packed identifier: {}", (Object)resourcelocation); -+ if (!net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(p_147240_1_, this.field_147302_e)) -+ field_147301_d.warn("Unknown custom packet identifier: {}", (Object)resourcelocation); - } - } finally { - if (packetbuffer != null) { -+ if (false) // Forge: let packet handle releasing buffer - packetbuffer.release(); - } - -@@ -1994,7 +2010,7 @@ - for(SEntityPropertiesPacket.Snapshot sentitypropertiespacket$snapshot : p_147290_1_.func_149441_d()) { - IAttributeInstance iattributeinstance = abstractattributemap.func_111152_a(sentitypropertiespacket$snapshot.func_151409_a()); - if (iattributeinstance == null) { -- iattributeinstance = abstractattributemap.func_111150_b(new RangedAttribute((IAttribute)null, sentitypropertiespacket$snapshot.func_151409_a(), 0.0D, Double.MIN_NORMAL, Double.MAX_VALUE)); -+ iattributeinstance = abstractattributemap.func_111150_b(new RangedAttribute((IAttribute)null, sentitypropertiespacket$snapshot.func_151409_a(), 0.0D, -Double.MAX_VALUE, Double.MAX_VALUE)); // FORGE: fix invalid value range (MC-150405) - } - - iattributeinstance.func_111128_a(sentitypropertiespacket$snapshot.func_151410_b()); diff --git a/patches/minecraft/net/minecraft/client/renderer/FluidBlockRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/FluidBlockRenderer.java.patch similarity index 88% rename from patches/minecraft/net/minecraft/client/renderer/FluidBlockRenderer.java.patch rename to patches_old/minecraft/net/minecraft/client/renderer/FluidBlockRenderer.java.patch index 20c99725d..d411af522 100644 --- a/patches/minecraft/net/minecraft/client/renderer/FluidBlockRenderer.java.patch +++ b/patches_old/minecraft/net/minecraft/client/renderer/FluidBlockRenderer.java.patch @@ -1,21 +1,21 @@ --- a/net/minecraft/client/renderer/FluidBlockRenderer.java +++ b/net/minecraft/client/renderer/FluidBlockRenderer.java -@@ -70,9 +70,10 @@ +@@ -57,8 +57,9 @@ - public boolean func_228796_a_(IBlockDisplayReader p_228796_1_, BlockPos p_228796_2_, IVertexBuilder p_228796_3_, FluidState p_228796_4_) { + public boolean func_228796_a_(ILightReader p_228796_1_, BlockPos p_228796_2_, IVertexBuilder p_228796_3_, IFluidState p_228796_4_) { boolean flag = p_228796_4_.func_206884_a(FluidTags.field_206960_b); - TextureAtlasSprite[] atextureatlassprite = flag ? this.field_178272_a : this.field_178271_b; +- int i = flag ? 16777215 : BiomeColors.func_228363_c_(p_228796_1_, p_228796_2_); + TextureAtlasSprite[] atextureatlassprite = net.minecraftforge.client.ForgeHooksClient.getFluidSprites(p_228796_1_, p_228796_2_, p_228796_4_); - BlockState blockstate = p_228796_1_.func_180495_p(p_228796_2_); - int i = flag ? 16777215 : BiomeColors.func_228363_c_(p_228796_1_, p_228796_2_); ++ int i = p_228796_4_.func_206886_c().getAttributes().getColor(p_228796_1_, p_228796_2_); + float alpha = (float)(i >> 24 & 255) / 255.0F; float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; -@@ -157,15 +158,15 @@ - float f25 = f4 * f; - float f26 = f4 * f1; - float f27 = f4 * f2; +@@ -143,15 +144,15 @@ + float f25 = 1.0F * f; + float f26 = 1.0F * f1; + float f27 = 1.0F * f2; - this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, f13, f17, j); - this.func_228797_a_(p_228796_3_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j); - this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j); @@ -36,10 +36,10 @@ } } -@@ -178,10 +179,10 @@ - float f40 = f3 * f; - float f41 = f3 * f1; - float f42 = f3 * f2; +@@ -164,10 +165,10 @@ + float f40 = 0.5F * f; + float f41 = 0.5F * f1; + float f42 = 0.5F * f2; - this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2 + 1.0D, f40, f41, f42, f34, f39, i1); - this.func_228797_a_(p_228796_3_, d0, d1 + (double)f12, d2, f40, f41, f42, f34, f37, i1); - this.func_228797_a_(p_228796_3_, d0 + 1.0D, d1 + (double)f12, d2, f40, f41, f42, f35, f37, i1); @@ -51,13 +51,13 @@ flag7 = true; } -@@ -236,10 +237,9 @@ +@@ -222,10 +223,9 @@ flag7 = true; BlockPos blockpos = p_228796_2_.func_177972_a(direction); TextureAtlasSprite textureatlassprite2 = atextureatlassprite[1]; - if (!flag) { - Block block = p_228796_1_.func_180495_p(blockpos).func_177230_c(); -- if (block instanceof BreakableBlock || block instanceof LeavesBlock) { +- if (block == Blocks.field_150359_w || block instanceof StainedGlassBlock) { - textureatlassprite2 = this.field_187501_d; + if (atextureatlassprite[2] != null) { + if (p_228796_1_.func_180495_p(blockpos).shouldDisplayFluidOverlay(p_228796_1_, blockpos, p_228796_4_)) { @@ -65,10 +65,10 @@ } } -@@ -253,15 +253,15 @@ - float f31 = f4 * f30 * f; - float f32 = f4 * f30 * f1; - float f33 = f4 * f30 * f2; +@@ -239,15 +239,15 @@ + float f31 = 1.0F * f30 * f; + float f32 = 1.0F * f30 * f1; + float f33 = 1.0F * f30 * f2; - this.func_228797_a_(p_228796_3_, d3, d1 + (double)f36, d4, f31, f32, f33, f48, f50, k); - this.func_228797_a_(p_228796_3_, d5, d1 + (double)f38, d6, f31, f32, f33, f49, f28, k); - this.func_228797_a_(p_228796_3_, d5, d1 + (double)f12, d6, f31, f32, f33, f49, f29, k); @@ -90,7 +90,7 @@ } } } -@@ -270,10 +270,15 @@ +@@ -256,10 +256,15 @@ } } @@ -104,6 +104,6 @@ + p_228797_1_.func_225582_a_(p_228797_2_, p_228797_4_, p_228797_6_).func_227885_a_(p_228797_8_, p_228797_9_, p_228797_10_, alpha).func_225583_a_(p_228797_11_, p_228797_12_).func_227886_a_(p_228797_13_).func_225584_a_(0.0F, 1.0F, 0.0F).func_181675_d(); + } + - private int func_228795_a_(IBlockDisplayReader p_228795_1_, BlockPos p_228795_2_) { + private int func_228795_a_(ILightReader p_228795_1_, BlockPos p_228795_2_) { int i = WorldRenderer.func_228421_a_(p_228795_1_, p_228795_2_); int j = WorldRenderer.func_228421_a_(p_228795_1_, p_228795_2_.func_177984_a()); diff --git a/patches_old/minecraft/net/minecraft/client/resources/FoliageColorReloadListener.java.patch b/patches_old/minecraft/net/minecraft/client/resources/FoliageColorReloadListener.java.patch deleted file mode 100644 index 05653b3b1..000000000 --- a/patches_old/minecraft/net/minecraft/client/resources/FoliageColorReloadListener.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/client/resources/FoliageColorReloadListener.java -+++ b/net/minecraft/client/resources/FoliageColorReloadListener.java -@@ -23,4 +23,9 @@ - protected void func_212853_a_(int[] p_212853_1_, IResourceManager p_212853_2_, IProfiler p_212853_3_) { - FoliageColors.func_77467_a(p_212853_1_); - } -+ -+ //@Override //Forge: TODO: Filtered resource reloading -+ public net.minecraftforge.resource.IResourceType getResourceType() { -+ return net.minecraftforge.resource.VanillaResourceType.TEXTURES; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/client/resources/GrassColorReloadListener.java.patch b/patches_old/minecraft/net/minecraft/client/resources/GrassColorReloadListener.java.patch deleted file mode 100644 index c6ec74d07..000000000 --- a/patches_old/minecraft/net/minecraft/client/resources/GrassColorReloadListener.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/client/resources/GrassColorReloadListener.java -+++ b/net/minecraft/client/resources/GrassColorReloadListener.java -@@ -23,4 +23,9 @@ - protected void func_212853_a_(int[] p_212853_1_, IResourceManager p_212853_2_, IProfiler p_212853_3_) { - GrassColors.func_77479_a(p_212853_1_); - } -+ -+ //@Override //Forge: TODO: Filtered resource reloading -+ public net.minecraftforge.resource.IResourceType getResourceType() { -+ return net.minecraftforge.resource.VanillaResourceType.TEXTURES; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/client/resources/I18n.java.patch b/patches_old/minecraft/net/minecraft/client/resources/I18n.java.patch deleted file mode 100644 index 093574f21..000000000 --- a/patches_old/minecraft/net/minecraft/client/resources/I18n.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/client/resources/I18n.java -+++ b/net/minecraft/client/resources/I18n.java -@@ -9,6 +9,7 @@ - - static void func_135051_a(Locale p_135051_0_) { - field_135054_a = p_135051_0_; -+ net.minecraftforge.fml.ForgeI18n.loadLanguageData(field_135054_a.field_135032_a); - } - - public static String func_135052_a(String p_135052_0_, Object... p_135052_1_) { diff --git a/patches_old/minecraft/net/minecraft/client/resources/JsonReloadListener.java.patch b/patches_old/minecraft/net/minecraft/client/resources/JsonReloadListener.java.patch deleted file mode 100644 index 769f14d8c..000000000 --- a/patches_old/minecraft/net/minecraft/client/resources/JsonReloadListener.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/client/resources/JsonReloadListener.java -+++ b/net/minecraft/client/resources/JsonReloadListener.java -@@ -61,4 +61,8 @@ - - return map; - } -+ -+ protected ResourceLocation getPreparedPath(ResourceLocation rl) { -+ return new ResourceLocation(rl.func_110624_b(), this.field_223383_d + "/" + rl.func_110623_a() + ".json"); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/client/resources/Language.java.patch b/patches_old/minecraft/net/minecraft/client/resources/Language.java.patch deleted file mode 100644 index fd7f9dc96..000000000 --- a/patches_old/minecraft/net/minecraft/client/resources/Language.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/net/minecraft/client/resources/Language.java -+++ b/net/minecraft/client/resources/Language.java -@@ -15,6 +15,12 @@ - this.field_135037_b = p_i1303_2_; - this.field_135038_c = p_i1303_3_; - this.field_135036_d = p_i1303_4_; -+ String[] splitLangCode = field_135038_c.split("_", 2); -+ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores -+ this.javaLocale = new java.util.Locale(field_135039_a); -+ } else { -+ this.javaLocale = new java.util.Locale(splitLangCode[0], splitLangCode[1]); -+ } - } - - public String getCode() { -@@ -52,4 +58,8 @@ - public int compareTo(Language p_compareTo_1_) { - return this.field_135039_a.compareTo(p_compareTo_1_.field_135039_a); - } -+ -+ // Forge: add access to Locale so modders can create correct string and number formatters -+ private final java.util.Locale javaLocale; -+ public java.util.Locale getJavaLocale() { return javaLocale; } - } diff --git a/patches_old/minecraft/net/minecraft/client/resources/LanguageManager.java.patch b/patches_old/minecraft/net/minecraft/client/resources/LanguageManager.java.patch deleted file mode 100644 index f0f65dfcb..000000000 --- a/patches_old/minecraft/net/minecraft/client/resources/LanguageManager.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/client/resources/LanguageManager.java -+++ b/net/minecraft/client/resources/LanguageManager.java -@@ -79,4 +79,9 @@ - public Language func_191960_a(String p_191960_1_) { - return this.field_135046_d.get(p_191960_1_); - } -+ -+ @Override -+ public net.minecraftforge.resource.IResourceType getResourceType() { -+ return net.minecraftforge.resource.VanillaResourceType.LANGUAGES; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch b/patches_old/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch deleted file mode 100644 index 464d7dd5e..000000000 --- a/patches_old/minecraft/net/minecraft/client/shader/ShaderInstance.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/net/minecraft/client/shader/ShaderInstance.java -+++ b/net/minecraft/client/shader/ShaderInstance.java -@@ -50,7 +50,8 @@ - private final ShaderLoader field_216563_s; - - public ShaderInstance(IResourceManager p_i50988_1_, String p_i50988_2_) throws IOException { -- ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_i50988_2_ + ".json"); -+ ResourceLocation rl = ResourceLocation.func_208304_a(p_i50988_2_); -+ ResourceLocation resourcelocation = new ResourceLocation(rl.func_110624_b(), "shaders/program/" + rl.func_110623_a() + ".json"); - this.field_216556_l = p_i50988_2_; - IResource iresource = null; - -@@ -142,7 +143,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) { -- ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_216542_2_ + p_216542_1_.func_148063_b()); -+ ResourceLocation rl = ResourceLocation.func_208304_a(p_216542_2_); -+ ResourceLocation resourcelocation = new ResourceLocation(rl.func_110624_b(), "shaders/program/" + rl.func_110623_a() + p_216542_1_.func_148063_b()); - IResource iresource = p_216542_0_.func_199002_a(resourcelocation); - - try { diff --git a/patches_old/minecraft/net/minecraft/client/util/SearchTreeManager.java.patch b/patches_old/minecraft/net/minecraft/client/util/SearchTreeManager.java.patch deleted file mode 100644 index e821230c2..000000000 --- a/patches_old/minecraft/net/minecraft/client/util/SearchTreeManager.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/client/util/SearchTreeManager.java -+++ b/net/minecraft/client/util/SearchTreeManager.java -@@ -31,6 +31,11 @@ - return (IMutableSearchTree) this.field_194013_c.get(p_215358_1_); - } - -+ @Override -+ public net.minecraftforge.resource.IResourceType getResourceType() { -+ return net.minecraftforge.resource.VanillaResourceType.LANGUAGES; -+ } -+ - @OnlyIn(Dist.CLIENT) - public static class Key { - } diff --git a/patches_old/minecraft/net/minecraft/client/world/ClientWorld.java.patch b/patches_old/minecraft/net/minecraft/client/world/ClientWorld.java.patch deleted file mode 100644 index a07b850b4..000000000 --- a/patches_old/minecraft/net/minecraft/client/world/ClientWorld.java.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- a/net/minecraft/client/world/ClientWorld.java -+++ b/net/minecraft/client/world/ClientWorld.java -@@ -103,6 +103,8 @@ - this.func_175652_B(new BlockPos(8, 64, 8)); - this.func_72966_v(); - this.func_72947_a(); -+ this.gatherCapabilities(field_73011_w.initCapabilities()); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this)); - } - - public void func_72835_b(BooleanSupplier p_72835_1_) { -@@ -127,6 +129,7 @@ - Entity entity = this.field_217428_a.get(i); - this.func_217390_a((p_228325_0_) -> { - ++p_228325_0_.field_70173_aa; -+ if (p_228325_0_.canUpdate()) - p_228325_0_.func_70071_h_(); - }, entity); - if (entity.field_70128_L) { -@@ -172,6 +175,7 @@ - this.func_217381_Z().func_194340_a(() -> { - return Registry.field_212629_r.func_177774_c(p_217418_1_.func_200600_R()).toString(); - }); -+ if (p_217418_1_.canUpdate()) - p_217418_1_.func_70071_h_(); - this.func_217381_Z().func_76319_b(); - } -@@ -289,9 +293,11 @@ - } - - private void func_217424_b(int p_217424_1_, Entity p_217424_2_) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_217424_2_, this))) return; - this.func_217413_d(p_217424_1_); - this.field_217429_b.put(p_217424_1_, p_217424_2_); - this.func_72863_F().func_212849_a_(MathHelper.func_76128_c(p_217424_2_.func_226277_ct_() / 16.0D), MathHelper.func_76128_c(p_217424_2_.func_226281_cx_() / 16.0D), ChunkStatus.field_222617_m, true).func_76612_a(p_217424_2_); -+ p_217424_2_.onAddedToWorld(); - } - - public void func_217413_d(int p_217413_1_) { -@@ -310,6 +316,7 @@ - } - - this.field_217431_w.remove(p_217414_1_); -+ p_217414_1_.onRemovedFromWorld(); - } - - public void func_217417_b(Chunk p_217417_1_) { -@@ -443,6 +450,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_) { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_); -+ if (event.isCanceled() || event.getSound() == null) return; -+ p_184148_8_ = event.getSound(); -+ p_184148_9_ = event.getCategory(); -+ p_184148_10_ = event.getVolume(); - 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); - } -@@ -450,6 +462,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_) { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_217384_1_, p_217384_3_, p_217384_4_, p_217384_5_, p_217384_6_); -+ if (event.isCanceled() || event.getSound() == null) return; -+ p_217384_3_ = event.getSound(); -+ p_217384_4_ = event.getCategory(); -+ p_217384_5_ = event.getVolume(); - if (p_217384_1_ == this.field_73037_M.field_71439_g) { - this.field_73037_M.func_147118_V().func_147682_a(new EntityTickableSound(p_217384_3_, p_217384_4_, p_217384_2_)); - } diff --git a/patches_old/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch b/patches_old/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch deleted file mode 100644 index 431af2cc0..000000000 --- a/patches_old/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/command/arguments/EntitySelectorParser.java -+++ b/net/minecraft/command/arguments/EntitySelectorParser.java -@@ -448,6 +448,9 @@ - } - - this.field_197417_j.skip(); -+ EntitySelector forgeSelector = net.minecraftforge.common.command.EntitySelectorManager.parseSelector(this); -+ if (forgeSelector != null) -+ return forgeSelector; - this.func_197403_b(); - } else { - this.func_197382_c(); -@@ -463,6 +466,7 @@ - p_210326_0_.suggest("@r", new TranslationTextComponent("argument.entity.selector.randomPlayer")); - p_210326_0_.suggest("@s", new TranslationTextComponent("argument.entity.selector.self")); - p_210326_0_.suggest("@e", new TranslationTextComponent("argument.entity.selector.allEntities")); -+ net.minecraftforge.common.command.EntitySelectorManager.fillSelectorSuggestions(p_210326_0_); - } - - private CompletableFuture func_201981_b(SuggestionsBuilder p_201981_1_, Consumer p_201981_2_) { diff --git a/patches_old/minecraft/net/minecraft/command/impl/TeleportCommand.java.patch b/patches_old/minecraft/net/minecraft/command/impl/TeleportCommand.java.patch deleted file mode 100644 index 2b447db97..000000000 --- a/patches_old/minecraft/net/minecraft/command/impl/TeleportCommand.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/command/impl/TeleportCommand.java -+++ b/net/minecraft/command/impl/TeleportCommand.java -@@ -151,7 +151,6 @@ - p_201127_1_.func_70012_b(p_201127_3_, p_201127_5_, p_201127_7_, f1, f); - p_201127_1_.func_70034_d(f1); - p_201127_2_.func_217460_e(p_201127_1_); -- entity.field_70128_L = true; - } - } - diff --git a/patches_old/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches_old/minecraft/net/minecraft/crash/CrashReport.java.patch deleted file mode 100644 index ddb7179f2..000000000 --- a/patches_old/minecraft/net/minecraft/crash/CrashReport.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/net/minecraft/crash/CrashReport.java -+++ b/net/minecraft/crash/CrashReport.java -@@ -69,6 +69,7 @@ - List list = Util.func_211565_f().collect(Collectors.toList()); - return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" "))); - }); -+ net.minecraftforge.fml.CrashReportExtender.enhanceCrashReport(this, this.field_85061_c); - } - - public String func_71501_a() { -@@ -121,23 +122,13 @@ - throwable.setStackTrace(this.field_71511_b.getStackTrace()); - } - -- String s; -- try { -- stringwriter = new StringWriter(); -- printwriter = new PrintWriter(stringwriter); -- throwable.printStackTrace(printwriter); -- s = stringwriter.toString(); -- } finally { -- IOUtils.closeQuietly((Writer)stringwriter); -- IOUtils.closeQuietly((Writer)printwriter); -- } -- -- return s; -+ return net.minecraftforge.fml.CrashReportExtender.generateEnhancedStackTrace(throwable); - } - - public String func_71502_e() { - StringBuilder stringbuilder = new StringBuilder(); - stringbuilder.append("---- Minecraft Crash Report ----\n"); -+ net.minecraftforge.fml.CrashReportExtender.addCrashReportHeader(stringbuilder, this); - stringbuilder.append("// "); - stringbuilder.append(func_71503_h()); - stringbuilder.append("\n\n"); diff --git a/patches_old/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches_old/minecraft/net/minecraft/crash/CrashReportCategory.java.patch deleted file mode 100644 index 51237b55f..000000000 --- a/patches_old/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/crash/CrashReportCategory.java -+++ b/net/minecraft/crash/CrashReportCategory.java -@@ -100,8 +100,10 @@ - if (astacktraceelement.length <= 0) { - return 0; - } else { -- this.field_85075_d = new StackTraceElement[astacktraceelement.length - 3 - p_85073_1_]; -- System.arraycopy(astacktraceelement, 3 + p_85073_1_, this.field_85075_d, 0, this.field_85075_d.length); -+ int len = astacktraceelement.length - 3 - p_85073_1_; -+ if (len <= 0) len = astacktraceelement.length; -+ this.field_85075_d = new StackTraceElement[len]; -+ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.field_85075_d, 0, this.field_85075_d.length); - return this.field_85075_d.length; - } - } diff --git a/patches_old/minecraft/net/minecraft/data/DataGenerator.java.patch b/patches_old/minecraft/net/minecraft/data/DataGenerator.java.patch deleted file mode 100644 index 142ef9d05..000000000 --- a/patches_old/minecraft/net/minecraft/data/DataGenerator.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/net/minecraft/data/DataGenerator.java -+++ b/net/minecraft/data/DataGenerator.java -@@ -16,10 +16,11 @@ - private final Collection field_200394_b; - private final Path field_200395_c; - private final List field_200396_d = Lists.newArrayList(); -+ private final List providerView = java.util.Collections.unmodifiableList(field_200396_d); - - public DataGenerator(Path p_i48266_1_, Collection p_i48266_2_) { - this.field_200395_c = p_i48266_1_; -- this.field_200394_b = p_i48266_2_; -+ this.field_200394_b = Lists.newArrayList(p_i48266_2_); - } - - public Collection func_200389_a() { -@@ -38,6 +39,7 @@ - - for(IDataProvider idataprovider : this.field_200396_d) { - field_200393_a.info("Starting provider: {}", (Object)idataprovider.func_200397_b()); -+ net.minecraftforge.fml.StartupMessageManager.addModMessage("Generating: " + idataprovider.func_200397_b()); - stopwatch1.start(); - idataprovider.func_200398_a(directorycache); - stopwatch1.stop(); -@@ -53,6 +55,14 @@ - this.field_200396_d.add(p_200390_1_); - } - -+ public List getProviders() { -+ return this.providerView; -+ } -+ -+ public void addInput(Path value) { -+ this.field_200394_b.add(value); -+ } -+ - static { - Bootstrap.func_151354_b(); - } diff --git a/patches_old/minecraft/net/minecraft/data/DirectoryCache.java.patch b/patches_old/minecraft/net/minecraft/data/DirectoryCache.java.patch deleted file mode 100644 index db262a25d..000000000 --- a/patches_old/minecraft/net/minecraft/data/DirectoryCache.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/data/DirectoryCache.java -+++ b/net/minecraft/data/DirectoryCache.java -@@ -23,7 +23,7 @@ - private final Path field_208326_c; - private int field_208327_d; - private final Map field_208328_e = Maps.newHashMap(); -- private final Map field_208329_f = Maps.newHashMap(); -+ private final Map field_208329_f = Maps.newTreeMap(); //Forge: TreeMap, makes the file output predictable/sorted. - private final Set field_218457_g = Sets.newHashSet(); - - public DirectoryCache(Path p_i49352_1_, String p_i49352_2_) throws IOException { -@@ -55,7 +55,7 @@ - } - - IOUtils.writeLines(this.field_208329_f.entrySet().stream().map((p_208319_1_) -> { -- return (String)p_208319_1_.getValue() + ' ' + this.field_208325_b.relativize(p_208319_1_.getKey()); -+ return (String)p_208319_1_.getValue() + ' ' + this.field_208325_b.relativize(p_208319_1_.getKey()).toString().replace('\\', '/'); //Forge: Standardize file paths. - }).collect(Collectors.toList()), System.lineSeparator(), writer); - writer.close(); - field_208324_a.debug("Caching: cache hits: {}, created: {} removed: {}", this.field_208327_d, this.field_208329_f.size() - this.field_208327_d, this.field_208328_e.size()); diff --git a/patches_old/minecraft/net/minecraft/data/LootTableProvider.java.patch b/patches_old/minecraft/net/minecraft/data/LootTableProvider.java.patch deleted file mode 100644 index fa26229b8..000000000 --- a/patches_old/minecraft/net/minecraft/data/LootTableProvider.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/net/minecraft/data/LootTableProvider.java -+++ b/net/minecraft/data/LootTableProvider.java -@@ -42,7 +42,7 @@ - public void func_200398_a(DirectoryCache p_200398_1_) { - Path path = this.field_218443_d.func_200391_b(); - Map map = Maps.newHashMap(); -- this.field_218444_e.forEach((p_218438_1_) -> { -+ this.getTables().forEach((p_218438_1_) -> { - p_218438_1_.getFirst().get().accept((p_218437_2_, p_218437_3_) -> { - if (map.put(p_218437_2_, p_218437_3_.func_216039_a(p_218438_1_.getSecond()).func_216038_b()) != null) { - throw new IllegalStateException("Duplicate loot table " + p_218437_2_); -@@ -53,13 +53,8 @@ - return null; - }, map::get); - -- for(ResourceLocation resourcelocation : Sets.difference(LootTables.func_215796_a(), map.keySet())) { -- validationtracker.func_227530_a_("Missing built-in table: " + resourcelocation); -- } -+ validate(map, validationtracker); - -- map.forEach((p_229439_1_, p_229439_2_) -> { -- LootTableManager.func_227508_a_(validationtracker, p_229439_1_, p_229439_2_); -- }); - Multimap multimap = validationtracker.func_227527_a_(); - if (!multimap.isEmpty()) { - multimap.forEach((p_229440_0_, p_229440_1_) -> { -@@ -80,6 +75,20 @@ - } - } - -+ protected List>>, LootParameterSet>> getTables() { -+ return field_218444_e; -+ } -+ -+ protected void validate(Map map, ValidationTracker validationtracker) { -+ for(ResourceLocation resourcelocation : Sets.difference(LootTables.func_215796_a(), map.keySet())) { -+ validationtracker.func_227530_a_("Missing built-in table: " + resourcelocation); -+ } -+ -+ map.forEach((p_218436_2_, p_218436_3_) -> { -+ LootTableManager.func_227508_a_(validationtracker, p_218436_2_, p_218436_3_); -+ }); -+ } -+ - private static Path func_218439_a(Path p_218439_0_, ResourceLocation p_218439_1_) { - return p_218439_0_.resolve("data/" + p_218439_1_.func_110624_b() + "/loot_tables/" + p_218439_1_.func_110623_a() + ".json"); - } diff --git a/patches_old/minecraft/net/minecraft/data/Main.java.patch b/patches_old/minecraft/net/minecraft/data/Main.java.patch deleted file mode 100644 index 24c6b3f1d..000000000 --- a/patches_old/minecraft/net/minecraft/data/Main.java.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/net/minecraft/data/Main.java -+++ b/net/minecraft/data/Main.java -@@ -21,8 +21,12 @@ - OptionSpec optionspec6 = optionparser.accepts("all", "Include all generators"); - OptionSpec optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated"); - OptionSpec optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg(); -+ OptionSpec existing = optionparser.accepts("existing", "Existing resource packs that generated resources can reference").withRequiredArg(); -+ OptionSpec gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(java.io.File.class).defaultsTo(new java.io.File(".")).required(); //Need by modlauncher, so lets just eat it -+ OptionSpec mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(","); -+ OptionSpec flat = optionparser.accepts("flat", "Do not append modid prefix to output directory when generating for multiple mods"); - OptionSet optionset = optionparser.parse(p_main_0_); -- if (!optionset.has(optionspec) && optionset.hasOptions()) { -+ if (!optionset.has(optionspec) && optionset.hasOptions() && !(optionset.specs().size() == 1 && optionset.has(gameDir))) { - Path path = Paths.get(optionspec7.value(optionset)); - boolean flag = optionset.has(optionspec6); - boolean flag1 = flag || optionset.has(optionspec2); -@@ -30,10 +34,13 @@ - boolean flag3 = flag || optionset.has(optionspec3); - boolean flag4 = flag || optionset.has(optionspec4); - boolean flag5 = flag || optionset.has(optionspec5); -- DataGenerator datagenerator = func_200264_a(path, optionset.valuesOf(optionspec8).stream().map((p_200263_0_) -> { -- return Paths.get(p_200263_0_); -- }).collect(Collectors.toList()), flag1, flag2, flag3, flag4, flag5); -- datagenerator.func_200392_c(); -+ Collection inputs = optionset.valuesOf(optionspec8).stream().map(Paths::get).collect(Collectors.toList()); -+ Collection existingPacks = optionset.valuesOf(existing).stream().map(Paths::get).collect(Collectors.toList()); -+ java.util.Set mods = new java.util.HashSet<>(optionset.valuesOf(mod)); -+ boolean isFlat = mods.isEmpty() || optionset.has(flat); -+ net.minecraftforge.fml.ModLoader.get().runDataGenerator(mods, path, inputs, existingPacks, flag2, flag1, flag3, flag4, flag5, isFlat); -+ if (mods.contains("minecraft") || mods.isEmpty()) -+ func_200264_a(isFlat ? path : path.resolve("minecraft"), inputs, flag1, flag2, flag3, flag4, flag5).func_200392_c(); - } else { - optionparser.printHelpOn(System.out); - } diff --git a/patches_old/minecraft/net/minecraft/data/RecipeProvider.java.patch b/patches_old/minecraft/net/minecraft/data/RecipeProvider.java.patch deleted file mode 100644 index 7bf7bb49c..000000000 --- a/patches_old/minecraft/net/minecraft/data/RecipeProvider.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/data/RecipeProvider.java -+++ b/net/minecraft/data/RecipeProvider.java -@@ -57,6 +57,7 @@ - - } - }); -+ if (this.getClass() == RecipeProvider.class) //Forge: Subclasses don't need this. - this.func_208310_b(p_200398_1_, Advancement.Builder.func_200278_a().func_200275_a("impossible", new ImpossibleTrigger.Instance()).func_200273_b(), path.resolve("data/minecraft/advancements/recipes/root.json")); - } - diff --git a/patches_old/minecraft/net/minecraft/data/TagsProvider.java.patch b/patches_old/minecraft/net/minecraft/data/TagsProvider.java.patch deleted file mode 100644 index c62e9d5bd..000000000 --- a/patches_old/minecraft/net/minecraft/data/TagsProvider.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/data/TagsProvider.java -+++ b/net/minecraft/data/TagsProvider.java -@@ -48,6 +48,7 @@ - tagcollection.func_200039_c().forEach((p_223474_2_, p_223474_3_) -> { - JsonObject jsonobject = p_223474_3_.func_200571_a(this.field_200435_c::func_177774_c); - Path path = this.func_200431_a(p_223474_2_); -+ if (path == null) return; //Forge: Allow running this data provider without writing it. Recipe provider needs valid tags. - - try { - String s = field_200437_e.toJson((JsonElement)jsonobject); diff --git a/patches_old/minecraft/net/minecraft/data/loot/BlockLootTables.java.patch b/patches_old/minecraft/net/minecraft/data/loot/BlockLootTables.java.patch deleted file mode 100644 index 3301eee73..000000000 --- a/patches_old/minecraft/net/minecraft/data/loot/BlockLootTables.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/net/minecraft/data/loot/BlockLootTables.java -+++ b/net/minecraft/data/loot/BlockLootTables.java -@@ -204,7 +204,7 @@ - return LootTable.func_216119_b(); - } - -- public void accept(BiConsumer p_accept_1_) { -+ protected void addTables() { - this.func_218492_c(Blocks.field_196650_c); - this.func_218492_c(Blocks.field_196652_d); - this.func_218492_c(Blocks.field_196654_e); -@@ -976,9 +976,13 @@ - this.func_218507_a(Blocks.field_150414_aQ, func_218482_a()); - this.func_218507_a(Blocks.field_185778_de, func_218482_a()); - this.func_218507_a(Blocks.field_150474_ac, func_218482_a()); -+ } -+ -+ public void accept(BiConsumer p_accept_1_) { -+ this.addTables(); - Set set = Sets.newHashSet(); - -- for(Block block : Registry.field_212618_g) { -+ for(Block block : getKnownBlocks()) { - ResourceLocation resourcelocation = block.func_220068_i(); - if (resourcelocation != LootTables.field_186419_a && set.add(resourcelocation)) { - LootTable.Builder loottable$builder = this.field_218581_i.remove(resourcelocation); -@@ -995,6 +999,10 @@ - } - } - -+ protected Iterable getKnownBlocks() { -+ return Registry.field_212618_g; -+ } -+ - public void func_218547_a(Block p_218547_1_) { - this.func_218522_a(p_218547_1_, (p_229438_0_) -> { - return func_218523_c(((FlowerPotBlock)p_229438_0_).func_220276_d()); diff --git a/patches_old/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch b/patches_old/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch deleted file mode 100644 index 793278692..000000000 --- a/patches_old/minecraft/net/minecraft/data/loot/EntityLootTables.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- a/net/minecraft/data/loot/EntityLootTables.java -+++ b/net/minecraft/data/loot/EntityLootTables.java -@@ -51,7 +51,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()))); - } - -- public void accept(BiConsumer p_accept_1_) { -+ protected void addTables() { - 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()); -@@ -137,8 +137,12 @@ - this.func_218582_a(EntityType.field_200726_aE, 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)))))); - this.func_218582_a(EntityType.field_200785_Y, 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, 1.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_151074_bl).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))))).func_216040_a(LootPool.func_216096_a().func_216046_a(ConstantRange.func_215835_a(1)).func_216045_a(ItemLootEntry.func_216168_a(Items.field_151043_k)).func_212840_b_(KilledByPlayer.func_215994_b()).func_212840_b_(RandomChanceWithLooting.func_216003_a(0.025F, 0.01F)))); - 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; -@@ -150,7 +154,7 @@ - - entitytype = (EntityType)iterator.next(); - 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; - } -@@ -167,6 +171,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))); - } - -+ protected Iterable> getKnownEntities() { -+ return Registry.field_212629_r; -+ } -+ -+ protected boolean isNonLiving(EntityType entitytype) { -+ 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_) { - this.func_218585_a(p_218582_1_.func_220348_g(), p_218582_2_); - } diff --git a/patches_old/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch b/patches_old/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch deleted file mode 100644 index ca367b12c..000000000 --- a/patches_old/minecraft/net/minecraft/dispenser/IDispenseItemBehavior.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/net/minecraft/dispenser/IDispenseItemBehavior.java -+++ b/net/minecraft/dispenser/IDispenseItemBehavior.java -@@ -295,8 +295,9 @@ - world.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P()); - } else if (FlintAndSteelItem.func_219997_a(blockstate)) { - world.func_175656_a(blockpos, blockstate.func_206870_a(BlockStateProperties.field_208190_q, Boolean.valueOf(true))); -- } else if (blockstate.func_177230_c() instanceof TNTBlock) { -- TNTBlock.func_196534_a(world, blockpos); -+ } else if (blockstate.isFlammable(world, blockpos, p_82487_1_.func_189992_e().func_177229_b(DispenserBlock.field_176441_a).func_176734_d())) { -+ blockstate.catchFire(world, blockpos, p_82487_1_.func_189992_e().func_177229_b(DispenserBlock.field_176441_a).func_176734_d(), null); -+ if (blockstate.func_177230_c() instanceof TNTBlock) - world.func_217377_a(blockpos, false); - } else { - this.field_218407_b = false; -@@ -426,15 +427,23 @@ - } - }); - DispenserBlock.func_199774_a(Items.field_151097_aZ.func_199767_j(), new OptionalDispenseBehavior() { -+ @SuppressWarnings("deprecation") - protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) { - World world = p_82487_1_.func_197524_h(); - if (!world.func_201670_d()) { - this.field_218407_b = false; - BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(p_82487_1_.func_189992_e().func_177229_b(DispenserBlock.field_176441_a)); - -- for(SheepEntity sheepentity : world.func_217357_a(SheepEntity.class, new AxisAlignedBB(blockpos))) { -- if (sheepentity.func_70089_S() && !sheepentity.func_70892_o() && !sheepentity.func_70631_g_()) { -- sheepentity.func_213612_dV(); -+ for(net.minecraft.entity.Entity entity : world.func_175674_a((net.minecraft.entity.Entity)null, new AxisAlignedBB(blockpos), e -> !e.func_175149_v() && e instanceof net.minecraftforge.common.IShearable)) { -+ net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)entity; -+ if (target.isShearable(p_82487_2_, world, blockpos)) { -+ java.util.List drops = target.onSheared(p_82487_2_, entity.field_70170_p, blockpos, -+ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantments.field_185308_t, p_82487_2_)); -+ java.util.Random rand = new java.util.Random(); -+ drops.forEach(d -> { -+ net.minecraft.entity.item.ItemEntity ent = entity.func_70099_a(d, 1.0F); -+ ent.func_213317_d(ent.func_213322_ci().func_72441_c((double)((rand.nextFloat() - rand.nextFloat()) * 0.1F), (double)(rand.nextFloat() * 0.05F), (double)((rand.nextFloat() - rand.nextFloat()) * 0.1F))); -+ }); - if (p_82487_2_.func_96631_a(1, world.field_73012_v, (ServerPlayerEntity)null)) { - p_82487_2_.func_190920_e(0); - } diff --git a/patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch deleted file mode 100644 index 9fb0bac15..000000000 --- a/patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/net/minecraft/enchantment/Enchantment.java -+++ b/net/minecraft/enchantment/Enchantment.java -@@ -17,7 +17,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public abstract class Enchantment { -+public abstract class Enchantment extends net.minecraftforge.registries.ForgeRegistryEntry { - private final EquipmentSlotType[] field_185263_a; - private final Enchantment.Rarity field_77333_a; - @Nullable -@@ -114,7 +114,7 @@ - } - - public boolean func_92089_a(ItemStack p_92089_1_) { -- return this.field_77351_y.func_77557_a(p_92089_1_.func_77973_b()); -+ return canApplyAtEnchantingTable(p_92089_1_); - } - - public void func_151368_a(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) { -@@ -131,6 +131,24 @@ - return false; - } - -+ /** -+ * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} -+ * applies for all possible enchantments. -+ * @param stack -+ * @return -+ */ -+ public boolean canApplyAtEnchantingTable(ItemStack stack) { -+ return stack.canApplyAtEnchantingTable(this); -+ } -+ -+ /** -+ * Is this enchantment allowed to be enchanted on books via Enchantment Table -+ * @return false to disable the vanilla feature -+ */ -+ public boolean isAllowedOnBooks() { -+ return true; -+ } -+ - public static enum Rarity { - COMMON(10), - UNCOMMON(5), diff --git a/patches_old/minecraft/net/minecraft/enchantment/EnchantmentType.java.patch b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentType.java.patch deleted file mode 100644 index 050831318..000000000 --- a/patches_old/minecraft/net/minecraft/enchantment/EnchantmentType.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/net/minecraft/enchantment/EnchantmentType.java -+++ b/net/minecraft/enchantment/EnchantmentType.java -@@ -14,7 +14,7 @@ - import net.minecraft.item.ToolItem; - import net.minecraft.item.TridentItem; - --public enum EnchantmentType { -+public enum EnchantmentType implements net.minecraftforge.common.IExtensibleEnum { - ALL { - public boolean func_77557_a(Item p_77557_1_) { - for(EnchantmentType enchantmenttype : EnchantmentType.values()) { -@@ -96,5 +96,16 @@ - private EnchantmentType() { - } - -- public abstract boolean func_77557_a(Item p_77557_1_); -+ private java.util.function.Predicate delegate; -+ private EnchantmentType(java.util.function.Predicate delegate) { -+ this.delegate = delegate; -+ } -+ -+ public static EnchantmentType create(String name, java.util.function.Predicate delegate) { -+ throw new IllegalStateException("Enum not extended"); -+ } -+ -+ public boolean func_77557_a(Item p_77557_1_) { -+ return this.delegate == null ? false : this.delegate.test(p_77557_1_); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/enchantment/Enchantments.java.patch b/patches_old/minecraft/net/minecraft/enchantment/Enchantments.java.patch deleted file mode 100644 index eb13c7017..000000000 --- a/patches_old/minecraft/net/minecraft/enchantment/Enchantments.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/enchantment/Enchantments.java -+++ b/net/minecraft/enchantment/Enchantments.java -@@ -3,6 +3,7 @@ - import net.minecraft.inventory.EquipmentSlotType; - import net.minecraft.util.registry.Registry; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public class Enchantments { - private static final EquipmentSlotType[] field_222195_L = new EquipmentSlotType[]{EquipmentSlotType.HEAD, EquipmentSlotType.CHEST, EquipmentSlotType.LEGS, EquipmentSlotType.FEET}; - public static final Enchantment field_180310_c = func_222191_a("protection", new ProtectionEnchantment(Enchantment.Rarity.COMMON, ProtectionEnchantment.Type.ALL, field_222195_L)); diff --git a/patches_old/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch b/patches_old/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch deleted file mode 100644 index 89dbd7257..000000000 --- a/patches_old/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/enchantment/FrostWalkerEnchantment.java -+++ b/net/minecraft/enchantment/FrostWalkerEnchantment.java -@@ -42,9 +42,10 @@ - if (blockpos.func_218137_a(p_185266_0_.func_213303_ch(), (double)f)) { - blockpos$mutable.func_181079_c(blockpos.func_177958_n(), blockpos.func_177956_o() + 1, blockpos.func_177952_p()); - BlockState blockstate1 = p_185266_1_.func_180495_p(blockpos$mutable); -- if (blockstate1.func_196958_f()) { -+ if (blockstate1.isAir(p_185266_1_, blockpos$mutable)) { - 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_, new net.minecraftforge.common.util.BlockSnapshot(p_185266_1_, blockpos, blockstate2), 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_old/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch deleted file mode 100644 index 01a17200e..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java -+++ b/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java -@@ -18,7 +18,7 @@ - import net.minecraft.util.math.IPosWrapper; - import net.minecraft.util.registry.Registry; - --public class MemoryModuleType { -+public class MemoryModuleType extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final MemoryModuleType field_220940_a = func_223541_a("dummy"); - public static final MemoryModuleType field_220941_b = func_220937_a("home", Optional.of(GlobalPos::func_218176_a)); - public static final MemoryModuleType field_220942_c = func_220937_a("job_site", Optional.of(GlobalPos::func_218176_a)); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/brain/schedule/Activity.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/brain/schedule/Activity.java.patch deleted file mode 100644 index c3c1c0e71..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/brain/schedule/Activity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/brain/schedule/Activity.java -+++ b/net/minecraft/entity/ai/brain/schedule/Activity.java -@@ -2,7 +2,7 @@ - - import net.minecraft.util.registry.Registry; - --public class Activity { -+public class Activity extends net.minecraftforge.registries.ForgeRegistryEntry { - public static final Activity field_221365_a = func_221363_a("core"); - public static final Activity field_221366_b = func_221363_a("idle"); - public static final Activity field_221367_c = func_221363_a("work"); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/brain/schedule/Schedule.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/brain/schedule/Schedule.java.patch deleted file mode 100644 index f213d56d2..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/brain/schedule/Schedule.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/brain/schedule/Schedule.java -+++ b/net/minecraft/entity/ai/brain/schedule/Schedule.java -@@ -8,7 +8,7 @@ - import java.util.stream.Collectors; - import net.minecraft.util.registry.Registry; - --public class Schedule { -+public class Schedule extends net.minecraftforge.registries.ForgeRegistryEntry { - public static final Schedule field_221383_a = func_221380_a("empty").func_221402_a(0, Activity.field_221366_b).func_221404_a(); - public static final Schedule field_221384_b = func_221380_a("simple").func_221402_a(5000, Activity.field_221367_c).func_221402_a(11000, Activity.field_221369_e).func_221404_a(); - public static final Schedule field_221385_c = func_221380_a("villager_baby").func_221402_a(10, Activity.field_221366_b).func_221402_a(3000, Activity.field_221368_d).func_221402_a(6000, Activity.field_221366_b).func_221402_a(10000, Activity.field_221368_d).func_221402_a(12000, Activity.field_221369_e).func_221404_a(); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/brain/sensor/SensorType.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/brain/sensor/SensorType.java.patch deleted file mode 100644 index d1a3ed307..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/brain/sensor/SensorType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/brain/sensor/SensorType.java -+++ b/net/minecraft/entity/ai/brain/sensor/SensorType.java -@@ -4,7 +4,7 @@ - import net.minecraft.util.ResourceLocation; - import net.minecraft.util.registry.Registry; - --public class SensorType> { -+public class SensorType> extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final SensorType field_220997_a = func_220996_a("dummy", DummySensor::new); - public static final SensorType field_220998_b = func_220996_a("nearest_living_entities", NearestLivingEntitiesSensor::new); - public static final SensorType field_220999_c = func_220996_a("nearest_players", NearestPlayersSensor::new); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch deleted file mode 100644 index 9e6673880..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/net/minecraft/entity/ai/brain/task/FarmTask.java -+++ b/net/minecraft/entity/ai/brain/task/FarmTask.java -@@ -39,7 +39,7 @@ - } - - protected boolean func_212832_a_(ServerWorld p_212832_1_, VillagerEntity p_212832_2_) { -- if (!p_212832_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212832_1_, p_212832_2_)) { - return false; - } else if (p_212832_2_.func_213700_eh().func_221130_b() != VillagerProfession.field_221156_f) { - return false; -@@ -136,6 +136,11 @@ - } else if (itemstack.func_77973_b() == Items.field_185163_cU) { - p_212833_1_.func_180501_a(this.field_220422_a, Blocks.field_185773_cZ.func_176223_P(), 3); - flag = true; -+ } else if (itemstack.func_77973_b() instanceof net.minecraftforge.common.IPlantable) { -+ if (((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlantType(p_212833_1_, field_220422_a) == net.minecraftforge.common.PlantType.Crop) { -+ p_212833_1_.func_180501_a(field_220422_a, ((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlant(p_212833_1_, field_220422_a), 3); -+ flag = true; -+ } - } - } - diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch deleted file mode 100644 index 775739b04..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/BreakBlockGoal.java -+++ b/net/minecraft/entity/ai/goal/BreakBlockGoal.java -@@ -32,7 +32,7 @@ - } - - public boolean func_75250_a() { -- if (!this.field_203118_g.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (!net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_203118_g.field_70170_p, this.field_179494_b, this.field_203118_g)) { - return false; - } else if (this.field_179496_a > 0) { - --this.field_179496_a; diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch deleted file mode 100644 index bc4230d67..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/BreakDoorGoal.java -+++ b/net/minecraft/entity/ai/goal/BreakDoorGoal.java -@@ -29,7 +29,7 @@ - public boolean func_75250_a() { - if (!super.func_75250_a()) { - return false; -- } else if (!this.field_75356_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ } else if (!net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a)) { - return false; - } else { - return this.func_220696_a(this.field_75356_a.field_70170_p.func_175659_aa()) && !this.func_195922_f(); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch deleted file mode 100644 index f055c15d0..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/BreedGoal.java -+++ b/net/minecraft/entity/ai/goal/BreedGoal.java -@@ -80,6 +80,17 @@ - - protected void func_75388_i() { - AgeableEntity ageableentity = 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, 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.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 (ageableentity != null) { - ServerPlayerEntity serverplayerentity = this.field_75390_d.func_191993_do(); - if (serverplayerentity == null && this.field_75391_e.func_191993_do() != null) { diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch deleted file mode 100644 index 7c4feb3d6..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/EatGrassGoal.java -+++ b/net/minecraft/entity/ai/goal/EatGrassGoal.java -@@ -59,7 +59,7 @@ - if (this.field_151502_a == 4) { - BlockPos blockpos = new BlockPos(this.field_151500_b); - if (field_179505_b.test(this.field_151501_c.func_180495_p(blockpos))) { -- if (this.field_151501_c.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b)) { - this.field_151501_c.func_175655_b(blockpos, false); - } - -@@ -67,7 +67,7 @@ - } else { - BlockPos blockpos1 = blockpos.func_177977_b(); - if (this.field_151501_c.func_180495_p(blockpos1).func_177230_c() == Blocks.field_196658_i) { -- if (this.field_151501_c.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b)) { - this.field_151501_c.func_217379_c(2001, blockpos1, Block.func_196246_j(Blocks.field_196658_i.func_176223_P())); - this.field_151501_c.func_180501_a(blockpos1, Blocks.field_150346_d.func_176223_P(), 2); - } diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/MeleeAttackGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/MeleeAttackGoal.java.patch deleted file mode 100644 index bba290bbf..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/MeleeAttackGoal.java.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/MeleeAttackGoal.java -+++ b/net/minecraft/entity/ai/goal/MeleeAttackGoal.java -@@ -21,6 +21,8 @@ - private double field_151496_k; - protected final int field_188493_g = 20; - private long field_220720_k; -+ private int failedPathFindingPenalty = 0; -+ private boolean canPenalize = false; - - public MeleeAttackGoal(CreatureEntity p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) { - this.field_75441_b = p_i1636_1_; -@@ -41,6 +43,15 @@ - } else if (!livingentity.func_70089_S()) { - return false; - } else { -+ if (canPenalize) { -+ if (--this.field_75445_i <= 0) { -+ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(livingentity, 0); -+ this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); -+ return this.field_75438_g != null; -+ } else { -+ return true; -+ } -+ } - this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(livingentity, 0); - if (this.field_75438_g != null) { - return true; -@@ -92,6 +103,18 @@ - this.field_151495_j = livingentity.func_226278_cu_(); - this.field_151496_k = livingentity.func_226281_cx_(); - this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); -+ if (this.canPenalize) { -+ this.field_75445_i += failedPathFindingPenalty; -+ if (this.field_75441_b.func_70661_as().func_75505_d() != null) { -+ net.minecraft.pathfinding.PathPoint finalPathPoint = this.field_75441_b.func_70661_as().func_75505_d().func_75870_c(); -+ if (finalPathPoint != null && livingentity.func_70092_e(finalPathPoint.field_75839_a, finalPathPoint.field_75837_b, finalPathPoint.field_75838_c) < 1) -+ failedPathFindingPenalty = 0; -+ else -+ failedPathFindingPenalty += 10; -+ } else { -+ failedPathFindingPenalty += 10; -+ } -+ } - if (d0 > 1024.0D) { - this.field_75445_i += 10; - } else if (d0 > 256.0D) { diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java.patch deleted file mode 100644 index 22d64d6be..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java -+++ b/net/minecraft/entity/ai/goal/RangedBowAttackGoal.java -@@ -36,7 +36,7 @@ - } - - protected boolean func_188498_f() { -- return this.field_188499_a.func_213382_a(Items.field_151031_f); -+ return this.field_188499_a.func_184614_ca().func_77973_b() instanceof BowItem || this.field_188499_a.func_184592_cb().func_77973_b() instanceof BowItem; - } - - public boolean func_75253_b() { diff --git a/patches_old/minecraft/net/minecraft/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch deleted file mode 100644 index 07266933d..000000000 --- a/patches_old/minecraft/net/minecraft/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/ai/goal/RunAroundLikeCrazyGoal.java -+++ b/net/minecraft/entity/ai/goal/RunAroundLikeCrazyGoal.java -@@ -54,7 +54,7 @@ - if (entity instanceof PlayerEntity) { - int i = this.field_111180_a.func_110252_cg(); - int j = this.field_111180_a.func_190676_dC(); -- if (j > 0 && this.field_111180_a.func_70681_au().nextInt(j) < i) { -+ if (j > 0 && this.field_111180_a.func_70681_au().nextInt(j) < i && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(field_111180_a, (PlayerEntity)entity)) { - this.field_111180_a.func_110263_g((PlayerEntity)entity); - return; - } diff --git a/patches_old/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch deleted file mode 100644 index 3619caf1b..000000000 --- a/patches_old/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/net/minecraft/entity/boss/WitherEntity.java -+++ b/net/minecraft/entity/boss/WitherEntity.java -@@ -212,7 +212,7 @@ - if (this.func_82212_n() > 0) { - int j1 = this.func_82212_n() - 1; - if (j1 <= 0) { -- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; -+ Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; - this.field_70170_p.func_217398_a(this, this.func_226277_ct_(), this.func_226280_cw_(), this.func_226281_cx_(), 7.0F, false, explosion$mode); - this.field_70170_p.func_175669_a(1023, new BlockPos(this), 0); - } -@@ -287,7 +287,7 @@ - - if (this.field_82222_j > 0) { - --this.field_82222_j; -- if (this.field_82222_j == 0 && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (this.field_82222_j == 0 && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { - int i1 = MathHelper.func_76128_c(this.func_226278_cu_()); - int l1 = MathHelper.func_76128_c(this.func_226277_ct_()); - int i2 = MathHelper.func_76128_c(this.func_226281_cx_()); -@@ -301,7 +301,7 @@ - int l = i2 + l2; - BlockPos blockpos = new BlockPos(i3, k, l); - BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); -- if (func_181033_a(blockstate)) { -+ if (blockstate.canEntityDestroy(this.field_70170_p, blockpos, this) && net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, blockstate)) { - flag = this.field_70170_p.func_225521_a_(blockpos, true, this) || flag; - } - } -@@ -322,6 +322,7 @@ - } - } - -+ @Deprecated //Forge: DO NOT USE use BlockState.canEntityDestroy - public static boolean func_181033_a(BlockState p_181033_0_) { - return !p_181033_0_.func_196958_f() && !BlockTags.field_219755_X.func_199685_a_(p_181033_0_.func_177230_c()); - } diff --git a/patches_old/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch deleted file mode 100644 index c441725bf..000000000 --- a/patches_old/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/effect/LightningBoltEntity.java -+++ b/net/minecraft/entity/effect/LightningBoltEntity.java -@@ -80,6 +80,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); - } - diff --git a/patches_old/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch deleted file mode 100644 index e63ad54f5..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/ArmorStandEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/item/ArmorStandEntity.java -+++ b/net/minecraft/entity/item/ArmorStandEntity.java -@@ -56,7 +56,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_) -> { -- return p_200617_0_ instanceof AbstractMinecartEntity && ((AbstractMinecartEntity)p_200617_0_).func_184264_v() == AbstractMinecartEntity.Type.RIDEABLE; -+ return p_200617_0_ instanceof AbstractMinecartEntity && ((AbstractMinecartEntity)p_200617_0_).canBeRidden(); - }; - private final NonNullList field_184799_bw = NonNullList.func_191197_a(2, ItemStack.field_190927_a); - private final NonNullList field_184800_bx = NonNullList.func_191197_a(4, ItemStack.field_190927_a); diff --git a/patches_old/minecraft/net/minecraft/entity/item/BoatEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/BoatEntity.java.patch deleted file mode 100644 index 4b85b1c0f..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/BoatEntity.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/minecraft/entity/item/BoatEntity.java -+++ b/net/minecraft/entity/item/BoatEntity.java -@@ -461,7 +461,7 @@ - blockpos$pooledmutable.func_181079_c(l1, k2, i2); - BlockState blockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutable); - if (!(blockstate.func_177230_c() instanceof LilyPadBlock) && VoxelShapes.func_197879_c(blockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutable).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.field_223238_i_)) { -- f += blockstate.func_177230_c().func_208618_m(); -+ f += blockstate.getSlipperiness(this.field_70170_p, blockpos$pooledmutable, this); - ++k1; - } - } -@@ -776,6 +776,16 @@ - return new SSpawnObjectPacket(this); - } - -+ // Forge: Fix MC-119811 by instantly completing lerp on board -+ @Override -+ protected void func_184200_o(Entity passenger) { -+ super.func_184200_o(passenger); -+ if (this.func_184186_bw() && this.field_184476_at > 0) { -+ this.field_184476_at = 0; -+ this.func_70080_a(this.field_70281_h, this.field_184477_av, this.field_184478_aw, (float)this.field_70273_g, (float)this.field_184479_ay); -+ } -+ } -+ - public static enum Status { - IN_WATER, - UNDER_WATER, diff --git a/patches_old/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch deleted file mode 100644 index 027066c18..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/net/minecraft/entity/item/EnderPearlEntity.java -+++ b/net/minecraft/entity/item/EnderPearlEntity.java -@@ -85,6 +85,8 @@ - if (livingentity instanceof ServerPlayerEntity) { - ServerPlayerEntity serverplayerentity = (ServerPlayerEntity)livingentity; - if (serverplayerentity.field_71135_a.func_147298_b().func_150724_d() && serverplayerentity.field_70170_p == this.field_70170_p && !serverplayerentity.func_70608_bn()) { -+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(serverplayerentity, this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), 5.0F); -+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { // Don't indent to lower patch size - if (this.field_70146_Z.nextFloat() < 0.05F && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) { - EndermiteEntity endermiteentity = EntityType.field_200804_r.func_200721_a(this.field_70170_p); - endermiteentity.func_175496_a(true); -@@ -96,9 +98,10 @@ - livingentity.func_184210_p(); - } - -- livingentity.func_70634_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_()); -+ livingentity.func_70634_a(event.getTargetX(), event.getTargetY(), event.getTargetZ()); - livingentity.field_70143_R = 0.0F; -- livingentity.func_70097_a(DamageSource.field_76379_h, 5.0F); -+ livingentity.func_70097_a(DamageSource.field_76379_h, event.getAttackDamage()); -+ } //Forge: End - } - } else if (livingentity != null) { - livingentity.func_70634_a(this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_()); -@@ -121,11 +124,11 @@ - } - - @Nullable -- public Entity func_212321_a(DimensionType p_212321_1_) { -+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { - if (this.field_70192_c.field_71093_bK != p_212321_1_) { - this.field_70192_c = null; - } - -- return super.func_212321_a(p_212321_1_); -+ return super.changeDimension(p_212321_1_, teleporter); - } - } diff --git a/patches_old/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch deleted file mode 100644 index d6935dc02..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/ExperienceOrbEntity.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/net/minecraft/entity/item/ExperienceOrbEntity.java -+++ b/net/minecraft/entity/item/ExperienceOrbEntity.java -@@ -98,7 +98,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)); -@@ -127,6 +128,7 @@ - } - - public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (this.field_70170_p.field_72995_K || this.field_70128_L) return false; //Forge: Fixes MC-53850 - if (this.func_180431_b(p_70097_1_)) { - return false; - } else { -@@ -155,13 +157,14 @@ - public void func_70100_b_(PlayerEntity p_70100_1_) { - if (!this.field_70170_p.field_72995_K) { - if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerXpEvent.PickupXp(p_70100_1_, this))) return; - p_70100_1_.field_71090_bL = 2; - p_70100_1_.func_71001_a(this, 1); - Entry entry = EnchantmentHelper.func_222189_b(Enchantments.field_185296_A, p_70100_1_); - if (entry != null) { - ItemStack itemstack = entry.getValue(); - if (!itemstack.func_190926_b() && itemstack.func_77951_h()) { -- int i = Math.min(this.func_184514_c(this.field_70530_e), itemstack.func_77952_i()); -+ int i = Math.min((int)(this.field_70530_e * itemstack.getXpRepairRatio()), itemstack.func_77952_i()); - this.field_70530_e -= this.func_184515_b(i); - itemstack.func_196085_b(itemstack.func_77952_i() - i); - } diff --git a/patches_old/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch deleted file mode 100644 index 6f29d16ef..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/item/FallingBlockEntity.java -+++ b/net/minecraft/entity/item/FallingBlockEntity.java -@@ -153,7 +153,7 @@ - ((FallingBlock)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, blockstate); - } - -- if (this.field_145810_d != null && block instanceof ITileEntityProvider) { -+ if (this.field_145810_d != null && this.field_175132_d.hasTileEntity()) { - TileEntity tileentity = this.field_70170_p.func_175625_s(blockpos1); - if (tileentity != null) { - CompoundNBT compoundnbt = tileentity.func_189515_b(new CompoundNBT()); diff --git a/patches_old/minecraft/net/minecraft/entity/item/FireworkRocketEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/FireworkRocketEntity.java.patch deleted file mode 100644 index 62400ef66..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/FireworkRocketEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/item/FireworkRocketEntity.java -+++ b/net/minecraft/entity/item/FireworkRocketEntity.java -@@ -187,6 +187,7 @@ - } - - protected void func_213892_a(RayTraceResult p_213892_1_) { -+ if(p_213892_1_.func_216346_c() != RayTraceResult.Type.MISS && net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, p_213892_1_)) return; - if (p_213892_1_.func_216346_c() == RayTraceResult.Type.ENTITY && !this.field_70170_p.field_72995_K) { - this.func_213893_k(); - } else if (this.field_70132_H) { diff --git a/patches_old/minecraft/net/minecraft/entity/item/HangingEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/HangingEntity.java.patch deleted file mode 100644 index 7b173e0a1..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/HangingEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/item/HangingEntity.java -+++ b/net/minecraft/entity/item/HangingEntity.java -@@ -113,6 +113,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); -+ if (net.minecraft.block.Block.func_220055_a(this.field_70170_p, blockpos$mutable, this.field_174860_b)) -+ continue; - if (!blockstate.func_185904_a().func_76220_a() && !RedstoneDiodeBlock.func_185546_B(blockstate)) { - return false; - } diff --git a/patches_old/minecraft/net/minecraft/entity/item/ItemEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/ItemEntity.java.patch deleted file mode 100644 index 8b647d9a6..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/ItemEntity.java.patch +++ /dev/null @@ -1,131 +0,0 @@ ---- a/net/minecraft/entity/item/ItemEntity.java -+++ b/net/minecraft/entity/item/ItemEntity.java -@@ -38,6 +38,10 @@ - private int field_70291_e = 5; - private UUID field_145801_f; - private UUID field_145802_g; -+ /** -+ * The maximum age of this EntityItem. The item is expired once this is reached. -+ */ -+ public int lifespan = 6000; - public final float field_70290_d = (float)(Math.random() * Math.PI * 2.0D); - - public ItemEntity(EntityType p_i50217_1_, World p_i50217_2_) { -@@ -54,6 +58,7 @@ - public ItemEntity(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) { - this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); - this.func_92058_a(p_i1710_8_); -+ this.lifespan = (p_i1710_8_.func_77973_b() == null ? 6000 : p_i1710_8_.getEntityLifespan(p_i1710_1_)); - } - - protected boolean func_225502_at_() { -@@ -65,6 +70,7 @@ - } - - public void func_70071_h_() { -+ if (func_92059_d().onEntityItemUpdate(this)) return; - if (this.func_92059_d().func_190926_b()) { - this.func_70106_y(); - } else { -@@ -96,7 +102,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)); -@@ -130,7 +137,14 @@ - } - } - -- if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) { -+ ItemStack item = this.func_92059_d(); -+ if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) { -+ int hook = net.minecraftforge.event.ForgeEventFactory.onItemExpire(this, item); -+ if (hook < 0) this.func_70106_y(); -+ else this.lifespan += hook; -+ } -+ -+ if (item.func_190926_b()) { - this.func_70106_y(); - } - -@@ -183,6 +197,8 @@ - return false; - } else if (p_226532_1_.func_77942_o() ^ p_226532_0_.func_77942_o()) { - return false; -+ }else if (!p_226532_0_.areCapsCompatible(p_226532_1_)) { -+ return false; - } else { - return !p_226532_1_.func_77942_o() || p_226532_1_.func_77978_p().equals(p_226532_0_.func_77978_p()); - } -@@ -216,6 +232,7 @@ - } - - public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (this.field_70170_p.field_72995_K || this.field_70128_L) return false; //Forge: Fixes MC-53850 - 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()) { -@@ -235,6 +252,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); -+ p_213281_1_.func_74768_a("Lifespan", lifespan); - if (this.func_200214_m() != null) { - p_213281_1_.func_218657_a("Thrower", NBTUtil.func_186862_a(this.func_200214_m())); - } -@@ -255,6 +273,7 @@ - if (p_70037_1_.func_74764_b("PickupDelay")) { - this.field_145804_b = p_70037_1_.func_74765_d("PickupDelay"); - } -+ if (p_70037_1_.func_74764_b("Lifespan")) lifespan = p_70037_1_.func_74762_e("Lifespan"); - - if (p_70037_1_.func_150297_b("Owner", 10)) { - this.field_145802_g = NBTUtil.func_186860_b(p_70037_1_.func_74775_l("Owner")); -@@ -274,12 +293,21 @@ - - public void func_70100_b_(PlayerEntity p_70100_1_) { - if (!this.field_70170_p.field_72995_K) { -+ if (this.field_145804_b > 0) return; - ItemStack itemstack = this.func_92059_d(); - Item item = itemstack.func_77973_b(); - int i = itemstack.func_190916_E(); -- if (this.field_145804_b == 0 && (this.field_145802_g == null || this.field_145802_g.equals(p_70100_1_.func_110124_au())) && p_70100_1_.field_71071_by.func_70441_a(itemstack)) { -+ -+ int hook = net.minecraftforge.event.ForgeEventFactory.onItemPickup(this, p_70100_1_); -+ if (hook < 0) return; -+ -+ ItemStack copy = itemstack.func_77946_l(); -+ if (this.field_145804_b == 0 && (this.field_145802_g == null || lifespan - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_110124_au())) && (hook == 1 || i <= 0 || p_70100_1_.field_71071_by.func_70441_a(itemstack))) { -+ copy.func_190920_e(copy.func_190916_E() - func_92059_d().func_190916_E()); -+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerItemPickupEvent(p_70100_1_, this, copy); - p_70100_1_.func_71001_a(this, i); - if (itemstack.func_190926_b()) { -+ p_70100_1_.func_71001_a(this, i); - this.func_70106_y(); - itemstack.func_190920_e(i); - } -@@ -300,8 +328,8 @@ - } - - @Nullable -- public Entity func_212321_a(DimensionType p_212321_1_) { -- Entity entity = super.func_212321_a(p_212321_1_); -+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { -+ Entity entity = super.changeDimension(p_212321_1_, teleporter); - if (!this.field_70170_p.field_72995_K && entity instanceof ItemEntity) { - ((ItemEntity)entity).func_85054_d(); - } -@@ -366,7 +394,7 @@ - - public void func_174870_v() { - this.func_174871_r(); -- this.field_70292_b = 5999; -+ this.field_70292_b = func_92059_d().getEntityLifespan(field_70170_p) - 1; - } - - public IPacket func_213297_N() { diff --git a/patches_old/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch deleted file mode 100644 index 01a71f9e4..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/item/ItemFrameEntity.java -+++ b/net/minecraft/entity/item/ItemFrameEntity.java -@@ -192,7 +192,7 @@ - } - - private void func_110131_b(ItemStack p_110131_1_) { -- if (p_110131_1_.func_77973_b() == Items.field_151098_aY) { -+ if (p_110131_1_.func_77973_b() instanceof net.minecraft.item.FilledMapItem) { - MapData mapdata = FilledMapItem.func_195950_a(p_110131_1_, this.field_70170_p); - mapdata.func_212441_a(this.field_174861_a, this.func_145782_y()); - mapdata.func_76186_a(true); diff --git a/patches_old/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch deleted file mode 100644 index a9b1db525..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/LeashKnotEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/item/LeashKnotEntity.java -+++ b/net/minecraft/entity/item/LeashKnotEntity.java -@@ -43,6 +43,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); -+ if (this.isAddedToWorld() && this.field_70170_p instanceof net.minecraft.world.server.ServerWorld) ((net.minecraft.world.server.ServerWorld)this.field_70170_p).func_217464_b(this); // Forge - Process chunk registration after moving. - } - - public void func_174859_a(Direction p_174859_1_) { diff --git a/patches_old/minecraft/net/minecraft/entity/item/PaintingType.java.patch b/patches_old/minecraft/net/minecraft/entity/item/PaintingType.java.patch deleted file mode 100644 index 32ab423ee..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/PaintingType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/item/PaintingType.java -+++ b/net/minecraft/entity/item/PaintingType.java -@@ -2,7 +2,7 @@ - - import net.minecraft.util.registry.Registry; - --public class PaintingType { -+public class PaintingType extends net.minecraftforge.registries.ForgeRegistryEntry { - public static final PaintingType field_200843_b = func_221119_a("kebab", 16, 16); - public static final PaintingType field_200844_c = func_221119_a("aztec", 16, 16); - public static final PaintingType field_200845_d = func_221119_a("alban", 16, 16); diff --git a/patches_old/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch deleted file mode 100644 index f2f092c76..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch +++ /dev/null @@ -1,257 +0,0 @@ ---- a/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java -+++ b/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java -@@ -40,7 +40,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public abstract class AbstractMinecartEntity extends Entity { -+public abstract class AbstractMinecartEntity extends Entity implements net.minecraftforge.common.extensions.IForgeEntityMinecart { - 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); -@@ -80,6 +80,7 @@ - private double field_70507_ar; - @OnlyIn(Dist.CLIENT) - private double field_70506_as; -+ private boolean canBePushed = true; - - protected AbstractMinecartEntity(EntityType p_i48538_1_, World p_i48538_2_) { - super(p_i48538_1_, p_i48538_2_); -@@ -126,11 +127,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; - } - - public boolean func_70104_M() { -- return true; -+ return canBePushed; - } - - public double func_70042_X() { -@@ -239,9 +241,9 @@ - - BlockPos blockpos = new BlockPos(i, j, k); - BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); -- if (blockstate.func_203425_a(BlockTags.field_203437_y)) { -+ if (canUseRail() && blockstate.func_203425_a(BlockTags.field_203437_y)) { - this.func_180460_a(blockpos, blockstate); -- if (blockstate.func_177230_c() == Blocks.field_150408_cc) { -+ if (blockstate.func_177230_c() instanceof PoweredRailBlock && ((PoweredRailBlock) blockstate.func_177230_c()).isActivatorRail()) { - this.func_96095_a(i, j, k, blockstate.func_177229_b(PoweredRailBlock.field_176569_M)); - } - } else { -@@ -266,8 +268,11 @@ - } - - this.func_70101_b(this.field_70177_z, this.field_70125_A); -- if (this.func_184264_v() == AbstractMinecartEntity.Type.RIDEABLE && func_213296_b(this.func_213322_ci()) > 0.01D) { -- List list = this.field_70170_p.func_175674_a(this, this.func_174813_aQ().func_72314_b((double)0.2F, 0.0D, (double)0.2F), EntityPredicates.func_200823_a(this)); -+ AxisAlignedBB box; -+ if (getCollisionHandler() != null) box = getCollisionHandler().getMinecartCollisionBox(this); -+ else box = this.func_174813_aQ().func_72314_b(0.2F, 0.0D, 0.2F); -+ if (canBeRidden() && func_213296_b(this.func_213322_ci()) > 0.01D) { -+ List list = this.field_70170_p.func_175674_a(this, box, EntityPredicates.func_200823_a(this)); - if (!list.isEmpty()) { - for(int l = 0; l < list.size(); ++l) { - Entity entity1 = list.get(l); -@@ -279,7 +284,7 @@ - } - } - } else { -- for(Entity entity : this.field_70170_p.func_72839_b(this, this.func_174813_aQ().func_72314_b((double)0.2F, 0.0D, (double)0.2F))) { -+ for(Entity entity : this.field_70170_p.func_72839_b(this, box)) { - if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof AbstractMinecartEntity) { - entity.func_70108_f(this); - } -@@ -287,6 +292,7 @@ - } - - this.func_70072_I(); -+ //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartUpdateEvent(this, this.getCurrentRailPosition())); - } - } - -@@ -298,16 +304,24 @@ - } - - protected void func_180459_n() { -- double d0 = this.func_174898_m(); -+ double d0 = field_70122_E ? this.func_174898_m() : getMaxSpeedAirLateral(); - Vec3d vec3d = this.func_213322_ci(); - this.func_213293_j(MathHelper.func_151237_a(vec3d.field_72450_a, -d0, d0), vec3d.field_72448_b, MathHelper.func_151237_a(vec3d.field_72449_c, -d0, d0)); -+ -+ if (getMaxSpeedAirVertical() > 0 && func_213322_ci().field_72448_b > getMaxSpeedAirVertical()) { -+ if(Math.abs(func_213322_ci().field_72450_a) < 0.3f && Math.abs(func_213322_ci().field_72449_c) < 0.3f) -+ func_213317_d(new Vec3d(func_213322_ci().field_72450_a, 0.15f, func_213322_ci().field_72449_c)); -+ else -+ func_213317_d(new Vec3d(func_213322_ci().field_72450_a, getMaxSpeedAirVertical(), func_213322_ci().field_72449_c)); -+ } -+ - if (this.field_70122_E) { - this.func_213317_d(this.func_213322_ci().func_186678_a(0.5D)); - } - - this.func_213315_a(MoverType.SELF, this.func_213322_ci()); - if (!this.field_70122_E) { -- this.func_213317_d(this.func_213322_ci().func_186678_a(0.95D)); -+ this.func_213317_d(this.func_213322_ci().func_186678_a(getDragAir())); - } - - } -@@ -322,29 +336,28 @@ - boolean flag = false; - boolean flag1 = false; - AbstractRailBlock abstractrailblock = (AbstractRailBlock)p_180460_2_.func_177230_c(); -- if (abstractrailblock == Blocks.field_196552_aC) { -+ if (abstractrailblock instanceof PoweredRailBlock && !((PoweredRailBlock) abstractrailblock).isActivatorRail()) { - flag = p_180460_2_.func_177229_b(PoweredRailBlock.field_176569_M); - flag1 = !flag; - } - -- double d3 = 0.0078125D; - Vec3d vec3d1 = this.func_213322_ci(); -- RailShape railshape = p_180460_2_.func_177229_b(abstractrailblock.func_176560_l()); -+ RailShape railshape = ((AbstractRailBlock)p_180460_2_.func_177230_c()).getRailDirection(p_180460_2_, this.field_70170_p, p_180460_1_, this); - switch(railshape) { - case ASCENDING_EAST: -- this.func_213317_d(vec3d1.func_72441_c(-0.0078125D, 0.0D, 0.0D)); -+ this.func_213317_d(vec3d1.func_72441_c(-1*getSlopeAdjustment(), 0.0D, 0.0D)); - ++d1; - break; - case ASCENDING_WEST: -- this.func_213317_d(vec3d1.func_72441_c(0.0078125D, 0.0D, 0.0D)); -+ this.func_213317_d(vec3d1.func_72441_c(getSlopeAdjustment(), 0.0D, 0.0D)); - ++d1; - break; - case ASCENDING_NORTH: -- this.func_213317_d(vec3d1.func_72441_c(0.0D, 0.0D, 0.0078125D)); -+ this.func_213317_d(vec3d1.func_72441_c(0.0D, 0.0D, getSlopeAdjustment())); - ++d1; - break; - case ASCENDING_SOUTH: -- this.func_213317_d(vec3d1.func_72441_c(0.0D, 0.0D, -0.0078125D)); -+ this.func_213317_d(vec3d1.func_72441_c(0.0D, 0.0D, -1*getSlopeAdjustment())); - ++d1; - } - -@@ -375,7 +388,7 @@ - } - } - -- if (flag1) { -+ if (flag1 && shouldDoRailFunctions()) { - double d22 = Math.sqrt(func_213296_b(this.func_213322_ci())); - if (d22 < 0.03D) { - this.func_213317_d(Vec3d.field_186680_a); -@@ -404,10 +417,7 @@ - d0 = d23 + d4 * d14; - d2 = d10 + d5 * d14; - this.func_70107_b(d0, d1, d2); -- double d24 = this.func_184207_aI() ? 0.75D : 1.0D; -- double d25 = this.func_174898_m(); -- vec3d1 = this.func_213322_ci(); -- this.func_213315_a(MoverType.SELF, new Vec3d(MathHelper.func_151237_a(d24 * vec3d1.field_72450_a, -d25, d25), 0.0D, MathHelper.func_151237_a(d24 * vec3d1.field_72449_c, -d25, d25))); -+ this.moveMinecartOnRail(p_180460_1_); - if (vec3i.func_177956_o() != 0 && MathHelper.func_76128_c(this.func_226277_ct_()) - p_180460_1_.func_177958_n() == vec3i.func_177958_n() && MathHelper.func_76128_c(this.func_226281_cx_()) - p_180460_1_.func_177952_p() == vec3i.func_177952_p()) { - this.func_70107_b(this.func_226277_ct_(), this.func_226278_cu_() + (double)vec3i.func_177956_o(), this.func_226281_cx_()); - } else if (vec3i1.func_177956_o() != 0 && MathHelper.func_76128_c(this.func_226277_ct_()) - p_180460_1_.func_177958_n() == vec3i1.func_177958_n() && MathHelper.func_76128_c(this.func_226281_cx_()) - p_180460_1_.func_177952_p() == vec3i1.func_177952_p()) { -@@ -435,7 +445,10 @@ - this.func_213293_j(d26 * (double)(j - p_180460_1_.func_177958_n()), vec3d5.field_72448_b, d26 * (double)(i - p_180460_1_.func_177952_p())); - } - -- if (flag) { -+ if (shouldDoRailFunctions()) -+ ((AbstractRailBlock)p_180460_2_.func_177230_c()).onMinecartPass(p_180460_2_, field_70170_p, p_180460_1_, this); -+ -+ if (flag && shouldDoRailFunctions()) { - Vec3d vec3d6 = this.func_213322_ci(); - double d27 = Math.sqrt(func_213296_b(vec3d6)); - if (d27 > 0.01D) { -@@ -490,7 +503,7 @@ - - BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); - if (blockstate.func_203425_a(BlockTags.field_203437_y)) { -- RailShape railshape = blockstate.func_177229_b(((AbstractRailBlock)blockstate.func_177230_c()).func_176560_l()); -+ RailShape railshape = ((AbstractRailBlock)blockstate.func_177230_c()).getRailDirection(blockstate, this.field_70170_p, new BlockPos(i, j, k), this); - p_70495_3_ = (double)j; - if (railshape.func_208092_c()) { - p_70495_3_ = (double)(j + 1); -@@ -529,7 +542,7 @@ - - BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); - if (blockstate.func_203425_a(BlockTags.field_203437_y)) { -- RailShape railshape = blockstate.func_177229_b(((AbstractRailBlock)blockstate.func_177230_c()).func_176560_l()); -+ RailShape railshape = ((AbstractRailBlock)blockstate.func_177230_c()).getRailDirection(blockstate, this.field_70170_p, new BlockPos(i, j, k), this); - Pair pair = func_226573_a_(railshape); - Vec3i vec3i = pair.getFirst(); - Vec3i vec3i1 = pair.getSecond(); -@@ -592,6 +605,11 @@ - } - - public void func_70108_f(Entity p_70108_1_) { -+ //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, entityIn)); -+ if (getCollisionHandler() != null) { -+ getCollisionHandler().onEntityCollision(this, p_70108_1_); -+ return; -+ } - 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_)) { -@@ -627,11 +645,11 @@ - - Vec3d vec3d2 = this.func_213322_ci(); - Vec3d vec3d3 = p_70108_1_.func_213322_ci(); -- if (((AbstractMinecartEntity)p_70108_1_).func_184264_v() == AbstractMinecartEntity.Type.FURNACE && this.func_184264_v() != AbstractMinecartEntity.Type.FURNACE) { -+ if (((AbstractMinecartEntity)p_70108_1_).isPoweredCart() && !this.isPoweredCart()) { - this.func_213317_d(vec3d2.func_216372_d(0.2D, 1.0D, 0.2D)); - this.func_70024_g(vec3d3.field_72450_a - d0, 0.0D, vec3d3.field_72449_c - d1); - p_70108_1_.func_213317_d(vec3d3.func_216372_d(0.95D, 1.0D, 0.95D)); -- } else if (((AbstractMinecartEntity)p_70108_1_).func_184264_v() != AbstractMinecartEntity.Type.FURNACE && this.func_184264_v() == AbstractMinecartEntity.Type.FURNACE) { -+ } else if (!((AbstractMinecartEntity)p_70108_1_).isPoweredCart() && this.isPoweredCart()) { - p_70108_1_.func_213317_d(vec3d3.func_216372_d(0.2D, 1.0D, 0.2D)); - p_70108_1_.func_70024_g(vec3d2.field_72450_a + d0, 0.0D, vec3d2.field_72449_c + d1); - this.func_213317_d(vec3d2.func_216372_d(0.95D, 1.0D, 0.95D)); -@@ -737,6 +755,40 @@ - return new SSpawnObjectPacket(this); - } - -+ private boolean canUseRail = true; -+ @Override public boolean canUseRail() { return canUseRail; } -+ @Override public void setCanUseRail(boolean value) { this.canUseRail = value; } -+ private float currentSpeedOnRail; -+ @Override public float getCurrentCartSpeedCapOnRail() { return currentSpeedOnRail; } -+ @Override public void setCurrentCartSpeedCapOnRail(float value) { currentSpeedOnRail = Math.min(value, getMaxCartSpeedOnRail()); } -+ private float maxSpeedAirLateral = DEFAULT_MAX_SPEED_AIR_LATERAL; -+ @Override public float getMaxSpeedAirLateral() { return maxSpeedAirLateral; } -+ @Override public void setMaxSpeedAirLateral(float value) { maxSpeedAirLateral = value; } -+ private float maxSpeedAirVertical = DEFAULT_MAX_SPEED_AIR_VERTICAL; -+ @Override public float getMaxSpeedAirVertical() { return maxSpeedAirVertical; } -+ @Override public void setMaxSpeedAirVertical(float value) { maxSpeedAirVertical = value; } -+ private double dragAir = DEFAULT_AIR_DRAG; -+ @Override public double getDragAir() { return dragAir; } -+ @Override public void setDragAir(double value) { dragAir = value; } -+ @Override -+ public double getMaxSpeedWithRail() { //Non-default because getMaximumSpeed is protected -+ if (!canUseRail()) return func_174898_m(); -+ BlockPos pos = this.getCurrentRailPosition(); -+ BlockState state = getMinecart().field_70170_p.func_180495_p(pos); -+ if (!state.func_203425_a(BlockTags.field_203437_y)) return func_174898_m(); -+ -+ float railMaxSpeed = ((AbstractRailBlock)state.func_177230_c()).getRailMaxSpeed(state, getMinecart().field_70170_p, pos, getMinecart()); -+ return Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); -+ } -+ @Override -+ public void moveMinecartOnRail(BlockPos pos) { //Non-default because getMaximumSpeed is protected -+ AbstractMinecartEntity mc = getMinecart(); -+ double d24 = mc.func_184207_aI() ? 0.75D : 1.0D; -+ double d25 = mc.getMaxSpeedWithRail(); -+ Vec3d vec3d1 = mc.func_213322_ci(); -+ mc.func_213315_a(MoverType.SELF, new Vec3d(MathHelper.func_151237_a(d24 * vec3d1.field_72450_a, -d25, d25), 0.0D, MathHelper.func_151237_a(d24 * vec3d1.field_72449_c, -d25, d25))); -+ } -+ - public static enum Type { - RIDEABLE, - CHEST, diff --git a/patches_old/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch deleted file mode 100644 index 8459e6051..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java -+++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java -@@ -110,17 +110,19 @@ - } - - @Nullable -- public Entity func_212321_a(DimensionType p_212321_1_) { -+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { - this.field_94112_b = false; -- return super.func_212321_a(p_212321_1_); -+ return super.changeDimension(p_212321_1_, teleporter); - } - -- public void func_70106_y() { -+ @Override -+ public void remove(boolean keepData) { - if (!this.field_70170_p.field_72995_K && this.field_94112_b) { - InventoryHelper.func_180176_a(this.field_70170_p, this, this); - } - -- super.func_70106_y(); -+ super.remove(keepData); -+ if (!keepData) itemHandler.invalidate(); - } - - protected void func_213281_b(CompoundNBT p_213281_1_) { -@@ -149,6 +151,7 @@ - } - - public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { -+ if (super.func_184230_a(p_184230_1_, p_184230_2_)) return true; - p_184230_1_.func_213829_a(this); - return true; - } -@@ -168,6 +171,8 @@ - LootTable loottable = this.field_70170_p.func_73046_m().func_200249_aQ().func_186521_a(this.field_184290_c); - this.field_184290_c = null; - LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld)this.field_70170_p)).func_216015_a(LootParameters.field_216286_f, new BlockPos(this)).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_); - } -@@ -198,4 +203,17 @@ - } - - protected abstract Container func_213968_a(int p_213968_1_, PlayerInventory p_213968_2_); -+ -+ private net.minecraftforge.common.util.LazyOptional itemHandler = net.minecraftforge.common.util.LazyOptional.of(() -> new net.minecraftforge.items.wrapper.InvWrapper(this)); -+ -+ @Override -+ public net.minecraftforge.common.util.LazyOptional getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.Direction facing) { -+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) -+ return itemHandler.cast(); -+ return super.getCapability(capability, facing); -+ } -+ -+ public void dropContentsWhenDead(boolean value) { -+ this.field_94112_b = value; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch deleted file mode 100644 index 3cfb77768..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java -+++ b/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java -@@ -110,6 +110,7 @@ - } - - public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { -+ if (super.func_184230_a(p_184230_1_, p_184230_2_)) return true; - ItemStack itemstack = p_184230_1_.func_184586_b(p_184230_2_); - if (field_195407_e.test(itemstack) && this.field_94110_c + 3600 <= 32000) { - if (!p_184230_1_.field_71075_bZ.field_75098_d) { diff --git a/patches_old/minecraft/net/minecraft/entity/item/minecart/MinecartCommandBlockEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/minecart/MinecartCommandBlockEntity.java.patch deleted file mode 100644 index 0811fd700..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/minecart/MinecartCommandBlockEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/item/minecart/MinecartCommandBlockEntity.java -+++ b/net/minecraft/entity/item/minecart/MinecartCommandBlockEntity.java -@@ -72,6 +72,7 @@ - } - - public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { -+ if (super.func_184230_a(p_184230_1_, p_184230_2_)) return true; - this.field_145824_a.func_175574_a(p_184230_1_); - return true; - } diff --git a/patches_old/minecraft/net/minecraft/entity/item/minecart/MinecartEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/minecart/MinecartEntity.java.patch deleted file mode 100644 index bd7714407..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/minecart/MinecartEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/item/minecart/MinecartEntity.java -+++ b/net/minecraft/entity/item/minecart/MinecartEntity.java -@@ -15,6 +15,7 @@ - } - - public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { -+ if (super.func_184230_a(p_184230_1_, p_184230_2_)) return true; - if (p_184230_1_.func_226563_dT_()) { - return false; - } else if (this.func_184207_aI()) { diff --git a/patches_old/minecraft/net/minecraft/entity/item/minecart/SpawnerMinecartEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/item/minecart/SpawnerMinecartEntity.java.patch deleted file mode 100644 index 02d08e37b..000000000 --- a/patches_old/minecraft/net/minecraft/entity/item/minecart/SpawnerMinecartEntity.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/entity/item/minecart/SpawnerMinecartEntity.java -+++ b/net/minecraft/entity/item/minecart/SpawnerMinecartEntity.java -@@ -23,6 +23,12 @@ - public BlockPos func_177221_b() { - return new BlockPos(SpawnerMinecartEntity.this); - } -+ -+ @Override -+ @javax.annotation.Nullable -+ public net.minecraft.entity.Entity getSpawnerEntity() { -+ return SpawnerMinecartEntity.this; -+ } - }; - - public SpawnerMinecartEntity(EntityType p_i50114_1_, World p_i50114_2_) { diff --git a/patches_old/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch deleted file mode 100644 index 622cf12ed..000000000 --- a/patches_old/minecraft/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java -+++ b/net/minecraft/entity/merchant/villager/AbstractVillagerEntity.java -@@ -179,9 +179,9 @@ - } - - @Nullable -- public Entity func_212321_a(DimensionType p_212321_1_) { -+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { - this.func_213750_eg(); -- return super.func_212321_a(p_212321_1_); -+ return super.changeDimension(p_212321_1_, teleporter); - } - - protected void func_213750_eg() { diff --git a/patches_old/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch deleted file mode 100644 index b387ba622..000000000 --- a/patches_old/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/net/minecraft/entity/merchant/villager/VillagerEntity.java -+++ b/net/minecraft/entity/merchant/villager/VillagerEntity.java -@@ -228,7 +228,7 @@ - if (flag) { - itemstack.func_111282_a(p_184645_1_, this, p_184645_2_); - return true; -- } else if (itemstack.func_77973_b() != Items.field_196172_da && this.func_70089_S() && !this.func_213716_dX() && !this.func_70608_bn()) { -+ } else if (itemstack.func_77973_b() != Items.field_196172_da && this.func_70089_S() && !this.func_213716_dX() && !this.func_70608_bn() && !p_184645_1_.func_226563_dT_()) { - if (this.func_70631_g_()) { - this.func_213756_es(); - return super.func_184645_a(p_184645_1_, p_184645_2_); -@@ -607,7 +607,8 @@ - } - - protected ITextComponent func_225513_by_() { -- return new TranslationTextComponent(this.func_200600_R().func_210760_d() + '.' + Registry.field_218370_L.func_177774_c(this.func_213700_eh().func_221130_b()).func_110623_a()); -+ net.minecraft.util.ResourceLocation profName = this.func_213700_eh().func_221130_b().getRegistryName(); -+ return new TranslationTextComponent(this.func_200600_R().func_210760_d() + '.' + (!"minecraft".equals(profName.func_110624_b()) ? profName.func_110624_b() + '.' : "") + profName.func_110623_a()); - } - - @OnlyIn(Dist.CLIENT) diff --git a/patches_old/minecraft/net/minecraft/entity/merchant/villager/VillagerProfession.java.patch b/patches_old/minecraft/net/minecraft/entity/merchant/villager/VillagerProfession.java.patch deleted file mode 100644 index feb536f75..000000000 --- a/patches_old/minecraft/net/minecraft/entity/merchant/villager/VillagerProfession.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/merchant/villager/VillagerProfession.java -+++ b/net/minecraft/entity/merchant/villager/VillagerProfession.java -@@ -12,7 +12,7 @@ - import net.minecraft.util.registry.Registry; - import net.minecraft.village.PointOfInterestType; - --public class VillagerProfession { -+public class VillagerProfession extends net.minecraftforge.registries.ForgeRegistryEntry { - public static final VillagerProfession field_221151_a = func_226556_a_("none", PointOfInterestType.field_221054_b, (SoundEvent)null); - public static final VillagerProfession field_221152_b = func_226556_a_("armorer", PointOfInterestType.field_221055_c, SoundEvents.field_219694_mB); - public static final VillagerProfession field_221153_c = func_226556_a_("butcher", PointOfInterestType.field_221056_d, SoundEvents.field_219695_mC); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/AbstractSkeletonEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/AbstractSkeletonEntity.java.patch deleted file mode 100644 index 87798c670..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/AbstractSkeletonEntity.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/entity/monster/AbstractSkeletonEntity.java -+++ b/net/minecraft/entity/monster/AbstractSkeletonEntity.java -@@ -154,7 +154,7 @@ - this.field_70714_bg.func_85156_a(this.field_85038_e); - this.field_70714_bg.func_85156_a(this.field_85037_d); - ItemStack itemstack = this.func_184586_b(ProjectileHelper.func_221274_a(this, Items.field_151031_f)); -- if (itemstack.func_77973_b() == Items.field_151031_f) { -+ if (itemstack.func_77973_b() instanceof net.minecraft.item.BowItem) { - int i = 20; - if (this.field_70170_p.func_175659_aa() != Difficulty.HARD) { - i = 40; -@@ -172,6 +172,8 @@ - public void func_82196_d(LivingEntity p_82196_1_, float p_82196_2_) { - ItemStack itemstack = this.func_213356_f(this.func_184586_b(ProjectileHelper.func_221274_a(this, Items.field_151031_f))); - AbstractArrowEntity abstractarrowentity = this.func_213624_b(itemstack, p_82196_2_); -+ if (this.func_184614_ca().func_77973_b() instanceof net.minecraft.item.BowItem) -+ abstractarrowentity = ((net.minecraft.item.BowItem)this.func_184614_ca().func_77973_b()).customeArrow(abstractarrowentity); - double d0 = p_82196_1_.func_226277_ct_() - this.func_226277_ct_(); - double d1 = p_82196_1_.func_226283_e_(0.3333333333333333D) - abstractarrowentity.func_226278_cu_(); - double d2 = p_82196_1_.func_226281_cx_() - this.func_226281_cx_(); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch deleted file mode 100644 index 556916353..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/monster/CreeperEntity.java -+++ b/net/minecraft/entity/monster/CreeperEntity.java -@@ -214,7 +214,7 @@ - - private void func_146077_cc() { - if (!this.field_70170_p.field_72995_K) { -- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; -+ Explosion.Mode explosion$mode = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; - float f = this.func_225509_J__() ? 2.0F : 1.0F; - this.field_70729_aU = true; - this.field_70170_p.func_217385_a(this, this.func_226277_ct_(), this.func_226278_cu_(), this.func_226281_cx_(), (float)this.field_82226_g * f, explosion$mode); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch deleted file mode 100644 index 98eadfd82..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- a/net/minecraft/entity/monster/EndermanEntity.java -+++ b/net/minecraft/entity/monster/EndermanEntity.java -@@ -93,7 +93,6 @@ - } - - public void func_70624_b(@Nullable LivingEntity p_70624_1_) { -- super.func_70624_b(p_70624_1_); - IAttributeInstance iattributeinstance = this.func_110148_a(SharedMonsterAttributes.field_111263_d); - if (p_70624_1_ == null) { - this.field_184721_by = 0; -@@ -108,6 +107,7 @@ - } - } - -+ super.func_70624_b(p_70624_1_); //Forge: Moved down to allow event handlers to write data manager values. - } - - protected void func_70088_a() { -@@ -234,7 +234,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) { -- boolean flag2 = this.func_213373_a(p_70825_1_, p_70825_3_, p_70825_5_, true); -+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; -+ boolean flag2 = this.func_213373_a(event.getTargetX(), event.getTargetY(), event.getTargetZ(), true); - if (flag2) { - 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); -@@ -390,7 +392,7 @@ - public boolean func_75250_a() { - if (this.field_179475_a.func_195405_dq() == null) { - return false; -- } else if (!this.field_179475_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179475_a.field_70170_p, this.field_179475_a)) { - return false; - } else { - return this.field_179475_a.func_70681_au().nextInt(2000) == 0; -@@ -408,7 +410,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, new net.minecraftforge.common.util.BlockSnapshot(iworld, blockpos, blockstate1), net.minecraft.util.Direction.UP)) { - iworld.func_180501_a(blockpos, blockstate2, 3); - this.field_179475_a.func_195406_b((BlockState)null); - } -@@ -416,7 +418,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_224756_o(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_224756_o(p_220836_1_, p_220836_6_) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_); - } - } - -@@ -458,7 +460,7 @@ - public boolean func_75250_a() { - if (this.field_179473_a.func_195405_dq() != null) { - return false; -- } else if (!this.field_179473_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179473_a.field_70170_p, this.field_179473_a)) { - return false; - } else { - return this.field_179473_a.func_70681_au().nextInt(20) == 0; diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch deleted file mode 100644 index 83f3bc0b7..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/monster/EvokerEntity.java -+++ b/net/minecraft/entity/monster/EvokerEntity.java -@@ -282,7 +282,7 @@ - return false; - } else if (EvokerEntity.this.field_70173_aa < this.field_193322_d) { - return false; -- } else if (!EvokerEntity.this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(EvokerEntity.this.field_70170_p, EvokerEntity.this)) { - return false; - } else { - List list = EvokerEntity.this.field_70170_p.func_217374_a(SheepEntity.class, this.field_220845_e, EvokerEntity.this, EvokerEntity.this.func_174813_aQ().func_72314_b(16.0D, 4.0D, 16.0D)); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/IllusionerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/IllusionerEntity.java.patch deleted file mode 100644 index e1047feae..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/IllusionerEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/monster/IllusionerEntity.java -+++ b/net/minecraft/entity/monster/IllusionerEntity.java -@@ -185,6 +185,8 @@ - public void func_82196_d(LivingEntity p_82196_1_, float p_82196_2_) { - ItemStack itemstack = this.func_213356_f(this.func_184586_b(ProjectileHelper.func_221274_a(this, Items.field_151031_f))); - AbstractArrowEntity abstractarrowentity = ProjectileHelper.func_221272_a(this, itemstack, p_82196_2_); -+ if (this.func_184614_ca().func_77973_b() instanceof net.minecraft.item.BowItem) -+ abstractarrowentity = ((net.minecraft.item.BowItem)this.func_184614_ca().func_77973_b()).customeArrow(abstractarrowentity); - double d0 = p_82196_1_.func_226277_ct_() - this.func_226277_ct_(); - double d1 = p_82196_1_.func_226283_e_(0.3333333333333333D) - abstractarrowentity.func_226278_cu_(); - double d2 = p_82196_1_.func_226281_cx_() - this.func_226281_cx_(); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch deleted file mode 100644 index ccef1a56d..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/entity/monster/MagmaCubeEntity.java -+++ b/net/minecraft/entity/monster/MagmaCubeEntity.java -@@ -72,6 +72,7 @@ - Vec3d vec3d = this.func_213322_ci(); - this.func_213293_j(vec3d.field_72450_a, (double)(this.func_175134_bD() + (float)this.func_70809_q() * 0.1F), vec3d.field_72449_c); - this.field_70160_al = true; -+ net.minecraftforge.common.ForgeHooks.onLivingJump(this); - } - - protected void func_180466_bG(Tag p_180466_1_) { diff --git a/patches_old/minecraft/net/minecraft/entity/monster/RavagerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/RavagerEntity.java.patch deleted file mode 100644 index e66ab3c80..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/RavagerEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/monster/RavagerEntity.java -+++ b/net/minecraft/entity/monster/RavagerEntity.java -@@ -139,7 +139,7 @@ - this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(MathHelper.func_219803_d(0.1D, d1, d0)); - } - -- if (this.field_70123_F && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (this.field_70123_F && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { - boolean flag = false; - AxisAlignedBB axisalignedbb = this.func_174813_aQ().func_186662_g(0.2D); - diff --git a/patches_old/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch deleted file mode 100644 index d1e4daa17..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/ShulkerEntity.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/entity/monster/ShulkerEntity.java -+++ b/net/minecraft/entity/monster/ShulkerEntity.java -@@ -183,7 +183,7 @@ - this.field_184708_bA = 0; - } else if (!this.field_70170_p.field_72995_K) { - BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); -- if (!blockstate.func_196958_f()) { -+ if (!blockstate.isAir(this.field_70170_p, blockpos)) { - if (blockstate.func_177230_c() == Blocks.field_196603_bb) { - Direction direction = blockstate.func_177229_b(PistonBlock.field_176387_N); - if (this.field_70170_p.func_175623_d(blockpos.func_177972_a(direction))) { -@@ -249,6 +249,7 @@ - this.func_226286_f_((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p() + 0.5D); - double d0 = 0.5D - (double)MathHelper.func_76126_a((0.5F + this.field_184706_by) * (float)Math.PI) * 0.5D; - double d1 = 0.5D - (double)MathHelper.func_76126_a((0.5F + this.field_184705_bx) * (float)Math.PI) * 0.5D; -+ if (this.isAddedToWorld() && this.field_70170_p instanceof net.minecraft.world.server.ServerWorld) ((net.minecraft.world.server.ServerWorld)this.field_70170_p).func_217464_b(this); // Forge - Process chunk registration after moving. - Direction direction3 = this.func_184696_cZ().func_176734_d(); - this.func_174826_a((new AxisAlignedBB(this.func_226277_ct_() - 0.5D, this.func_226278_cu_(), this.func_226281_cx_() - 0.5D, this.func_226277_ct_() + 0.5D, this.func_226278_cu_() + 1.0D, this.func_226281_cx_() + 0.5D)).func_72321_a((double)direction3.func_82601_c() * d0, (double)direction3.func_96559_d() * d0, (double)direction3.func_82599_e() * d0)); - double d2 = d0 - d1; -@@ -307,6 +308,12 @@ - } - - if (flag) { -+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, blockpos1.func_177958_n(), blockpos1.func_177956_o(), blockpos1.func_177952_p(), 0); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) flag = false; -+ blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ()); -+ } -+ -+ if (flag) { - this.func_184185_a(SoundEvents.field_187791_eX, 1.0F, 1.0F); - this.field_70180_af.func_187227_b(field_184701_b, Optional.of(blockpos1)); - this.field_70180_af.func_187227_b(field_184702_c, (byte)0); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch deleted file mode 100644 index 95b0e68a8..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/entity/monster/SilverfishEntity.java -+++ b/net/minecraft/entity/monster/SilverfishEntity.java -@@ -136,7 +136,7 @@ - return false; - } else { - Random random = this.field_75457_a.func_70681_au(); -- if (this.field_75457_a.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b) && random.nextInt(10) == 0) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75457_a.field_70170_p, this.field_75457_a) && random.nextInt(10) == 0) { - this.field_179483_b = Direction.func_176741_a(random); - BlockPos blockpos = (new BlockPos(this.field_75457_a.func_226277_ct_(), this.field_75457_a.func_226278_cu_() + 0.5D, this.field_75457_a.func_226281_cx_())).func_177972_a(this.field_179483_b); - BlockState blockstate = this.field_75457_a.field_70170_p.func_180495_p(blockpos); -@@ -205,7 +205,7 @@ - BlockState blockstate = world.func_180495_p(blockpos1); - Block block = blockstate.func_177230_c(); - if (block instanceof SilverfishBlock) { -- if (world.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, this.field_179464_a)) { - world.func_225521_a_(blockpos1, true, this.field_179464_a); - } else { - world.func_180501_a(blockpos1, ((SilverfishBlock)block).func_196468_d().func_176223_P(), 3); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch deleted file mode 100644 index 61266e095..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- a/net/minecraft/entity/monster/SlimeEntity.java -+++ b/net/minecraft/entity/monster/SlimeEntity.java -@@ -129,6 +129,7 @@ - if (this.field_70122_E && !this.field_175452_bi) { - int i = this.func_70809_q(); - -+ if (spawnCustomParticles()) i = 0; // don't spawn particles if it's handled by the implementation itself - 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; -@@ -180,9 +181,10 @@ - return (EntityType) super.func_200600_R(); - } - -- public void func_70106_y() { -+ @Override -+ public void remove(boolean keepData) { - int i = this.func_70809_q(); -- if (!this.field_70170_p.field_72995_K && i > 1 && this.func_110143_aJ() <= 0.0F) { -+ if (!this.field_70170_p.field_72995_K && i > 1 && this.func_110143_aJ() <= 0.0F && !this.field_70128_L) { - int j = 2 + this.field_70146_Z.nextInt(3); - - for(int k = 0; k < j; ++k) { -@@ -204,7 +206,7 @@ - } - } - -- super.func_70106_y(); -+ super.remove(keepData); - } - - public void func_70108_f(Entity p_70108_1_) { -@@ -262,7 +264,7 @@ - } - - public static boolean func_223366_c(EntityType p_223366_0_, IWorld p_223366_1_, SpawnReason p_223366_2_, BlockPos p_223366_3_, Random p_223366_4_) { -- if (p_223366_1_.func_72912_H().func_76067_t() == WorldType.field_77138_c && p_223366_4_.nextInt(4) != 1) { -+ if (p_223366_1_.func_72912_H().func_76067_t().handleSlimeSpawnReduction(p_223366_4_, p_223366_1_) && p_223366_4_.nextInt(4) != 1) { - return false; - } else { - if (p_223366_1_.func_175659_aa() != Difficulty.PEACEFUL) { -@@ -320,6 +322,12 @@ - return super.func_213305_a(p_213305_1_).func_220313_a(0.255F * (float)this.func_70809_q()); - } - -+ /** -+ * Called when the slime spawns particles on landing, see onUpdate. -+ * Return true to prevent the spawning of the default particles. -+ */ -+ protected boolean spawnCustomParticles() { return false; } -+ - static class AttackGoal extends Goal { - private final SlimeEntity field_179466_a; - private int field_179465_b; diff --git a/patches_old/minecraft/net/minecraft/entity/monster/SpiderEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/SpiderEntity.java.patch deleted file mode 100644 index 1215b5b94..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/SpiderEntity.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/net/minecraft/entity/monster/SpiderEntity.java -+++ b/net/minecraft/entity/monster/SpiderEntity.java -@@ -119,7 +119,12 @@ - } - - public boolean func_70687_e(EffectInstance p_70687_1_) { -- return p_70687_1_.func_188419_a() == Effects.field_76436_u ? false : super.func_70687_e(p_70687_1_); -+ if (p_70687_1_.func_188419_a() == Effects.field_76436_u) { -+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW; -+ } -+ return super.func_70687_e(p_70687_1_); - } - - public boolean func_70841_p() { diff --git a/patches_old/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch deleted file mode 100644 index d15a0c55e..000000000 --- a/patches_old/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/net/minecraft/entity/monster/ZombieEntity.java -+++ b/net/minecraft/entity/monster/ZombieEntity.java -@@ -110,7 +110,7 @@ - this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.23F); - this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D); - this.func_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(2.0D); -- this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * (double)0.1F); -+ this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * net.minecraftforge.common.ForgeConfig.SERVER.zombieBaseSummonChance.get()); - } - - protected void func_70088_a() { -@@ -315,12 +315,16 @@ - livingentity = (LivingEntity)p_70097_1_.func_76346_g(); - } - -- if (livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) { - int i = MathHelper.func_76128_c(this.func_226277_ct_()); - int j = MathHelper.func_76128_c(this.func_226278_cu_()); - int k = MathHelper.func_76128_c(this.func_226281_cx_()); -- ZombieEntity zombieentity = new ZombieEntity(this.field_70170_p); - -+ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent event = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, livingentity, this.func_110148_a(field_110186_bp).func_111126_e()); -+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return true; -+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || -+ livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) { -+ ZombieEntity zombieentity = event.getCustomSummonedAid() != null && event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ? event.getCustomSummonedAid() : EntityType.field_200725_aD.func_200721_a(this.field_70170_p); -+ - 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); -@@ -330,6 +334,7 @@ - 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(new BlockPos(zombieentity)), SpawnReason.REINFORCEMENT, (ILivingEntityData)null, (CompoundNBT)null); - this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, AttributeModifier.Operation.ADDITION)); -@@ -468,7 +473,7 @@ - float f = p_213386_2_.func_180170_c(); - this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * f); - if (p_213386_4_ == null) { -- p_213386_4_ = new ZombieEntity.GroupData(p_213386_1_.func_201674_k().nextFloat() < 0.05F); -+ p_213386_4_ = new ZombieEntity.GroupData(p_213386_1_.func_201674_k().nextFloat() < net.minecraftforge.common.ForgeConfig.SERVER.zombieBabyChance.get()); - } - - if (p_213386_4_ instanceof ZombieEntity.GroupData) { diff --git a/patches_old/minecraft/net/minecraft/entity/passive/BeeEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/BeeEntity.java.patch deleted file mode 100644 index 618d0032d..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/BeeEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/BeeEntity.java -+++ b/net/minecraft/entity/passive/BeeEntity.java -@@ -438,7 +438,7 @@ - return false; - } else { - TileEntity tileentity = this.field_70170_p.func_175625_s(this.field_226369_bI_); -- return tileentity != null && tileentity.func_200662_C() == TileEntityType.field_226985_G_; -+ return tileentity instanceof BeehiveTileEntity; - } - } - diff --git a/patches_old/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch deleted file mode 100644 index 8062f6f32..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/FoxEntity.java -+++ b/net/minecraft/entity/passive/FoxEntity.java -@@ -747,7 +747,7 @@ - } - - protected void func_220730_m() { -- if (FoxEntity.this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(FoxEntity.this.field_70170_p, FoxEntity.this)) { - BlockState blockstate = FoxEntity.this.field_70170_p.func_180495_p(this.field_179494_b); - if (blockstate.func_177230_c() == Blocks.field_222434_lW) { - int i = blockstate.func_177229_b(SweetBerryBushBlock.field_220125_a); diff --git a/patches_old/minecraft/net/minecraft/entity/passive/IronGolemEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/IronGolemEntity.java.patch deleted file mode 100644 index 07c8c58e3..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/IronGolemEntity.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/net/minecraft/entity/passive/IronGolemEntity.java -+++ b/net/minecraft/entity/passive/IronGolemEntity.java -@@ -113,9 +113,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_()); -- BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); -- if (!blockstate.func_196958_f()) { -- this.field_70170_p.func_195594_a(new BlockParticleData(ParticleTypes.field_197611_d, blockstate), this.func_226277_ct_() + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.func_213311_cf(), this.func_226278_cu_() + 0.1D, this.func_226281_cx_() + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.func_213311_cf(), 4.0D * ((double)this.field_70146_Z.nextFloat() - 0.5D), 0.5D, ((double)this.field_70146_Z.nextFloat() - 0.5D) * 4.0D); -+ BlockPos pos = new BlockPos(i, j, k); -+ BlockState blockstate = this.field_70170_p.func_180495_p(pos); -+ if (!blockstate.isAir(this.field_70170_p, pos)) { -+ this.field_70170_p.func_195594_a(new BlockParticleData(ParticleTypes.field_197611_d, blockstate).setPos(pos), this.func_226277_ct_() + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.func_213311_cf(), this.func_226278_cu_() + 0.1D, this.func_226281_cx_() + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.func_213311_cf(), 4.0D * ((double)this.field_70146_Z.nextFloat() - 0.5D), 0.5D, ((double)this.field_70146_Z.nextFloat() - 0.5D) * 4.0D); - } - } - diff --git a/patches_old/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch deleted file mode 100644 index 12bfcd170..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/OcelotEntity.java -+++ b/net/minecraft/entity/passive/OcelotEntity.java -@@ -161,7 +161,7 @@ - if ((this.field_70914_e == null || this.field_70914_e.func_75277_f()) && !this.func_213530_dX() && this.func_70877_b(itemstack) && p_184645_1_.func_70068_e(this) < 9.0D) { - this.func_175505_a(p_184645_1_, itemstack); - if (!this.field_70170_p.field_72995_K) { -- if (this.field_70146_Z.nextInt(3) == 0) { -+ if (this.field_70146_Z.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) { - this.func_213528_r(true); - this.func_213527_s(true); - this.field_70170_p.func_72960_a(this, (byte)41); diff --git a/patches_old/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch deleted file mode 100644 index 3500854f2..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/ParrotEntity.java -+++ b/net/minecraft/entity/passive/ParrotEntity.java -@@ -232,7 +232,7 @@ - } - - if (!this.field_70170_p.field_72995_K) { -- if (this.field_70146_Z.nextInt(10) == 0) { -+ if (this.field_70146_Z.nextInt(10) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) { - this.func_193101_c(p_184645_1_); - this.field_70170_p.func_72960_a(this, (byte)7); - } else { diff --git a/patches_old/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch deleted file mode 100644 index cf77ca9eb..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/RabbitEntity.java -+++ b/net/minecraft/entity/passive/RabbitEntity.java -@@ -492,7 +492,7 @@ - - public boolean func_75250_a() { - if (this.field_179496_a <= 0) { -- if (!this.field_179500_c.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { -+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179500_c.field_70170_p, this.field_179500_c)) { - return false; - } - diff --git a/patches_old/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch deleted file mode 100644 index fea6b0cc8..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/WolfEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/WolfEntity.java -+++ b/net/minecraft/entity/passive/WolfEntity.java -@@ -353,7 +353,7 @@ - itemstack.func_190918_g(1); - } - -- if (this.field_70146_Z.nextInt(3) == 0) { -+ if (this.field_70146_Z.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) { - this.func_193101_c(p_184645_1_); - this.field_70699_by.func_75499_g(); - this.func_70624_b((LivingEntity)null); diff --git a/patches_old/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch deleted file mode 100644 index e221e7abd..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/horse/AbstractHorseEntity.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/net/minecraft/entity/passive/horse/AbstractHorseEntity.java -+++ b/net/minecraft/entity/passive/horse/AbstractHorseEntity.java -@@ -263,6 +263,7 @@ - - this.field_110296_bG.func_110134_a(this); - this.func_110232_cE(); -+ this.itemHandler = net.minecraftforge.common.util.LazyOptional.of(() -> new net.minecraftforge.items.wrapper.InvWrapper(this.field_110296_bG)); - } - - protected void func_110232_cE() { -@@ -324,9 +325,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()); -- SoundType soundtype = p_180429_2_.func_215695_r(); -+ SoundType soundtype = p_180429_2_.getSoundType(field_70170_p, p_180429_1_, this); - if (blockstate.func_177230_c() == Blocks.field_150433_aE) { -- soundtype = blockstate.func_215695_r(); -+ soundtype = blockstate.getSoundType(field_70170_p, p_180429_1_, this); - } - - if (this.func_184207_aI() && this.field_190688_bE) { -@@ -947,4 +948,22 @@ - - return super.func_213386_a(p_213386_1_, p_213386_2_, p_213386_3_, p_213386_4_, p_213386_5_); - } -+ -+ private net.minecraftforge.common.util.LazyOptional itemHandler = null; -+ -+ @Override -+ public net.minecraftforge.common.util.LazyOptional getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.Direction facing) { -+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && itemHandler != null) -+ return itemHandler.cast(); -+ return super.getCapability(capability, facing); -+ } -+ -+ @Override -+ public void remove(boolean keepData) { -+ super.remove(keepData); -+ if (!keepData && itemHandler != null) { -+ itemHandler.invalidate(); -+ itemHandler = null; -+ } -+ } - } diff --git a/patches_old/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch deleted file mode 100644 index 889f37dd0..000000000 --- a/patches_old/minecraft/net/minecraft/entity/passive/horse/HorseEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/passive/horse/HorseEntity.java -+++ b/net/minecraft/entity/passive/horse/HorseEntity.java -@@ -175,6 +175,8 @@ - this.func_110230_cF(); - } - -+ ItemStack stack = this.field_110296_bG.func_70301_a(1); -+ if (func_190682_f(stack)) stack.onHorseArmorTick(field_70170_p, this); - } - - protected SoundEvent func_184639_G() { diff --git a/patches_old/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch deleted file mode 100644 index 7997fdbbf..000000000 --- a/patches_old/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch +++ /dev/null @@ -1,506 +0,0 @@ ---- a/net/minecraft/entity/player/PlayerEntity.java -+++ b/net/minecraft/entity/player/PlayerEntity.java -@@ -109,6 +109,10 @@ - import net.minecraftforge.api.distmarker.OnlyIn; - - public abstract class PlayerEntity extends LivingEntity { -+ public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; -+ protected java.util.HashMap spawnPosMap = new java.util.HashMap<>(); -+ protected java.util.HashMap spawnForcedMap = new java.util.HashMap<>(); -+ public static final net.minecraft.entity.ai.attributes.IAttribute REACH_DISTANCE = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "generic.reachDistance", 5.0D, 0.0D, 1024.0D).func_111112_a(true); - public static final EntitySize field_213835_bs = EntitySize.func_220314_b(0.6F, 1.8F); - private static final Map field_213836_b = ImmutableMap.builder().put(Pose.STANDING, field_213835_bs).put(Pose.SLEEPING, field_213377_as).put(Pose.FALL_FLYING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SWIMMING, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.SPIN_ATTACK, EntitySize.func_220314_b(0.6F, 0.6F)).put(Pose.CROUCHING, EntitySize.func_220314_b(0.6F, 1.5F)).put(Pose.DYING, EntitySize.func_220311_c(0.2F, 0.2F)).build(); - private static final DataParameter field_184829_a = EntityDataManager.func_187226_a(PlayerEntity.class, DataSerializers.field_187193_c); -@@ -151,6 +155,9 @@ - private final CooldownTracker field_184832_bU = this.func_184815_l(); - @Nullable - public FishingBobberEntity field_71104_cf; -+ private net.minecraft.world.dimension.DimensionType spawnDimension = net.minecraft.world.dimension.DimensionType.field_223227_a_; -+ private final java.util.Collection prefixes = new java.util.LinkedList(); -+ private final java.util.Collection suffixes = new java.util.LinkedList(); - - public PlayerEntity(World p_i45324_1_, GameProfile p_i45324_2_) { - super(EntityType.field_200729_aH, p_i45324_1_); -@@ -182,6 +189,7 @@ - this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.1F); - this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188790_f); - this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188792_h); -+ this.func_110140_aT().func_111150_b(REACH_DISTANCE); - } - - protected void func_70088_a() { -@@ -195,6 +203,7 @@ - } - - public void func_70071_h_() { -+ net.minecraftforge.fml.hooks.BasicEventHooks.onPlayerPreTick(this); - this.field_70145_X = this.func_175149_v(); - if (this.func_175149_v()) { - this.field_70122_E = false; -@@ -210,7 +219,7 @@ - this.field_71076_b = 100; - } - -- if (!this.field_70170_p.field_72995_K && this.field_70170_p.func_72935_r()) { -+ if (!this.field_70170_p.field_72995_K && !net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, func_213374_dv())) { - this.func_225652_a_(false, true); - } - } else if (this.field_71076_b > 0) { -@@ -268,6 +277,7 @@ - this.func_203041_m(); - this.field_184832_bU.func_185144_a(); - this.func_213832_dB(); -+ net.minecraftforge.fml.hooks.BasicEventHooks.onPlayerPostTick(this); - } - - public boolean func_226563_dT_() { -@@ -454,10 +464,10 @@ - this.field_71107_bF = this.field_71109_bG; - this.field_71109_bG = 0.0F; - this.func_71015_k(this.func_226277_ct_() - d0, this.func_226278_cu_() - d1, this.func_226281_cx_() - d2); -- if (this.func_184187_bx() instanceof PigEntity) { -+ if (this.func_184187_bx() instanceof LivingEntity && ((LivingEntity)this.func_184187_bx()).shouldRiderFaceForward(this)) { - this.field_70125_A = f1; - this.field_70177_z = f; -- this.field_70761_aq = ((PigEntity)this.func_184187_bx()).field_70761_aq; -+ this.field_70761_aq = ((LivingEntity)this.func_184187_bx()).field_70761_aq; - } - - } -@@ -570,6 +580,7 @@ - } - - public void func_70645_a(DamageSource p_70645_1_) { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; - super.func_70645_a(p_70645_1_); - this.func_226264_Z_(); - if (!this.func_175149_v()) { -@@ -623,12 +634,14 @@ - } - - public boolean func_225609_n_(boolean p_225609_1_) { -- return this.func_146097_a(this.field_71071_by.func_70298_a(this.field_71071_by.field_70461_c, p_225609_1_ && !this.field_71071_by.func_70448_g().func_190926_b() ? this.field_71071_by.func_70448_g().func_190916_E() : 1), false, true) != null; -+ ItemStack stack = field_71071_by.func_70448_g(); -+ if (stack.func_190926_b() || !stack.onDroppedByPlayer(this)) return false; -+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, this.field_71071_by.func_70298_a(this.field_71071_by.field_70461_c, p_225609_1_ && !this.field_71071_by.func_70448_g().func_190926_b() ? this.field_71071_by.func_70448_g().func_190916_E() : 1), true) != null; - } - - @Nullable - public ItemEntity func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) { -- return this.func_146097_a(p_71019_1_, false, p_71019_2_); -+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false); - } - - @Nullable -@@ -662,7 +675,12 @@ - } - } - -+ @Deprecated //Use location sensitive version below - public float func_184813_a(BlockState p_184813_1_) { -+ return getDigSpeed(p_184813_1_, null); -+ } -+ -+ public float getDigSpeed(BlockState p_184813_1_, @Nullable BlockPos pos) { - float f = this.field_71071_by.func_184438_a(p_184813_1_); - if (f > 1.0F) { - int i = EnchantmentHelper.func_185293_e(this); -@@ -704,11 +722,12 @@ - f /= 5.0F; - } - -+ f = net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(this, p_184813_1_, f, pos); - return f; - } - - public boolean func_184823_b(BlockState p_184823_1_) { -- return p_184823_1_.func_185904_a().func_76229_l() || this.field_71071_by.func_184432_b(p_184823_1_); -+ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_184823_1_, p_184823_1_.func_185904_a().func_76229_l() || this.field_71071_by.func_184432_b(p_184823_1_)); - } - - public void func_70037_a(CompoundNBT p_70037_1_) { -@@ -732,6 +751,17 @@ - this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); - } - -+ p_70037_1_.func_150295_c("Spawns", 10).forEach(e -> { -+ CompoundNBT data = (CompoundNBT)e; -+ ResourceLocation dim = new ResourceLocation(data.func_74779_i("Dim")); -+ this.spawnPosMap.put(dim, new BlockPos(data.func_74762_e("SpawnX"), data.func_74762_e("SpawnY"), data.func_74762_e("SpawnZ"))); -+ this.spawnForcedMap.put(dim, data.func_74767_n("SpawnForced")); -+ }); -+ net.minecraft.world.dimension.DimensionType spawnDim = null; -+ if (p_70037_1_.func_150297_b("SpawnDimension", net.minecraftforge.common.util.Constants.NBT.TAG_STRING)) -+ spawnDim = net.minecraft.world.dimension.DimensionType.func_193417_a(new ResourceLocation(p_70037_1_.func_74779_i("SpawnDimension"))); -+ this.spawnDimension = spawnDim != null ? spawnDim : net.minecraft.world.dimension.DimensionType.field_223227_a_; -+ - this.field_71100_bB.func_75112_a(p_70037_1_); - this.field_71075_bZ.func_75095_b(p_70037_1_); - if (p_70037_1_.func_150297_b("EnderItems", 9)) { -@@ -777,6 +807,23 @@ - p_213281_1_.func_218657_a("ShoulderEntityRight", this.func_192025_dl()); - } - -+ ListNBT spawnlist = new ListNBT(); -+ spawnPosMap.forEach((dim, pos) -> { -+ if (pos != null) { -+ CompoundNBT data = new CompoundNBT(); -+ data.func_74778_a("Dim", dim.toString()); -+ data.func_74768_a("SpawnX", pos.func_177958_n()); -+ data.func_74768_a("SpawnY", pos.func_177956_o()); -+ data.func_74768_a("SpawnZ", pos.func_177952_p()); -+ data.func_74757_a("SpawnForced", spawnForcedMap.getOrDefault(dim, false)); -+ spawnlist.add(data); -+ } -+ }); -+ p_213281_1_.func_218657_a("Spawns", spawnlist); -+ if (spawnDimension != net.minecraft.world.dimension.DimensionType.field_223227_a_) { -+ p_213281_1_.func_74778_a("SpawnDimension", spawnDimension.getRegistryName().toString()); -+ } -+ - } - - public boolean func_180431_b(DamageSource p_180431_1_) { -@@ -794,6 +841,7 @@ - } - - public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (!net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_)) return false; - if (this.func_180431_b(p_70097_1_)) { - return false; - } else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) { -@@ -825,7 +873,7 @@ - - protected void func_190629_c(LivingEntity p_190629_1_) { - super.func_190629_c(p_190629_1_); -- if (p_190629_1_.func_184614_ca().func_77973_b() instanceof AxeItem) { -+ if (p_190629_1_.func_184614_ca().canDisableShield(this.field_184627_bm, this, p_190629_1_)) { - this.func_190777_m(true); - } - -@@ -846,11 +894,12 @@ - } - - protected void func_184590_k(float p_184590_1_) { -- if (p_184590_1_ >= 3.0F && this.field_184627_bm.func_77973_b() == Items.field_185159_cQ) { -+ if (p_184590_1_ >= 3.0F && this.field_184627_bm.isShield(this)) { - int i = 1 + MathHelper.func_76141_d(p_184590_1_); - Hand hand = this.func_184600_cs(); - this.field_184627_bm.func_222118_a(i, this, (p_213833_1_) -> { - p_213833_1_.func_213334_d(hand); -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, this.field_184627_bm, hand); - }); - if (this.field_184627_bm.func_190926_b()) { - if (hand == Hand.MAIN_HAND) { -@@ -868,10 +917,13 @@ - - protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { - if (!this.func_180431_b(p_70665_1_)) { -+ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); -+ if (p_70665_2_ <= 0) return; - 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); - this.func_110149_m(this.func_110139_bj() - (p_70665_2_ - f2)); -+ f2 = net.minecraftforge.common.ForgeHooks.onLivingDamage(this, p_70665_1_, f2); - float f = p_70665_2_ - f2; - if (f > 0.0F && f < 3.4028235E37F) { - this.func_195067_a(Stats.field_212738_J, Math.round(f * 10.0F)); -@@ -926,6 +978,8 @@ - - return ActionResultType.PASS; - } else { -+ ActionResultType cancelResult = net.minecraftforge.common.ForgeHooks.onInteractEntity(this, p_190775_1_, p_190775_2_); -+ if (cancelResult != null) return cancelResult; - ItemStack itemstack = this.func_184586_b(p_190775_2_); - ItemStack itemstack1 = itemstack.func_77946_l(); - if (p_190775_1_.func_184230_a(this, p_190775_2_)) { -@@ -933,6 +987,9 @@ - itemstack.func_190920_e(itemstack1.func_190916_E()); - } - -+ if (!this.field_71075_bZ.field_75098_d && itemstack.func_190926_b()) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, itemstack1, p_190775_2_); -+ } - return ActionResultType.SUCCESS; - } else { - if (!itemstack.func_190926_b() && p_190775_1_ instanceof LivingEntity) { -@@ -942,6 +999,7 @@ - - if (itemstack.func_111282_a(this, (LivingEntity)p_190775_1_, p_190775_2_)) { - if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, itemstack1, p_190775_2_); - this.func_184611_a(p_190775_2_, ItemStack.field_190927_a); - } - -@@ -1018,6 +1076,7 @@ - } - - public void func_71059_n(Entity p_71059_1_) { -+ if (!net.minecraftforge.common.ForgeHooks.onPlayerAttackTarget(this, p_71059_1_)) return; - if (p_71059_1_.func_70075_an()) { - if (!p_71059_1_.func_85031_j(this)) { - float f = (float)this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111126_e(); -@@ -1045,8 +1104,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(); -+ net.minecraftforge.event.entity.player.CriticalHitEvent hitResult = net.minecraftforge.common.ForgeHooks.getCriticalHit(this, p_71059_1_, flag2, flag2 ? 1.5F : 1.0F); -+ flag2 = hitResult != null; - if (flag2) { -- f *= 1.5F; -+ f *= hitResult.getDamageModifier(); - } - - f = f + f1; -@@ -1134,8 +1195,10 @@ - } - - if (!this.field_70170_p.field_72995_K && !itemstack1.func_190926_b() && entity instanceof LivingEntity) { -+ ItemStack copy = itemstack1.func_77946_l(); - itemstack1.func_77961_a((LivingEntity)entity, this); - if (itemstack1.func_190926_b()) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, copy, Hand.MAIN_HAND); - this.func_184611_a(Hand.MAIN_HAND, ItemStack.field_190927_a); - } - } -@@ -1177,7 +1240,7 @@ - } - - if (this.field_70146_Z.nextFloat() < f) { -- this.func_184811_cZ().func_185145_a(Items.field_185159_cQ, 100); -+ this.func_184811_cZ().func_185145_a(this.func_184607_cu().func_77973_b(), 100); - this.func_184602_cy(); - this.field_70170_p.func_72960_a(this, (byte)30); - } -@@ -1203,8 +1266,9 @@ - public void func_71004_bE() { - } - -- public void func_70106_y() { -- super.func_70106_y(); -+ @Override -+ public void remove(boolean keepData) { -+ super.remove(keepData); - this.field_71069_bz.func_75134_a(this); - if (this.field_71070_bA != null) { - this.field_71070_bA.func_75134_a(this); -@@ -1221,6 +1285,9 @@ - } - - public Either func_213819_a(BlockPos p_213819_1_) { -+ Optional optAt = Optional.of(p_213819_1_); -+ PlayerEntity.SleepResult ret = net.minecraftforge.event.ForgeEventFactory.onPlayerSleepInBed(this, optAt); -+ if (ret != null) return Either.left(ret); - Direction direction = this.field_70170_p.func_180495_p(p_213819_1_).func_177229_b(HorizontalBlock.field_185512_D); - if (!this.field_70170_p.field_72995_K) { - if (this.func_70608_bn() || !this.func_70089_S()) { -@@ -1231,7 +1298,7 @@ - return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_HERE); - } - -- if (this.field_70170_p.func_72935_r()) { -+ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, optAt)) { - this.func_226560_a_(p_213819_1_, false, true); - return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW); - } -@@ -1273,6 +1340,7 @@ - } - - private boolean func_190774_a(BlockPos p_190774_1_, Direction p_190774_2_) { -+ if (p_190774_2_ == null) return false; - return this.func_230126_g_(p_190774_1_) || this.func_230126_g_(p_190774_1_.func_177972_a(p_190774_2_.func_176734_d())); - } - -@@ -1287,6 +1355,7 @@ - } - - public void func_225652_a_(boolean p_225652_1_, boolean p_225652_2_) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_225652_1_, p_225652_2_); - super.func_213366_dy(); - if (this.field_70170_p instanceof ServerWorld && p_225652_2_) { - ((ServerWorld)this.field_70170_p).func_72854_c(); -@@ -1300,17 +1369,17 @@ - } - - public static Optional func_213822_a(IWorldReader p_213822_0_, BlockPos p_213822_1_, boolean p_213822_2_) { -- Block block = p_213822_0_.func_180495_p(p_213822_1_).func_177230_c(); -- if (!(block instanceof BedBlock)) { -+ BlockState blockState = p_213822_0_.func_180495_p(p_213822_1_); -+ if (!(blockState.isBed(p_213822_0_, p_213822_1_, null))) { - if (!p_213822_2_) { - return Optional.empty(); - } else { -- boolean flag = block.func_181623_g(); -+ boolean flag = blockState.func_177230_c().func_181623_g(); - boolean flag1 = p_213822_0_.func_180495_p(p_213822_1_.func_177984_a()).func_177230_c().func_181623_g(); - return flag && flag1 ? Optional.of(new Vec3d((double)p_213822_1_.func_177958_n() + 0.5D, (double)p_213822_1_.func_177956_o() + 0.1D, (double)p_213822_1_.func_177952_p() + 0.5D)) : Optional.empty(); - } - } else { -- return BedBlock.func_220172_a(EntityType.field_200729_aH, p_213822_0_, p_213822_1_, 0); -+ return blockState.getBedSpawnPosition(EntityType.field_200729_aH, p_213822_0_, p_213822_1_, null); - } - } - -@@ -1325,15 +1394,62 @@ - public void func_146105_b(ITextComponent p_146105_1_, boolean p_146105_2_) { - } - -+ @Deprecated //Forge: Use Dimension sensitive version - public BlockPos func_180470_cg() { -- return this.field_71077_c; -+ return getBedLocation(this.field_71093_bK); - } - -+ /** -+ * A dimension aware version of getBedLocation. -+ * @param dim The dimension to get the bed spawn for -+ * @return The player specific spawn location for the dimension. May be null. -+ */ -+ public BlockPos getBedLocation(net.minecraft.world.dimension.DimensionType dim) { -+ return dim == net.minecraft.world.dimension.DimensionType.field_223227_a_ ? field_71077_c : spawnPosMap.get(dim.getRegistryName()); -+ } -+ -+ @Deprecated //Forge: Use Dimension sensitive version - public boolean func_82245_bX() { -- return this.field_82248_d; -+ return isSpawnForced(this.field_71093_bK); - } - -+ /** -+ * A dimension aware version of isSpawnForced. -+ * Noramally isSpawnForced is used to determine if the respawn system should check for a bed or not. -+ * This just extends that to be dimension aware. -+ * @param dim The dimension to get whether to check for a bed before spawning for -+ * @return The player specific spawn location for the dimension. May be null. -+ */ -+ public boolean isSpawnForced(net.minecraft.world.dimension.DimensionType dim) { -+ return dim == net.minecraft.world.dimension.DimensionType.field_223227_a_ ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false); -+ } -+ -+ @Deprecated //Forge: Use Dimension sensitive version - public void func_226560_a_(BlockPos p_226560_1_, boolean p_226560_2_, boolean p_226560_3_) { -+ setSpawnPoint(p_226560_1_, p_226560_2_, p_226560_3_, this.field_71093_bK); -+ } -+ -+ /** -+ * A dimension aware version of setSpawnChunk. -+ * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension. -+ * @param pos The spawn point to set as the player-specific spawn point for the dimension -+ * @param forced Whether or not the respawn code should check for a bed at this location (true means it won't check for a bed) -+ * @param dim Which dimension to apply the player-specific respawn point to -+ */ -+ public void setSpawnPoint(@Nullable BlockPos p_226560_1_, boolean p_226560_2_, boolean p_226560_3_, net.minecraft.world.dimension.DimensionType dim) { -+ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, p_226560_1_, p_226560_2_)) return; -+ if (dim != net.minecraft.world.dimension.DimensionType.field_223227_a_) { -+ if (p_226560_1_ != null) { -+ BlockPos old = spawnPosMap.put(dim.getRegistryName(), p_226560_1_); -+ spawnForcedMap.put(dim.getRegistryName(), p_226560_2_); -+ if (p_226560_3_ && !p_226560_1_.equals(old)) -+ this.func_145747_a(new TranslationTextComponent("block.minecraft.bed.set_spawn")); -+ } else { -+ spawnPosMap.remove(dim.getRegistryName()); -+ spawnForcedMap.remove(dim.getRegistryName()); -+ } -+ return; -+ } - if (p_226560_1_ != null) { - if (p_226560_3_ && !p_226560_1_.equals(this.field_71077_c)) { - this.func_145747_a(new TranslationTextComponent("block.minecraft.bed.set_spawn")); -@@ -1506,6 +1622,7 @@ - - public boolean func_225503_b_(float p_225503_1_, float p_225503_2_) { - if (this.field_71075_bZ.field_75101_c) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerFall(this, p_225503_1_, p_225503_2_); - return false; - } else { - if (p_225503_1_ >= 2.0F) { -@@ -1560,6 +1677,10 @@ - } - - public void func_195068_e(int p_195068_1_) { -+ net.minecraftforge.event.entity.player.PlayerXpEvent.XpChange event = new net.minecraftforge.event.entity.player.PlayerXpEvent.XpChange(this, p_195068_1_); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; -+ p_195068_1_ = event.getAmount(); -+ - 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); -@@ -1588,7 +1709,7 @@ - } - - public void func_192024_a(ItemStack p_192024_1_, int p_192024_2_) { -- this.field_71068_ca -= p_192024_2_; -+ func_82242_a(-p_192024_2_); - if (this.field_71068_ca < 0) { - this.field_71068_ca = 0; - this.field_71106_cc = 0.0F; -@@ -1599,6 +1720,10 @@ - } - - public void func_82242_a(int p_82242_1_) { -+ net.minecraftforge.event.entity.player.PlayerXpEvent.LevelChange event = new net.minecraftforge.event.entity.player.PlayerXpEvent.LevelChange(this, p_82242_1_); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; -+ p_82242_1_ = event.getLevels(); -+ - this.field_71068_ca += p_82242_1_; - if (this.field_71068_ca < 0) { - this.field_71068_ca = 0; -@@ -1789,7 +1914,10 @@ - } - - public ITextComponent func_145748_c_() { -- ITextComponent itextcomponent = ScorePlayerTeam.func_200541_a(this.func_96124_cp(), this.func_200200_C_()); -+ ITextComponent itextcomponent = new StringTextComponent(""); -+ prefixes.forEach(e -> itextcomponent.func_150257_a(e)); -+ itextcomponent.func_150257_a(ScorePlayerTeam.func_200541_a(this.func_96124_cp(), this.func_200200_C_())); -+ suffixes.forEach(e -> itextcomponent.func_150257_a(e)); - return this.func_208016_c(itextcomponent); - } - -@@ -2029,4 +2157,45 @@ - return this.field_221260_g; - } - } -+ -+ // =========== FORGE START ==============// -+ public net.minecraft.world.dimension.DimensionType getSpawnDimension() { -+ return this.spawnDimension; -+ } -+ -+ public void setSpawnDimenion(net.minecraft.world.dimension.DimensionType dim) { -+ this.spawnDimension = dim; -+ } -+ -+ public Collection getPrefixes() { -+ return this.prefixes; -+ } -+ -+ public Collection getSuffixes() { -+ return this.suffixes; -+ } -+ -+ private final net.minecraftforge.common.util.LazyOptional -+ playerMainHandler = net.minecraftforge.common.util.LazyOptional.of( -+ () -> new net.minecraftforge.items.wrapper.PlayerMainInvWrapper(field_71071_by)); -+ -+ private final net.minecraftforge.common.util.LazyOptional -+ playerEquipmentHandler = net.minecraftforge.common.util.LazyOptional.of( -+ () -> new net.minecraftforge.items.wrapper.CombinedInvWrapper( -+ new net.minecraftforge.items.wrapper.PlayerArmorInvWrapper(field_71071_by), -+ new net.minecraftforge.items.wrapper.PlayerOffhandInvWrapper(field_71071_by))); -+ -+ private final net.minecraftforge.common.util.LazyOptional -+ playerJoinedHandler = net.minecraftforge.common.util.LazyOptional.of( -+ () -> new net.minecraftforge.items.wrapper.PlayerInvWrapper(field_71071_by)); -+ -+ @Override -+ public net.minecraftforge.common.util.LazyOptional getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable Direction facing) { -+ if (this.func_70089_S() && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { -+ if (facing == null) return playerJoinedHandler.cast(); -+ else if (facing.func_176740_k().func_200128_b()) return playerMainHandler.cast(); -+ else if (facing.func_176740_k().func_176722_c()) return playerEquipmentHandler.cast(); -+ } -+ return super.getCapability(capability, facing); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch b/patches_old/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch deleted file mode 100644 index d27a05c5e..000000000 --- a/patches_old/minecraft/net/minecraft/entity/player/PlayerInventory.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/net/minecraft/entity/player/PlayerInventory.java -+++ b/net/minecraft/entity/player/PlayerInventory.java -@@ -214,7 +214,8 @@ - int i = p_191973_2_.func_190916_E(); - ItemStack itemstack = this.func_70301_a(p_191973_1_); - if (itemstack.func_190926_b()) { -- itemstack = new ItemStack(item, 0); -+ itemstack = p_191973_2_.func_77946_l(); // Forge: Replace Item clone above to preserve item capabilities when picking the item up. -+ itemstack.func_190920_e(0); - if (p_191973_2_.func_77942_o()) { - itemstack.func_77982_d(p_191973_2_.func_77978_p().func_74737_b()); - } -@@ -265,7 +266,7 @@ - } - } - } -- -+ field_70460_b.forEach(e -> e.onArmorTick(field_70458_d.field_70170_p, field_70458_d)); - } - - public boolean func_70441_a(ItemStack p_70441_1_) { -@@ -318,6 +319,8 @@ - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.func_85055_a(throwable, "Adding item to inventory"); - CrashReportCategory crashreportcategory = crashreport.func_85058_a("Item being added"); -+ crashreportcategory.func_189529_a("Registry Name", () -> String.valueOf(p_191971_2_.func_77973_b().getRegistryName())); -+ crashreportcategory.func_189529_a("Item Class", () -> p_191971_2_.func_77973_b().getClass().getName()); - crashreportcategory.func_71507_a("Item ID", Item.func_150891_b(p_191971_2_.func_77973_b())); - crashreportcategory.func_71507_a("Item data", p_191971_2_.func_77952_i()); - crashreportcategory.func_189529_a("Item name", () -> { diff --git a/patches_old/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch b/patches_old/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch deleted file mode 100644 index 899fbcfc2..000000000 --- a/patches_old/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch +++ /dev/null @@ -1,173 +0,0 @@ ---- a/net/minecraft/entity/player/ServerPlayerEntity.java -+++ b/net/minecraft/entity/player/ServerPlayerEntity.java -@@ -432,6 +432,7 @@ - } - - public void func_70645_a(DamageSource p_70645_1_) { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; - 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(); -@@ -550,13 +551,15 @@ - return this.field_71133_b.func_71219_W(); - } - -+ @Override - @Nullable -- public Entity func_212321_a(DimensionType p_212321_1_) { -+ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null; - this.field_184851_cj = true; - DimensionType dimensiontype = this.field_71093_bK; -- if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) { -+ if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_ && teleporter instanceof net.minecraft.world.Teleporter) { //Forge: Fix non-vanilla teleporters triggering end credits - this.func_213319_R(); -- this.func_71121_q().func_217434_e(this); -+ this.func_71121_q().removePlayer(this, true); //Forge: The player entity is cloned so keep the data until after cloning calls copyFrom - if (!this.field_71136_j) { - this.field_71136_j = true; - this.field_71135_a.func_147359_a(new SChangeGameStatePacket(4, this.field_192040_cp ? 0.0F : 1.0F)); -@@ -569,12 +572,14 @@ - this.field_71093_bK = p_212321_1_; - ServerWorld serverworld1 = this.field_71133_b.func_71218_a(p_212321_1_); - WorldInfo worldinfo = serverworld1.func_72912_H(); -+ net.minecraftforge.fml.network.NetworkHooks.sendDimensionDataPacket(this.field_71135_a.field_147371_a, this); - this.field_71135_a.func_147359_a(new SRespawnPacket(p_212321_1_, WorldInfo.func_227498_c_(worldinfo.func_76063_b()), worldinfo.func_76067_t(), this.field_71134_c.func_73081_b())); - this.field_71135_a.func_147359_a(new SServerDifficultyPacket(worldinfo.func_176130_y(), worldinfo.func_176123_z())); - PlayerList playerlist = this.field_71133_b.func_184103_al(); - playerlist.func_187243_f(this); -- serverworld.func_217434_e(this); -- 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, serverworld1, 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_(); -@@ -583,13 +588,11 @@ - double d3 = 8.0D; - float f2 = f1; - serverworld.func_217381_Z().func_76320_a("moving"); -+ double moveFactor = serverworld.func_201675_m().getMovementFactor() / serverworld1.func_201675_m().getMovementFactor(); -+ d0 *= moveFactor; -+ d2 *= moveFactor; - if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223228_b_) { - this.field_193110_cw = this.func_213303_ch(); -- d0 /= 8.0D; -- d2 /= 8.0D; -- } else if (dimensiontype == DimensionType.field_223228_b_ && p_212321_1_ == DimensionType.field_223227_a_) { -- d0 *= 8.0D; -- d2 *= 8.0D; - } else if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223229_c_) { - BlockPos blockpos = serverworld1.func_180504_m(); - d0 = (double)blockpos.func_177958_n(); -@@ -630,7 +633,7 @@ - - this.func_70012_b((double)i, (double)j, (double)k, f1, 0.0F); - this.func_213317_d(Vec3d.field_186680_a); -- } else if (!serverworld1.func_85176_s().func_222268_a(this, f2)) { -+ } else if (spawnPortal && !serverworld1.func_85176_s().func_222268_a(this, f2)) { - serverworld1.func_85176_s().func_85188_a(this); - serverworld1.func_85176_s().func_222268_a(this, f2); - } -@@ -640,6 +643,9 @@ - serverworld1.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(serverworld1); - this.field_71135_a.func_147359_a(new SPlayerAbilitiesPacket(this.field_71075_bZ)); - playerlist.func_72354_b(this, serverworld1); -@@ -653,6 +659,7 @@ - this.field_71144_ck = -1; - this.field_71149_ch = -1.0F; - this.field_71146_ci = -1; -+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, dimensiontype, p_212321_1_); - return this; - } - } -@@ -788,6 +795,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; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA)); - return OptionalInt.of(this.field_71139_cq); - } - } -@@ -806,6 +814,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); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA)); - } - - public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) { -@@ -863,6 +872,7 @@ - - public void func_71128_l() { - this.field_71070_bA.func_75134_a(this); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Close(this, this.field_71070_bA)); - this.field_71070_bA = this.field_71069_bz; - } - -@@ -989,6 +999,20 @@ - 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()); -+ -+ this.spawnPosMap = p_193104_1_.spawnPosMap; -+ this.spawnForcedMap = p_193104_1_.spawnForcedMap; -+ if(p_193104_1_.field_71093_bK != DimensionType.field_223227_a_) { -+ this.field_71077_c = p_193104_1_.field_71077_c; -+ this.field_82248_d = p_193104_1_.field_82248_d; -+ } -+ -+ //Copy over a section of the Entity Data from the old player. -+ //Allows mods to specify data that persists after players respawn. -+ CompoundNBT old = p_193104_1_.getPersistentData(); -+ if (old.func_74764_b(PERSISTED_NBT_TAG)) -+ getPersistentData().func_218657_a(PERSISTED_NBT_TAG, old.func_74781_a(PERSISTED_NBT_TAG)); -+ net.minecraftforge.event.ForgeEventFactory.onPlayerClone(this, p_193104_1_, !p_193104_2_); - } - - protected void func_70670_a(EffectInstance p_70670_1_) { -@@ -1207,15 +1231,17 @@ - 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_); -- } else { -+ } else if (net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_200619_1_.field_73011_w.func_186058_p())) { -+ DimensionType oldDimension = this.field_71093_bK; - ServerWorld serverworld = this.func_71121_q(); - this.field_71093_bK = p_200619_1_.field_73011_w.func_186058_p(); - WorldInfo worldinfo = p_200619_1_.func_72912_H(); -+ net.minecraftforge.fml.network.NetworkHooks.sendDimensionDataPacket(this.field_71135_a.field_147371_a, this); - this.field_71135_a.func_147359_a(new SRespawnPacket(this.field_71093_bK, WorldInfo.func_227498_c_(worldinfo.func_76063_b()), worldinfo.func_76067_t(), this.field_71134_c.func_73081_b())); - this.field_71135_a.func_147359_a(new SServerDifficultyPacket(worldinfo.func_176130_y(), worldinfo.func_176123_z())); - this.field_71133_b.func_184103_al().func_187243_f(this); -- serverworld.func_217434_e(this); -- this.field_70128_L = false; -+ serverworld.removePlayer(this, true); //Forge: The player entity itself is moved, and not cloned. So we need to keep the data alive with no matching invalidate call later. -+ this.revive(); - 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); -@@ -1224,6 +1250,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); -+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, oldDimension, this.field_71093_bK); - } - - } -@@ -1261,6 +1288,8 @@ - if (itementity == null) { - return null; - } else { -+ if (captureDrops() != null) captureDrops().add(itementity); -+ else - this.field_70170_p.func_217376_c(itementity); - ItemStack itemstack = itementity.func_92059_d(); - if (p_146097_3_) { diff --git a/patches_old/minecraft/net/minecraft/inventory/container/BrewingStandContainer.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/BrewingStandContainer.java.patch deleted file mode 100644 index 5f9380ffd..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/BrewingStandContainer.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/net/minecraft/inventory/container/BrewingStandContainer.java -+++ b/net/minecraft/inventory/container/BrewingStandContainer.java -@@ -143,7 +143,7 @@ - } - - public boolean func_75214_a(ItemStack p_75214_1_) { -- return PotionBrewing.func_185205_a(p_75214_1_); -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_75214_1_); - } - - public int func_75219_a() { -@@ -167,6 +167,7 @@ - public ItemStack func_190901_a(PlayerEntity p_190901_1_, ItemStack p_190901_2_) { - Potion potion = PotionUtils.func_185191_c(p_190901_2_); - if (p_190901_1_ instanceof ServerPlayerEntity) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerBrewedPotion(p_190901_1_, p_190901_2_); - CriteriaTriggers.field_192130_j.func_192173_a((ServerPlayerEntity)p_190901_1_, potion); - } - -@@ -175,8 +176,7 @@ - } - - public static boolean func_75243_a_(ItemStack p_75243_0_) { -- Item item = p_75243_0_.func_77973_b(); -- return item == Items.field_151068_bn || item == Items.field_185155_bH || item == Items.field_185156_bI || item == Items.field_151069_bo; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_75243_0_); - } - } - } diff --git a/patches_old/minecraft/net/minecraft/inventory/container/ContainerType.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/ContainerType.java.patch deleted file mode 100644 index d73023fcd..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/ContainerType.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/net/minecraft/inventory/container/ContainerType.java -+++ b/net/minecraft/inventory/container/ContainerType.java -@@ -5,7 +5,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public class ContainerType { -+public class ContainerType extends net.minecraftforge.registries.ForgeRegistryEntry> implements net.minecraftforge.common.extensions.IForgeContainerType { - public static final ContainerType field_221507_a = func_221505_a("generic_9x1", ChestContainer::func_216986_a); - public static final ContainerType field_221508_b = func_221505_a("generic_9x2", ChestContainer::func_216987_b); - public static final ContainerType field_221509_c = func_221505_a("generic_9x3", ChestContainer::func_216988_c); -@@ -45,6 +45,14 @@ - public T func_221506_a(int p_221506_1_, PlayerInventory p_221506_2_) { - return this.field_221530_x.create(p_221506_1_, p_221506_2_); - } -+ -+ @Override -+ public T create(int windowId, PlayerInventory playerInv, net.minecraft.network.PacketBuffer extraData) { -+ if (this.field_221530_x instanceof net.minecraftforge.fml.network.IContainerFactory) { -+ return ((net.minecraftforge.fml.network.IContainerFactory) this.field_221530_x).create(windowId, playerInv, extraData); -+ } -+ return func_221506_a(windowId, playerInv); -+ } - - public interface IFactory { - @OnlyIn(Dist.CLIENT) diff --git a/patches_old/minecraft/net/minecraft/inventory/container/CraftingResultSlot.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/CraftingResultSlot.java.patch deleted file mode 100644 index 2bc3bb302..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/CraftingResultSlot.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/net/minecraft/inventory/container/CraftingResultSlot.java -+++ b/net/minecraft/inventory/container/CraftingResultSlot.java -@@ -43,6 +43,7 @@ - protected void func_75208_c(ItemStack p_75208_1_) { - if (this.field_75237_g > 0) { - p_75208_1_.func_77980_a(this.field_75238_b.field_70170_p, this.field_75238_b, this.field_75237_g); -+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerCraftingEvent(this.field_75238_b, p_75208_1_, this.field_75239_a); - } - - if (this.field_75224_c instanceof IRecipeHolder) { -@@ -54,8 +55,9 @@ - - public ItemStack func_190901_a(PlayerEntity p_190901_1_, ItemStack p_190901_2_) { - this.func_75208_c(p_190901_2_); -+ net.minecraftforge.common.ForgeHooks.setCraftingPlayer(p_190901_1_); - NonNullList nonnulllist = p_190901_1_.field_70170_p.func_199532_z().func_215369_c(IRecipeType.field_222149_a, this.field_75239_a, p_190901_1_.field_70170_p); -- -+ net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null); - for(int i = 0; i < nonnulllist.size(); ++i) { - ItemStack itemstack = this.field_75239_a.func_70301_a(i); - ItemStack itemstack1 = nonnulllist.get(i); diff --git a/patches_old/minecraft/net/minecraft/inventory/container/FurnaceResultSlot.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/FurnaceResultSlot.java.patch deleted file mode 100644 index 34ef30cf5..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/FurnaceResultSlot.java.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/net/minecraft/inventory/container/FurnaceResultSlot.java -+++ b/net/minecraft/inventory/container/FurnaceResultSlot.java -@@ -44,5 +44,6 @@ - } - - this.field_75228_b = 0; -+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerSmeltedEvent(this.field_75229_a, p_75208_1_); - } - } diff --git a/patches_old/minecraft/net/minecraft/inventory/container/GrindstoneContainer.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/GrindstoneContainer.java.patch deleted file mode 100644 index 3d10230db..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/GrindstoneContainer.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/net/minecraft/inventory/container/GrindstoneContainer.java -+++ b/net/minecraft/inventory/container/GrindstoneContainer.java -@@ -141,12 +141,13 @@ - } - - Item item = itemstack.func_77973_b(); -- int k = item.func_77612_l() - itemstack.func_77952_i(); -- int l = item.func_77612_l() - itemstack1.func_77952_i(); -- int i1 = k + l + item.func_77612_l() * 5 / 100; -- i = Math.max(item.func_77612_l() - i1, 0); -+ int k = itemstack.func_77958_k() - itemstack.func_77952_i(); -+ int l = itemstack.func_77958_k() - itemstack1.func_77952_i(); -+ int i1 = k + l + itemstack.func_77958_k() * 5 / 100; -+ i = Math.max(itemstack.func_77958_k() - i1, 0); - itemstack2 = this.func_217011_b(itemstack, itemstack1); -- if (!itemstack2.func_77984_f()) { -+ if (!itemstack2.isRepairable()) i = itemstack.func_77952_i(); -+ if (!itemstack2.func_77984_f() || !itemstack2.isRepairable()) { - if (!ItemStack.func_77989_b(itemstack, itemstack1)) { - this.field_217013_c.func_70299_a(0, ItemStack.field_190927_a); - this.func_75142_b(); diff --git a/patches_old/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch deleted file mode 100644 index 166ad22be..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/PlayerContainer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/inventory/container/PlayerContainer.java -+++ b/net/minecraft/inventory/container/PlayerContainer.java -@@ -50,7 +50,7 @@ - } - - public boolean func_75214_a(ItemStack p_75214_1_) { -- return equipmentslottype == MobEntity.func_184640_d(p_75214_1_); -+ return p_75214_1_.canEquip(equipmentslottype, field_82862_h); - } - - public boolean func_82869_a(PlayerEntity p_82869_1_) { diff --git a/patches_old/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch deleted file mode 100644 index 021a03c2f..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/RecipeBookContainer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/inventory/container/RecipeBookContainer.java -+++ b/net/minecraft/inventory/container/RecipeBookContainer.java -@@ -31,4 +31,8 @@ - - @OnlyIn(Dist.CLIENT) - public abstract int func_203721_h(); -+ -+ public java.util.List getRecipeBookCategories() { -+ return net.minecraft.client.util.ClientRecipeBook.func_216769_b(this); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/inventory/container/Slot.java.patch b/patches_old/minecraft/net/minecraft/inventory/container/Slot.java.patch deleted file mode 100644 index 7a99868fa..000000000 --- a/patches_old/minecraft/net/minecraft/inventory/container/Slot.java.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/net/minecraft/inventory/container/Slot.java -+++ b/net/minecraft/inventory/container/Slot.java -@@ -77,7 +77,7 @@ - @Nullable - @OnlyIn(Dist.CLIENT) - public Pair func_225517_c_() { -- return null; -+ return backgroundPair; - } - - public ItemStack func_75209_a(int p_75209_1_) { -@@ -92,4 +92,36 @@ - public boolean func_111238_b() { - return true; - } -+ -+ /** -+ * Retrieves the index in the inventory for this slot, this value should typically not -+ * be used, but can be useful for some occasions. -+ * -+ * @return Index in associated inventory for this slot. -+ */ -+ public int getSlotIndex() { -+ return field_75225_a; -+ } -+ -+ /** -+ * Checks if the other slot is in the same inventory, by comparing the inventory reference. -+ * @param other -+ * @return true if the other slot is in the same inventory -+ */ -+ public boolean isSameInventory(Slot other) { -+ return this.field_75224_c == other.field_75224_c; -+ } -+ -+ private Pair backgroundPair; -+ /** -+ * Sets the background atlas and sprite location. -+ * -+ * @param atlas The atlas name -+ * @param sprite The sprite located on that atlas. -+ * @return this, to allow chaining. -+ */ -+ public Slot setBackground(ResourceLocation atlas, ResourceLocation sprite) { -+ this.backgroundPair = Pair.of(atlas, sprite); -+ return this; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/ArmorItem.java.patch b/patches_old/minecraft/net/minecraft/item/ArmorItem.java.patch deleted file mode 100644 index ac2688615..000000000 --- a/patches_old/minecraft/net/minecraft/item/ArmorItem.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/item/ArmorItem.java -+++ b/net/minecraft/item/ArmorItem.java -@@ -102,4 +102,8 @@ - public int func_200881_e() { - return this.field_77879_b; - } -+ -+ public float getToughness() { -+ return this.field_189415_e; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/ArrowItem.java.patch b/patches_old/minecraft/net/minecraft/item/ArrowItem.java.patch deleted file mode 100644 index cff1d60a1..000000000 --- a/patches_old/minecraft/net/minecraft/item/ArrowItem.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/item/ArrowItem.java -+++ b/net/minecraft/item/ArrowItem.java -@@ -15,4 +15,9 @@ - arrowentity.func_184555_a(p_200887_2_); - return arrowentity; - } -+ -+ public boolean isInfinite(ItemStack stack, ItemStack bow, net.minecraft.entity.player.PlayerEntity player) { -+ int enchant = net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantments.field_185312_x, bow); -+ return enchant <= 0 ? false : this.getClass() == ArrowItem.class; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/BlockItem.java.patch b/patches_old/minecraft/net/minecraft/item/BlockItem.java.patch deleted file mode 100644 index 32cf5ad8e..000000000 --- a/patches_old/minecraft/net/minecraft/item/BlockItem.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- a/net/minecraft/item/BlockItem.java -+++ b/net/minecraft/item/BlockItem.java -@@ -69,8 +69,8 @@ - } - } - -- SoundType soundtype = blockstate1.func_215695_r(); -- world.func_184133_a(playerentity, blockpos, this.func_219983_a(blockstate1), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); -+ SoundType soundtype = blockstate1.getSoundType(world, blockpos, p_195942_1_.func_195999_j()); -+ world.func_184133_a(playerentity, blockpos, this.getPlaceSound(blockstate1, world, blockpos, p_195942_1_.func_195999_j()), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); - itemstack.func_190918_g(1); - return ActionResultType.SUCCESS; - } -@@ -78,10 +78,16 @@ - } - } - -+ @Deprecated //Forge: Use more sensitive version {@link BlockItem#getPlaceSound(BlockState, IBlockReader, BlockPos, Entity) } - protected SoundEvent func_219983_a(BlockState p_219983_1_) { - return p_219983_1_.func_215695_r().func_185841_e(); - } - -+ //Forge: Sensitive version of BlockItem#getPlaceSound -+ protected SoundEvent getPlaceSound(BlockState state, World world, BlockPos pos, PlayerEntity entity) { -+ return state.getSoundType(world, pos, entity).func_185841_e(); -+ } -+ - @Nullable - public BlockItemUseContext func_219984_b(BlockItemUseContext p_219984_1_) { - return p_219984_1_; -@@ -189,10 +195,18 @@ - } - - public Block func_179223_d() { -+ return this.getBlockRaw() == null ? null : this.getBlockRaw().delegate.get(); -+ } -+ -+ private Block getBlockRaw() { - return this.field_150939_a; - } - - public void func_195946_a(Map p_195946_1_, Item p_195946_2_) { - p_195946_1_.put(this.func_179223_d(), p_195946_2_); - } -+ -+ public void removeFromBlockToItemMap(Map blockToItemMap, Item itemIn) { -+ blockToItemMap.remove(this.func_179223_d()); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/BoneMealItem.java.patch b/patches_old/minecraft/net/minecraft/item/BoneMealItem.java.patch deleted file mode 100644 index 69195f1f5..000000000 --- a/patches_old/minecraft/net/minecraft/item/BoneMealItem.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- a/net/minecraft/item/BoneMealItem.java -+++ b/net/minecraft/item/BoneMealItem.java -@@ -27,7 +27,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()); -- if (func_195966_a(p_195939_1_.func_195996_i(), world, blockpos)) { -+ if (applyBonemeal(p_195939_1_.func_195996_i(), world, blockpos, p_195939_1_.func_195999_j())) { - if (!world.field_72995_K) { - world.func_217379_c(2005, blockpos, 0); - } -@@ -48,8 +48,17 @@ - } - } - -+ @Deprecated //Forge: Use Player/Hand version - public static boolean func_195966_a(ItemStack p_195966_0_, World p_195966_1_, BlockPos p_195966_2_) { -+ if (p_195966_1_ instanceof net.minecraft.world.server.ServerWorld) -+ return applyBonemeal(p_195966_0_, p_195966_1_, p_195966_2_, net.minecraftforge.common.util.FakePlayerFactory.getMinecraft((net.minecraft.world.server.ServerWorld)p_195966_1_)); -+ return false; -+ } -+ -+ public static boolean applyBonemeal(ItemStack p_195966_0_, World p_195966_1_, BlockPos p_195966_2_, net.minecraft.entity.player.PlayerEntity player) { - BlockState blockstate = p_195966_1_.func_180495_p(p_195966_2_); -+ int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, p_195966_1_, p_195966_2_, blockstate, p_195966_0_); -+ if (hook != 0) return hook > 0; - 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 @@ - } - - BlockState blockstate = p_195965_0_.func_180495_p(p_195965_1_); -- if (!blockstate.func_196958_f()) { -+ if (!blockstate.isAir(p_195965_0_, p_195965_1_)) { - for(int i = 0; i < p_195965_2_; ++i) { - double d0 = field_77697_d.nextGaussian() * 0.02D; - double d1 = field_77697_d.nextGaussian() * 0.02D; diff --git a/patches_old/minecraft/net/minecraft/item/DyeColor.java.patch b/patches_old/minecraft/net/minecraft/item/DyeColor.java.patch deleted file mode 100644 index 8fce4c2bd..000000000 --- a/patches_old/minecraft/net/minecraft/item/DyeColor.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/net/minecraft/item/DyeColor.java -+++ b/net/minecraft/item/DyeColor.java -@@ -41,6 +41,7 @@ - private final int field_196066_w; - private final float[] field_193352_x; - private final int field_196067_y; -+ private final net.minecraft.tags.Tag 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_) { -@@ -53,6 +54,7 @@ - int j = (p_i50049_5_ & '\uff00') >> 8; - int k = (p_i50049_5_ & 255) >> 0; - this.field_196066_w = k << 16 | j << 8 | i << 0; -+ this.tag = new net.minecraft.tags.ItemTags.Wrapper(new net.minecraft.util.ResourceLocation("forge", "dyes/" + p_i50049_4_)); - this.field_193352_x = new float[]{(float)i / 255.0F, (float)j / 255.0F, (float)k / 255.0F}; - this.field_196067_y = p_i50049_7_; - } -@@ -111,4 +113,25 @@ - public String func_176610_l() { - return this.field_176785_v; - } -+ -+ public int getColorValue() { -+ return field_193351_w; -+ } -+ -+ public net.minecraft.tags.Tag getTag() { -+ return tag; -+ } -+ -+ @Nullable -+ public static DyeColor getColor(ItemStack stack) { -+ if (stack.func_77973_b() instanceof DyeItem) -+ return ((DyeItem)stack.func_77973_b()).func_195962_g(); -+ -+ for (DyeColor color : field_196062_q) { -+ if (stack.func_77973_b().func_206844_a(color.getTag())) -+ return color; -+ } -+ -+ return null; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/DyeableHorseArmorItem.java.patch b/patches_old/minecraft/net/minecraft/item/DyeableHorseArmorItem.java.patch deleted file mode 100644 index 52fe87e3f..000000000 --- a/patches_old/minecraft/net/minecraft/item/DyeableHorseArmorItem.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/item/DyeableHorseArmorItem.java -+++ b/net/minecraft/item/DyeableHorseArmorItem.java -@@ -4,4 +4,7 @@ - public DyeableHorseArmorItem(int p_i50047_1_, String p_i50047_2_, Item.Properties p_i50047_3_) { - super(p_i50047_1_, p_i50047_2_, p_i50047_3_); - } -+ public DyeableHorseArmorItem(int p_i50047_1_, net.minecraft.util.ResourceLocation texture, Item.Properties p_i50047_3_) { -+ super(p_i50047_1_, texture, p_i50047_3_); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/FilledMapItem.java.patch b/patches_old/minecraft/net/minecraft/item/FilledMapItem.java.patch deleted file mode 100644 index 19b52fe96..000000000 --- a/patches_old/minecraft/net/minecraft/item/FilledMapItem.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/net/minecraft/item/FilledMapItem.java -+++ b/net/minecraft/item/FilledMapItem.java -@@ -52,6 +52,16 @@ - - @Nullable - public static MapData func_195950_a(ItemStack p_195950_0_, World p_195950_1_) { -+ // FORGE: Add instance method for mods to override -+ Item map = p_195950_0_.func_77973_b(); -+ if (map instanceof FilledMapItem) { -+ return ((FilledMapItem)map).getCustomMapData(p_195950_0_, p_195950_1_); -+ } -+ return null; -+ } -+ -+ @Nullable -+ protected MapData getCustomMapData(ItemStack p_195950_0_, World p_195950_1_) { - MapData mapdata = func_219994_a(p_195950_0_, p_195950_1_); - if (mapdata == null && !p_195950_1_.field_72995_K) { - mapdata = func_195951_a(p_195950_0_, p_195950_1_, p_195950_1_.func_72912_H().func_76079_c(), p_195950_1_.func_72912_H().func_76074_e(), 3, false, false, p_195950_1_.field_73011_w.func_186058_p()); diff --git a/patches_old/minecraft/net/minecraft/item/FishBucketItem.java.patch b/patches_old/minecraft/net/minecraft/item/FishBucketItem.java.patch deleted file mode 100644 index cd8070e4f..000000000 --- a/patches_old/minecraft/net/minecraft/item/FishBucketItem.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/item/FishBucketItem.java -+++ b/net/minecraft/item/FishBucketItem.java -@@ -25,11 +25,19 @@ - public class FishBucketItem extends BucketItem { - private final EntityType field_203794_a; - -+ @Deprecated - public FishBucketItem(EntityType p_i49022_1_, Fluid p_i49022_2_, Item.Properties p_i49022_3_) { - super(p_i49022_2_, p_i49022_3_); - this.field_203794_a = p_i49022_1_; -+ this.fishTypeSupplier = () -> p_i49022_1_; - } - -+ public FishBucketItem(java.util.function.Supplier> fishTypeIn, java.util.function.Supplier p_i49022_2_, Item.Properties builder) { -+ super(p_i49022_2_, builder); -+ this.field_203794_a = null; -+ this.fishTypeSupplier = fishTypeIn; -+ } -+ - 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_); -@@ -78,4 +86,9 @@ - } - - } -+ -+ private final java.util.function.Supplier> fishTypeSupplier; -+ protected EntityType getFishType() { -+ return fishTypeSupplier.get(); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/FlintAndSteelItem.java.patch b/patches_old/minecraft/net/minecraft/item/FlintAndSteelItem.java.patch deleted file mode 100644 index a79283750..000000000 --- a/patches_old/minecraft/net/minecraft/item/FlintAndSteelItem.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/item/FlintAndSteelItem.java -+++ b/net/minecraft/item/FlintAndSteelItem.java -@@ -65,7 +65,8 @@ - boolean flag = false; - - for(Direction direction : Direction.Plane.HORIZONTAL) { -- if (p_219996_1_.func_180495_p(p_219996_2_.func_177972_a(direction)).func_177230_c() == Blocks.field_150343_Z && ((NetherPortalBlock)Blocks.field_150427_aO).func_201816_b(p_219996_1_, p_219996_2_) != null) { -+ BlockPos framePos = p_219996_2_.func_177972_a(direction); -+ if (p_219996_1_.func_180495_p(framePos).isPortalFrame(p_219996_1_, framePos) && ((NetherPortalBlock)Blocks.field_150427_aO).func_201816_b(p_219996_1_, p_219996_2_) != null) { - flag = true; - } - } diff --git a/patches_old/minecraft/net/minecraft/item/Food.java.patch b/patches_old/minecraft/net/minecraft/item/Food.java.patch deleted file mode 100644 index 8b1215590..000000000 --- a/patches_old/minecraft/net/minecraft/item/Food.java.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- a/net/minecraft/item/Food.java -+++ b/net/minecraft/item/Food.java -@@ -11,15 +11,26 @@ - private final boolean field_221472_c; - private final boolean field_221473_d; - private final boolean field_221474_e; -- private final List> field_221475_f; -+ private final List, Float>> field_221475_f; -+ -+ private Food(Food.Builder builder) { -+ this.field_221470_a = builder.field_221458_a; -+ this.field_221471_b = builder.field_221459_b; -+ this.field_221472_c = builder.field_221460_c; -+ this.field_221473_d = builder.field_221461_d; -+ this.field_221474_e = builder.field_221462_e; -+ this.field_221475_f = builder.field_221463_f; -+ } - -+ // Forge: Use builder method instead -+ @Deprecated - private Food(int p_i50106_1_, float p_i50106_2_, boolean p_i50106_3_, boolean p_i50106_4_, boolean p_i50106_5_, List> p_i50106_6_) { - this.field_221470_a = p_i50106_1_; - this.field_221471_b = p_i50106_2_; - this.field_221472_c = p_i50106_3_; - this.field_221473_d = p_i50106_4_; - this.field_221474_e = p_i50106_5_; -- this.field_221475_f = p_i50106_6_; -+ this.field_221475_f = p_i50106_6_.stream().map(pair -> Pair., Float>of(pair::getLeft, pair.getRight())).collect(java.util.stream.Collectors.toList()); - } - - public int func_221466_a() { -@@ -43,7 +54,7 @@ - } - - public List> func_221464_f() { -- return this.field_221475_f; -+ return this.field_221475_f.stream().map(pair -> Pair.of(pair.getLeft() != null ? pair.getLeft().get() : null, pair.getRight())).collect(java.util.stream.Collectors.toList()); - } - - public static class Builder { -@@ -52,7 +63,7 @@ - private boolean field_221460_c; - private boolean field_221461_d; - private boolean field_221462_e; -- private final List> field_221463_f = Lists.newArrayList(); -+ private final List, Float>> field_221463_f = Lists.newArrayList(); - - public Food.Builder func_221456_a(int p_221456_1_) { - this.field_221458_a = p_221456_1_; -@@ -78,14 +89,21 @@ - this.field_221462_e = true; - return this; - } -+ -+ public Food.Builder effect(java.util.function.Supplier effectIn, float probability) { -+ this.field_221463_f.add(Pair.of(effectIn, probability)); -+ return this; -+ } - -+ // Forge: Use supplier method instead -+ @Deprecated - public Food.Builder func_221452_a(EffectInstance p_221452_1_, float p_221452_2_) { -- this.field_221463_f.add(Pair.of(p_221452_1_, p_221452_2_)); -+ this.field_221463_f.add(Pair.of(() -> p_221452_1_, p_221452_2_)); - return this; - } - - public Food func_221453_d() { -- return new Food(this.field_221458_a, this.field_221459_b, this.field_221460_c, this.field_221461_d, this.field_221462_e, this.field_221463_f); -+ return new Food(this); - } - } - } diff --git a/patches_old/minecraft/net/minecraft/item/HoeItem.java.patch b/patches_old/minecraft/net/minecraft/item/HoeItem.java.patch deleted file mode 100644 index b75b128f5..000000000 --- a/patches_old/minecraft/net/minecraft/item/HoeItem.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/item/HoeItem.java -+++ b/net/minecraft/item/HoeItem.java -@@ -31,7 +31,9 @@ - public ActionResultType func_195939_a(ItemUseContext p_195939_1_) { - World world = p_195939_1_.func_195991_k(); - BlockPos blockpos = p_195939_1_.func_195995_a(); -- if (p_195939_1_.func_196000_l() != Direction.DOWN && world.func_180495_p(blockpos.func_177984_a()).func_196958_f()) { -+ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(p_195939_1_); -+ if (hook != 0) return hook > 0 ? ActionResultType.SUCCESS : ActionResultType.FAIL; -+ if (p_195939_1_.func_196000_l() != Direction.DOWN && world.func_175623_d(blockpos.func_177984_a())) { - BlockState blockstate = field_195973_b.get(world.func_180495_p(blockpos).func_177230_c()); - if (blockstate != null) { - PlayerEntity playerentity = p_195939_1_.func_195999_j(); diff --git a/patches_old/minecraft/net/minecraft/item/HorseArmorItem.java.patch b/patches_old/minecraft/net/minecraft/item/HorseArmorItem.java.patch deleted file mode 100644 index 49f526153..000000000 --- a/patches_old/minecraft/net/minecraft/item/HorseArmorItem.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/net/minecraft/item/HorseArmorItem.java -+++ b/net/minecraft/item/HorseArmorItem.java -@@ -6,17 +6,21 @@ - - public class HorseArmorItem extends Item { - private final int field_219978_a; -- private final String field_219979_b; -+ private final ResourceLocation texture; - - public HorseArmorItem(int p_i50042_1_, String p_i50042_2_, Item.Properties p_i50042_3_) { -+ this(p_i50042_1_, new ResourceLocation("textures/entity/horse/armor/horse_armor_" + p_i50042_2_ + ".png"), p_i50042_3_); -+ } -+ -+ public HorseArmorItem(int p_i50042_1_, ResourceLocation texture, Item.Properties p_i50042_3_) { - super(p_i50042_3_); - this.field_219978_a = p_i50042_1_; -- this.field_219979_b = "textures/entity/horse/armor/horse_armor_" + p_i50042_2_ + ".png"; -+ this.texture = texture; - } - - @OnlyIn(Dist.CLIENT) - public ResourceLocation func_219976_d() { -- return new ResourceLocation(this.field_219979_b); -+ return texture; - } - - public int func_219977_e() { diff --git a/patches_old/minecraft/net/minecraft/item/ItemGroup.java.patch b/patches_old/minecraft/net/minecraft/item/ItemGroup.java.patch deleted file mode 100644 index 411c9d11e..000000000 --- a/patches_old/minecraft/net/minecraft/item/ItemGroup.java.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- a/net/minecraft/item/ItemGroup.java -+++ b/net/minecraft/item/ItemGroup.java -@@ -104,11 +104,14 @@ - private EnchantmentType[] field_111230_s = new EnchantmentType[0]; - private ItemStack field_151245_t; - -+ public ItemGroup(String label) { -+ this(-1, label); -+ } -+ - 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_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 @@ - - @OnlyIn(Dist.CLIENT) - public int func_78020_k() { -+ if (field_78033_n > 11) return ((field_78033_n - 12) % 10) % 5; - return this.field_78033_n % 6; - } - - @OnlyIn(Dist.CLIENT) - public boolean func_78023_l() { -+ if (field_78033_n > 11) return ((field_78033_n - 12) % 10) < 5; - return this.field_78033_n < 6; - } - -@@ -220,4 +225,58 @@ - } - - } -+ -+ public int getTabPage() { -+ return field_78033_n < 12 ? 0 : ((field_78033_n - 12) / 10) + 1; -+ } -+ -+ public boolean hasSearchBar() { -+ return field_78033_n == field_78027_g.field_78033_n; -+ } -+ -+ /** -+ * Gets the width of the search bar of the creative tab, use this if your -+ * creative tab name overflows together with a custom texture. -+ * -+ * @return The width of the search bar, 89 by default -+ */ -+ public int getSearchbarWidth() { -+ return 89; -+ } -+ -+ @OnlyIn(Dist.CLIENT) -+ public net.minecraft.util.ResourceLocation getBackgroundImage() { -+ return new net.minecraft.util.ResourceLocation("textures/gui/container/creative_inventory/tab_" + this.func_78015_f()); -+ } -+ -+ private static final net.minecraft.util.ResourceLocation CREATIVE_INVENTORY_TABS = new net.minecraft.util.ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); -+ @OnlyIn(Dist.CLIENT) -+ public net.minecraft.util.ResourceLocation getTabsImage() { -+ return CREATIVE_INVENTORY_TABS; -+ } -+ -+ public int getLabelColor() { -+ return 4210752; -+ } -+ -+ 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; -+ } -+ if (index >= field_78032_a.length) { -+ ItemGroup[] tmp = new ItemGroup[index + 1]; -+ System.arraycopy(field_78032_a, 0, tmp, 0, field_78032_a.length); -+ field_78032_a = tmp; -+ } -+ field_78032_a[index] = newGroup; -+ return index; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/ItemStack.java.patch b/patches_old/minecraft/net/minecraft/item/ItemStack.java.patch deleted file mode 100644 index dc7384472..000000000 --- a/patches_old/minecraft/net/minecraft/item/ItemStack.java.patch +++ /dev/null @@ -1,245 +0,0 @@ ---- a/net/minecraft/item/ItemStack.java -+++ b/net/minecraft/item/ItemStack.java -@@ -66,7 +66,7 @@ - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - --public final class ItemStack { -+public final class ItemStack extends net.minecraftforge.common.capabilities.CapabilityProvider implements net.minecraftforge.common.extensions.IForgeItemStack { - private static final Logger field_199558_c = LogManager.getLogger(); - public static final ItemStack field_190927_a = new ItemStack((Item)null); - public static final DecimalFormat field_111284_a = func_208306_D(); -@@ -82,6 +82,9 @@ - private CachedBlockInfo field_179550_j; - private boolean field_179551_k; - -+ private net.minecraftforge.registries.IRegistryDelegate delegate; -+ private CompoundNBT capNBT; -+ - private static DecimalFormat func_208306_D() { - DecimalFormat decimalformat = new DecimalFormat("#.##"); - decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT)); -@@ -92,7 +95,10 @@ - this(p_i48203_1_, 1); - } - -- public ItemStack(IItemProvider p_i48204_1_, int p_i48204_2_) { -+ public ItemStack(IItemProvider p_i48204_1_, int p_i48204_2_) { this(p_i48204_1_, p_i48204_2_, null); } -+ public ItemStack(IItemProvider p_i48204_1_, int p_i48204_2_, @Nullable CompoundNBT capNBT) { -+ super(ItemStack.class); -+ this.capNBT = capNBT; - this.field_151002_e = p_i48204_1_ == null ? null : p_i48204_1_.func_199767_j(); - this.field_77994_a = p_i48204_2_; - if (this.field_151002_e != null && this.field_151002_e.func_77645_m()) { -@@ -100,6 +106,7 @@ - } - - this.func_190923_F(); -+ this.forgeInit(); - } - - private void func_190923_F() { -@@ -108,6 +115,8 @@ - } - - private ItemStack(CompoundNBT p_i47263_1_) { -+ super(ItemStack.class); -+ this.capNBT = p_i47263_1_.func_74764_b("ForgeCaps") ? p_i47263_1_.func_74775_l("ForgeCaps") : null; - this.field_151002_e = Registry.field_212630_s.func_82594_a(new ResourceLocation(p_i47263_1_.func_74779_i("id"))); - this.field_77994_a = p_i47263_1_.func_74771_c("Count"); - if (p_i47263_1_.func_150297_b("tag", 10)) { -@@ -120,6 +129,7 @@ - } - - this.func_190923_F(); -+ this.forgeInit(); - } - - public static ItemStack func_199557_a(CompoundNBT p_199557_0_) { -@@ -134,7 +144,7 @@ - public boolean func_190926_b() { - if (this == field_190927_a) { - return true; -- } else if (this.func_77973_b() != null && this.func_77973_b() != Items.field_190931_a) { -+ } else if (this.getItemRaw() != null && this.getItemRaw() != Items.field_190931_a) { - return this.field_77994_a <= 0; - } else { - return true; -@@ -150,10 +160,19 @@ - } - - public Item func_77973_b() { -- return this.field_190928_g ? Items.field_190931_a : this.field_151002_e; -+ return this.field_190928_g || this.delegate == null ? Items.field_190931_a : this.delegate.get(); - } - - 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_); -+ return onItemUse(p_196084_1_, (c) -> func_77973_b().func_195939_a(p_196084_1_)); -+ } -+ -+ public ActionResultType onItemUseFirst(ItemUseContext context) { -+ return onItemUse(context, (c) -> func_77973_b().onItemUseFirst(this, context)); -+ } -+ -+ private ActionResultType onItemUse(ItemUseContext p_196084_1_, java.util.function.Function callback) { - PlayerEntity playerentity = p_196084_1_.func_195999_j(); - BlockPos blockpos = p_196084_1_.func_195995_a(); - CachedBlockInfo cachedblockinfo = new CachedBlockInfo(p_196084_1_.func_195991_k(), blockpos, false); -@@ -161,7 +180,7 @@ - return ActionResultType.PASS; - } else { - Item item = this.func_77973_b(); -- ActionResultType actionresulttype = item.func_195939_a(p_196084_1_); -+ ActionResultType actionresulttype = callback.apply(p_196084_1_); - if (playerentity != null && actionresulttype == ActionResultType.SUCCESS) { - playerentity.func_71029_a(Stats.field_75929_E.func_199076_b(item)); - } -@@ -189,12 +208,15 @@ - if (this.field_77990_d != null) { - p_77955_1_.func_218657_a("tag", this.field_77990_d.func_74737_b()); - } -- -+ CompoundNBT cnbt = this.serializeCaps(); -+ if (cnbt != null && !cnbt.isEmpty()) { -+ p_77955_1_.func_218657_a("ForgeCaps", cnbt); -+ } - return p_77955_1_; - } - - public int func_77976_d() { -- return this.func_77973_b().func_77639_j(); -+ return this.func_77973_b().getItemStackLimit(this); - } - - public boolean func_77985_e() { -@@ -202,7 +224,7 @@ - } - - public boolean func_77984_f() { -- if (!this.field_190928_g && this.func_77973_b().func_77612_l() > 0) { -+ if (!this.field_190928_g && this.func_77973_b().getMaxDamage(this) > 0) { - CompoundNBT compoundnbt = this.func_77978_p(); - return compoundnbt == null || !compoundnbt.func_74767_n("Unbreakable"); - } else { -@@ -211,19 +233,19 @@ - } - - public boolean func_77951_h() { -- return this.func_77984_f() && this.func_77952_i() > 0; -+ return this.func_77984_f() && func_77973_b().isDamaged(this); - } - - public int func_77952_i() { -- return this.field_77990_d == null ? 0 : this.field_77990_d.func_74762_e("Damage"); -+ return this.func_77973_b().getDamage(this); - } - - public void func_196085_b(int p_196085_1_) { -- this.func_196082_o().func_74768_a("Damage", Math.max(0, p_196085_1_)); -+ this.func_77973_b().setDamage(this, p_196085_1_); - } - - public int func_77958_k() { -- return this.func_77973_b().func_77612_l(); -+ return this.func_77973_b().getMaxDamage(this); - } - - public boolean func_96631_a(int p_96631_1_, Random p_96631_2_, @Nullable ServerPlayerEntity p_96631_3_) { -@@ -259,6 +281,7 @@ - public void func_222118_a(int p_222118_1_, T p_222118_2_, Consumer p_222118_3_) { - if (!p_222118_2_.field_70170_p.field_72995_K && (!(p_222118_2_ instanceof PlayerEntity) || !((PlayerEntity)p_222118_2_).field_71075_bZ.field_75098_d)) { - if (this.func_77984_f()) { -+ p_222118_1_ = this.func_77973_b().damageItem(this, p_222118_1_, p_222118_2_, p_222118_3_); - if (this.func_96631_a(p_222118_1_, p_222118_2_.func_70681_au(), p_222118_2_ instanceof ServerPlayerEntity ? (ServerPlayerEntity)p_222118_2_ : null)) { - p_222118_3_.accept(p_222118_2_); - Item item = this.func_77973_b(); -@@ -291,7 +314,7 @@ - } - - public boolean func_150998_b(BlockState p_150998_1_) { -- return this.func_77973_b().func_150897_b(p_150998_1_); -+ return this.func_77973_b().canHarvestBlock(this, p_150998_1_); - } - - public boolean func_111282_a(PlayerEntity p_111282_1_, LivingEntity p_111282_2_, Hand p_111282_3_) { -@@ -302,7 +325,7 @@ - if (this.func_190926_b()) { - return field_190927_a; - } else { -- ItemStack itemstack = new ItemStack(this.func_77973_b(), this.field_77994_a); -+ ItemStack itemstack = new ItemStack(this.func_77973_b(), this.field_77994_a, this.serializeCaps()); - itemstack.func_190915_d(this.func_190921_D()); - if (this.field_77990_d != null) { - itemstack.field_77990_d = this.field_77990_d.func_74737_b(); -@@ -319,7 +342,7 @@ - if (p_77970_0_.field_77990_d == null && p_77970_1_.field_77990_d != null) { - return false; - } else { -- return p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d); -+ return (p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d)) && p_77970_0_.areCapsCompatible(p_77970_1_); - } - } else { - return false; -@@ -342,7 +365,7 @@ - } else if (this.field_77990_d == null && p_77959_1_.field_77990_d != null) { - return false; - } else { -- return this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d); -+ return (this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d)) && this.areCapsCompatible(p_77959_1_); - } - } - -@@ -652,6 +675,7 @@ - } - } - -+ net.minecraftforge.event.ForgeEventFactory.onItemTooltip(this, p_82840_1_, list, p_82840_2_); - return list; - } - -@@ -772,7 +796,7 @@ - } - } - } else { -- multimap = this.func_77973_b().func_111205_h(p_111283_1_); -+ multimap = this.func_77973_b().getAttributeModifiers(p_111283_1_, this); - } - - multimap.values().forEach((p_226631_0_) -> { -@@ -915,6 +939,35 @@ - return this.func_77973_b().func_219971_r(); - } - -+ // FORGE START -+ public void deserializeNBT(CompoundNBT nbt) { -+ final ItemStack itemStack = ItemStack.func_199557_a(nbt); -+ getStack().func_77982_d(itemStack.func_77978_p()); -+ if (itemStack.capNBT != null) deserializeCaps(itemStack.capNBT); -+ } -+ -+ /** -+ * Set up forge's ItemStack additions. -+ */ -+ private void forgeInit() { -+ Item item = getItemRaw(); -+ if (item != null) { -+ this.delegate = item.delegate; -+ net.minecraftforge.common.capabilities.ICapabilityProvider provider = item.initCapabilities(this, this.capNBT); -+ this.gatherCapabilities(provider); -+ if (this.capNBT != null) deserializeCaps(this.capNBT); -+ } -+ } -+ -+ /** -+ * Internal call to get the actual item, not the delegate. -+ * In all other methods, FML replaces calls to this.item with the item delegate. -+ */ -+ @Nullable -+ private Item getItemRaw() { -+ return this.field_151002_e; -+ } -+ - public SoundEvent func_226629_F_() { - return this.func_77973_b().func_225520_U__(); - } diff --git a/patches_old/minecraft/net/minecraft/item/Items.java.patch b/patches_old/minecraft/net/minecraft/item/Items.java.patch deleted file mode 100644 index c2fcd96b3..000000000 --- a/patches_old/minecraft/net/minecraft/item/Items.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/item/Items.java -+++ b/net/minecraft/item/Items.java -@@ -12,6 +12,7 @@ - import net.minecraft.util.SoundEvents; - import net.minecraft.util.registry.Registry; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public class Items { - public static final Item field_190931_a = func_221546_a(Blocks.field_150350_a, new AirItem(Blocks.field_150350_a, new Item.Properties())); - public static final Item field_221574_b = func_221542_a(Blocks.field_150348_b, ItemGroup.field_78030_b); diff --git a/patches_old/minecraft/net/minecraft/item/LilyPadItem.java.patch b/patches_old/minecraft/net/minecraft/item/LilyPadItem.java.patch deleted file mode 100644 index 6f6375d5f..000000000 --- a/patches_old/minecraft/net/minecraft/item/LilyPadItem.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/item/LilyPadItem.java -+++ b/net/minecraft/item/LilyPadItem.java -@@ -50,7 +50,15 @@ - Material material = blockstate.func_185904_a(); - IFluidState ifluidstate = p_77659_1_.func_204610_c(blockpos); - if ((ifluidstate.func_206886_c() == Fluids.field_204546_a || material == Material.field_151588_w) && p_77659_1_.func_175623_d(blockpos1)) { -+ -+ // special case for handling block placement with water lilies -+ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_1_, blockpos1); - p_77659_1_.func_180501_a(blockpos1, Blocks.field_196651_dG.func_176223_P(), 11); -+ if (net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_77659_2_, blocksnapshot, net.minecraft.util.Direction.UP)) { -+ blocksnapshot.restore(true, false); -+ return ActionResult.func_226251_d_(itemstack); -+ } -+ - if (p_77659_2_ instanceof ServerPlayerEntity) { - CriteriaTriggers.field_193137_x.func_193173_a((ServerPlayerEntity)p_77659_2_, blockpos1, itemstack); - } diff --git a/patches_old/minecraft/net/minecraft/item/MilkBucketItem.java.patch b/patches_old/minecraft/net/minecraft/item/MilkBucketItem.java.patch deleted file mode 100644 index 133b3f114..000000000 --- a/patches_old/minecraft/net/minecraft/item/MilkBucketItem.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/item/MilkBucketItem.java -+++ b/net/minecraft/item/MilkBucketItem.java -@@ -15,6 +15,8 @@ - } - - public ItemStack func_77654_b(ItemStack p_77654_1_, World p_77654_2_, LivingEntity p_77654_3_) { -+ if (!p_77654_2_.field_72995_K) p_77654_3_.curePotionEffects(p_77654_1_); // FORGE - move up so stack.shrink does not turn stack into air -+ - if (p_77654_3_ instanceof ServerPlayerEntity) { - ServerPlayerEntity serverplayerentity = (ServerPlayerEntity)p_77654_3_; - CriteriaTriggers.field_193138_y.func_193148_a(serverplayerentity, p_77654_1_); -@@ -25,10 +27,6 @@ - p_77654_1_.func_190918_g(1); - } - -- if (!p_77654_2_.field_72995_K) { -- p_77654_3_.func_195061_cb(); -- } -- - return p_77654_1_.func_190926_b() ? new ItemStack(Items.field_151133_ar) : p_77654_1_; - } - -@@ -44,4 +42,9 @@ - p_77659_2_.func_184598_c(p_77659_3_); - return ActionResult.func_226248_a_(p_77659_2_.func_184586_b(p_77659_3_)); - } -+ -+ @Override -+ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, @javax.annotation.Nullable net.minecraft.nbt.CompoundNBT nbt) { -+ return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/MinecartItem.java.patch b/patches_old/minecraft/net/minecraft/item/MinecartItem.java.patch deleted file mode 100644 index 957a16961..000000000 --- a/patches_old/minecraft/net/minecraft/item/MinecartItem.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/net/minecraft/item/MinecartItem.java -+++ b/net/minecraft/item/MinecartItem.java -@@ -26,7 +26,7 @@ - double d2 = p_82487_1_.func_82616_c() + (double)direction.func_82599_e() * 1.125D; - BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(direction); - BlockState blockstate = world.func_180495_p(blockpos); -- RailShape railshape = blockstate.func_177230_c() instanceof AbstractRailBlock ? blockstate.func_177229_b(((AbstractRailBlock)blockstate.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; -+ RailShape railshape = blockstate.func_177230_c() instanceof AbstractRailBlock ? ((AbstractRailBlock)blockstate.func_177230_c()).getRailDirection(blockstate, world, blockpos, null) : RailShape.NORTH_SOUTH; - double d3; - if (blockstate.func_203425_a(BlockTags.field_203437_y)) { - if (railshape.func_208092_c()) { -@@ -35,12 +35,12 @@ - d3 = 0.1D; - } - } else { -- if (!blockstate.func_196958_f() || !world.func_180495_p(blockpos.func_177977_b()).func_203425_a(BlockTags.field_203437_y)) { -+ if (!blockstate.isAir(world, blockpos) || !world.func_180495_p(blockpos.func_177977_b()).func_203425_a(BlockTags.field_203437_y)) { - return this.field_96465_b.dispense(p_82487_1_, p_82487_2_); - } - - BlockState blockstate1 = world.func_180495_p(blockpos.func_177977_b()); -- RailShape railshape1 = blockstate1.func_177230_c() instanceof AbstractRailBlock ? blockstate1.func_177229_b(((AbstractRailBlock)blockstate1.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; -+ RailShape railshape1 = blockstate1.func_177230_c() instanceof AbstractRailBlock ? ((AbstractRailBlock)blockstate1.func_177230_c()).getRailDirection(blockstate1, world, blockpos.func_177977_b(), null) : RailShape.NORTH_SOUTH; - if (direction != Direction.DOWN && railshape1.func_208092_c()) { - d3 = -0.4D; - } else { -@@ -79,7 +79,7 @@ - } else { - ItemStack itemstack = p_195939_1_.func_195996_i(); - if (!world.field_72995_K) { -- RailShape railshape = blockstate.func_177230_c() instanceof AbstractRailBlock ? blockstate.func_177229_b(((AbstractRailBlock)blockstate.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; -+ RailShape railshape = blockstate.func_177230_c() instanceof AbstractRailBlock ? ((AbstractRailBlock)blockstate.func_177230_c()).getRailDirection(blockstate, world, blockpos, null) : RailShape.NORTH_SOUTH; - double d0 = 0.0D; - if (railshape.func_208092_c()) { - d0 = 0.5D; diff --git a/patches_old/minecraft/net/minecraft/item/MusicDiscItem.java.patch b/patches_old/minecraft/net/minecraft/item/MusicDiscItem.java.patch deleted file mode 100644 index 915348992..000000000 --- a/patches_old/minecraft/net/minecraft/item/MusicDiscItem.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- a/net/minecraft/item/MusicDiscItem.java -+++ b/net/minecraft/item/MusicDiscItem.java -@@ -21,17 +21,40 @@ - import net.minecraftforge.api.distmarker.OnlyIn; - - public class MusicDiscItem extends Item { -+ @Deprecated // Forge: refer to WorldRender#playRecord. Modders: there's no need to reflectively modify this map! - private static final Map field_150928_b = Maps.newHashMap(); - private final int field_195977_c; -+ @Deprecated // Forge: refer to soundSupplier - private final SoundEvent field_185076_b; -+ private final java.util.function.Supplier soundSupplier; - -+ @Deprecated // Forge: Use the constructor that takes a supplier instead - protected MusicDiscItem(int p_i48475_1_, SoundEvent p_i48475_2_, Item.Properties p_i48475_3_) { - super(p_i48475_3_); - this.field_195977_c = p_i48475_1_; - this.field_185076_b = p_i48475_2_; - field_150928_b.put(this.field_185076_b, this); -+ this.soundSupplier = this.field_185076_b.delegate; - } - -+ /** -+ * For mod use, allows to create a music disc without having to create a new -+ * SoundEvent before their registry event is fired. -+ * -+ * @param comparatorValue The value this music disc should output on the comparator. Must be between 0 and 15. -+ * @param soundSupplier A supplier that provides the sound that should be played. Use a -+ * {@link net.minecraftforge.fml.RegistryObject}{@code } or a -+ * {@link net.minecraftforge.registries.IRegistryDelegate} for this parameter. -+ * @param builder A set of {@link Item.Properties} that describe this item. -+ */ -+ public MusicDiscItem(int comparatorValue, java.util.function.Supplier soundSupplier, Item.Properties builder) -+ { -+ super(builder); -+ this.field_195977_c = comparatorValue; -+ this.field_185076_b = null; -+ this.soundSupplier = soundSupplier; -+ } -+ - public ActionResultType func_195939_a(ItemUseContext p_195939_1_) { - World world = p_195939_1_.func_195991_k(); - BlockPos blockpos = p_195939_1_.func_195995_a(); -@@ -76,6 +99,6 @@ - - @OnlyIn(Dist.CLIENT) - public SoundEvent func_185075_h() { -- return this.field_185076_b; -+ return this.soundSupplier.get(); - } - } diff --git a/patches_old/minecraft/net/minecraft/item/Rarity.java.patch b/patches_old/minecraft/net/minecraft/item/Rarity.java.patch deleted file mode 100644 index 333800c24..000000000 --- a/patches_old/minecraft/net/minecraft/item/Rarity.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/item/Rarity.java -+++ b/net/minecraft/item/Rarity.java -@@ -2,7 +2,7 @@ - - import net.minecraft.util.text.TextFormatting; - --public enum Rarity { -+public enum Rarity implements net.minecraftforge.common.IExtensibleEnum { - COMMON(TextFormatting.WHITE), - UNCOMMON(TextFormatting.YELLOW), - RARE(TextFormatting.AQUA), -@@ -13,4 +13,8 @@ - private Rarity(TextFormatting p_i48837_3_) { - this.field_77937_e = p_i48837_3_; - } -+ -+ public static Rarity create(String name, TextFormatting p_i48837_3_) { -+ throw new IllegalStateException("Enum not extended"); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/ShearsItem.java.patch b/patches_old/minecraft/net/minecraft/item/ShearsItem.java.patch deleted file mode 100644 index 2cb1d3f8e..000000000 --- a/patches_old/minecraft/net/minecraft/item/ShearsItem.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/net/minecraft/item/ShearsItem.java -+++ b/net/minecraft/item/ShearsItem.java -@@ -38,4 +38,26 @@ - return 15.0F; - } - } -+ -+ @SuppressWarnings("deprecation") -+ @Override -+ public boolean func_111207_a(ItemStack stack, net.minecraft.entity.player.PlayerEntity playerIn, LivingEntity entity, net.minecraft.util.Hand hand) { -+ if (entity.field_70170_p.field_72995_K) return false; -+ if (entity instanceof net.minecraftforge.common.IShearable) { -+ net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)entity; -+ BlockPos pos = new BlockPos(entity.func_226277_ct_(), entity.func_226278_cu_(), entity.func_226281_cx_()); -+ if (target.isShearable(stack, entity.field_70170_p, pos)) { -+ java.util.List drops = target.onSheared(stack, entity.field_70170_p, pos, -+ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantments.field_185308_t, stack)); -+ java.util.Random rand = new java.util.Random(); -+ drops.forEach(d -> { -+ net.minecraft.entity.item.ItemEntity ent = entity.func_70099_a(d, 1.0F); -+ ent.func_213317_d(ent.func_213322_ci().func_72441_c((double)((rand.nextFloat() - rand.nextFloat()) * 0.1F), (double)(rand.nextFloat() * 0.05F), (double)((rand.nextFloat() - rand.nextFloat()) * 0.1F))); -+ }); -+ stack.func_222118_a(1, entity, e -> e.func_213334_d(hand)); -+ } -+ return true; -+ } -+ return false; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/ShovelItem.java.patch b/patches_old/minecraft/net/minecraft/item/ShovelItem.java.patch deleted file mode 100644 index 4e504aa46..000000000 --- a/patches_old/minecraft/net/minecraft/item/ShovelItem.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/item/ShovelItem.java -+++ b/net/minecraft/item/ShovelItem.java -@@ -22,7 +22,7 @@ - protected static final Map field_195955_e = Maps.newHashMap(ImmutableMap.of(Blocks.field_196658_i, Blocks.field_185774_da.func_176223_P())); - - public ShovelItem(IItemTier p_i48469_1_, float p_i48469_2_, float p_i48469_3_, Item.Properties p_i48469_4_) { -- super(p_i48469_2_, p_i48469_3_, p_i48469_1_, field_150916_c, p_i48469_4_); -+ super(p_i48469_2_, p_i48469_3_, p_i48469_1_, field_150916_c, p_i48469_4_.addToolType(net.minecraftforge.common.ToolType.SHOVEL, p_i48469_1_.func_200925_d())); - } - - public boolean func_150897_b(BlockState p_150897_1_) { -@@ -40,7 +40,7 @@ - PlayerEntity playerentity = p_195939_1_.func_195999_j(); - BlockState blockstate1 = field_195955_e.get(blockstate.func_177230_c()); - BlockState blockstate2 = null; -- if (blockstate1 != null && world.func_180495_p(blockpos.func_177984_a()).func_196958_f()) { -+ if (blockstate1 != null && world.func_175623_d(blockpos.func_177984_a())) { - world.func_184133_a(playerentity, blockpos, SoundEvents.field_187771_eN, SoundCategory.BLOCKS, 1.0F, 1.0F); - blockstate2 = blockstate1; - } else if (blockstate.func_177230_c() instanceof CampfireBlock && blockstate.func_177229_b(CampfireBlock.field_220101_b)) { diff --git a/patches_old/minecraft/net/minecraft/item/ToolItem.java.patch b/patches_old/minecraft/net/minecraft/item/ToolItem.java.patch deleted file mode 100644 index 86958c9e0..000000000 --- a/patches_old/minecraft/net/minecraft/item/ToolItem.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/item/ToolItem.java -+++ b/net/minecraft/item/ToolItem.java -@@ -26,6 +26,7 @@ - } - - public float func_150893_a(ItemStack p_150893_1_, BlockState p_150893_2_) { -+ if (getToolTypes(p_150893_1_).stream().anyMatch(e -> p_150893_2_.isToolEffective(e))) return field_77864_a; - return this.field_150914_c.contains(p_150893_2_.func_177230_c()) ? this.field_77864_a : 1.0F; - } - diff --git a/patches_old/minecraft/net/minecraft/item/WallOrFloorItem.java.patch b/patches_old/minecraft/net/minecraft/item/WallOrFloorItem.java.patch deleted file mode 100644 index 392861e30..000000000 --- a/patches_old/minecraft/net/minecraft/item/WallOrFloorItem.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/item/WallOrFloorItem.java -+++ b/net/minecraft/item/WallOrFloorItem.java -@@ -41,4 +41,9 @@ - super.func_195946_a(p_195946_1_, p_195946_2_); - p_195946_1_.put(this.field_195947_b, p_195946_2_); - } -+ -+ public void removeFromBlockToItemMap(Map blockToItemMap, Item itemIn) { -+ super.removeFromBlockToItemMap(blockToItemMap, itemIn); -+ blockToItemMap.remove(this.field_195947_b); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/item/crafting/BannerDuplicateRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/BannerDuplicateRecipe.java.patch deleted file mode 100644 index a0bcbfbf6..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/BannerDuplicateRecipe.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/item/crafting/BannerDuplicateRecipe.java -+++ b/net/minecraft/item/crafting/BannerDuplicateRecipe.java -@@ -77,8 +77,8 @@ - for(int i = 0; i < nonnulllist.size(); ++i) { - ItemStack itemstack = p_179532_1_.func_70301_a(i); - if (!itemstack.func_190926_b()) { -- if (itemstack.func_77973_b().func_77634_r()) { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -+ if (itemstack.hasContainerItem()) { -+ nonnulllist.set(i, itemstack.getContainerItem()); - } else if (itemstack.func_77942_o() && BannerTileEntity.func_175113_c(itemstack) > 0) { - ItemStack itemstack1 = itemstack.func_77946_l(); - itemstack1.func_190920_e(1); diff --git a/patches_old/minecraft/net/minecraft/item/crafting/BookCloningRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/BookCloningRecipe.java.patch deleted file mode 100644 index 8952a808e..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/BookCloningRecipe.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/item/crafting/BookCloningRecipe.java -+++ b/net/minecraft/item/crafting/BookCloningRecipe.java -@@ -79,8 +79,8 @@ - - for(int i = 0; i < nonnulllist.size(); ++i) { - ItemStack itemstack = p_179532_1_.func_70301_a(i); -- if (itemstack.func_77973_b().func_77634_r()) { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -+ if (itemstack.hasContainerItem()) { -+ nonnulllist.set(i, itemstack.getContainerItem()); - } else if (itemstack.func_77973_b() instanceof WrittenBookItem) { - ItemStack itemstack1 = itemstack.func_77946_l(); - itemstack1.func_190920_e(1); diff --git a/patches_old/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch deleted file mode 100644 index 1dd2da6b9..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/CookingRecipeSerializer.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/net/minecraft/item/crafting/CookingRecipeSerializer.java -+++ b/net/minecraft/item/crafting/CookingRecipeSerializer.java -@@ -8,7 +8,7 @@ - import net.minecraft.util.ResourceLocation; - import net.minecraft.util.registry.Registry; - --public class CookingRecipeSerializer implements IRecipeSerializer { -+public class CookingRecipeSerializer extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { - private final int field_222178_t; - private final CookingRecipeSerializer.IFactory field_222179_u; - -@@ -21,11 +21,17 @@ - String s = JSONUtils.func_151219_a(p_199425_2_, "group", ""); - JsonElement jsonelement = (JsonElement)(JSONUtils.func_151202_d(p_199425_2_, "ingredient") ? JSONUtils.func_151214_t(p_199425_2_, "ingredient") : JSONUtils.func_152754_s(p_199425_2_, "ingredient")); - Ingredient ingredient = Ingredient.func_199802_a(jsonelement); -+ //Forge: Check if primitive string to keep vanilla or a object which can contain a count field. -+ if (!p_199425_2_.has("result")) throw new com.google.gson.JsonSyntaxException("Missing result, expected to find a string or object"); -+ ItemStack itemstack; -+ if (p_199425_2_.get("result").isJsonObject()) itemstack = ShapedRecipe.func_199798_a(JSONUtils.func_152754_s(p_199425_2_, "result")); -+ 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(() -> { - return new IllegalStateException("Item: " + s1 + " does not exist"); - })); -+ } - float f = JSONUtils.func_151221_a(p_199425_2_, "experience", 0.0F); - int i = JSONUtils.func_151208_a(p_199425_2_, "cookingtime", this.field_222178_t); - return this.field_222179_u.create(p_199425_1_, s, ingredient, itemstack, f, i); diff --git a/patches_old/minecraft/net/minecraft/item/crafting/IRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/IRecipe.java.patch deleted file mode 100644 index 9bf817be7..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/IRecipe.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/item/crafting/IRecipe.java -+++ b/net/minecraft/item/crafting/IRecipe.java -@@ -21,9 +21,9 @@ - NonNullList nonnulllist = NonNullList.func_191197_a(p_179532_1_.func_70302_i_(), ItemStack.field_190927_a); - - for(int i = 0; i < nonnulllist.size(); ++i) { -- Item item = p_179532_1_.func_70301_a(i).func_77973_b(); -- if (item.func_77634_r()) { -- nonnulllist.set(i, new ItemStack(item.func_77668_q())); -+ ItemStack item = p_179532_1_.func_70301_a(i); -+ if (item.hasContainerItem()) { -+ nonnulllist.set(i, item.getContainerItem()); - } - } - diff --git a/patches_old/minecraft/net/minecraft/item/crafting/IRecipePlacer.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/IRecipePlacer.java.patch deleted file mode 100644 index 1a0f0d345..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/IRecipePlacer.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/net/minecraft/item/crafting/IRecipePlacer.java -+++ b/net/minecraft/item/crafting/IRecipePlacer.java -@@ -7,10 +7,10 @@ - default void func_201501_a(int p_201501_1_, int p_201501_2_, int p_201501_3_, IRecipe p_201501_4_, Iterator p_201501_5_, int p_201501_6_) { - int i = p_201501_1_; - int j = p_201501_2_; -- if (p_201501_4_ instanceof ShapedRecipe) { -- ShapedRecipe shapedrecipe = (ShapedRecipe)p_201501_4_; -- i = shapedrecipe.func_192403_f(); -- j = shapedrecipe.func_192404_g(); -+ if (p_201501_4_ instanceof net.minecraftforge.common.crafting.IShapedRecipe) { -+ net.minecraftforge.common.crafting.IShapedRecipe shapedrecipe = (net.minecraftforge.common.crafting.IShapedRecipe)p_201501_4_; -+ i = shapedrecipe.getRecipeWidth(); -+ j = shapedrecipe.getRecipeHeight(); - } - - int k1 = 0; diff --git a/patches_old/minecraft/net/minecraft/item/crafting/IRecipeSerializer.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/IRecipeSerializer.java.patch deleted file mode 100644 index 6d1c6fd51..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/IRecipeSerializer.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/net/minecraft/item/crafting/IRecipeSerializer.java -+++ b/net/minecraft/item/crafting/IRecipeSerializer.java -@@ -5,7 +5,7 @@ - import net.minecraft.util.ResourceLocation; - import net.minecraft.util.registry.Registry; - --public interface IRecipeSerializer> { -+public interface IRecipeSerializer> extends net.minecraftforge.registries.IForgeRegistryEntry> { - IRecipeSerializer field_222157_a = func_222156_a("crafting_shaped", new ShapedRecipe.Serializer()); - IRecipeSerializer field_222158_b = func_222156_a("crafting_shapeless", new ShapelessRecipe.Serializer()); - SpecialRecipeSerializer field_222159_c = func_222156_a("crafting_special_armordye", new SpecialRecipeSerializer<>(ArmorDyeRecipe::new)); -@@ -29,6 +29,7 @@ - - T func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_); - -+ @javax.annotation.Nullable - T func_199426_a_(ResourceLocation p_199426_1_, PacketBuffer p_199426_2_); - - void func_199427_a_(PacketBuffer p_199427_1_, T p_199427_2_); diff --git a/patches_old/minecraft/net/minecraft/item/crafting/RepairItemRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/RepairItemRecipe.java.patch deleted file mode 100644 index fc263ce75..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/RepairItemRecipe.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/net/minecraft/item/crafting/RepairItemRecipe.java -+++ b/net/minecraft/item/crafting/RepairItemRecipe.java -@@ -22,7 +22,7 @@ - list.add(itemstack); - if (list.size() > 1) { - ItemStack itemstack1 = list.get(0); -- if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.func_77973_b().func_77645_m()) { -+ if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.isRepairable()) { - return false; - } - } -@@ -41,7 +41,7 @@ - list.add(itemstack); - if (list.size() > 1) { - ItemStack itemstack1 = list.get(0); -- if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.func_77973_b().func_77645_m()) { -+ if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.isRepairable()) { - return ItemStack.field_190927_a; - } - } -@@ -51,12 +51,12 @@ - if (list.size() == 2) { - ItemStack itemstack3 = list.get(0); - ItemStack itemstack4 = list.get(1); -- if (itemstack3.func_77973_b() == itemstack4.func_77973_b() && itemstack3.func_190916_E() == 1 && itemstack4.func_190916_E() == 1 && itemstack3.func_77973_b().func_77645_m()) { -+ if (itemstack3.func_77973_b() == itemstack4.func_77973_b() && itemstack3.func_190916_E() == 1 && itemstack4.func_190916_E() == 1 && itemstack3.isRepairable()) { - Item item = itemstack3.func_77973_b(); -- int j = item.func_77612_l() - itemstack3.func_77952_i(); -- int k = item.func_77612_l() - itemstack4.func_77952_i(); -- int l = j + k + item.func_77612_l() * 5 / 100; -- int i1 = item.func_77612_l() - l; -+ int j = itemstack3.func_77958_k() - itemstack3.func_77952_i(); -+ int k = itemstack3.func_77958_k() - itemstack4.func_77952_i(); -+ int l = j + k + itemstack3.func_77958_k() * 5 / 100; -+ int i1 = itemstack3.func_77958_k() - l; - if (i1 < 0) { - i1 = 0; - } diff --git a/patches_old/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch deleted file mode 100644 index 93b58b6c4..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/net/minecraft/item/crafting/ShapedRecipe.java -+++ b/net/minecraft/item/crafting/ShapedRecipe.java -@@ -21,7 +21,20 @@ - import net.minecraft.util.registry.Registry; - import net.minecraft.world.World; - --public class ShapedRecipe implements ICraftingRecipe { -+public class ShapedRecipe implements ICraftingRecipe, net.minecraftforge.common.crafting.IShapedRecipe { -+ static int MAX_WIDTH = 3; -+ static int MAX_HEIGHT = 3; -+ /** -+ * Expand the max width and height allowed in the deserializer. -+ * This should be called by modders who add custom crafting tables that are larger than the vanilla 3x3. -+ * @param width your max recipe width -+ * @param height your max recipe height -+ */ -+ public static void setCraftingSize(int width, int height) { -+ if (MAX_WIDTH < width) MAX_WIDTH = width; -+ if (MAX_HEIGHT < height) MAX_HEIGHT = height; -+ } -+ - private final int field_77576_b; - private final int field_77577_c; - private final NonNullList field_77574_d; -@@ -109,10 +122,20 @@ - return this.field_77576_b; - } - -+ @Override -+ public int getRecipeWidth() { -+ return func_192403_f(); -+ } -+ - public int func_192404_g() { - return this.field_77577_c; - } - -+ @Override -+ public int getRecipeHeight() { -+ return func_192404_g(); -+ } -+ - private static NonNullList func_192402_a(String[] p_192402_0_, Map p_192402_1_, int p_192402_2_, int p_192402_3_) { - NonNullList nonnulllist = NonNullList.func_191197_a(p_192402_2_ * p_192402_3_, Ingredient.field_193370_a); - Set set = Sets.newHashSet(p_192402_1_.keySet()); -@@ -194,15 +217,15 @@ - - private static String[] func_192407_a(JsonArray p_192407_0_) { - String[] astring = new String[p_192407_0_.size()]; -- if (astring.length > 3) { -- throw new JsonSyntaxException("Invalid pattern: too many rows, 3 is maximum"); -+ if (astring.length > MAX_HEIGHT) { -+ throw new JsonSyntaxException("Invalid pattern: too many rows, " + MAX_HEIGHT + " is maximum"); - } else if (astring.length == 0) { - throw new JsonSyntaxException("Invalid pattern: empty pattern not allowed"); - } else { - for(int i = 0; i < astring.length; ++i) { - String s = JSONUtils.func_151206_a(p_192407_0_.get(i), "pattern[" + i + "]"); -- if (s.length() > 3) { -- throw new JsonSyntaxException("Invalid pattern: too many columns, 3 is maximum"); -+ if (s.length() > MAX_WIDTH) { -+ throw new JsonSyntaxException("Invalid pattern: too many columns, " + MAX_WIDTH + " is maximum"); - } - - if (i > 0 && astring[0].length() != s.length()) { -@@ -244,11 +267,12 @@ - throw new JsonParseException("Disallowed data tag found"); - } else { - int i = JSONUtils.func_151208_a(p_199798_0_, "count", 1); -- return new ItemStack(item, i); -+ return net.minecraftforge.common.crafting.CraftingHelper.getItemStack(p_199798_0_, true); - } - } - -- public static class Serializer implements IRecipeSerializer { -+ public static class Serializer extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { -+ private static final ResourceLocation NAME = new ResourceLocation("minecraft", "crafting_shaped"); - public ShapedRecipe func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_) { - String s = JSONUtils.func_151219_a(p_199425_2_, "group", ""); - Map map = ShapedRecipe.func_192408_a(JSONUtils.func_152754_s(p_199425_2_, "key")); diff --git a/patches_old/minecraft/net/minecraft/item/crafting/ShapelessRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/ShapelessRecipe.java.patch deleted file mode 100644 index f781cb219..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/ShapelessRecipe.java.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- a/net/minecraft/item/crafting/ShapelessRecipe.java -+++ b/net/minecraft/item/crafting/ShapelessRecipe.java -@@ -17,12 +17,14 @@ - private final String field_194138_c; - private final ItemStack field_77580_a; - private final NonNullList field_77579_b; -+ private final boolean isSimple; - - public ShapelessRecipe(ResourceLocation p_i48161_1_, String p_i48161_2_, ItemStack p_i48161_3_, NonNullList p_i48161_4_) { - this.field_199562_a = p_i48161_1_; - this.field_194138_c = p_i48161_2_; - this.field_77580_a = p_i48161_3_; - this.field_77579_b = p_i48161_4_; -+ this.isSimple = p_i48161_4_.stream().allMatch(Ingredient::isSimple); - } - - public ResourceLocation func_199560_c() { -@@ -47,17 +49,20 @@ - - public boolean func_77569_a(CraftingInventory p_77569_1_, World p_77569_2_) { - RecipeItemHelper recipeitemhelper = new RecipeItemHelper(); -+ java.util.List inputs = new java.util.ArrayList<>(); - int i = 0; - - for(int j = 0; j < p_77569_1_.func_70302_i_(); ++j) { - ItemStack itemstack = p_77569_1_.func_70301_a(j); - if (!itemstack.func_190926_b()) { - ++i; -+ if (isSimple) - recipeitemhelper.func_221264_a(itemstack, 1); -+ else inputs.add(itemstack); - } - } - -- return i == this.field_77579_b.size() && recipeitemhelper.func_194116_a(this, (IntList)null); -+ return i == this.field_77579_b.size() && (isSimple ? recipeitemhelper.func_194116_a(this, (IntList)null) : net.minecraftforge.common.util.RecipeMatcher.findMatches(inputs, this.field_77579_b) != null); - } - - public ItemStack func_77572_b(CraftingInventory p_77572_1_) { -@@ -68,14 +73,15 @@ - return p_194133_1_ * p_194133_2_ >= this.field_77579_b.size(); - } - -- public static class Serializer implements IRecipeSerializer { -+ public static class Serializer extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { -+ private static final ResourceLocation NAME = new ResourceLocation("minecraft", "crafting_shapeless"); - public ShapelessRecipe func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_) { - String s = JSONUtils.func_151219_a(p_199425_2_, "group", ""); - NonNullList nonnulllist = func_199568_a(JSONUtils.func_151214_t(p_199425_2_, "ingredients")); - if (nonnulllist.isEmpty()) { - throw new JsonParseException("No ingredients for shapeless recipe"); -- } else if (nonnulllist.size() > 9) { -- throw new JsonParseException("Too many ingredients for shapeless recipe"); -+ } else if (nonnulllist.size() > ShapedRecipe.MAX_WIDTH * ShapedRecipe.MAX_HEIGHT) { -+ throw new JsonParseException("Too many ingredients for shapeless recipe the max is " + (ShapedRecipe.MAX_WIDTH * ShapedRecipe.MAX_HEIGHT)); - } else { - ItemStack itemstack = ShapedRecipe.func_199798_a(JSONUtils.func_152754_s(p_199425_2_, "result")); - return new ShapelessRecipe(p_199425_1_, s, itemstack, nonnulllist); diff --git a/patches_old/minecraft/net/minecraft/item/crafting/ShulkerBoxColoringRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/ShulkerBoxColoringRecipe.java.patch deleted file mode 100644 index b8e099fa4..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/ShulkerBoxColoringRecipe.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/net/minecraft/item/crafting/ShulkerBoxColoringRecipe.java -+++ b/net/minecraft/item/crafting/ShulkerBoxColoringRecipe.java -@@ -25,7 +25,7 @@ - if (Block.func_149634_a(itemstack.func_77973_b()) instanceof ShulkerBoxBlock) { - ++i; - } else { -- if (!(itemstack.func_77973_b() instanceof DyeItem)) { -+ if (!itemstack.func_77973_b().func_206844_a(net.minecraftforge.common.Tags.Items.DYES)) { - return false; - } - -@@ -43,7 +43,7 @@ - - public ItemStack func_77572_b(CraftingInventory p_77572_1_) { - ItemStack itemstack = ItemStack.field_190927_a; -- DyeItem dyeitem = (DyeItem)Items.field_222069_lA; -+ net.minecraft.item.DyeColor dyecolor = net.minecraft.item.DyeColor.WHITE; - - for(int i = 0; i < p_77572_1_.func_70302_i_(); ++i) { - ItemStack itemstack1 = p_77572_1_.func_70301_a(i); -@@ -51,13 +51,14 @@ - Item item = itemstack1.func_77973_b(); - if (Block.func_149634_a(item) instanceof ShulkerBoxBlock) { - itemstack = itemstack1; -- } else if (item instanceof DyeItem) { -- dyeitem = (DyeItem)item; -+ } else { -+ net.minecraft.item.DyeColor tmp = net.minecraft.item.DyeColor.getColor(itemstack1); -+ if (tmp != null) dyecolor = tmp; - } - } - } - -- ItemStack itemstack2 = ShulkerBoxBlock.func_190953_b(dyeitem.func_195962_g()); -+ ItemStack itemstack2 = ShulkerBoxBlock.func_190953_b(dyecolor); - if (itemstack.func_77942_o()) { - itemstack2.func_77982_d(itemstack.func_77978_p().func_74737_b()); - } diff --git a/patches_old/minecraft/net/minecraft/item/crafting/SingleItemRecipe.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/SingleItemRecipe.java.patch deleted file mode 100644 index 43387b576..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/SingleItemRecipe.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/item/crafting/SingleItemRecipe.java -+++ b/net/minecraft/item/crafting/SingleItemRecipe.java -@@ -60,7 +60,7 @@ - return this.field_222132_b.func_77946_l(); - } - -- public static class Serializer implements IRecipeSerializer { -+ public static class Serializer extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { - final SingleItemRecipe.Serializer.IRecipeFactory field_222180_t; - - protected Serializer(SingleItemRecipe.Serializer.IRecipeFactory p_i50146_1_) { diff --git a/patches_old/minecraft/net/minecraft/item/crafting/SpecialRecipeSerializer.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/SpecialRecipeSerializer.java.patch deleted file mode 100644 index 195ee9902..000000000 --- a/patches_old/minecraft/net/minecraft/item/crafting/SpecialRecipeSerializer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/item/crafting/SpecialRecipeSerializer.java -+++ b/net/minecraft/item/crafting/SpecialRecipeSerializer.java -@@ -5,7 +5,7 @@ - import net.minecraft.network.PacketBuffer; - import net.minecraft.util.ResourceLocation; - --public class SpecialRecipeSerializer> implements IRecipeSerializer { -+public class SpecialRecipeSerializer> extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { - private final Function field_222176_t; - - public SpecialRecipeSerializer(Function p_i50024_1_) { diff --git a/patches_old/minecraft/net/minecraft/nbt/CompoundNBT.java.patch b/patches_old/minecraft/net/minecraft/nbt/CompoundNBT.java.patch deleted file mode 100644 index eaca9d010..000000000 --- a/patches_old/minecraft/net/minecraft/nbt/CompoundNBT.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/nbt/CompoundNBT.java -+++ b/net/minecraft/nbt/CompoundNBT.java -@@ -39,6 +39,7 @@ - while((b0 = CompoundNBT.func_152447_a(p_225649_1_, p_225649_3_)) != 0) { - String s = CompoundNBT.func_152448_b(p_225649_1_, p_225649_3_); - p_225649_3_.func_152450_a((long)(224 + 16 * s.length())); -+ p_225649_3_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. - INBT inbt = CompoundNBT.func_229680_b_(NBTTypes.func_229710_a_(b0), s, p_225649_1_, p_225649_2_ + 1, p_225649_3_); - if (map.put(s, inbt) != null) { - p_225649_3_.func_152450_a(288L); -@@ -94,6 +95,7 @@ - - @Nullable - public INBT func_218657_a(String p_218657_1_, INBT p_218657_2_) { -+ if (p_218657_2_ == null) throw new IllegalArgumentException("Invalid null NBT value with key " + p_218657_1_); - return this.field_74784_a.put(p_218657_1_, p_218657_2_); - } - -@@ -410,11 +412,12 @@ - } - - private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException { -+ p_152447_1_.func_152450_a(8); - return p_152447_0_.readByte(); - } - - private static String func_152448_b(DataInput p_152448_0_, NBTSizeTracker p_152448_1_) throws IOException { -- return p_152448_0_.readUTF(); -+ return p_152448_1_.readUTF(p_152448_0_.readUTF()); - } - - private static INBT func_229680_b_(INBTType p_229680_0_, String p_229680_1_, DataInput p_229680_2_, int p_229680_3_, NBTSizeTracker p_229680_4_) { diff --git a/patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch deleted file mode 100644 index cf6e70f88..000000000 --- a/patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/net/minecraft/nbt/CompressedStreamTools.java -+++ b/net/minecraft/nbt/CompressedStreamTools.java -@@ -110,10 +110,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(); -+ p_152455_2_.func_152450_a(8); // Forge: Count everything! - if (b0 == 0) { - return EndNBT.field_229686_b_; - } else { -- p_152455_0_.readUTF(); -+ p_152455_2_.readUTF(p_152455_0_.readUTF()); //Forge: Count this string. -+ p_152455_2_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. - - try { - return NBTTypes.func_229710_a_(b0).func_225649_b_(p_152455_0_, p_152455_1_, p_152455_2_); diff --git a/patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch b/patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch deleted file mode 100644 index 8bde6e848..000000000 --- a/patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/net/minecraft/nbt/NBTSizeTracker.java -+++ b/net/minecraft/nbt/NBTSizeTracker.java -@@ -18,4 +18,34 @@ - throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.field_152453_c + "bytes where max allowed: " + this.field_152452_b); - } - } -+ -+ /* -+ * UTF8 is not a simple encoding system, each character can be either -+ * 1, 2, or 3 bytes. Depending on where it's numerical value falls. -+ * We have to count up each character individually to see the true -+ * length of the data. -+ * -+ * Basic concept is that it uses the MSB of each byte as a 'read more' signal. -+ * So it has to shift each 7-bit segment. -+ * -+ * This will accurately count the correct byte length to encode this string, plus the 2 bytes for it's length prefix. -+ */ -+ public String readUTF(String data) { -+ func_152450_a(16); //Header length -+ if (data == null) -+ return data; -+ -+ int len = data.length(); -+ int utflen = 0; -+ -+ for (int i = 0; i < len; i++) { -+ int c = data.charAt(i); -+ if ((c >= 0x0001) && (c <= 0x007F)) utflen += 1; -+ else if (c > 0x07FF) utflen += 3; -+ else utflen += 2; -+ } -+ func_152450_a(8 * utflen); -+ -+ return data; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/nbt/StringNBT.java.patch b/patches_old/minecraft/net/minecraft/nbt/StringNBT.java.patch deleted file mode 100644 index 1a2c869e8..000000000 --- a/patches_old/minecraft/net/minecraft/nbt/StringNBT.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/nbt/StringNBT.java -+++ b/net/minecraft/nbt/StringNBT.java -@@ -12,7 +12,7 @@ - public StringNBT func_225649_b_(DataInput p_225649_1_, int p_225649_2_, NBTSizeTracker p_225649_3_) throws IOException { - p_225649_3_.func_152450_a(288L); - String s = p_225649_1_.readUTF(); -- p_225649_3_.func_152450_a((long)(16 * s.length())); -+ p_225649_3_.readUTF(s); - return StringNBT.func_229705_a_(s); - } - diff --git a/patches_old/minecraft/net/minecraft/particles/BlockParticleData.java.patch b/patches_old/minecraft/net/minecraft/particles/BlockParticleData.java.patch deleted file mode 100644 index 0611b41a4..000000000 --- a/patches_old/minecraft/net/minecraft/particles/BlockParticleData.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/particles/BlockParticleData.java -+++ b/net/minecraft/particles/BlockParticleData.java -@@ -45,4 +45,15 @@ - public BlockState func_197584_c() { - return this.field_197587_c; - } -+ -+ //FORGE: Add a source pos property, so we can provide models with additional model data -+ private net.minecraft.util.math.BlockPos pos; -+ public BlockParticleData setPos(net.minecraft.util.math.BlockPos pos) { -+ this.pos = pos; -+ return this; -+ } -+ -+ public net.minecraft.util.math.BlockPos getPos() { -+ return pos; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/particles/ItemParticleData.java.patch b/patches_old/minecraft/net/minecraft/particles/ItemParticleData.java.patch deleted file mode 100644 index 7181811a3..000000000 --- a/patches_old/minecraft/net/minecraft/particles/ItemParticleData.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/particles/ItemParticleData.java -+++ b/net/minecraft/particles/ItemParticleData.java -@@ -28,7 +28,7 @@ - - public ItemParticleData(ParticleType p_i47952_1_, ItemStack p_i47952_2_) { - this.field_197558_b = p_i47952_1_; -- this.field_197559_c = p_i47952_2_; -+ this.field_197559_c = p_i47952_2_.func_77946_l(); //Forge: Fix stack updating after the fact causing particle changes. - } - - public void func_197553_a(PacketBuffer p_197553_1_) { diff --git a/patches_old/minecraft/net/minecraft/particles/ParticleTypes.java.patch b/patches_old/minecraft/net/minecraft/particles/ParticleTypes.java.patch deleted file mode 100644 index e0438e948..000000000 --- a/patches_old/minecraft/net/minecraft/particles/ParticleTypes.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/particles/ParticleTypes.java -+++ b/net/minecraft/particles/ParticleTypes.java -@@ -2,6 +2,7 @@ - - import net.minecraft.util.registry.Registry; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public class ParticleTypes { - public static final BasicParticleType field_197608_a = func_218415_a("ambient_entity_effect", false); - public static final BasicParticleType field_197609_b = func_218415_a("angry_villager", false); diff --git a/patches_old/minecraft/net/minecraft/pathfinding/PathNavigator.java.patch b/patches_old/minecraft/net/minecraft/pathfinding/PathNavigator.java.patch deleted file mode 100644 index 87ea227d5..000000000 --- a/patches_old/minecraft/net/minecraft/pathfinding/PathNavigator.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/pathfinding/PathNavigator.java -+++ b/net/minecraft/pathfinding/PathNavigator.java -@@ -204,7 +204,8 @@ - Vec3d vec3d = this.func_75502_i(); - this.field_188561_o = this.field_75515_a.func_213311_cf() > 0.75F ? this.field_75515_a.func_213311_cf() / 2.0F : 0.75F - this.field_75515_a.func_213311_cf() / 2.0F; - Vec3d vec3d1 = this.field_75514_c.func_186310_f(); -- if (Math.abs(this.field_75515_a.func_226277_ct_() - (vec3d1.field_72450_a + 0.5D)) < (double)this.field_188561_o && Math.abs(this.field_75515_a.func_226281_cx_() - (vec3d1.field_72449_c + 0.5D)) < (double)this.field_188561_o && Math.abs(this.field_75515_a.func_226278_cu_() - vec3d1.field_72448_b) < 1.0D) { -+ // Forge: fix MC-94054 -+ if (Math.abs(this.field_75515_a.func_226277_ct_() - (vec3d1.field_72450_a + ((int)(this.field_75515_a.func_213311_cf() + 1) / 2D))) < (double)this.field_188561_o && Math.abs(this.field_75515_a.func_226281_cx_() - (vec3d1.field_72449_c + ((int)(this.field_75515_a.func_213311_cf() + 1) / 2D))) < (double)this.field_188561_o && Math.abs(this.field_75515_a.func_226278_cu_() - vec3d1.field_72448_b) < 1.0D) { - this.field_75514_c.func_75872_c(this.field_75514_c.func_75873_e() + 1); - } - diff --git a/patches_old/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch b/patches_old/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch deleted file mode 100644 index 012842b6d..000000000 --- a/patches_old/minecraft/net/minecraft/pathfinding/PathNodeType.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/net/minecraft/pathfinding/PathNodeType.java -+++ b/net/minecraft/pathfinding/PathNodeType.java -@@ -33,4 +33,13 @@ - public float func_186289_a() { - return this.field_186307_r; - } -+ -+ @javax.annotation.Nullable -+ public PathNodeType getDanger() { -+ return (this == DAMAGE_FIRE || this == DANGER_FIRE ) ? DANGER_FIRE : -+ (this == DAMAGE_CACTUS || this == DANGER_CACTUS) ? DANGER_CACTUS : -+ (this == DAMAGE_OTHER || this == DANGER_OTHER ) ? DANGER_OTHER : -+ (this == LAVA) ? DAMAGE_FIRE : -+ null; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch b/patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch deleted file mode 100644 index f1d47f3df..000000000 --- a/patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/net/minecraft/pathfinding/WalkNodeProcessor.java -+++ b/net/minecraft/pathfinding/WalkNodeProcessor.java -@@ -383,16 +383,9 @@ - for(int j = -1; j <= 1; ++j) { - for(int k = -1; k <= 1; ++k) { - if (i != 0 || k != 0) { -- Block block = p_193578_0_.func_180495_p(blockpos$pooledmutable.func_181079_c(i + p_193578_1_, j + p_193578_2_, k + p_193578_3_)).func_177230_c(); -- if (block == Blocks.field_150434_aF) { -- p_193578_4_ = PathNodeType.DANGER_CACTUS; -- } else if (block != Blocks.field_150480_ab && block != Blocks.field_150353_l) { -- if (block == Blocks.field_222434_lW) { -- p_193578_4_ = PathNodeType.DANGER_OTHER; -- } -- } else { -- p_193578_4_ = PathNodeType.DANGER_FIRE; -- } -+ PathNodeType type = func_189553_b(p_193578_0_, p_193578_1_ + i, p_193578_2_ + j, p_193578_3_ + k).getDanger(); -+ if (type != null) -+ p_193578_4_ = type; - } - } - } -@@ -405,9 +398,11 @@ - protected static PathNodeType func_189553_b(IBlockReader p_189553_0_, int p_189553_1_, int p_189553_2_, int p_189553_3_) { - BlockPos blockpos = new BlockPos(p_189553_1_, p_189553_2_, p_189553_3_); - BlockState blockstate = p_189553_0_.func_180495_p(blockpos); -+ PathNodeType type = blockstate.getAiPathNodeType(p_189553_0_, blockpos); -+ if (type != null) return type; - Block block = blockstate.func_177230_c(); - Material material = blockstate.func_185904_a(); -- if (blockstate.func_196958_f()) { -+ if (blockstate.isAir(p_189553_0_, blockpos)) { - return PathNodeType.OPEN; - } else if (!block.func_203417_a(BlockTags.field_212185_E) && block != Blocks.field_196651_dG) { - if (block == Blocks.field_150480_ab) { diff --git a/patches_old/minecraft/net/minecraft/potion/Effect.java.patch b/patches_old/minecraft/net/minecraft/potion/Effect.java.patch deleted file mode 100644 index 5608193c0..000000000 --- a/patches_old/minecraft/net/minecraft/potion/Effect.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/potion/Effect.java -+++ b/net/minecraft/potion/Effect.java -@@ -18,7 +18,7 @@ - import net.minecraft.util.text.ITextComponent; - import net.minecraft.util.text.TranslationTextComponent; - --public class Effect { -+public class Effect extends net.minecraftforge.registries.ForgeRegistryEntry implements net.minecraftforge.common.extensions.IForgeEffect { - private final Map field_111188_I = Maps.newHashMap(); - private final EffectType field_220305_b; - private final int field_76414_N; diff --git a/patches_old/minecraft/net/minecraft/potion/EffectInstance.java.patch b/patches_old/minecraft/net/minecraft/potion/EffectInstance.java.patch deleted file mode 100644 index 50dd4ad31..000000000 --- a/patches_old/minecraft/net/minecraft/potion/EffectInstance.java.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/net/minecraft/potion/EffectInstance.java -+++ b/net/minecraft/potion/EffectInstance.java -@@ -9,7 +9,7 @@ - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - --public class EffectInstance implements Comparable { -+public class EffectInstance implements Comparable, net.minecraftforge.common.extensions.IForgeEffectInstance { - private static final Logger field_180155_a = LogManager.getLogger(); - private final Effect field_188420_b; - private int field_76460_b; -@@ -64,6 +64,7 @@ - this.field_82724_e = p_230117_1_.field_82724_e; - this.field_188421_h = p_230117_1_.field_188421_h; - this.field_205349_i = p_230117_1_.field_205349_i; -+ this.curativeItems = p_230117_1_.curativeItems == null ? null : new java.util.ArrayList(p_230117_1_.curativeItems); - } - - public boolean func_199308_a(EffectInstance p_199308_1_) { -@@ -112,7 +113,7 @@ - } - - public Effect func_188419_a() { -- return this.field_188420_b; -+ return this.field_188420_b == null ? null : this.field_188420_b.delegate.get(); - } - - public int func_76459_b() { -@@ -231,11 +232,12 @@ - this.field_230115_j_.func_82719_a(compoundnbt); - p_230119_1_.func_218657_a("HiddenEffect", compoundnbt); - } -+ writeCurativeItems(p_230119_1_); - - } - - public static EffectInstance func_82722_b(CompoundNBT p_82722_0_) { -- int i = p_82722_0_.func_74771_c("Id"); -+ int i = p_82722_0_.func_74771_c("Id") & 0xFF; - Effect effect = Effect.func_188412_a(i); - return effect == null ? null : func_230116_a_(effect, p_82722_0_); - } -@@ -259,7 +261,7 @@ - effectinstance = func_230116_a_(p_230116_0_, p_230116_1_.func_74775_l("HiddenEffect")); - } - -- return new EffectInstance(p_230116_0_, j, i < 0 ? 0 : i, flag, flag1, flag2, effectinstance); -+ return readCurativeItems(new EffectInstance(p_230116_0_, j, i < 0 ? 0 : i, flag, flag1, flag2, effectinstance), p_230116_1_); - } - - @OnlyIn(Dist.CLIENT) -@@ -274,6 +276,32 @@ - - public int compareTo(EffectInstance p_compareTo_1_) { - int i = 32147; -- return (this.func_76459_b() <= 32147 || p_compareTo_1_.func_76459_b() <= 32147) && (!this.func_82720_e() || !p_compareTo_1_.func_82720_e()) ? ComparisonChain.start().compare(this.func_82720_e(), p_compareTo_1_.func_82720_e()).compare(this.func_76459_b(), p_compareTo_1_.func_76459_b()).compare(this.func_188419_a().func_76401_j(), p_compareTo_1_.func_188419_a().func_76401_j()).result() : ComparisonChain.start().compare(this.func_82720_e(), p_compareTo_1_.func_82720_e()).compare(this.func_188419_a().func_76401_j(), p_compareTo_1_.func_188419_a().func_76401_j()).result(); -+ return (this.func_76459_b() <= 32147 || p_compareTo_1_.func_76459_b() <= 32147) && (!this.func_82720_e() || !p_compareTo_1_.func_82720_e()) ? ComparisonChain.start().compare(this.func_82720_e(), p_compareTo_1_.func_82720_e()).compare(this.func_76459_b(), p_compareTo_1_.func_76459_b()).compare(this.func_188419_a().getGuiSortColor(this), p_compareTo_1_.func_188419_a().getGuiSortColor(this)).result() : ComparisonChain.start().compare(this.func_82720_e(), p_compareTo_1_.func_82720_e()).compare(this.func_188419_a().getGuiSortColor(this), p_compareTo_1_.func_188419_a().getGuiSortColor(this)).result(); - } -+ -+ //======================= FORGE START =========================== -+ private java.util.List curativeItems; -+ -+ @Override -+ public java.util.List getCurativeItems() { -+ if (this.curativeItems == null) //Lazy load this so that we don't create a circular dep on Items. -+ this.curativeItems = func_188419_a().getCurativeItems(); -+ return this.curativeItems; -+ } -+ @Override -+ public void setCurativeItems(java.util.List curativeItems) { -+ this.curativeItems = curativeItems; -+ } -+ private static EffectInstance readCurativeItems(EffectInstance effect, CompoundNBT nbt) { -+ if (nbt.func_150297_b("CurativeItems", net.minecraftforge.common.util.Constants.NBT.TAG_LIST)) { -+ java.util.List items = new java.util.ArrayList(); -+ net.minecraft.nbt.ListNBT list = nbt.func_150295_c("CurativeItems", net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND); -+ for (int i = 0; i < list.size(); i++) { -+ items.add(net.minecraft.item.ItemStack.func_199557_a(list.func_150305_b(i))); -+ } -+ effect.setCurativeItems(items); -+ } -+ -+ return effect; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/potion/Effects.java.patch b/patches_old/minecraft/net/minecraft/potion/Effects.java.patch deleted file mode 100644 index 7d0df2667..000000000 --- a/patches_old/minecraft/net/minecraft/potion/Effects.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/potion/Effects.java -+++ b/net/minecraft/potion/Effects.java -@@ -9,6 +9,7 @@ - import net.minecraft.world.Difficulty; - import net.minecraft.world.server.ServerWorld; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public class Effects { - public static final Effect field_76424_c = func_220308_a(1, "speed", (new Effect(EffectType.BENEFICIAL, 8171462)).func_220304_a(SharedMonsterAttributes.field_111263_d, "91AEAA56-376B-4498-935B-2F7F68070635", (double)0.2F, AttributeModifier.Operation.MULTIPLY_TOTAL)); - public static final Effect field_76421_d = func_220308_a(2, "slowness", (new Effect(EffectType.HARMFUL, 5926017)).func_220304_a(SharedMonsterAttributes.field_111263_d, "7107DE5E-7CE8-4030-940E-514C1F160890", (double)-0.15F, AttributeModifier.Operation.MULTIPLY_TOTAL)); diff --git a/patches_old/minecraft/net/minecraft/potion/Potion.java.patch b/patches_old/minecraft/net/minecraft/potion/Potion.java.patch deleted file mode 100644 index 019651479..000000000 --- a/patches_old/minecraft/net/minecraft/potion/Potion.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/potion/Potion.java -+++ b/net/minecraft/potion/Potion.java -@@ -6,7 +6,7 @@ - import net.minecraft.util.ResourceLocation; - import net.minecraft.util.registry.Registry; - --public class Potion { -+public class Potion extends net.minecraftforge.registries.ForgeRegistryEntry { - private final String field_185179_d; - private final ImmutableList field_185180_e; - diff --git a/patches_old/minecraft/net/minecraft/potion/PotionBrewing.java.patch b/patches_old/minecraft/net/minecraft/potion/PotionBrewing.java.patch deleted file mode 100644 index 7de69e80c..000000000 --- a/patches_old/minecraft/net/minecraft/potion/PotionBrewing.java.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/net/minecraft/potion/PotionBrewing.java -+++ b/net/minecraft/potion/PotionBrewing.java -@@ -57,7 +57,7 @@ - int i = 0; - - for(int j = field_185213_a.size(); i < j; ++i) { -- if ((field_185213_a.get(i)).field_185200_c == p_222124_0_) { -+ if ((field_185213_a.get(i)).field_185200_c.get() == p_222124_0_) { - return true; - } - } -@@ -79,7 +79,7 @@ - - for(int j = field_185214_b.size(); i < j; ++i) { - PotionBrewing.MixPredicate mixpredicate = field_185214_b.get(i); -- if (mixpredicate.field_185198_a == item && mixpredicate.field_185199_b.test(p_185206_1_)) { -+ if (mixpredicate.field_185198_a.get() == item && mixpredicate.field_185199_b.test(p_185206_1_)) { - return true; - } - } -@@ -93,7 +93,7 @@ - - for(int j = field_185213_a.size(); i < j; ++i) { - PotionBrewing.MixPredicate mixpredicate = field_185213_a.get(i); -- if (mixpredicate.field_185198_a == potion && mixpredicate.field_185199_b.test(p_185209_1_)) { -+ if (mixpredicate.field_185198_a.get() == potion && mixpredicate.field_185199_b.test(p_185209_1_)) { - return true; - } - } -@@ -109,8 +109,8 @@ - - for(int j = field_185214_b.size(); i < j; ++i) { - PotionBrewing.MixPredicate mixpredicate = field_185214_b.get(i); -- if (mixpredicate.field_185198_a == item && mixpredicate.field_185199_b.test(p_185212_0_)) { -- return PotionUtils.func_185188_a(new ItemStack((IItemProvider)mixpredicate.field_185200_c), potion); -+ if (mixpredicate.field_185198_a.get() == item && mixpredicate.field_185199_b.test(p_185212_0_)) { -+ return PotionUtils.func_185188_a(new ItemStack((IItemProvider)mixpredicate.field_185200_c.get()), potion); - } - } - -@@ -118,8 +118,8 @@ - - for(int k = field_185213_a.size(); i < k; ++i) { - PotionBrewing.MixPredicate mixpredicate1 = field_185213_a.get(i); -- if (mixpredicate1.field_185198_a == potion && mixpredicate1.field_185199_b.test(p_185212_0_)) { -- return PotionUtils.func_185188_a(new ItemStack(item), (Potion)mixpredicate1.field_185200_c); -+ if (mixpredicate1.field_185198_a.get() == potion && mixpredicate1.field_185199_b.test(p_185212_0_)) { -+ return PotionUtils.func_185188_a(new ItemStack(item), (Potion)mixpredicate1.field_185200_c.get()); - } - } - } -@@ -212,15 +212,15 @@ - field_185213_a.add(new PotionBrewing.MixPredicate<>(p_193357_0_, Ingredient.func_199804_a(p_193357_1_), p_193357_2_)); - } - -- static class MixPredicate { -- private final T field_185198_a; -+ static class MixPredicate> { -+ private final net.minecraftforge.registries.IRegistryDelegate field_185198_a; - private final Ingredient field_185199_b; -- private final T field_185200_c; -+ private final net.minecraftforge.registries.IRegistryDelegate field_185200_c; - - public MixPredicate(T p_i47570_1_, Ingredient p_i47570_2_, T p_i47570_3_) { -- this.field_185198_a = p_i47570_1_; -+ this.field_185198_a = p_i47570_1_.delegate; - this.field_185199_b = p_i47570_2_; -- this.field_185200_c = p_i47570_3_; -+ this.field_185200_c = p_i47570_3_.delegate; - } - } - } diff --git a/patches_old/minecraft/net/minecraft/resources/IResourceManagerReloadListener.java.patch b/patches_old/minecraft/net/minecraft/resources/IResourceManagerReloadListener.java.patch deleted file mode 100644 index 0c2d4a0ee..000000000 --- a/patches_old/minecraft/net/minecraft/resources/IResourceManagerReloadListener.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/net/minecraft/resources/IResourceManagerReloadListener.java -+++ b/net/minecraft/resources/IResourceManagerReloadListener.java -@@ -5,6 +5,11 @@ - import net.minecraft.profiler.IProfiler; - import net.minecraft.util.Unit; - -+/** -+ * @deprecated Forge: {@link net.minecraftforge.resource.ISelectiveResourceReloadListener}, which selectively allows -+ * individual resource types being reloaded should rather be used where possible. -+ */ -+@Deprecated - public interface IResourceManagerReloadListener extends IFutureReloadListener { - default CompletableFuture func_215226_a(IFutureReloadListener.IStage p_215226_1_, IResourceManager p_215226_2_, IProfiler p_215226_3_, IProfiler p_215226_4_, Executor p_215226_5_, Executor p_215226_6_) { - return p_215226_1_.func_216872_a(Unit.INSTANCE).thenRunAsync(() -> { -@@ -13,4 +18,9 @@ - } - - void func_195410_a(IResourceManager p_195410_1_); -+ -+ @javax.annotation.Nullable -+ default net.minecraftforge.resource.IResourceType getResourceType() { -+ return null; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/resources/ResourcePackList.java.patch b/patches_old/minecraft/net/minecraft/resources/ResourcePackList.java.patch deleted file mode 100644 index db3e5cf11..000000000 --- a/patches_old/minecraft/net/minecraft/resources/ResourcePackList.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/resources/ResourcePackList.java -+++ b/net/minecraft/resources/ResourcePackList.java -@@ -48,7 +48,7 @@ - private void func_198986_e() { - List> list = Lists.newArrayList(this.field_198988_b.entrySet()); - this.field_198988_b.clear(); -- list.stream().sorted(Entry.comparingByKey()).forEachOrdered((p_198984_1_) -> { -+ list.stream().sorted(net.minecraftforge.fml.packs.ResourcePackLoader.getSorter()).forEachOrdered((p_198984_1_) -> { - ResourcePackInfo resourcepackinfo = (ResourcePackInfo)this.field_198988_b.put(p_198984_1_.getKey(), p_198984_1_.getValue()); - }); - } diff --git a/patches_old/minecraft/net/minecraft/resources/VanillaPack.java.patch b/patches_old/minecraft/net/minecraft/resources/VanillaPack.java.patch deleted file mode 100644 index 91b1519a3..000000000 --- a/patches_old/minecraft/net/minecraft/resources/VanillaPack.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/net/minecraft/resources/VanillaPack.java -+++ b/net/minecraft/resources/VanillaPack.java -@@ -176,7 +176,7 @@ - - try { - URL url = VanillaPack.class.getResource(s); -- return func_223459_a(s, url) ? url.openStream() : null; -+ return func_223459_a(s, url) ? getExtraInputStream(p_195782_1_, s) : null; - } catch (IOException var6) { - return VanillaPack.class.getResourceAsStream(s); - } -@@ -192,7 +192,7 @@ - - @Nullable - protected InputStream func_200010_a(String p_200010_1_) { -- return VanillaPack.class.getResourceAsStream("/" + p_200010_1_); -+ return getExtraInputStream(ResourcePackType.SERVER_DATA, "/" + p_200010_1_); - } - - public boolean func_195764_b(ResourcePackType p_195764_1_, ResourceLocation p_195764_2_) { -@@ -232,4 +232,18 @@ - - public void close() { - } -+ -+ //Vanilla used to just grab from the classpath, this breaks dev environments, and Forge runtime -+ //as forge ships vanilla assets in an 'extra' jar with no classes. -+ //So find that extra jar using the .mcassetsroot marker. -+ private InputStream getExtraInputStream(ResourcePackType type, String resource) { -+ try { -+ FileSystem fs = field_217810_e.get(type); -+ if (fs != null) -+ return Files.newInputStream(fs.getPath(resource)); -+ return VanillaPack.class.getResourceAsStream(resource); -+ } catch (IOException e) { -+ return VanillaPack.class.getResourceAsStream(resource); -+ } -+ } - } diff --git a/patches_old/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches_old/minecraft/net/minecraft/server/MinecraftServer.java.patch deleted file mode 100644 index 8cf20075d..000000000 --- a/patches_old/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ /dev/null @@ -1,263 +0,0 @@ ---- a/net/minecraft/server/MinecraftServer.java -+++ b/net/minecraft/server/MinecraftServer.java -@@ -196,7 +196,7 @@ - private final GameProfileRepository field_152365_W; - private final PlayerProfileCache field_152366_X; - private long field_147142_T; -- protected final Thread field_175590_aa = Util.func_200696_a(new Thread(this, "Server thread"), (p_213187_0_) -> { -+ protected final Thread field_175590_aa = Util.func_200696_a(new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, this, "Server thread"), (p_213187_0_) -> { - p_213187_0_.setUncaughtExceptionHandler((p_213206_0_, p_213206_1_) -> { - field_147145_h.error(p_213206_1_); - }); -@@ -221,6 +221,7 @@ - private final LootTableManager field_200256_aj = new LootTableManager(this.field_229734_an_); - private final AdvancementManager field_200257_ak = new AdvancementManager(); - private final FunctionManager field_200258_al = new FunctionManager(this); -+ private final net.minecraftforge.common.loot.LootModifierManager lootManager = new net.minecraftforge.common.loot.LootModifierManager(); - private final FrameTimer field_213215_ap = new FrameTimer(); - private boolean field_205745_an; - private boolean field_212205_ao; -@@ -249,6 +250,7 @@ - this.field_195576_ac.func_219534_a(this.field_200256_aj); - this.field_195576_ac.func_219534_a(this.field_200258_al); - this.field_195576_ac.func_219534_a(this.field_200257_ak); -+ field_195576_ac.func_219534_a(lootManager); - this.field_213217_au = Util.func_215072_e(); - this.field_71294_K = p_i50590_10_; - } -@@ -336,6 +338,8 @@ - this.func_200245_b(new TranslationTextComponent("menu.loadingLevel")); - SaveHandler savehandler = this.func_71254_M().func_197715_a(p_71247_1_, this); - this.func_175584_a(this.func_71270_I(), savehandler); -+ // Move factory creation earlier to prevent startupquery deadlock -+ IChunkStatusListener ichunkstatuslistener = this.field_213220_d.create(11); - WorldInfo worldinfo = savehandler.func_75757_d(); - WorldSettings worldsettings; - if (worldinfo == null) { -@@ -357,13 +361,13 @@ - - worldinfo.func_230145_a_(this.getServerModName(), this.func_230045_q_().isPresent()); - this.func_195560_a(savehandler.func_75765_b(), worldinfo); -- IChunkStatusListener ichunkstatuslistener = this.field_213220_d.create(11); - this.func_213194_a(savehandler, worldinfo, worldsettings, ichunkstatuslistener); - this.func_147139_a(this.func_147135_j(), true); - this.func_213186_a(ichunkstatuslistener); - } - - protected void func_213194_a(SaveHandler p_213194_1_, WorldInfo p_213194_2_, WorldSettings p_213194_3_, IChunkStatusListener p_213194_4_) { -+ net.minecraftforge.common.DimensionManager.fireRegister(); - if (this.func_71242_L()) { - p_213194_2_.func_176127_a(field_213219_c); - } -@@ -407,6 +411,7 @@ - if (dimensiontype != DimensionType.field_223227_a_) { - this.field_71305_c.put(dimensiontype, new ServerMultiWorld(serverworld1, this, this.field_213217_au, p_213194_1_, dimensiontype, this.field_71304_b, p_213194_4_)); - } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(field_71305_c.get(dimensiontype))); - } - - } -@@ -565,6 +570,7 @@ - for(ServerWorld serverworld1 : this.func_212370_w()) { - if (serverworld1 != null) { - try { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(serverworld1)); - serverworld1.close(); - } catch (IOException ioexception) { - field_147145_h.error("Exception closing the level", (Throwable)ioexception); -@@ -605,6 +611,7 @@ - public void run() { - try { - if (this.func_71197_b()) { -+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarted(this); - 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())); -@@ -636,9 +643,15 @@ - this.field_71304_b.func_219897_b(); - this.field_71296_Q = true; - } -+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStopping(this); -+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions - } else { -+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions - this.func_71228_a((CrashReport)null); - } -+ } catch (net.minecraftforge.fml.StartupQuery.AbortedException e) { -+ // ignore silently -+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions - } catch (Throwable throwable1) { - field_147145_h.error("Encountered an unexpected exception", throwable1); - CrashReport crashreport; -@@ -655,6 +668,7 @@ - field_147145_h.error("We were unable to save this crash report to disk."); - } - -+ net.minecraftforge.fml.server.ServerLifecycleHooks.expectServerStopped(); // has to come before finalTick to avoid race conditions - this.func_71228_a(crashreport); - } finally { - try { -@@ -663,6 +677,7 @@ - } catch (Throwable throwable) { - field_147145_h.error("Exception stopping the server", throwable); - } finally { -+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStopped(this); - this.func_71240_o(); - } - -@@ -764,6 +779,7 @@ - - protected void func_71217_p(BooleanSupplier p_71217_1_) { - long i = Util.func_211178_c(); -+ net.minecraftforge.fml.hooks.BasicEventHooks.onPreServerTick(); - ++this.field_71315_w; - this.func_71190_q(p_71217_1_); - if (i - this.field_147142_T >= 5000000000L) { -@@ -778,6 +794,7 @@ - - Collections.shuffle(Arrays.asList(agameprofile)); - this.field_147147_p.func_151318_b().func_151330_a(agameprofile); -+ this.field_147147_p.invalidateJson(); - } - - if (this.field_71315_w % 6000 == 0) { -@@ -805,6 +822,7 @@ - long i1 = Util.func_211178_c(); - this.field_213215_ap.func_181747_a(i1 - i); - this.field_71304_b.func_76319_b(); -+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostServerTick(); - } - - protected void func_71190_q(BooleanSupplier p_71190_1_) { -@@ -812,7 +830,8 @@ - this.func_193030_aL().func_73660_a(); - this.field_71304_b.func_219895_b("levels"); - -- for(ServerWorld serverworld : this.func_212370_w()) { -+ for(ServerWorld serverworld : this.getWorldArray()) { -+ long tickStart = Util.func_211178_c(); - if (serverworld.field_73011_w.func_186058_p() == DimensionType.field_223227_a_ || this.func_71255_r()) { - this.field_71304_b.func_194340_a(() -> { - return serverworld.func_72912_H().func_76065_j() + " " + Registry.field_212622_k.func_177774_c(serverworld.field_73011_w.func_186058_p()); -@@ -824,6 +843,7 @@ - } - - this.field_71304_b.func_76320_a("tick"); -+ net.minecraftforge.fml.hooks.BasicEventHooks.onPreWorldTick(serverworld); - - try { - serverworld.func_72835_b(p_71190_1_); -@@ -832,12 +852,16 @@ - serverworld.func_72914_a(crashreport); - throw new ReportedException(crashreport); - } -+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostWorldTick(serverworld); - - this.field_71304_b.func_76319_b(); - this.field_71304_b.func_76319_b(); - } -+ perWorldTickTimes.computeIfAbsent(serverworld.func_201675_m().func_186058_p(), k -> new long[100])[this.field_71315_w % 100] = Util.func_211178_c() - tickStart; - } - -+ this.field_71304_b.func_219895_b("dim_unloading"); -+ net.minecraftforge.common.DimensionManager.unloadWorlds(this, this.field_71315_w % 200 == 0); - this.field_71304_b.func_219895_b("connection"); - this.func_147137_ag().func_151269_c(); - this.field_71304_b.func_219895_b("players"); -@@ -878,6 +902,7 @@ - OptionSpec optionspec10 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1); - OptionSpec optionspec11 = optionparser.accepts("serverId").withRequiredArg(); - OptionSpec optionspec12 = optionparser.nonOptions(); -+ optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File(".")); //Forge: Consume this argument, we use it in the launcher, and the client side. - - try { - OptionSet optionset = optionparser.parse(p_main_0_); -@@ -888,7 +913,7 @@ - - Path path = Paths.get("server.properties"); - ServerPropertiesProvider serverpropertiesprovider = new ServerPropertiesProvider(path); -- serverpropertiesprovider.func_219035_b(); -+ if (optionset.has(optionspec1) || !Files.exists(path)) serverpropertiesprovider.func_219035_b(); - Path path1 = Paths.get("eula.txt"); - ServerEula servereula = new ServerEula(path1); - if (optionset.has(optionspec1)) { -@@ -910,6 +935,10 @@ - GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); - PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(s, field_152367_a.getName())); - String s1 = Optional.ofNullable(optionset.valueOf(optionspec9)).orElse(serverpropertiesprovider.func_219034_a().field_219021_o); -+ if (s1 == null || s1.isEmpty() || new File(s, s1).getAbsolutePath().equals(new File(s).getAbsolutePath())) { -+ field_147145_h.error("Invalid world directory specified, must not be null, empty or the same directory as your universe! " + s1); -+ return; -+ } - final DedicatedServer dedicatedserver = new DedicatedServer(new File(s), serverpropertiesprovider, DataFixesManager.func_210901_a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache, LoggingChunkStatusListener::new, s1); - dedicatedserver.func_71224_l(optionset.valueOf(optionspec7)); - dedicatedserver.func_71208_b(optionset.valueOf(optionspec10)); -@@ -927,6 +956,7 @@ - Thread thread = new Thread("Server Shutdown Thread") { - public void run() { - dedicatedserver.func_71263_m(true); -+ LogManager.shutdown(); // we're manually managing the logging shutdown on the server. Make sure we do it here at the end. - } - }; - thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(field_147145_h)); -@@ -971,7 +1001,7 @@ - } - - public ServerWorld func_71218_a(DimensionType p_71218_1_) { -- return this.field_71305_c.get(p_71218_1_); -+ return net.minecraftforge.common.DimensionManager.getWorld(this, p_71218_1_, true, true); - } - - public Iterable func_212370_w() { -@@ -1010,7 +1040,7 @@ - } - - public String getServerModName() { -- return "vanilla"; -+ return net.minecraftforge.fml.BrandingControl.getServerBranding(); - } - - public CrashReport func_71230_b(CrashReport p_71230_1_) { -@@ -1396,6 +1426,10 @@ - public FunctionManager func_193030_aL() { - return this.field_200258_al; - } -+ -+ public net.minecraftforge.common.loot.LootModifierManager getLootModifierManager() { -+ return lootManager; -+ } - - public void func_193031_aM() { - if (!this.func_213162_bc()) { -@@ -1567,6 +1601,31 @@ - - public abstract boolean func_213199_b(GameProfile p_213199_1_); - -+ private Map perWorldTickTimes = Maps.newIdentityHashMap(); -+ @Nullable -+ public long[] getTickTime(DimensionType dim) { -+ return perWorldTickTimes.get(dim); -+ } -+ -+ @Deprecated //Forge Internal use Only, You can screw up a lot of things if you mess with this map. -+ public synchronized Map forgeGetWorldMap() { -+ return this.field_71305_c; -+ } -+ private int worldArrayMarker = 0; -+ private int worldArrayLast = -1; -+ private ServerWorld[] worldArray; -+ @Deprecated //Forge Internal use Only, use to protect against concurrent modifications in the world tick loop. -+ public synchronized void markWorldsDirty() { -+ worldArrayMarker++; -+ } -+ private ServerWorld[] getWorldArray() { -+ if (worldArrayMarker == worldArrayLast && worldArray != null) -+ return worldArray; -+ worldArray = this.field_71305_c.values().stream().toArray(x -> new ServerWorld[x]); -+ worldArrayLast = worldArrayMarker; -+ return worldArray; -+ } -+ - public void func_223711_a(Path p_223711_1_) throws IOException { - Path path = p_223711_1_.resolve("levels"); - diff --git a/patches_old/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches_old/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch deleted file mode 100644 index 49f4f78f2..000000000 --- a/patches_old/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/net/minecraft/server/integrated/IntegratedServer.java -+++ b/net/minecraft/server/integrated/IntegratedServer.java -@@ -64,6 +64,8 @@ - this.func_71237_c(p_71247_1_); - SaveHandler savehandler = this.func_71254_M().func_197715_a(p_71247_1_, this); - this.func_175584_a(this.func_71270_I(), savehandler); -+ // Move factory creation earlier to prevent startupquery deadlock -+ IChunkStatusListener ichunkstatuslistener = this.field_213220_d.create(11); - WorldInfo worldinfo = savehandler.func_75757_d(); - if (worldinfo == null) { - worldinfo = new WorldInfo(this.field_71350_m, p_71247_2_); -@@ -73,7 +75,6 @@ - - worldinfo.func_230145_a_(this.getServerModName(), this.func_230045_q_().isPresent()); - this.func_195560_a(savehandler.func_75765_b(), worldinfo); -- IChunkStatusListener ichunkstatuslistener = this.field_213220_d.create(11); - this.func_213194_a(savehandler, worldinfo, this.field_71350_m, ichunkstatuslistener); - if (this.func_71218_a(DimensionType.field_223227_a_).func_72912_H().func_176130_y() == null) { - this.func_147139_a(this.field_71349_l.field_71474_y.field_74318_M, true); -@@ -91,9 +92,10 @@ - this.func_71245_h(true); - field_147148_h.info("Generating keypair"); - this.func_71253_a(CryptManager.func_75891_b()); -+ if (!net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(this)) return false; - this.func_71247_a(this.func_71270_I(), this.func_71221_J(), this.field_71350_m.func_77160_d(), this.field_71350_m.func_77165_h(), this.field_71350_m.func_205391_j()); - this.func_71205_p(this.func_71214_G() + " - " + this.func_71218_a(DimensionType.field_223227_a_).func_72912_H().func_76065_j()); -- return true; -+ return net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarting(this); - } - - public void func_71217_p(BooleanSupplier p_71217_1_) { -@@ -128,6 +130,7 @@ - } - - public Difficulty func_147135_j() { -+ if (this.field_71349_l.field_71441_e == null) return this.field_71349_l.field_71474_y.field_74318_M; // Fix NPE just in case. - return this.field_71349_l.field_71441_e.func_72912_H().func_176130_y(); - } - -@@ -219,6 +222,7 @@ - } - - public void func_71263_m(boolean p_71263_1_) { -+ if (func_71278_l()) - this.func_213167_f(() -> { - for(ServerPlayerEntity serverplayerentity : Lists.newArrayList(this.func_184103_al().func_181057_v())) { - if (!serverplayerentity.func_110124_au().equals(this.field_211528_n)) { diff --git a/patches_old/minecraft/net/minecraft/stats/StatType.java.patch b/patches_old/minecraft/net/minecraft/stats/StatType.java.patch deleted file mode 100644 index a2c7f74f4..000000000 --- a/patches_old/minecraft/net/minecraft/stats/StatType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/stats/StatType.java -+++ b/net/minecraft/stats/StatType.java -@@ -7,7 +7,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public class StatType implements Iterable> { -+public class StatType extends net.minecraftforge.registries.ForgeRegistryEntry> implements Iterable> { - private final Registry field_199082_a; - private final Map> field_199083_b = new IdentityHashMap<>(); - diff --git a/patches_old/minecraft/net/minecraft/util/SharedConstants.java.patch b/patches_old/minecraft/net/minecraft/util/SharedConstants.java.patch deleted file mode 100644 index e0b080dd5..000000000 --- a/patches_old/minecraft/net/minecraft/util/SharedConstants.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/util/SharedConstants.java -+++ b/net/minecraft/util/SharedConstants.java -@@ -57,6 +57,7 @@ - } - - static { -+ if (System.getProperty("io.netty.leakDetection.level") == null) // Forge: allow level to be manually specified - ResourceLeakDetector.setLevel(field_184877_a); - CommandSyntaxException.ENABLE_COMMAND_STACK_TRACES = false; - CommandSyntaxException.BUILT_IN_EXCEPTIONS = new TranslatableExceptionProvider(); diff --git a/patches_old/minecraft/net/minecraft/util/SoundEvent.java.patch b/patches_old/minecraft/net/minecraft/util/SoundEvent.java.patch deleted file mode 100644 index 0ee27eff1..000000000 --- a/patches_old/minecraft/net/minecraft/util/SoundEvent.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/util/SoundEvent.java -+++ b/net/minecraft/util/SoundEvent.java -@@ -3,7 +3,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public class SoundEvent { -+public class SoundEvent extends net.minecraftforge.registries.ForgeRegistryEntry { - private final ResourceLocation field_187506_b; - - public SoundEvent(ResourceLocation p_i46834_1_) { diff --git a/patches_old/minecraft/net/minecraft/util/SoundEvents.java.patch b/patches_old/minecraft/net/minecraft/util/SoundEvents.java.patch deleted file mode 100644 index 4dfb06a40..000000000 --- a/patches_old/minecraft/net/minecraft/util/SoundEvents.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/util/SoundEvents.java -+++ b/net/minecraft/util/SoundEvents.java -@@ -2,6 +2,7 @@ - - import net.minecraft.util.registry.Registry; - -+@net.minecraftforge.registries.ObjectHolder("minecraft") - public class SoundEvents { - public static final SoundEvent field_187674_a = func_219592_a("ambient.cave"); - public static final SoundEvent field_204326_e = func_219592_a("ambient.underwater.enter"); diff --git a/patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch b/patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch deleted file mode 100644 index 508e4d06d..000000000 --- a/patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/util/math/RayTraceResult.java -+++ b/net/minecraft/util/math/RayTraceResult.java -@@ -8,7 +8,12 @@ - } - - public abstract RayTraceResult.Type func_216346_c(); -+ /** Used to determine what sub-segment is hit */ -+ public int subHit = -1; - -+ /** Used to add extra hit info */ -+ public Object hitInfo = null; -+ - public Vec3d func_216347_e() { - return this.field_72307_f; - } diff --git a/patches_old/minecraft/net/minecraft/util/math/shapes/EntitySelectionContext.java.patch b/patches_old/minecraft/net/minecraft/util/math/shapes/EntitySelectionContext.java.patch deleted file mode 100644 index 6e95eb98c..000000000 --- a/patches_old/minecraft/net/minecraft/util/math/shapes/EntitySelectionContext.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/net/minecraft/util/math/shapes/EntitySelectionContext.java -+++ b/net/minecraft/util/math/shapes/EntitySelectionContext.java -@@ -18,6 +18,11 @@ - private final Item field_216382_d; - - protected EntitySelectionContext(boolean p_i51181_1_, double p_i51181_2_, Item p_i51181_4_) { -+ this(null, p_i51181_1_, p_i51181_2_, p_i51181_4_); -+ } -+ -+ protected EntitySelectionContext(@javax.annotation.Nullable Entity entityIn, boolean p_i51181_1_, double p_i51181_2_, Item p_i51181_4_) { -+ this.entity = entityIn; - this.field_227579_b_ = p_i51181_1_; - this.field_216381_c = p_i51181_2_; - this.field_216382_d = p_i51181_4_; -@@ -25,7 +30,7 @@ - - @Deprecated - protected EntitySelectionContext(Entity p_i51182_1_) { -- this(p_i51182_1_.func_226274_bn_(), p_i51182_1_.func_226278_cu_(), p_i51182_1_ instanceof LivingEntity ? ((LivingEntity)p_i51182_1_).func_184614_ca().func_77973_b() : Items.field_190931_a); -+ this(p_i51182_1_, p_i51182_1_.func_226274_bn_(), p_i51182_1_.func_226278_cu_(), p_i51182_1_ instanceof LivingEntity ? ((LivingEntity)p_i51182_1_).func_184614_ca().func_77973_b() : Items.field_190931_a); - } - - public boolean func_216375_a(Item p_216375_1_) { -@@ -39,4 +44,11 @@ - public boolean func_216378_a(VoxelShape p_216378_1_, BlockPos p_216378_2_, boolean p_216378_3_) { - return this.field_216381_c > (double)p_216378_2_.func_177956_o() + p_216378_1_.func_197758_c(Direction.Axis.Y) - (double)1.0E-5F; - } -+ -+ private final @javax.annotation.Nullable Entity entity; -+ -+ @Override -+ public @javax.annotation.Nullable Entity getEntity() { -+ return entity; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/util/math/shapes/ISelectionContext.java.patch b/patches_old/minecraft/net/minecraft/util/math/shapes/ISelectionContext.java.patch deleted file mode 100644 index 13cd00bf6..000000000 --- a/patches_old/minecraft/net/minecraft/util/math/shapes/ISelectionContext.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/util/math/shapes/ISelectionContext.java -+++ b/net/minecraft/util/math/shapes/ISelectionContext.java -@@ -4,7 +4,7 @@ - import net.minecraft.item.Item; - import net.minecraft.util.math.BlockPos; - --public interface ISelectionContext { -+public interface ISelectionContext extends net.minecraftforge.common.extensions.IForgeSelectionContext { - static ISelectionContext func_216377_a() { - return EntitySelectionContext.field_216379_a; - } diff --git a/patches_old/minecraft/net/minecraft/util/palette/PalettedContainer.java.patch b/patches_old/minecraft/net/minecraft/util/palette/PalettedContainer.java.patch deleted file mode 100644 index 5c5ec295b..000000000 --- a/patches_old/minecraft/net/minecraft/util/palette/PalettedContainer.java.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/net/minecraft/util/palette/PalettedContainer.java -+++ b/net/minecraft/util/palette/PalettedContainer.java -@@ -65,8 +65,11 @@ - } - - private void func_186012_b(int p_186012_1_) { -- if (p_186012_1_ != this.field_186024_e) { -- this.field_186024_e = p_186012_1_; -+ setBits(p_186012_1_, false); -+ } -+ private void setBits(int bitsIn, boolean forceBits) { -+ if (bitsIn != this.field_186024_e) { -+ this.field_186024_e = bitsIn; - if (this.field_186024_e <= 4) { - this.field_186024_e = 4; - this.field_186022_c = new PaletteArray<>(this.field_205523_d, this.field_186024_e, this, this.field_205524_e); -@@ -75,6 +78,8 @@ - } else { - this.field_186022_c = this.field_205521_b; - this.field_186024_e = MathHelper.func_151241_e(this.field_205523_d.func_186804_a()); -+ if (forceBits) -+ this.field_186024_e = bitsIn; - } - - this.field_186022_c.func_186041_a(this.field_205526_g); -@@ -137,12 +142,16 @@ - this.func_210459_b(); - int i = p_186010_1_.readByte(); - if (this.field_186024_e != i) { -- this.func_186012_b(i); -+ this.setBits(i, true); //Forge, Force bit density to fix network issues, resize below if needed. - } - - this.field_186022_c.func_186038_a(p_186010_1_); - p_186010_1_.func_186873_b(this.field_186021_b.func_188143_a()); - this.func_210460_c(); -+ -+ int regSize = MathHelper.func_151241_e(this.field_205523_d.func_186804_a()); -+ if (this.field_186022_c == field_205521_b && this.field_186024_e != regSize) // Resize bits to fit registry. -+ this.onResize(regSize, field_205526_g); - } - - public void func_186009_b(PacketBuffer p_186009_1_) { diff --git a/patches_old/minecraft/net/minecraft/util/registry/Bootstrap.java.patch b/patches_old/minecraft/net/minecraft/util/registry/Bootstrap.java.patch deleted file mode 100644 index 652058f95..000000000 --- a/patches_old/minecraft/net/minecraft/util/registry/Bootstrap.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/util/registry/Bootstrap.java -+++ b/net/minecraft/util/registry/Bootstrap.java -@@ -43,6 +43,7 @@ - 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 - func_179868_d(); - } - } diff --git a/patches_old/minecraft/net/minecraft/util/text/LanguageMap.java.patch b/patches_old/minecraft/net/minecraft/util/text/LanguageMap.java.patch deleted file mode 100644 index 5f9fad508..000000000 --- a/patches_old/minecraft/net/minecraft/util/text/LanguageMap.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/util/text/LanguageMap.java -+++ b/net/minecraft/util/text/LanguageMap.java -@@ -36,6 +36,7 @@ - this.field_74816_c.put(entry.getKey(), s); - } - -+ net.minecraftforge.fml.server.LanguageHook.captureLanguageMap(this.field_74816_c); - this.field_150511_e = Util.func_211177_b(); - } catch (JsonParseException | IOException ioexception) { - field_201045_a.error("Couldn't read strings from /assets/minecraft/lang/en_us.json", (Throwable)ioexception); diff --git a/patches_old/minecraft/net/minecraft/util/text/TranslationTextComponent.java.patch b/patches_old/minecraft/net/minecraft/util/text/TranslationTextComponent.java.patch deleted file mode 100644 index 38a1be77c..000000000 --- a/patches_old/minecraft/net/minecraft/util/text/TranslationTextComponent.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/util/text/TranslationTextComponent.java -+++ b/net/minecraft/util/text/TranslationTextComponent.java -@@ -100,6 +100,10 @@ - } - } - -+ if (j == 0) { -+ // if we failed to match above, lets try the messageformat handler instead. -+ j = net.minecraftforge.fml.TextComponentMessageFormatHandler.handle(this, this.field_150278_b, this.field_150277_e, p_150269_1_); -+ } - if (j < p_150269_1_.length()) { - ITextComponent itextcomponent1 = new StringTextComponent(String.format(p_150269_1_.substring(j))); - itextcomponent1.func_150256_b().func_150221_a(this.func_150256_b()); diff --git a/patches_old/minecraft/net/minecraft/village/PointOfInterestType.java.patch b/patches_old/minecraft/net/minecraft/village/PointOfInterestType.java.patch deleted file mode 100644 index 5a5b12d7b..000000000 --- a/patches_old/minecraft/net/minecraft/village/PointOfInterestType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/village/PointOfInterestType.java -+++ b/net/minecraft/village/PointOfInterestType.java -@@ -19,7 +19,7 @@ - import net.minecraft.util.Util; - import net.minecraft.util.registry.Registry; - --public class PointOfInterestType { -+public class PointOfInterestType extends net.minecraftforge.registries.ForgeRegistryEntry { - private static final Predicate field_221071_s = (p_221041_0_) -> { - return Registry.field_218370_L.func_201756_e().map(VillagerProfession::func_221149_b).collect(Collectors.toSet()).contains(p_221041_0_); - }; diff --git a/patches_old/minecraft/net/minecraft/village/VillageSiege.java.patch b/patches_old/minecraft/net/minecraft/village/VillageSiege.java.patch deleted file mode 100644 index caa0c6a1d..000000000 --- a/patches_old/minecraft/net/minecraft/village/VillageSiege.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/net/minecraft/village/VillageSiege.java -+++ b/net/minecraft/village/VillageSiege.java -@@ -74,7 +74,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); -- if (this.func_225476_a(p_75529_1_, new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)) != null) { -+ Vec3d siegeLocation = this.func_225476_a(p_75529_1_, new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)); -+ if (siegeLocation != null) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.village.VillageSiegeEvent(this, p_75529_1_, playerentity, siegeLocation))) return false; - this.field_75534_e = 0; - this.field_75533_d = 20; - break; -@@ -94,7 +96,7 @@ - if (vec3d != null) { - ZombieEntity zombieentity; - try { -- zombieentity = new ZombieEntity(p_75530_1_); -+ 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(new BlockPos(zombieentity)), SpawnReason.EVENT, (ILivingEntityData)null, (CompoundNBT)null); - } catch (Exception exception) { - exception.printStackTrace(); diff --git a/patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch b/patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch deleted file mode 100644 index c8999d71f..000000000 --- a/patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/net/minecraft/world/biome/Biome.java -+++ b/net/minecraft/world/biome/Biome.java -@@ -54,7 +54,7 @@ - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - --public abstract class Biome { -+public abstract class Biome extends net.minecraftforge.registries.ForgeRegistryEntry { - public static final Logger field_150586_aC = LogManager.getLogger(); - public static final Set field_201870_ab = Sets.newHashSet(); - public static final ObjectIntIdentityMap field_185373_j = new ObjectIntIdentityMap<>(); -@@ -143,11 +143,11 @@ - } - - 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_); - } - - 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()); - } - - public Biome.RainType func_201851_b() { -@@ -196,7 +196,7 @@ - if (this.func_225486_c(p_201854_2_) >= 0.15F) { - return false; - } else { -- if (p_201854_2_.func_177956_o() >= 0 && p_201854_2_.func_177956_o() < 256 && p_201854_1_.func_226658_a_(LightType.BLOCK, p_201854_2_) < 10) { -+ if (p_201854_2_.func_177956_o() >= 0 && p_201854_2_.func_177956_o() < p_201854_1_.func_201675_m().getHeight() && p_201854_1_.func_226658_a_(LightType.BLOCK, p_201854_2_) < 10) { - BlockState blockstate = p_201854_1_.func_180495_p(p_201854_2_); - IFluidState ifluidstate = p_201854_1_.func_204610_c(p_201854_2_); - if (ifluidstate.func_206886_c() == Fluids.field_204546_a && blockstate.func_177230_c() instanceof FlowingFluidBlock) { -@@ -221,7 +221,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_); -- if (blockstate.func_196958_f() && Blocks.field_150433_aE.func_176223_P().func_196955_c(p_201850_1_, p_201850_2_)) { -+ if (blockstate.isAir(p_201850_1_, p_201850_2_) && Blocks.field_150433_aE.func_176223_P().func_196955_c(p_201850_1_, p_201850_2_)) { - return true; - } - } -@@ -375,6 +375,17 @@ - return this.field_185364_H; - } - -+ 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; -+ } -+ - public static class Builder { - @Nullable - private ConfiguredSurfaceBuilder field_205422_a; -@@ -526,6 +537,18 @@ - } - } - -+ public static class FlowerEntry extends WeightedRandom.Item { -+ private final BlockState state; -+ public FlowerEntry(BlockState state, int weight) { -+ super(weight); -+ this.state = state; -+ } -+ -+ public BlockState getState() { -+ return state; -+ } -+ } -+ - public static enum TempCategory { - OCEAN("ocean"), - COLD("cold"), diff --git a/patches_old/minecraft/net/minecraft/world/biome/Biomes.java.patch b/patches_old/minecraft/net/minecraft/world/biome/Biomes.java.patch deleted file mode 100644 index 59953600e..000000000 --- a/patches_old/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_old/minecraft/net/minecraft/world/biome/DefaultBiomeFeatures.java.patch b/patches_old/minecraft/net/minecraft/world/biome/DefaultBiomeFeatures.java.patch deleted file mode 100644 index 4c3ba0a59..000000000 --- a/patches_old/minecraft/net/minecraft/world/biome/DefaultBiomeFeatures.java.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/net/minecraft/world/biome/DefaultBiomeFeatures.java -+++ b/net/minecraft/world/biome/DefaultBiomeFeatures.java -@@ -132,30 +132,30 @@ - private static final BlockState field_226805_bm_ = Blocks.field_150419_aX.func_176223_P().func_206870_a(HugeMushroomBlock.field_196460_A, Boolean.valueOf(false)); - private static final BlockState field_226806_bn_ = Blocks.field_150420_aW.func_176223_P().func_206870_a(HugeMushroomBlock.field_196465_z, Boolean.valueOf(true)).func_206870_a(HugeMushroomBlock.field_196460_A, Boolean.valueOf(false)); - private static final BlockState field_226807_bo_ = Blocks.field_196706_do.func_176223_P().func_206870_a(HugeMushroomBlock.field_196465_z, Boolean.valueOf(false)).func_206870_a(HugeMushroomBlock.field_196460_A, Boolean.valueOf(false)); -- public static final TreeFeatureConfig field_226739_a_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_226792_b_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226775_aj_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(8).func_227360_i_(3).func_227353_a_(ImmutableList.of(new CocoaTreeDecorator(0.2F), new TrunkVineTreeDecorator(), new LeaveVineTreeDecorator())).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_226808_c_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226775_aj_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(8).func_227360_i_(3).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_226809_d_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_), new PineFoliagePlacer(1, 0))).func_225569_d_(7).func_227354_b_(4).func_227358_g_(1).func_227360_i_(3).func_227361_j_(1).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_226810_e_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_), new SpruceFoliagePlacer(2, 1))).func_225569_d_(6).func_227354_b_(3).func_227356_e_(1).func_227357_f_(1).func_227359_h_(2).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_226811_f_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226778_am_), new SimpleBlockStateProvider(field_226779_an_), new AcaciaFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227355_c_(2).func_227356_e_(0).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_226812_g_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_225568_b_(); -- public static final TreeFeatureConfig field_230129_h_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230130_i_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227355_c_(6).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).func_225568_b_(); -- public static final TreeFeatureConfig field_226814_i_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(3, 0))).func_225569_d_(5).func_227354_b_(3).func_227360_i_(3).func_227362_k_(1).func_227353_a_(ImmutableList.of(new LeaveVineTreeDecorator())).func_225568_b_(); -- public static final TreeFeatureConfig field_226815_j_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_225568_b_(); -- public static final TreeFeatureConfig field_226816_k_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.05F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230131_m_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).func_225568_b_(); -- public static final TreeFeatureConfig field_226817_l_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.05F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230132_o_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230133_p_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.02F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230134_q_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.02F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230135_r_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.02F))).func_225568_b_(); -- public static final TreeFeatureConfig field_230136_s_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.05F))).func_225568_b_(); -- public static final BaseTreeFeatureConfig field_226821_p_ = (new BaseTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226773_ah_))).func_225569_d_(4).func_225568_b_(); -- public static final HugeTreeFeatureConfig field_226822_q_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226782_aq_), new SimpleBlockStateProvider(field_226783_ar_))).func_225569_d_(6).func_225568_b_(); -- public static final HugeTreeFeatureConfig field_226823_r_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_))).func_225569_d_(13).func_227283_b_(15).func_227284_c_(13).func_227282_a_(ImmutableList.of(new AlterGroundTreeDecorator(new SimpleBlockStateProvider(field_226771_af_)))).func_225568_b_(); -- public static final HugeTreeFeatureConfig field_226824_s_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_))).func_225569_d_(13).func_227283_b_(15).func_227284_c_(3).func_227282_a_(ImmutableList.of(new AlterGroundTreeDecorator(new SimpleBlockStateProvider(field_226771_af_)))).func_225568_b_(); -- public static final HugeTreeFeatureConfig field_226825_t_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226775_aj_))).func_225569_d_(10).func_227283_b_(20).func_227282_a_(ImmutableList.of(new TrunkVineTreeDecorator(), new LeaveVineTreeDecorator())).func_225568_b_(); -+ public static final TreeFeatureConfig field_226739_a_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_226792_b_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226775_aj_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(8).func_227360_i_(3).func_227353_a_(ImmutableList.of(new CocoaTreeDecorator(0.2F), new TrunkVineTreeDecorator(), new LeaveVineTreeDecorator())).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196678_w).func_225568_b_(); -+ public static final TreeFeatureConfig field_226808_c_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226775_aj_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(8).func_227360_i_(3).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196678_w).func_225568_b_(); -+ public static final TreeFeatureConfig field_226809_d_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_), new PineFoliagePlacer(1, 0))).func_225569_d_(7).func_227354_b_(4).func_227358_g_(1).func_227360_i_(3).func_227361_j_(1).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196675_u).func_225568_b_(); -+ public static final TreeFeatureConfig field_226810_e_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_), new SpruceFoliagePlacer(2, 1))).func_225569_d_(6).func_227354_b_(3).func_227356_e_(1).func_227357_f_(1).func_227359_h_(2).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196675_u).func_225568_b_(); -+ public static final TreeFeatureConfig field_226811_f_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226778_am_), new SimpleBlockStateProvider(field_226779_an_), new AcaciaFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227355_c_(2).func_227356_e_(0).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196679_x).func_225568_b_(); -+ public static final TreeFeatureConfig field_226812_g_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196676_v).func_225568_b_(); -+ public static final TreeFeatureConfig field_230129_h_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196676_v).func_225568_b_(); -+ public static final TreeFeatureConfig field_230130_i_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227355_c_(6).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196676_v).func_225568_b_(); -+ public static final TreeFeatureConfig field_226814_i_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(3, 0))).func_225569_d_(5).func_227354_b_(3).func_227360_i_(3).func_227362_k_(1).func_227353_a_(ImmutableList.of(new LeaveVineTreeDecorator())).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_226815_j_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_226816_k_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.05F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_230131_m_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_226817_l_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.05F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_230132_o_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.002F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_230133_p_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(2, 0))).func_225569_d_(4).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.02F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_230134_q_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226772_ag_), new SimpleBlockStateProvider(field_226773_ah_), new BlobFoliagePlacer(0, 0))).func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.02F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196674_t).func_225568_b_(); -+ public static final TreeFeatureConfig field_230135_r_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.02F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196676_v).func_225568_b_(); -+ public static final TreeFeatureConfig field_230136_s_ = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226780_ao_), new SimpleBlockStateProvider(field_226781_ap_), new BlobFoliagePlacer(2, 0))).func_225569_d_(5).func_227354_b_(2).func_227360_i_(3).func_227352_a_().func_227353_a_(ImmutableList.of(new BeehiveTreeDecorator(0.05F))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196676_v).func_225568_b_(); -+ public static final BaseTreeFeatureConfig field_226821_p_ = (new BaseTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226773_ah_))).func_225569_d_(4).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196678_w).func_225568_b_(); -+ public static final HugeTreeFeatureConfig field_226822_q_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226782_aq_), new SimpleBlockStateProvider(field_226783_ar_))).func_225569_d_(6).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196680_y).func_225568_b_(); -+ public static final HugeTreeFeatureConfig field_226823_r_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_))).func_225569_d_(13).func_227283_b_(15).func_227284_c_(13).func_227282_a_(ImmutableList.of(new AlterGroundTreeDecorator(new SimpleBlockStateProvider(field_226771_af_)))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196675_u).func_225568_b_(); -+ public static final HugeTreeFeatureConfig field_226824_s_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226776_ak_), new SimpleBlockStateProvider(field_226777_al_))).func_225569_d_(13).func_227283_b_(15).func_227284_c_(3).func_227282_a_(ImmutableList.of(new AlterGroundTreeDecorator(new SimpleBlockStateProvider(field_226771_af_)))).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196675_u).func_225568_b_(); -+ public static final HugeTreeFeatureConfig field_226825_t_ = (new HugeTreeFeatureConfig.Builder(new SimpleBlockStateProvider(field_226774_ai_), new SimpleBlockStateProvider(field_226775_aj_))).func_225569_d_(10).func_227283_b_(20).func_227282_a_(ImmutableList.of(new TrunkVineTreeDecorator(), new LeaveVineTreeDecorator())).setSapling((net.minecraftforge.common.IPlantable)Blocks.field_196678_w).func_225568_b_(); - public static final BlockClusterFeatureConfig field_226826_u_ = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(field_226769_ad_), new SimpleBlockPlacer())).func_227315_a_(32).func_227322_d_(); - public static final BlockClusterFeatureConfig field_226827_v_ = (new BlockClusterFeatureConfig.Builder((new WeightedBlockStateProvider()).func_227407_a_(field_226769_ad_, 1).func_227407_a_(field_226770_ae_, 4), new SimpleBlockPlacer())).func_227315_a_(32).func_227322_d_(); - public static final BlockClusterFeatureConfig field_226828_w_ = (new BlockClusterFeatureConfig.Builder((new WeightedBlockStateProvider()).func_227407_a_(field_226769_ad_, 3).func_227407_a_(field_226770_ae_, 1), new SimpleBlockPlacer())).func_227319_b_(ImmutableSet.of(field_226771_af_)).func_227315_a_(32).func_227322_d_(); diff --git a/patches_old/minecraft/net/minecraft/world/biome/provider/BiomeProviderType.java.patch b/patches_old/minecraft/net/minecraft/world/biome/provider/BiomeProviderType.java.patch deleted file mode 100644 index db58e82b4..000000000 --- a/patches_old/minecraft/net/minecraft/world/biome/provider/BiomeProviderType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/biome/provider/BiomeProviderType.java -+++ b/net/minecraft/world/biome/provider/BiomeProviderType.java -@@ -4,7 +4,7 @@ - import net.minecraft.util.registry.Registry; - import net.minecraft.world.storage.WorldInfo; - --public class BiomeProviderType { -+public class BiomeProviderType extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final BiomeProviderType field_205460_b = func_226841_a_("checkerboard", CheckerboardBiomeProvider::new, CheckerboardBiomeProviderSettings::new); - public static final BiomeProviderType field_205461_c = func_226841_a_("fixed", SingleBiomeProvider::new, SingleBiomeProviderSettings::new); - public static final BiomeProviderType field_206859_d = func_226841_a_("vanilla_layered", OverworldBiomeProvider::new, OverworldBiomeProviderSettings::new); diff --git a/patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch b/patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch deleted file mode 100644 index fb6822625..000000000 --- a/patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/world/border/WorldBorder.java -+++ b/net/minecraft/world/border/WorldBorder.java -@@ -134,6 +134,10 @@ - this.field_177758_a.add(p_177737_1_); - } - -+ public void removeListener(IBorderListener listener) { -+ this.field_177758_a.remove(listener); -+ } -+ - public void func_177725_a(int p_177725_1_) { - this.field_177762_h = p_177725_1_; - this.field_212674_i.func_212652_j(); diff --git a/patches_old/minecraft/net/minecraft/world/chunk/ChunkPrimer.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/ChunkPrimer.java.patch deleted file mode 100644 index e7ecbf746..000000000 --- a/patches_old/minecraft/net/minecraft/world/chunk/ChunkPrimer.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/world/chunk/ChunkPrimer.java -+++ b/net/minecraft/world/chunk/ChunkPrimer.java -@@ -136,13 +136,13 @@ - if (this.field_201661_i[j >> 4] == Chunk.field_186036_a && p_177436_2_.func_177230_c() == Blocks.field_150350_a) { - return p_177436_2_; - } else { -- if (p_177436_2_.func_185906_d() > 0) { -+ if (p_177436_2_.getLightValue(this, p_177436_1_) > 0) { - this.field_201663_k.add(new BlockPos((i & 15) + this.func_76632_l().func_180334_c(), j, (k & 15) + this.func_76632_l().func_180333_d())); - } - - ChunkSection chunksection = this.func_217332_a(j >> 4); - BlockState blockstate = chunksection.func_222629_a(i & 15, j & 15, k & 15, p_177436_2_); -- if (this.field_201658_f.func_209003_a(ChunkStatus.field_222613_i) && p_177436_2_ != blockstate && (p_177436_2_.func_200016_a(this, p_177436_1_) != blockstate.func_200016_a(this, p_177436_1_) || p_177436_2_.func_185906_d() != blockstate.func_185906_d() || p_177436_2_.func_215691_g() || blockstate.func_215691_g())) { -+ if (this.field_201658_f.func_209003_a(ChunkStatus.field_222613_i) && p_177436_2_ != blockstate && (p_177436_2_.func_200016_a(this, p_177436_1_) != blockstate.func_200016_a(this, p_177436_1_) || p_177436_2_.getLightValue(this, p_177436_1_) != blockstate.getLightValue(this, p_177436_1_) || p_177436_2_.func_215691_g() || blockstate.func_215691_g())) { - WorldLightManager worldlightmanager = this.func_217307_e(); - worldlightmanager.func_215568_a(p_177436_1_); - } diff --git a/patches_old/minecraft/net/minecraft/world/chunk/ChunkStatus.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/ChunkStatus.java.patch deleted file mode 100644 index 2517f3b45..000000000 --- a/patches_old/minecraft/net/minecraft/world/chunk/ChunkStatus.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/chunk/ChunkStatus.java -+++ b/net/minecraft/world/chunk/ChunkStatus.java -@@ -23,7 +23,7 @@ - import net.minecraft.world.server.ServerWorld; - import net.minecraft.world.server.ServerWorldLightManager; - --public class ChunkStatus { -+public class ChunkStatus extends net.minecraftforge.registries.ForgeRegistryEntry { - private static final EnumSet field_222618_n = EnumSet.of(Heightmap.Type.OCEAN_FLOOR_WG, Heightmap.Type.WORLD_SURFACE_WG); - private static final EnumSet field_222619_o = EnumSet.of(Heightmap.Type.OCEAN_FLOOR, Heightmap.Type.WORLD_SURFACE, Heightmap.Type.MOTION_BLOCKING, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES); - private static final ChunkStatus.ILoadingWorker field_223211_p = (p_222588_0_, p_222588_1_, p_222588_2_, p_222588_3_, p_222588_4_, p_222588_5_) -> { diff --git a/patches_old/minecraft/net/minecraft/world/chunk/IChunk.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/IChunk.java.patch deleted file mode 100644 index d430dfe3d..000000000 --- a/patches_old/minecraft/net/minecraft/world/chunk/IChunk.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/chunk/IChunk.java -+++ b/net/minecraft/world/chunk/IChunk.java -@@ -151,4 +151,9 @@ - boolean func_217310_r(); - - void func_217305_b(boolean p_217305_1_); -+ -+ @Nullable -+ default net.minecraft.world.IWorld getWorldForge() { -+ return null; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch deleted file mode 100644 index 269b4f4e2..000000000 --- a/patches_old/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/net/minecraft/world/chunk/storage/ChunkSerializer.java -+++ b/net/minecraft/world/chunk/storage/ChunkSerializer.java -@@ -131,6 +131,7 @@ - ichunk = new Chunk(p_222656_0_.func_201672_e(), p_222656_3_, biomecontainer, upgradedata, iticklist, iticklist1, k1, achunksection, (p_222648_1_) -> { - func_222650_a(compoundnbt, p_222648_1_); - }); -+ if (compoundnbt.func_74764_b("ForgeCaps")) ((Chunk)ichunk).readCapsFromNBT(compoundnbt.func_74775_l("ForgeCaps")); - } else { - ChunkPrimer chunkprimer = new ChunkPrimer(p_222656_3_, upgradedata, achunksection, chunkprimerticklist, chunkprimerticklist1); - chunkprimer.func_225548_a_(biomecontainer); -@@ -143,7 +144,7 @@ - - if (!flag && chunkprimer.func_201589_g().func_209003_a(ChunkStatus.field_222614_j)) { - for(BlockPos blockpos : BlockPos.func_191531_b(p_222656_3_.func_180334_c(), 0, p_222656_3_.func_180333_d(), p_222656_3_.func_180332_e(), 255, p_222656_3_.func_180330_f())) { -- if (ichunk.func_180495_p(blockpos).func_185906_d() != 0) { -+ if (ichunk.func_180495_p(blockpos).getLightValue(ichunk, blockpos) != 0) { - chunkprimer.func_201637_h(blockpos); - } - } -@@ -182,6 +183,7 @@ - } - - if (chunkstatus$type == ChunkStatus.Type.LEVELCHUNK) { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Load(ichunk, compoundnbt, chunkstatus$type)); - return new ChunkPrimerWrapper((Chunk)ichunk); - } else { - ChunkPrimer chunkprimer1 = (ChunkPrimer)ichunk; -@@ -215,6 +217,8 @@ - chunkprimer1.func_205767_a(generationstage$carving, BitSet.valueOf(compoundnbt5.func_74770_j(s1))); - } - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Load(ichunk, compoundnbt, chunkstatus$type)); -+ - return chunkprimer1; - } - } -@@ -294,12 +298,22 @@ - for(int k = 0; k < chunk.func_177429_s().length; ++k) { - for(Entity entity : chunk.func_177429_s()[k]) { - CompoundNBT compoundnbt3 = new CompoundNBT(); -+ try { - if (entity.func_70039_c(compoundnbt3)) { - chunk.func_177409_g(true); - listnbt2.add(compoundnbt3); - } -+ } catch (Exception e) { -+ LogManager.getLogger().error("An Entity type {} has thrown an exception trying to write state. It will not persist. Report this to the mod author", entity.func_200600_R(), e); -+ } - } - } -+ try { -+ final CompoundNBT capTag = chunk.writeCapsToNBT(); -+ if (capTag != null) compoundnbt1.func_218657_a("ForgeCaps", capTag); -+ } catch (Exception exception) { -+ LogManager.getLogger().error("A capability provider has thrown an exception trying to write state. It will not persist. Report this to the mod author", exception); -+ } - } else { - ChunkPrimer chunkprimer = (ChunkPrimer)p_222645_1_; - listnbt2.addAll(chunkprimer.func_201652_l()); diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch deleted file mode 100644 index aa33bb3bd..000000000 --- a/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- a/net/minecraft/world/chunk/storage/RegionFile.java -+++ b/net/minecraft/world/chunk/storage/RegionFile.java -@@ -33,6 +33,7 @@ - private final IntBuffer field_76716_d; - private final IntBuffer field_227127_h_; - private final RegionBitmap field_227128_i_ = new RegionBitmap(); -+ private final Path filePath; - - public RegionFile(File p_i225784_1_, File p_i225784_2_) throws IOException { - this(p_i225784_1_.toPath(), p_i225784_2_.toPath(), RegionFileVersion.field_227159_b_); -@@ -40,6 +41,7 @@ - - public RegionFile(Path p_i225785_1_, Path p_i225785_2_, RegionFileVersion p_i225785_3_) throws IOException { - this.field_227125_e_ = p_i225785_3_; -+ this.filePath = p_i225785_1_; - if (!Files.isDirectory(p_i225785_2_)) { - throw new IllegalArgumentException("Expected directory, got " + p_i225785_2_.toAbsolutePath()); - } else { -@@ -62,6 +64,8 @@ - if (k != 0) { - int l = func_227142_b_(k); - int i1 = func_227131_a_(k); -+ if (i1 == 255) -+ i1 = forgeGetRealLength(j, l); - this.field_227128_i_.func_227120_a_(l, i1); - } - } -@@ -70,6 +74,66 @@ - } - } - -+ private int forgeGetRealLength(int index, int offset) throws IOException { -+ int chunkX = index & 31; -+ int chunkZ = (index >> 5) & 31; -+ -+ ByteBuffer header = ByteBuffer.allocate(5); -+ this.field_76719_c.read(header, offset * 4096); -+ ((Buffer)header).flip(); -+ -+ if (header.remaining() < 5) { -+ field_227122_a_.error("Chunk {},{} in {} header is truncated: expected 5 but read {}", chunkX, chunkZ, this.filePath.getFileName(), header.remaining()); -+ return 255; -+ } -+ -+ return (header.getInt() + 4) / 4096 + 1; -+ } -+ -+ /** -+ * In 1.14, Forge added support for large chunks by allowing it to overflow the 255 section limit. -+ * Deferring the section size to the 'length' header in front of the chunk data. -+ * In 1.15, Mojang solved this issue by adding an external '.mcc' file for large chunks. -+ * Here, we attempt to detect and extract these large chunks from Forge's format to Vanilla's -+ */ -+ public RegionFile extractLargeChunks(ChunkPos pos) throws IOException { -+ ChunkPos regionBase = new ChunkPos(pos.func_222241_h() * 32, pos.func_222242_i() * 32); -+ for (int index = 0; index < 1024; index++) { -+ int offset = this.field_76716_d.get(index); -+ if (func_227131_a_(offset) != 255) //If it's not 255, then it's not possible to be a oversized chunk. Move on. -+ continue; -+ offset = func_227142_b_(offset); -+ -+ ChunkPos chunk = new ChunkPos(regionBase.field_77276_a + (index & 31), regionBase.field_77275_b + ((index >> 5) & 31)); -+ -+ ByteBuffer header = ByteBuffer.allocate(5); -+ this.field_76719_c.read(header, offset * 4096); -+ ((Buffer)header).flip(); -+ -+ if (header.remaining() < 5) { -+ field_227122_a_.error("Chunk {} in {} header is truncated: expected 5 but read {}", chunk, this.filePath.getFileName(), header.remaining()); -+ continue; -+ } -+ -+ int length = header.getInt(); -+ byte version = header.get(); -+ int sectors = (length + 4) / 4096 + 1; -+ if (sectors <= 255 || func_227130_a_(version)) -+ continue; //Not over sized, or already external -+ -+ ByteBuffer data = ByteBuffer.allocate(length + 4); -+ this.field_76719_c.read(data, offset * 4096); -+ ((Buffer)data).flip(); -+ -+ if (data.remaining() < length + 4) { -+ field_227122_a_.error("Chunk {} in {} is truncated: expected {} but read {}", chunk, this.filePath.getFileName(), length + 4, data.remaining()); -+ continue; -+ } -+ func_227135_a_(chunk, data); //Save the chunk data, it'll be spit out to an external file. -+ } -+ return this; -+ } -+ - private Path func_227145_e_(ChunkPos p_227145_1_) { - String s = "c." + p_227145_1_.field_77276_a + "." + p_227145_1_.field_77275_b + ".mcc"; - return this.field_227124_d_.resolve(s); -@@ -225,6 +289,7 @@ - int j = this.field_76716_d.get(i); - int k = func_227142_b_(j); - int l = func_227131_a_(j); -+ if (l == 255) l = forgeGetRealLength(i, k); //Forge: Old Forge fix, get real length, so we can free if needed - int i1 = p_227135_2_.remaining(); - int j1 = func_227144_c_(i1); - int k1; diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFileCache.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFileCache.java.patch deleted file mode 100644 index c72ca60da..000000000 --- a/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFileCache.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/chunk/storage/RegionFileCache.java -+++ b/net/minecraft/world/chunk/storage/RegionFileCache.java -@@ -33,7 +33,7 @@ - } - - File file1 = new File(this.field_219101_a, "r." + p_219098_1_.func_222241_h() + "." + p_219098_1_.func_222242_i() + ".mca"); -- RegionFile regionfile1 = new RegionFile(file1, this.field_219101_a); -+ RegionFile regionfile1 = new RegionFile(file1, this.field_219101_a).extractLargeChunks(p_219098_1_); - this.field_219102_c.putAndMoveToFirst(i, regionfile1); - return regionfile1; - } diff --git a/patches_old/minecraft/net/minecraft/world/dimension/Dimension.java.patch b/patches_old/minecraft/net/minecraft/world/dimension/Dimension.java.patch deleted file mode 100644 index d4bf309e4..000000000 --- a/patches_old/minecraft/net/minecraft/world/dimension/Dimension.java.patch +++ /dev/null @@ -1,103 +0,0 @@ ---- a/net/minecraft/world/dimension/Dimension.java -+++ b/net/minecraft/world/dimension/Dimension.java -@@ -12,7 +12,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public abstract class Dimension { -+public abstract class Dimension implements net.minecraftforge.common.extensions.IForgeDimension { - public static final float[] field_111203_a = new float[]{1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F}; - protected final World field_76579_a; - private final DimensionType field_222669_f; -@@ -59,7 +59,7 @@ - - @OnlyIn(Dist.CLIENT) - public float func_76571_f() { -- return 128.0F; -+ return this.getWorld().func_72912_H().func_76067_t().getCloudHeight(); - } - - @OnlyIn(Dist.CLIENT) -@@ -74,7 +74,7 @@ - - @OnlyIn(Dist.CLIENT) - public double func_76565_k() { -- return this.field_76579_a.func_72912_H().func_76067_t() == WorldType.field_77138_c ? 1.0D : 0.03125D; -+ return this.field_76579_a.func_72912_H().func_76067_t().voidFadeMagnitude(); - } - - public boolean func_177500_n() { -@@ -103,6 +103,7 @@ - public void func_186059_r() { - } - -+ @Deprecated //Forge: Use WorldType.createChunkGenerator - public abstract ChunkGenerator func_186060_c(); - - @Nullable -@@ -123,5 +124,64 @@ - @OnlyIn(Dist.CLIENT) - public abstract boolean func_76568_b(int p_76568_1_, int p_76568_2_); - -- public abstract DimensionType func_186058_p(); -+ public DimensionType func_186058_p() { -+ return this.field_222669_f; -+ } -+ -+ /*======================================= Forge Start =========================================*/ -+ private net.minecraftforge.client.IRenderHandler skyRenderer = null; -+ private net.minecraftforge.client.IRenderHandler cloudRenderer = null; -+ private net.minecraftforge.client.IRenderHandler weatherRenderer = null; -+ -+ @Nullable -+ @OnlyIn(Dist.CLIENT) -+ @Override -+ public net.minecraftforge.client.IRenderHandler getSkyRenderer() { -+ return this.skyRenderer; -+ } -+ -+ @OnlyIn(Dist.CLIENT) -+ @Override -+ public void setSkyRenderer(net.minecraftforge.client.IRenderHandler skyRenderer) { -+ this.skyRenderer = skyRenderer; -+ } -+ -+ @Nullable -+ @OnlyIn(Dist.CLIENT) -+ @Override -+ public net.minecraftforge.client.IRenderHandler getCloudRenderer() { -+ return cloudRenderer; -+ } -+ -+ @OnlyIn(Dist.CLIENT) -+ @Override -+ public void setCloudRenderer(net.minecraftforge.client.IRenderHandler renderer) { -+ cloudRenderer = renderer; -+ } -+ -+ @Nullable -+ @OnlyIn(Dist.CLIENT) -+ @Override -+ public net.minecraftforge.client.IRenderHandler getWeatherRenderer() { -+ return weatherRenderer; -+ } -+ -+ @OnlyIn(Dist.CLIENT) -+ @Override -+ public void setWeatherRenderer(net.minecraftforge.client.IRenderHandler renderer) { -+ weatherRenderer = renderer; -+ } -+ -+ @Override -+ public void resetRainAndThunder() { -+ field_76579_a.func_72912_H().func_76080_g(0); -+ field_76579_a.func_72912_H().func_76084_b(false); -+ field_76579_a.func_72912_H().func_76090_f(0); -+ field_76579_a.func_72912_H().func_76069_a(false); -+ } -+ -+ @Override -+ public World getWorld() { -+ return this.field_76579_a; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/world/dimension/DimensionType.java.patch b/patches_old/minecraft/net/minecraft/world/dimension/DimensionType.java.patch deleted file mode 100644 index 3b060fef9..000000000 --- a/patches_old/minecraft/net/minecraft/world/dimension/DimensionType.java.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- a/net/minecraft/world/dimension/DimensionType.java -+++ b/net/minecraft/world/dimension/DimensionType.java -@@ -13,7 +13,7 @@ - import net.minecraft.world.biome.FuzzedBiomeMagnifier; - import net.minecraft.world.biome.IBiomeMagnifier; - --public class DimensionType implements IDynamicSerializable { -+public class DimensionType extends net.minecraftforge.registries.ForgeRegistryEntry implements IDynamicSerializable { - public static final DimensionType field_223227_a_ = func_212677_a("overworld", new DimensionType(1, "", "", OverworldDimension::new, true, ColumnFuzzedBiomeMagnifier.INSTANCE)); - public static final DimensionType field_223228_b_ = func_212677_a("the_nether", new DimensionType(0, "_nether", "DIM-1", NetherDimension::new, false, FuzzedBiomeMagnifier.INSTANCE)); - public static final DimensionType field_223229_c_ = func_212677_a("the_end", new DimensionType(2, "_end", "DIM1", EndDimension::new, false, FuzzedBiomeMagnifier.INSTANCE)); -@@ -23,18 +23,32 @@ - private final BiFunction field_201038_g; - private final boolean field_218273_h; - private final IBiomeMagnifier field_227175_i_; -+ private final boolean isVanilla; -+ private final net.minecraftforge.common.ModDimension modType; -+ private final net.minecraft.network.PacketBuffer data; - - private static DimensionType func_212677_a(String p_212677_0_, DimensionType p_212677_1_) { - return Registry.func_218343_a(Registry.field_212622_k, p_212677_1_.field_186074_d, p_212677_0_, p_212677_1_); - } - -+ //Forge, Internal use only. Use DimensionManager instead. -+ @Deprecated - protected DimensionType(int p_i225789_1_, String p_i225789_2_, String p_i225789_3_, BiFunction p_i225789_4_, boolean p_i225789_5_, IBiomeMagnifier p_i225789_6_) { -+ this(p_i225789_1_, p_i225789_2_, p_i225789_3_, p_i225789_4_, p_i225789_5_, p_i225789_6_, null, null); -+ } -+ -+ //Forge, Internal use only. Use DimensionManager instead. -+ @Deprecated -+ public DimensionType(int p_i225789_1_, String p_i225789_2_, String p_i225789_3_, BiFunction p_i225789_4_, boolean p_i225789_5_, IBiomeMagnifier p_i225789_6_, @Nullable net.minecraftforge.common.ModDimension modType, @Nullable net.minecraft.network.PacketBuffer data) { - this.field_186074_d = p_i225789_1_; - this.field_186076_f = p_i225789_2_; - this.field_212682_f = p_i225789_3_; - this.field_201038_g = p_i225789_4_; - this.field_218273_h = p_i225789_5_; - this.field_227175_i_ = p_i225789_6_; -+ this.isVanilla = this.field_186074_d >= 0 && this.field_186074_d <= 2; -+ this.modType = modType; -+ this.data = data; - } - - public static DimensionType func_218271_a(Dynamic p_218271_0_) { -@@ -49,8 +63,9 @@ - return this.field_186074_d + -1; - } - -+ @Deprecated //Forge Do not use, only used for villages backwards compatibility - public String func_186067_c() { -- return this.field_186076_f; -+ return isVanilla ? this.field_186076_f : ""; - } - - public File func_212679_a(File p_212679_1_) { -@@ -62,7 +77,7 @@ - } - - public String toString() { -- return func_212678_a(this).toString(); -+ return "DimensionType{" + func_212678_a(this) + "}"; - } - - @Nullable -@@ -70,7 +85,21 @@ - return Registry.field_212622_k.func_148745_a(p_186069_0_ - -1); - } - -+ public boolean isVanilla() { -+ return this.isVanilla; -+ } -+ - @Nullable -+ public net.minecraftforge.common.ModDimension getModType() { -+ return this.modType; -+ } -+ -+ @Nullable -+ public net.minecraft.network.PacketBuffer getData() { -+ return this.data; -+ } -+ -+ @Nullable - public static DimensionType func_193417_a(ResourceLocation p_193417_0_) { - return Registry.field_212622_k.func_82594_a(p_193417_0_); - } diff --git a/patches_old/minecraft/net/minecraft/world/dimension/EndDimension.java.patch b/patches_old/minecraft/net/minecraft/world/dimension/EndDimension.java.patch deleted file mode 100644 index 6817f7998..000000000 --- a/patches_old/minecraft/net/minecraft/world/dimension/EndDimension.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/world/dimension/EndDimension.java -+++ b/net/minecraft/world/dimension/EndDimension.java -@@ -24,8 +24,8 @@ - - public EndDimension(World p_i49932_1_, DimensionType p_i49932_2_) { - super(p_i49932_1_, p_i49932_2_, 0.0F); -- CompoundNBT compoundnbt = p_i49932_1_.func_72912_H().func_186347_a(DimensionType.field_223229_c_); -- this.field_186064_g = p_i49932_1_ instanceof ServerWorld ? new DragonFightManager((ServerWorld)p_i49932_1_, compoundnbt.func_74775_l("DragonFight")) : null; -+ CompoundNBT compoundnbt = p_i49932_1_.func_72912_H().func_186347_a(p_i49932_2_); -+ this.field_186064_g = p_i49932_1_ instanceof ServerWorld ? new DragonFightManager((ServerWorld)p_i49932_1_, compoundnbt.func_74775_l("DragonFight"), this) : null; - } - - public ChunkGenerator func_186060_c() { -@@ -99,17 +99,13 @@ - return false; - } - -- public DimensionType func_186058_p() { -- return DimensionType.field_223229_c_; -- } -- - public void func_186057_q() { - CompoundNBT compoundnbt = new CompoundNBT(); - if (this.field_186064_g != null) { - compoundnbt.func_218657_a("DragonFight", this.field_186064_g.func_186088_a()); - } - -- this.field_76579_a.func_72912_H().func_186345_a(DimensionType.field_223229_c_, compoundnbt); -+ this.field_76579_a.func_72912_H().func_186345_a(this.field_76579_a.func_201675_m().func_186058_p(), compoundnbt); - } - - public void func_186059_r() { diff --git a/patches_old/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch b/patches_old/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch deleted file mode 100644 index 23f0a9501..000000000 --- a/patches_old/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/dimension/NetherDimension.java -+++ b/net/minecraft/world/dimension/NetherDimension.java -@@ -74,8 +74,4 @@ - } - }; - } -- -- public DimensionType func_186058_p() { -- return DimensionType.field_223228_b_; -- } - } diff --git a/patches_old/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch b/patches_old/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch deleted file mode 100644 index a50b9a307..000000000 --- a/patches_old/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/world/dimension/OverworldDimension.java -+++ b/net/minecraft/world/dimension/OverworldDimension.java -@@ -51,10 +51,6 @@ - super(p_i49933_1_, p_i49933_2_, 0.0F); - } - -- public DimensionType func_186058_p() { -- return DimensionType.field_223227_a_; -- } -- - public ChunkGenerator func_186060_c() { - WorldType worldtype = this.field_76579_a.func_72912_H().func_76067_t(); - ChunkGeneratorType chunkgeneratortype = ChunkGeneratorType.field_205489_f; diff --git a/patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch b/patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch deleted file mode 100644 index e53ba433b..000000000 --- a/patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/net/minecraft/world/end/DragonFightManager.java -+++ b/net/minecraft/world/end/DragonFightManager.java -@@ -76,7 +76,7 @@ - private int field_186123_q; - private List field_186124_r; - -- public DragonFightManager(ServerWorld p_i46669_1_, CompoundNBT p_i46669_2_) { -+ public DragonFightManager(ServerWorld p_i46669_1_, CompoundNBT p_i46669_2_, net.minecraft.world.dimension.EndDimension dim) { - this.field_186110_d = p_i46669_1_; - if (p_i46669_2_.func_150297_b("DragonKilled", 99)) { - if (p_i46669_2_.func_186855_b("DragonUUID")) { -@@ -85,6 +85,7 @@ - - this.field_186117_k = p_i46669_2_.func_74767_n("DragonKilled"); - this.field_186118_l = p_i46669_2_.func_74767_n("PreviouslyKilled"); -+ this.field_186120_n = !p_i46669_2_.func_74767_n("LegacyScanPerformed"); // Forge: fix MC-105080 - if (p_i46669_2_.func_74767_n("IsRespawning")) { - this.field_186122_p = DragonSpawnState.START; - } -@@ -105,7 +106,7 @@ - } - } else { - this.field_186111_e.addAll(ContiguousSet.create(Range.closedOpen(0, 20), DiscreteDomain.integers())); -- Collections.shuffle(this.field_186111_e, new Random(p_i46669_1_.func_72905_C())); -+ Collections.shuffle(this.field_186111_e, new Random(dim.getSeed())); - } - - this.field_186112_f = BlockPatternBuilder.func_177660_a().func_177659_a(" ", " ", " ", " # ", " ", " ", " ").func_177659_a(" ", " ", " ", " # ", " ", " ", " ").func_177659_a(" ", " ", " ", " # ", " ", " ", " ").func_177659_a(" ### ", " # # ", "# #", "# # #", "# #", " # # ", " ### ").func_177659_a(" ", " ### ", " ##### ", " ##### ", " ##### ", " ### ", " ").func_177662_a('#', CachedBlockInfo.func_177510_a(BlockMatcher.func_177642_a(Blocks.field_150357_h))).func_177661_b(); -@@ -119,6 +120,7 @@ - - compoundnbt.func_74757_a("DragonKilled", this.field_186117_k); - compoundnbt.func_74757_a("PreviouslyKilled", this.field_186118_l); -+ compoundnbt.func_74757_a("LegacyScanPerformed", !this.field_186120_n); // Forge: fix MC-105080 - if (this.field_186121_o != null) { - compoundnbt.func_218657_a("ExitPortalLocation", NBTUtil.func_186859_a(this.field_186121_o)); - } -@@ -492,6 +494,13 @@ - endercrystalentity.func_184516_a((BlockPos)null); - } - } -+ } - -+ public void addPlayer(ServerPlayerEntity player) { -+ this.field_186109_c.func_186760_a(player); - } -+ -+ public void removePlayer(ServerPlayerEntity player) { -+ this.field_186109_c.func_186761_b(player); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkGenerator.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkGenerator.java.patch deleted file mode 100644 index ce970844f..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/ChunkGenerator.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/ChunkGenerator.java -+++ b/net/minecraft/world/gen/ChunkGenerator.java -@@ -196,7 +196,7 @@ - public abstract void func_222537_b(IWorld p_222537_1_, IChunk p_222537_2_); - - public int func_222530_f() { -- return 63; -+ return field_222540_a.func_201675_m().getSeaLevel(); - } - - public abstract int func_222529_a(int p_222529_1_, int p_222529_2_, Heightmap.Type p_222529_3_); diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorType.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorType.java.patch deleted file mode 100644 index 8c9603408..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/ChunkGeneratorType.java -+++ b/net/minecraft/world/gen/ChunkGeneratorType.java -@@ -7,7 +7,7 @@ - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; - --public class ChunkGeneratorType> implements IChunkGeneratorFactory { -+public class ChunkGeneratorType> extends net.minecraftforge.registries.ForgeRegistryEntry> implements IChunkGeneratorFactory { - public static final ChunkGeneratorType field_206911_b = func_212676_a("surface", OverworldChunkGenerator::new, OverworldGenSettings::new, true); - public static final ChunkGeneratorType field_206912_c = func_212676_a("caves", NetherChunkGenerator::new, NetherGenSettings::new, true); - public static final ChunkGeneratorType field_206913_d = func_212676_a("floating_islands", EndChunkGenerator::new, EndGenerationSettings::new, true); diff --git a/patches_old/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch b/patches_old/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch deleted file mode 100644 index 36577a381..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/IWorldGenerationBaseReader.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/IWorldGenerationBaseReader.java -+++ b/net/minecraft/world/gen/IWorldGenerationBaseReader.java -@@ -8,4 +8,8 @@ - boolean func_217375_a(BlockPos p_217375_1_, Predicate p_217375_2_); - - BlockPos func_205770_a(Heightmap.Type p_205770_1_, BlockPos p_205770_2_); -+ -+ default int getMaxHeight() { -+ return this instanceof net.minecraft.world.IWorld ? ((net.minecraft.world.IWorld)this).func_201672_e().func_201675_m().getHeight() : 256; -+ } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch b/patches_old/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch deleted file mode 100644 index b9ce49b05..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/NoiseChunkGenerator.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/world/gen/NoiseChunkGenerator.java -+++ b/net/minecraft/world/gen/NoiseChunkGenerator.java -@@ -378,8 +378,8 @@ - } - - if (blockstate != field_222562_i) { -- if (blockstate.func_185906_d() != 0) { -- blockpos$mutable.func_181079_c(j3, j2, i4); -+ blockpos$mutable.func_181079_c(j3, j2, i4); -+ if (blockstate.getLightValue(chunkprimer, blockpos$mutable) != 0) { - chunkprimer.func_201637_h(blockpos$mutable); - } - diff --git a/patches_old/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch b/patches_old/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch deleted file mode 100644 index 024973d21..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/net/minecraft/world/gen/WorldGenRegion.java -+++ b/net/minecraft/world/gen/WorldGenRegion.java -@@ -164,11 +164,11 @@ - - public boolean func_225521_a_(BlockPos p_225521_1_, boolean p_225521_2_, @Nullable Entity p_225521_3_) { - BlockState blockstate = this.func_180495_p(p_225521_1_); -- if (blockstate.func_196958_f()) { -+ if (blockstate.isAir(this, p_225521_1_)) { - return false; - } else { - if (p_225521_2_) { -- TileEntity tileentity = blockstate.func_177230_c().func_149716_u() ? this.func_175625_s(p_225521_1_) : null; -+ TileEntity tileentity = blockstate.hasTileEntity() ? this.func_175625_s(p_225521_1_) : null; - Block.func_220054_a(blockstate, this.field_201689_f, p_225521_1_, tileentity, p_225521_3_, ItemStack.field_190927_a); - } - -@@ -186,12 +186,12 @@ - CompoundNBT compoundnbt = ichunk.func_201579_g(p_175625_1_); - if (compoundnbt != null) { - if ("DUMMY".equals(compoundnbt.func_74779_i("id"))) { -- Block block = this.func_180495_p(p_175625_1_).func_177230_c(); -- if (!(block instanceof ITileEntityProvider)) { -+ BlockState state = this.func_180495_p(p_175625_1_); -+ if (!state.hasTileEntity()) { - return null; - } - -- tileentity = ((ITileEntityProvider)block).func_196283_a_(this.field_201689_f); -+ tileentity = state.createTileEntity(this.field_201689_f); - } else { - tileentity = TileEntity.func_203403_c(compoundnbt); - } -@@ -202,7 +202,7 @@ - } - } - -- if (ichunk.func_180495_p(p_175625_1_).func_177230_c() instanceof ITileEntityProvider) { -+ if (ichunk.func_180495_p(p_175625_1_).hasTileEntity()) { - field_208303_a.warn("Tried to access a block entity before it was created. {}", (Object)p_175625_1_); - } - -@@ -218,9 +218,9 @@ - } - - Block block = p_180501_2_.func_177230_c(); -- if (block.func_149716_u()) { -+ if (p_180501_2_.hasTileEntity()) { - if (ichunk.func_201589_g().func_202129_d() == ChunkStatus.Type.LEVELCHUNK) { -- ichunk.func_177426_a(p_180501_1_, ((ITileEntityProvider)block).func_196283_a_(this)); -+ ichunk.func_177426_a(p_180501_1_, p_180501_2_.createTileEntity(this)); - } else { - CompoundNBT compoundnbt = new CompoundNBT(); - compoundnbt.func_74768_a("x", p_180501_1_.func_177958_n()); -@@ -229,7 +229,7 @@ - compoundnbt.func_74778_a("id", "DUMMY"); - ichunk.func_201591_a(compoundnbt); - } -- } else if (blockstate != null && blockstate.func_177230_c().func_149716_u()) { -+ } else if (blockstate != null && blockstate.hasTileEntity()) { - ichunk.func_177425_e(p_180501_1_); - } - diff --git a/patches_old/minecraft/net/minecraft/world/gen/blockplacer/BlockPlacerType.java.patch b/patches_old/minecraft/net/minecraft/world/gen/blockplacer/BlockPlacerType.java.patch deleted file mode 100644 index 3b7663ee3..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/blockplacer/BlockPlacerType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/blockplacer/BlockPlacerType.java -+++ b/net/minecraft/world/gen/blockplacer/BlockPlacerType.java -@@ -4,7 +4,7 @@ - import java.util.function.Function; - import net.minecraft.util.registry.Registry; - --public class BlockPlacerType

{ -+public class BlockPlacerType

extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final BlockPlacerType field_227259_a_ = func_227264_a_("simple_block_placer", SimpleBlockPlacer::new); - public static final BlockPlacerType field_227260_b_ = func_227264_a_("double_plant_placer", DoublePlantBlockPlacer::new); - public static final BlockPlacerType field_227261_c_ = func_227264_a_("column_placer", ColumnBlockPlacer::new); diff --git a/patches_old/minecraft/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java.patch b/patches_old/minecraft/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java.patch deleted file mode 100644 index 0a4da6d68..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java -+++ b/net/minecraft/world/gen/blockstateprovider/BlockStateProviderType.java -@@ -4,7 +4,7 @@ - import java.util.function.Function; - import net.minecraft.util.registry.Registry; - --public class BlockStateProviderType

{ -+public class BlockStateProviderType

extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final BlockStateProviderType field_227394_a_ = func_227400_a_("simple_state_provider", SimpleBlockStateProvider::new); - public static final BlockStateProviderType field_227395_b_ = func_227400_a_("weighted_state_provider", WeightedBlockStateProvider::new); - public static final BlockStateProviderType field_227396_c_ = func_227400_a_("plain_flower_provider", PlainFlowerBlockStateProvider::new); diff --git a/patches_old/minecraft/net/minecraft/world/gen/carver/WorldCarver.java.patch b/patches_old/minecraft/net/minecraft/world/gen/carver/WorldCarver.java.patch deleted file mode 100644 index bdaef4183..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/carver/WorldCarver.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/carver/WorldCarver.java -+++ b/net/minecraft/world/gen/carver/WorldCarver.java -@@ -22,7 +22,7 @@ - import net.minecraft.world.chunk.IChunk; - import net.minecraft.world.gen.feature.ProbabilityConfig; - --public abstract class WorldCarver { -+public abstract class WorldCarver extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final WorldCarver field_222709_a = func_222699_a("cave", new CaveWorldCarver(ProbabilityConfig::func_214645_a, 256)); - public static final WorldCarver field_222710_b = func_222699_a("hell_cave", new NetherCaveWorldCarver(ProbabilityConfig::func_214645_a)); - public static final WorldCarver field_222711_c = func_222699_a("canyon", new CanyonWorldCarver(ProbabilityConfig::func_214645_a)); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch deleted file mode 100644 index c2e5bd6b8..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java -+++ b/net/minecraft/world/gen/feature/AbstractBigMushroomFeature.java -@@ -20,7 +20,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); -- if (!p_227210_1_.func_180495_p(p_227210_6_).func_200015_d(p_227210_1_, p_227210_6_)) { -+ if (p_227210_1_.func_180495_p(p_227210_6_).canBeReplacedByLogs(p_227210_1_, p_227210_6_)) { - this.func_202278_a(p_227210_1_, p_227210_6_, p_227210_4_.field_227273_b_.func_225574_a_(p_227210_2_, p_227210_3_)); - } - } -@@ -38,7 +38,7 @@ - - protected boolean func_227209_a_(IWorld p_227209_1_, BlockPos p_227209_2_, int p_227209_3_, BlockPos.Mutable p_227209_4_, BigMushroomFeatureConfig p_227209_5_) { - int i = p_227209_2_.func_177956_o(); -- if (i >= 1 && i + p_227209_3_ + 1 < 256) { -+ if (i >= 1 && i + p_227209_3_ + 1 < p_227209_1_.getMaxHeight()) { - Block block = p_227209_1_.func_180495_p(p_227209_2_.func_177977_b()).func_177230_c(); - if (!func_227250_b_(block)) { - return false; -@@ -49,7 +49,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_189533_g(p_227209_2_).func_196234_d(l, j, i1)); -- if (!blockstate.func_196958_f() && !blockstate.func_203425_a(BlockTags.field_206952_E)) { -+ if (!blockstate.isAir(p_227209_1_, p_227209_4_) && !blockstate.func_203425_a(BlockTags.field_206952_E)) { - return false; - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractSmallTreeFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractSmallTreeFeature.java.patch deleted file mode 100644 index a00031dfe..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractSmallTreeFeature.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/net/minecraft/world/gen/feature/AbstractSmallTreeFeature.java -+++ b/net/minecraft/world/gen/feature/AbstractSmallTreeFeature.java -@@ -35,7 +35,7 @@ - blockpos = p_227212_5_; - } - -- if (blockpos.func_177956_o() >= 1 && blockpos.func_177956_o() + p_227212_2_ + 1 <= 256) { -+ if (blockpos.func_177956_o() >= 1 && blockpos.func_177956_o() + p_227212_2_ + 1 <= p_227212_1_.getMaxHeight()) { - for(int i1 = 0; i1 <= p_227212_2_ + 1; ++i1) { - int j1 = p_227212_6_.field_227327_a_.func_225570_a_(p_227212_3_, p_227212_2_, p_227212_4_, i1); - BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable(); -@@ -44,7 +44,7 @@ - int l = -j1; - - while(l <= j1) { -- if (i1 + blockpos.func_177956_o() >= 0 && i1 + blockpos.func_177956_o() < 256) { -+ if (i1 + blockpos.func_177956_o() >= 0 && i1 + blockpos.func_177956_o() < p_227212_1_.getMaxHeight()) { - blockpos$mutable.func_181079_c(k + blockpos.func_177958_n(), i1 + blockpos.func_177956_o(), l + blockpos.func_177952_p()); - if (func_214587_a(p_227212_1_, blockpos$mutable) && (p_227212_6_.field_227337_l_ || !func_227222_d_(p_227212_1_, blockpos$mutable))) { - ++l; -@@ -59,7 +59,7 @@ - } - } - -- return func_214585_i(p_227212_1_, blockpos.func_177977_b()) && blockpos.func_177956_o() < 256 - p_227212_2_ - 1 ? Optional.of(blockpos) : Optional.empty(); -+ return isSoilOrFarm(p_227212_1_, blockpos.func_177977_b(), p_227212_6_.getSapling()) && blockpos.func_177956_o() < p_227212_1_.getMaxHeight() - p_227212_2_ - 1 ? Optional.of(blockpos) : Optional.empty(); - } else { - return Optional.empty(); - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch deleted file mode 100644 index 4592a4303..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/AbstractTreeFeature.java.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- a/net/minecraft/world/gen/feature/AbstractTreeFeature.java -+++ b/net/minecraft/world/gen/feature/AbstractTreeFeature.java -@@ -34,6 +34,8 @@ - } - - protected static boolean func_214587_a(IWorldGenerationBaseReader p_214587_0_, BlockPos p_214587_1_) { -+ if (p_214587_0_ instanceof net.minecraft.world.IWorldReader) // FORGE: Redirect to state method when possible -+ return p_214587_0_.func_217375_a(p_214587_1_, state -> state.canBeReplacedByLogs((net.minecraft.world.IWorldReader)p_214587_0_, p_214587_1_)); - return p_214587_0_.func_217375_a(p_214587_1_, (p_214573_0_) -> { - Block block = p_214573_0_.func_177230_c(); - return p_214573_0_.func_196958_f() || p_214573_0_.func_203425_a(BlockTags.field_206952_E) || func_227250_b_(block) || block.func_203417_a(BlockTags.field_200031_h) || block.func_203417_a(BlockTags.field_200030_g) || block == Blocks.field_150395_bd; -@@ -41,6 +43,8 @@ - } - - public static boolean func_214574_b(IWorldGenerationBaseReader p_214574_0_, BlockPos p_214574_1_) { -+ if (p_214574_0_ instanceof net.minecraft.world.IBlockReader) // FORGE: Redirect to state method when possible -+ return p_214574_0_.func_217375_a(p_214574_1_, state -> state.isAir((net.minecraft.world.IBlockReader)p_214574_0_, p_214574_1_)); - return p_214574_0_.func_217375_a(p_214574_1_, BlockState::func_196958_f); - } - -@@ -64,17 +68,27 @@ - } - - public static boolean func_214572_g(IWorldGenerationBaseReader p_214572_0_, BlockPos p_214572_1_) { -+ if (p_214572_0_ instanceof net.minecraft.world.IWorldReader) // FORGE: Redirect to state method when possible -+ return p_214572_0_.func_217375_a(p_214572_1_, state -> state.canBeReplacedByLeaves((net.minecraft.world.IWorldReader)p_214572_0_, p_214572_1_)); - return p_214572_0_.func_217375_a(p_214572_1_, (p_227223_0_) -> { - return p_227223_0_.func_196958_f() || p_227223_0_.func_203425_a(BlockTags.field_206952_E); - }); - } - -+ @Deprecated //Forge: moved to isSoil - public static boolean func_214589_h(IWorldGenerationBaseReader p_214589_0_, BlockPos p_214589_1_) { - return p_214589_0_.func_217375_a(p_214589_1_, (p_227221_0_) -> { - return func_227250_b_(p_227221_0_.func_177230_c()); - }); - } - -+ protected static boolean isSoil(IWorldGenerationBaseReader reader, BlockPos pos, net.minecraftforge.common.IPlantable sapling) { -+ if (!(reader instanceof net.minecraft.world.IBlockReader) || sapling == null) -+ return func_214589_h(reader, pos); -+ return reader.func_217375_a(pos, state -> state.canSustainPlant((net.minecraft.world.IBlockReader)reader, pos, Direction.UP, sapling)); -+ } -+ -+ @Deprecated //Forge: moved to isSoilOrFarm - protected static boolean func_214585_i(IWorldGenerationBaseReader p_214585_0_, BlockPos p_214585_1_) { - return p_214585_0_.func_217375_a(p_214585_1_, (p_227220_0_) -> { - Block block = p_227220_0_.func_177230_c(); -@@ -82,6 +96,12 @@ - }); - } - -+ protected static boolean isSoilOrFarm(IWorldGenerationBaseReader reader, BlockPos pos, net.minecraftforge.common.IPlantable sapling) { -+ if (!(reader instanceof net.minecraft.world.IBlockReader) || sapling == null) -+ return func_214585_i(reader, pos); -+ return reader.func_217375_a(pos, state -> state.canSustainPlant((net.minecraft.world.IBlockReader)reader, pos, Direction.UP, sapling)); -+ } -+ - public static boolean func_214576_j(IWorldGenerationBaseReader p_214576_0_, BlockPos p_214576_1_) { - return p_214576_0_.func_217375_a(p_214576_1_, (p_227218_0_) -> { - Material material = p_227218_0_.func_185904_a(); -@@ -89,6 +109,7 @@ - }); - } - -+ @Deprecated //Forge: moved to setDirtAt - protected void func_214584_a(IWorldGenerationReader p_214584_1_, BlockPos p_214584_2_) { - if (!func_214578_c(p_214584_1_, p_214584_2_)) { - this.func_202278_a(p_214584_1_, p_214584_2_, Blocks.field_150346_d.func_176223_P()); -@@ -116,6 +137,13 @@ - } - } - -+ protected void setDirtAt(IWorldGenerationReader reader, BlockPos pos, BlockPos origin) { -+ if (!(reader instanceof IWorld)) { -+ func_214584_a(reader, pos); -+ return; -+ } -+ ((IWorld)reader).func_180495_p(pos).onPlantGrow((IWorld)reader, pos, origin); -+ } - protected void func_202278_a(IWorldWriter p_202278_1_, BlockPos p_202278_2_, BlockState p_202278_3_) { - this.func_208521_b(p_202278_1_, p_202278_2_, p_202278_3_); - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/AcaciaFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/AcaciaFeature.java.patch deleted file mode 100644 index ceb7a6754..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/AcaciaFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/AcaciaFeature.java -+++ b/net/minecraft/world/gen/feature/AcaciaFeature.java -@@ -24,7 +24,7 @@ - return false; - } else { - BlockPos blockpos = optional.get(); -- this.func_214584_a(p_225557_1_, blockpos.func_177977_b()); -+ this.setDirtAt(p_225557_1_, blockpos.func_177977_b(), blockpos); - Direction direction = Direction.Plane.HORIZONTAL.func_179518_a(p_225557_2_); - int l = i - p_225557_2_.nextInt(4) - 1; - int i1 = 3 - p_225557_2_.nextInt(3); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch deleted file mode 100644 index 790cce939..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- a/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java -+++ b/net/minecraft/world/gen/feature/BaseTreeFeatureConfig.java -@@ -17,6 +17,7 @@ - public final List field_227370_o_; - public final int field_227371_p_; - public transient boolean field_227372_q_; -+ protected net.minecraftforge.common.IPlantable sapling = (net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196674_t; - - protected BaseTreeFeatureConfig(BlockStateProvider p_i225842_1_, BlockStateProvider p_i225842_2_, List p_i225842_3_, int p_i225842_4_) { - this.field_227368_m_ = p_i225842_1_; -@@ -37,6 +38,15 @@ - return new Dynamic<>(p_214634_1_, p_214634_1_.createMap(builder.build())); - } - -+ protected BaseTreeFeatureConfig setSapling(net.minecraftforge.common.IPlantable value) { -+ this.sapling = value; -+ return this; -+ } -+ -+ public net.minecraftforge.common.IPlantable getSapling() { -+ return this.sapling; -+ } -+ - public static BaseTreeFeatureConfig func_227376_b_(Dynamic p_227376_0_) { - BlockStateProviderType blockstateprovidertype = Registry.field_229387_t_.func_82594_a(new ResourceLocation(p_227376_0_.get("trunk_provider").get("type").asString().orElseThrow(RuntimeException::new))); - BlockStateProviderType blockstateprovidertype1 = Registry.field_229387_t_.func_82594_a(new ResourceLocation(p_227376_0_.get("leaves_provider").get("type").asString().orElseThrow(RuntimeException::new))); -@@ -45,11 +55,16 @@ - }), p_227376_0_.get("base_height").asInt(0)); - } - -+ public static BaseTreeFeatureConfig deserializeJungle(Dynamic data) { -+ return func_227376_b_(data).setSapling((net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196678_w); -+ } -+ - public static class Builder { - public final BlockStateProvider field_227377_a_; - public final BlockStateProvider field_227378_b_; - private List field_227379_c_ = Lists.newArrayList(); - private int field_227380_d_ = 0; -+ protected net.minecraftforge.common.IPlantable sapling = (net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196674_t; - - public Builder(BlockStateProvider p_i225843_1_, BlockStateProvider p_i225843_2_) { - this.field_227377_a_ = p_i225843_1_; -@@ -61,8 +76,13 @@ - return this; - } - -+ public BaseTreeFeatureConfig.Builder setSapling(net.minecraftforge.common.IPlantable value) { -+ this.sapling = value; -+ return this; -+ } -+ - public BaseTreeFeatureConfig func_225568_b_() { -- return new BaseTreeFeatureConfig(this.field_227377_a_, this.field_227378_b_, this.field_227379_c_, this.field_227380_d_); -+ return new BaseTreeFeatureConfig(this.field_227377_a_, this.field_227378_b_, this.field_227379_c_, this.field_227380_d_).setSapling(sapling); - } - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/BigBrownMushroomFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/BigBrownMushroomFeature.java.patch deleted file mode 100644 index 3da0500fd..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/BigBrownMushroomFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/BigBrownMushroomFeature.java -+++ b/net/minecraft/world/gen/feature/BigBrownMushroomFeature.java -@@ -25,7 +25,7 @@ - boolean flag5 = flag2 || flag3; - if (!flag4 || !flag5) { - p_225564_5_.func_189533_g(p_225564_3_).func_196234_d(j, p_225564_4_, k); -- if (!p_225564_1_.func_180495_p(p_225564_5_).func_200015_d(p_225564_1_, p_225564_5_)) { -+ if (p_225564_1_.func_180495_p(p_225564_5_).canBeReplacedByLeaves(p_225564_1_, p_225564_5_)) { - boolean flag6 = flag || flag5 && j == 1 - i; - boolean flag7 = flag1 || flag5 && j == i - 1; - boolean flag8 = flag2 || flag4 && k == 1 - i; diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch deleted file mode 100644 index 24a938f0d..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/BigRedMushroomFeature.java -+++ b/net/minecraft/world/gen/feature/BigRedMushroomFeature.java -@@ -27,7 +27,7 @@ - boolean flag5 = flag2 || flag3; - if (i >= p_225564_4_ || flag4 != flag5) { - p_225564_5_.func_189533_g(p_225564_3_).func_196234_d(l, i, i1); -- if (!p_225564_1_.func_180495_p(p_225564_5_).func_200015_d(p_225564_1_, p_225564_5_)) { -+ if (p_225564_1_.func_180495_p(p_225564_5_).canBeReplacedByLeaves(p_225564_1_, p_225564_5_)) { - this.func_202278_a(p_225564_1_, p_225564_5_, p_225564_6_.field_227272_a_.func_225574_a_(p_225564_2_, p_225564_3_).func_206870_a(HugeMushroomBlock.field_196465_z, Boolean.valueOf(i >= p_225564_4_ - 1)).func_206870_a(HugeMushroomBlock.field_196464_y, Boolean.valueOf(l < -k)).func_206870_a(HugeMushroomBlock.field_196461_b, Boolean.valueOf(l > k)).func_206870_a(HugeMushroomBlock.field_196459_a, Boolean.valueOf(i1 < -k)).func_206870_a(HugeMushroomBlock.field_196463_c, Boolean.valueOf(i1 > k))); - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/DarkOakTreeFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/DarkOakTreeFeature.java.patch deleted file mode 100644 index 098ee4558..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/DarkOakTreeFeature.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/net/minecraft/world/gen/feature/DarkOakTreeFeature.java -+++ b/net/minecraft/world/gen/feature/DarkOakTreeFeature.java -@@ -20,17 +20,17 @@ - int j = p_225557_3_.func_177958_n(); - int k = p_225557_3_.func_177956_o(); - int l = p_225557_3_.func_177952_p(); -- if (k >= 1 && k + i + 1 < 256) { -+ if (k >= 1 && k + i + 1 < p_225557_1_.getMaxHeight()) { - BlockPos blockpos = p_225557_3_.func_177977_b(); -- if (!func_214589_h(p_225557_1_, blockpos)) { -+ if (!isSoil(p_225557_1_, blockpos, p_225557_7_.getSapling())) { - return false; - } else if (!this.func_214615_a(p_225557_1_, p_225557_3_, i)) { - return false; - } else { -- this.func_214584_a(p_225557_1_, blockpos); -- this.func_214584_a(p_225557_1_, blockpos.func_177974_f()); -- this.func_214584_a(p_225557_1_, blockpos.func_177968_d()); -- this.func_214584_a(p_225557_1_, blockpos.func_177968_d().func_177974_f()); -+ this.setDirtAt(p_225557_1_, blockpos, p_225557_3_); -+ this.setDirtAt(p_225557_1_, blockpos.func_177974_f(), p_225557_3_); -+ this.setDirtAt(p_225557_1_, blockpos.func_177968_d(), p_225557_3_); -+ this.setDirtAt(p_225557_1_, blockpos.func_177968_d().func_177974_f(), p_225557_3_); - Direction direction = Direction.Plane.HORIZONTAL.func_179518_a(p_225557_2_); - int i1 = i - p_225557_2_.nextInt(4); - int j1 = 2 - p_225557_2_.nextInt(3); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/Feature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/Feature.java.patch deleted file mode 100644 index 10fb17c5c..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/Feature.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/net/minecraft/world/gen/feature/Feature.java -+++ b/net/minecraft/world/gen/feature/Feature.java -@@ -43,7 +43,7 @@ - import net.minecraft.world.gen.feature.structure.WoodlandMansionStructure; - import net.minecraft.world.gen.placement.CountConfig; - --public abstract class Feature { -+public abstract class Feature extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final Structure field_214536_b = func_214468_a("pillager_outpost", new PillagerOutpostStructure(NoFeatureConfig::func_214639_a)); - public static final Structure field_202329_g = func_214468_a("mineshaft", new MineshaftStructure(MineshaftConfig::func_214638_a)); - public static final Structure field_202330_h = func_214468_a("woodland_mansion", new WoodlandMansionStructure(NoFeatureConfig::func_214639_a)); -@@ -61,12 +61,12 @@ - public static final Structure field_214550_p = func_214468_a("village", new VillageStructure(VillageConfig::func_214679_a)); - public static final Feature field_227245_q_ = func_214468_a("no_op", new NoOpFeature(NoFeatureConfig::func_214639_a)); - public static final Feature field_202301_A = func_214468_a("normal_tree", new TreeFeature(TreeFeatureConfig::func_227338_a_)); -- public static final Feature field_227246_s_ = func_214468_a("acacia_tree", new AcaciaFeature(TreeFeatureConfig::func_227338_a_)); -+ public static final Feature field_227246_s_ = func_214468_a("acacia_tree", new AcaciaFeature(TreeFeatureConfig::deserializeAcacia)); - public static final Feature field_202339_q = func_214468_a("fancy_tree", new FancyTreeFeature(TreeFeatureConfig::func_227338_a_)); -- public static final Feature field_202342_t = func_214468_a("jungle_ground_bush", new ShrubFeature(BaseTreeFeatureConfig::func_227376_b_)); -- public static final Feature field_214551_w = func_214468_a("dark_oak_tree", new DarkOakTreeFeature(HugeTreeFeatureConfig::func_227277_a_)); -- public static final Feature field_202302_B = func_214468_a("mega_jungle_tree", new MegaJungleFeature(HugeTreeFeatureConfig::func_227277_a_)); -- public static final Feature field_202304_D = func_214468_a("mega_spruce_tree", new MegaPineTree(HugeTreeFeatureConfig::func_227277_a_)); -+ public static final Feature field_202342_t = func_214468_a("jungle_ground_bush", new ShrubFeature(BaseTreeFeatureConfig::deserializeJungle)); -+ public static final Feature field_214551_w = func_214468_a("dark_oak_tree", new DarkOakTreeFeature(HugeTreeFeatureConfig::deserializeDarkOak)); -+ public static final Feature field_202302_B = func_214468_a("mega_jungle_tree", new MegaJungleFeature(HugeTreeFeatureConfig::deserializeJungle)); -+ public static final Feature field_202304_D = func_214468_a("mega_spruce_tree", new MegaPineTree(HugeTreeFeatureConfig::deserializeSpruce)); - public static final FlowersFeature field_227247_y_ = func_214468_a("flower", new DefaultFlowersFeature(BlockClusterFeatureConfig::func_227300_a_)); - public static final Feature field_227248_z_ = func_214468_a("random_patch", new RandomPatchFeature(BlockClusterFeatureConfig::func_227300_a_)); - public static final Feature field_227244_A_ = func_214468_a("block_pile", new BlockPileFeature(BlockStateProvidingFeatureConfig::func_227269_a_)); -@@ -109,7 +109,8 @@ - public static final Feature field_202293_am = func_214468_a("random_boolean_selector", new TwoFeatureChoiceFeature(TwoFeatureChoiceConfig::func_227287_a_)); - public static final Feature field_214483_aK = func_214468_a("decorated", new DecoratedFeature(DecoratedFeatureConfig::func_214688_a)); - public static final Feature field_214484_aL = func_214468_a("decorated_flower", new DecoratedFlowerFeature(DecoratedFeatureConfig::func_214688_a)); -- public static final BiMap> field_202300_at = Util.func_200696_a(HashBiMap.create(), (p_205170_0_) -> { -+ public static final BiMap> field_202300_at = Util.func_200696_a(net.minecraftforge.registries.GameData.getStructureMap(), (p_205170_0_) -> { -+ if (true) return; // Forge: This is now a slave map to the feature registry, leave this code here to reduce patch size - p_205170_0_.put("Pillager_Outpost".toLowerCase(Locale.ROOT), field_214536_b); - p_205170_0_.put("Mineshaft".toLowerCase(Locale.ROOT), field_202329_g); - p_205170_0_.put("Mansion".toLowerCase(Locale.ROOT), field_202330_h); -@@ -160,10 +161,10 @@ - } - - 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; -+ return net.minecraftforge.common.Tags.Blocks.STONE.func_199685_a_(p_227249_0_); - } - - protected static boolean func_227250_b_(Block p_227250_0_) { -- return p_227250_0_ == Blocks.field_150346_d || p_227250_0_ == Blocks.field_196658_i || p_227250_0_ == Blocks.field_196661_l || p_227250_0_ == Blocks.field_196660_k || p_227250_0_ == Blocks.field_150391_bh; -+ return net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(p_227250_0_); - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/FlowersFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/FlowersFeature.java.patch deleted file mode 100644 index a63563c91..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/FlowersFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/FlowersFeature.java -+++ b/net/minecraft/world/gen/feature/FlowersFeature.java -@@ -20,7 +20,7 @@ - - for(int j = 0; j < this.func_225560_a_(p_212245_5_); ++j) { - BlockPos blockpos = this.func_225561_a_(p_212245_3_, p_212245_4_, p_212245_5_); -- if (p_212245_1_.func_175623_d(blockpos) && blockpos.func_177956_o() < 255 && blockstate.func_196955_c(p_212245_1_, blockpos) && this.func_225559_a_(p_212245_1_, blockpos, p_212245_5_)) { -+ if (p_212245_1_.func_175623_d(blockpos) && blockpos.func_177956_o() < p_212245_1_.getMaxHeight() - 1 && blockstate.func_196955_c(p_212245_1_, blockpos) && this.func_225559_a_(p_212245_1_, blockpos, p_212245_5_)) { - p_212245_1_.func_180501_a(blockpos, blockstate, 2); - ++i; - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch deleted file mode 100644 index 7ad799067..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java -+++ b/net/minecraft/world/gen/feature/GlowstoneBlobFeature.java -@@ -25,7 +25,7 @@ - - for(int i = 0; i < 1500; ++i) { - BlockPos blockpos = p_212245_4_.func_177982_a(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), -p_212245_3_.nextInt(12), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8)); -- if (p_212245_1_.func_180495_p(blockpos).func_196958_f()) { -+ if (p_212245_1_.func_180495_p(blockpos).isAir(p_212245_1_, blockpos)) { - int j = 0; - - for(Direction direction : Direction.values()) { diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/HugeTreeFeatureConfig.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/HugeTreeFeatureConfig.java.patch deleted file mode 100644 index 168bc6fef..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/HugeTreeFeatureConfig.java.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/net/minecraft/world/gen/feature/HugeTreeFeatureConfig.java -+++ b/net/minecraft/world/gen/feature/HugeTreeFeatureConfig.java -@@ -23,11 +23,27 @@ - return dynamic.merge(super.func_214634_a(p_214634_1_)); - } - -+ @Override -+ protected HugeTreeFeatureConfig setSapling(net.minecraftforge.common.IPlantable value) { -+ super.setSapling(value); -+ return this; -+ } -+ - public static HugeTreeFeatureConfig func_227277_a_(Dynamic p_227277_0_) { - BaseTreeFeatureConfig basetreefeatureconfig = BaseTreeFeatureConfig.func_227376_b_(p_227277_0_); - return new HugeTreeFeatureConfig(basetreefeatureconfig.field_227368_m_, basetreefeatureconfig.field_227369_n_, basetreefeatureconfig.field_227370_o_, basetreefeatureconfig.field_227371_p_, p_227277_0_.get("height_interval").asInt(0), p_227277_0_.get("crown_height").asInt(0)); - } - -+ public static HugeTreeFeatureConfig deserializeDarkOak(Dynamic data) { -+ return func_227277_a_(data).setSapling((net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196680_y); -+ } -+ public static HugeTreeFeatureConfig deserializeSpruce(Dynamic data) { -+ return func_227277_a_(data).setSapling((net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196675_u); -+ } -+ public static HugeTreeFeatureConfig deserializeJungle(Dynamic data) { -+ return func_227277_a_(data).setSapling((net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196678_w); -+ } -+ - public static class Builder extends BaseTreeFeatureConfig.Builder { - private List field_227278_c_ = ImmutableList.of(); - private int field_227279_d_; -@@ -58,8 +74,14 @@ - return this; - } - -+ @Override -+ public HugeTreeFeatureConfig.Builder setSapling(net.minecraftforge.common.IPlantable value) { -+ super.setSapling(value); -+ return this; -+ } -+ - public HugeTreeFeatureConfig func_225568_b_() { -- return new HugeTreeFeatureConfig(this.field_227377_a_, this.field_227378_b_, this.field_227278_c_, this.field_227279_d_, this.field_227280_e_, this.field_227281_f_); -+ return new HugeTreeFeatureConfig(this.field_227377_a_, this.field_227378_b_, this.field_227278_c_, this.field_227279_d_, this.field_227280_e_, this.field_227281_f_).setSapling(this.sapling); - } - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/HugeTreesFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/HugeTreesFeature.java.patch deleted file mode 100644 index 4dda8c87d..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/HugeTreesFeature.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/net/minecraft/world/gen/feature/HugeTreesFeature.java -+++ b/net/minecraft/world/gen/feature/HugeTreesFeature.java -@@ -25,7 +25,7 @@ - - private boolean func_175926_c(IWorldGenerationBaseReader p_175926_1_, BlockPos p_175926_2_, int p_175926_3_) { - boolean flag = true; -- if (p_175926_2_.func_177956_o() >= 1 && p_175926_2_.func_177956_o() + p_175926_3_ + 1 <= 256) { -+ if (p_175926_2_.func_177956_o() >= 1 && p_175926_2_.func_177956_o() + p_175926_3_ + 1 <= p_175926_1_.getMaxHeight()) { - for(int i = 0; i <= 1 + p_175926_3_; ++i) { - int j = 2; - if (i == 0) { -@@ -36,7 +36,7 @@ - - for(int k = -j; k <= j && flag; ++k) { - for(int l = -j; l <= j && flag; ++l) { -- if (p_175926_2_.func_177956_o() + i < 0 || p_175926_2_.func_177956_o() + i >= 256 || !func_214587_a(p_175926_1_, p_175926_2_.func_177982_a(k, i, l))) { -+ if (p_175926_2_.func_177956_o() + i < 0 || p_175926_2_.func_177956_o() + i >= p_175926_1_.getMaxHeight() || !func_214587_a(p_175926_1_, p_175926_2_.func_177982_a(k, i, l))) { - flag = false; - } - } -@@ -49,23 +49,28 @@ - } - } - -- private boolean func_202405_b(IWorldGenerationReader p_202405_1_, BlockPos p_202405_2_) { -+ private boolean validSoil(IWorldGenerationReader p_202405_1_, BlockPos p_202405_2_, net.minecraftforge.common.IPlantable sapling) { - BlockPos blockpos = p_202405_2_.func_177977_b(); -- if (func_214589_h(p_202405_1_, blockpos) && p_202405_2_.func_177956_o() >= 2) { -- this.func_214584_a(p_202405_1_, blockpos); -- this.func_214584_a(p_202405_1_, blockpos.func_177974_f()); -- this.func_214584_a(p_202405_1_, blockpos.func_177968_d()); -- this.func_214584_a(p_202405_1_, blockpos.func_177968_d().func_177974_f()); -+ if (isSoil(p_202405_1_, blockpos, sapling) && p_202405_2_.func_177956_o() >= 2) { -+ setDirtAt(p_202405_1_, blockpos, p_202405_2_); -+ setDirtAt(p_202405_1_, blockpos.func_177974_f(), p_202405_2_); -+ setDirtAt(p_202405_1_, blockpos.func_177968_d(), p_202405_2_); -+ setDirtAt(p_202405_1_, blockpos.func_177968_d().func_177974_f(), p_202405_2_); - return true; - } else { - return false; - } - } - -+ @Deprecated //Forge: Use config sensitive version - protected boolean func_203427_a(IWorldGenerationReader p_203427_1_, BlockPos p_203427_2_, int p_203427_3_) { -- return this.func_175926_c(p_203427_1_, p_203427_2_, p_203427_3_) && this.func_202405_b(p_203427_1_, p_203427_2_); -+ return this.func_175926_c(p_203427_1_, p_203427_2_, p_203427_3_) && this.validSoil(p_203427_1_, p_203427_2_, (net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196674_t); - } - -+ protected boolean hasRoom(IWorldGenerationReader world, BlockPos pos, int height, BaseTreeFeatureConfig config) { -+ return this.func_175926_c(world, pos, height) && this.validSoil(world, pos, config.getSapling()); -+ } -+ - protected void func_227255_a_(IWorldGenerationReader p_227255_1_, Random p_227255_2_, BlockPos p_227255_3_, int p_227255_4_, Set p_227255_5_, MutableBoundingBox p_227255_6_, BaseTreeFeatureConfig p_227255_7_) { - int i = p_227255_4_ * p_227255_4_; - diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch deleted file mode 100644 index d156b86a5..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/IceSpikeFeature.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/minecraft/world/gen/feature/IceSpikeFeature.java -+++ b/net/minecraft/world/gen/feature/IceSpikeFeature.java -@@ -44,14 +44,14 @@ - if ((i1 == 0 && j1 == 0 || !(f1 * f1 + f2 * f2 > f * f)) && (i1 != -l && i1 != l && j1 != -l && j1 != l || !(p_212245_3_.nextFloat() > 0.75F))) { - BlockState blockstate = p_212245_1_.func_180495_p(p_212245_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_212245_1_, p_212245_4_.func_177982_a(i1, k, j1)) || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { - this.func_202278_a(p_212245_1_, p_212245_4_.func_177982_a(i1, k, j1), Blocks.field_150403_cj.func_176223_P()); - } - - if (k != 0 && l > 1) { - blockstate = p_212245_1_.func_180495_p(p_212245_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_212245_1_, p_212245_4_.func_177982_a(i1, -k, j1)) || func_227250_b_(block) || block == Blocks.field_196604_cC || block == Blocks.field_150432_aD) { - this.func_202278_a(p_212245_1_, p_212245_4_.func_177982_a(i1, -k, j1), Blocks.field_150403_cj.func_176223_P()); - } - } -@@ -78,7 +78,7 @@ - while(blockpos.func_177956_o() > 50) { - BlockState blockstate1 = p_212245_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_212245_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_old/minecraft/net/minecraft/world/gen/feature/MegaJungleFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/MegaJungleFeature.java.patch deleted file mode 100644 index a04566911..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/MegaJungleFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/MegaJungleFeature.java -+++ b/net/minecraft/world/gen/feature/MegaJungleFeature.java -@@ -16,7 +16,7 @@ - - public boolean func_225557_a_(IWorldGenerationReader p_225557_1_, Random p_225557_2_, BlockPos p_225557_3_, Set p_225557_4_, Set p_225557_5_, MutableBoundingBox p_225557_6_, HugeTreeFeatureConfig p_225557_7_) { - int i = this.func_227256_a_(p_225557_2_, p_225557_7_); -- if (!this.func_203427_a(p_225557_1_, p_225557_3_, i)) { -+ if (!this.hasRoom(p_225557_1_, p_225557_3_, i, p_225557_7_)) { - return false; - } else { - this.func_227252_c_(p_225557_1_, p_225557_2_, p_225557_3_.func_177981_b(i), 2, p_225557_5_, p_225557_6_, p_225557_7_); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/MegaPineTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/MegaPineTree.java.patch deleted file mode 100644 index 34019a0d0..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/MegaPineTree.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/MegaPineTree.java -+++ b/net/minecraft/world/gen/feature/MegaPineTree.java -@@ -16,7 +16,7 @@ - - public boolean func_225557_a_(IWorldGenerationReader p_225557_1_, Random p_225557_2_, BlockPos p_225557_3_, Set p_225557_4_, Set p_225557_5_, MutableBoundingBox p_225557_6_, HugeTreeFeatureConfig p_225557_7_) { - int i = this.func_227256_a_(p_225557_2_, p_225557_7_); -- if (!this.func_203427_a(p_225557_1_, p_225557_3_, i)) { -+ if (!this.hasRoom(p_225557_1_, p_225557_3_, i, p_225557_7_)) { - return false; - } else { - this.func_227253_a_(p_225557_1_, p_225557_2_, p_225557_3_.func_177958_n(), p_225557_3_.func_177952_p(), p_225557_3_.func_177956_o() + i, 0, p_225557_5_, p_225557_6_, p_225557_7_); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/OreFeatureConfig.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/OreFeatureConfig.java.patch deleted file mode 100644 index 633959e63..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/OreFeatureConfig.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/net/minecraft/world/gen/feature/OreFeatureConfig.java -+++ b/net/minecraft/world/gen/feature/OreFeatureConfig.java -@@ -34,7 +34,7 @@ - return new OreFeatureConfig(orefeatureconfig$fillerblocktype, blockstate, i); - } - -- public static enum FillerBlockType { -+ public static enum FillerBlockType implements net.minecraftforge.common.IExtensibleEnum { - NATURAL_STONE("natural_stone", (p_214739_0_) -> { - if (p_214739_0_ == null) { - return false; -@@ -67,5 +67,15 @@ - public Predicate func_214738_b() { - return this.field_214743_e; - } -+ -+ 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); -+ } - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/ShrubFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/ShrubFeature.java.patch deleted file mode 100644 index c082cb82e..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/ShrubFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/ShrubFeature.java -+++ b/net/minecraft/world/gen/feature/ShrubFeature.java -@@ -16,7 +16,7 @@ - - public boolean func_225557_a_(IWorldGenerationReader p_225557_1_, Random p_225557_2_, BlockPos p_225557_3_, Set p_225557_4_, Set p_225557_5_, MutableBoundingBox p_225557_6_, BaseTreeFeatureConfig p_225557_7_) { - p_225557_3_ = p_225557_1_.func_205770_a(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, p_225557_3_).func_177977_b(); -- if (func_214589_h(p_225557_1_, p_225557_3_)) { -+ if (isSoil(p_225557_1_, p_225557_3_, p_225557_7_.getSapling())) { - p_225557_3_ = p_225557_3_.func_177984_a(); - this.func_227216_a_(p_225557_1_, p_225557_2_, p_225557_3_, p_225557_4_, p_225557_6_, p_225557_7_); - diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch deleted file mode 100644 index 8cd95c2b5..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/SpringFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/SpringFeature.java -+++ b/net/minecraft/world/gen/feature/SpringFeature.java -@@ -21,7 +21,7 @@ - return false; - } else { - BlockState blockstate = p_212245_1_.func_180495_p(p_212245_4_); -- if (!blockstate.func_196958_f() && !p_212245_5_.field_227366_f_.contains(blockstate.func_177230_c())) { -+ if (!blockstate.isAir(p_212245_1_, p_212245_4_) && !p_212245_5_.field_227366_f_.contains(blockstate.func_177230_c())) { - return false; - } else { - int i = 0; diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/TreeFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/TreeFeature.java.patch deleted file mode 100644 index 1163c9f7c..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/TreeFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/TreeFeature.java -+++ b/net/minecraft/world/gen/feature/TreeFeature.java -@@ -23,7 +23,7 @@ - return false; - } else { - BlockPos blockpos = optional.get(); -- this.func_214584_a(p_225557_1_, blockpos.func_177977_b()); -+ this.setDirtAt(p_225557_1_, blockpos.func_177977_b(), blockpos); - p_225557_7_.field_227327_a_.func_225571_a_(p_225557_1_, p_225557_2_, p_225557_7_, i, j, k, blockpos, p_225557_5_); - this.func_227213_a_(p_225557_1_, p_225557_2_, i, blockpos, p_225557_7_.field_227332_g_ + p_225557_2_.nextInt(p_225557_7_.field_227333_h_ + 1), p_225557_4_, p_225557_6_, p_225557_7_); - return true; diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/TreeFeatureConfig.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/TreeFeatureConfig.java.patch deleted file mode 100644 index 41b345d3d..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/TreeFeatureConfig.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/net/minecraft/world/gen/feature/TreeFeatureConfig.java -+++ b/net/minecraft/world/gen/feature/TreeFeatureConfig.java -@@ -47,12 +47,26 @@ - return dynamic.merge(super.func_214634_a(p_214634_1_)); - } - -+ @Override -+ protected TreeFeatureConfig setSapling(net.minecraftforge.common.IPlantable value) { -+ super.setSapling(value); -+ return this; -+ } -+ - public static TreeFeatureConfig func_227338_a_(Dynamic p_227338_0_) { - BaseTreeFeatureConfig basetreefeatureconfig = BaseTreeFeatureConfig.func_227376_b_(p_227338_0_); - FoliagePlacerType foliageplacertype = Registry.field_229389_v_.func_82594_a(new ResourceLocation(p_227338_0_.get("foliage_placer").get("type").asString().orElseThrow(RuntimeException::new))); - return new TreeFeatureConfig(basetreefeatureconfig.field_227368_m_, basetreefeatureconfig.field_227369_n_, foliageplacertype.func_227391_a_(p_227338_0_.get("foliage_placer").orElseEmptyMap()), basetreefeatureconfig.field_227370_o_, basetreefeatureconfig.field_227371_p_, p_227338_0_.get("height_rand_a").asInt(0), p_227338_0_.get("height_rand_b").asInt(0), p_227338_0_.get("trunk_height").asInt(-1), p_227338_0_.get("trunk_height_random").asInt(0), p_227338_0_.get("trunk_top_offset").asInt(0), p_227338_0_.get("trunk_top_offset_random").asInt(0), p_227338_0_.get("foliage_height").asInt(-1), p_227338_0_.get("foliage_height_random").asInt(0), p_227338_0_.get("max_water_depth").asInt(0), p_227338_0_.get("ignore_vines").asBoolean(false)); - } - -+ public static TreeFeatureConfig deserializeJungle(Dynamic data) { -+ return func_227338_a_(data).setSapling((net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196678_w); -+ } -+ -+ public static TreeFeatureConfig deserializeAcacia(Dynamic data) { -+ return func_227338_a_(data).setSapling((net.minecraftforge.common.IPlantable)net.minecraft.block.Blocks.field_196679_x); -+ } -+ - public static class Builder extends BaseTreeFeatureConfig.Builder { - private final FoliagePlacer field_227339_c_; - private List field_227340_d_ = ImmutableList.of(); -@@ -133,8 +147,14 @@ - return this; - } - -+ @Override -+ public TreeFeatureConfig.Builder setSapling(net.minecraftforge.common.IPlantable value) { -+ super.setSapling(value); -+ return this; -+ } -+ - public TreeFeatureConfig func_225568_b_() { -- return new TreeFeatureConfig(this.field_227377_a_, this.field_227378_b_, this.field_227339_c_, this.field_227340_d_, this.field_227341_e_, this.field_227342_f_, this.field_227343_g_, this.field_227344_h_, this.field_227345_i_, this.field_227346_j_, this.field_227347_k_, this.field_227348_l_, this.field_227349_m_, this.field_227350_n_, this.field_227351_o_); -+ return new TreeFeatureConfig(this.field_227377_a_, this.field_227378_b_, this.field_227339_c_, this.field_227340_d_, this.field_227341_e_, this.field_227342_f_, this.field_227343_g_, this.field_227344_h_, this.field_227345_i_, this.field_227346_j_, this.field_227347_k_, this.field_227348_l_, this.field_227349_m_, this.field_227350_n_, this.field_227351_o_).setSapling(this.sapling); - } - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/VinesFeature.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/VinesFeature.java.patch deleted file mode 100644 index ecc725b9e..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/VinesFeature.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/VinesFeature.java -+++ b/net/minecraft/world/gen/feature/VinesFeature.java -@@ -21,7 +21,7 @@ - public boolean func_212245_a(IWorld p_212245_1_, ChunkGenerator p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_) { - BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable(p_212245_4_); - -- for(int i = p_212245_4_.func_177956_o(); i < 256; ++i) { -+ for(int i = p_212245_4_.func_177956_o(); i < p_212245_1_.func_201672_e().func_201675_m().getHeight(); ++i) { - blockpos$mutable.func_189533_g(p_212245_4_); - blockpos$mutable.func_196234_d(p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), 0, p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4)); - blockpos$mutable.func_185336_p(i); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch deleted file mode 100644 index fb7478745..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java -+++ b/net/minecraft/world/gen/feature/jigsaw/JigsawPattern.java -@@ -72,7 +72,7 @@ - return this.field_214953_e.size(); - } - -- public static enum PlacementBehaviour { -+ public static enum PlacementBehaviour implements net.minecraftforge.common.IExtensibleEnum { - TERRAIN_MATCHING("terrain_matching", ImmutableList.of(new GravityStructureProcessor(Heightmap.Type.WORLD_SURFACE_WG, -1))), - RIGID("rigid", ImmutableList.of()); - -@@ -98,5 +98,15 @@ - public ImmutableList func_214937_b() { - return this.field_214941_e; - } -+ -+ public static PlacementBehaviour create(String enumName, String p_i50487_3_, ImmutableList p_i50487_4_) { -+ throw new IllegalStateException("Enum not extended"); -+ } -+ -+ @Override -+ @Deprecated -+ public void init() { -+ field_214939_c.put(func_214936_a(), this); -+ } - } - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch deleted file mode 100644 index ba3f680f9..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java -+++ b/net/minecraft/world/gen/feature/jigsaw/SingleJigsawPiece.java -@@ -89,7 +89,7 @@ - if (!template.func_189962_a(p_225575_2_, p_225575_4_, placementsettings, 18)) { - return false; - } else { -- for(Template.BlockInfo template$blockinfo : Template.func_215387_a(p_225575_2_, p_225575_4_, placementsettings, this.func_214857_a(p_225575_1_, p_225575_4_, p_225575_5_, false))) { -+ for(Template.BlockInfo template$blockinfo : Template.processBlockInfos(template, p_225575_2_, p_225575_4_, placementsettings, this.func_214857_a(p_225575_1_, p_225575_4_, p_225575_5_, false))) { - this.func_214846_a(p_225575_2_, template$blockinfo, p_225575_4_, p_225575_5_, p_225575_7_, p_225575_6_); - } - diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch deleted file mode 100644 index 4dab4c2d6..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/MineshaftPieces.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/feature/structure/MineshaftPieces.java -+++ b/net/minecraft/world/gen/feature/structure/MineshaftPieces.java -@@ -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_) { - 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())) { - BlockState blockstate = Blocks.field_150448_aq.func_176223_P().func_206870_a(RailBlock.field_176565_b, p_186167_3_.nextBoolean() ? RailShape.NORTH_SOUTH : RailShape.EAST_WEST); - this.func_175811_a(p_186167_1_, blockstate, p_186167_4_, p_186167_5_, p_186167_6_, p_186167_2_); - ChestMinecartEntity chestminecartentity = new ChestMinecartEntity(p_186167_1_.func_201672_e(), (double)((float)blockpos.func_177958_n() + 0.5F), (double)((float)blockpos.func_177956_o() + 0.5F), (double)((float)blockpos.func_177952_p() + 0.5F)); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/StructurePiece.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/structure/StructurePiece.java.patch deleted file mode 100644 index 25ded3773..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/StructurePiece.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/gen/feature/structure/StructurePiece.java -+++ b/net/minecraft/world/gen/feature/structure/StructurePiece.java -@@ -56,6 +56,9 @@ - } - - public final CompoundNBT func_143010_b() { -+ if (Registry.field_218362_C.func_177774_c(this.func_214807_k()) == null) { // FORGE: Friendlier error then the Null String error below. -+ throw new RuntimeException("StructurePiece \"" + this.getClass().getName() + "\": \"" + this.func_214807_k() + "\" missing ID Mapping, Modder see MapGenStructureIO"); -+ } - CompoundNBT compoundnbt = new CompoundNBT(); - compoundnbt.func_74778_a("id", Registry.field_218362_C.func_177774_c(this.func_214807_k()).toString()); - compoundnbt.func_218657_a("BB", this.field_74887_e.func_151535_h()); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch deleted file mode 100644 index 007d1d630..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/gen/feature/structure/StructureStart.java -+++ b/net/minecraft/world/gen/feature/structure/StructureStart.java -@@ -77,6 +77,9 @@ - public CompoundNBT func_143021_a(int p_143021_1_, int p_143021_2_) { - CompoundNBT compoundnbt = new CompoundNBT(); - if (this.func_75069_d()) { -+ if (Registry.field_218361_B.func_177774_c(this.func_214627_k()) == null) { // FORGE: This is just a more friendly error instead of the 'Null String' below -+ throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\": \"" + this.func_214627_k() + "\" missing ID Mapping, Modder see MapGenStructureIO"); -+ } - compoundnbt.func_74778_a("id", Registry.field_218361_B.func_177774_c(this.func_214627_k()).toString()); - compoundnbt.func_74768_a("ChunkX", p_143021_1_); - compoundnbt.func_74768_a("ChunkZ", p_143021_2_); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/Structures.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/structure/Structures.java.patch deleted file mode 100644 index fdf22effb..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/structure/Structures.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/world/gen/feature/structure/Structures.java -+++ b/net/minecraft/world/gen/feature/structure/Structures.java -@@ -32,6 +32,7 @@ - public static final Structure field_215157_o = func_215141_a("Village", Feature.field_214550_p); - - private static Structure func_215141_a(String p_215141_0_, Structure p_215141_1_) { -+ if (true) return p_215141_1_; // FORGE: Registry replaced with slave map - return Registry.func_218325_a(Registry.field_218361_B, p_215141_0_.toLowerCase(Locale.ROOT), p_215141_1_); - } - diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/template/StructureProcessor.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/template/StructureProcessor.java.patch deleted file mode 100644 index 6c5705112..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/template/StructureProcessor.java.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/net/minecraft/world/gen/feature/template/StructureProcessor.java -+++ b/net/minecraft/world/gen/feature/template/StructureProcessor.java -@@ -9,8 +9,53 @@ - - public abstract class StructureProcessor { - @Nullable -- public abstract Template.BlockInfo func_215194_a(IWorldReader p_215194_1_, BlockPos p_215194_2_, Template.BlockInfo p_215194_3_, Template.BlockInfo p_215194_4_, PlacementSettings p_215194_5_); -+ @Deprecated -+ public Template.BlockInfo func_215194_a(IWorldReader p_215194_1_, BlockPos p_215194_2_, Template.BlockInfo p_215194_3_, Template.BlockInfo p_215194_4_, PlacementSettings p_215194_5_) { -+ return p_215194_4_; -+ } - -+ /** -+ * FORGE: Add template parameter -+ * -+ * @param worldReaderIn -+ * @param pos -+ * @param p_215194_3_ -+ * @param blockInfo -+ * @param placementSettingsIn -+ * @param template The template being placed, can be null due to deprecated -+ * method calls. -+ * @see #process(IWorldReader, BlockPos, -+ * net.minecraft.world.gen.feature.template.Template.BlockInfo, -+ * net.minecraft.world.gen.feature.template.Template.BlockInfo, -+ * PlacementSettings) -+ */ -+ @Nullable -+ public Template.BlockInfo process(IWorldReader p_215194_1_, BlockPos p_215194_2_, Template.BlockInfo p_215194_3_, Template.BlockInfo p_215194_4_, PlacementSettings p_215194_5_, @Nullable Template template) { -+ return func_215194_a(p_215194_1_, p_215194_2_, p_215194_3_, p_215194_4_, p_215194_5_); -+ } -+ -+ /** -+ * FORGE: Add entity processing. -+ *

-+ * Use this method to process entities from a structure in much the same way as -+ * blocks, parameters are analogous. -+ * -+ * @param world -+ * @param seedPos -+ * @param rawEntityInfo -+ * @param entityInfo -+ * @param placementSettings -+ * @param template -+ * -+ * @see #process(IWorldReader, BlockPos, -+ * net.minecraft.world.gen.feature.template.Template.BlockInfo, -+ * net.minecraft.world.gen.feature.template.Template.BlockInfo, -+ * PlacementSettings) -+ */ -+ public Template.EntityInfo processEntity(IWorldReader world, BlockPos seedPos, Template.EntityInfo rawEntityInfo, Template.EntityInfo entityInfo, PlacementSettings placementSettings, Template template) { -+ return entityInfo; -+ } -+ - protected abstract IStructureProcessorType func_215192_a(); - - protected abstract Dynamic func_215193_a(DynamicOps p_215193_1_); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch deleted file mode 100644 index 8e8af4b8f..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/feature/template/Template.java.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- a/net/minecraft/world/gen/feature/template/Template.java -+++ b/net/minecraft/world/gen/feature/template/Template.java -@@ -152,6 +152,11 @@ - 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()); - } - -+ // FORGE: Add overload accepting Vec3d -+ public static Vec3d transformedVec3d(PlacementSettings p_186266_0_, Vec3d p_186266_1_) { -+ return func_207667_a(p_186266_1_, p_186266_0_.func_186212_b(), p_186266_0_.func_186215_c(), p_186266_0_.func_207664_d()); -+ } -+ - public void func_186260_a(IWorld p_186260_1_, BlockPos p_186260_2_, PlacementSettings p_186260_3_) { - p_186260_3_.func_186224_i(); - this.func_186253_b(p_186260_1_, p_186260_2_, p_186260_3_); -@@ -177,7 +182,7 @@ - int i1 = Integer.MIN_VALUE; - int j1 = Integer.MIN_VALUE; - -- for(Template.BlockInfo template$blockinfo : func_215387_a(p_189962_1_, p_189962_2_, p_189962_3_, list)) { -+ for(Template.BlockInfo template$blockinfo : processBlockInfos(this, p_189962_1_, p_189962_2_, p_189962_3_, list)) { - BlockPos blockpos = template$blockinfo.field_186242_a; - if (mutableboundingbox == null || mutableboundingbox.func_175898_b(blockpos)) { - IFluidState ifluidstate = p_189962_3_.func_204763_l() ? p_189962_1_.func_204610_c(blockpos) : null; -@@ -288,7 +293,7 @@ - } - - if (!p_189962_3_.func_186221_e()) { -- this.func_207668_a(p_189962_1_, p_189962_2_, p_189962_3_.func_186212_b(), p_189962_3_.func_186215_c(), p_189962_3_.func_207664_d(), mutableboundingbox); -+ this.addEntitiesToWorld(p_189962_1_, p_189962_2_, p_189962_3_, p_189962_3_.func_186212_b(), p_189962_3_.func_186215_c(), p_189962_3_.func_207664_d(), p_189962_3_.func_186213_g()); - } - - return true; -@@ -317,14 +322,19 @@ - }); - } - -+ @Deprecated // FORGE: Add template parameter - public static List func_215387_a(IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List p_215387_3_) { -+ return processBlockInfos(null, p_215387_0_, p_215387_1_, p_215387_2_, p_215387_3_); -+ } -+ -+ public static List processBlockInfos(@Nullable Template template, IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List p_215387_3_) { - List list = Lists.newArrayList(); - - for(Template.BlockInfo template$blockinfo : p_215387_3_) { - BlockPos blockpos = func_186266_a(p_215387_2_, template$blockinfo.field_186242_a).func_177971_a(p_215387_1_); - Template.BlockInfo template$blockinfo1 = new Template.BlockInfo(blockpos, template$blockinfo.field_186243_b, template$blockinfo.field_186244_c); - -- for(Iterator iterator = p_215387_2_.func_215221_j().iterator(); template$blockinfo1 != null && iterator.hasNext(); template$blockinfo1 = iterator.next().func_215194_a(p_215387_0_, p_215387_1_, template$blockinfo, template$blockinfo1, p_215387_2_)) { -+ for(Iterator iterator = p_215387_2_.func_215221_j().iterator(); template$blockinfo1 != null && iterator.hasNext(); template$blockinfo1 = iterator.next().process(p_215387_0_, p_215387_1_, template$blockinfo, template$blockinfo1, p_215387_2_, template)) { - ; - } - -@@ -336,13 +346,42 @@ - return list; - } - -+ // FORGE: Add processing for entities -+ public static List processEntityInfos(@Nullable Template template, IWorld p_215387_0_, BlockPos p_215387_1_, PlacementSettings p_215387_2_, List p_215387_3_) { -+ List list = Lists.newArrayList(); -+ -+ for(Template.EntityInfo entityInfo : p_215387_3_) { -+ Vec3d pos = transformedVec3d(p_215387_2_, entityInfo.field_186247_a).func_178787_e(new Vec3d(p_215387_1_)); -+ BlockPos blockpos = func_186266_a(p_215387_2_, entityInfo.field_186248_b).func_177971_a(p_215387_1_); -+ Template.EntityInfo info = new Template.EntityInfo(pos, blockpos, entityInfo.field_186249_c); -+ -+ for (StructureProcessor proc : p_215387_2_.func_215221_j()) { -+ info = proc.processEntity(p_215387_0_, p_215387_1_, entityInfo, info, p_215387_2_, template); -+ if (info == null) -+ break; -+ } -+ -+ if (info != null) -+ list.add(info); -+ } -+ -+ return list; -+ } -+ -+ @Deprecated // FORGE: Add PlacementSettings parameter (below) to pass to entity processors - private void func_207668_a(IWorld p_207668_1_, BlockPos p_207668_2_, Mirror p_207668_3_, Rotation p_207668_4_, BlockPos p_207668_5_, @Nullable MutableBoundingBox p_207668_6_) { -- for(Template.EntityInfo template$entityinfo : this.field_186271_b) { -+ addEntitiesToWorld(p_207668_1_, p_207668_2_, new PlacementSettings().func_186214_a(p_207668_3_).func_186220_a(p_207668_4_).func_207665_a(p_207668_5_).func_186223_a(p_207668_6_), p_207668_3_, p_207668_4_, p_207668_2_, p_207668_6_); -+ } -+ -+ private void addEntitiesToWorld(IWorld p_207668_1_, BlockPos p_207668_2_, PlacementSettings placementIn, Mirror p_207668_3_, Rotation p_207668_4_, BlockPos p_207668_5_, @Nullable MutableBoundingBox p_207668_6_) { -+ for(Template.EntityInfo template$entityinfo : processEntityInfos(this, p_207668_1_, p_207668_2_, placementIn, this.field_186271_b)) { - BlockPos blockpos = func_207669_a(template$entityinfo.field_186248_b, p_207668_3_, p_207668_4_, p_207668_5_).func_177971_a(p_207668_2_); -+ blockpos = template$entityinfo.field_186248_b; // FORGE: Position will have already been transformed by processEntityInfos - if (p_207668_6_ == null || p_207668_6_.func_175898_b(blockpos)) { - CompoundNBT compoundnbt = template$entityinfo.field_186249_c; - Vec3d vec3d = func_207667_a(template$entityinfo.field_186247_a, p_207668_3_, p_207668_4_, p_207668_5_); -- Vec3d vec3d1 = vec3d.func_72441_c((double)p_207668_2_.func_177958_n(), (double)p_207668_2_.func_177956_o(), (double)p_207668_2_.func_177952_p()); -+ vec3d = vec3d.func_72441_c((double)p_207668_2_.func_177958_n(), (double)p_207668_2_.func_177956_o(), (double)p_207668_2_.func_177952_p()); -+ Vec3d vec3d1 = template$entityinfo.field_186247_a; // FORGE: Position will have already been transformed by processEntityInfos - ListNBT listnbt = new ListNBT(); - listnbt.add(DoubleNBT.func_229684_a_(vec3d1.field_72450_a)); - listnbt.add(DoubleNBT.func_229684_a_(vec3d1.field_72448_b)); diff --git a/patches_old/minecraft/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java.patch b/patches_old/minecraft/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java.patch deleted file mode 100644 index 9a9f7fec2..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java -+++ b/net/minecraft/world/gen/foliageplacer/FoliagePlacerType.java -@@ -4,7 +4,7 @@ - import java.util.function.Function; - import net.minecraft.util.registry.Registry; - --public class FoliagePlacerType

{ -+public class FoliagePlacerType

extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final FoliagePlacerType field_227386_a_ = func_227392_a_("blob_foliage_placer", BlobFoliagePlacer::new); - public static final FoliagePlacerType field_227387_b_ = func_227392_a_("spruce_foliage_placer", SpruceFoliagePlacer::new); - public static final FoliagePlacerType field_227388_c_ = func_227392_a_("pine_foliage_placer", PineFoliagePlacer::new); diff --git a/patches_old/minecraft/net/minecraft/world/gen/layer/HillsLayer.java.patch b/patches_old/minecraft/net/minecraft/world/gen/layer/HillsLayer.java.patch deleted file mode 100644 index 1eda51a99..000000000 --- a/patches_old/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_old/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch b/patches_old/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch deleted file mode 100644 index b47c23cbe..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/net/minecraft/world/gen/layer/LayerUtil.java -+++ b/net/minecraft/world/gen/layer/LayerUtil.java -@@ -58,13 +58,11 @@ - iareafactory = DeepOceanLayer.INSTANCE.func_202713_a(p_227475_2_.apply(4L), iareafactory); - iareafactory = func_202829_a(1000L, ZoomLayer.NORMAL, iareafactory, 0, p_227475_2_); - int i = p_227475_0_ == WorldType.field_77135_d ? 6 : p_227475_1_.func_202200_j(); -+ i = getModdedBiomeSize(p_227475_0_, i); - int j = p_227475_1_.func_202198_k(); - IAreaFactory lvt_7_1_ = func_202829_a(1000L, ZoomLayer.NORMAL, iareafactory, 0, p_227475_2_); - lvt_7_1_ = StartRiverLayer.INSTANCE.func_202713_a((IExtendedNoiseRandom)p_227475_2_.apply(100L), lvt_7_1_); -- IAreaFactory lvt_8_1_ = (new BiomeLayer(p_227475_0_, p_227475_1_.func_202199_l())).func_202713_a(p_227475_2_.apply(200L), iareafactory); -- lvt_8_1_ = AddBambooForestLayer.INSTANCE.func_202713_a((IExtendedNoiseRandom)p_227475_2_.apply(1001L), lvt_8_1_); -- lvt_8_1_ = func_202829_a(1000L, ZoomLayer.NORMAL, lvt_8_1_, 2, p_227475_2_); -- lvt_8_1_ = EdgeBiomeLayer.INSTANCE.func_202713_a((IExtendedNoiseRandom)p_227475_2_.apply(1000L), lvt_8_1_); -+ IAreaFactory lvt_8_1_ = p_227475_0_.getBiomeLayer(iareafactory, p_227475_1_, p_227475_2_); - IAreaFactory lvt_9_1_ = func_202829_a(1000L, ZoomLayer.NORMAL, lvt_7_1_, 2, p_227475_2_); - lvt_8_1_ = HillsLayer.INSTANCE.func_202707_a((IExtendedNoiseRandom)p_227475_2_.apply(1000L), lvt_8_1_, lvt_9_1_); - lvt_7_1_ = func_202829_a(1000L, ZoomLayer.NORMAL, lvt_7_1_, 2, p_227475_2_); -@@ -120,6 +118,15 @@ - } - } - -+ /* ======================================== FORGE START =====================================*/ -+ public static int getModdedBiomeSize(WorldType worldType, int original) -+ { -+ net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize event = new net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize(worldType, original); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.getNewSize(); -+ } -+ /* ========================================= FORGE END ======================================*/ -+ - protected static boolean func_202827_a(int p_202827_0_) { - return p_202827_0_ == field_203632_a || p_202827_0_ == field_203633_b || p_202827_0_ == field_202832_c || p_202827_0_ == field_203634_d || p_202827_0_ == field_202831_b || p_202827_0_ == field_203635_f || p_202827_0_ == field_203636_g || p_202827_0_ == field_202830_a || p_202827_0_ == field_203637_i || p_202827_0_ == field_203638_j; - } diff --git a/patches_old/minecraft/net/minecraft/world/gen/layer/MixRiverLayer.java.patch b/patches_old/minecraft/net/minecraft/world/gen/layer/MixRiverLayer.java.patch deleted file mode 100644 index 922fa6b45..000000000 --- a/patches_old/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_old/minecraft/net/minecraft/world/gen/placement/Placement.java.patch b/patches_old/minecraft/net/minecraft/world/gen/placement/Placement.java.patch deleted file mode 100644 index edab9e71e..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/placement/Placement.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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.Feature; - import net.minecraft.world.gen.feature.IFeatureConfig; - --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::func_214735_a)); - public static final Placement field_215015_a = func_214999_a("count_heightmap", new AtSurface(FrequencyConfig::func_214721_a)); - public static final Placement field_215016_b = func_214999_a("count_top_solid", new TopSolid(FrequencyConfig::func_214721_a)); diff --git a/patches_old/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch b/patches_old/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch deleted file mode 100644 index ffdafae25..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java -+++ b/net/minecraft/world/gen/surfacebuilders/SurfaceBuilder.java -@@ -9,7 +9,7 @@ - import net.minecraft.world.biome.Biome; - import net.minecraft.world.chunk.IChunk; - --public abstract class SurfaceBuilder { -+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(); diff --git a/patches_old/minecraft/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java.patch b/patches_old/minecraft/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java.patch deleted file mode 100644 index c74c4f65f..000000000 --- a/patches_old/minecraft/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java -+++ b/net/minecraft/world/gen/treedecorator/TreeDecoratorType.java -@@ -4,7 +4,7 @@ - import java.util.function.Function; - import net.minecraft.util.registry.Registry; - --public class TreeDecoratorType

{ -+public class TreeDecoratorType

extends net.minecraftforge.registries.ForgeRegistryEntry> { - public static final TreeDecoratorType field_227425_a_ = func_227432_a_("trunk_vine", TrunkVineTreeDecorator::new); - public static final TreeDecoratorType field_227426_b_ = func_227432_a_("leave_vine", LeaveVineTreeDecorator::new); - public static final TreeDecoratorType field_227427_c_ = func_227432_a_("cocoa", CocoaTreeDecorator::new); diff --git a/patches_old/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch b/patches_old/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch deleted file mode 100644 index d3d59883b..000000000 --- a/patches_old/minecraft/net/minecraft/world/lighting/BlockLightEngine.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/world/lighting/BlockLightEngine.java -+++ b/net/minecraft/world/lighting/BlockLightEngine.java -@@ -117,4 +117,11 @@ - this.field_215627_c.func_215532_c(); - this.func_215469_a(Long.MAX_VALUE, p_215623_1_.func_218275_a(), 15 - p_215623_2_, true); - } -+ -+ // FORGE START -+ -+ @Override -+ public int queuedUpdateSize() { -+ return field_215627_c.queuedUpdateSize(); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch b/patches_old/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch deleted file mode 100644 index d368dd39b..000000000 --- a/patches_old/minecraft/net/minecraft/world/lighting/LevelBasedGraph.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/world/lighting/LevelBasedGraph.java -+++ b/net/minecraft/world/lighting/LevelBasedGraph.java -@@ -228,4 +228,10 @@ - protected abstract void func_215476_a(long p_215476_1_, int p_215476_3_); - - protected abstract int func_215480_b(long p_215480_1_, long p_215480_3_, int p_215480_5_); -+ -+ // FORGE START -+ -+ protected int queuedUpdateSize() { -+ return field_215488_c.size(); -+ } - } diff --git a/patches_old/minecraft/net/minecraft/world/lighting/LightEngine.java.patch b/patches_old/minecraft/net/minecraft/world/lighting/LightEngine.java.patch deleted file mode 100644 index 48a8ddd6b..000000000 --- a/patches_old/minecraft/net/minecraft/world/lighting/LightEngine.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/lighting/LightEngine.java -+++ b/net/minecraft/world/lighting/LightEngine.java -@@ -215,4 +215,8 @@ - long i = SectionPos.func_218169_f(SectionPos.func_218166_b(p_223129_1_.field_77276_a, 0, p_223129_1_.field_77275_b)); - this.field_215627_c.func_223113_c(i, p_223129_2_); - } -+ -+ // FORGE START -+ -+ public abstract int queuedUpdateSize(); - } diff --git a/patches_old/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch b/patches_old/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch deleted file mode 100644 index 225b637dd..000000000 --- a/patches_old/minecraft/net/minecraft/world/lighting/SkyLightEngine.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/world/lighting/SkyLightEngine.java -+++ b/net/minecraft/world/lighting/SkyLightEngine.java -@@ -229,4 +229,11 @@ - public String func_215614_b(long p_215614_1_) { - return super.func_215614_b(p_215614_1_) + (this.field_215627_c.func_215549_m(p_215614_1_) ? "*" : ""); - } -+ -+ // FORGE START -+ -+ @Override -+ public int queuedUpdateSize() { -+ return 0; -+ } - } diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 707922e63..5a0354544 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -321,10 +321,10 @@ public class ForgeHooksClient if (status == BETA || status == BETA_OUTDATED) { // render a warning at the top of the screen, - ITextComponent line = new TranslationTextComponent("forge.update.beta.1", TextFormatting.RED, TextFormatting.RESET); - gui.func_238472_a_(mStack, font, line, (width - font.func_238414_a_(line)) / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1); + ITextComponent line = new TranslationTextComponent("forge.update.beta.1", TextFormatting.RED, TextFormatting.RESET).func_240699_a_(TextFormatting.RED); + gui.func_238472_a_(mStack, font, line, width / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1); line = new TranslationTextComponent("forge.update.beta.2"); - gui.func_238472_a_(mStack, font, line, (width - font.func_238414_a_(line)) / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1); + gui.func_238472_a_(mStack, font, line, width / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1); } String line = null; diff --git a/src/main/java/net/minecraftforge/common/DimensionManager.java b/src/main/java/net/minecraftforge/common/DimensionManager.java deleted file mode 100644 index 31ff70543..000000000 --- a/src/main/java/net/minecraftforge/common/DimensionManager.java +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Minecraft Forge - * Copyright (c) 2016-2019. - * - * 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; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.concurrent.ConcurrentMap; -import java.util.stream.Collectors; - -import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectMaps; -import it.unimi.dsi.fastutil.ints.IntIterator; -import it.unimi.dsi.fastutil.ints.IntLinkedOpenHashSet; -import it.unimi.dsi.fastutil.ints.IntSet; -import it.unimi.dsi.fastutil.ints.IntSets; -import com.google.common.collect.HashMultiset; -import com.google.common.collect.Lists; -import com.google.common.collect.MapMaker; -import com.google.common.collect.Multiset; - -import io.netty.buffer.Unpooled; -import net.minecraft.nbt.CompoundNBT; -import net.minecraft.nbt.INBT; -import net.minecraft.nbt.ListNBT; -import net.minecraft.nbt.StringNBT; -import net.minecraft.network.PacketBuffer; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.management.PlayerList; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.ChunkPos; -import net.minecraft.util.registry.MutableRegistry; -import net.minecraft.world.World; -import net.minecraft.world.biome.IBiomeMagnifier; -import net.minecraft.world.chunk.ChunkStatus; -import net.minecraft.world.chunk.listener.IChunkStatusListener; -import net.minecraft.world.server.ServerMultiWorld; -import net.minecraft.world.server.ServerWorld; -import net.minecraft.world.dimension.DimensionType; -import net.minecraft.world.storage.SaveFormat; -import net.minecraft.world.storage.SaveHandler; -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.event.world.RegisterDimensionsEvent; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.StartupQuery; -import net.minecraftforge.fml.server.ServerModLoader; -import net.minecraftforge.registries.ClearableRegistry; -import net.minecraftforge.registries.ForgeRegistries; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.Validate; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.Marker; -import org.apache.logging.log4j.MarkerManager; - -import javax.annotation.Nullable; - -public class DimensionManager -{ - private static final Logger LOGGER = LogManager.getLogger(); - private static final Marker DIMMGR = MarkerManager.getMarker("DIMS"); - - private static final ClearableRegistry REGISTRY = new ClearableRegistry<>(new ResourceLocation("dimension_type"), DimensionType.class); - - private static final Int2ObjectMap dimensions = Int2ObjectMaps.synchronize(new Int2ObjectLinkedOpenHashMap<>()); - private static final IntSet unloadQueue = IntSets.synchronize(new IntLinkedOpenHashSet()); - private static final ConcurrentMap weakWorldMap = new MapMaker().weakKeys().weakValues().makeMap(); - private static final Multiset leakedWorlds = HashMultiset.create(); - private static final Map savedEntries = new HashMap<>(); - private static final List foldersScheduledForDeletion = new ArrayList<>(); - private static volatile Set playerWorlds = new HashSet<>(); - - /** - * Register or get the existing dimension type for the given dimtype name. - * - * Dimensions already known to the save are loaded into the DimensionType map before the {@link RegisterDimensionsEvent} is fired. - * You can use this helper to get your existing dimension, or create it if it is not found. - * - * @param name Registry name - * @param type ModDimension type data - * @param data Extra data for the ModDimension - * @param hasSkyLight does this dimension have a skylight? - * @param magnifier The biome generation processor - * @return the DimensionType for the dimension. - * / - public static DimensionType registerOrGetDimension(ResourceLocation name, ModDimension type, PacketBuffer data, boolean hasSkyLight) - { - return REGISTRY.getValue(name).orElseGet(()->registerDimension(name, type, data, hasSkyLight)); - } - /** - * Registers a real unique dimension, Should be called on server init, or when the dimension is created. - * On the client, the list will be reset/reloaded every time a InternalServer is refreshed. - * - * Forge will save this data and keep track of registered values, syncing automatically from the remote server. - * - * @param name Registry name for this new dimension. - * @param type Dimension Type. - * @param data Configuration data for this dimension, passed into - * @param hasSkyLight skylight for this dimension - * @param magnifier The biome generation processor - * @return the DimensionType for the dimension. - * / - public static DimensionType registerDimension(ResourceLocation name, ModDimension type, PacketBuffer data, boolean hasSkyLight) - { - Validate.notNull(name, "Can not register a dimension with null name"); - Validate.isTrue(!REGISTRY.containsKey(name), "Dimension: " + name + " Already registered"); - Validate.notNull(type, "Can not register a null dimension type"); - - int id = REGISTRY.getNextId(); - SavedEntry old = savedEntries.get(name); - if (old != null) - { - id = old.getId(); - if (!type.getRegistryName().equals(old.getType())) - LOGGER.info(DIMMGR, "Changing ModDimension for '{}' from '{}' to '{}'", name.toString(), old.getType() == null ? null : old.getType().toString(), type.getRegistryName().toString()); - savedEntries.remove(name); - } - @SuppressWarnings("deprecation") - DimensionType instance = new DimensionType(id, "", name.getNamespace() + "/" + name.getPath(), type.getFactory(), hasSkyLight, type.getMagnifier(), type, data); - REGISTRY.register(id, name, instance); - LOGGER.info(DIMMGR, "Registered dimension {} of type {} and id {}", name.toString(), type.getRegistryName().toString(), id); - return instance; - } - - /** - * Configures if the dimension will stay loaded in memory even if all chunks are unloaded. - * - * @param dim The dimension - * @param value True to keep loaded, false to allow unloading - * @return The old value for this dimension. - * / - public static boolean keepLoaded(DimensionType dim, boolean value) - { - Validate.notNull(dim, "Dimension type must not be null"); - Data data = getData(dim); - boolean ret = data.keepLoaded; - data.keepLoaded = value; - return ret; - } - - /** - * Determines if the dimension will stay loaded in memory even if all chunks are unloaded. - * @param dim The dimension - * @return True if the dimension will stay loaded with no chunks loaded. - * / - public static boolean keepLoaded(DimensionType dim) - { - Validate.notNull(dim, "Dimension type must not be null"); - Data data = dimensions.get(dim.getId()); - return data == null ? false : data.keepLoaded; - } - - /** - * Retrieves the world from the server allowing for null return, and optionally resetting it's unload timer. - * - * @param server The server that controls this world. - * @param dim Dimension to load. - * @param resetUnloadDelay True to reset the unload timer, which is a delay that is used to prevent constant world loading/unloading cycle. - * @param forceLoad True to attempt to load the dimension if the server has it unloaded. - * @return The world, null if unloaded and not loadable. - * / - @Nullable - public static ServerWorld getWorld(MinecraftServer server, DimensionType dim, boolean resetUnloadDelay, boolean forceLoad) - { - Validate.notNull(server, "Must provide server when creating world"); - Validate.notNull(dim, "Dimension type must not be null"); - - if (ServerModLoader.hasErrors()) { - throw new RuntimeException("The server has failed to initialize correctly due to mod loading errors. Examine the crash report for more details."); - } - // If we're in the early stages of loading, we need to return null so CommandSource can work properly for command function - if (StartupQuery.pendingQuery()) { - return null; - } - - if (resetUnloadDelay && unloadQueue.contains(dim.getId())) - getData(dim).ticksWaited = 0; - - @SuppressWarnings("deprecation") - ServerWorld ret = server.forgeGetWorldMap().get(dim); - if (ret == null && forceLoad) - ret = initWorld(server, dim); - return ret; - } - - /** - * Marks the given dimension for deletion upon next reload of the save. - * The corresponding data directory will be deleted as well. - * - * Note that the dimension need not be currently unloaded. The dimension will stay functioning as normal - * until the save is reloaded. - * - * Vanilla dimensions are not supported and will throw an exception. - * - * @param dim the dimension to delete - * / - public static void markForDeletion(DimensionType dim) - { - if (dim.isVanilla()) - { - throw new IllegalArgumentException("Cannot delete vanilla dimensions."); - } - getData(dim).markedForDeletion = true; - - Path base = Paths.get(".").toAbsolutePath().normalize(); - Path directory = dim.getDirectory(base.toFile()).toPath().toAbsolutePath().normalize(); - if (!directory.startsWith(base)) - { - LOGGER.warn("DimensionType {} returned save directory outside of base directory. This is bad. The directory will not be deleted.", dim); - } - else - { - String relative = base.relativize(directory).toString(); - foldersScheduledForDeletion.add(relative); - } - } - - //========================================================================================================== - // FORGE INTERNAL - //========================================================================================================== - - /** - * Deprecated, unregistering dimensions at runtime is not supported. - * @see DimensionManager#markForDeletion(DimensionType) - * / - @Deprecated - public static void unregisterDimension(int id) - { - } - - public static DimensionType registerDimensionInternal(int id, ResourceLocation name, ModDimension type, PacketBuffer data, boolean hasSkyLight) - { - Validate.notNull(name, "Can not register a dimension with null name"); - Validate.notNull(type, "Can not register a null dimension type"); - Validate.isTrue(!REGISTRY.containsKey(name), "Dimension: " + name + " Already registered"); - Validate.isTrue(REGISTRY.getByValue(id) == null, "Dimension with id " + id + " already registered as name " + REGISTRY.getKey(REGISTRY.getByValue(id))); - - @SuppressWarnings("deprecation") - DimensionType instance = new DimensionType(id, "", name.getNamespace() + "/" + name.getPath(), type.getFactory(), hasSkyLight, type.getMagnifier(), type, data); - REGISTRY.register(id, name, instance); - LOGGER.info(DIMMGR, "Registered dimension {} of type {} and id {}", name.toString(), type.getRegistryName().toString(), id); - return instance; - } - - @SuppressWarnings("deprecation") - public static ServerWorld initWorld(MinecraftServer server, DimensionType dim) - { - Validate.isTrue(dim != DimensionType.OVERWORLD, "Can not hotload overworld. This must be loaded at all times by main Server."); - Validate.notNull(server, "Must provide server when creating world"); - Validate.notNull(dim, "Must provide dimension when creating world"); - - ServerWorld overworld = getWorld(server, DimensionType.OVERWORLD, false, false); - Validate.notNull(overworld, "Cannot Hotload Dim: Overworld is not Loaded!"); - - @SuppressWarnings("resource") - ServerWorld world = new ServerMultiWorld(overworld, server, server.getBackgroundExecutor(), overworld.getSaveHandler(), dim, server.getProfiler(), new NoopChunkStatusListener()); - if (!server.isSinglePlayer()) - world.getWorldInfo().setGameType(server.getGameType()); - server.forgeGetWorldMap().put(dim, world); - server.markWorldsDirty(); - - MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); - - return world; - } - - private static boolean canUnloadWorld(ServerWorld world) - { - return world.getDimension().getType() != DimensionType.OVERWORLD - && world.getPlayers().isEmpty() - && world.getForcedChunks().isEmpty() - && !getData(world.getDimension().getType()).keepLoaded - && !playerWorlds.contains(world); - } - - /** - * Queues a dimension to unload, if it can be unloaded. - * @param world The world to unload - * / - public static void unloadWorld(ServerWorld world) - { - if (world == null || !canUnloadWorld(world)) - return; - - int id = world.getDimension().getType().getId(); - if (unloadQueue.add(id)) - LOGGER.debug(DIMMGR,"Queueing dimension {} to unload", id); - } - - @SuppressWarnings("deprecation") - public static void unloadWorlds(MinecraftServer server, boolean checkLeaks) - { - IntIterator queueIterator = unloadQueue.iterator(); - while (queueIterator.hasNext()) - { - int id = queueIterator.nextInt(); - DimensionType dim = DimensionType.getById(id); - - if (dim == null) - { - LOGGER.warn(DIMMGR, "Dimension with unknown type '{}' added to unload queue, removing", id); - queueIterator.remove(); - continue; - } - - Data dimension = dimensions.computeIfAbsent(id, k -> new Data()); - if (dimension.ticksWaited < ForgeConfig.SERVER.dimensionUnloadQueueDelay.get()) - { - dimension.ticksWaited++; - continue; - } - - queueIterator.remove(); - - ServerWorld w = server.forgeGetWorldMap().get(dim); - - dimension.ticksWaited = 0; - // Don't unload the world if the status changed - if (w == null || !canUnloadWorld(w)) - { - LOGGER.debug(DIMMGR,"Aborting unload for dimension {} as status changed", id); - continue; - } - try - { - w.save(null, true, true); - } - catch (Exception e) - { - LOGGER.error(DIMMGR,"Caught an exception while saving all chunks:", e); - } - finally - { - MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); - LOGGER.debug(DIMMGR, "Unloading dimension {}", id); - try { - w.close(); - } catch (IOException e) { - LOGGER.error("Exception closing the level", e); - } - server.forgeGetWorldMap().remove(dim); - server.markWorldsDirty(); - } - } - - if (checkLeaks) - { - List allWorlds = Lists.newArrayList(weakWorldMap.keySet()); - allWorlds.removeAll(server.forgeGetWorldMap().values()); - allWorlds.stream().map(System::identityHashCode).forEach(leakedWorlds::add); - - for (World w : allWorlds) - { - int hash = System.identityHashCode(w); - int leakCount = leakedWorlds.count(hash); - if (leakCount == 5) - LOGGER.debug(DIMMGR,"The world {} ({}) may have leaked: first encounter (5 occurrences).\n", Integer.toHexString(hash), w.getWorldInfo().getWorldName()); - else if (leakCount % 5 == 0) - LOGGER.debug(DIMMGR,"The world {} ({}) may have leaked: seen {} times.\n", Integer.toHexString(hash), w.getWorldInfo().getWorldName(), leakCount); - } - } - } - - public static void writeRegistry(CompoundNBT data) - { - data.putInt("version", 1); - List list = new ArrayList<>(); - for (DimensionType type : REGISTRY) - list.add(new SavedEntry(type, getData(type).markedForDeletion)); - savedEntries.values().forEach(list::add); - - Collections.sort(list, (a, b) -> a.id - b.id); - ListNBT lst = new ListNBT(); - list.forEach(e -> lst.add(e.write())); - - data.put("entries", lst); - - ListNBT deleteLst = new ListNBT(); - foldersScheduledForDeletion.forEach(folder -> deleteLst.add(StringNBT.valueOf(folder))); - data.put("delete_dirs", deleteLst); - } - - public static void readRegistry(CompoundNBT data) - { - int version = data.getInt("version"); - if (version != 1) - throw new IllegalStateException("Attempted to load world with unknown Dimension data format: " + version); - - LOGGER.debug(DIMMGR, "Reading Dimension Entries."); - Map vanilla = REGISTRY.stream().filter(DimensionType::isVanilla).collect(Collectors.toMap(REGISTRY::getKey, v -> v)); - REGISTRY.clear(); - vanilla.forEach((key, value) -> { - LOGGER.debug(DIMMGR, "Registering vanilla entry ID: {} Name: {} Value: {}", value.getId() + 1, key.toString(), value.toString()); - REGISTRY.register(value.getId() + 1, key, value); - }); - - savedEntries.clear(); - - @SuppressWarnings("unused") - boolean error = false; - ListNBT list = data.getList("entries", 10); - for (int x = 0; x < list.size(); x++) - { - SavedEntry entry = new SavedEntry(list.getCompound(x)); - if (entry.type == null) - { - DimensionType type = REGISTRY.getOrDefault(entry.name); - if (type == null) - { - LOGGER.error(DIMMGR, "Vanilla entry '{}' id {} in save file not found in registry.", entry.name.toString(), entry.id); - error = true; - continue; - } - int id = REGISTRY.getId(type); - if (id != entry.id) - { - LOGGER.error(DIMMGR, "Vanilla entry '{}' id {} in save file has incorrect in {} in registry.", entry.name.toString(), entry.id, id); - error = true; - continue; - } - } - else if (!entry.markedForDeletion) - { - ModDimension mod = ForgeRegistries.MOD_DIMENSIONS.getValue(entry.type); - if (mod == null) - { - LOGGER.error(DIMMGR, "Modded dimension entry '{}' id {} type {} in save file missing ModDimension.", entry.name.toString(), entry.id, entry.type.toString()); - savedEntries.put(entry.name, entry); - continue; - } - registerDimensionInternal(entry.id, entry.name, mod, entry.data == null ? null : new PacketBuffer(Unpooled.wrappedBuffer(entry.data)), entry.skyLight()); - } - } - - foldersScheduledForDeletion.clear(); - - ListNBT folderList = data.getList("delete_dirs", Constants.NBT.TAG_STRING); - folderList.stream() - .map(INBT::getString) - .forEach(foldersScheduledForDeletion::add); - } - - public static void processScheduledDeletions(SaveFormat.LevelSave levelSave) - { - List toDelete = new ArrayList<>(foldersScheduledForDeletion); - foldersScheduledForDeletion.clear(); - if (!toDelete.isEmpty()) - { - StringBuilder text = new StringBuilder(); - text.append("The following dimensions are marked for deletion by their owning mod. Proceed?\n\n"); - for (String folder : toDelete) - { - text.append(folder).append('\n'); - } - if (!StartupQuery.confirm(text.toString())) - { - StartupQuery.abort(); - return; - } - } - for (String folderName : toDelete) - { - File folder = new File(levelSave.getWorldDir().toFile(), folderName); - try - { - FileUtils.deleteDirectory(folder); - LOGGER.info(DIMMGR, "Modded dimension directory {} scheduled for deletion was deleted.", folderName); - } - catch (Exception e) - { - LOGGER.error(DIMMGR, "Failed to delete modded dimension directory {} that was scheduled for deletion.", folderName, e); - } - } - } - - public static void fireRegister() - { - MinecraftForge.EVENT_BUS.post(new RegisterDimensionsEvent(savedEntries)); - if (!savedEntries.isEmpty()) - { - savedEntries.values().forEach(entry -> { - LOGGER.warn(DIMMGR, "Missing Dimension Name: '{}' Id: {} Type: '{}", entry.name.toString(), entry.id, entry.type.toString()); - }); - } - } - - @Deprecated //Forge: Internal use only. - public static MutableRegistry getRegistry() - { - return REGISTRY; - } - - private static Data getData(DimensionType dim) - { - return dimensions.computeIfAbsent(dim.getId(), k -> new Data()); - } - - private static class Data - { - int ticksWaited = 0; - boolean keepLoaded = false; - boolean markedForDeletion = false; - } - - public static class SavedEntry - { - int id; - ResourceLocation name; - ResourceLocation type; - byte[] data; - boolean skyLight; - boolean markedForDeletion; - - public int getId() - { - return id; - } - - public ResourceLocation getName() - { - return name; - } - - @Nullable - public ResourceLocation getType() - { - return type; - } - - @Nullable - public byte[] getData() - { - return data; - } - - public boolean skyLight() - { - return this.skyLight; - } - - private SavedEntry(CompoundNBT data) - { - this.id = data.getInt("id"); - this.name = new ResourceLocation(data.getString("name")); - this.type = data.contains("type", 8) ? new ResourceLocation(data.getString("type")) : null; - this.data = data.contains("data", 7) ? data.getByteArray("data") : null; - this.skyLight = data.contains("sky_light", 99) ? data.getBoolean("sky_light") : true; - this.markedForDeletion = data.getBoolean("marked_for_deletion"); - } - - private SavedEntry(DimensionType data, boolean markedForDeletion) - { - this.id = REGISTRY.getId(data); - this.name = REGISTRY.getKey(data); - if (data.getModType() != null) - this.type = data.getModType().getRegistryName(); - if (data.getData() != null) - this.data = data.getData().array(); - this.skyLight = data.hasSkyLight(); - this.markedForDeletion = markedForDeletion; - } - - private CompoundNBT write() - { - CompoundNBT ret = new CompoundNBT(); - ret.putInt("id", id); - ret.putString("name", name.toString()); - if (type != null) - ret.putString("type", type.toString()); - if (data != null) - ret.putByteArray("data", data); - ret.putBoolean("sky_light", skyLight); - ret.putBoolean("marked_for_deletion", markedForDeletion); - return ret; - } - } - - private static class NoopChunkStatusListener implements IChunkStatusListener - { - @Override public void start(ChunkPos center) { } - @Override public void statusChanged(ChunkPos chunkPosition, ChunkStatus newStatus) { } - @Override public void stop() { } - } - - public static boolean rebuildPlayerMap(PlayerList players, boolean changed) - { - playerWorlds = players.getPlayers().stream().map(e -> e.world).collect(Collectors.toSet()); - return changed; - } -}*/ diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index 7e3790b67..209222fe7 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -94,6 +94,8 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public static final RegistryObject NAMETAG_DISTANCE = ATTRIBUTES.register("nametag_distance", () -> new RangedAttribute("forge.nameTagDistance", 64.0D, 0.0D, Float.MAX_VALUE).func_233753_a_(true)); public static final RegistryObject ENTITY_GRAVITY = ATTRIBUTES.register("entity_gravity", () -> new RangedAttribute("forge.entity_gravity", 0.08D, -8.0D, 8.0D).func_233753_a_(true)); + public static final RegistryObject REACH_DISTANCE = ATTRIBUTES.register("reach_distance", () -> new RangedAttribute( "generic.reachDistance", 5.0D, 0.0D, 1024.0D).func_233753_a_(true)); + private static ForgeMod INSTANCE; public static ForgeMod getInstance() { diff --git a/src/main/java/net/minecraftforge/common/ModDimension.java b/src/main/java/net/minecraftforge/common/ModDimension.java deleted file mode 100644 index cddee9632..000000000 --- a/src/main/java/net/minecraftforge/common/ModDimension.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Minecraft Forge - * Copyright (c) 2016-2019. - * - * 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; - -import java.util.function.BiFunction; - -import net.minecraft.network.PacketBuffer; -import net.minecraft.world.World; -import net.minecraft.world.biome.ColumnFuzzedBiomeMagnifier; -import net.minecraft.world.biome.IBiomeMagnifier; -import net.minecraft.world.dimension.Dimension; -import net.minecraft.world.dimension.DimensionType; -import net.minecraftforge.registries.ForgeRegistryEntry; - -/** - * In 1.13.2, Mojang made DimensionType as the unique holder/identifier for each Dimension. - * We used to be able to create custom Dimensions separate from DimensionType. - * But now that they are hard linked to a single instance, this is the new class that - * defines the 'template' for new dimensions. - * / -public abstract class ModDimension extends ForgeRegistryEntry -{ - public abstract BiFunction getFactory(); - - /** - * Serialize any necessary data, this is called both when saving the world on the server. - * And when sent over the network to the client. - * - * @param buffer The data buffer to write to. - * @param network true when sent over the network, so you can only data needed by the client. - * / - public void write(PacketBuffer buffer, boolean network){} - - /** - * Deserialize any necessary data, this is called both when saving the world on the server. - * And when sent over the network to the client. - * - * @param buffer The data buffer to write to. - * @param network true when sent over the network, so you can only data needed by the client. - * / - public void read(PacketBuffer buffer, boolean network){} - - public IBiomeMagnifier getMagnifier() { - return ColumnFuzzedBiomeMagnifier.INSTANCE; - } - - /** - * Convenience method for generating a ModDimension with a specific factory but no extra - * data handling behaviour. Extend ModDimension to override other methods. - * - * @param factory Factory for creating {@link Dimension} instances from DimType and World. - * @return A custom ModDimension with that factory. - * / - public static ModDimension withFactory(BiFunction factory) { - return new ModDimension() { - @Override - public BiFunction getFactory() { - return factory; - } - }; - } -}*/ diff --git a/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java b/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java index c1bad65a3..cc08d24dd 100644 --- a/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java +++ b/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -31,7 +30,6 @@ import com.google.gson.JsonSyntaxException; import net.minecraft.advancements.Advancement; import net.minecraft.util.JSONUtils; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.crafting.conditions.ICondition; public class ConditionalAdvancement @@ -41,14 +39,11 @@ public class ConditionalAdvancement return new Builder(); } - public static Advancement.Builder read(Gson gson, ResourceLocation recipeId, JsonObject json) - { + public static boolean processConditions(JsonObject json) { JsonArray entries = JSONUtils.getJsonArray(json, "advancements", null); if (entries == null) { - if (!CraftingHelper.processConditions(json, "conditions")) - return null; - return gson.fromJson(json, Advancement.Builder.class); + return CraftingHelper.processConditions(json, "conditions"); } int idx = 0; @@ -57,10 +52,10 @@ public class ConditionalAdvancement if (!ele.isJsonObject()) throw new JsonSyntaxException("Invalid advancement entry at index " + idx + " Must be JsonObject"); if (CraftingHelper.processConditions(JSONUtils.getJsonArray(ele.getAsJsonObject(), "conditions"))) - return gson.fromJson(JSONUtils.getJsonObject(ele.getAsJsonObject(), "advancement"), Advancement.Builder.class); + return true; idx++; } - return null; + return false; } public static class Builder diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index c1f8d8a0e..55a6dc108 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -114,7 +114,7 @@ public interface IForgeBlock */ default boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity) { - return false; + return state.getBlock().isIn(BlockTags.field_232878_as_); } /** @@ -533,7 +533,7 @@ public interface IForgeBlock */ default boolean isFertile(BlockState state, IBlockReader world, BlockPos pos) { - if (this.getBlock() == Blocks.FARMLAND) + if (state.isIn(Blocks.FARMLAND)) return state.get(FarmlandBlock.MOISTURE) > 0; return false; @@ -581,7 +581,7 @@ public interface IForgeBlock */ default boolean isPortalFrame(BlockState state, IWorldReader world, BlockPos pos) { - return state.getBlock() == Blocks.OBSIDIAN; + return state.isIn(Blocks.OBSIDIAN); } /** @@ -634,7 +634,7 @@ public interface IForgeBlock */ default float getEnchantPowerBonus(BlockState state, IWorldReader world, BlockPos pos) { - return this.getBlock() == Blocks.BOOKSHELF ? 1: 0; + return state.isIn(Blocks.BOOKSHELF) ? 1: 0; } /** diff --git a/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java b/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java index af4c72a8b..7302b9719 100644 --- a/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java +++ b/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java @@ -23,6 +23,7 @@ import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraft.util.RegistryKey; import net.minecraft.world.World; import net.minecraftforge.client.model.animation.Animation; import net.minecraftforge.common.MinecraftForge; @@ -32,11 +33,11 @@ import net.minecraftforge.event.TickEvent; public class BasicEventHooks { - //TODO Dimensions.. -// public static void firePlayerChangedDimensionEvent(PlayerEntity player, DimensionType fromDim, DimensionType toDim) -// { -// MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim)); -// } + + public static void firePlayerChangedDimensionEvent(PlayerEntity player, RegistryKey fromDim, RegistryKey toDim) + { + MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim)); + } public static void firePlayerLoggedIn(PlayerEntity player) { diff --git a/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java b/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java index 0794329e5..cb1c098b4 100644 --- a/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java +++ b/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java @@ -308,61 +308,4 @@ public class FMLPlayMessages return additionalData; } } - - //TODO Dimensions.. - /*public static class DimensionInfoMessage - { - private ResourceLocation dimName; - private boolean skylight; - private int id; - private ResourceLocation modDimensionName; - private PacketBuffer extraData; - - DimensionInfoMessage(DimensionType type) { - id = type.getId() + 1; - dimName = type.getRegistryName(); - modDimensionName = type.getModType().getRegistryName(); - skylight = type.hasSkyLight(); - extraData = new PacketBuffer(Unpooled.buffer()); - type.getModType().write(extraData, true); - } - - DimensionInfoMessage(final int dimId, final ResourceLocation dimname, final ResourceLocation modDimensionName, final boolean skylight, final PacketBuffer extraData) { - id = dimId; - this.dimName = dimname; - this.modDimensionName = modDimensionName; - this.skylight = skylight; - this.extraData = extraData; - } - - public static DimensionInfoMessage decode(PacketBuffer buffer) { - int dimId = buffer.readInt(); - ResourceLocation dimname = buffer.readResourceLocation(); - ResourceLocation moddimname = buffer.readResourceLocation(); - boolean skylight = buffer.readBoolean(); - PacketBuffer pb = new PacketBuffer(Unpooled.wrappedBuffer(buffer.readByteArray())); - return new DimensionInfoMessage(dimId, dimname, moddimname, skylight, pb); - } - - public static void encode(DimensionInfoMessage message, PacketBuffer buffer) { - buffer.writeInt(message.id); - buffer.writeResourceLocation(message.dimName); - buffer.writeResourceLocation(message.modDimensionName); - buffer.writeBoolean(message.skylight); - buffer.writeByteArray(message.extraData.array()); - } - - private DimensionType makeDummyDimensionType() { - final ModDimension modDim = ForgeRegistries.MOD_DIMENSIONS.getValue(modDimensionName); - // default to overworld if no moddim found - if (modDim == null) return DimensionType.OVERWORLD; - modDim.read(extraData, true); - return new DimensionType(id, "dummy", "dummy", modDim.getFactory(), skylight, FuzzedBiomeMagnifier.INSTANCE, modDim, extraData); - } - - public static boolean handle(final DimensionInfoMessage message, final Supplier contextSupplier) { - contextSupplier.get().enqueueWork(()-> NetworkHooks.addCachedDimensionType(message.makeDummyDimensionType(), message.dimName)); - return true; - } - }*/ } diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java index f96d27402..fd25b96d7 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java @@ -80,7 +80,7 @@ public class ForgeRegistries public static final IForgeRegistry> RECIPE_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(IRecipeSerializer.class); public static final IForgeRegistry ATTRIBUTES = RegistryManager.ACTIVE.getRegistry(Attribute.class); public static final IForgeRegistry> STAT_TYPES = RegistryManager.ACTIVE.getRegistry(StatType.class); - + // Villages public static final IForgeRegistry PROFESSIONS = RegistryManager.ACTIVE.getRegistry(VillagerProfession.class); public static final IForgeRegistry POI_TYPES = RegistryManager.ACTIVE.getRegistry(PointOfInterestType.class); @@ -94,7 +94,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> BIOME_PROVIDER_TYPES = RegistryManager.ACTIVE.getRegistry(BiomeProviderType.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> BLOCK_STATE_PROVIDER_TYPES = RegistryManager.ACTIVE.getRegistry(BlockStateProviderType.class); @@ -103,7 +102,6 @@ public class ForgeRegistries public static final IForgeRegistry> TREE_DECORATOR_TYPES = RegistryManager.ACTIVE.getRegistry(TreeDecoratorType.class); // Custom forge registries - //public static final IForgeRegistry MOD_DIMENSIONS = RegistryManager.ACTIVE.getRegistry(ModDimension.class); //TODO Dimensions.. public static final IForgeRegistry DATA_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(DataSerializerEntry.class); public static final IForgeRegistry> LOOT_MODIFIER_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(GlobalLootModifierSerializer.class); diff --git a/src/main/java/net/minecraftforge/registries/GameData.java b/src/main/java/net/minecraftforge/registries/GameData.java index 5cab98dc5..0982c91ce 100644 --- a/src/main/java/net/minecraftforge/registries/GameData.java +++ b/src/main/java/net/minecraftforge/registries/GameData.java @@ -141,7 +141,6 @@ public class GameData public static final ResourceLocation FEATURES = new ResourceLocation("feature"); public static final ResourceLocation DECORATORS = new ResourceLocation("decorator"); public static final ResourceLocation BIOME_PROVIDER_TYPES = new ResourceLocation("biome_source_type"); - public static final ResourceLocation CHUNK_GENERATOR_TYPES = new ResourceLocation("chunk_generator_type"); public static final ResourceLocation CHUNK_STATUS = new ResourceLocation("chunk_status"); public static final ResourceLocation BLOCK_STATE_PROVIDER_TYPES = new ResourceLocation("block_state_provider_type"); public static final ResourceLocation BLOCK_PLACER_TYPES = new ResourceLocation("block_placer_type"); @@ -149,7 +148,6 @@ public class GameData public static final ResourceLocation TREE_DECORATOR_TYPES = new ResourceLocation("tree_decorator_type"); // Custom forge registries - public static final ResourceLocation MODDIMENSIONS = new ResourceLocation("forge:moddimensions"); public static final ResourceLocation SERIALIZERS = new ResourceLocation("minecraft:dataserializers"); public static final ResourceLocation LOOT_MODIFIER_SERIALIZERS = new ResourceLocation("forge:loot_modifier_serializers"); @@ -212,8 +210,6 @@ public class GameData 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(BIOME_PROVIDER_TYPES, BiomeProviderType.class).disableSaving().disableSync().create(); -// makeRegistry(CHUNK_GENERATOR_TYPES, ChunkGeneratorType.class).disableSaving().disableSync().create(); makeRegistry(CHUNK_STATUS, ChunkStatus.class, new ResourceLocation("empty")).disableSaving().disableSync().create(); makeRegistry(BLOCK_STATE_PROVIDER_TYPES, BlockStateProviderType.class).disableSaving().disableSync().create(); makeRegistry(BLOCK_PLACER_TYPES, BlockPlacerType.class).disableSaving().disableSync().create(); @@ -221,7 +217,6 @@ public class GameData makeRegistry(TREE_DECORATOR_TYPES, TreeDecoratorType.class).disableSaving().disableSync().create(); // Custom forge registries - //makeRegistry(MODDIMENSIONS, ModDimension.class ).disableSaving().create(); //TODO Dimensions makeRegistry(SERIALIZERS, DataSerializerEntry.class, 256 /*vanilla space*/, MAX_VARINT).disableSaving().disableOverrides().addCallback(SerializerCallbacks.INSTANCE).create(); makeRegistry(LOOT_MODIFIER_SERIALIZERS, GlobalLootModifierSerializer.class).disableSaving().disableSync().create(); } diff --git a/src/test/java/net/minecraftforge/debug/world/MarkDimensionForDeletionTest.java b/src/test/java/net/minecraftforge/debug/world/MarkDimensionForDeletionTest.java deleted file mode 100644 index 8a1f35761..000000000 --- a/src/test/java/net/minecraftforge/debug/world/MarkDimensionForDeletionTest.java +++ /dev/null @@ -1,188 +0,0 @@ -package net.minecraftforge.debug.world; -/* - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompoundNBT; -import net.minecraft.nbt.INBT; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Direction; -import net.minecraft.util.Hand; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.StringTextComponent; -import net.minecraft.world.World; -import net.minecraft.world.dimension.DimensionType; -import net.minecraft.world.dimension.OverworldDimension; -import net.minecraft.world.server.ServerWorld; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.ModDimension; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.CapabilityInject; -import net.minecraftforge.common.capabilities.CapabilityManager; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.common.util.ITeleporter; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -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; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.UUID; -import java.util.function.Function; - -@Mod(MarkDimensionForDeletionTest.MODID) -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = MarkDimensionForDeletionTest.MODID) -public class MarkDimensionForDeletionTest -{ - - public static final String MODID = "mark_dimension_for_deletion_test"; - - private static final DeferredRegister DIMENSIONS = new DeferredRegister<>(ForgeRegistries.MOD_DIMENSIONS, MODID); - private static final DeferredRegister ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, MODID); - - private static final RegistryObject DYNAMIC_DIMENSION_TYPE = DIMENSIONS.register( - "dynamic_dimension", - () -> ModDimension.withFactory(OverworldDimension::new) - ); - private static final RegistryObject DIM_ITEM = ITEMS.register("dim_item", () -> new Item(new Item.Properties().group(ItemGroup.MISC)) - { - @Override - public ActionResult onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) - { - if (!worldIn.isRemote) - { - if (playerIn.isShiftKeyDown()) - { - playerIn.sendMessage(new StringTextComponent("You are in dimension " + worldIn.dimension.getType().getRegistryName())); - } - else - { - DynamicDimensionCap cap = playerIn.getCapability(CAP).orElseThrow(IllegalStateException::new); - ITeleporter teleporter = new ITeleporter() - { - @Override - public Entity placeEntity(Entity entity, ServerWorld currentWorld, ServerWorld destWorld, float yaw, Function repositionEntity) - { - return repositionEntity.apply(false); - } - }; - if (cap.dimension == null) - { - ResourceLocation dimName = new ResourceLocation(MODID, "dynamic_" + playerIn.getUniqueID().toString() + "_" + UUID.randomUUID().toString()); - cap.dimension = DimensionManager.registerDimension(dimName, DYNAMIC_DIMENSION_TYPE.get(), null, true); - DimensionManager.initWorld(worldIn.getServer(), cap.dimension); - playerIn.changeDimension(cap.dimension, teleporter); - } - else if (playerIn.dimension == cap.dimension) - { - playerIn.changeDimension(DimensionType.OVERWORLD, teleporter); - DimensionManager.markForDeletion(cap.dimension); - } - else - { - playerIn.changeDimension(cap.dimension, teleporter); - } - } - } - return ActionResult.resultSuccess(playerIn.getHeldItem(handIn)); - } - }); - - @CapabilityInject(DynamicDimensionCap.class) - public static Capability CAP; - - public MarkDimensionForDeletionTest() - { - DIMENSIONS.register(FMLJavaModLoadingContext.get().getModEventBus()); - ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); - } - - @SubscribeEvent - public static void commonSetup(FMLCommonSetupEvent event) - { - CapabilityManager.INSTANCE.register(DynamicDimensionCap.class, new DynamicDimensionCap.Storage(), DynamicDimensionCap::new); - } - - @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE, modid = MODID) - public static class ForgeEventSubscriber - { - - @SubscribeEvent - public static void attachCaps(AttachCapabilitiesEvent event) - { - if (event.getObject() instanceof ServerPlayerEntity) - { - event.addCapability(new ResourceLocation(MODID, "dynamic_dimension"), new DynamicDimensionCap()); - } - } - - } - - public static class DynamicDimensionCap implements ICapabilitySerializable - { - - static class Storage implements Capability.IStorage - { - - @Nullable - @Override - public INBT writeNBT(Capability capability, DynamicDimensionCap instance, Direction side) - { - return instance.serializeNBT(); - } - - @Override - public void readNBT(Capability capability, DynamicDimensionCap instance, Direction side, INBT nbt) - { - instance.deserializeNBT((CompoundNBT) nbt); - } - } - - public DimensionType dimension = null; - - private final LazyOptional instance = LazyOptional.of(() -> this); - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) - { - return CAP.orEmpty(cap, instance); - } - - @Override - public CompoundNBT serializeNBT() - { - CompoundNBT result = new CompoundNBT(); - if (dimension != null && dimension.getRegistryName() != null) - { - result.putString("dimension", dimension.getRegistryName().toString()); - } - return result; - } - - @Override - public void deserializeNBT(CompoundNBT nbt) - { - if (nbt.contains("dimension", Constants.NBT.TAG_STRING)) - { - dimension = DimensionType.byName(new ResourceLocation(nbt.getString("dimension"))); - } - else - { - dimension = null; - } - } - } -} -*/ \ No newline at end of file diff --git a/src/userdev/java/net/minecraftforge/userdev/FMLDevServerLaunchProvider.java b/src/userdev/java/net/minecraftforge/userdev/FMLDevServerLaunchProvider.java index 9c852d6a6..57da69947 100644 --- a/src/userdev/java/net/minecraftforge/userdev/FMLDevServerLaunchProvider.java +++ b/src/userdev/java/net/minecraftforge/userdev/FMLDevServerLaunchProvider.java @@ -70,7 +70,7 @@ public class FMLDevServerLaunchProvider extends FMLCommonLaunchHandler implement super.beforeStart(launchClassLoader); launchClassLoader.addTargetPackageFilter(getPackagePredicate()); Thread.currentThread().setContextClassLoader(launchClassLoader.getInstance()); - Class.forName("net.minecraft.server.MinecraftServer", true, launchClassLoader.getInstance()).getMethod("main", String[].class).invoke(null, (Object)arguments); + Class.forName("net.minecraft.server.Main", true, launchClassLoader.getInstance()).getMethod("main", String[].class).invoke(null, (Object)arguments); return null; }; }