feat: update plugin to spigot 1.21.1
Some checks failed
Build and Upload JAR / build (push) Failing after 17s

This commit is contained in:
2024-10-10 19:59:05 +02:00
parent 4db0401d34
commit df6f1f293e
23 changed files with 95 additions and 96 deletions

View File

@@ -2,8 +2,8 @@ import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java'
group = 'net.rawmod'
version = '0.1.5'
group = 'dev.rawleenc'
version = '0.2.0'
repositories {
mavenCentral()
@@ -18,10 +18,10 @@ repositories {
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT")
}
def targetJavaVersion = 17
def targetJavaVersion = 21
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
@@ -46,4 +46,4 @@ processResources {
filesMatching('plugin.yml') {
expand props
}
}
}

View File

@@ -1,8 +1,8 @@
package net.rawmod.mineclass;
package dev.rawleenc.mineclass;
import net.rawmod.mineclass.classes.MineClassFactory;
import net.rawmod.mineclass.commands.CommandClass;
import net.rawmod.mineclass.listeners.MineClassListeners;
import dev.rawleenc.mineclass.classes.MineClassFactory;
import dev.rawleenc.mineclass.commands.CommandClass;
import dev.rawleenc.mineclass.listeners.MineClassListeners;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -29,7 +29,7 @@ public class BeastMasterClass extends MineClassImpl {
Stream.of(
new Object[][] {
{PotionEffectType.NIGHT_VISION, 1},
{PotionEffectType.SLOW, 1},
{PotionEffectType.SLOWNESS, 1},
{PotionEffectType.WEAKNESS, 1},
})
.collect(Collectors.toMap(data -> (PotionEffectType) data[0], data -> (Integer) data[1]));

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -32,9 +32,9 @@ public class DwarfClass extends MineClassImpl {
Stream.of(
new Object[][] {
{PotionEffectType.HEALTH_BOOST, 2},
{PotionEffectType.DAMAGE_RESISTANCE, 1},
{PotionEffectType.RESISTANCE, 1},
{PotionEffectType.HERO_OF_THE_VILLAGE, 1},
{PotionEffectType.FAST_DIGGING, 1},
{PotionEffectType.HASTE, 1},
{PotionEffectType.NIGHT_VISION, 1},
})
.collect(Collectors.toMap(data -> (PotionEffectType) data[0], data -> (Integer) data[1]));
@@ -44,33 +44,33 @@ public class DwarfClass extends MineClassImpl {
new AbstractMap.SimpleEntry<>(
Material.NETHERITE_PICKAXE,
Arrays.asList(
new Pair<>(Enchantment.DIG_SPEED, 8),
new Pair<>(Enchantment.LOOT_BONUS_BLOCKS, 2))),
new Pair<>(Enchantment.EFFICIENCY, 8),
new Pair<>(Enchantment.FORTUNE, 2))),
new AbstractMap.SimpleEntry<>(
Material.DIAMOND_PICKAXE,
Arrays.asList(
new Pair<>(Enchantment.DIG_SPEED, 8),
new Pair<>(Enchantment.LOOT_BONUS_BLOCKS, 2))),
new Pair<>(Enchantment.EFFICIENCY, 8),
new Pair<>(Enchantment.FORTUNE, 2))),
new AbstractMap.SimpleEntry<>(
Material.IRON_PICKAXE,
Arrays.asList(
new Pair<>(Enchantment.DIG_SPEED, 8),
new Pair<>(Enchantment.LOOT_BONUS_BLOCKS, 2))),
new Pair<>(Enchantment.EFFICIENCY, 8),
new Pair<>(Enchantment.FORTUNE, 2))),
new AbstractMap.SimpleEntry<>(
Material.GOLDEN_PICKAXE,
Arrays.asList(
new Pair<>(Enchantment.DIG_SPEED, 8),
new Pair<>(Enchantment.LOOT_BONUS_BLOCKS, 2))),
new Pair<>(Enchantment.EFFICIENCY, 8),
new Pair<>(Enchantment.FORTUNE, 2))),
new AbstractMap.SimpleEntry<>(
Material.STONE_PICKAXE,
Arrays.asList(
new Pair<>(Enchantment.DIG_SPEED, 8),
new Pair<>(Enchantment.LOOT_BONUS_BLOCKS, 2))),
new Pair<>(Enchantment.EFFICIENCY, 8),
new Pair<>(Enchantment.FORTUNE, 2))),
new AbstractMap.SimpleEntry<>(
Material.WOODEN_PICKAXE,
Arrays.asList(
new Pair<>(Enchantment.DIG_SPEED, 8),
new Pair<>(Enchantment.LOOT_BONUS_BLOCKS, 2))))
new Pair<>(Enchantment.EFFICIENCY, 8),
new Pair<>(Enchantment.FORTUNE, 2))))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
@Override

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -37,7 +37,7 @@ public class ElfClass extends MineClassImpl {
Stream.of(
new Object[][] {
{PotionEffectType.SPEED, 2},
{PotionEffectType.JUMP, 3},
{PotionEffectType.JUMP_BOOST, 3},
{PotionEffectType.LUCK, 1},
{PotionEffectType.NIGHT_VISION, 1},
})
@@ -48,8 +48,8 @@ public class ElfClass extends MineClassImpl {
new AbstractMap.SimpleEntry<>(
Material.BOW,
Arrays.asList(
new Pair<>(Enchantment.ARROW_INFINITE, 1),
new Pair<>(Enchantment.ARROW_DAMAGE, 8),
new Pair<>(Enchantment.INFINITY, 1),
new Pair<>(Enchantment.POWER, 8),
new Pair<>(Enchantment.KNOCKBACK, 1))))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
@@ -92,7 +92,7 @@ public class EnderElfClass extends MineClassImpl {
player.addPotionEffect(
new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 0, false, false));
player.addPotionEffect(
new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, Integer.MAX_VALUE, 0, false, false));
new PotionEffect(PotionEffectType.RESISTANCE, Integer.MAX_VALUE, 0, false, false));
}
}

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
@@ -38,8 +38,8 @@ public class FireDwarfClass extends MineClassImpl {
Stream.of(
new Object[][] {
{PotionEffectType.FIRE_RESISTANCE, 1},
{PotionEffectType.FAST_DIGGING, 1},
{PotionEffectType.JUMP, 2},
{PotionEffectType.HASTE, 1},
{PotionEffectType.JUMP_BOOST, 2},
{PotionEffectType.NIGHT_VISION, 1},
{PotionEffectType.HEALTH_BOOST, 2},
})
@@ -67,25 +67,25 @@ public class FireDwarfClass extends MineClassImpl {
Collections.singletonList(new Pair<>(Enchantment.FIRE_ASPECT, 2))),
new AbstractMap.SimpleEntry<>(
Material.NETHERITE_PICKAXE,
Collections.singletonList(new Pair<>(Enchantment.DIG_SPEED, 5))),
Collections.singletonList(new Pair<>(Enchantment.EFFICIENCY, 5))),
new AbstractMap.SimpleEntry<>(
Material.DIAMOND_PICKAXE,
Collections.singletonList(new Pair<>(Enchantment.DIG_SPEED, 5))),
Collections.singletonList(new Pair<>(Enchantment.EFFICIENCY, 5))),
new AbstractMap.SimpleEntry<>(
Material.IRON_PICKAXE,
Collections.singletonList(new Pair<>(Enchantment.DIG_SPEED, 5))),
Collections.singletonList(new Pair<>(Enchantment.EFFICIENCY, 5))),
new AbstractMap.SimpleEntry<>(
Material.GOLDEN_PICKAXE,
Collections.singletonList(new Pair<>(Enchantment.DIG_SPEED, 5))),
Collections.singletonList(new Pair<>(Enchantment.EFFICIENCY, 5))),
new AbstractMap.SimpleEntry<>(
Material.STONE_PICKAXE,
Collections.singletonList(new Pair<>(Enchantment.DIG_SPEED, 5))),
Collections.singletonList(new Pair<>(Enchantment.EFFICIENCY, 5))),
new AbstractMap.SimpleEntry<>(
Material.WOODEN_PICKAXE,
Collections.singletonList(new Pair<>(Enchantment.DIG_SPEED, 5))),
Collections.singletonList(new Pair<>(Enchantment.EFFICIENCY, 5))),
new AbstractMap.SimpleEntry<>(
Material.CROSSBOW,
Collections.singletonList(new Pair<>(Enchantment.ARROW_INFINITE, 1))),
Collections.singletonList(new Pair<>(Enchantment.INFINITY, 1))),
new AbstractMap.SimpleEntry<>(
Material.FLINT_AND_STEEL, new ArrayList<Pair<Enchantment, Integer>>()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
@@ -99,7 +99,7 @@ public class FireDwarfClass extends MineClassImpl {
player.addPotionEffect(
new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 0, false, false));
player.addPotionEffect(
new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, Integer.MAX_VALUE, 0, false, false));
new PotionEffect(PotionEffectType.RESISTANCE, Integer.MAX_VALUE, 0, false, false));
}
}

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import org.bukkit.Material;
import org.bukkit.entity.Player;

