diff --git a/build.gradle b/build.gradle index 33954541c..a1bc39dd9 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,8 @@ ext { } MAPPING_CHANNEL = 'snapshot' MAPPING_VERSION = '20190621-1.14.2' - MC_VERSION = '1.14.2' - MCP_VERSION = '20190603.175704' + MC_VERSION = '1.14.3' + MCP_VERSION = '20190624.152911' } project(':mcp') { @@ -169,7 +169,7 @@ project(':forge') { } ext { - SPEC_VERSION = '26.0' // This is overwritten by git tag, but here so dev time doesnt explode + SPEC_VERSION = '27.0' // This is overwritten by git tag, but here so dev time doesnt explode // The new versioning sceme is -.. // ForgeMC is a unique identifier for every MC version we have supported. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. diff --git a/patches/minecraft/com/mojang/blaze3d/platform/GLX.java.patch b/patches/minecraft/com/mojang/blaze3d/platform/GLX.java.patch index 220fe5600..f7359a16e 100644 --- a/patches/minecraft/com/mojang/blaze3d/platform/GLX.java.patch +++ b/patches/minecraft/com/mojang/blaze3d/platform/GLX.java.patch @@ -11,7 +11,7 @@ public static void populateSnooperWithOpenGL(IDataHolder p_populateSnooperWithOpenGL_0_) { p_populateSnooperWithOpenGL_0_.setFixedData("opengl_version", GlStateManager.getString(7938)); p_populateSnooperWithOpenGL_0_.setFixedData("opengl_vendor", GlStateManager.getString(7936)); -@@ -909,6 +913,10 @@ +@@ -913,6 +917,10 @@ GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_); } diff --git a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch index 669cebbbe..f384df7d8 100644 --- a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch +++ b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/advancements/PlayerAdvancements.java +++ b/net/minecraft/advancements/PlayerAdvancements.java -@@ -186,6 +186,8 @@ +@@ -187,6 +187,8 @@ } public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) { @@ -9,8 +9,8 @@ boolean flag = false; AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_); boolean flag1 = advancementprogress.func_192105_a(); -@@ -198,6 +200,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_82766_b("announceAdvancements")) { +@@ -199,6 +201,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/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 12e962cc1..5f45b591d 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/Block.java +++ b/net/minecraft/block/Block.java -@@ -74,9 +74,10 @@ +@@ -75,9 +75,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,7 +13,7 @@ private static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP}; private static final LoadingCache field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader() { public Boolean load(VoxelShape p_load_1_) { -@@ -290,7 +291,7 @@ +@@ -291,7 +292,7 @@ @Deprecated public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) { @@ -22,7 +22,7 @@ } @Deprecated -@@ -302,8 +303,9 @@ +@@ -303,8 +304,9 @@ return this.field_149789_z; } @@ -33,7 +33,7 @@ } @Deprecated -@@ -314,7 +316,7 @@ +@@ -315,7 +317,7 @@ @Deprecated @OnlyIn(Dist.CLIENT) public int func_220058_a(BlockState p_220058_1_, IEnviromentBlockReader p_220058_2_, BlockPos p_220058_3_) { @@ -42,7 +42,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -459,10 +461,9 @@ +@@ -460,10 +462,9 @@ @Deprecated public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) { @@ -54,7 +54,7 @@ } @Deprecated -@@ -471,8 +472,8 @@ +@@ -472,8 +473,8 @@ if (f == -1.0F) { return 0.0F; } else { @@ -65,25 +65,25 @@ } } -@@ -552,7 +553,7 @@ +@@ -553,7 +554,7 @@ } public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) { -- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")) { -+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe +- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f)) { ++ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180635_0_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe float f = 0.5F; double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; -@@ -564,7 +565,7 @@ +@@ -565,7 +566,7 @@ } public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) { -- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_82766_b("doTileDrops")) { -+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_82766_b("doTileDrops") && !p_180637_1_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe +- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) { ++ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe while(p_180637_3_ > 0) { int i = ExperienceOrbEntity.func_70527_a(p_180637_3_); p_180637_3_ -= i; -@@ -574,6 +575,7 @@ +@@ -575,6 +576,7 @@ } @@ -91,7 +91,7 @@ public float func_149638_a() { return this.field_149781_w; } -@@ -676,6 +678,7 @@ +@@ -677,6 +679,7 @@ p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.0D)); } @@ -99,7 +99,7 @@ @OnlyIn(Dist.CLIENT) public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) { return new ItemStack(this); -@@ -690,6 +693,7 @@ +@@ -691,6 +694,7 @@ return Fluids.field_204541_a.func_207188_f(); } @@ -107,7 +107,7 @@ public float func_208618_m() { return this.field_149765_K; } -@@ -710,6 +714,7 @@ +@@ -711,6 +715,7 @@ public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) { } @@ -115,7 +115,7 @@ public boolean func_149659_a(Explosion p_149659_1_) { return true; } -@@ -754,6 +759,7 @@ +@@ -755,6 +760,7 @@ } } @@ -123,7 +123,7 @@ public SoundType func_220072_p(BlockState p_220072_1_) { return this.field_149762_H; } -@@ -779,13 +785,80 @@ +@@ -780,13 +786,80 @@ } public static boolean func_196252_e(Block p_196252_0_) { diff --git a/patches/minecraft/net/minecraft/block/BlockState.java.patch b/patches/minecraft/net/minecraft/block/BlockState.java.patch index a98f44a8a..a0d2dfd38 100644 --- a/patches/minecraft/net/minecraft/block/BlockState.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockState.java.patch @@ -9,7 +9,7 @@ @Nullable private BlockState.Cache field_215707_c; private final int field_215708_d; -@@ -107,10 +107,14 @@ +@@ -106,10 +106,14 @@ return this.field_215708_d; } diff --git a/patches/minecraft/net/minecraft/block/CropsBlock.java.patch b/patches/minecraft/net/minecraft/block/CropsBlock.java.patch index a9aa32cbe..de9c27516 100644 --- a/patches/minecraft/net/minecraft/block/CropsBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/CropsBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/CropsBlock.java +++ b/net/minecraft/block/CropsBlock.java -@@ -58,12 +58,14 @@ +@@ -59,12 +59,14 @@ public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) { super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_); @@ -16,7 +16,7 @@ } } } -@@ -92,9 +94,9 @@ +@@ -93,9 +95,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)); @@ -28,3 +28,12 @@ f1 = 3.0F; } } +@@ -131,7 +133,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_175655_b(p_196262_3_, true); + } + diff --git a/patches/minecraft/net/minecraft/block/FarmlandBlock.java.patch b/patches/minecraft/net/minecraft/block/FarmlandBlock.java.patch index fb721ff9a..041353e43 100644 --- a/patches/minecraft/net/minecraft/block/FarmlandBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/FarmlandBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/block/FarmlandBlock.java +++ b/net/minecraft/block/FarmlandBlock.java -@@ -72,7 +72,7 @@ +@@ -73,7 +73,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_82766_b("mobGriefing")) && 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 && 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_); } -@@ -83,9 +83,9 @@ +@@ -84,9 +84,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_)); } @@ -22,7 +22,7 @@ } private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) { -@@ -95,7 +95,7 @@ +@@ -96,7 +96,7 @@ } } diff --git a/patches/minecraft/net/minecraft/block/FireBlock.java.patch b/patches/minecraft/net/minecraft/block/FireBlock.java.patch index 0fa2a7de5..0a834f91c 100644 --- a/patches/minecraft/net/minecraft/block/FireBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/FireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/FireBlock.java +++ b/net/minecraft/block/FireBlock.java -@@ -63,13 +63,13 @@ +@@ -64,13 +64,13 @@ public BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) { BlockPos blockpos = p_196448_2_.func_177977_b(); BlockState blockstate = p_196448_1_.func_180495_p(blockpos); @@ -16,10 +16,10 @@ } } -@@ -90,12 +90,14 @@ +@@ -91,12 +91,14 @@ public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) { - if (p_196267_2_.func_82736_K().func_82766_b("doFireTick")) { + if (p_196267_2_.func_82736_K().func_223586_b(GameRules.field_223598_a)) { + if (!p_196267_2_.isAreaLoaded(p_196267_3_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) { p_196267_2_.func_217377_a(p_196267_3_, false); @@ -32,7 +32,7 @@ int i = p_196267_1_.func_177229_b(field_176543_a); if (!flag && p_196267_2_.func_72896_J() && this.func_176537_d(p_196267_2_, p_196267_3_) && p_196267_4_.nextFloat() < 0.2F + (float)i * 0.03F) { p_196267_2_.func_217377_a(p_196267_3_, false); -@@ -117,7 +119,7 @@ +@@ -118,7 +120,7 @@ return; } @@ -41,7 +41,7 @@ p_196267_2_.func_217377_a(p_196267_3_, false); return; } -@@ -125,12 +127,12 @@ +@@ -126,12 +128,12 @@ boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_); int k = flag1 ? -50 : 0; @@ -60,7 +60,7 @@ BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for(int l = -1; l <= 1; ++l) { -@@ -168,16 +170,18 @@ +@@ -169,16 +171,18 @@ return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d()); } @@ -83,7 +83,7 @@ if (p_176536_4_.nextInt(p_176536_3_) < i) { BlockState blockstate = p_176536_1_.func_180495_p(p_176536_2_); if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) { -@@ -198,7 +202,7 @@ +@@ -199,7 +203,7 @@ private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) { for(Direction direction : Direction.values()) { @@ -92,7 +92,7 @@ return true; } } -@@ -214,13 +218,14 @@ +@@ -215,13 +219,14 @@ for(Direction direction : Direction.values()) { BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction)); @@ -108,7 +108,7 @@ public boolean func_196446_i(BlockState p_196446_1_) { return this.func_220275_r(p_196446_1_) > 0; } -@@ -245,8 +250,8 @@ +@@ -246,8 +251,8 @@ BlockPos blockpos = p_180655_3_.func_177977_b(); BlockState blockstate = p_180655_2_.func_180495_p(blockpos); @@ -119,7 +119,7 @@ for(int j = 0; j < 2; ++j) { double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F; double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -255,7 +260,7 @@ +@@ -256,7 +261,7 @@ } } @@ -128,7 +128,7 @@ for(int k = 0; k < 2; ++k) { double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F; double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -264,7 +269,7 @@ +@@ -265,7 +270,7 @@ } } @@ -137,7 +137,7 @@ for(int l = 0; l < 2; ++l) { double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble(); double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -273,7 +278,7 @@ +@@ -274,7 +279,7 @@ } } @@ -146,7 +146,7 @@ for(int i1 = 0; i1 < 2; ++i1) { double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble(); double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -282,7 +287,7 @@ +@@ -283,7 +288,7 @@ } } @@ -155,7 +155,7 @@ for(int j1 = 0; j1 < 2; ++j1) { double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble(); double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F; -@@ -310,10 +315,23 @@ +@@ -311,10 +316,23 @@ } public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) { diff --git a/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch b/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch index b67196800..0909d974f 100644 --- a/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/NetherPortalBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/NetherPortalBlock.java +++ b/net/minecraft/block/NetherPortalBlock.java -@@ -68,7 +68,7 @@ +@@ -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_); diff --git a/patches/minecraft/net/minecraft/block/TrapDoorBlock.java.patch b/patches/minecraft/net/minecraft/block/TrapDoorBlock.java.patch index 3e251755e..69106a3e3 100644 --- a/patches/minecraft/net/minecraft/block/TrapDoorBlock.java.patch +++ b/patches/minecraft/net/minecraft/block/TrapDoorBlock.java.patch @@ -1,10 +1,9 @@ --- a/net/minecraft/block/TrapDoorBlock.java +++ b/net/minecraft/block/TrapDoorBlock.java -@@ -151,4 +151,14 @@ - +@@ -153,6 +153,16 @@ return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); } -+ + + @Override + public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { + if (state.func_177229_b(field_176283_b)) { @@ -14,4 +13,7 @@ + } + return false; + } - } ++ + public boolean func_220067_a(BlockState p_220067_1_, IBlockReader p_220067_2_, BlockPos p_220067_3_, EntityType p_220067_4_) { + return false; + } diff --git a/patches/minecraft/net/minecraft/block/TurtleEggBlock.java.patch b/patches/minecraft/net/minecraft/block/TurtleEggBlock.java.patch new file mode 100644 index 000000000..997a6c3f2 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/TurtleEggBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/block/TurtleEggBlock.java ++++ b/net/minecraft/block/TurtleEggBlock.java +@@ -146,7 +146,7 @@ + if (p_212570_2_ instanceof TurtleEntity) { + return false; + } else { +- return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? p_212570_1_.func_82736_K().func_223586_b(GameRules.field_223599_b) : true; ++ return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_) : true; + } + } + } diff --git a/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch b/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch index 8ebf9a4ad..6e278597a 100644 --- a/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch +++ b/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch @@ -24,9 +24,9 @@ Screen.wrapScreenError(() -> { if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) { if (p_197961_5_ == 0) { -- aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_); +- aboolean[0] = inestedguieventhandler.func_223281_a_(p_197961_3_, p_197961_4_, p_197961_6_); + aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_); -+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_); ++ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.func_223281_a_(p_197961_3_, p_197961_4_, p_197961_6_); + if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_); } } else { diff --git a/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch index bab84e9e8..1816597ec 100644 --- a/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screen/MainMenuScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screen/MainMenuScreen.java +++ b/net/minecraft/client/gui/screen/MainMenuScreen.java -@@ -58,6 +58,7 @@ +@@ -51,6 +51,7 @@ private final RenderSkybox field_209101_K = new RenderSkybox(field_213098_a); private final boolean field_213102_y; private long field_213103_z; @@ -8,7 +8,7 @@ public MainMenuScreen() { this(false); -@@ -108,10 +109,14 @@ +@@ -98,10 +99,14 @@ this.field_193979_N = this.width - this.field_193978_M - 2; int i = 24; int j = this.height / 4 + 48; @@ -23,7 +23,7 @@ } this.addButton(new ImageButton(this.width / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.WIDGETS_LOCATION, 256, 256, (p_213090_1_) -> { -@@ -146,6 +151,7 @@ +@@ -130,6 +135,7 @@ if (this.func_183501_a()) { this.field_183503_M.init(this.minecraft, this.width, this.height); } @@ -31,7 +31,7 @@ } -@@ -156,7 +162,7 @@ +@@ -140,7 +146,7 @@ this.addButton(new Button(this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, 200, 20, I18n.func_135052_a("menu.multiplayer"), (p_213086_1_) -> { this.minecraft.func_147108_a(new MultiplayerScreen(this)); })); @@ -40,7 +40,7 @@ this.func_140005_i(); })); } -@@ -220,6 +226,7 @@ +@@ -204,6 +210,7 @@ this.minecraft.func_110434_K().func_110577_a(field_194400_H); blit(j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16); @@ -48,7 +48,7 @@ if (this.field_73975_c != null) { GlStateManager.pushMatrix(); GlStateManager.translatef((float)(this.width / 2 + 90), 70.0F, 0.0F); -@@ -238,7 +245,10 @@ +@@ -222,7 +229,10 @@ s = s + ("release".equalsIgnoreCase(this.minecraft.func_184123_d()) ? "" : "/" + this.minecraft.func_184123_d()); } @@ -60,7 +60,7 @@ this.drawString(this.font, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.height - 10, 16777215 | l); if (p_render_1_ > this.field_193979_N && p_render_1_ < this.field_193979_N + this.field_193978_M && p_render_2_ > this.height - 10 && p_render_2_ < this.height) { fill(this.field_193979_N, this.height - 1, this.field_193979_N + this.field_193978_M, this.height, 16777215 | l); -@@ -258,6 +268,7 @@ +@@ -240,6 +250,7 @@ if (this.func_183501_a() && f1 >= 1.0F) { this.field_183503_M.render(p_render_1_, p_render_2_, p_render_3_); } 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 b75f19b4f..6397d10b7 100644 --- a/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/network/play/ClientPlayNetHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/network/play/ClientPlayNetHandler.java +++ b/net/minecraft/client/network/play/ClientPlayNetHandler.java -@@ -712,7 +712,7 @@ +@@ -711,7 +711,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) { @@ -9,7 +9,7 @@ } } -@@ -784,7 +784,9 @@ +@@ -783,7 +783,9 @@ public void func_147251_a(SChatPacket p_147251_1_) { PacketThreadUtil.func_218797_a(p_147251_1_, this, this.field_147299_f); @@ -20,7 +20,7 @@ } public void func_147279_a(SAnimateHandPacket p_147279_1_) { -@@ -956,6 +958,7 @@ +@@ -955,6 +957,7 @@ this.field_147299_f.field_71439_g = clientplayerentity1; this.field_147299_f.field_175622_Z = clientplayerentity1; clientplayerentity1.func_184212_Q().func_187218_a(clientplayerentity.func_184212_Q().func_187231_c()); @@ -28,7 +28,7 @@ clientplayerentity1.func_70065_x(); clientplayerentity1.func_175158_f(s); this.field_147300_g.func_217408_a(i, clientplayerentity1); -@@ -1078,6 +1081,12 @@ +@@ -1077,6 +1080,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) { tileentity.func_145839_a(p_147273_1_.func_148857_g()); @@ -41,7 +41,7 @@ } if (flag && this.field_147299_f.field_71462_r instanceof CommandBlockScreen) { -@@ -1252,6 +1261,7 @@ +@@ -1246,6 +1255,7 @@ clientrecipebook.func_199644_c(); clientrecipebook.func_199642_d().forEach(imutablesearchtree::func_217872_a); imutablesearchtree.func_194040_a(); @@ -49,7 +49,7 @@ } public void func_200232_a(SPlayerLookPacket p_200232_1_) { -@@ -1332,7 +1342,7 @@ +@@ -1326,7 +1336,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) { @@ -58,7 +58,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()); -@@ -1757,10 +1767,12 @@ +@@ -1759,10 +1769,12 @@ this.field_147299_f.field_184132_p.field_217741_m.func_217692_a(pointofinterestdebugrenderer$braininfo); } else { diff --git a/patches/minecraft/net/minecraft/client/particle/Particle.java.patch b/patches/minecraft/net/minecraft/client/particle/Particle.java.patch deleted file mode 100644 index f25ad0581..000000000 --- a/patches/minecraft/net/minecraft/client/particle/Particle.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/net/minecraft/client/particle/Particle.java -+++ b/net/minecraft/client/particle/Particle.java -@@ -156,6 +156,7 @@ - public void func_187110_a(double p_187110_1_, double p_187110_3_, double p_187110_5_) { - double d0 = p_187110_1_; - double d1 = p_187110_3_; -+ double origZ = p_187110_5_; - if (this.field_190017_n && p_187110_1_ != 0.0D || p_187110_3_ != 0.0D || p_187110_5_ != 0.0D) { - Vec3d vec3d = Entity.func_213313_a(new Vec3d(p_187110_1_, p_187110_3_, p_187110_5_), this.func_187116_l(), this.field_187122_b, ISelectionContext.func_216377_a(), new ReuseableStream<>(Stream.empty())); - p_187110_1_ = vec3d.field_72450_a; -@@ -173,7 +174,7 @@ - this.field_187129_i = 0.0D; - } - -- if (p_187110_5_ != p_187110_5_) { -+ if (origZ != p_187110_5_) { - this.field_187131_k = 0.0D; - } - diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index 92a25fb48..dffde2cbc 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -60,7 +60,7 @@ + renderer.render(p_195465_1_, field_72769_h, field_72777_q); + return; + } - if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.THE_END) { + if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.field_223229_c_) { this.func_180448_r(); } else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { @@ -1113,6 +1122,7 @@ 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 a422103e1..9d7a3e4e0 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch @@ -4,15 +4,15 @@ private Vec3d field_217672_l = Vec3d.field_186680_a; public ChunkRenderDispatcher(boolean p_i51518_1_) { -+ this(p_i51518_1_,-1); ++ this(p_i51518_1_, -1); + } + + public ChunkRenderDispatcher(boolean p_i51518_1_, int countRenderBuilders) { int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760 - 1); int j = Runtime.getRuntime().availableProcessors(); int k = p_i51518_1_ ? j : Math.min(j, 4); -- int l = Math.max(1, Math.min(k * 3, i)); -+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k * 3, i)) : countRenderBuilders; +- int l = Math.max(1, Math.min(k * 2, i)); ++ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k * 2, i)) : countRenderBuilders; this.field_178525_i = new ChunkRenderWorker(this, new RegionRenderCacheBuilder()); List list = Lists.newArrayListWithExpectedSize(l); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/PlayerRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/PlayerRenderer.java.patch index b9ddd8c4a..bc345bf8b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/PlayerRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/PlayerRenderer.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/client/renderer/entity/PlayerRenderer.java @@ -52,6 +52,7 @@ public void func_76986_a(AbstractClientPlayerEntity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { - if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_217783_c.func_216773_g() == p_76986_1_) { + if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_217783_c != null && this.field_76990_c.field_217783_c.func_216773_g() == p_76986_1_) { double d0 = p_76986_4_; + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return; if (p_76986_1_.func_213287_bg()) { diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java.patch index e3ac56bf2..1cedcfd30 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java +++ b/net/minecraft/client/renderer/tileentity/PistonTileEntityRenderer.java -@@ -67,6 +67,7 @@ +@@ -70,6 +70,7 @@ } private boolean func_188186_a(BlockPos p_188186_1_, BlockState p_188186_2_, BufferBuilder p_188186_3_, World p_188186_4_, boolean p_188186_5_) { diff --git a/patches/minecraft/net/minecraft/client/resources/JsonReloadListener.java.patch b/patches/minecraft/net/minecraft/client/resources/JsonReloadListener.java.patch new file mode 100644 index 000000000..769f14d8c --- /dev/null +++ b/patches/minecraft/net/minecraft/client/resources/JsonReloadListener.java.patch @@ -0,0 +1,11 @@ +--- 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/minecraft/net/minecraft/client/world/ClientWorld.java.patch b/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch index c5a43fa67..5d21914dc 100644 --- a/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/world/ClientWorld.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/world/ClientWorld.java +++ b/net/minecraft/client/world/ClientWorld.java -@@ -86,6 +86,8 @@ +@@ -87,6 +87,8 @@ this.func_175652_B(new BlockPos(8, 64, 8)); this.func_72966_v(); this.func_72947_a(); @@ -9,7 +9,7 @@ } public void func_72835_b(BooleanSupplier p_72835_1_) { -@@ -110,6 +112,7 @@ +@@ -111,6 +113,7 @@ Entity entity = this.field_217428_a.get(i); this.func_217390_a((p_217415_0_) -> { ++p_217415_0_.field_70173_aa; @@ -17,7 +17,7 @@ p_217415_0_.func_70071_h_(); }, entity); if (entity.field_70128_L) { -@@ -157,6 +160,7 @@ +@@ -158,6 +161,7 @@ this.func_217381_Z().func_194340_a(() -> { return Registry.field_212629_r.func_177774_c(p_217418_1_.func_200600_R()).toString(); }); @@ -25,7 +25,7 @@ p_217418_1_.func_70071_h_(); this.func_217381_Z().func_76319_b(); } -@@ -264,9 +268,11 @@ +@@ -265,9 +269,11 @@ } private void func_217424_b(int p_217424_1_, Entity p_217424_2_) { @@ -37,7 +37,7 @@ } public void func_217413_d(int p_217413_1_) { -@@ -285,6 +291,7 @@ +@@ -286,6 +292,7 @@ } this.field_217431_w.remove(p_217414_1_); @@ -45,7 +45,7 @@ } public void func_217417_b(Chunk p_217417_1_) { -@@ -410,6 +417,11 @@ +@@ -411,6 +418,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_) { @@ -57,7 +57,7 @@ if (p_184148_1_ == this.field_73037_M.field_71439_g) { this.func_184134_a(p_184148_2_, p_184148_4_, p_184148_6_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_, false); } -@@ -417,6 +429,11 @@ +@@ -418,6 +430,11 @@ } public void func_217384_a(@Nullable PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) { diff --git a/patches/minecraft/net/minecraft/data/TagsProvider.java.patch b/patches/minecraft/net/minecraft/data/TagsProvider.java.patch deleted file mode 100644 index a9cff0bf4..000000000 --- a/patches/minecraft/net/minecraft/data/TagsProvider.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/net/minecraft/data/TagsProvider.java -+++ b/net/minecraft/data/TagsProvider.java -@@ -41,17 +41,27 @@ - return Optional.empty(); - }, "", false, "generated"); - -- for(Entry, Tag.Builder> entry : this.field_200434_b.entrySet()) { -- ResourceLocation resourcelocation = entry.getKey().func_199886_b(); -- if (!entry.getValue().func_200160_a(tagcollection::func_199910_a)) { -- throw new UnsupportedOperationException("Unsupported referencing of tags!"); -+ //This does not support resolving nested tags of ResourceLocation type entries. -+ //So we must do this in multiple passes, and error if we have a pass that doesn't resolve anything. -+ java.util.Set> pending = new java.util.HashSet<>(this.field_200434_b.keySet()); -+ java.util.Set> processed = new java.util.HashSet<>(); -+ -+ do { -+ pending.removeAll(processed); -+ processed.clear(); -+ for (Tag key : pending) { -+ Tag.Builder value = this.field_200434_b.get(key); -+ ResourceLocation resourcelocation = key.func_199886_b(); -+ if (!value.func_200160_a(tagcollection::func_199910_a)) { -+ continue; - } - -- Tag tag = entry.getValue().func_200051_a(resourcelocation); -+ Tag tag = value.func_200051_a(resourcelocation); - JsonObject jsonobject = tag.func_200571_a(this.field_200435_c::func_177774_c); - Path path = this.func_200431_a(resourcelocation); - tagcollection.func_199912_a(tag); - this.func_200429_a(tagcollection); -+ processed.add(key); - - try { - String s = field_200437_e.toJson((JsonElement)jsonobject); -@@ -69,7 +79,11 @@ - field_200436_d.error("Couldn't save tags to {}", path, ioexception); - } - } -+ } while (!processed.isEmpty() && !pending.isEmpty()); - -+ if (!pending.isEmpty()) { -+ throw new UnsupportedOperationException("Failed to resolve tags: " + pending.stream().map(Tag::func_199886_b).map(Object::toString).sorted().collect(java.util.stream.Collectors.joining(", "))); -+ } - } - - protected abstract void func_200429_a(TagCollection p_200429_1_); diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch index bee3bcbde..9fb0bac15 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -9,7 +9,7 @@ private final EquipmentSlotType[] field_185263_a; private final Enchantment.Rarity field_77333_a; @Nullable -@@ -110,7 +110,7 @@ +@@ -114,7 +114,7 @@ } public boolean func_92089_a(ItemStack p_92089_1_) { @@ -18,7 +18,7 @@ } public void func_151368_a(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) { -@@ -127,12 +127,31 @@ +@@ -131,6 +131,24 @@ return false; } @@ -41,12 +41,5 @@ + } + public static enum Rarity { - COMMON(30), - UNCOMMON(10), - RARE(3), - VERY_RARE(1); - -+ - private final int field_185275_e; - - private Rarity(int p_i47026_3_) { + COMMON(10), + UNCOMMON(5), diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 8ecce0382..7dcf52ead 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/enchantment/EnchantmentHelper.java +++ b/net/minecraft/enchantment/EnchantmentHelper.java -@@ -257,7 +257,7 @@ +@@ -258,7 +258,7 @@ public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) { Item item = p_77514_3_.func_77973_b(); @@ -9,7 +9,7 @@ if (i <= 0) { return 0; } else { -@@ -295,7 +295,7 @@ +@@ -296,7 +296,7 @@ public static List func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) { List list = Lists.newArrayList(); Item item = p_77513_1_.func_77973_b(); @@ -18,12 +18,12 @@ if (i <= 0) { return list; } else { -@@ -354,7 +354,7 @@ +@@ -349,7 +349,7 @@ boolean flag = p_185291_1_.func_77973_b() == Items.field_151122_aG; for(Enchantment enchantment : Registry.field_212628_q) { - if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.field_77351_y.func_77557_a(item) || flag)) { + if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) { for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) { - if (p_185291_0_ >= enchantment.func_77321_a(i)) { + if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) { list.add(new EnchantmentData(enchantment, i)); diff --git a/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch index aca17f7fd..9bb4a1ab4 100644 --- a/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/FrostWalkerEnchantment.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/enchantment/FrostWalkerEnchantment.java +++ b/net/minecraft/enchantment/FrostWalkerEnchantment.java -@@ -38,9 +38,10 @@ +@@ -42,9 +42,10 @@ if (blockpos.func_218137_a(p_185266_0_.func_213303_ch(), (double)f)) { blockpos$mutableblockpos.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$mutableblockpos); diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index 7e85ffbd4..6214e059c 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/Entity.java +++ b/net/minecraft/entity/Entity.java -@@ -103,12 +103,13 @@ +@@ -104,12 +104,13 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -15,7 +15,7 @@ private final EntityType field_200606_g; private int field_145783_c = field_213331_b.incrementAndGet(); public boolean field_70156_m; -@@ -135,6 +136,7 @@ +@@ -136,6 +137,7 @@ public boolean field_70132_H; public boolean field_70133_I; protected Vec3d field_213328_B = Vec3d.field_186680_a; @@ -23,7 +23,7 @@ public boolean field_70128_L; public float field_70141_P; public float field_70140_Q; -@@ -196,6 +198,7 @@ +@@ -197,6 +199,7 @@ private float field_213326_aJ; public Entity(EntityType p_i48580_1_, World p_i48580_2_) { @@ -31,7 +31,7 @@ this.field_200606_g = p_i48580_1_; this.field_70170_p = p_i48580_2_; this.field_213325_aI = p_i48580_1_.func_220334_j(); -@@ -213,7 +216,9 @@ +@@ -214,7 +217,9 @@ this.field_70180_af.func_187214_a(field_189655_aD, false); this.field_70180_af.func_187214_a(field_213330_X, Pose.STANDING); this.func_70088_a(); @@ -42,7 +42,7 @@ } public boolean func_175149_v() { -@@ -302,7 +307,13 @@ +@@ -303,7 +308,13 @@ } public void func_70106_y() { @@ -56,7 +56,7 @@ } protected void func_213301_b(Pose p_213301_1_) { -@@ -322,6 +333,7 @@ +@@ -323,6 +334,7 @@ this.field_70165_t = p_70107_1_; this.field_70163_u = p_70107_3_; this.field_70161_v = p_70107_5_; @@ -64,7 +64,7 @@ float f = this.field_213325_aI.field_220315_a / 2.0F; float f1 = this.field_213325_aI.field_220316_b; this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f)); -@@ -487,7 +499,7 @@ +@@ -496,7 +508,7 @@ int k = MathHelper.func_76128_c(this.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -73,7 +73,7 @@ BlockPos blockpos1 = blockpos.func_177977_b(); BlockState blockstate1 = this.field_70170_p.func_180495_p(blockpos1); Block block = blockstate1.func_177230_c(); -@@ -526,7 +538,7 @@ +@@ -535,7 +547,7 @@ this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(func_213296_b(vec3d)) * 0.6D); this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d2 * d2 + d0 * d0 + d1 * d1) * 0.6D); @@ -82,7 +82,7 @@ this.field_70150_b = this.func_203009_ad(); if (this.func_70090_H()) { Entity entity = this.func_184207_aI() && this.func_184179_bs() != null ? this.func_184179_bs() : this; -@@ -541,7 +553,7 @@ +@@ -550,7 +562,7 @@ } else { this.func_180429_a(blockpos, blockstate); } @@ -91,7 +91,7 @@ this.field_191959_ay = this.func_191954_d(this.field_82151_R); } } -@@ -743,6 +755,7 @@ +@@ -792,6 +804,7 @@ this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D; this.field_70163_u = axisalignedbb.field_72338_b; this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D; @@ -99,7 +99,7 @@ } protected SoundEvent func_184184_Z() { -@@ -795,7 +808,7 @@ +@@ -844,7 +857,7 @@ protected void func_180429_a(BlockPos p_180429_1_, BlockState p_180429_2_) { if (!p_180429_2_.func_185904_a().func_76224_d()) { BlockState blockstate = this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()); @@ -108,7 +108,7 @@ this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b()); } } -@@ -991,6 +1004,7 @@ +@@ -1040,6 +1053,7 @@ int k = MathHelper.func_76128_c(this.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -116,7 +116,7 @@ if (blockstate.func_185901_i() != BlockRenderType.INVISIBLE) { Vec3d vec3d = this.func_213322_ci(); this.field_70170_p.func_195594_a(new BlockParticleData(ParticleTypes.field_197611_d, blockstate), this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_213325_aI.field_220315_a, this.field_70163_u + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_213325_aI.field_220315_a, vec3d.field_72450_a * -4.0D, 1.5D, vec3d.field_72449_c * -4.0D); -@@ -1012,7 +1026,7 @@ +@@ -1061,7 +1075,7 @@ return false; } else { IFluidState ifluidstate = this.field_70170_p.func_204610_c(blockpos); @@ -125,7 +125,7 @@ } } } -@@ -1083,6 +1097,7 @@ +@@ -1132,6 +1146,7 @@ this.field_70126_B -= 360.0F; } @@ -133,7 +133,7 @@ this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); this.func_70101_b(p_70080_7_, p_70080_8_); } -@@ -1319,6 +1334,7 @@ +@@ -1368,6 +1383,7 @@ if (this.field_184238_ar) { p_189511_1_.func_74757_a("Glowing", this.field_184238_ar); } @@ -141,7 +141,7 @@ if (!this.field_184236_aF.isEmpty()) { ListNBT listnbt = new ListNBT(); -@@ -1330,6 +1346,10 @@ +@@ -1379,6 +1395,10 @@ p_189511_1_.func_218657_a("Tags", listnbt); } @@ -152,7 +152,7 @@ this.func_213281_b(p_189511_1_); if (this.func_184207_aI()) { ListNBT listnbt1 = new ListNBT(); -@@ -1406,6 +1426,9 @@ +@@ -1455,6 +1475,9 @@ this.func_174810_b(p_70020_1_.func_74767_n("Silent")); this.func_189654_d(p_70020_1_.func_74767_n("NoGravity")); this.func_184195_f(p_70020_1_.func_74767_n("Glowing")); @@ -162,7 +162,7 @@ if (p_70020_1_.func_150297_b("Tags", 9)) { this.field_184236_aF.clear(); ListNBT listnbt1 = p_70020_1_.func_150295_c("Tags", 8); -@@ -1494,6 +1517,8 @@ +@@ -1543,6 +1566,8 @@ } else { ItemEntity itementity = new ItemEntity(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_); itementity.func_174869_p(); @@ -171,7 +171,7 @@ this.field_70170_p.func_217376_c(itementity); return itementity; } -@@ -1537,6 +1562,7 @@ +@@ -1586,6 +1611,7 @@ public void func_70098_U() { this.func_213317_d(Vec3d.field_186680_a); @@ -179,7 +179,7 @@ this.func_70071_h_(); if (this.func_184218_aH()) { this.func_184187_bx().func_184232_k(this); -@@ -1577,6 +1603,7 @@ +@@ -1626,6 +1652,7 @@ } } @@ -187,7 +187,7 @@ if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) { if (this.func_184218_aH()) { this.func_184210_p(); -@@ -1608,6 +1635,7 @@ +@@ -1657,6 +1684,7 @@ public void func_184210_p() { if (this.field_184239_as != null) { Entity entity = this.field_184239_as; @@ -195,7 +195,7 @@ this.field_184239_as = null; entity.func_184225_p(this); } -@@ -1758,6 +1786,7 @@ +@@ -1807,6 +1835,7 @@ return !this.func_184188_bt().isEmpty(); } @@ -203,7 +203,7 @@ public boolean func_205710_ba() { return true; } -@@ -1956,7 +1985,7 @@ +@@ -2005,7 +2034,7 @@ func_207712_c(itextcomponent1); return itextcomponent1; } else { @@ -212,7 +212,7 @@ } } -@@ -2014,6 +2043,7 @@ +@@ -2063,6 +2092,7 @@ @Nullable public Entity func_212321_a(DimensionType p_212321_1_) { @@ -220,28 +220,27 @@ if (!this.field_70170_p.field_72995_K && !this.field_70128_L) { this.field_70170_p.func_217381_Z().func_76320_a("changeDimension"); MinecraftServer minecraftserver = this.func_184102_h(); -@@ -2031,17 +2061,9 @@ - } else if (p_212321_1_ == DimensionType.THE_END) { +@@ -2080,16 +2110,9 @@ + } else if (p_212321_1_ == DimensionType.field_223229_c_) { blockpos = serverworld1.func_180504_m(); } else { - double d0 = this.field_70165_t; - double d1 = this.field_70161_v; - double d2 = 8.0D; -- if (dimensiontype == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.NETHER) { +- if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223228_b_) { - d0 /= 8.0D; - d1 /= 8.0D; -- } else if (dimensiontype == DimensionType.NETHER && p_212321_1_ == DimensionType.OVERWORLD) { +- } else if (dimensiontype == DimensionType.field_223228_b_ && p_212321_1_ == DimensionType.field_223227_a_) { - d0 *= 8.0D; - d1 *= 8.0D; - } -- + double movementFactor = serverworld.func_201675_m().getMovementFactor() / serverworld1.func_201675_m().getMovementFactor(); + double d0 = this.field_70165_t * movementFactor; + double d1 = this.field_70161_v * movementFactor; + double d3 = Math.min(-2.9999872E7D, serverworld1.func_175723_af().func_177726_b() + 16.0D); double d4 = Math.min(-2.9999872E7D, serverworld1.func_175723_af().func_177736_c() + 16.0D); - double d5 = Math.min(2.9999872E7D, serverworld1.func_175723_af().func_177728_d() - 16.0D); -@@ -2069,7 +2091,6 @@ +@@ -2118,7 +2141,6 @@ serverworld1.func_217460_e(entity); } @@ -249,7 +248,7 @@ this.field_70170_p.func_217381_Z().func_76319_b(); serverworld.func_82742_i(); serverworld1.func_82742_i(); -@@ -2225,7 +2246,7 @@ +@@ -2274,7 +2296,7 @@ Pose pose = this.func_213283_Z(); EntitySize entitysize1 = this.func_213305_a(pose); this.field_213325_aI = entitysize1; @@ -258,7 +257,7 @@ if (entitysize1.field_220315_a < entitysize.field_220315_a) { double d0 = (double)entitysize1.field_220315_a / 2.0D; this.func_174826_a(new AxisAlignedBB(this.field_70165_t - d0, this.field_70163_u, this.field_70161_v - d0, this.field_70165_t + d0, this.field_70163_u + (double)entitysize1.field_220316_b, this.field_70161_v + d0)); -@@ -2592,6 +2613,7 @@ +@@ -2641,6 +2663,7 @@ return this.field_211517_W; } @@ -266,7 +265,7 @@ public final float func_213311_cf() { return this.field_213325_aI.field_220315_a; } -@@ -2621,4 +2643,69 @@ +@@ -2670,4 +2693,69 @@ public void func_213293_j(double p_213293_1_, double p_213293_3_, double p_213293_5_) { this.func_213317_d(new Vec3d(p_213293_1_, p_213293_3_, p_213293_5_)); } @@ -329,7 +328,7 @@ + this.field_70128_L = false; + this.reviveCaps(); + } -+ ++ + private float getEyeHeightForge(Pose pose, EntitySize size) { + net.minecraftforge.event.entity.EntityEvent.EyeHeight evt = new net.minecraftforge.event.entity.EntityEvent.EyeHeight(this, pose, size, this.func_213316_a(pose, size)); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(evt); diff --git a/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch b/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch index 601da6d52..2a51a8f7f 100644 --- a/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch @@ -1,33 +1,27 @@ --- a/net/minecraft/entity/EntitySpawnPlacementRegistry.java +++ b/net/minecraft/entity/EntitySpawnPlacementRegistry.java -@@ -9,6 +9,7 @@ - private static final Map, EntitySpawnPlacementRegistry.Entry> field_209347_a = Maps.newHashMap(); - - public static void func_209343_a(EntityType p_209343_0_, EntitySpawnPlacementRegistry.PlacementType p_209343_1_, Heightmap.Type p_209343_2_) { -+ if (field_209347_a.containsKey(p_209343_0_)) throw new IllegalArgumentException("Invalid register call, " + p_209343_0_ + " already registered."); - field_209347_a.put(p_209343_0_, new EntitySpawnPlacementRegistry.Entry(p_209343_2_, p_209343_1_)); - } - -@@ -87,8 +88,23 @@ - } +@@ -141,9 +141,25 @@ + boolean test(EntityType p_test_1_, IWorld p_test_2_, SpawnReason p_test_3_, BlockPos p_test_4_, Random p_test_5_); } - public static enum PlacementType { + public static enum PlacementType implements net.minecraftforge.common.IExtensibleEnum { ON_GROUND, - IN_WATER; + IN_WATER, + NO_RESTRICTIONS; + -+ public static PlacementType create(String name, net.minecraftforge.common.util.TriPredicate> predicate) { ++ public static PlacementType create(String name, net.minecraftforge.common.util.TriPredicate> predicate) { + throw new IllegalStateException("Enum not extended"); + } + -+ private net.minecraftforge.common.util.TriPredicate> predicate; ++ private net.minecraftforge.common.util.TriPredicate> predicate; + private PlacementType() { this(null); } -+ private PlacementType(net.minecraftforge.common.util.TriPredicate> predicate) { ++ private PlacementType(net.minecraftforge.common.util.TriPredicate> predicate) { + this.predicate = predicate; + } + -+ public boolean canSpawnAt(net.minecraft.world.IWorldReader world, net.minecraft.util.math.BlockPos pos, EntityType type) { ++ public boolean canSpawnAt(net.minecraft.world.IWorldReader world, BlockPos pos, EntityType type) { ++ if (this == NO_RESTRICTIONS) return true; + if (predicate == null) return net.minecraft.world.spawner.WorldEntitySpawner.canSpawnAtBody(this, world, pos, type); + return predicate.test(world, pos, type); + } diff --git a/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch b/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch index ab6a3d827..d66b70552 100644 --- a/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/LivingEntity.java +++ b/net/minecraft/entity/LivingEntity.java -@@ -104,6 +104,8 @@ +@@ -105,6 +105,8 @@ public abstract class LivingEntity extends Entity { private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); private static final AttributeModifier field_110157_c = (new AttributeModifier(field_110156_b, "Sprinting speed boost", (double)0.3F, AttributeModifier.Operation.MULTIPLY_TOTAL)).func_111168_a(false); @@ -9,7 +9,7 @@ protected static final DataParameter field_184621_as = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187191_a); private static final DataParameter field_184632_c = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187193_c); private static final DataParameter field_184633_f = EntityDataManager.func_187226_a(LivingEntity.class, DataSerializers.field_187192_b); -@@ -227,6 +229,8 @@ +@@ -228,6 +230,8 @@ this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111263_d); this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188791_g); this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_189429_h); @@ -18,7 +18,7 @@ } protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, BlockState p_184231_4_, BlockPos p_184231_5_) { -@@ -236,9 +240,10 @@ +@@ -237,9 +241,10 @@ if (!this.field_70170_p.field_72995_K && this.field_70143_R > 3.0F && p_184231_3_) { float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F); @@ -30,7 +30,7 @@ ((ServerWorld)this.field_70170_p).func_195598_a(new BlockParticleData(ParticleTypes.field_197611_d, p_184231_4_), this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, (double)0.15F); } } -@@ -302,7 +307,7 @@ +@@ -303,7 +308,7 @@ } } @@ -39,15 +39,15 @@ this.func_184210_p(); } } else if (this.func_70086_ai() < this.func_205010_bg()) { -@@ -387,6 +392,7 @@ - if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot"))) { +@@ -388,6 +393,7 @@ + if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e))) { int i = this.func_70693_a(this.field_70717_bb); + i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.field_70717_bb, i); while(i > 0) { int j = ExperienceOrbEntity.func_70527_a(i); i -= j; -@@ -589,7 +595,7 @@ +@@ -590,7 +596,7 @@ Effect effect = iterator.next(); EffectInstance effectinstance = this.field_70713_bf.get(effect); if (!effectinstance.func_76455_a(this)) { @@ -56,7 +56,7 @@ iterator.remove(); this.func_70688_c(effectinstance); } -@@ -639,8 +645,10 @@ +@@ -640,8 +646,10 @@ this.func_82142_c(false); } else { Collection collection = this.field_70713_bf.values(); @@ -69,7 +69,7 @@ this.func_82142_c(this.func_70644_a(Effects.field_76441_p)); } -@@ -704,7 +712,10 @@ +@@ -705,7 +713,10 @@ boolean flag; for(flag = false; iterator.hasNext(); flag = true) { @@ -81,7 +81,7 @@ iterator.remove(); } -@@ -734,6 +745,7 @@ +@@ -735,6 +746,7 @@ return false; } else { EffectInstance effectinstance = this.field_70713_bf.get(p_195064_1_.func_188419_a()); @@ -89,17 +89,17 @@ if (effectinstance == null) { this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_); this.func_70670_a(p_195064_1_); -@@ -748,6 +760,9 @@ +@@ -749,6 +761,9 @@ } public boolean func_70687_e(EffectInstance p_70687_1_) { + 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); + if (event.getResult() != net.minecraftforge.eventbus.api.Event.Result.DEFAULT) return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW; - if (this.func_70668_bt() == CreatureAttribute.UNDEAD) { + if (this.func_70668_bt() == CreatureAttribute.field_223223_b_) { Effect effect = p_70687_1_.func_188419_a(); if (effect == Effects.field_76428_l || effect == Effects.field_76436_u) { -@@ -768,6 +783,7 @@ +@@ -769,6 +784,7 @@ } public boolean func_195063_d(Effect p_195063_1_) { @@ -107,7 +107,7 @@ EffectInstance effectinstance = this.func_184596_c(p_195063_1_); if (effectinstance != null) { this.func_70688_c(effectinstance); -@@ -804,6 +820,8 @@ +@@ -805,6 +821,8 @@ } public void func_70691_i(float p_70691_1_) { @@ -116,7 +116,7 @@ float f = this.func_110143_aJ(); if (f > 0.0F) { this.func_70606_j(f + p_70691_1_); -@@ -820,6 +838,7 @@ +@@ -821,6 +839,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -124,7 +124,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (this.field_70170_p.field_72995_K) { -@@ -886,8 +905,8 @@ +@@ -887,8 +906,8 @@ if (entity1 instanceof PlayerEntity) { this.field_70718_bc = 100; this.field_70717_bb = (PlayerEntity)entity1; @@ -135,7 +135,7 @@ if (wolfentity.func_70909_n()) { this.field_70718_bc = 100; LivingEntity livingentity = wolfentity.func_70902_q(); -@@ -1069,6 +1088,7 @@ +@@ -1070,6 +1089,7 @@ } public void func_70645_a(DamageSource p_70645_1_) { @@ -143,7 +143,16 @@ if (!this.field_70729_aU) { Entity entity = p_70645_1_.func_76346_g(); LivingEntity livingentity = this.func_94060_bK(); -@@ -1113,13 +1133,10 @@ +@@ -1091,7 +1111,7 @@ + this.func_213345_d(p_70645_1_); + boolean flag = false; + if (livingentity instanceof WitherEntity) { +- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { ++ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { + BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v); + BlockState blockstate = Blocks.field_222388_bz.func_176223_P(); + if (this.field_70170_p.func_180495_p(blockpos).func_196958_f() && blockstate.func_196955_c(this.field_70170_p, blockpos)) { +@@ -1114,13 +1134,10 @@ protected void func_213345_d(DamageSource p_213345_1_) { Entity entity = p_213345_1_.func_76346_g(); @@ -158,9 +167,9 @@ + this.captureDrops(new java.util.ArrayList<>()); + boolean flag = this.field_70718_bc > 0; - if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) { + if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223602_e)) { this.func_213354_a(p_213345_1_, flag); -@@ -1127,6 +1144,10 @@ +@@ -1128,6 +1145,10 @@ } this.func_213337_cE(); @@ -171,7 +180,7 @@ } protected void func_213337_cE() { -@@ -1156,6 +1177,9 @@ +@@ -1157,6 +1178,9 @@ } public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) { @@ -181,7 +190,7 @@ if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) { this.field_70160_al = true; Vec3d vec3d = this.func_213322_ci(); -@@ -1191,12 +1215,7 @@ +@@ -1192,12 +1216,7 @@ return false; } else { BlockState blockstate = this.func_213339_cH(); @@ -195,7 +204,7 @@ } } -@@ -1220,6 +1239,9 @@ +@@ -1221,6 +1240,9 @@ } public void func_180430_e(float p_180430_1_, float p_180430_2_) { @@ -205,7 +214,7 @@ super.func_180430_e(p_180430_1_, p_180430_2_); EffectInstance effectinstance = this.func_70660_b(Effects.field_76430_j); float f = effectinstance == null ? 0.0F : (float)(effectinstance.func_76458_c() + 1); -@@ -1232,7 +1254,7 @@ +@@ -1233,7 +1255,7 @@ int l = MathHelper.func_76128_c(this.field_70161_v); BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l)); if (!blockstate.func_196958_f()) { @@ -214,7 +223,7 @@ this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F); } } -@@ -1301,6 +1323,8 @@ +@@ -1302,6 +1324,8 @@ protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { if (!this.func_180431_b(p_70665_1_)) { @@ -223,7 +232,7 @@ p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); float f = p_70665_2_; -@@ -1311,10 +1335,11 @@ +@@ -1312,10 +1336,11 @@ ((ServerPlayerEntity)p_70665_1_.func_76346_g()).func_195067_a(Stats.field_212735_F, Math.round(f1 * 10.0F)); } @@ -236,7 +245,7 @@ this.func_110149_m(this.func_110139_bj() - p_70665_2_); } } -@@ -1356,6 +1381,8 @@ +@@ -1357,6 +1382,8 @@ } public void func_184609_a(Hand p_184609_1_) { @@ -245,7 +254,7 @@ if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) { this.field_110158_av = -1; this.field_82175_bq = true; -@@ -1714,15 +1741,16 @@ +@@ -1715,15 +1742,16 @@ } this.field_70160_al = true; @@ -264,7 +273,7 @@ } protected float func_189749_co() { -@@ -1785,7 +1813,7 @@ +@@ -1786,7 +1814,7 @@ } } else { BlockPos blockpos = new BlockPos(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v); @@ -273,7 +282,7 @@ float f7 = this.field_70122_E ? f5 * 0.91F : 0.91F; this.func_213309_a(this.func_213335_r(f5), p_213352_1_); this.func_213317_d(this.func_213362_f(this.func_213322_ci())); -@@ -1847,6 +1875,7 @@ +@@ -1848,6 +1876,7 @@ f = 0.96F; } @@ -281,7 +290,7 @@ this.func_213309_a(f1, p_213352_1_); this.func_213315_a(MoverType.SELF, this.func_213322_ci()); Vec3d vec3d1 = this.func_213322_ci(); -@@ -1922,6 +1951,7 @@ +@@ -1923,6 +1952,7 @@ } public void func_70071_h_() { @@ -289,7 +298,7 @@ super.func_70071_h_(); this.func_184608_ct(); this.func_205014_p(); -@@ -1953,7 +1983,9 @@ +@@ -1954,7 +1984,9 @@ ItemStack itemstack1 = this.func_184582_a(equipmentslottype); if (!ItemStack.func_77989_b(itemstack1, itemstack)) { @@ -299,7 +308,7 @@ if (!itemstack.func_190926_b()) { this.func_110140_aT().func_111148_a(itemstack.func_111283_C(equipmentslottype)); } -@@ -2402,13 +2434,22 @@ +@@ -2403,13 +2435,22 @@ protected void func_184608_ct() { if (this.func_184587_cr()) { @@ -324,7 +333,7 @@ this.func_71036_o(); } } else { -@@ -2442,8 +2483,10 @@ +@@ -2443,8 +2484,10 @@ public void func_184598_c(Hand p_184598_1_) { ItemStack itemstack = this.func_184586_b(p_184598_1_); if (!itemstack.func_190926_b() && !this.func_184587_cr()) { @@ -336,7 +345,7 @@ if (!this.field_70170_p.field_72995_K) { this.func_204802_c(1, true); this.func_204802_c(2, p_184598_1_ == Hand.OFF_HAND); -@@ -2503,6 +2546,9 @@ +@@ -2504,6 +2547,9 @@ vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F)); vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F)); vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v); @@ -346,7 +355,7 @@ this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c); } -@@ -2511,7 +2557,9 @@ +@@ -2512,7 +2558,9 @@ protected void func_71036_o() { if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) { this.func_184584_a(this.field_184627_bm, 16); @@ -357,7 +366,7 @@ this.func_184602_cy(); } -@@ -2531,6 +2579,7 @@ +@@ -2532,6 +2580,7 @@ public void func_184597_cx() { if (!this.field_184627_bm.func_190926_b()) { @@ -365,7 +374,7 @@ this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv()); if (this.field_184627_bm.func_222122_m()) { this.func_184608_ct(); -@@ -2686,16 +2735,16 @@ +@@ -2687,16 +2736,16 @@ private boolean func_213359_p() { return this.func_213374_dv().map((p_213347_1_) -> { @@ -386,7 +395,7 @@ BlockPos blockpos = p_213368_1_.func_177984_a(); return new Vec3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D); }); -@@ -2710,8 +2759,13 @@ +@@ -2711,8 +2760,13 @@ @Nullable @OnlyIn(Dist.CLIENT) public Direction func_213376_dz() { @@ -401,7 +410,7 @@ } public boolean func_70094_T() { -@@ -2778,4 +2832,58 @@ +@@ -2779,4 +2833,58 @@ public void func_213334_d(Hand p_213334_1_) { this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND); } diff --git a/patches/minecraft/net/minecraft/entity/MobEntity.java.patch b/patches/minecraft/net/minecraft/entity/MobEntity.java.patch index 305d8aca8..57221f435 100644 --- a/patches/minecraft/net/minecraft/entity/MobEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/MobEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/MobEntity.java +++ b/net/minecraft/entity/MobEntity.java -@@ -174,6 +174,7 @@ +@@ -176,6 +176,7 @@ public void func_70624_b(@Nullable LivingEntity p_70624_1_) { this.field_70696_bz = p_70624_1_; @@ -8,7 +8,7 @@ } public boolean func_213358_a(EntityType p_213358_1_) { -@@ -257,7 +258,6 @@ +@@ -259,7 +260,6 @@ } @@ -16,16 +16,16 @@ public void func_70103_a(byte p_70103_1_) { if (p_70103_1_ == 20) { this.func_70656_aK(); -@@ -456,7 +456,7 @@ +@@ -458,7 +458,7 @@ public void func_70636_d() { super.func_70636_d(); this.field_70170_p.func_217381_Z().func_76320_a("looting"); -- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { +- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { + if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && this.func_70089_S() && !this.field_70729_aU && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { for(ItemEntity itementity : this.field_70170_p.func_217357_a(ItemEntity.class, this.func_174813_aQ().func_72314_b(1.0D, 0.0D, 1.0D))) { if (!itementity.field_70128_L && !itementity.func_92059_d().func_190926_b() && !itementity.func_174874_s()) { this.func_175445_a(itementity); -@@ -546,6 +546,14 @@ +@@ -548,6 +548,14 @@ protected void func_70623_bb() { if (!this.func_104002_bU() && !this.func_213392_I()) { Entity entity = this.field_70170_p.func_217362_a(this, -1.0D); @@ -40,7 +40,7 @@ if (entity != null) { double d0 = entity.func_70068_e(this); if (d0 > 16384.0D && this.func_213397_c(d0)) { -@@ -784,6 +792,8 @@ +@@ -786,6 +794,8 @@ } public static EquipmentSlotType func_184640_d(ItemStack p_184640_0_) { @@ -49,7 +49,7 @@ Item item = p_184640_0_.func_77973_b(); if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof BlockItem) || !(((BlockItem)item).func_179223_d() instanceof AbstractSkullBlock))) { if (item instanceof ArmorItem) { -@@ -791,7 +801,7 @@ +@@ -793,7 +803,7 @@ } else if (item == Items.field_185160_cR) { return EquipmentSlotType.CHEST; } else { @@ -58,7 +58,7 @@ } } else { return EquipmentSlotType.HEAD; -@@ -1171,10 +1181,10 @@ +@@ -1173,10 +1183,10 @@ PlayerEntity playerentity = (PlayerEntity)p_70652_1_; ItemStack itemstack = this.func_184614_ca(); ItemStack itemstack1 = playerentity.func_184587_cr() ? playerentity.func_184607_cu() : ItemStack.field_190927_a; diff --git a/patches/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch b/patches/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch index 222ed27aa..eaf724d08 100644 --- a/patches/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java +++ b/net/minecraft/entity/ai/brain/memory/MemoryModuleType.java -@@ -15,7 +15,7 @@ +@@ -17,7 +17,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_220937_a("dummy", Optional.empty()); + 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/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch b/patches/minecraft/net/minecraft/entity/ai/brain/task/FarmTask.java.patch index 9d9577658..2c0f8b797 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 @@ -4,12 +4,12 @@ } protected boolean func_212832_a_(ServerWorld p_212832_1_, VillagerEntity p_212832_2_) { -- if (!p_212832_1_.func_82736_K().func_82766_b("mobGriefing")) { +- 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; -@@ -106,6 +106,11 @@ +@@ -130,6 +130,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; diff --git a/patches/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch b/patches/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch index f4f8c242d..464b98ec7 100644 --- a/patches/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/goal/BreakBlockGoal.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/entity/ai/goal/BreakBlockGoal.java +++ b/net/minecraft/entity/ai/goal/BreakBlockGoal.java -@@ -29,7 +29,7 @@ +@@ -30,7 +30,7 @@ } public boolean func_75250_a() { -- if (!this.field_203118_g.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { -+ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_203118_g.field_70170_p, this.field_203118_g) || !this.field_203118_g.field_70170_p.func_180495_p(this.field_179494_b).canEntityDestroy(this.field_203118_g.field_70170_p, this.field_179494_b, this.field_203118_g) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_203118_g, this.field_179494_b, this.field_203118_g.field_70170_p.func_180495_p(this.field_179494_b))) { +- 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/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch b/patches/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch index 5fdec51de..bc4230d67 100644 --- a/patches/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/goal/BreakDoorGoal.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/entity/ai/goal/BreakDoorGoal.java +++ b/net/minecraft/entity/ai/goal/BreakDoorGoal.java -@@ -28,7 +28,7 @@ +@@ -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_82766_b("mobGriefing")) { -+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75356_a.field_70170_p, this.field_75356_a) || !this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b).canEntityDestroy(this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_75356_a, this.field_179507_b, this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b))) { +- } 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/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch b/patches/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch index 51b300bee..f055c15d0 100644 --- a/patches/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/goal/BreedGoal.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/ai/goal/BreedGoal.java +++ b/net/minecraft/entity/ai/goal/BreedGoal.java -@@ -79,6 +79,17 @@ +@@ -80,6 +80,17 @@ protected void func_75388_i() { AgeableEntity ageableentity = this.field_75390_d.func_90011_a(this.field_75391_e); diff --git a/patches/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch b/patches/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch index fe35a4d11..7c4feb3d6 100644 --- a/patches/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/goal/EatGrassGoal.java.patch @@ -1,19 +1,19 @@ --- a/net/minecraft/entity/ai/goal/EatGrassGoal.java +++ b/net/minecraft/entity/ai/goal/EatGrassGoal.java -@@ -58,7 +58,7 @@ +@@ -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_82766_b("mobGriefing")) { +- 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); } -@@ -66,7 +66,7 @@ +@@ -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_82766_b("mobGriefing")) { +- 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/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch b/patches/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch index 7ec55ead1..593d97d01 100644 --- a/patches/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/WitherEntity.java.patch @@ -1,24 +1,24 @@ --- a/net/minecraft/entity/boss/WitherEntity.java +++ b/net/minecraft/entity/boss/WitherEntity.java -@@ -206,7 +206,7 @@ +@@ -207,7 +207,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_82766_b("mobGriefing") ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; +- 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.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v, 7.0F, false, explosion$mode); this.field_70170_p.func_175669_a(1023, new BlockPos(this), 0); } -@@ -281,7 +281,7 @@ +@@ -282,7 +282,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_82766_b("mobGriefing")) { +- 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.field_70163_u); int l1 = MathHelper.func_76128_c(this.field_70165_t); int i2 = MathHelper.func_76128_c(this.field_70161_v); -@@ -295,7 +295,7 @@ +@@ -296,7 +296,7 @@ int l = i2 + l2; BlockPos blockpos = new BlockPos(i3, k, l); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -27,7 +27,7 @@ flag = this.field_70170_p.func_175655_b(blockpos, true) || flag; } } -@@ -316,6 +316,7 @@ +@@ -317,6 +317,7 @@ } } diff --git a/patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch b/patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch index 290a9e475..7625f5383 100644 --- a/patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/dragon/EnderDragonEntity.java.patch @@ -1,15 +1,13 @@ --- a/net/minecraft/entity/boss/dragon/EnderDragonEntity.java +++ b/net/minecraft/entity/boss/dragon/EnderDragonEntity.java -@@ -407,8 +407,10 @@ +@@ -408,8 +408,8 @@ BlockPos blockpos = new BlockPos(k1, l1, i2); 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_82766_b("mobGriefing") && !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_199685_a_(block)) { + if (!blockstate.isAir(this.field_70170_p, blockpos) && blockstate.func_185904_a() != Material.field_151581_o) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this) && -+ blockstate.canEntityDestroy(this.field_70170_p, blockpos, this) && -+ net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, blockstate)) { ++ if (net.minecraftforge.common.ForgeHooks.canEntityDestroy(this.field_70170_p, blockpos, this) && !BlockTags.field_219754_W.func_199685_a_(block)) { flag1 = this.field_70170_p.func_217377_a(blockpos, false) || flag1; } else { flag = true; diff --git a/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch b/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch index 2aa8fc8c0..262ca229a 100644 --- a/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/effect/LightningBoltEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/effect/LightningBoltEntity.java +++ b/net/minecraft/entity/effect/LightningBoltEntity.java -@@ -79,6 +79,7 @@ +@@ -80,6 +80,7 @@ List list = this.field_70170_p.func_175674_a(this, new AxisAlignedBB(this.field_70165_t - 3.0D, this.field_70163_u - 3.0D, this.field_70161_v - 3.0D, this.field_70165_t + 3.0D, this.field_70163_u + 6.0D + 3.0D, this.field_70161_v + 3.0D), Entity::func_70089_S); for(Entity entity : list) { diff --git a/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch index 54acc1923..7b802edb3 100644 --- a/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/BoatEntity.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/entity/item/BoatEntity.java +++ b/net/minecraft/entity/item/BoatEntity.java -@@ -458,7 +458,7 @@ +@@ -459,7 +459,7 @@ blockpos$pooledmutableblockpos.func_181079_c(l1, k2, i2); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos); - if (!(blockstate.func_177230_c() instanceof LilyPadBlock) && VoxelShapes.func_197879_c(blockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutableblockpos).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.AND)) { + if (!(blockstate.func_177230_c() instanceof LilyPadBlock) && VoxelShapes.func_197879_c(blockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutableblockpos).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$pooledmutableblockpos, this); ++k1; } } -@@ -777,6 +777,20 @@ +@@ -778,6 +778,20 @@ return new SSpawnObjectPacket(this); } diff --git a/patches/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch index 208691a6a..1a7849781 100644 --- a/patches/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EnderPearlEntity.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/entity/item/EnderPearlEntity.java +++ b/net/minecraft/entity/item/EnderPearlEntity.java @@ -84,6 +84,8 @@ + if (!this.field_70170_p.field_72995_K) { if (livingentity instanceof ServerPlayerEntity) { ServerPlayerEntity serverplayerentity = (ServerPlayerEntity)livingentity; - if (serverplayerentity.field_71135_a.func_147362_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.field_70165_t, this.field_70163_u, this.field_70161_v, 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_82766_b("doMobSpawning")) { + if (serverplayerentity.field_71135_a.func_147362_b().func_150724_d() && serverplayerentity.field_70170_p == this.field_70170_p && !serverplayerentity.func_70608_bn()) { + 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); -@@ -95,9 +97,10 @@ +@@ -96,9 +98,10 @@ livingentity.func_184210_p(); } diff --git a/patches/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch index 29c838232..6f29d16ef 100644 --- a/patches/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/FallingBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/FallingBlockEntity.java +++ b/net/minecraft/entity/item/FallingBlockEntity.java -@@ -152,7 +152,7 @@ +@@ -153,7 +153,7 @@ ((FallingBlock)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, blockstate); } diff --git a/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch index 68c3398cb..e0d016dd0 100644 --- a/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/HangingEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/HangingEntity.java +++ b/net/minecraft/entity/item/HangingEntity.java -@@ -119,6 +119,8 @@ +@@ -118,6 +118,8 @@ int j1 = (j - 1) / -2; blockpos$mutableblockpos.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$mutableblockpos); diff --git a/patches/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch index ee981f553..b2e1278ca 100644 --- a/patches/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/ItemFrameEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/ItemFrameEntity.java +++ b/net/minecraft/entity/item/ItemFrameEntity.java -@@ -190,7 +190,7 @@ +@@ -191,7 +191,7 @@ } private void func_110131_b(ItemStack p_110131_1_) { 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 d3f2cc146..65edce040 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java +++ b/net/minecraft/entity/item/minecart/AbstractMinecartEntity.java -@@ -34,7 +34,7 @@ +@@ -35,7 +35,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -9,7 +9,7 @@ private static final DataParameter field_184265_a = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187192_b); private static final DataParameter field_184266_b = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187192_b); private static final DataParameter field_184267_c = EntityDataManager.func_187226_a(AbstractMinecartEntity.class, DataSerializers.field_187193_c); -@@ -55,6 +55,7 @@ +@@ -56,6 +56,7 @@ private double field_70507_ar; @OnlyIn(Dist.CLIENT) private double field_70506_as; @@ -17,7 +17,7 @@ protected AbstractMinecartEntity(EntityType p_i48538_1_, World p_i48538_2_) { super(p_i48538_1_, p_i48538_2_); -@@ -101,11 +102,12 @@ +@@ -102,11 +103,12 @@ @Nullable public AxisAlignedBB func_70114_g(Entity p_70114_1_) { @@ -31,7 +31,7 @@ } public double func_70042_X() { -@@ -213,7 +215,7 @@ +@@ -214,7 +216,7 @@ BlockPos blockpos = new BlockPos(i, j, k); BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -40,7 +40,7 @@ this.func_180460_a(blockpos, blockstate); if (blockstate.func_177230_c() == Blocks.field_150408_cc) { this.func_96095_a(i, j, k, blockstate.func_177229_b(PoweredRailBlock.field_176569_M)); -@@ -240,8 +242,11 @@ +@@ -241,8 +243,11 @@ } this.func_70101_b(this.field_70177_z, this.field_70125_A); @@ -54,7 +54,7 @@ if (!list.isEmpty()) { for(int l = 0; l < list.size(); ++l) { Entity entity1 = list.get(l); -@@ -253,7 +258,7 @@ +@@ -254,7 +259,7 @@ } } } else { @@ -63,7 +63,7 @@ if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof AbstractMinecartEntity) { entity.func_70108_f(this); } -@@ -261,6 +266,7 @@ +@@ -262,6 +267,7 @@ } this.func_70072_I(); @@ -71,7 +71,7 @@ } } -@@ -272,16 +278,24 @@ +@@ -273,16 +279,24 @@ } protected void func_180459_n() { @@ -98,7 +98,7 @@ } } -@@ -298,24 +312,24 @@ +@@ -299,24 +313,24 @@ flag1 = !flag; } @@ -129,7 +129,7 @@ ++this.field_70163_u; } -@@ -344,7 +358,7 @@ +@@ -345,7 +359,7 @@ } } @@ -138,7 +138,7 @@ double d19 = Math.sqrt(func_213296_b(this.func_213322_ci())); if (d19 < 0.03D) { this.func_213317_d(Vec3d.field_186680_a); -@@ -375,10 +389,7 @@ +@@ -376,10 +390,7 @@ this.field_70165_t = d20 + d1 * d11; this.field_70161_v = d7 + d2 * d11; this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); @@ -150,7 +150,7 @@ if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[0][2]) { this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v); } else if (aint[1][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[1][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[1][2]) { -@@ -406,7 +417,10 @@ +@@ -407,7 +418,10 @@ this.func_213293_j(d23 * (double)(j - p_180460_1_.func_177958_n()), vec3d5.field_72448_b, d23 * (double)(i - p_180460_1_.func_177952_p())); } @@ -162,7 +162,7 @@ Vec3d vec3d6 = this.func_213322_ci(); double d24 = Math.sqrt(func_213296_b(vec3d6)); if (d24 > 0.01D) { -@@ -461,7 +475,7 @@ +@@ -462,7 +476,7 @@ BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (blockstate.func_203425_a(BlockTags.field_203437_y)) { @@ -171,7 +171,7 @@ p_70495_3_ = (double)j; if (railshape.func_208092_c()) { p_70495_3_ = (double)(j + 1); -@@ -498,7 +512,7 @@ +@@ -499,7 +513,7 @@ BlockState blockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (blockstate.func_203425_a(BlockTags.field_203437_y)) { @@ -180,7 +180,7 @@ int[][] aint = field_70500_g[railshape.func_208091_a()]; double d0 = (double)i + 0.5D + (double)aint[0][0] * 0.5D; double d1 = (double)j + 0.0625D + (double)aint[0][1] * 0.5D; -@@ -561,6 +575,11 @@ +@@ -562,6 +576,11 @@ } public void func_70108_f(Entity p_70108_1_) { @@ -192,7 +192,7 @@ if (!this.field_70170_p.field_72995_K) { if (!p_70108_1_.field_70145_X && !this.field_70145_X) { if (!this.func_184196_w(p_70108_1_)) { -@@ -596,11 +615,11 @@ +@@ -597,11 +616,11 @@ Vec3d vec3d2 = this.func_213322_ci(); Vec3d vec3d3 = p_70108_1_.func_213322_ci(); @@ -206,7 +206,7 @@ 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)); -@@ -706,6 +725,40 @@ +@@ -707,6 +726,40 @@ return new SSpawnObjectPacket(this); } diff --git a/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch index 4c9bd5921..22fe16a2a 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java +++ b/net/minecraft/entity/item/minecart/ContainerMinecartEntity.java -@@ -115,11 +115,17 @@ +@@ -116,11 +116,17 @@ } public void func_70106_y() { @@ -19,7 +19,7 @@ } protected void func_213281_b(CompoundNBT p_213281_1_) { -@@ -148,6 +154,7 @@ +@@ -149,6 +155,7 @@ } public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_2_) { @@ -27,7 +27,7 @@ p_184230_1_.func_213829_a(this); return true; } -@@ -167,6 +174,8 @@ +@@ -168,6 +175,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); @@ -36,7 +36,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_); } -@@ -197,4 +206,17 @@ +@@ -198,4 +207,17 @@ } protected abstract Container func_213968_a(int p_213968_1_, PlayerInventory p_213968_2_); diff --git a/patches/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch b/patches/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch index 3cfb77768..bb4031a13 100644 --- a/patches/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java +++ b/net/minecraft/entity/item/minecart/FurnaceMinecartEntity.java -@@ -110,6 +110,7 @@ +@@ -111,6 +111,7 @@ } public boolean func_184230_a(PlayerEntity p_184230_1_, Hand p_184230_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 f610b86d8..a9acaafb0 100644 --- a/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/merchant/villager/VillagerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/merchant/villager/VillagerEntity.java +++ b/net/minecraft/entity/merchant/villager/VillagerEntity.java -@@ -229,7 +229,7 @@ +@@ -227,7 +227,7 @@ if (flag) { itemstack.func_111282_a(p_184645_1_, this, p_184645_2_); return true; diff --git a/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch index ae840961c..526a6156b 100644 --- a/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/CreeperEntity.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/entity/monster/CreeperEntity.java +++ b/net/minecraft/entity/monster/CreeperEntity.java -@@ -207,7 +207,7 @@ +@@ -208,7 +208,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_82766_b("mobGriefing") ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; +- 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_70830_n() ? 2.0F : 1.0F; this.field_70729_aU = true; diff --git a/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch index bae4cb09e..ffbee3415 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/EndermanEntity.java +++ b/net/minecraft/entity/monster/EndermanEntity.java -@@ -225,7 +225,9 @@ +@@ -226,7 +226,9 @@ if (!this.field_70170_p.func_180495_p(blockpos$mutableblockpos).func_185904_a().func_76230_c()) { return false; } else { @@ -11,16 +11,16 @@ if (flag) { 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); -@@ -370,7 +372,7 @@ +@@ -371,7 +373,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_82766_b("mobGriefing")) { +- } 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; -@@ -388,7 +390,7 @@ +@@ -389,7 +391,7 @@ BlockPos blockpos1 = blockpos.func_177977_b(); BlockState blockstate1 = iworld.func_180495_p(blockpos1); BlockState blockstate2 = this.field_179475_a.func_195405_dq(); @@ -29,11 +29,20 @@ iworld.func_180501_a(blockpos, blockstate2, 3); this.field_179475_a.func_195406_b((BlockState)null); } -@@ -433,7 +435,7 @@ +@@ -397,7 +399,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() && Block.func_208062_a(p_220836_5_.func_196952_d(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_) && Block.func_208062_a(p_220836_5_.func_196952_d(p_220836_1_, p_220836_6_)) && p_220836_3_.func_196955_c(p_220836_1_, p_220836_2_); + } + } + +@@ -434,7 +436,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_82766_b("mobGriefing")) { +- } 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 { diff --git a/patches/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch index bcfbba48c..231c4efc9 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EvokerEntity.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/entity/monster/EvokerEntity.java +++ b/net/minecraft/entity/monster/EvokerEntity.java -@@ -286,7 +286,7 @@ +@@ -287,7 +287,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_82766_b("mobGriefing")) { +- } 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 { diff --git a/patches/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch index 61a7bddcd..f7bf562ab 100644 --- a/patches/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/MagmaCubeEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/MagmaCubeEntity.java +++ b/net/minecraft/entity/monster/MagmaCubeEntity.java -@@ -77,6 +77,7 @@ +@@ -79,6 +79,7 @@ Vec3d vec3d = this.func_213322_ci(); this.func_213293_j(vec3d.field_72450_a, (double)(0.42F + (float)this.func_70809_q() * 0.1F), vec3d.field_72449_c); this.field_70160_al = true; diff --git a/patches/minecraft/net/minecraft/entity/monster/RavagerEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/RavagerEntity.java.patch new file mode 100644 index 000000000..e66ab3c80 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/monster/RavagerEntity.java.patch @@ -0,0 +1,11 @@ +--- 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/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch index 8f7bc618d..70f6d3def 100644 --- a/patches/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/SilverfishEntity.java.patch @@ -1,20 +1,20 @@ --- a/net/minecraft/entity/monster/SilverfishEntity.java +++ b/net/minecraft/entity/monster/SilverfishEntity.java -@@ -141,7 +141,7 @@ +@@ -138,7 +138,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_82766_b("mobGriefing") && random.nextInt(10) == 0) { +- 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.field_70165_t, this.field_75457_a.field_70163_u + 0.5D, this.field_75457_a.field_70161_v)).func_177972_a(this.field_179483_b); BlockState blockstate = this.field_75457_a.field_70170_p.func_180495_p(blockpos); -@@ -210,7 +210,7 @@ +@@ -207,7 +207,7 @@ BlockState blockstate = world.func_180495_p(blockpos1); Block block = blockstate.func_177230_c(); if (block instanceof SilverfishBlock) { -- if (world.func_82736_K().func_82766_b("mobGriefing")) { -+ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, field_179464_a)) { +- 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_175655_b(blockpos1, true); } else { world.func_180501_a(blockpos1, ((SilverfishBlock)block).func_196468_d().func_176223_P(), 3); diff --git a/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch index 6931a5bf8..5be934afe 100644 --- a/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/SlimeEntity.java +++ b/net/minecraft/entity/monster/SlimeEntity.java -@@ -113,7 +113,7 @@ +@@ -114,7 +114,7 @@ public void func_70071_h_() { if (!this.field_70170_p.field_72995_K && this.field_70170_p.func_175659_aa() == Difficulty.PEACEFUL && this.func_70809_q() > 0) { @@ -9,7 +9,7 @@ } this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F; -@@ -122,6 +122,7 @@ +@@ -123,6 +123,7 @@ if (this.field_70122_E && !this.field_175452_bi) { int i = this.func_70809_q(); @@ -18,14 +18,14 @@ float f = this.field_70146_Z.nextFloat() * ((float)Math.PI * 2F); float f1 = this.field_70146_Z.nextFloat() * 0.5F + 0.5F; @@ -251,7 +252,7 @@ + } - public boolean func_213380_a(IWorld p_213380_1_, SpawnReason p_213380_2_) { - BlockPos blockpos = new BlockPos(this.field_70165_t, 0.0D, this.field_70161_v); -- if (p_213380_1_.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1) { -+ if (p_213380_1_.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p)) { + 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_213380_1_.func_175659_aa() != Difficulty.PEACEFUL) { + if (p_223366_1_.func_175659_aa() != Difficulty.PEACEFUL) { @@ -309,6 +310,12 @@ return super.func_213305_a(p_213305_1_).func_220313_a(0.255F * (float)this.func_70809_q()); } diff --git a/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch index afa979e75..701e0b90c 100644 --- a/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/ZombieEntity.java +++ b/net/minecraft/entity/monster/ZombieEntity.java -@@ -105,7 +105,7 @@ +@@ -106,7 +106,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); @@ -9,11 +9,11 @@ } protected void func_70088_a() { -@@ -278,12 +278,16 @@ +@@ -279,12 +279,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_82766_b("doMobSpawning")) { +- 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.field_70165_t); int j = MathHelper.func_76128_c(this.field_70163_u); int k = MathHelper.func_76128_c(this.field_70161_v); @@ -22,13 +22,13 @@ + 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_82766_b("doMobSpawning")) { ++ 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() && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { + 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); -@@ -293,6 +297,7 @@ +@@ -294,6 +298,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_217346_i(zombieentity) && this.field_70170_p.func_217345_j(zombieentity) && !this.field_70170_p.func_72953_d(zombieentity.func_174813_aQ())) { this.field_70170_p.func_217376_c(zombieentity); @@ -36,7 +36,7 @@ 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)); -@@ -425,7 +430,7 @@ +@@ -426,7 +431,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) { diff --git a/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch new file mode 100644 index 000000000..8c375f216 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/passive/FoxEntity.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/entity/passive/FoxEntity.java ++++ b/net/minecraft/entity/passive/FoxEntity.java +@@ -767,7 +767,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/minecraft/net/minecraft/entity/passive/MooshroomEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/MooshroomEntity.java.patch index 17807b4cf..378fad75f 100644 --- a/patches/minecraft/net/minecraft/entity/passive/MooshroomEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/MooshroomEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/MooshroomEntity.java +++ b/net/minecraft/entity/passive/MooshroomEntity.java -@@ -28,7 +28,7 @@ +@@ -33,7 +33,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import org.apache.commons.lang3.tuple.Pair; @@ -9,7 +9,7 @@ private static final DataParameter field_213449_bz = EntityDataManager.func_187226_a(MooshroomEntity.class, DataSerializers.field_187194_d); private Effect field_213450_bA; private int field_213447_bB; -@@ -85,7 +85,7 @@ +@@ -97,7 +97,7 @@ this.func_184185_a(soundevent, 1.0F, 1.0F); return true; @@ -18,7 +18,7 @@ this.field_70170_p.func_195594_a(ParticleTypes.field_197627_t, this.field_70165_t, this.field_70163_u + (double)(this.func_213302_cg() / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D); if (!this.field_70170_p.field_72995_K) { this.func_70106_y(); -@@ -191,6 +191,33 @@ +@@ -203,6 +203,33 @@ return mooshroomentity$type2; } diff --git a/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch index 46a18fa25..c14fb63e2 100644 --- a/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/OcelotEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/OcelotEntity.java +++ b/net/minecraft/entity/passive/OcelotEntity.java -@@ -153,7 +153,7 @@ +@@ -154,7 +154,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) { diff --git a/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch index e1c154eef..4b9b6e80d 100644 --- a/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/ParrotEntity.java.patch @@ -9,12 +9,3 @@ this.func_193101_c(p_184645_1_); this.func_70908_e(true); this.field_70170_p.func_72960_a(this, (byte)7); -@@ -266,7 +266,7 @@ - int k = MathHelper.func_76128_c(this.field_70161_v); - BlockPos blockpos = new BlockPos(i, j, k); - Block block = p_213380_1_.func_180495_p(blockpos.func_177977_b()).func_177230_c(); -- return block.func_203417_a(BlockTags.field_206952_E) || block == Blocks.field_196658_i || block instanceof LogBlock || block == Blocks.field_150350_a && super.func_213380_a(p_213380_1_, p_213380_2_); -+ return block.func_203417_a(BlockTags.field_206952_E) || block == Blocks.field_196658_i || block instanceof LogBlock || block == Blocks.field_150350_a && super.func_213380_a(p_213380_1_, p_213380_2_); //Forge: GRASS -> GRASS_BLOCK - } - - public void func_180430_e(float p_180430_1_, float p_180430_2_) { diff --git a/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch index ba9711c97..9180617a6 100644 --- a/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/RabbitEntity.java.patch @@ -1,19 +1,10 @@ --- a/net/minecraft/entity/passive/RabbitEntity.java +++ b/net/minecraft/entity/passive/RabbitEntity.java -@@ -362,7 +362,7 @@ - int k = MathHelper.func_76128_c(this.field_70161_v); - BlockPos blockpos = new BlockPos(i, j, k); - Block block = p_213380_1_.func_180495_p(blockpos.func_177977_b()).func_177230_c(); -- return block != Blocks.field_150349_c && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_213380_a(p_213380_1_, p_213380_2_) : true; -+ return block != Blocks.field_196658_i && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_213380_a(p_213380_1_, p_213380_2_) : true; //Forge: GRASS -> GRASS_BLOCk - } - - private boolean func_175534_cv() { -@@ -500,7 +500,7 @@ +@@ -502,7 +502,7 @@ public boolean func_75250_a() { if (this.field_179496_a <= 0) { -- if (!this.field_179500_c.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { +- 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/minecraft/net/minecraft/entity/passive/SnowGolemEntity.java.patch b/patches/minecraft/net/minecraft/entity/passive/SnowGolemEntity.java.patch index c74d226cd..de3bf0c83 100644 --- a/patches/minecraft/net/minecraft/entity/passive/SnowGolemEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/SnowGolemEntity.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/entity/passive/SnowGolemEntity.java +++ b/net/minecraft/entity/passive/SnowGolemEntity.java -@@ -32,7 +32,7 @@ - import net.minecraft.util.math.MathHelper; +@@ -33,7 +33,7 @@ + import net.minecraft.world.GameRules; import net.minecraft.world.World; -public class SnowGolemEntity extends GolemEntity implements IRangedAttackMob { @@ -9,16 +9,16 @@ private static final DataParameter field_184749_a = EntityDataManager.func_187226_a(SnowGolemEntity.class, DataSerializers.field_187191_a); public SnowGolemEntity(EntityType p_i50244_1_, World p_i50244_2_) { -@@ -87,7 +87,7 @@ +@@ -88,7 +88,7 @@ this.func_70097_a(DamageSource.field_76370_b, 1.0F); } -- if (!this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { +- if (!this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { + if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { return; } -@@ -98,7 +98,7 @@ +@@ -99,7 +99,7 @@ j = MathHelper.func_76128_c(this.field_70163_u); k = MathHelper.func_76128_c(this.field_70161_v + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); BlockPos blockpos = new BlockPos(i, j, k); @@ -27,7 +27,7 @@ this.field_70170_p.func_175656_a(blockpos, blockstate); } } -@@ -124,7 +124,7 @@ +@@ -125,7 +125,7 @@ protected boolean func_184645_a(PlayerEntity p_184645_1_, Hand p_184645_2_) { ItemStack itemstack = p_184645_1_.func_184586_b(p_184645_2_); @@ -36,7 +36,7 @@ this.func_184747_a(false); itemstack.func_222118_a(1, p_184645_1_, (p_213622_1_) -> { p_213622_1_.func_213334_d(p_184645_2_); -@@ -162,4 +162,15 @@ +@@ -163,4 +163,15 @@ protected SoundEvent func_184615_bR() { return SoundEvents.field_187801_fC; } diff --git a/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch index 062b45dcb..7c935e90f 100644 --- a/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/PlayerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/player/PlayerEntity.java +++ b/net/minecraft/entity/player/PlayerEntity.java -@@ -107,6 +107,10 @@ +@@ -108,6 +108,10 @@ import net.minecraftforge.api.distmarker.OnlyIn; public abstract class PlayerEntity extends LivingEntity { @@ -11,17 +11,17 @@ 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.SNEAKING, 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); -@@ -148,6 +152,9 @@ +@@ -149,6 +153,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.OVERWORLD; ++ 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_); -@@ -166,6 +173,7 @@ +@@ -167,6 +174,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); @@ -29,7 +29,7 @@ } protected void func_70088_a() { -@@ -179,6 +187,7 @@ +@@ -180,6 +188,7 @@ } public void func_70071_h_() { @@ -37,7 +37,7 @@ this.field_70145_X = this.func_175149_v(); if (this.func_175149_v()) { this.field_70122_E = false; -@@ -194,7 +203,7 @@ +@@ -195,7 +204,7 @@ this.field_71076_b = 100; } @@ -46,7 +46,7 @@ this.func_70999_a(false, true, true); } } else if (this.field_71076_b > 0) { -@@ -252,6 +261,7 @@ +@@ -253,6 +262,7 @@ this.func_203041_m(); this.field_184832_bU.func_185144_a(); this.func_213832_dB(); @@ -54,7 +54,7 @@ } protected boolean func_204229_de() { -@@ -260,6 +270,7 @@ +@@ -261,6 +271,7 @@ } private void func_203041_m() { @@ -62,7 +62,7 @@ ItemStack itemstack = this.func_184582_a(EquipmentSlotType.HEAD); if (itemstack.func_77973_b() == Items.field_203179_ao && !this.func_208600_a(FluidTags.field_206959_a)) { this.func_195064_c(new EffectInstance(Effects.field_76427_o, 200, 0, false, false, true)); -@@ -426,10 +437,10 @@ +@@ -427,10 +438,10 @@ this.field_71107_bF = this.field_71109_bG; this.field_71109_bG = 0.0F; this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2); @@ -75,7 +75,7 @@ } } -@@ -542,6 +553,7 @@ +@@ -543,6 +554,7 @@ } public void func_70645_a(DamageSource p_70645_1_) { @@ -83,7 +83,7 @@ super.func_70645_a(p_70645_1_); this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); if (!this.func_175149_v()) { -@@ -596,12 +608,14 @@ +@@ -597,12 +609,14 @@ @Nullable public ItemEntity func_71040_bB(boolean p_71040_1_) { @@ -100,7 +100,7 @@ } @Nullable -@@ -635,7 +649,12 @@ +@@ -636,7 +650,12 @@ } } @@ -113,7 +113,7 @@ float f = this.field_71071_by.func_184438_a(p_184813_1_); if (f > 1.0F) { int i = EnchantmentHelper.func_185293_e(this); -@@ -677,11 +696,12 @@ +@@ -678,11 +697,12 @@ f /= 5.0F; } @@ -127,7 +127,7 @@ } public void func_70037_a(CompoundNBT p_70037_1_) { -@@ -705,6 +725,17 @@ +@@ -706,6 +726,17 @@ this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); } @@ -140,12 +140,12 @@ + 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.OVERWORLD; ++ 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)) { -@@ -750,9 +781,26 @@ +@@ -751,9 +782,26 @@ p_213281_1_.func_218657_a("ShoulderEntityRight", this.func_192025_dl()); } @@ -162,7 +162,7 @@ + } + }); + p_213281_1_.func_218657_a("Spawns", spawnlist); -+ if (spawnDimension != net.minecraft.world.dimension.DimensionType.OVERWORLD) { ++ if (spawnDimension != net.minecraft.world.dimension.DimensionType.field_223227_a_) { + p_213281_1_.func_74778_a("SpawnDimension", spawnDimension.getRegistryName().toString()); + } } @@ -172,7 +172,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()) { -@@ -784,7 +832,7 @@ +@@ -785,7 +833,7 @@ protected void func_190629_c(LivingEntity p_190629_1_) { super.func_190629_c(p_190629_1_); @@ -181,7 +181,7 @@ this.func_190777_m(true); } -@@ -805,13 +853,15 @@ +@@ -806,13 +854,15 @@ } protected void func_184590_k(float p_184590_1_) { @@ -198,7 +198,7 @@ if (hand == Hand.MAIN_HAND) { this.func_184201_a(EquipmentSlotType.MAINHAND, ItemStack.field_190927_a); } else { -@@ -827,11 +877,14 @@ +@@ -828,11 +878,14 @@ protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { if (!this.func_180431_b(p_70665_1_)) { @@ -213,7 +213,7 @@ float f1 = f - p_70665_2_; if (f1 > 0.0F && f1 < 3.4028235E37F) { this.func_195067_a(Stats.field_212738_J, Math.round(f1 * 10.0F)); -@@ -886,6 +939,8 @@ +@@ -887,6 +940,8 @@ return ActionResultType.PASS; } else { @@ -222,7 +222,7 @@ ItemStack itemstack = this.func_184586_b(p_190775_2_); ItemStack itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l(); if (p_190775_1_.func_184230_a(this, p_190775_2_)) { -@@ -893,6 +948,9 @@ +@@ -894,6 +949,9 @@ itemstack.func_190920_e(itemstack1.func_190916_E()); } @@ -232,7 +232,7 @@ return ActionResultType.SUCCESS; } else { if (!itemstack.func_190926_b() && p_190775_1_ instanceof LivingEntity) { -@@ -902,6 +960,7 @@ +@@ -903,6 +961,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) { @@ -240,7 +240,7 @@ this.func_184611_a(p_190775_2_, ItemStack.field_190927_a); } -@@ -928,6 +987,7 @@ +@@ -929,6 +988,7 @@ } public void func_71059_n(Entity p_71059_1_) { @@ -248,7 +248,7 @@ 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(); -@@ -955,8 +1015,10 @@ +@@ -956,8 +1016,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(); @@ -260,7 +260,7 @@ } f = f + f1; -@@ -1044,8 +1106,10 @@ +@@ -1045,8 +1107,10 @@ } if (!this.field_70170_p.field_72995_K && !itemstack1.func_190926_b() && entity instanceof LivingEntity) { @@ -271,7 +271,7 @@ this.func_184611_a(Hand.MAIN_HAND, ItemStack.field_190927_a); } } -@@ -1087,7 +1151,7 @@ +@@ -1088,7 +1152,7 @@ } if (this.field_70146_Z.nextFloat() < f) { @@ -280,7 +280,7 @@ this.func_184602_cy(); this.field_70170_p.func_72960_a(this, (byte)30); } -@@ -1131,6 +1195,8 @@ +@@ -1132,6 +1196,8 @@ } public Either func_213819_a(BlockPos p_213819_1_) { @@ -289,7 +289,7 @@ 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()) { -@@ -1141,7 +1207,7 @@ +@@ -1142,7 +1208,7 @@ return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_HERE); } @@ -298,7 +298,7 @@ return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW); } -@@ -1183,6 +1249,8 @@ +@@ -1184,6 +1250,8 @@ private boolean func_190774_a(BlockPos p_190774_1_, Direction p_190774_2_) { if (Math.abs(this.field_70165_t - (double)p_190774_1_.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)p_190774_1_.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)p_190774_1_.func_177952_p()) <= 3.0D) { return true; @@ -307,7 +307,7 @@ } else { BlockPos blockpos = p_190774_1_.func_177972_a(p_190774_2_.func_176734_d()); return Math.abs(this.field_70165_t - (double)blockpos.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)blockpos.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)blockpos.func_177952_p()) <= 3.0D; -@@ -1195,6 +1263,7 @@ +@@ -1196,6 +1264,7 @@ } public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { @@ -315,7 +315,7 @@ Optional optional = this.func_213374_dv(); super.func_213366_dy(); if (this.field_70170_p instanceof ServerWorld && p_70999_2_) { -@@ -1215,17 +1284,17 @@ +@@ -1216,17 +1285,17 @@ } public static Optional func_213822_a(IWorldReader p_213822_0_, BlockPos p_213822_1_, boolean p_213822_2_) { @@ -337,7 +337,7 @@ } } -@@ -1240,23 +1309,67 @@ +@@ -1241,23 +1310,67 @@ public void func_146105_b(ITextComponent p_146105_1_, boolean p_146105_2_) { } @@ -353,7 +353,7 @@ + * @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.OVERWORLD ? field_71077_c : spawnPosMap.get(dim.getRegistryName()); ++ return dim == net.minecraft.world.dimension.DimensionType.field_223227_a_ ? field_71077_c : spawnPosMap.get(dim.getRegistryName()); + } + + @Deprecated //Forge: Use Dimension sensitive version @@ -370,7 +370,7 @@ + * @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.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false); ++ return dim == net.minecraft.world.dimension.DimensionType.field_223227_a_ ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false); + } + + @Deprecated //Forge: Use Dimension sensitive version @@ -394,7 +394,7 @@ + */ + public void setSpawnPoint(@Nullable BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) { + if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, pos, forced)) return; -+ if (dim != net.minecraft.world.dimension.DimensionType.OVERWORLD) { ++ if (dim != net.minecraft.world.dimension.DimensionType.field_223227_a_) { + if (pos == null) { + spawnPosMap.remove(dim.getRegistryName()); + spawnForcedMap.remove(dim.getRegistryName()); @@ -414,7 +414,7 @@ } public void func_195066_a(ResourceLocation p_195066_1_) { -@@ -1422,6 +1535,8 @@ +@@ -1423,6 +1536,8 @@ } super.func_180430_e(p_180430_1_, p_180430_2_); @@ -423,7 +423,7 @@ } } -@@ -1684,7 +1799,10 @@ +@@ -1685,7 +1800,10 @@ } public ITextComponent func_145748_c_() { @@ -435,7 +435,7 @@ return this.func_208016_c(itextcomponent); } -@@ -1920,4 +2038,44 @@ +@@ -1921,4 +2039,44 @@ return this.field_221260_g; } } diff --git a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch index d9ff37a11..7d2b04287 100644 --- a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch @@ -1,14 +1,23 @@ --- a/net/minecraft/entity/player/ServerPlayerEntity.java +++ b/net/minecraft/entity/player/ServerPlayerEntity.java -@@ -433,6 +433,7 @@ +@@ -436,6 +436,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_82766_b("showDeathMessages"); ++ 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(); -@@ -565,8 +566,10 @@ +@@ -477,7 +478,7 @@ + livingentity.func_191956_a(this, this.field_70744_aE, p_70645_1_); + if (!this.field_70170_p.field_72995_K && livingentity instanceof WitherEntity) { + boolean flag1 = false; +- if (this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { ++ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) { + BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v); + BlockState blockstate = Blocks.field_222388_bz.func_176223_P(); + if (this.field_70170_p.func_180495_p(blockpos).func_196958_f() && blockstate.func_196955_c(this.field_70170_p, blockpos)) { +@@ -568,8 +569,10 @@ return this.field_71133_b.func_71219_W(); } @@ -18,8 +27,8 @@ + 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.THE_END && p_212321_1_ == DimensionType.OVERWORLD) { -@@ -588,8 +591,8 @@ + if (dimensiontype == DimensionType.field_223229_c_ && p_212321_1_ == DimensionType.field_223227_a_) { +@@ -591,8 +594,8 @@ 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); @@ -30,24 +39,24 @@ double d0 = this.field_70165_t; double d1 = this.field_70163_u; double d2 = this.field_70161_v; -@@ -598,13 +601,11 @@ +@@ -601,13 +604,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.OVERWORLD && p_212321_1_ == DimensionType.NETHER) { + if (dimensiontype == DimensionType.field_223227_a_ && p_212321_1_ == DimensionType.field_223228_b_) { this.field_193110_cw = new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v); - d0 /= 8.0D; - d2 /= 8.0D; -- } else if (dimensiontype == DimensionType.NETHER && p_212321_1_ == DimensionType.OVERWORLD) { +- } else if (dimensiontype == DimensionType.field_223228_b_ && p_212321_1_ == DimensionType.field_223227_a_) { - d0 *= 8.0D; - d2 *= 8.0D; - } else if (dimensiontype == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.THE_END) { + } 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(); -@@ -668,6 +669,7 @@ +@@ -671,6 +672,7 @@ this.field_71144_ck = -1; this.field_71149_ch = -1.0F; this.field_71146_ci = -1; @@ -55,7 +64,7 @@ return this; } } -@@ -773,7 +775,7 @@ +@@ -776,7 +778,7 @@ BlockPos blockpos = new BlockPos(i, j, k); if (this.field_70170_p.func_175667_e(blockpos)) { BlockState blockstate = this.field_70170_p.func_180495_p(blockpos); @@ -64,7 +73,7 @@ BlockPos blockpos1 = blockpos.func_177977_b(); BlockState blockstate1 = this.field_70170_p.func_180495_p(blockpos1); Block block = blockstate1.func_177230_c(); -@@ -816,6 +818,7 @@ +@@ -819,6 +821,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; @@ -72,7 +81,7 @@ return OptionalInt.of(this.field_71139_cq); } } -@@ -834,6 +837,7 @@ +@@ -837,6 +840,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); @@ -80,7 +89,7 @@ } public void func_184814_a(ItemStack p_184814_1_, Hand p_184814_2_) { -@@ -891,6 +895,7 @@ +@@ -894,6 +898,7 @@ public void func_71128_l() { this.field_71070_bA.func_75134_a(this); @@ -88,14 +97,14 @@ this.field_71070_bA = this.field_71069_bz; } -@@ -1017,6 +1022,20 @@ +@@ -1020,6 +1025,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 != net.minecraft.world.dimension.DimensionType.OVERWORLD) { ++ 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; + } @@ -109,7 +118,7 @@ } protected void func_70670_a(EffectInstance p_70670_1_) { -@@ -1239,15 +1258,15 @@ +@@ -1242,15 +1261,15 @@ 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_); @@ -128,7 +137,7 @@ this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_); this.func_70029_a(p_200619_1_); p_200619_1_.func_217446_a(this); -@@ -1256,6 +1275,7 @@ +@@ -1259,6 +1278,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); @@ -136,7 +145,7 @@ } } -@@ -1290,6 +1310,8 @@ +@@ -1293,6 +1313,8 @@ if (itementity == null) { return null; } else { diff --git a/patches/minecraft/net/minecraft/entity/projectile/FireballEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/FireballEntity.java.patch index 7001981df..9d20d5541 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/FireballEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/FireballEntity.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/entity/projectile/FireballEntity.java +++ b/net/minecraft/entity/projectile/FireballEntity.java -@@ -36,7 +36,7 @@ +@@ -37,7 +37,7 @@ this.func_174815_a(this.field_70235_a, entity); } -- boolean flag = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing"); +- boolean flag = this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b); + boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a); this.field_70170_p.func_217398_a((Entity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, (float)this.field_92057_e, flag, flag ? Explosion.Mode.DESTROY : Explosion.Mode.NONE); this.func_70106_y(); diff --git a/patches/minecraft/net/minecraft/entity/projectile/SmallFireballEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/SmallFireballEntity.java.patch index f58984384..72749ee61 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/SmallFireballEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/SmallFireballEntity.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/entity/projectile/SmallFireballEntity.java +++ b/net/minecraft/entity/projectile/SmallFireballEntity.java -@@ -36,7 +36,7 @@ - this.func_174815_a(this.field_70235_a, entity); +@@ -40,7 +40,7 @@ + entity.func_223308_g(i); } } -- } else if (this.field_70235_a == null || !(this.field_70235_a instanceof MobEntity) || this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { +- } else if (this.field_70235_a == null || !(this.field_70235_a instanceof MobEntity) || this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223599_b)) { + } else if (this.field_70235_a == null || !(this.field_70235_a instanceof MobEntity) || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a)) { BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)p_70227_1_; BlockPos blockpos = blockraytraceresult.func_216350_a().func_177972_a(blockraytraceresult.func_216354_b()); diff --git a/patches/minecraft/net/minecraft/entity/projectile/WitherSkullEntity.java.patch b/patches/minecraft/net/minecraft/entity/projectile/WitherSkullEntity.java.patch index 475b89cca..26274f373 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/WitherSkullEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/WitherSkullEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/projectile/WitherSkullEntity.java +++ b/net/minecraft/entity/projectile/WitherSkullEntity.java -@@ -47,7 +47,7 @@ +@@ -48,7 +48,7 @@ } public float func_180428_a(Explosion p_180428_1_, IBlockReader p_180428_2_, BlockPos p_180428_3_, BlockState p_180428_4_, IFluidState p_180428_5_, float p_180428_6_) { @@ -9,11 +9,11 @@ } protected void func_70227_a(RayTraceResult p_70227_1_) { -@@ -80,7 +80,7 @@ +@@ -81,7 +81,7 @@ } } -- Explosion.Mode explosion$mode = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing") ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; +- 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.field_70235_a) ? Explosion.Mode.DESTROY : Explosion.Mode.NONE; this.field_70170_p.func_217398_a(this, this.field_70165_t, this.field_70163_u, this.field_70161_v, 1.0F, false, explosion$mode); this.func_70106_y(); diff --git a/patches/minecraft/net/minecraft/fluid/Fluid.java.patch b/patches/minecraft/net/minecraft/fluid/Fluid.java.patch index 3a5c08be5..c1238e348 100644 --- a/patches/minecraft/net/minecraft/fluid/Fluid.java.patch +++ b/patches/minecraft/net/minecraft/fluid/Fluid.java.patch @@ -9,7 +9,7 @@ public static final ObjectIntIdentityMap field_207201_d = new ObjectIntIdentityMap<>(); protected final StateContainer field_207202_e; private IFluidState field_207200_b; -@@ -100,4 +100,10 @@ +@@ -102,4 +102,10 @@ } public abstract VoxelShape func_215664_b(IFluidState p_215664_1_, IBlockReader p_215664_2_, BlockPos p_215664_3_); diff --git a/patches/minecraft/net/minecraft/fluid/IFluidState.java.patch b/patches/minecraft/net/minecraft/fluid/IFluidState.java.patch index 464c131e6..59712e4e9 100644 --- a/patches/minecraft/net/minecraft/fluid/IFluidState.java.patch +++ b/patches/minecraft/net/minecraft/fluid/IFluidState.java.patch @@ -9,7 +9,7 @@ Fluid func_206886_c(); default boolean func_206889_d() { -@@ -103,6 +103,7 @@ +@@ -107,6 +107,7 @@ return this.func_206886_c().func_207185_a(p_206884_1_); } diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index f4a506b40..c8330cea3 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -35,7 +35,7 @@ public final int func_77612_l() { return this.field_77699_b; } -@@ -209,10 +215,12 @@ +@@ -213,10 +219,12 @@ } @Nullable @@ -48,7 +48,7 @@ public boolean func_77634_r() { return this.field_77700_c != null; } -@@ -273,7 +281,7 @@ +@@ -277,7 +285,7 @@ } public boolean func_77616_k(ItemStack p_77616_1_) { @@ -57,7 +57,7 @@ } protected static RayTraceResult func_219968_a(World p_219968_0_, PlayerEntity p_219968_1_, RayTraceContext.FluidMode p_219968_2_) { -@@ -286,8 +294,8 @@ +@@ -290,8 +298,8 @@ float f5 = MathHelper.func_76126_a(-f * ((float)Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; @@ -68,7 +68,7 @@ return p_219968_0_.func_217299_a(new RayTraceContext(vec3d, vec3d1, RayTraceContext.BlockMode.OUTLINE, p_219968_2_, p_219968_1_)); } -@@ -303,6 +311,7 @@ +@@ -307,6 +315,7 @@ } protected boolean func_194125_a(ItemGroup p_194125_1_) { @@ -76,7 +76,7 @@ ItemGroup itemgroup = this.func_77640_w(); return itemgroup != null && (p_194125_1_ == ItemGroup.field_78027_g || p_194125_1_ == itemgroup); } -@@ -316,10 +325,44 @@ +@@ -320,10 +329,44 @@ return false; } @@ -121,7 +121,7 @@ public boolean func_219970_i(ItemStack p_219970_1_) { return p_219970_1_.func_77973_b() == Items.field_222114_py; } -@@ -349,6 +392,9 @@ +@@ -353,6 +396,9 @@ private ItemGroup field_200923_d; private Rarity field_208104_e = Rarity.COMMON; private Food field_221541_f; @@ -131,7 +131,7 @@ public Item.Properties func_221540_a(Food p_221540_1_) { this.field_221541_f = p_221540_1_; -@@ -388,5 +434,20 @@ +@@ -392,5 +438,20 @@ this.field_208104_e = p_208103_1_; return this; } diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch index 5f9748e08..c59bfb90d 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch @@ -1,20 +1,16 @@ --- a/net/minecraft/item/crafting/RecipeManager.java +++ b/net/minecraft/item/crafting/RecipeManager.java -@@ -46,7 +46,7 @@ - func_215374_a(this.field_199522_d); +@@ -50,8 +50,13 @@ - for(ResourceLocation resourcelocation : p_195410_1_.func_199003_a("recipes", (p_199516_0_) -> { -- return p_199516_0_.endsWith(".json"); -+ return p_199516_0_.endsWith(".json") && !p_199516_0_.startsWith("_"); //Forge filter anything beginning with "_" as it's used for metadata. - })) { - String s = resourcelocation.func_110623_a(); - ResourceLocation resourcelocation1 = new ResourceLocation(resourcelocation.func_110624_b(), s.substring(field_199519_a, s.length() - field_199520_b)); -@@ -55,6 +55,8 @@ - JsonObject jsonobject = JSONUtils.func_188178_a(gson, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), JsonObject.class); - if (jsonobject == null) { - field_199521_c.error("Couldn't load recipe {} as it's null or empty", (Object)resourcelocation1); -+ } else if (jsonobject.has("conditions") && !net.minecraftforge.common.crafting.CraftingHelper.processConditions(JSONUtils.func_151214_t(jsonobject, "conditions"))) { -+ field_199521_c.info("Skipping loading recipe {} as it's conditions were not met", resourcelocation1); - } else { - this.func_199509_a(func_215377_a(resourcelocation1, jsonobject)); - } + for(Entry entry : p_212853_1_.entrySet()) { + ResourceLocation resourcelocation = entry.getKey(); ++ if (resourcelocation.func_110623_a().startsWith("_")) continue; //Forge: filter anything beginning with "_" as it's used for metadata. + + try { ++ if (!net.minecraftforge.common.crafting.CraftingHelper.processConditions(entry.getValue(), "conditions")) { ++ field_199521_c.info("Skipping loading recipe {} as it's conditions were not met", resourcelocation); ++ continue; ++ } + IRecipe irecipe = func_215377_a(resourcelocation, entry.getValue()); + map.computeIfAbsent(irecipe.func_222127_g(), (p_223391_0_) -> { + return ImmutableMap.builder(); diff --git a/patches/minecraft/net/minecraft/network/datasync/EntityDataManager.java.patch b/patches/minecraft/net/minecraft/network/datasync/EntityDataManager.java.patch index 502b95656..c2ebd8ff1 100644 --- a/patches/minecraft/net/minecraft/network/datasync/EntityDataManager.java.patch +++ b/patches/minecraft/net/minecraft/network/datasync/EntityDataManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/datasync/EntityDataManager.java +++ b/net/minecraft/network/datasync/EntityDataManager.java -@@ -35,11 +35,13 @@ +@@ -36,11 +36,13 @@ } public static DataParameter func_187226_a(Class p_187226_0_, IDataSerializer p_187226_1_) { diff --git a/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch b/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch index d06db7116..ccae47260 100644 --- a/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch +++ b/patches/minecraft/net/minecraft/network/play/ServerPlayNetHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/play/ServerPlayNetHandler.java +++ b/net/minecraft/network/play/ServerPlayNetHandler.java -@@ -336,9 +336,11 @@ +@@ -337,9 +337,11 @@ } entity.func_70080_a(d3, d4, d5, f, f1); @@ -12,7 +12,7 @@ this.field_147371_a.func_179290_a(new SMoveVehiclePacket(entity)); return; } -@@ -825,7 +827,9 @@ +@@ -826,7 +828,9 @@ double d1 = this.field_147369_b.field_70163_u - ((double)blockpos.func_177956_o() + 0.5D) + 1.5D; double d2 = this.field_147369_b.field_70161_v - ((double)blockpos.func_177952_p() + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; @@ -23,7 +23,7 @@ return; } else if (blockpos.func_177956_o() >= this.field_147367_d.func_71207_Z()) { return; -@@ -865,7 +869,9 @@ +@@ -866,7 +870,9 @@ Direction direction = blockraytraceresult.func_216354_b(); this.field_147369_b.func_143004_u(); if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z() - 1 || direction != Direction.UP && blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) { @@ -34,7 +34,7 @@ this.field_147369_b.field_71134_c.func_219441_a(this.field_147369_b, serverworld, itemstack, hand, blockraytraceresult); } } else { -@@ -985,7 +991,9 @@ +@@ -986,7 +992,9 @@ if (s.startsWith("/")) { this.func_147361_d(s); } else { @@ -45,7 +45,7 @@ this.field_147367_d.func_184103_al().func_148544_a(itextcomponent, false); } -@@ -1083,6 +1091,7 @@ +@@ -1084,6 +1092,7 @@ this.field_147369_b.func_190775_a(entity, hand); } else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.INTERACT_AT) { Hand hand1 = p_147340_1_.func_186994_b(); @@ -53,16 +53,16 @@ entity.func_184199_a(this.field_147369_b, p_147340_1_.func_179712_b(), hand1); } else if (p_147340_1_.func_149565_c() == CUseEntityPacket.Action.ATTACK) { if (entity instanceof ItemEntity || entity instanceof ExperienceOrbEntity || entity instanceof AbstractArrowEntity || entity == this.field_147369_b) { -@@ -1113,7 +1122,7 @@ +@@ -1114,7 +1123,7 @@ return; } -- this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, DimensionType.OVERWORLD, false); -+ this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false); +- this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, DimensionType.field_223227_a_, false); ++ this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, this.field_147369_b.field_71093_bK, false); if (this.field_147367_d.func_71199_h()) { this.field_147369_b.func_71033_a(GameType.SPECTATOR); - this.field_147369_b.func_71121_q().func_82736_K().func_82764_b("spectatorsGenerateChunks", "false", this.field_147367_d); -@@ -1290,6 +1299,8 @@ + this.field_147369_b.func_71121_q().func_82736_K().func_223585_a(GameRules.field_223613_p).func_223570_a(false, this.field_147367_d); +@@ -1291,6 +1300,8 @@ } public void func_147349_a(CCustomPayloadPacket p_147349_1_) { diff --git a/patches/minecraft/net/minecraft/resources/VanillaPack.java.patch b/patches/minecraft/net/minecraft/resources/VanillaPack.java.patch index 633066f06..d955a3a67 100644 --- a/patches/minecraft/net/minecraft/resources/VanillaPack.java.patch +++ b/patches/minecraft/net/minecraft/resources/VanillaPack.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/resources/VanillaPack.java +++ b/net/minecraft/resources/VanillaPack.java -@@ -184,7 +184,7 @@ +@@ -183,7 +183,7 @@ try { URL url = VanillaPack.class.getResource(s); -- return url != null && FolderPack.func_195777_a(new File(url.getFile()), s) ? VanillaPack.class.getResourceAsStream(s) : null; -+ return url != null && FolderPack.func_195777_a(new File(url.getFile()), s) ? getExtraInputStream(p_195782_1_, s) : null; +- 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 @@ +@@ -199,7 +199,7 @@ @Nullable protected InputStream func_200010_a(String p_200010_1_) { @@ -18,7 +18,7 @@ } public boolean func_195764_b(ResourcePackType p_195764_1_, ResourceLocation p_195764_2_) { -@@ -222,4 +222,18 @@ +@@ -239,4 +239,18 @@ public void close() { } diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 0d18a72a2..d9fe05d6b 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -182,7 +182,7 @@ +@@ -181,7 +181,7 @@ private final GameProfileRepository field_152365_W; private final PlayerProfileCache field_152366_X; private long field_147142_T; @@ -9,7 +9,7 @@ p_213187_0_.setUncaughtExceptionHandler((p_213206_0_, p_213206_1_) -> { field_147145_h.error(p_213206_1_); }); -@@ -318,6 +318,8 @@ +@@ -317,6 +317,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); @@ -18,7 +18,7 @@ WorldInfo worldinfo = savehandler.func_75757_d(); WorldSettings worldsettings; if (worldinfo == null) { -@@ -338,7 +340,6 @@ +@@ -337,7 +339,6 @@ } this.func_195560_a(savehandler.func_75765_b(), worldinfo); @@ -26,15 +26,15 @@ this.func_213194_a(savehandler, worldinfo, worldsettings, ichunkstatuslistener); this.func_147139_a(this.func_147135_j(), true); this.func_213186_a(ichunkstatuslistener); -@@ -386,6 +387,7 @@ - if (dimensiontype != DimensionType.OVERWORLD) { +@@ -385,6 +386,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))); } } -@@ -541,6 +543,7 @@ +@@ -540,6 +542,7 @@ for(ServerWorld serverworld1 : this.func_212370_w()) { if (serverworld1 != null) { try { @@ -42,7 +42,7 @@ serverworld1.close(); } catch (IOException ioexception) { field_147145_h.error("Exception closing the level", (Throwable)ioexception); -@@ -581,6 +584,7 @@ +@@ -580,6 +583,7 @@ public void run() { try { if (this.func_71197_b()) { @@ -50,7 +50,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())); -@@ -612,7 +616,10 @@ +@@ -611,7 +615,10 @@ this.field_71304_b.func_219897_b(); this.field_71296_Q = true; } @@ -61,7 +61,7 @@ this.func_71228_a((CrashReport)null); } } catch (Throwable throwable1) { -@@ -631,6 +638,7 @@ +@@ -630,6 +637,7 @@ field_147145_h.error("We were unable to save this crash report to disk."); } @@ -69,7 +69,7 @@ this.func_71228_a(crashreport); } finally { try { -@@ -639,6 +647,7 @@ +@@ -638,6 +646,7 @@ } catch (Throwable throwable) { field_147145_h.error("Exception stopping the server", throwable); } finally { @@ -77,7 +77,7 @@ this.func_71240_o(); } -@@ -735,6 +744,7 @@ +@@ -734,6 +743,7 @@ protected void func_71217_p(BooleanSupplier p_71217_1_) { long i = Util.func_211178_c(); @@ -85,7 +85,7 @@ ++this.field_71315_w; this.func_71190_q(p_71217_1_); if (i - this.field_147142_T >= 5000000000L) { -@@ -749,6 +759,7 @@ +@@ -748,6 +758,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); this.field_147147_p.func_151318_b().func_151330_a(agameprofile); @@ -93,7 +93,7 @@ } if (this.field_71315_w % 6000 == 0) { -@@ -776,6 +787,7 @@ +@@ -775,6 +786,7 @@ long i1 = Util.func_211178_c(); this.field_213215_ap.func_181747_a(i1 - i); this.field_71304_b.func_76319_b(); @@ -101,7 +101,15 @@ } protected void func_71190_q(BooleanSupplier p_71190_1_) { -@@ -796,6 +808,7 @@ +@@ -783,6 +795,7 @@ + this.field_71304_b.func_219895_b("levels"); + + for(ServerWorld serverworld : this.func_212370_w()) { ++ 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()); +@@ -794,6 +807,7 @@ } this.field_71304_b.func_76320_a("tick"); @@ -109,7 +117,7 @@ try { serverworld.func_72835_b(p_71190_1_); -@@ -804,6 +817,7 @@ +@@ -802,12 +816,16 @@ serverworld.func_72914_a(crashreport); throw new ReportedException(crashreport); } @@ -117,8 +125,8 @@ this.field_71304_b.func_76319_b(); this.field_71304_b.func_76319_b(); -@@ -814,6 +828,8 @@ - }))[this.field_71315_w % 100] = Util.func_211178_c() - i; + } ++ tickTimes.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"); @@ -126,7 +134,7 @@ this.field_71304_b.func_219895_b("connection"); this.func_147137_ag().func_151269_c(); this.field_71304_b.func_219895_b("players"); -@@ -850,6 +866,7 @@ +@@ -844,6 +862,7 @@ OptionSpec optionspec10 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1); OptionSpec optionspec11 = optionparser.accepts("serverId").withRequiredArg(); OptionSpec optionspec12 = optionparser.nonOptions(); @@ -134,7 +142,7 @@ try { OptionSet optionset = optionparser.parse(p_main_0_); -@@ -942,7 +959,7 @@ +@@ -936,7 +955,7 @@ } public ServerWorld func_71218_a(DimensionType p_71218_1_) { @@ -143,7 +151,7 @@ } public Iterable func_212370_w() { -@@ -981,7 +998,7 @@ +@@ -975,7 +994,7 @@ } public String getServerModName() { @@ -152,14 +160,15 @@ } public CrashReport func_71230_b(CrashReport p_71230_1_) { -@@ -1516,4 +1533,14 @@ +@@ -1517,4 +1536,15 @@ } public abstract boolean func_213199_b(GameProfile p_213199_1_); + ++ private Map tickTimes = Maps.newIdentityHashMap(); + @Nullable + public long[] getTickTime(DimensionType dim) { -+ return field_71312_k.get(dim); ++ return tickTimes.get(dim); + } + + @Deprecated //Forge Internal use Only, You can screw up a lot of things if you mess with this map. diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index c6b46bbdd..9522469e1 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -95,6 +95,7 @@ +@@ -96,6 +96,7 @@ public boolean func_71197_b() throws IOException { Thread thread = new Thread("Server console handler") { public void run() { @@ -8,7 +8,7 @@ BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); String s3; -@@ -116,6 +117,7 @@ +@@ -117,6 +118,7 @@ field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } @@ -16,7 +16,7 @@ field_155771_h.info("Loading properties"); ServerProperties serverproperties = this.field_71340_o.func_219034_a(); if (this.func_71264_H()) { -@@ -173,6 +175,7 @@ +@@ -174,6 +176,7 @@ if (!PreYggdrasilConverter.func_219587_e(this)) { return false; } else { @@ -24,7 +24,7 @@ this.func_184105_a(new DedicatedPlayerList(this)); long i = Util.func_211178_c(); String s = serverproperties.field_219022_p; -@@ -194,6 +197,7 @@ +@@ -195,6 +198,7 @@ SkullTileEntity.func_184293_a(this.func_152358_ax()); SkullTileEntity.func_184294_a(this.func_147130_as()); PlayerProfileCache.func_187320_a(this.func_71266_T()); @@ -32,15 +32,15 @@ field_155771_h.info("Preparing level \"{}\"", (Object)this.func_71270_I()); JsonObject jsonobject = new JsonObject(); if (worldtype == WorldType.field_77138_c) { -@@ -206,6 +210,7 @@ +@@ -207,6 +211,7 @@ long l = Util.func_211178_c() - i; String s2 = String.format(Locale.ROOT, "%.3fs", (double)l / 1.0E9D); field_155771_h.info("Done ({})! For help, type \"help\"", (Object)s2); + this.field_211151_aa = Util.func_211177_b(); //Forge: Update server time to prevent watchdog/spaming during long load. if (serverproperties.field_219027_u != null) { - this.func_200252_aR().func_82764_b("announceAdvancements", serverproperties.field_219027_u ? "true" : "false", this); + this.func_200252_aR().func_223585_a(GameRules.field_223620_w).func_223570_a(serverproperties.field_219027_u, this); } -@@ -231,7 +236,8 @@ +@@ -232,7 +237,8 @@ } Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a()); @@ -50,7 +50,7 @@ } } -@@ -535,4 +541,9 @@ +@@ -538,4 +544,9 @@ public boolean func_213199_b(GameProfile p_213199_1_) { return false; } diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index 362b16a69..20e35ca06 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -15,7 +15,7 @@ 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.OVERWORLD).func_72912_H().func_176130_y() == null) { + 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); @@ -89,9 +90,10 @@ this.func_71245_h(true); @@ -23,7 +23,7 @@ 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.OVERWORLD).func_72912_H().func_76065_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); } diff --git a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch index 615bb9f87..cb91edb52 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch @@ -1,13 +1,13 @@ --- a/net/minecraft/server/management/PlayerList.java +++ b/net/minecraft/server/management/PlayerList.java -@@ -109,6 +109,14 @@ +@@ -110,6 +110,14 @@ playerprofilecache.func_152649_a(gameprofile); CompoundNBT compoundnbt = this.func_72380_a(p_72355_2_); ServerWorld serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + + //Forge: Make sure the dimension hasn't been deleted, if so stick them in the overworld. + if (serverworld == null) { -+ p_72355_2_.field_71093_bK = DimensionType.OVERWORLD; ++ p_72355_2_.field_71093_bK = DimensionType.field_223227_a_; + serverworld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + p_72355_2_.func_70107_b(serverworld.func_72912_H().func_76079_c(), serverworld.func_72912_H().func_76075_d(), serverworld.func_72912_H().func_76074_e()); + } @@ -15,7 +15,7 @@ p_72355_2_.func_70029_a(serverworld); p_72355_2_.field_71134_c.func_73080_a((ServerWorld)p_72355_2_.field_70170_p); String s1 = "local"; -@@ -162,8 +170,9 @@ +@@ -163,8 +171,9 @@ if (compoundnbt != null && compoundnbt.func_150297_b("RootVehicle", 10)) { CompoundNBT compoundnbt1 = compoundnbt.func_74775_l("RootVehicle"); @@ -26,7 +26,7 @@ }); if (entity1 != null) { UUID uuid = compoundnbt1.func_186857_a("Attach"); -@@ -190,6 +199,7 @@ +@@ -191,6 +200,7 @@ } p_72355_2_.func_71116_b(); @@ -34,7 +34,7 @@ } protected void func_96456_a(ServerScoreboard p_96456_1_, ServerPlayerEntity p_96456_2_) { -@@ -251,6 +261,7 @@ +@@ -252,6 +262,7 @@ compoundnbt1 = compoundnbt; p_72380_1_.func_70020_e(compoundnbt); field_148546_d.debug("loading single player"); @@ -42,7 +42,7 @@ } else { compoundnbt1 = this.field_72412_k.func_75752_b(p_72380_1_); } -@@ -259,6 +270,7 @@ +@@ -260,6 +271,7 @@ } protected void func_72391_b(ServerPlayerEntity p_72391_1_) { @@ -50,7 +50,7 @@ this.field_72412_k.func_75753_a(p_72391_1_); ServerStatisticsManager serverstatisticsmanager = this.field_148547_k.get(p_72391_1_.func_110124_au()); if (serverstatisticsmanager != null) { -@@ -273,6 +285,7 @@ +@@ -274,6 +286,7 @@ } public void func_72367_e(ServerPlayerEntity p_72367_1_) { @@ -58,7 +58,7 @@ ServerWorld serverworld = p_72367_1_.func_71121_q(); p_72367_1_.func_195066_a(Stats.field_75947_j); this.func_72391_b(p_72367_1_); -@@ -363,10 +376,18 @@ +@@ -364,10 +377,18 @@ } public ServerPlayerEntity func_72368_a(ServerPlayerEntity p_72368_1_, DimensionType p_72368_2_, boolean p_72368_3_) { @@ -68,7 +68,7 @@ + else if (!world.func_201675_m().func_76567_e()) + p_72368_2_ = world.func_201675_m().getRespawnDimension(p_72368_1_); + if (field_72400_f.func_71218_a(p_72368_2_) == null) -+ p_72368_2_ = DimensionType.OVERWORLD; ++ p_72368_2_ = DimensionType.field_223227_a_; + this.field_72404_b.remove(p_72368_1_); - p_72368_1_.func_71121_q().func_217434_e(p_72368_1_); @@ -80,7 +80,7 @@ p_72368_1_.field_71093_bK = p_72368_2_; PlayerInteractionManager playerinteractionmanager; if (this.field_72400_f.func_71242_L()) { -@@ -378,6 +399,8 @@ +@@ -379,6 +400,8 @@ ServerPlayerEntity serverplayerentity = new ServerPlayerEntity(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), playerinteractionmanager); serverplayerentity.field_71135_a = p_72368_1_.field_71135_a; serverplayerentity.func_193104_a(p_72368_1_, p_72368_3_); @@ -89,7 +89,7 @@ serverplayerentity.func_145769_d(p_72368_1_.func_145782_y()); serverplayerentity.func_184819_a(p_72368_1_.func_184591_cq()); -@@ -392,7 +415,7 @@ +@@ -393,7 +416,7 @@ if (optional.isPresent()) { Vec3d vec3d = optional.get(); serverplayerentity.func_70012_b(vec3d.field_72450_a, vec3d.field_72448_b, vec3d.field_72449_c, 0.0F, 0.0F); @@ -98,7 +98,7 @@ } else { serverplayerentity.field_71135_a.func_147359_a(new SChangeGameStatePacket(0, 0.0F)); } -@@ -416,6 +439,7 @@ +@@ -417,6 +440,7 @@ this.field_177454_f.put(serverplayerentity.func_110124_au(), serverplayerentity); serverplayerentity.func_71116_b(); serverplayerentity.func_70606_j(serverplayerentity.func_110143_aJ()); diff --git a/patches/minecraft/net/minecraft/tags/Tag.java.patch b/patches/minecraft/net/minecraft/tags/Tag.java.patch index 40ea1a6b6..022aa8faf 100644 --- a/patches/minecraft/net/minecraft/tags/Tag.java.patch +++ b/patches/minecraft/net/minecraft/tags/Tag.java.patch @@ -35,7 +35,7 @@ public static Tag.Builder func_200047_a() { return new Tag.Builder<>(); -@@ -107,6 +112,22 @@ +@@ -102,6 +107,22 @@ return this; } @@ -58,7 +58,7 @@ public Tag.Builder func_200045_a(boolean p_200045_1_) { this.field_200053_b = p_200045_1_; return this; -@@ -123,7 +144,7 @@ +@@ -118,7 +139,7 @@ } public Tag func_200051_a(ResourceLocation p_200051_1_) { @@ -67,7 +67,7 @@ } public Tag.Builder func_219783_a(Function> p_219783_1_, JsonObject p_219783_2_) { -@@ -147,8 +168,10 @@ +@@ -142,8 +163,10 @@ } this.field_200052_a.addAll(list); @@ -78,7 +78,7 @@ } public interface ITagEntry { -@@ -187,6 +210,8 @@ +@@ -182,6 +205,8 @@ public Collection func_200578_a() { return this.field_200165_a; } @@ -87,7 +87,7 @@ } public static class TagEntry implements Tag.ITagEntry { -@@ -233,5 +258,7 @@ +@@ -228,5 +253,7 @@ public void func_200576_a(JsonArray p_200576_1_, Function p_200576_2_) { p_200576_1_.add("#" + this.func_200577_a()); } diff --git a/patches/minecraft/net/minecraft/tags/TagCollection.java.patch b/patches/minecraft/net/minecraft/tags/TagCollection.java.patch index 18ef95308..2693e77e3 100644 --- a/patches/minecraft/net/minecraft/tags/TagCollection.java.patch +++ b/patches/minecraft/net/minecraft/tags/TagCollection.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tags/TagCollection.java +++ b/net/minecraft/tags/TagCollection.java -@@ -22,8 +22,6 @@ +@@ -27,8 +27,6 @@ import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Util; @@ -9,7 +9,7 @@ import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -67,7 +65,6 @@ +@@ -64,7 +62,6 @@ return this.field_199921_d.keySet(); } diff --git a/patches/minecraft/net/minecraft/util/registry/Registry.java.patch b/patches/minecraft/net/minecraft/util/registry/Registry.java.patch index d966ba009..aebc91dcd 100644 --- a/patches/minecraft/net/minecraft/util/registry/Registry.java.patch +++ b/patches/minecraft/net/minecraft/util/registry/Registry.java.patch @@ -41,7 +41,7 @@ return Items.field_190931_a; }); - public static final DefaultedRegistry field_212621_j = func_222933_a("potion", "empty", () -> { -+ @Deprecated public static final DefaultedRegistry field_212621_j = forgeDefaulted("potion", Potion.class, () -> { ++ @Deprecated public static final DefaultedRegistry field_212621_j = forgeDefaulted("potion", Potion.class, () -> { return Potions.field_185229_a; }); - public static final Registry> field_218377_o = func_222935_a("carver", () -> { @@ -81,8 +81,8 @@ return ChunkGeneratorType.field_205489_f; }); - public static final Registry field_212622_k = func_222935_a("dimension_type", () -> { -+ public static final Registry field_212622_k = func_222939_a("dimension_type", net.minecraftforge.common.DimensionManager.getRegistry(), () -> { - return DimensionType.OVERWORLD; ++ @Deprecated public static final Registry field_212622_k = func_222939_a("dimension_type", net.minecraftforge.common.DimensionManager.getRegistry(), () -> { + return DimensionType.field_223227_a_; }); - public static final DefaultedRegistry field_212620_i = func_222933_a("motive", "kebab", () -> { + @Deprecated public static final DefaultedRegistry field_212620_i = forgeDefaulted("motive", PaintingType.class, () -> { @@ -93,7 +93,7 @@ }); - public static final DefaultedRegistry field_218360_A = func_222933_a("chunk_status", "empty", () -> { + @Deprecated public static final DefaultedRegistry field_218360_A = forgeDefaulted("chunk_status", ChunkStatus.class, () -> { - return ChunkStatus.EMPTY; + return ChunkStatus.field_223226_a_; }); public static final Registry> field_218361_B = func_222935_a("structure_feature", () -> { @@ -148,37 +152,37 @@ @@ -150,7 +150,7 @@ + private static > Registry forge(String name, Class cls, Supplier def) { + return func_222939_a(name, net.minecraftforge.registries.GameData.getWrapper(cls), def); + } -+ ++ + private static > DefaultedRegistry forgeDefaulted(String name, Class cls, Supplier def) { + return Registry.>func_222939_a(name, net.minecraftforge.registries.GameData.getWrapperDefaulted(cls), def); + } diff --git a/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch b/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch index e2d8894bc..4baa28593 100644 --- a/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch +++ b/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch @@ -7,5 +7,5 @@ - + net.minecraftforge.fml.server.LanguageHook.captureLanguageMap(this.field_74816_c); this.field_150511_e = Util.func_211177_b(); - } catch (JsonParseException jsonparseexception) { - field_201045_a.error("Couldn't read strings from /assets/minecraft/lang/en_us.json", (Throwable)jsonparseexception); + } 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/minecraft/net/minecraft/village/VillageSiege.java.patch b/patches/minecraft/net/minecraft/village/VillageSiege.java.patch index a44c6d8d5..456a7dc18 100644 --- a/patches/minecraft/net/minecraft/village/VillageSiege.java.patch +++ b/patches/minecraft/net/minecraft/village/VillageSiege.java.patch @@ -1,14 +1,17 @@ --- a/net/minecraft/village/VillageSiege.java +++ b/net/minecraft/village/VillageSiege.java -@@ -85,6 +85,7 @@ - - Vec3d vec3d = this.func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)); - if (vec3d != null) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.village.VillageSiegeEvent(this, field_75537_a, playerentity, vec3d))) return false; - break; - } - } -@@ -101,7 +102,7 @@ +@@ -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_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)) != null) { ++ Vec3d siegeLocation = this.func_179867_a(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, field_75537_a, 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 { @@ -17,12 +20,3 @@ zombieentity.func_213386_a(this.field_75537_a, this.field_75537_a.func_175649_E(new BlockPos(zombieentity)), SpawnReason.EVENT, (ILivingEntityData)null, (CompoundNBT)null); } catch (Exception exception) { exception.printStackTrace(); -@@ -117,7 +118,7 @@ - private Vec3d func_179867_a(BlockPos p_179867_1_) { - for(int i = 0; i < 10; ++i) { - BlockPos blockpos = p_179867_1_.func_177982_a(this.field_75537_a.field_73012_v.nextInt(16) - 8, this.field_75537_a.field_73012_v.nextInt(6) - 3, this.field_75537_a.field_73012_v.nextInt(16) - 8); -- if (this.field_75537_a.func_217483_b_(blockpos) && WorldEntitySpawner.func_209382_a(EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, this.field_75537_a, blockpos, (EntityType)null)) { -+ if (this.field_75537_a.func_217483_b_(blockpos) && WorldEntitySpawner.func_209382_a(EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, this.field_75537_a, blockpos, EntityType.field_200725_aD)) { //Forge: MC-154328 passing in null always returns false, so pass in ZOMBIE - return new Vec3d((double)blockpos.func_177958_n(), (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p()); - } - } diff --git a/patches/minecraft/net/minecraft/world/IWorld.java.patch b/patches/minecraft/net/minecraft/world/IWorld.java.patch index 8f50dfac4..dcd6808fe 100644 --- a/patches/minecraft/net/minecraft/world/IWorld.java.patch +++ b/patches/minecraft/net/minecraft/world/IWorld.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/IWorld.java +++ b/net/minecraft/world/IWorld.java -@@ -24,16 +24,16 @@ +@@ -25,16 +25,16 @@ long func_72905_C(); default float func_130001_d() { diff --git a/patches/minecraft/net/minecraft/world/IWorldReader.java.patch b/patches/minecraft/net/minecraft/world/IWorldReader.java.patch index 5926cdaaf..20a64d6af 100644 --- a/patches/minecraft/net/minecraft/world/IWorldReader.java.patch +++ b/patches/minecraft/net/minecraft/world/IWorldReader.java.patch @@ -9,7 +9,7 @@ } default boolean func_175710_j(BlockPos p_175710_1_) { -@@ -241,6 +241,10 @@ +@@ -233,6 +233,10 @@ return this.func_217354_b(p_175667_1_.func_177958_n() >> 4, p_175667_1_.func_177952_p() >> 4); } diff --git a/patches/minecraft/net/minecraft/world/ServerWorld.java.patch b/patches/minecraft/net/minecraft/world/ServerWorld.java.patch index 5d88f73a4..df4a3f01c 100644 --- a/patches/minecraft/net/minecraft/world/ServerWorld.java.patch +++ b/patches/minecraft/net/minecraft/world/ServerWorld.java.patch @@ -20,26 +20,24 @@ public ServerWorld(MinecraftServer p_i50703_1_, Executor p_i50703_2_, SaveHandler p_i50703_3_, WorldInfo p_i50703_4_, DimensionType p_i50703_5_, IProfiler p_i50703_6_, IChunkStatusListener p_i50703_7_) { super(p_i50703_4_, p_i50703_5_, (p_217442_4_, p_217442_5_) -> { -- return new ServerChunkProvider((ServerWorld)p_217442_4_, p_i50703_3_.func_75765_b(), p_i50703_3_.func_197718_i(), p_i50703_3_.func_186340_h(), p_i50703_2_, p_217442_5_.func_186060_c(), p_i50703_1_.func_184103_al().func_72395_o(), p_i50703_1_.func_184103_al().func_72395_o() - 2, p_i50703_7_, () -> { -+ return new ServerChunkProvider((ServerWorld)p_217442_4_, p_i50703_3_.func_75765_b(), p_i50703_3_.func_197718_i(), p_i50703_3_.func_186340_h(), p_i50703_2_, p_217442_4_.func_175624_G().createChunkGenerator(p_217442_4_), p_i50703_1_.func_184103_al().func_72395_o(), p_i50703_1_.func_184103_al().func_72395_o() - 2, p_i50703_7_, () -> { - return p_i50703_1_.func_71218_a(DimensionType.OVERWORLD).func_217481_x(); +- return new ServerChunkProvider((ServerWorld)p_217442_4_, p_i50703_3_.func_75765_b(), p_i50703_3_.func_197718_i(), p_i50703_3_.func_186340_h(), p_i50703_2_, p_217442_5_.func_186060_c(), p_i50703_1_.func_184103_al().func_72395_o(), p_i50703_7_, () -> { ++ return new ServerChunkProvider((ServerWorld)p_217442_4_, p_i50703_3_.func_75765_b(), p_i50703_3_.func_197718_i(), p_i50703_3_.func_186340_h(), p_i50703_2_, p_217442_4_.func_175624_G().createChunkGenerator(p_217442_4_), p_i50703_1_.func_184103_al().func_72395_o(), p_i50703_7_, () -> { + return p_i50703_1_.func_71218_a(DimensionType.field_223227_a_).func_217481_x(); }); }, p_i50703_6_, false); -@@ -166,6 +170,7 @@ - } - - this.field_217496_L = this.field_73011_w.func_186058_p() == DimensionType.OVERWORLD ? new WanderingTraderSpawner(this) : null; -+ this.initCapabilities(); - } +@@ -170,11 +174,13 @@ public void func_72835_b(BooleanSupplier p_72835_1_) { -@@ -175,6 +180,7 @@ + IProfiler iprofiler = this.func_217381_Z(); ++ this.initCapabilities(); + this.field_211159_Q = true; + iprofiler.func_76320_a("world border"); this.func_175723_af().func_212673_r(); iprofiler.func_219895_b("weather"); boolean flag = this.func_72896_J(); + this.field_73011_w.updateWeather(() -> { if (this.field_73011_w.func_191066_m()) { - if (this.func_82736_K().func_82766_b("doWeatherCycle")) { + if (this.func_82736_K().func_223586_b(GameRules.field_223617_t)) { int i = this.field_72986_A.func_176133_A(); @@ -236,6 +242,7 @@ @@ -76,7 +74,7 @@ @@ -265,7 +276,7 @@ })) { this.field_73068_P = false; - if (this.func_82736_K().func_82766_b("doDaylightCycle")) { + if (this.func_82736_K().func_223586_b(GameRules.field_223607_j)) { - long l = this.field_72986_A.func_76073_f() + 24000L; + long l = this.func_72820_D() + 24000L; this.func_72877_b(l - l % 24000L); @@ -186,10 +184,10 @@ if (!(entity instanceof MobEntity) || !((MobEntity)entity).func_104002_bU()) { - EntityClassification entityclassification = entity.func_200600_R().func_220339_d(); + EntityClassification entityclassification = entity.getClassification(true); - if (entityclassification != EntityClassification.MISC && this.func_72863_F().func_217204_a(entity)) { - object2intmap.computeInt(entityclassification, (p_217480_0_, p_217480_1_) -> { - return 1 + (p_217480_1_ == null ? 0 : p_217480_1_); -@@ -840,6 +859,7 @@ + if (entityclassification != EntityClassification.MISC && this.func_72863_F().func_223435_b(entity)) { + object2intmap.mergeInt(entityclassification, 1, Integer::sum); + } +@@ -838,6 +857,7 @@ } else if (this.func_217478_l(p_72838_1_)) { return false; } else { @@ -197,7 +195,7 @@ IChunk ichunk = this.func_217353_a(MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D), MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D), ChunkStatus.field_222617_m, p_72838_1_.field_98038_p); if (!(ichunk instanceof Chunk)) { return false; -@@ -855,6 +875,7 @@ +@@ -853,6 +873,7 @@ if (this.func_217478_l(p_217440_1_)) { return false; } else { @@ -205,7 +203,7 @@ this.func_217465_m(p_217440_1_); return true; } -@@ -891,11 +912,15 @@ +@@ -889,11 +910,15 @@ } public void func_217484_g(Entity p_217484_1_) { @@ -222,7 +220,7 @@ this.field_175741_N.remove(p_217484_1_.func_110124_au()); this.func_72863_F().func_217226_b(p_217484_1_); -@@ -909,6 +934,7 @@ +@@ -907,6 +932,7 @@ this.field_217495_I.remove(((MobEntity)p_217484_1_).func_70661_as()); } @@ -230,7 +228,7 @@ } private void func_217465_m(Entity p_217465_1_) { -@@ -929,9 +955,13 @@ +@@ -927,9 +953,13 @@ } } @@ -244,7 +242,7 @@ if (this.field_217492_a) { throw new IllegalStateException("Removing entity while ticking!"); } else { -@@ -950,7 +980,10 @@ +@@ -948,7 +978,10 @@ } public void func_217434_e(ServerPlayerEntity p_217434_1_) { @@ -256,7 +254,7 @@ this.func_217467_h(p_217434_1_); this.func_72854_c(); } -@@ -975,10 +1008,20 @@ +@@ -973,10 +1006,20 @@ } public void func_184148_a(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) { @@ -277,7 +275,7 @@ this.field_73061_a.func_184103_al().func_148543_a(p_217384_1_, p_217384_2_.field_70165_t, p_217384_2_.field_70163_u, p_217384_2_.field_70161_v, p_217384_5_ > 1.0F ? (double)(16.0F * p_217384_5_) : 16.0D, this.field_73011_w.func_186058_p(), new SSpawnMovingSoundEffectPacket(p_217384_3_, p_217384_4_, p_217384_2_, p_217384_5_, p_217384_6_)); } -@@ -1014,6 +1057,7 @@ +@@ -1012,6 +1055,7 @@ public Explosion func_217401_a(@Nullable Entity p_217401_1_, DamageSource p_217401_2_, double p_217401_3_, double p_217401_5_, double p_217401_7_, float p_217401_9_, boolean p_217401_10_, Explosion.Mode p_217401_11_) { Explosion explosion = new Explosion(this, p_217401_1_, p_217401_3_, p_217401_5_, p_217401_7_, p_217401_9_, p_217401_10_, p_217401_11_); @@ -285,7 +283,7 @@ if (p_217401_2_ != null) { explosion.func_199592_a(p_217401_2_); } -@@ -1264,4 +1308,15 @@ +@@ -1261,4 +1305,15 @@ public void func_217489_a(IReputationType p_217489_1_, Entity p_217489_2_, IReputationTracking p_217489_3_) { p_217489_3_.func_213739_a(p_217489_1_, p_217489_2_); } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 0671392e1..e4edd896e 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -532,7 +532,7 @@ } public CrashReportCategory func_72914_a(CrashReport p_72914_1_) { -@@ -1178,16 +1271,15 @@ +@@ -1180,16 +1273,15 @@ public abstract Scoreboard func_96441_U(); public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) { @@ -553,7 +553,7 @@ blockstate.func_215697_a(this, blockpos, p_175666_2_, p_175666_1_, false); } } -@@ -1266,4 +1358,16 @@ +@@ -1268,4 +1360,16 @@ public BlockPos func_205770_a(Heightmap.Type p_205770_1_, BlockPos p_205770_2_) { return new BlockPos(p_205770_2_.func_177958_n(), this.func_201676_a(p_205770_1_, p_205770_2_.func_177958_n(), p_205770_2_.func_177952_p()), p_205770_2_.func_177952_p()); } diff --git a/patches/minecraft/net/minecraft/world/chunk/ChunkHolder.java.patch b/patches/minecraft/net/minecraft/world/chunk/ChunkHolder.java.patch index 66ef643c0..4bb18b60f 100644 --- a/patches/minecraft/net/minecraft/world/chunk/ChunkHolder.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/ChunkHolder.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/chunk/ChunkHolder.java +++ b/net/minecraft/world/chunk/ChunkHolder.java -@@ -123,7 +123,7 @@ +@@ -127,7 +127,7 @@ Chunk chunk = this.func_219298_c(); if (chunk != null) { this.field_219322_q |= 1 << (p_219279_2_ >> 4); @@ -9,7 +9,7 @@ short short1 = (short)(p_219279_1_ << 12 | p_219279_3_ << 8 | p_219279_2_); for(int i = 0; i < this.field_219321_p; ++i) { -@@ -132,6 +132,8 @@ +@@ -136,6 +136,8 @@ } } @@ -18,7 +18,7 @@ this.field_219320_o[this.field_219321_p++] = short1; } -@@ -154,7 +156,7 @@ +@@ -158,7 +160,7 @@ public void func_219274_a(Chunk p_219274_1_) { if (this.field_219321_p != 0 || this.field_219325_t != 0 || this.field_219324_s != 0) { World world = p_219274_1_.func_177412_p(); @@ -27,7 +27,7 @@ this.field_219323_r = -1; } -@@ -177,20 +179,19 @@ +@@ -181,20 +183,19 @@ int k = (this.field_219320_o[0] >> 8 & 15) + this.field_219319_n.field_77275_b * 16; BlockPos blockpos = new BlockPos(l, j1, k); this.func_219293_a(new SChangeBlockPacket(world, blockpos), false); diff --git a/patches/minecraft/net/minecraft/world/chunk/ChunkManager.java.patch b/patches/minecraft/net/minecraft/world/chunk/ChunkManager.java.patch index 14bb7bfc3..4b2071b07 100644 --- a/patches/minecraft/net/minecraft/world/chunk/ChunkManager.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/ChunkManager.java.patch @@ -40,11 +40,11 @@ this.func_219100_a(chunkpos, compoundnbt1); return true; } catch (Exception exception) { -@@ -760,6 +765,7 @@ +@@ -756,6 +761,7 @@ for(int l = i - this.field_219247_A; l <= i + this.field_219247_A; ++l) { for(int k = j - this.field_219247_A; k <= j + this.field_219247_A; ++k) { ChunkPos chunkpos = new ChunkPos(l, k); + net.minecraftforge.event.ForgeEventFactory.fireChunkWatch(p_219234_2_, p_219234_1_, chunkpos, field_219255_i); - this.func_219199_a(p_219234_1_, chunkpos, new IPacket[2], !p_219234_2_ && !flag1, p_219234_2_ && !flag); + this.func_219199_a(p_219234_1_, chunkpos, new IPacket[2], !p_219234_2_, p_219234_2_); } } diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch index b59145452..c2d353027 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkSerializer.java.patch @@ -8,7 +8,7 @@ } else { ChunkPrimer chunkprimer = new ChunkPrimer(p_222656_3_, upgradedata, achunksection, chunkprimerticklist1, chunkprimerticklist); ichunk = chunkprimer; -@@ -313,12 +314,22 @@ +@@ -314,12 +315,22 @@ for(int k = 0; k < chunk.func_177429_s().length; ++k) { for(Entity entity : chunk.func_177429_s()[k]) { CompoundNBT compoundnbt3 = new CompoundNBT(); @@ -31,7 +31,7 @@ } else { ChunkPrimer chunkprimer = (ChunkPrimer)p_222645_1_; listnbt2.addAll(chunkprimer.func_201652_l()); -@@ -362,6 +373,7 @@ +@@ -363,6 +374,7 @@ compoundnbt1.func_218657_a("Heightmaps", compoundnbt6); compoundnbt1.func_218657_a("Structures", func_222649_a(chunkpos, p_222645_1_.func_201609_c(), p_222645_1_.func_201604_d())); diff --git a/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch b/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch index 442c92611..850fe2eec 100644 --- a/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch @@ -6,9 +6,9 @@ -public class DimensionType implements IDynamicSerializable { +public class DimensionType extends net.minecraftforge.registries.ForgeRegistryEntry implements IDynamicSerializable { - public static final DimensionType OVERWORLD = func_212677_a("overworld", new DimensionType(1, "", "", OverworldDimension::new, true)); - public static final DimensionType NETHER = func_212677_a("the_nether", new DimensionType(0, "_nether", "DIM-1", NetherDimension::new, false)); - public static final DimensionType THE_END = func_212677_a("the_end", new DimensionType(2, "_end", "DIM1", EndDimension::new, false)); + public static final DimensionType field_223227_a_ = func_212677_a("overworld", new DimensionType(1, "", "", OverworldDimension::new, true)); + public static final DimensionType field_223228_b_ = func_212677_a("the_nether", new DimensionType(0, "_nether", "DIM-1", NetherDimension::new, false)); + public static final DimensionType field_223229_c_ = func_212677_a("the_end", new DimensionType(2, "_end", "DIM1", EndDimension::new, false)); @@ -19,17 +19,31 @@ private final String field_212682_f; private final BiFunction field_201038_g; diff --git a/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch index fb31d96a7..4719be695 100644 --- a/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch @@ -4,7 +4,7 @@ public EndDimension(World p_i49932_1_, DimensionType p_i49932_2_) { super(p_i49932_1_, p_i49932_2_); -- CompoundNBT compoundnbt = p_i49932_1_.func_72912_H().func_186347_a(DimensionType.THE_END); +- 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; @@ -16,7 +16,7 @@ } - public DimensionType func_186058_p() { -- return DimensionType.THE_END; +- return DimensionType.field_223229_c_; - } - public void func_186057_q() { @@ -25,8 +25,8 @@ compoundnbt.func_218657_a("DragonFight", this.field_186064_g.func_186088_a()); } -- this.field_76579_a.func_72912_H().func_186345_a(DimensionType.THE_END, compoundnbt); -+ this.field_76579_a.func_72912_H().func_186345_a(field_76579_a.func_201675_m().func_186058_p(), compoundnbt); +- 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/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch index b6dad12d4..88b2931af 100644 --- a/patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch @@ -6,6 +6,6 @@ } - - public DimensionType func_186058_p() { -- return DimensionType.NETHER; +- return DimensionType.field_223228_b_; - } } diff --git a/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch index ec033970d..ce637c4f0 100644 --- a/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch @@ -5,7 +5,7 @@ } - public DimensionType func_186058_p() { -- return DimensionType.OVERWORLD; +- return DimensionType.field_223227_a_; - } - public ChunkGenerator func_186060_c() { diff --git a/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch b/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch index 5aa1f3eb9..5b0b68b7a 100644 --- a/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/spawner/AbstractSpawner.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/spawner/AbstractSpawner.java +++ b/net/minecraft/world/spawner/AbstractSpawner.java -@@ -126,7 +126,7 @@ +@@ -127,7 +127,7 @@ entity.func_70012_b(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, world.field_73012_v.nextFloat() * 360.0F, 0.0F); if (entity instanceof MobEntity) { MobEntity mobentity = (MobEntity)entity; @@ -9,7 +9,7 @@ continue; } -@@ -282,4 +282,9 @@ +@@ -283,4 +283,9 @@ public double func_177223_e() { return this.field_98284_d; } diff --git a/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch b/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch index 2da3bc6e5..a1ead2ee0 100644 --- a/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/spawner/WorldEntitySpawner.java.patch @@ -7,7 +7,7 @@ - biome$spawnlistentry = func_222264_a(chunkgenerator, p_222263_0_, p_222263_1_.field_73012_v, blockpos$mutableblockpos); + biome$spawnlistentry = getSpawnList(chunkgenerator, p_222263_0_, p_222263_1_.field_73012_v, blockpos$mutableblockpos, p_222263_1_); if (biome$spawnlistentry == null) { - break label116; + break label117; } @@ -95,7 +95,7 @@ } @@ -15,7 +15,7 @@ EntityType entitytype = biome$spawnlistentry.field_200702_b; - if (!entitytype.func_200720_b() || !func_222261_a(chunkgenerator, p_222263_0_, biome$spawnlistentry, blockpos$mutableblockpos)) { + if (!entitytype.func_200720_b() || !getSpawnList(chunkgenerator, p_222263_0_, biome$spawnlistentry, blockpos$mutableblockpos, p_222263_1_)) { - break label108; + break label109; } @@ -118,15 +118,17 @@ @@ -24,8 +24,8 @@ mobentity.func_70012_b((double)f, (double)k, (double)f1, p_222263_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); - if (playerentity.func_70092_e((double)f, (double)k, (double)f1) > 16384.0D && mobentity.func_213397_c(playerentity.func_70092_e((double)f, (double)k, (double)f1)) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_)) { + int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(mobentity, p_222263_1_, f, k, f1, null); -+ if (playerentity.func_70092_e((double)f, (double)k, (double)f1) > 16384.0D && (canSpawn == 1 || (canSpawn == 0 && mobentity.func_213397_c(playerentity.func_70092_e((double)f, (double)k, (double)f1)))) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_)) { - break label108; ++ if (playerentity.func_70092_e((double)f, (double)k, (double)f1) > 16384.0D && (canSpawn == -1 || (canSpawn == 0 && (mobentity.func_213397_c(playerentity.func_70092_e((double)f, (double)k, (double)f1)) || !mobentity.func_213380_a(p_222263_1_, SpawnReason.NATURAL) || !mobentity.func_205019_a(p_222263_1_))))) { + break label109; } + if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mobentity, p_222263_1_, f, k, f1, null)) @@ -56,10 +56,10 @@ return list.isEmpty() ? false : list.contains(p_222261_2_); } -@@ -182,6 +186,13 @@ - - public static boolean func_209382_a(EntitySpawnPlacementRegistry.PlacementType p_209382_0_, IWorldReader p_209382_1_, BlockPos p_209382_2_, @Nullable EntityType p_209382_3_) { - if (p_209382_3_ != null && p_209382_1_.func_175723_af().func_177746_a(p_209382_2_)) { +@@ -184,6 +188,13 @@ + if (p_209382_0_ == EntitySpawnPlacementRegistry.PlacementType.NO_RESTRICTIONS) { + return true; + } else if (p_209382_3_ != null && p_209382_1_.func_175723_af().func_177746_a(p_209382_2_)) { + return p_209382_0_.canSpawnAt(p_209382_1_, p_209382_2_, p_209382_3_); + } + return false; @@ -70,7 +70,7 @@ BlockState blockstate = p_209382_1_.func_180495_p(p_209382_2_); IFluidState ifluidstate = p_209382_1_.func_204610_c(p_209382_2_); BlockPos blockpos = p_209382_2_.func_177984_a(); -@@ -192,14 +203,12 @@ +@@ -194,14 +205,12 @@ case ON_GROUND: default: BlockState blockstate1 = p_209382_1_.func_180495_p(blockpos1); @@ -86,7 +86,7 @@ } } -@@ -242,6 +251,7 @@ +@@ -244,6 +253,7 @@ entity.func_70012_b(d0, (double)blockpos.func_177956_o(), d1, p_77191_4_.nextFloat() * 360.0F, 0.0F); if (entity instanceof MobEntity) { MobEntity mobentity = (MobEntity)entity; diff --git a/patches/minecraft/net/minecraft/world/storage/DimensionSavedDataManager.java.patch b/patches/minecraft/net/minecraft/world/storage/DimensionSavedDataManager.java.patch index 70c93465b..ad1d707bd 100644 --- a/patches/minecraft/net/minecraft/world/storage/DimensionSavedDataManager.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/DimensionSavedDataManager.java.patch @@ -1,20 +1,16 @@ --- a/net/minecraft/world/storage/DimensionSavedDataManager.java +++ b/net/minecraft/world/storage/DimensionSavedDataManager.java -@@ -47,6 +47,7 @@ +@@ -47,9 +47,13 @@ @Nullable public T func_215753_b(Supplier p_215753_1_, String p_215753_2_) { WorldSavedData worldsaveddata = this.field_212778_c.get(p_215753_2_); + if (worldsaveddata == net.minecraftforge.common.util.DummyWorldSaveData.DUMMY) return null; - if (worldsaveddata == null) { - try { - File file1 = this.func_215754_a(p_215753_2_); -@@ -55,6 +56,9 @@ - CompoundNBT compoundnbt = this.func_215755_a(p_215753_2_, SharedConstants.func_215069_a().getWorldVersion()); - worldsaveddata.func_76184_a(compoundnbt.func_74775_l("data")); - this.field_212778_c.put(p_215753_2_, worldsaveddata); -+ } else { -+ this.field_212778_c.put(p_215753_2_, net.minecraftforge.common.util.DummyWorldSaveData.DUMMY); -+ return null; - } - } catch (Exception exception) { - field_212776_a.error("Error loading saved data: {}", p_215753_2_, exception); + if (worldsaveddata == null && !this.field_212778_c.containsKey(p_215753_2_)) { + worldsaveddata = this.func_223409_c(p_215753_1_, p_215753_2_); + this.field_212778_c.put(p_215753_2_, worldsaveddata); ++ } else { ++ this.field_212778_c.put(p_215753_2_, net.minecraftforge.common.util.DummyWorldSaveData.DUMMY); ++ return null; + } + + return (T)worldsaveddata; diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch index cddaae593..50b5efd5d 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/world/storage/MapData.java +++ b/net/minecraft/world/storage/MapData.java -@@ -210,8 +210,8 @@ +@@ -216,8 +216,8 @@ if (f >= -63.0F && f1 >= -63.0F && f <= 63.0F && f1 <= 63.0F) { p_191095_8_ = p_191095_8_ + (p_191095_8_ < 0.0D ? -8.0D : 8.0D); b2 = (byte)((int)(p_191095_8_ * 16.0D / 360.0D)); -- if (this.field_76200_c == DimensionType.NETHER && p_191095_2_ != null) { +- if (this.field_76200_c == DimensionType.field_223228_b_ && p_191095_2_ != null) { - int l = (int)(p_191095_2_.func_72912_H().func_76073_f() / 10L); + if (p_191095_2_ != null && p_191095_2_.func_201672_e().field_73011_w.shouldMapSpin(p_191095_3_, p_191095_4_, p_191095_6_, p_191095_8_)) { + int l = (int)(p_191095_2_.func_201672_e().func_72820_D() / 10L); diff --git a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch index 83666be1d..9e9ca3627 100644 --- a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/storage/WorldInfo.java +++ b/net/minecraft/world/storage/WorldInfo.java -@@ -349,6 +349,7 @@ +@@ -348,6 +348,7 @@ CompoundNBT compoundnbt1 = new CompoundNBT(); for(Entry entry : this.field_186348_N.entrySet()) { diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch index c81bee0b1..3e8800382 100644 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch @@ -1,11 +1,12 @@ --- a/net/minecraft/world/storage/loot/LootTableManager.java +++ b/net/minecraft/world/storage/loot/LootTableManager.java -@@ -45,7 +45,7 @@ - ResourceLocation resourcelocation1 = new ResourceLocation(resourcelocation.func_110624_b(), s.substring(field_195435_a, s.length() - field_195436_b)); +@@ -43,7 +43,8 @@ - try (IResource iresource = p_195410_1_.func_199002_a(resourcelocation)) { -- LootTable loottable = JSONUtils.func_188178_a(field_186526_b, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), LootTable.class); -+ LootTable loottable = net.minecraftforge.common.ForgeHooks.loadLootTable(field_186526_b, resourcelocation, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), iresource.func_199026_d().equals("Default"), this); - if (loottable != null) { - this.field_186527_c.put(resourcelocation1, loottable); - } + p_212853_1_.forEach((p_223385_1_, p_223385_2_) -> { + try { +- LootTable loottable = field_186526_b.fromJson(p_223385_2_, LootTable.class); ++ net.minecraft.resources.IResource res = p_212853_2_.func_199002_a(getPreparedPath(p_223385_1_)); ++ LootTable loottable = net.minecraftforge.common.ForgeHooks.loadLootTable(field_186526_b, p_223385_1_, p_223385_2_, res == null || !res.func_199026_d().equals("Default"), this); + builder.put(p_223385_1_, loottable); + } catch (Exception exception) { + field_186525_a.error("Couldn't parse loot table {}", p_223385_1_, exception); diff --git a/src/main/java/net/minecraftforge/common/DimensionManager.java b/src/main/java/net/minecraftforge/common/DimensionManager.java index 5aa6c1065..ce9f3a975 100644 --- a/src/main/java/net/minecraftforge/common/DimensionManager.java +++ b/src/main/java/net/minecraftforge/common/DimensionManager.java @@ -198,11 +198,11 @@ public class DimensionManager @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.isTrue(dim != DimensionType.field_223227_a_, "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); + ServerWorld overworld = getWorld(server, DimensionType.field_223227_a_, false, false); Validate.notNull(overworld, "Cannot Hotload Dim: Overworld is not Loaded!"); @SuppressWarnings("resource") diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 1065afc1b..485666995 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -802,7 +802,7 @@ public class ForgeHooks } @Nullable - public static LootTable loadLootTable(Gson gson, ResourceLocation name, String data, boolean custom, LootTableManager lootTableManager) + public static LootTable loadLootTable(Gson gson, ResourceLocation name, JsonObject data, boolean custom, LootTableManager lootTableManager) { Deque que = lootContext.get(); if (que == null) @@ -1151,4 +1151,10 @@ public class ForgeHooks } return id; } + + public static boolean canEntityDestroy(World world, BlockPos pos, LivingEntity entity) + { + BlockState state = world.getBlockState(pos); + return ForgeEventFactory.getMobGriefingEvent(world, entity) && state.canEntityDestroy(world, pos, entity) && ForgeEventFactory.onEntityDestroyBlock(entity, pos, state); + } } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java b/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java index cf10ae07d..c802a4204 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java @@ -290,7 +290,7 @@ public interface IForgeDimension */ default boolean shouldMapSpin(String entity, double x, double z, double rotation) { - return getDimension().getType() == DimensionType.NETHER; + return getDimension().getType() == DimensionType.field_223228_b_; } /** diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeWorldType.java b/src/main/java/net/minecraftforge/common/extensions/IForgeWorldType.java index 8c7007203..1f573ec3c 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeWorldType.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeWorldType.java @@ -25,6 +25,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.CreateBuffetWorldScreen; import net.minecraft.client.gui.screen.CreateFlatWorldScreen; import net.minecraft.client.gui.screen.CreateWorldScreen; +import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.world.WorldType; import net.minecraft.world.gen.ChunkGenerator; @@ -39,7 +40,6 @@ import net.minecraft.world.gen.layer.ZoomLayer; import net.minecraft.world.gen.layer.LayerUtil; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fml.client.config.IArrayEntry; public interface IForgeWorldType { @@ -70,7 +70,7 @@ public interface IForgeWorldType mc.displayGuiScreen(new CreateBuffetWorldScreen(gui, gui.chunkProviderSettingsJson)); } - default boolean handleSlimeSpawnReduction(java.util.Random random, World world) + default boolean handleSlimeSpawnReduction(java.util.Random random, IWorld world) { return this == WorldType.FLAT ? random.nextInt(4) != 1 : false; } diff --git a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java index f364058b2..5b8f3d8d5 100644 --- a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java +++ b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -64,6 +64,7 @@ import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.text.ChatType; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.Explosion; +import net.minecraft.world.GameRules; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.world.ServerWorld; @@ -670,7 +671,7 @@ public class ForgeEventFactory MinecraftForge.EVENT_BUS.post(event); Result result = event.getResult(); - return result == Result.DEFAULT ? world.getGameRules().getBoolean("mobGriefing") : result == Result.ALLOW; + return result == Result.DEFAULT ? world.getGameRules().func_223586_b(GameRules.field_223599_b) : result == Result.ALLOW; } public static boolean saplingGrowTree(IWorld world, Random rand, BlockPos pos)