Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test patches. Should fail check. #2

Open
wants to merge 1 commit into
base: 1.16.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions patches/minecraft/net/minecraft/block/AbstractBlock.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
protected static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
protected final Material field_149764_J;
protected final boolean field_235688_at_;
@@ -86,6 +87,8 @@
@@ -71,6 +72,7 @@
protected final float field_226887_g_;
protected final boolean field_208621_p;
protected final AbstractBlock.Properties field_235684_aB_;
+
@Nullable
protected ResourceLocation field_220085_g;

@@ -86,6 +88,8 @@
this.field_226887_g_ = p_i241196_1_.field_226894_k_;
this.field_208621_p = p_i241196_1_.field_208772_j;
this.field_235684_aB_ = p_i241196_1_;
Expand All @@ -19,7 +27,7 @@
}

@Deprecated
@@ -128,7 +131,7 @@
@@ -128,7 +132,7 @@

@Deprecated
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
Expand All @@ -28,7 +36,7 @@
p_196243_2_.func_175713_t(p_196243_3_);
}

@@ -190,7 +193,7 @@
@@ -190,7 +194,7 @@

@Deprecated
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
Expand All @@ -37,18 +45,16 @@
}

@Deprecated
@@ -293,8 +296,8 @@
@@ -293,7 +297,7 @@
if (f == -1.0F) {
return 0.0F;
} else {
- int i = p_180647_2_.func_234569_d_(p_180647_1_) ? 30 : 100;
- return p_180647_2_.func_184813_a(p_180647_1_) / f / (float)i;
+ int i = net.minecraftforge.common.ForgeHooks.canHarvestBlock(p_180647_1_, p_180647_2_, p_180647_3_, p_180647_4_) ? 30 : 100;
+ return p_180647_2_.getDigSpeed(p_180647_1_, p_180647_4_) / f / (float)i;
return p_180647_2_.func_184813_a(p_180647_1_) / f / (float)i;
}
}

@@ -320,14 +323,14 @@
@@ -320,14 +324,14 @@
return 0;
}

Expand All @@ -65,7 +71,7 @@
}

return this.field_220085_g;
@@ -345,6 +348,10 @@
@@ -345,6 +349,10 @@
return this.field_235684_aB_.field_235800_b_.apply(this.func_230328_p_().func_176223_P());
}

Expand All @@ -76,7 +82,7 @@
public abstract static class AbstractBlockState extends StateHolder<Block, BlockState> {
private final int field_215708_d;
private final boolean field_215709_e;
@@ -427,6 +434,8 @@
@@ -427,6 +435,8 @@
return this.field_215708_d;
}

Expand All @@ -85,7 +91,7 @@
public boolean func_196958_f() {
return this.field_235702_f_;
}
@@ -435,6 +444,8 @@
@@ -435,6 +445,8 @@
return this.field_235704_h_;
}

Expand All @@ -94,7 +100,7 @@
public BlockState func_185907_a(Rotation p_185907_1_) {
return this.func_177230_c().func_185499_a(this.func_230340_p_(), p_185907_1_);
}
@@ -786,6 +797,9 @@
@@ -786,6 +798,9 @@
private ResourceLocation field_222381_j;
private boolean field_226895_m_ = true;
private boolean field_235813_o_;
Expand All @@ -104,7 +110,7 @@
private AbstractBlock.IExtendedPositionPredicate<EntityType<?>> field_235814_p_ = (p_235832_0_, p_235832_1_, p_235832_2_, p_235832_3_) -> {
return p_235832_0_.func_224755_d(p_235832_1_, p_235832_2_, Direction.UP) && p_235832_0_.func_185906_d() < 14;
};
@@ -847,6 +861,8 @@
@@ -847,6 +862,8 @@
abstractblock$properties.field_226895_m_ = p_200950_0_.field_235684_aB_.field_226895_m_;
abstractblock$properties.field_235813_o_ = p_200950_0_.field_235684_aB_.field_235813_o_;
abstractblock$properties.field_235806_h_ = p_200950_0_.field_235684_aB_.field_235806_h_;
Expand All @@ -113,7 +119,7 @@
return abstractblock$properties;
}

@@ -861,6 +877,16 @@
@@ -861,6 +878,16 @@
return this;
}

Expand All @@ -130,7 +136,7 @@
public AbstractBlock.Properties func_200941_a(float p_200941_1_) {
this.field_200961_i = p_200941_1_;
return this;
@@ -917,7 +943,7 @@
@@ -917,7 +944,7 @@
}

