Skip to content

Commit

Permalink
Fix 1.16.5 compatibility
Browse files Browse the repository at this point in the history
Was broken since build-500
  • Loading branch information
PseudoKnight committed Dec 20, 2024
1 parent 75366d4 commit 01bdb8a
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.laytonsmith.abstraction.MCParticleData;
import com.laytonsmith.abstraction.blocks.MCBlockData;
import com.laytonsmith.abstraction.bukkit.BukkitMCColor;
import com.laytonsmith.abstraction.bukkit.BukkitMCVibration;
import com.laytonsmith.abstraction.enums.MCParticle;
import com.laytonsmith.abstraction.enums.MCVersion;
import com.laytonsmith.core.MSLog;
Expand All @@ -16,8 +17,6 @@
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Vibration;
import org.bukkit.entity.Entity;
import org.bukkit.inventory.ItemStack;

import java.lang.reflect.Constructor;
Expand Down Expand Up @@ -120,18 +119,15 @@ public Object getParticleData(MCLocation l, Object data) {
return new Particle.DustTransition(Color.TEAL, Color.RED, 1.0F);
}
case VIBRATION:
BukkitMCVibration vibe;
if(data instanceof MCParticleData.VibrationBlockDestination destination) {
return new Vibration((Location) l.getHandle(),
new Vibration.Destination.BlockDestination((Location) destination.location().getHandle()),
destination.arrivalTime());
vibe = new BukkitMCVibration(l, destination.location(), destination.arrivalTime());
} else if(data instanceof MCParticleData.VibrationEntityDestination destination) {
return new Vibration((Location) l.getHandle(),
new Vibration.Destination.EntityDestination((Entity) destination.entity().getHandle()),
destination.arrivalTime());
vibe = new BukkitMCVibration(l, destination.entity(), destination.arrivalTime());
} else {
return new Vibration((Location) l.getHandle(),
new Vibration.Destination.BlockDestination((Location) l.getHandle()), 5);
vibe = new BukkitMCVibration(l, l, 5);
}
return vibe.getHandle();
case SCULK_CHARGE:
if(data instanceof Float) {
return data;
Expand Down

0 comments on commit 01bdb8a

Please sign in to comment.