Dropped support for 1.16.5

This commit is contained in:
Auxilor 2022-02-19 18:42:44 +00:00
parent 72b334d5f7
commit dc9db7faad
15 changed files with 12 additions and 108 deletions

View File

@ -1,6 +0,0 @@
group 'com.willfp'
version rootProject.version
dependencies {
compileOnly 'org.spigotmc:spigot:1.16.4-R0.1-SNAPSHOT'
}

View File

@ -1,25 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R3;
import com.willfp.ecoenchants.enchantments.support.vanilla.VanillaEnchantmentMetadata;
import com.willfp.ecoenchants.enchantments.support.vanilla.VanillaEnchantments;
import com.willfp.ecoenchants.proxy.proxies.EcoCraftEnchantmentManagerProxy;
import com.willfp.ecoenchants.proxy.v1_16_R3.enchants.EcoCraftEnchantment;
import net.minecraft.server.v1_16_R3.Enchantment;
import net.minecraft.server.v1_16_R3.IRegistry;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.v1_16_R3.util.CraftNamespacedKey;
import java.util.Map;
public final class EcoCraftEnchantmentManager implements EcoCraftEnchantmentManagerProxy {
@Override
public void registerNewCraftEnchantments() {
Map<org.bukkit.enchantments.Enchantment, VanillaEnchantmentMetadata> metadataMap = VanillaEnchantments.getMetadataMap();
for (Enchantment enchantment : IRegistry.ENCHANTMENT) {
NamespacedKey key = CraftNamespacedKey.fromMinecraft(IRegistry.ENCHANTMENT.getKey(enchantment));
VanillaEnchantmentMetadata metadata = metadataMap.get(org.bukkit.enchantments.Enchantment.getByKey(key));
new EcoCraftEnchantment(enchantment, metadata).register();
}
}
}

View File

@ -1,13 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R3;
import com.willfp.ecoenchants.proxy.proxies.OpenInventoryProxy;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class OpenInventory implements OpenInventoryProxy {
@Override
public Object getOpenInventory(@NotNull final Player player) {
return ((CraftPlayer) player).getHandle().activeContainer;
}
}

View File

@ -1,36 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R3.enchants;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.support.vanilla.VanillaEnchantmentMetadata;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import net.minecraft.server.v1_16_R3.Enchantment;
import org.bukkit.craftbukkit.v1_16_R3.enchantments.CraftEnchantment;
import org.jetbrains.annotations.NotNull;
public class EcoCraftEnchantment extends CraftEnchantment {
private final VanillaEnchantmentMetadata metadata;
public EcoCraftEnchantment(@NotNull final Enchantment target,
@NotNull final VanillaEnchantmentMetadata metadata) {
super(target);
this.metadata = metadata;
}
@Override
public int getMaxLevel() {
return metadata.maxLevel() == null ? this.getHandle().getMaxLevel() : metadata.maxLevel();
}
@Override
public boolean conflictsWith(@NotNull final org.bukkit.enchantments.Enchantment other) {
if (other instanceof EcoEnchant) {
return other.conflictsWith(this);
}
return metadata.conflicts() == null ? super.conflictsWith(other) : metadata.conflicts().contains(other.getKey());
}
public void register() {
EnchantmentUtils.register(this);
}
}

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; package com.willfp.ecoenchants.enchantments.ecoenchants.artifact;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -8,8 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class CopperArtifact extends Artifact { public class CopperArtifact extends Artifact {
public CopperArtifact() { public CopperArtifact() {
super( super(
"copper_artifact", "copper_artifact"
Prerequisite.HAS_1_17
); );
} }

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; package com.willfp.ecoenchants.enchantments.ecoenchants.artifact;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -8,8 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class GlowArtifact extends Artifact { public class GlowArtifact extends Artifact {
public GlowArtifact() { public GlowArtifact() {
super( super(
"glow_artifact", "glow_artifact"
Prerequisite.HAS_1_17
); );
} }

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; package com.willfp.ecoenchants.enchantments.ecoenchants.artifact;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -8,8 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class SparkArtifact extends Artifact { public class SparkArtifact extends Artifact {
public SparkArtifact() { public SparkArtifact() {
super( super(
"spark_artifact", "spark_artifact"
Prerequisite.HAS_1_17
); );
} }

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; package com.willfp.ecoenchants.enchantments.ecoenchants.artifact;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -8,8 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class SporeArtifact extends Artifact { public class SporeArtifact extends Artifact {
public SporeArtifact() { public SporeArtifact() {
super( super(
"spore_artifact", "spore_artifact"
Prerequisite.HAS_1_17
); );
} }

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; package com.willfp.ecoenchants.enchantments.ecoenchants.artifact;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -8,8 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class WaxArtifact extends Artifact { public class WaxArtifact extends Artifact {
public WaxArtifact() { public WaxArtifact() {
super( super(
"wax_artifact", "wax_artifact"
Prerequisite.HAS_1_17
); );
} }

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal; package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.core.Prerequisite;
import com.willfp.eco.core.drops.DropQueue; import com.willfp.eco.core.drops.DropQueue;
import com.willfp.eco.core.integrations.antigrief.AntigriefManager; import com.willfp.eco.core.integrations.antigrief.AntigriefManager;
import com.willfp.eco.core.tuples.Pair; import com.willfp.eco.core.tuples.Pair;
@ -52,10 +51,8 @@ public class InfernalTouch extends EcoEnchant {
RECIPES.put(furnaceRecipe.getInput().getType(), new Pair<>(furnaceRecipe.getResult().getType(), xp)); RECIPES.put(furnaceRecipe.getInput().getType(), new Pair<>(furnaceRecipe.getResult().getType(), xp));
} }
if (Prerequisite.HAS_1_17.isMet()) {
FORTUNE_MATERIALS.add(Material.COPPER_INGOT); FORTUNE_MATERIALS.add(Material.COPPER_INGOT);
} }
}
public InfernalTouch() { public InfernalTouch() {
super( super(

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal; package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import org.bukkit.Material; import org.bukkit.Material;
@ -32,11 +31,10 @@ public class Replenish extends EcoEnchant {
return; return;
} }
if (Prerequisite.HAS_1_17.isMet()) {
if (block.getType() == Material.GLOW_BERRIES) { if (block.getType() == Material.GLOW_BERRIES) {
return; return;
} }
}
if (data.getAge() != data.getMaximumAge()) { if (data.getAge() != data.getMaximumAge()) {
event.setDropItems(false); event.setDropItems(false);

View File

@ -1,7 +1,7 @@
name: EcoEnchants name: EcoEnchants
version: ${projectVersion} version: ${projectVersion}
main: com.willfp.ecoenchants.EcoEnchantsPlugin main: com.willfp.ecoenchants.EcoEnchantsPlugin
api-version: 1.16 api-version: 1.17
authors: [ Auxilor ] authors: [ Auxilor ]
website: willfp.com website: willfp.com
load: STARTUP load: STARTUP

View File

@ -2,5 +2,5 @@ group 'com.willfp'
version rootProject.version version rootProject.version
dependencies { dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT' compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
} }

View File

@ -5,7 +5,7 @@ subprojects {
dependencies { dependencies {
compileOnly project(":eco-core:core-plugin") compileOnly project(":eco-core:core-plugin")
compileOnly project(":eco-core:core-proxy") compileOnly project(":eco-core:core-proxy")
compileOnly 'org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT' compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
compileOnly 'com.willfp:libreforge:3.3.0' compileOnly 'com.willfp:libreforge:3.3.0'
} }

View File

@ -3,7 +3,6 @@ rootProject.name = 'EcoEnchants'
// Core // Core
include ':eco-core' include ':eco-core'
include ':eco-core:core-nms' include ':eco-core:core-nms'
include ':eco-core:core-nms:v1_16_R3'
include ':eco-core:core-nms:v1_17_R1' include ':eco-core:core-nms:v1_17_R1'
include ':eco-core:core-nms:v1_18_R1' include ':eco-core:core-nms:v1_18_R1'
include ':eco-core:core-proxy' include ':eco-core:core-proxy'