Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
fix slimefun blocks turning into vanilla blocks for 1.20.1 and lower
Browse files Browse the repository at this point in the history
  • Loading branch information
J3fftw1 committed Jan 18, 2024
1 parent 7c917c3 commit 4ef60c6
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import javax.annotation.Nonnull;

import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.papermc.lib.PaperLib;
import org.bukkit.Location;
import org.bukkit.entity.ArmorStand;

Expand Down Expand Up @@ -49,8 +48,12 @@ public class ArmorStandUtils {
* @return The spawned {@link ArmorStand}
*/
public static @Nonnull ArmorStand spawnArmorStand(@Nonnull Location location) {
// 1.19 and below don't have the consumer method so flicker exists on these versions.
if (Slimefun.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_20)) {
// The consumer method was moved from World to RegionAccessor in 1.20.2
// Due to this, we need to use a rubbish workaround to support 1.20.1 and below
// This causes flicker on these versions which sucks but not sure a better way around this right now.
if (PaperLib.getMinecraftVersion() <= 20
&& PaperLib.getMinecraftPatchVersion() < 2
) {
ArmorStand armorStand = location.getWorld().spawn(location, ArmorStand.class);
setupArmorStand(armorStand);
return armorStand;
Expand Down

0 comments on commit 4ef60c6

Please sign in to comment.