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 0f2ca4b commit e9f3200
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public abstract class AbstractMinecartMixin extends EntityMixin {
@Shadow private boolean flipped;
@Shadow public abstract AbstractMinecart.Type getMinecartType();
@Shadow(remap = false) public abstract boolean canUseRail();
@Shadow private boolean onRails;
// @formatter:on

@Shadow private boolean onRails;
public boolean slowWhenEmpty = true;
private double derailedX = 0.5;
private double derailedY = 0.5;
Expand Down Expand Up @@ -128,17 +128,15 @@ public boolean hurt(DamageSource source, float amount) {
return true;
}

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 @@ -204,7 +202,9 @@ public void tick() {
}
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);
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public class LootDataManagerMixin {
private void arclight$buildRev(Map<LootDataType<?>, Map<ResourceLocation, ?>> p_279426_, CallbackInfo ci) {
ImmutableMap.Builder<Object, ResourceLocation> lootTableToKeyBuilder = ImmutableMap.builder();
this.elements.forEach((key, lootTable) -> lootTableToKeyBuilder.put(lootTable, key.location()));
this.lootTableToKey = lootTableToKeyBuilder.build();
this.lootTableToKey = lootTableToKeyBuilder.buildKeepingLast();
}
}

0 comments on commit e9f3200

Please sign in to comment.