mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
fix items not being able to be placed on ancient altar (#4094)
Co-authored-by: Daniel Walsh <walshydev@gmail.com>
This commit is contained in:
parent
eb4d23ec45
commit
6bc1b1f474
@ -2,6 +2,8 @@ package io.github.thebusybiscuit.slimefun4.utils;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
|
||||||
@ -47,13 +49,22 @@ public class ArmorStandUtils {
|
|||||||
* @return The spawned {@link ArmorStand}
|
* @return The spawned {@link ArmorStand}
|
||||||
*/
|
*/
|
||||||
public static @Nonnull ArmorStand spawnArmorStand(@Nonnull Location location) {
|
public static @Nonnull ArmorStand spawnArmorStand(@Nonnull Location location) {
|
||||||
return location.getWorld().spawn(location, ArmorStand.class, armorStand -> {
|
// 1.19 and below don't have the consumer method so flicker exists on these versions.
|
||||||
|
if (Slimefun.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_20)) {
|
||||||
|
ArmorStand armorStand = location.getWorld().spawn(location, ArmorStand.class);
|
||||||
|
setupArmorStand(armorStand);
|
||||||
|
return armorStand;
|
||||||
|
}
|
||||||
|
|
||||||
|
return location.getWorld().spawn(location, ArmorStand.class, armorStand -> setupArmorStand(armorStand));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setupArmorStand(ArmorStand armorStand) {
|
||||||
armorStand.setVisible(false);
|
armorStand.setVisible(false);
|
||||||
armorStand.setSilent(true);
|
armorStand.setSilent(true);
|
||||||
armorStand.setMarker(true);
|
armorStand.setMarker(true);
|
||||||
armorStand.setGravity(false);
|
armorStand.setGravity(false);
|
||||||
armorStand.setBasePlate(false);
|
armorStand.setBasePlate(false);
|
||||||
armorStand.setRemoveWhenFarAway(false);
|
armorStand.setRemoveWhenFarAway(false);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user