mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Remove 1.8 NMS spawner providers (#3276)
This PR removes the 1.8 R1 and R2 spawner providers. I was looking into refactoring these to use reflection instead of importing NMS code (in order to avoid requiring buildtools to compile), but after some research it looks like these are actually not even used anymore, in favor of the LegacySpawnerProvider (which Essentials appears to use for 1.8.0-1.12.2). Thus, keeping these is fairly pointless and causes more harm than good. There is no reason to continue including them, nor maintaining them. Essentials currently doesn't even officially support these versions anyway.
This commit is contained in:
parent
d59fd71ba5
commit
e53520aef6
8 changed files with 0 additions and 156 deletions
|
@ -48,8 +48,6 @@ import net.ess3.nms.legacy.LegacySpawnerProvider;
|
|||
import net.ess3.nms.refl.ReflSpawnEggProvider;
|
||||
import net.ess3.nms.updatedmeta.BasePotionDataProvider;
|
||||
import net.ess3.nms.updatedmeta.BlockMetaSpawnerProvider;
|
||||
import net.ess3.nms.v1_8_R1.v1_8_R1SpawnerProvider;
|
||||
import net.ess3.nms.v1_8_R2.v1_8_R2SpawnerProvider;
|
||||
import net.ess3.providers.ProviderFactory;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
|
@ -251,8 +249,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||
spawnerProvider = new ProviderFactory<>(getLogger(),
|
||||
Arrays.asList(
|
||||
BlockMetaSpawnerProvider.class,
|
||||
v1_8_R2SpawnerProvider.class,
|
||||
v1_8_R1SpawnerProvider.class,
|
||||
LegacySpawnerProvider.class
|
||||
), "mob spawner").getProvider();
|
||||
spawnEggProvider = new ProviderFactory<>(getLogger(),
|
||||
|
|
1
nms/1_8_R1Provider/.gitignore
vendored
1
nms/1_8_R1Provider/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
craftbukkit-*.jar
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>EssentialsXParent</artifactId>
|
||||
<groupId>net.ess3</groupId>
|
||||
<version>2.17.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>1_8_R1Provider</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ess3</groupId>
|
||||
<artifactId>NMSProvider</artifactId>
|
||||
<version>2.17.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,46 +0,0 @@
|
|||
package net.ess3.nms.v1_8_R1;
|
||||
|
||||
import net.ess3.nms.SpawnerProvider;
|
||||
import net.minecraft.server.v1_8_R1.NBTTagCompound;
|
||||
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class v1_8_R1SpawnerProvider extends SpawnerProvider {
|
||||
@Override
|
||||
public ItemStack setEntityType(ItemStack is, EntityType type) {
|
||||
net.minecraft.server.v1_8_R1.ItemStack itemStack;
|
||||
CraftItemStack craftStack = CraftItemStack.asCraftCopy(is);
|
||||
itemStack = CraftItemStack.asNMSCopy(craftStack);
|
||||
NBTTagCompound tag = itemStack.getTag();
|
||||
if (tag == null) {
|
||||
tag = new NBTTagCompound();
|
||||
itemStack.setTag(tag);
|
||||
}
|
||||
if (!tag.hasKey("BlockEntityTag")) {
|
||||
tag.set("BlockEntityTag", new NBTTagCompound());
|
||||
}
|
||||
tag = itemStack.getTag().getCompound("BlockEntityTag");
|
||||
tag.setString("EntityId", type.getName());
|
||||
ItemStack bukkitItemStack = CraftItemStack.asCraftMirror(itemStack).clone();
|
||||
return setDisplayName(bukkitItemStack, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getEntityType(ItemStack is) {
|
||||
net.minecraft.server.v1_8_R1.ItemStack itemStack;
|
||||
CraftItemStack craftStack = CraftItemStack.asCraftCopy(is);
|
||||
itemStack = CraftItemStack.asNMSCopy(craftStack);
|
||||
NBTTagCompound tag = itemStack.getTag();
|
||||
if (tag == null || !tag.hasKey("BlockEntityTag")) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
String name = tag.getCompound("BlockEntityTag").getString("EntityId");
|
||||
return EntityType.fromName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHumanName() {
|
||||
return "CraftBukkit 1.8 NMS-based provider";
|
||||
}
|
||||
}
|
1
nms/1_8_R2Provider/.gitignore
vendored
1
nms/1_8_R2Provider/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
craftbukkit-*.jar
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>EssentialsXParent</artifactId>
|
||||
<groupId>net.ess3</groupId>
|
||||
<version>2.17.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>1_8_R2Provider</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.8.3-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ess3</groupId>
|
||||
<artifactId>NMSProvider</artifactId>
|
||||
<version>2.17.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,46 +0,0 @@
|
|||
package net.ess3.nms.v1_8_R2;
|
||||
|
||||
import net.ess3.nms.SpawnerProvider;
|
||||
import net.minecraft.server.v1_8_R2.NBTTagCompound;
|
||||
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class v1_8_R2SpawnerProvider extends SpawnerProvider {
|
||||
@Override
|
||||
public ItemStack setEntityType(ItemStack is, EntityType type) {
|
||||
net.minecraft.server.v1_8_R2.ItemStack itemStack;
|
||||
CraftItemStack craftStack = CraftItemStack.asCraftCopy(is);
|
||||
itemStack = CraftItemStack.asNMSCopy(craftStack);
|
||||
NBTTagCompound tag = itemStack.getTag();
|
||||
if (tag == null) {
|
||||
tag = new NBTTagCompound();
|
||||
itemStack.setTag(tag);
|
||||
}
|
||||
if (!tag.hasKey("BlockEntityTag")) {
|
||||
tag.set("BlockEntityTag", new NBTTagCompound());
|
||||
}
|
||||
tag = itemStack.getTag().getCompound("BlockEntityTag");
|
||||
tag.setString("EntityId", type.getName());
|
||||
ItemStack bukkitItemStack = CraftItemStack.asCraftMirror(itemStack).clone();
|
||||
return setDisplayName(bukkitItemStack, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getEntityType(ItemStack is) {
|
||||
net.minecraft.server.v1_8_R2.ItemStack itemStack;
|
||||
CraftItemStack craftStack = CraftItemStack.asCraftCopy(is);
|
||||
itemStack = CraftItemStack.asNMSCopy(craftStack);
|
||||
NBTTagCompound tag = itemStack.getTag();
|
||||
if (tag == null || !tag.hasKey("BlockEntityTag")) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
String name = tag.getCompound("BlockEntityTag").getString("EntityId");
|
||||
return EntityType.fromName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHumanName() {
|
||||
return "CraftBukkit 1.8.3 NMS-based provider";
|
||||
}
|
||||
}
|
2
pom.xml
2
pom.xml
|
@ -51,8 +51,6 @@
|
|||
<module>EssentialsXMPP</module>
|
||||
<module>nms/NMSProvider</module>
|
||||
<module>nms/UpdatedMetaProvider</module>
|
||||
<module>nms/1_8_R1Provider</module>
|
||||
<module>nms/1_8_R2Provider</module>
|
||||
<module>nms/LegacyProvider</module>
|
||||
<module>nms/ReflectionProvider</module>
|
||||
<module>nms/FlattenedProvider</module>
|
||||
|
|
Loading…
Reference in a new issue