View File

@@ -1,12 +1,10 @@
package net.rawmod.mineclass.classes;
package dev.rawleenc.mineclass.classes;
import net.rawmod.mineclass.utils.Pair;
import dev.rawleenc.mineclass.utils.Pair;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.util.*;
@@ -44,17 +42,17 @@ public class NagaClass extends MineClassImpl {
{PotionEffectType.DOLPHINS_GRACE, 3},
{PotionEffectType.SATURATION, 1},
{PotionEffectType.NIGHT_VISION, 1},
{PotionEffectType.DAMAGE_RESISTANCE, 2},
{PotionEffectType.INCREASE_DAMAGE, 2},
{PotionEffectType.FAST_DIGGING, 10},
{PotionEffectType.RESISTANCE, 2},
{PotionEffectType.STRENGTH, 2},
{PotionEffectType.HASTE, 10},
})
.collect(Collectors.toMap(data -> (PotionEffectType) data[0], data -> (Integer) data[1]));
private static final Map<PotionEffectType, Integer> potionEffectsOnEarth =
Stream.of(
new Object[][] {
{PotionEffectType.SLOW, 4},
{PotionEffectType.SLOW_DIGGING, 1},
{PotionEffectType.SLOWNESS, 4},
{PotionEffectType.MINING_FATIGUE, 1},
{PotionEffectType.HUNGER, 10},
{PotionEffectType.WEAKNESS, 1},
})

