Skip to content

Commit

Permalink
Cleanup Explosion patch but keep bin compatibility by using asm hacks.
Browse files Browse the repository at this point in the history
…Closes #9817
  • Loading branch information
LexManos committed Dec 21, 2023
1 parent b041189 commit ed2ba0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
17 changes: 0 additions & 17 deletions patches/minecraft/net/minecraft/world/level/Explosion.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,3 @@
Vec3 vec3 = new Vec3(this.x, this.y, this.z);

for(Entity entity : list) {
@@ -345,6 +_,16 @@

public List<BlockPos> getToBlow() {
return this.toBlow;
+ }
+
+ @Deprecated(forRemoval = true, since = "1.20.4")
+ public Vec3 getPosition() {
+ return this.center();
+ }
+
+ @Nullable
+ public Entity getExploder() {
+ return this.source;
}

public Explosion.BlockInteraction getBlockInteraction() {
4 changes: 3 additions & 1 deletion src/main/resources/coremods/add_bouncer_method.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ var InsnNode = Java.type('org.objectweb.asm.tree.InsnNode')

function initializeCoreMod() {
return {
"getLanguage_bouncer": addBouncer("net.minecraft.network.play.client.CClientSettingsPacket", "func_149524_c", "getLanguage", "()Ljava/lang/String;"),
//TODO: Remove in 1.20.5+
"getPosition_bouncer": addBouncer("net.minecraft.world.level.Explosion", "m_307721_", "getPosition", "()Lnet/minecraft/world/phys/Vec3;"),
"getExploder_bouncer": addBouncer("net.minecraft.world.level.Explosion", "m_253049_", "getExploder", "()Lnet/minecraft/world/entity/Entity;"),
}
}

Expand Down

0 comments on commit ed2ba0f

Please sign in to comment.