public AbstractBlock.Properties func_222379_b(Block p_222379_1_) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
--- a/net/minecraft/client/gui/ResourceLoadProgressGui.java
+++ b/net/minecraft/client/gui/ResourceLoadProgressGui.java
@@ -97,6 +97,7 @@
@@ -20,6 +20,7 @@
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
+import net.minecraftforge.client.CloudRenderHandler;

@OnlyIn(Dist.CLIENT)
public class ResourceLoadProgressGui extends LoadingGui {
@@ -97,6 +98,7 @@
int l1 = (int)((double)this.field_212974_b.func_228018_at_().func_198087_p() * 0.8325D);
float f3 = this.field_212975_c.func_219555_b();
this.field_212978_f = MathHelper.func_76131_a(this.field_212978_f * 0.95F + f3 * 0.050000012F, 0.0F, 1.0F);
+ net.minecraftforge.fml.client.ClientModLoader.renderProgressText();
if (f < 1.0F) {
this.func_238629_a_(p_230430_1_, i / 2 - k1, l1 - 5, i / 2 + k1, l1 + 5, 1.0F - MathHelper.func_76131_a(f, 0.0F, 1.0F));
}
@@ -106,6 +107,7 @@
@@ -106,6 +108,7 @@
}

if (this.field_212979_g == -1L && this.field_212975_c.func_219554_d() && (!this.field_212977_e || f1 >= 2.0F)) {
+ this.field_212979_g = Util.func_211177_b(); // Moved up to guard against inf loops caused by callback
try {
this.field_212975_c.func_219556_e();
this.field_212976_d.accept(Optional.empty());
@@ -113,7 +115,6 @@
@@ -113,7 +116,6 @@
this.field_212976_d.accept(Optional.of(throwable));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,20 @@
public void func_238651_a_(MatrixStack p_238651_1_, int p_238651_2_) {
if (this.field_230706_i_.field_71441_e != null) {
this.func_238468_a_(p_238651_1_, 0, 0, this.field_230708_k_, this.field_230709_l_, -1072689136, -804253680);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, p_238651_1_));
+ //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, p_238651_1_));
} else {
this.func_231165_f_(p_238651_2_);
}
@@ -342,6 +360,7 @@
@@ -342,6 +360,8 @@
bufferbuilder.func_225582_a_((double)this.field_230708_k_, 0.0D, 0.0D).func_225583_a_((float)this.field_230708_k_ / 32.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
bufferbuilder.func_225582_a_(0.0D, 0.0D, 0.0D).func_225583_a_(0.0F, (float)p_231165_1_).func_225586_a_(64, 64, 64, 255).func_181675_d();
tessellator.func_78381_a();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, new MatrixStack()));
+
+ //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
}

public boolean func_231177_au__() {
@@ -428,4 +447,8 @@
@@ -428,4 +448,8 @@

public void func_230476_a_(List<Path> p_230476_1_) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
--- a/net/minecraft/client/renderer/BufferBuilder.java
+++ b/net/minecraft/client/renderer/BufferBuilder.java
@@ -297,6 +297,7 @@
@@ -121,7 +121,6 @@

bitset.set(l);
}
-
}

private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) {
@@ -297,6 +296,7 @@
}

ByteBuffer bytebuffer = this.field_179001_a.slice();
+ bytebuffer.order(this.field_179001_a.order()); // FORGE: Fix incorrect byte order
((Buffer)this.field_179001_a).clear();
return Pair.of(bufferbuilder$drawstate, bytebuffer);
}
@@ -364,4 +365,15 @@
@@ -364,4 +364,15 @@
this.field_179018_e = p_i225907_2_;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@
}

if (this.field_187469_f < 0.1F) {
@@ -430,6 +440,5 @@
} else {
this.field_187471_h = 0.0F;
}
-
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
if (fluidstate.func_206884_a(FluidTags.field_206959_a)) {
float f = 1.0F;
f = 0.05F;
@@ -231,6 +250,7 @@
@@ -231,8 +250,8 @@
RenderSystem.fogEnd(f3);
RenderSystem.fogMode(GlStateManager.FogMode.LINEAR);
RenderSystem.setupNvFogDistance();
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(p_228372_1_, p_228372_0_, partialTicks, f3);
}
-
}