View File

@@ -1,20 +1,16 @@
package net.rawmod.mineclass.commands;
package dev.rawleenc.mineclass.commands;
import net.rawmod.mineclass.classes.MineClassFactory;
import net.rawmod.mineclass.utils.InvocationsFinder;
import net.rawmod.mineclass.utils.NumberOfInvocations;
import dev.rawleenc.mineclass.classes.MineClassFactory;
import dev.rawleenc.mineclass.utils.InvocationsFinder;
import dev.rawleenc.mineclass.utils.NumberOfInvocations;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.util.Arrays;
import java.util.stream.Collectors;
public class CommandClass implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

View File

@@ -1,9 +1,16 @@
package net.rawmod.mineclass.listeners;
package dev.rawleenc.mineclass.listeners;
import net.rawmod.mineclass.Mineclass;
import net.rawmod.mineclass.classes.MineClass;
import net.rawmod.mineclass.classes.MineClassFactory;
import net.rawmod.mineclass.utils.*;
import dev.rawleenc.mineclass.Mineclass;
import dev.rawleenc.mineclass.classes.MineClass;
import dev.rawleenc.mineclass.classes.MineClassFactory;
import dev.rawleenc.mineclass.utils.ApplyClassStatusTask;
import dev.rawleenc.mineclass.utils.ClassItemPossessed;
import dev.rawleenc.mineclass.utils.InvocationsFinder;
import dev.rawleenc.mineclass.utils.NumberOfInvocations;
import dev.rawleenc.mineclass.utils.PlayerHitCounter;
import dev.rawleenc.mineclass.utils.PlayerTimerEffects;
import dev.rawleenc.mineclass.utils.PlayerUtils;
import dev.rawleenc.mineclass.utils.SmeltingEngine;
import org.bukkit.DyeColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
@@ -114,9 +121,9 @@ public class MineClassListeners implements Listener {
|| isItemforbidden(player, itemInHand)) {
player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 200, 0));
if (MineClassFactory.getInstance().getClassCode(player).equals("elf")) {
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 3));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 200, 3));
} else {
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 200, 1));
}
player.addPotionEffect(new PotionEffect(PotionEffectType.HUNGER, 200, 9));
player.setFoodLevel(Math.max(player.getFoodLevel() - 2, 0));
@@ -187,7 +194,7 @@ public class MineClassListeners implements Listener {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
if (event.getProjectile() instanceof AbstractArrow
&& event.getBow().getEnchantments().containsKey(Enchantment.ARROW_INFINITE)) {
&& event.getBow().getEnchantments().containsKey(Enchantment.INFINITY)) {
player.getInventory().addItem(new ItemStack(Material.ARROW));
((AbstractArrow) event.getProjectile())
.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
@@ -443,7 +450,7 @@ public class MineClassListeners implements Listener {
wolf.setMetadata("beastMasterWolfType", new FixedMetadataValue(this.plugin, 1));
wolf.setCustomName(String.format("%s's Beast Master Wolf", player.getName()));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, Integer.MAX_VALUE, 3));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, Integer.MAX_VALUE, 1));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, Integer.MAX_VALUE, 1));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 2));
}
@@ -451,7 +458,7 @@ public class MineClassListeners implements Listener {
wolf.setMetadata("beastMasterWolfType", new FixedMetadataValue(this.plugin, 2));
wolf.setCustomName(String.format("%s's Beast Master Hellhound", player.getName()));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, Integer.MAX_VALUE, 4));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, Integer.MAX_VALUE, 2));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, Integer.MAX_VALUE, 2));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 4));
wolf.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, Integer.MAX_VALUE, 0));
}

