Skip to content

Commit

Permalink
Fix mixin conflict with Spelunkery (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Mar 10, 2024
1 parent 3f2b5ae commit 3fa5285
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.izzel.arclight.common.bridge.core.entity.EntityBridge;
import io.izzel.arclight.common.bridge.core.entity.vehicle.AbstractMinecartBridge;
import io.izzel.arclight.common.bridge.core.world.WorldBridge;
import io.izzel.arclight.common.bridge.core.world.level.block.BlockBridge;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
Expand Down Expand Up @@ -74,17 +73,15 @@ public abstract class AbstractMinecartMixin extends VehicleEntityMixin implement
maxSpeed = 0.4D;
}

private transient Location arclight$prevLocation;

/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public void tick() {
double prevX = this.getX();
double prevY = this.getY();
double prevZ = this.getZ();
float prevYaw = this.getYRot();
float prevPitch = this.getXRot();
this.arclight$prevLocation = new Location(null, this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
Expand Down Expand Up @@ -142,8 +139,10 @@ public void tick() {
this.flipped = !this.flipped;
}
this.setRot(this.getYRot(), this.getXRot());
org.bukkit.World bworld = ((WorldBridge) this.level()).bridge$getWorld();
Location from = new Location(bworld, prevX, prevY, prevZ, prevYaw, prevPitch);
org.bukkit.World bworld = this.level().bridge$getWorld();
Location from = this.arclight$prevLocation;
this.arclight$prevLocation = null;
from.setWorld(bworld);
Location to = new Location(bworld, this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
Bukkit.getPluginManager().callEvent(new VehicleUpdateEvent(vehicle));
Expand Down

0 comments on commit 3fa5285

Please sign in to comment.