Skip to content

Commit

Permalink
fix: 1.20.6 兼容
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Aug 3, 2024
1 parent 448081c commit f3b1395
Show file tree
Hide file tree
Showing 40 changed files with 230 additions and 84 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.StarWishsama</groupId>
<artifactId>Slimefun4</artifactId>
<version>2022.06</version>
<version>a19da27bee</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -153,7 +153,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.libraries.dough.collections.Pair;
import io.github.thebusybiscuit.slimefun4.libraries.dough.common.ChatColors;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag;
import lombok.Getter;
import lombok.Setter;
import net.md_5.bungee.api.ChatColor;
Expand Down Expand Up @@ -64,7 +65,7 @@ public SlimefunItemStack getThemedStack() {
);
ItemMeta itemMeta = stack.getItemMeta();
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
itemMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
itemMeta.addItemFlags(VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP);
stack.setItemMeta(itemMeta);
return stack;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
Expand All @@ -35,14 +36,14 @@ public class Animaniacs extends Spell {
EntityType.DONKEY,
EntityType.WOLF,
EntityType.FOX,
EntityType.SNOWMAN,
VersionedEntityType.SNOW_GOLEM,
EntityType.TURTLE,
EntityType.RABBIT,
EntityType.PARROT,
EntityType.CAT,
EntityType.OCELOT,
EntityType.HORSE,
EntityType.MUSHROOM_COW,
VersionedEntityType.MOOSHROOM,
EntityType.AXOLOTL,
EntityType.PUFFERFISH,
EntityType.PIG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.data.persistent.PersistentDataAPI;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedEntityTypeX;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;
Expand All @@ -33,12 +34,12 @@ public AntiPrism() {
.makeEffectingSpell(true, true)
.addNegativeEffect(PotionEffectType.BAD_OMEN, 1, 30)
.addNegativeEffect(PotionEffectType.BLINDNESS, 1, 30)
.addNegativeEffect(PotionEffectType.CONFUSION, 1, 30)
.addNegativeEffect(PotionEffectType.HARM, 1, 30)
.addNegativeEffect(VersionedPotionEffectType.NAUSEA, 1, 30)
.addNegativeEffect(VersionedPotionEffectType.INSTANT_DAMAGE, 1, 30)
.addNegativeEffect(PotionEffectType.HUNGER, 1, 30)
.addNegativeEffect(PotionEffectType.POISON, 1, 30)
.addNegativeEffect(PotionEffectType.SLOW, 1, 30)
.addNegativeEffect(PotionEffectType.SLOW_DIGGING, 1, 30)
.addNegativeEffect(VersionedPotionEffectType.SLOWNESS, 1, 30)
.addNegativeEffect(VersionedPotionEffectType.MINING_FATIGUE, 1, 30)
.addNegativeEffect(PotionEffectType.UNLUCK, 1, 30)
.addNegativeEffect(PotionEffectType.WEAKNESS, 1, 30)
.addNegativeEffect(PotionEffectType.WITHER, 1, 30);
Expand All @@ -49,7 +50,7 @@ public AntiPrism() {
public void cast(CastInformation castInformation) {
Location location = castInformation.getCastLocation();
Location aimLocation = location.clone().add(0, 1.5, 0).add(location.getDirection().multiply(2));
MagicProjectile magicProjectile = SpellUtils.summonMagicProjectile(castInformation, EntityType.SPLASH_POTION, aimLocation);
MagicProjectile magicProjectile = SpellUtils.summonMagicProjectile(castInformation, VersionedEntityTypeX.POTION, aimLocation);
magicProjectile.setVelocity(location.getDirection(), 0.5);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedEntityTypeX;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.material.Colorable;

import javax.annotation.Nonnull;
Expand All @@ -42,7 +42,7 @@ public Bobulate() {
public void fireProjectile(CastInformation castInformation) {
final Location location = castInformation.getCastLocation();
final Location aimLocation = location.clone().add(0, 1.5, 0).add(location.getDirection().multiply(2));
final MagicProjectile magicProjectile = SpellUtils.summonMagicProjectile(castInformation, EntityType.SPLASH_POTION, aimLocation);
final MagicProjectile magicProjectile = SpellUtils.summonMagicProjectile(castInformation, VersionedEntityTypeX.POTION, aimLocation);
magicProjectile.setVelocity(location.getDirection(), 1.5);
magicProjectile.disableGravity();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import io.github.sefiraat.crystamaehistoria.slimefun.items.mechanisms.liquefactionbasin.RecipeSpell;
import io.github.sefiraat.crystamaehistoria.stories.definition.StoryType;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffectType;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -22,8 +22,8 @@ public ChillWind() {
SpellCoreBuilder spellCoreBuilder = new SpellCoreBuilder(120, true, 7, false, 25, true)
.makeTickingSpell(this::cast, 20, true, 5, false)
.makeEffectingSpell(false, false)
.addNegativeEffect(PotionEffectType.SLOW, 4, 1)
.addNegativeEffect(PotionEffectType.SLOW_DIGGING, 4, 1);
.addNegativeEffect(VersionedPotionEffectType.SLOWNESS, 4, 1)
.addNegativeEffect(VersionedPotionEffectType.MINING_FATIGUE, 4, 1);
setSpellCore(spellCoreBuilder.build());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.github.sefiraat.crystamaehistoria.slimefun.items.mechanisms.liquefactionbasin.RecipeSpell;
import io.github.sefiraat.crystamaehistoria.stories.definition.StoryType;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
Expand Down Expand Up @@ -39,7 +40,7 @@ public void onTick(CastInformation castInformation) {
if (foundBlock == null) {
ParticleUtils.displayParticleEffect(
location.add(location.getDirection()),
Particle.VILLAGER_ANGRY,
VersionedParticleX.ANGRY_VILLAGER,
1,
10
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffectType;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -25,7 +25,7 @@ public EarthNova() {
SpellCoreBuilder spellCoreBuilder = new SpellCoreBuilder(20, true, 10, false, 10, false)
.makeDamagingSpell(2, true, 1, false)
.makeEffectingSpell(false, true)
.addNegativeEffect(PotionEffectType.SLOW, 20, 2)
.addNegativeEffect(VersionedPotionEffectType.SLOWNESS, 20, 2)
.makeProjectileSpell(this::fireProjectiles, 2, false, 1, false)
.makeProjectileVsEntitySpell(this::projectileHit);
setSpellCore(spellCoreBuilder.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;

Expand Down Expand Up @@ -57,7 +57,7 @@ public void projectileHit(CastInformation castInformation) {

@ParametersAreNonnullByDefault
public void afterProjectileHit(CastInformation castInformation) {
ParticleUtils.displayParticleEffect(castInformation.getMainTarget(), Particle.EXPLOSION_NORMAL, 1.0, 5);
ParticleUtils.displayParticleEffect(castInformation.getMainTarget(), VersionedParticleX.POOF, 1.0, 5);
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;

Expand Down Expand Up @@ -53,7 +53,7 @@ public void projectileHit(CastInformation castInformation) {
for (LivingEntity livingEntity : getTargets(castInformation, getProjectileAoe(castInformation), true)) {
GeneralUtils.damageEntity(livingEntity, castInformation.getCaster(), getDamage(castInformation));
livingEntity.setFreezeTicks(60);
ParticleUtils.displayParticleEffect(livingEntity, Particle.SNOW_SHOVEL, 1, 5);
ParticleUtils.displayParticleEffect(livingEntity, VersionedParticleX.ITEM_SNOWBALL, 1, 5);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
Expand Down Expand Up @@ -50,7 +51,7 @@ public void cast(CastInformation castInformation) {
Location newLocation = entity.getLocation().clone();
newLocation.setYaw(entity.getLocation().getYaw() + 10F);
entity.teleport(newLocation);
ParticleUtils.displayParticleEffect(entity, Particle.SPELL, 1, 1);
ParticleUtils.displayParticleEffect(entity, VersionedParticleX.EFFECT, 1, 1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedMaterial;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Tag;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
Expand Down Expand Up @@ -67,7 +68,7 @@ public void onTick(CastInformation castInformation) {
block.setType(material);
}
block.getRelative(BlockFace.DOWN).setType(Material.GRASS_BLOCK);
ParticleUtils.displayParticleEffect(block.getLocation(), Particle.FIREWORKS_SPARK, 0.5, 3);
ParticleUtils.displayParticleEffect(block.getLocation(), VersionedParticle.FIREWORK, 0.5, 3);
}
}

Expand Down Expand Up @@ -105,6 +106,6 @@ public String getId() {
@Nonnull
@Override
public Material getMaterial() {
return Material.GRASS;
return VersionedMaterial.SHORT_GRASS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.github.sefiraat.crystamaehistoria.slimefun.items.mechanisms.liquefactionbasin.RecipeSpell;
import io.github.sefiraat.crystamaehistoria.stories.definition.StoryType;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
Expand Down Expand Up @@ -45,7 +46,7 @@ public void afterAllTicks(CastInformation castInformation) {
Location location = caster.getBedSpawnLocation();
if (location == null) {
Location casterLocation = caster.getLocation();
ParticleUtils.displayParticleEffect(casterLocation.add(casterLocation.getDirection()), Particle.VILLAGER_ANGRY, 1, 10);
ParticleUtils.displayParticleEffect(casterLocation.add(casterLocation.getDirection()), VersionedParticleX.ANGRY_VILLAGER, 1, 10);
} else {
caster.teleportAsync(location, PlayerTeleportEvent.TeleportCause.PLUGIN);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.github.sefiraat.crystamaehistoria.utils.GeneralUtils;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
Expand Down Expand Up @@ -63,13 +64,13 @@ public void projectileHit(CastInformation castInformation) {

@ParametersAreNonnullByDefault
public void afterProjectileHit(CastInformation castInformation) {
ParticleUtils.displayParticleEffect(castInformation.getMainTarget(), Particle.VILLAGER_ANGRY, 1.0, 5);
ParticleUtils.displayParticleEffect(castInformation.getMainTarget(), VersionedParticleX.ANGRY_VILLAGER, 1.0, 5);
}

@ParametersAreNonnullByDefault
public void onTick(MagicProjectile magicProjectile) {
ParticleUtils.displayParticleEffect(magicProjectile.getProjectile(), Particle.SWEEP_ATTACK, 0.5, 1);
ParticleUtils.displayParticleEffect(magicProjectile.getProjectile(), Particle.VILLAGER_ANGRY, 0.5, 1);
ParticleUtils.displayParticleEffect(magicProjectile.getProjectile(), VersionedParticleX.ANGRY_VILLAGER, 0.5, 1);
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import io.github.sefiraat.crystamaehistoria.stories.definition.StoryType;
import io.github.sefiraat.crystamaehistoria.utils.SpellUtils;
import io.github.sefiraat.crystamaehistoria.utils.mobgoals.BoringGoal;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.potion.PotionEffectType;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -21,8 +21,8 @@ public class ImbueVoid extends Spell {
public ImbueVoid() {
SpellCoreBuilder spellCoreBuilder = new SpellCoreBuilder(240, false, 3, false, 30, true)
.makeTickingSpell(this::onTick, 5, false, 40, false)
.addPositiveEffect(PotionEffectType.SLOW, 99, 5)
.addPositiveEffect(PotionEffectType.SLOW_DIGGING, 99, 5);
.addPositiveEffect(VersionedPotionEffectType.SLOWNESS, 99, 5)
.addPositiveEffect(VersionedPotionEffectType.MINING_FATIGUE, 99, 5);
setSpellCore(spellCoreBuilder.build());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import io.github.sefiraat.crystamaehistoria.utils.Keys;
import io.github.sefiraat.crystamaehistoria.utils.ParticleUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.data.persistent.PersistentDataAPI;
import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType;
import net.guizhanss.crystamaehistoria.utils.compatibility.VersionedParticleX;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;

Expand All @@ -24,14 +25,14 @@ public Prism() {
.makeEffectingSpell(true, true)
.addPositiveEffect(PotionEffectType.ABSORPTION, 1, 30)
.addPositiveEffect(PotionEffectType.CONDUIT_POWER, 1, 30)
.addPositiveEffect(PotionEffectType.DAMAGE_RESISTANCE, 1, 30)
.addPositiveEffect(VersionedPotionEffectType.RESISTANCE, 1, 30)
.addPositiveEffect(PotionEffectType.DOLPHINS_GRACE, 1, 30)
.addPositiveEffect(PotionEffectType.FAST_DIGGING, 1, 30)
.addPositiveEffect(VersionedPotionEffectType.HASTE, 1, 30)
.addPositiveEffect(PotionEffectType.HEALTH_BOOST, 1, 30)
.addPositiveEffect(PotionEffectType.HERO_OF_THE_VILLAGE, 1, 30)
.addPositiveEffect(PotionEffectType.INCREASE_DAMAGE, 1, 30)
.addPositiveEffect(VersionedPotionEffectType.STRENGTH, 1, 30)
.addPositiveEffect(PotionEffectType.INVISIBILITY, 1, 30)
.addPositiveEffect(PotionEffectType.JUMP, 1, 30)
.addPositiveEffect(VersionedPotionEffectType.JUMP_BOOST, 1, 30)
.addPositiveEffect(PotionEffectType.LUCK, 1, 30)
.addPositiveEffect(PotionEffectType.NIGHT_VISION, 1, 30)
.addPositiveEffect(PotionEffectType.REGENERATION, 1, 30)
Expand All @@ -49,7 +50,7 @@ public void cast(CastInformation castInformation) {
}
PersistentDataAPI.setBoolean(player, Keys.newKey("PRISM"), true);
applyPositiveEffects(player, castInformation);
ParticleUtils.displayParticleEffect(player, Particle.SPELL, 2, 20);
ParticleUtils.displayParticleEffect(player, VersionedParticleX.EFFECT, 2, 20);
}

@Nonnull
Expand Down
Loading

0 comments on commit f3b1395

Please sign in to comment.