View File

@@ -1,6 +1,6 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import net.rawmod.mineclass.classes.MineClassFactory;
import dev.rawleenc.mineclass.classes.MineClassFactory;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import org.bukkit.inventory.ItemStack;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import org.bukkit.entity.Player;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
public class Pair<F, S> {
private F first;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import org.bukkit.entity.Player;

View File

@@ -1,9 +1,7 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import net.rawmod.mineclass.classes.MineClass;
import net.rawmod.mineclass.classes.MineClassFactory;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import dev.rawleenc.mineclass.classes.MineClass;
import dev.rawleenc.mineclass.classes.MineClassFactory;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
@@ -40,8 +38,8 @@ public class PlayerTimerEffects extends BukkitRunnable {
if (player.getFireTicks() > 0) {
PlayerUtils.heal(player, 2);
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 40, 3));
player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 40, 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 40, 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, 40, 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.RESISTANCE, 40, 1));
}
if (player.isInWater()) {
player.damage(1);

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;

View File

@@ -1,4 +1,4 @@
package net.rawmod.mineclass.utils;
package dev.rawleenc.mineclass.utils;
import org.bukkit.Bukkit;
import org.bukkit.Location;

View File

@@ -1,6 +1,6 @@
name: Mineclass
version: @version@
main: net.rawmod.mineclass.Mineclass
main: dev.rawleenc.mineclass.Mineclass
api-version: 1.16
authors: [ Barazok ]
commands: