[1.16.x] Fixes for Bamboo, Enchantments and Conduits, small adjustments to bring some patches closer to the vanilla code. (#7239)

This commit is contained in:
Edwin Mindcraft 2020-09-08 22:03:36 +02:00 committed by GitHub
parent 47f05a4fcd
commit 887bc37209
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 12 deletions

View file

@ -24,7 +24,7 @@
@Deprecated @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_) { public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
- if (this.func_235695_q_() && !p_196243_1_.func_203425_a(p_196243_4_.func_177230_c())) { - if (this.func_235695_q_() && !p_196243_1_.func_203425_a(p_196243_4_.func_177230_c())) {
+ if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() || !p_196243_4_.hasTileEntity())) { + if (p_196243_1_.hasTileEntity() && (p_196243_1_.func_203425_a(p_196243_4_.func_177230_c()) || !p_196243_4_.hasTileEntity())) {
p_196243_2_.func_175713_t(p_196243_3_); p_196243_2_.func_175713_t(p_196243_3_);
} }

View file

@ -13,7 +13,7 @@
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) { public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
RailShape railshape = p_220053_1_.func_203425_a(this) ? p_220053_1_.func_177229_b(this.func_176560_l()) : null; RailShape railshape = p_220053_1_.func_203425_a(this) ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
+ RailShape railShape2 = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null; + RailShape railShape2 = p_220053_1_.func_203425_a(this) ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a; return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
} }

View file

@ -1,11 +1,14 @@
--- a/net/minecraft/block/BambooBlock.java --- a/net/minecraft/block/BambooBlock.java
+++ b/net/minecraft/block/BambooBlock.java +++ b/net/minecraft/block/BambooBlock.java
@@ -102,8 +102,9 @@ @@ -100,10 +100,11 @@
public void func_225542_b_(BlockState p_225542_1_, ServerWorld p_225542_2_, BlockPos p_225542_3_, Random p_225542_4_) {
if (p_225542_1_.func_177229_b(field_220266_f) == 0) { if (p_225542_1_.func_177229_b(field_220266_f) == 0) {
if (p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) { - if (p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) {
+ if (p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9) {
int i = this.func_220260_b(p_225542_2_, p_225542_3_) + 1; int i = this.func_220260_b(p_225542_2_, p_225542_3_) + 1;
- if (i < 16) { - if (i < 16) {
+ if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_.nextInt(3) == 0 && p_225542_2_.func_175623_d(p_225542_3_.func_177984_a()) && p_225542_2_.func_226659_b_(p_225542_3_.func_177984_a(), 0) >= 9)) { + if (i < 16 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_225542_2_, p_225542_3_, p_225542_1_, p_225542_4_.nextInt(3) == 0)) {
this.func_220258_a(p_225542_1_, p_225542_2_, p_225542_3_, p_225542_4_, i); this.func_220258_a(p_225542_1_, p_225542_2_, p_225542_3_, p_225542_4_, i);
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, p_225542_3_, p_225542_1_); + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_225542_2_, p_225542_3_, p_225542_1_);
} }

View file

@ -5,7 +5,7 @@
return false; return false;
} else { } else {
- return p_212570_2_ instanceof PlayerEntity || p_212570_1_.func_82736_K().func_223586_b(GameRules.field_223599_b); - return p_212570_2_ instanceof PlayerEntity || p_212570_1_.func_82736_K().func_223586_b(GameRules.field_223599_b);
+ return p_212570_2_ instanceof LivingEntity && !(p_212570_2_ instanceof PlayerEntity) ? net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_) : true; + return p_212570_2_ instanceof PlayerEntity || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_212570_1_, p_212570_2_);
} }
} else { } else {
return false; return false;

View file

@ -23,7 +23,7 @@
for(Enchantment enchantment : Registry.field_212628_q) { for(Enchantment enchantment : Registry.field_212628_q) {
- if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.field_77351_y.func_77557_a(item) || flag)) { - if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (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()))) { + if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) {
for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) { for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) {
if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) { if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) {
list.add(new EnchantmentData(enchantment, i)); list.add(new EnchantmentData(enchantment, i));

View file

@ -1,11 +1,15 @@
--- a/net/minecraft/tileentity/ConduitTileEntity.java --- a/net/minecraft/tileentity/ConduitTileEntity.java
+++ b/net/minecraft/tileentity/ConduitTileEntity.java +++ b/net/minecraft/tileentity/ConduitTileEntity.java
@@ -131,7 +131,7 @@ @@ -130,10 +130,8 @@
BlockPos blockpos1 = this.field_174879_c.func_177982_a(j1, k1, l1);
BlockState blockstate = this.field_145850_b.func_180495_p(blockpos1); BlockState blockstate = this.field_145850_b.func_180495_p(blockpos1);
for(Block block : field_205042_e) { - for(Block block : field_205042_e) {
- if (blockstate.func_203425_a(block)) { - if (blockstate.func_203425_a(block)) {
+ if (blockstate.isConduitFrame(this.field_145850_b, blockpos1, func_174877_v())) { - this.field_205046_i.add(blockpos1);
this.field_205046_i.add(blockpos1); - }
} + if (blockstate.isConduitFrame(this.field_145850_b, blockpos1, func_174877_v())) {
+ this.field_205046_i.add(blockpos1);
} }
}
}