public static void func_228373_b_() {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/entity/EntityRendererManager.java
+++ b/net/minecraft/client/renderer/entity/EntityRendererManager.java
@@ -187,7 +187,10 @@
@@ -187,13 +187,15 @@
this.field_178637_m = new PlayerRenderer(this);
this.field_178636_l.put("default", this.field_178637_m);
this.field_178636_l.put("slim", new PlayerRenderer(this, true));
Expand All @@ -11,7 +11,13 @@
for(EntityType<?> entitytype : Registry.field_212629_r) {
if (entitytype != EntityType.field_200729_aH && !this.field_78729_o.containsKey(entitytype)) {
throw new IllegalStateException("No renderer registered for " + Registry.field_212629_r.func_177774_c(entitytype));
@@ -449,4 +452,8 @@
}
}
-
}

public <T extends Entity> EntityRenderer<? super T> func_78713_a(T p_78713_1_) {
@@ -449,4 +451,8 @@
public FontRenderer func_78716_a() {
return this.field_78736_p;
}
Expand Down
17 changes: 7 additions & 10 deletions patches/minecraft/net/minecraft/entity/LivingEntity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
}

protected float func_189749_co() {
@@ -1868,11 +1896,15 @@
@@ -1868,16 +1896,20 @@
public void func_213352_e(Vector3d p_213352_1_) {
if (this.func_70613_aW() || this.func_184186_bw()) {
double d0 = 0.08D;
Expand All @@ -327,6 +327,12 @@

FluidState fluidstate = this.field_70170_p.func_204610_c(this.func_233580_cy_());
if (this.func_70090_H() && this.func_241208_cS_() && !this.func_230285_a_(fluidstate.func_206886_c())) {
double d8 = this.func_226278_cu_();
- float f5 = this.func_70051_ag() ? 0.9F : this.func_189749_co();
+ float f5 = this.field_70170_p.func_180495_p(this.func_226270_aj_()).getSlipperiness(field_70170_p, this.func_226270_aj_(), this);
float f6 = 0.02F;
float f7 = (float)EnchantmentHelper.func_185294_d(this);
if (f7 > 3.0F) {
@@ -1897,6 +1929,7 @@
f5 = 0.96F;
}
Expand All @@ -335,15 +341,6 @@
this.func_213309_a(f6, p_213352_1_);
this.func_213315_a(MoverType.SELF, this.func_213322_ci());
Vector3d vector3d6 = this.func_213322_ci();
@@ -1975,7 +2008,7 @@
}
} else {
BlockPos blockpos = this.func_226270_aj_();
- float f3 = this.field_70170_p.func_180495_p(blockpos).func_177230_c().func_208618_m();
+ float f3 = this.field_70170_p.func_180495_p(this.func_226270_aj_()).getSlipperiness(field_70170_p, this.func_226270_aj_(), this);
float f4 = this.field_70122_E ? f3 * 0.91F : 0.91F;
Vector3d vector3d5 = this.func_233633_a_(p_213352_1_, f3);
double d2 = vector3d5.field_72448_b;
@@ -2075,6 +2108,7 @@
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
Optional<BlockPos> optional1 = Optional.of(new BlockPos(p_70107_1_, p_70107_3_, p_70107_5_));
if (!optional1.equals(optional)) {
this.field_70180_af.func_187227_b(field_184701_b, optional1);
@@ -283,6 +285,12 @@
@@ -282,7 +284,14 @@
BlockPos blockpos1 = blockpos.func_177982_a(8 - this.field_70146_Z.nextInt(17), 8 - this.field_70146_Z.nextInt(17), 8 - this.field_70146_Z.nextInt(17));
if (blockpos1.func_177956_o() > 0 && this.field_70170_p.func_175623_d(blockpos1) && this.field_70170_p.func_175723_af().func_177746_a(blockpos1) && this.field_70170_p.func_226665_a__(this, new AxisAlignedBB(blockpos1))) {
Direction direction = this.func_234299_g_(blockpos1);
+
if (direction != null) {
+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, blockpos1.func_177958_n(), blockpos1.func_177956_o(), blockpos1.func_177952_p(), 0);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) direction = null;
Expand All @@ -38,3 +40,11 @@
this.field_70180_af.func_187227_b(field_184700_a, direction);
this.func_184185_a(SoundEvents.field_187791_eX, 1.0F, 1.0F);
this.field_70180_af.func_187227_b(field_184701_b, Optional.of(blockpos1));
@@ -306,7 +315,6 @@
this.field_70760_ar = 0.0F;
this.field_70761_aq = 0.0F;
}
-
}

public void func_184206_a(DataParameter<?> p_184206_1_) {
Loading