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;
import com.willfp.eco.core.Prerequisite;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;
import org.bukkit.Particle;
import org.jetbrains.annotations.NotNull;
@ -8,8 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class CopperArtifact extends Artifact {
public CopperArtifact() {
super(
"copper_artifact",
Prerequisite.HAS_1_17
"copper_artifact"
);
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
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.integrations.antigrief.AntigriefManager;
import com.willfp.eco.core.tuples.Pair;
@ -52,9 +51,7 @@ public class InfernalTouch extends EcoEnchant {
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() {

View File

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

View File

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

View File

@ -2,5 +2,5 @@ group 'com.willfp'
version rootProject.version
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 {
compileOnly project(":eco-core:core-plugin")
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'
}

View File

@ -3,7 +3,6 @@ rootProject.name = 'EcoEnchants'
// Core
include ':eco-core'
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_18_R1'
include ':eco-core:core-proxy'