Resolve NMF's concerns

This commit is contained in:
MattBDev 2020-06-29 22:05:32 -04:00
parent 3a2e932d17
commit 49c35ec084
3 changed files with 185 additions and 170 deletions

View File

@ -25,7 +25,10 @@ dependencies {
compile("com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT") compile("com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT")
//implementation 'com.onarandombox.multiversecore:Multiverse-Core:3.0.0-SNAPSHOT' //implementation 'com.onarandombox.multiversecore:Multiverse-Core:3.0.0-SNAPSHOT'
implementation("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT") implementation("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT")
compile(group: "com.sk89q.worldedit", name: "worldedit-bukkit", version: "7.0.1") compile(group: "com.sk89q.worldedit", name: "worldedit-bukkit", version: "7.1.0") {
exclude(module: "bukkit")
}
compile("io.papermc:paperlib:1.0.2") compile("io.papermc:paperlib:1.0.2")
implementation("net.kyori:text-adapter-bukkit:3.0.3") implementation("net.kyori:text-adapter-bukkit:3.0.3")
compile("com.github.MilkBowl:VaultAPI:1.7") { compile("com.github.MilkBowl:VaultAPI:1.7") {

View File

@ -27,14 +27,20 @@
<dependency> <dependency>
<groupId>com.destroystokyo.paper</groupId> <groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version> <version>1.16.1-R0.1-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sk89q.worldedit</groupId> <groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId> <artifactId>worldedit-bukkit</artifactId>
<version>7.0.1</version> <version>7.1.0</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>bukkit</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.papermc</groupId> <groupId>io.papermc</groupId>
@ -131,7 +137,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version> <version>1.16.1-R0.1-SNAPSHOT</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -103,51 +103,51 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
if (!entity.hasGravity()) { if (!entity.hasGravity()) {
this.noGravity = true; this.noGravity = true;
} }
switch (entity.getType()) { switch (entity.getType().toString()) {
case BOAT: case "BOAT":
Boat boat = (Boat) entity; Boat boat = (Boat) entity;
this.dataByte = getOrdinal(TreeSpecies.values(), boat.getWoodType()); this.dataByte = getOrdinal(TreeSpecies.values(), boat.getWoodType());
return; return;
case ARROW: case "ARROW":
case EGG: case "EGG":
case ENDER_CRYSTAL: case "ENDER_CRYSTAL":
case ENDER_PEARL: case "ENDER_PEARL":
case ENDER_SIGNAL: case "ENDER_SIGNAL":
case EXPERIENCE_ORB: case "EXPERIENCE_ORB":
case FALLING_BLOCK: case "FALLING_BLOCK":
case FIREBALL: case "FIREBALL":
case FIREWORK: case "FIREWORK":
case FISHING_HOOK: case "FISHING_HOOK":
case LEASH_HITCH: case "LEASH_HITCH":
case LIGHTNING: case "LIGHTNING":
case MINECART: case "MINECART":
case MINECART_COMMAND: case "MINECART_COMMAND":
case MINECART_MOB_SPAWNER: case "MINECART_MOB_SPAWNER":
case MINECART_TNT: case "MINECART_TNT":
case PLAYER: case "PLAYER":
case PRIMED_TNT: case "PRIMED_TNT":
case SLIME: case "SLIME":
case SMALL_FIREBALL: case "SMALL_FIREBALL":
case SNOWBALL: case "SNOWBALL":
case MINECART_FURNACE: case "MINECART_FURNACE":
case SPLASH_POTION: case "SPLASH_POTION":
case THROWN_EXP_BOTTLE: case "THROWN_EXP_BOTTLE":
case WITHER_SKULL: case "WITHER_SKULL":
case UNKNOWN: case "UNKNOWN":
case SPECTRAL_ARROW: case "SPECTRAL_ARROW":
case SHULKER_BULLET: case "SHULKER_BULLET":
case DRAGON_FIREBALL: case "DRAGON_FIREBALL":
case AREA_EFFECT_CLOUD: case "AREA_EFFECT_CLOUD":
case TRIDENT: case "TRIDENT":
case LLAMA_SPIT: case "LLAMA_SPIT":
// Do this stuff later // Do this stuff later
return; return;
// MISC // // MISC //
case DROPPED_ITEM: case "DROPPED_ITEM":
Item item = (Item) entity; Item item = (Item) entity;
this.stack = item.getItemStack(); this.stack = item.getItemStack();
return; return;
case ITEM_FRAME: case "ITEM_FRAME":
this.x = Math.floor(this.x); this.x = Math.floor(this.x);
this.y = Math.floor(this.y); this.y = Math.floor(this.y);
this.z = Math.floor(this.z); this.z = Math.floor(this.z);
@ -155,7 +155,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
this.dataByte = getOrdinal(Rotation.values(), itemFrame.getRotation()); this.dataByte = getOrdinal(Rotation.values(), itemFrame.getRotation());
this.stack = itemFrame.getItem().clone(); this.stack = itemFrame.getItem().clone();
return; return;
case PAINTING: case "PAINTING":
this.x = Math.floor(this.x); this.x = Math.floor(this.x);
this.y = Math.floor(this.y); this.y = Math.floor(this.y);
this.z = Math.floor(this.z); this.z = Math.floor(this.z);
@ -170,18 +170,18 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
return; return;
// END MISC // // END MISC //
// INVENTORY HOLDER // // INVENTORY HOLDER //
case MINECART_CHEST: case "MINECART_CHEST":
case MINECART_HOPPER: case "MINECART_HOPPER":
storeInventory((InventoryHolder) entity); storeInventory((InventoryHolder) entity);
return; return;
// START LIVING ENTITY // // START LIVING ENTITY //
// START AGEABLE // // START AGEABLE //
// START TAMEABLE // // START TAMEABLE //
case HORSE: case "HORSE":
case DONKEY: case "DONKEY":
case LLAMA: case "LLAMA":
case MULE: case "MULE":
case SKELETON_HORSE: case "SKELETON_HORSE":
AbstractHorse horse = (AbstractHorse) entity; AbstractHorse horse = (AbstractHorse) entity;
this.horse = new HorseStats(); this.horse = new HorseStats();
this.horse.jump = horse.getJumpStrength(); this.horse.jump = horse.getJumpStrength();
@ -199,15 +199,15 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
storeInventory(horse); storeInventory(horse);
return; return;
// END INVENTORY HOLDER // // END INVENTORY HOLDER //
case WOLF: case "WOLF":
case OCELOT: case "OCELOT":
storeTameable((Tameable) entity); storeTameable((Tameable) entity);
storeAgeable((Ageable) entity); storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity); storeLiving((LivingEntity) entity);
return; return;
// END TAMEABLE // // END TAMEABLE //
//todo fix sheep //todo fix sheep
case SHEEP: case "SHEEP":
Sheep sheep = (Sheep) entity; Sheep sheep = (Sheep) entity;
if (sheep.isSheared()) { if (sheep.isSheared()) {
this.dataByte = (byte) 1; this.dataByte = (byte) 1;
@ -218,23 +218,23 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
storeAgeable(sheep); storeAgeable(sheep);
storeLiving(sheep); storeLiving(sheep);
return; return;
case VILLAGER: case "VILLAGER":
case CHICKEN: case "CHICKEN":
case COW: case "COW":
case MUSHROOM_COW: case "MUSHROOM_COW":
case PIG: case "PIG":
case TURTLE: case "TURTLE":
case POLAR_BEAR: case "POLAR_BEAR":
storeAgeable((Ageable) entity); storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity); storeLiving((LivingEntity) entity);
return; return;
case RABBIT: case "RABBIT":
this.dataByte = getOrdinal(Rabbit.Type.values(), ((Rabbit) entity).getRabbitType()); this.dataByte = getOrdinal(Rabbit.Type.values(), ((Rabbit) entity).getRabbitType());
storeAgeable((Ageable) entity); storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity); storeLiving((LivingEntity) entity);
return; return;
// END AGEABLE // // END AGEABLE //
case ARMOR_STAND: case "ARMOR_STAND":
ArmorStand stand = (ArmorStand) entity; ArmorStand stand = (ArmorStand) entity;
this.inventory = this.inventory =
new ItemStack[] {stand.getItemInHand().clone(), stand.getHelmet().clone(), new ItemStack[] {stand.getItemInHand().clone(), stand.getHelmet().clone(),
@ -286,42 +286,45 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
this.stand.small = true; this.stand.small = true;
} }
return; return;
case ENDERMITE: case "ENDERMITE":
return; return;
case BAT: case "BAT":
if (((Bat) entity).isAwake()) { if (((Bat) entity).isAwake()) {
this.dataByte = (byte) 1; this.dataByte = (byte) 1;
} else { } else {
this.dataByte = (byte) 0; this.dataByte = (byte) 0;
} }
return; return;
case ENDER_DRAGON: case "ENDER_DRAGON":
EnderDragon entity1 = (EnderDragon) entity; EnderDragon entity1 = (EnderDragon) entity;
this.dataByte = (byte) entity1.getPhase().ordinal(); this.dataByte = (byte) entity1.getPhase().ordinal();
return; return;
case SKELETON: case "SKELETON":
case WITHER_SKELETON: case "WITHER_SKELETON":
case GUARDIAN: case "GUARDIAN":
case ELDER_GUARDIAN: case "ELDER_GUARDIAN":
case GHAST: case "GHAST":
case MAGMA_CUBE: case "MAGMA_CUBE":
case SQUID: case "SQUID":
case PIG_ZOMBIE: case "PIG_ZOMBIE":
case ZOMBIE: case "HOGLIN":
case WITHER: case "ZOMBIFIED_PIGLIN":
case WITCH: case "PIGLIN":
case SPIDER: case "ZOMBIE":
case CAVE_SPIDER: case "WITHER":
case SILVERFISH: case "WITCH":
case GIANT: case "SPIDER":
case ENDERMAN: case "CAVE_SPIDER":
case CREEPER: case "SILVERFISH":
case BLAZE: case "GIANT":
case SHULKER: case "ENDERMAN":
case SNOWMAN: case "CREEPER":
case "BLAZE":
case "SHULKER":
case "SNOWMAN":
storeLiving((LivingEntity) entity); storeLiving((LivingEntity) entity);
return; return;
case IRON_GOLEM: case "IRON_GOLEM":
if (((IronGolem) entity).isPlayerCreated()) { if (((IronGolem) entity).isPlayerCreated()) {
this.dataByte = (byte) 1; this.dataByte = (byte) 1;
} else { } else {
@ -463,16 +466,16 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
return null; return null;
} }
Entity entity; Entity entity;
switch (this.getType()) { switch (this.getType().toString()) {
case DROPPED_ITEM: case "DROPPED_ITEM":
return world.dropItem(location, this.stack); return world.dropItem(location, this.stack);
case PLAYER: case "PLAYER":
case LEASH_HITCH: case "LEASH_HITCH":
return null; return null;
case ITEM_FRAME: case "ITEM_FRAME":
entity = world.spawn(location, ItemFrame.class); entity = world.spawn(location, ItemFrame.class);
break; break;
case PAINTING: case "PAINTING":
entity = world.spawn(location, Painting.class); entity = world.spawn(location, Painting.class);
break; break;
default: default:
@ -504,73 +507,73 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
if (this.noGravity) { if (this.noGravity) {
entity.setGravity(false); entity.setGravity(false);
} }
switch (entity.getType()) { switch (entity.getType().toString()) {
case BOAT: case "BOAT":
Boat boat = (Boat) entity; Boat boat = (Boat) entity;
boat.setWoodType(TreeSpecies.values()[dataByte]); boat.setWoodType(TreeSpecies.values()[dataByte]);
return entity; return entity;
case SLIME: case "SLIME":
((Slime) entity).setSize(this.dataByte); ((Slime) entity).setSize(this.dataByte);
return entity; return entity;
case ARROW: case "ARROW":
case EGG: case "EGG":
case ENDER_CRYSTAL: case "ENDER_CRYSTAL":
case ENDER_PEARL: case "ENDER_PEARL":
case ENDER_SIGNAL: case "ENDER_SIGNAL":
case DROPPED_ITEM: case "DROPPED_ITEM":
case EXPERIENCE_ORB: case "EXPERIENCE_ORB":
case FALLING_BLOCK: case "FALLING_BLOCK":
case FIREBALL: case "FIREBALL":
case FIREWORK: case "FIREWORK":
case FISHING_HOOK: case "FISHING_HOOK":
case LEASH_HITCH: case "LEASH_HITCH":
case LIGHTNING: case "LIGHTNING":
case MINECART: case "MINECART":
case MINECART_COMMAND: case "MINECART_COMMAND":
case MINECART_MOB_SPAWNER: case "MINECART_MOB_SPAWNER":
case MINECART_TNT: case "MINECART_TNT":
case PLAYER: case "PLAYER":
case PRIMED_TNT: case "PRIMED_TNT":
case SMALL_FIREBALL: case "SMALL_FIREBALL":
case SNOWBALL: case "SNOWBALL":
case SPLASH_POTION: case "SPLASH_POTION":
case THROWN_EXP_BOTTLE: case "THROWN_EXP_BOTTLE":
case SPECTRAL_ARROW: case "SPECTRAL_ARROW":
case SHULKER_BULLET: case "SHULKER_BULLET":
case AREA_EFFECT_CLOUD: case "AREA_EFFECT_CLOUD":
case DRAGON_FIREBALL: case "DRAGON_FIREBALL":
case WITHER_SKULL: case "WITHER_SKULL":
case MINECART_FURNACE: case "MINECART_FURNACE":
case LLAMA_SPIT: case "LLAMA_SPIT":
case TRIDENT: case "TRIDENT":
case UNKNOWN: case "UNKNOWN":
// Do this stuff later // Do this stuff later
return entity; return entity;
// MISC // // MISC //
case ITEM_FRAME: case "ITEM_FRAME":
ItemFrame itemframe = (ItemFrame) entity; ItemFrame itemframe = (ItemFrame) entity;
itemframe.setRotation(Rotation.values()[this.dataByte]); itemframe.setRotation(Rotation.values()[this.dataByte]);
itemframe.setItem(this.stack); itemframe.setItem(this.stack);
return entity; return entity;
case PAINTING: case "PAINTING":
Painting painting = (Painting) entity; Painting painting = (Painting) entity;
painting.setFacingDirection(BlockFace.values()[this.dataByte], true); painting.setFacingDirection(BlockFace.values()[this.dataByte], true);
painting.setArt(Art.getByName(this.dataString), true); painting.setArt(Art.getByName(this.dataString), true);
return entity; return entity;
// END MISC // // END MISC //
// INVENTORY HOLDER // // INVENTORY HOLDER //
case MINECART_CHEST: case "MINECART_CHEST":
case MINECART_HOPPER: case "MINECART_HOPPER":
restoreInventory((InventoryHolder) entity); restoreInventory((InventoryHolder) entity);
return entity; return entity;
// START LIVING ENTITY // // START LIVING ENTITY //
// START AGEABLE // // START AGEABLE //
// START TAMEABLE // // START TAMEABLE //
case HORSE: case "HORSE":
case LLAMA: case "LLAMA":
case SKELETON_HORSE: case "SKELETON_HORSE":
case DONKEY: case "DONKEY":
case MULE: case "MULE":
AbstractHorse horse = (AbstractHorse) entity; AbstractHorse horse = (AbstractHorse) entity;
horse.setJumpStrength(this.horse.jump); horse.setJumpStrength(this.horse.jump);
if (horse instanceof ChestedHorse) { if (horse instanceof ChestedHorse) {
@ -586,14 +589,14 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
restoreInventory(horse); restoreInventory(horse);
return entity; return entity;
// END INVENTORY HOLDER // // END INVENTORY HOLDER //
case WOLF: case "WOLF":
case OCELOT: case "OCELOT":
restoreTameable((Tameable) entity); restoreTameable((Tameable) entity);
restoreAgeable((Ageable) entity); restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
// END AGEABLE // // END AGEABLE //
case SHEEP: case "SHEEP":
Sheep sheep = (Sheep) entity; Sheep sheep = (Sheep) entity;
if (this.dataByte == 1) { if (this.dataByte == 1) {
sheep.setSheared(true); sheep.setSheared(true);
@ -604,25 +607,25 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
restoreAgeable(sheep); restoreAgeable(sheep);
restoreLiving(sheep); restoreLiving(sheep);
return sheep; return sheep;
case VILLAGER: case "VILLAGER":
case CHICKEN: case "CHICKEN":
case COW: case "COW":
case TURTLE: case "TURTLE":
case POLAR_BEAR: case "POLAR_BEAR":
case MUSHROOM_COW: case "MUSHROOM_COW":
case PIG: case "PIG":
restoreAgeable((Ageable) entity); restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
// END AGEABLE // // END AGEABLE //
case RABBIT: case "RABBIT":
if (this.dataByte != 0) { if (this.dataByte != 0) {
((Rabbit) entity).setRabbitType(Rabbit.Type.values()[this.dataByte]); ((Rabbit) entity).setRabbitType(Rabbit.Type.values()[this.dataByte]);
} }
restoreAgeable((Ageable) entity); restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
case ARMOR_STAND: case "ARMOR_STAND":
// CHECK positions // CHECK positions
ArmorStand stand = (ArmorStand) entity; ArmorStand stand = (ArmorStand) entity;
if (this.inventory[0] != null) { if (this.inventory[0] != null) {
@ -688,42 +691,45 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
} }
restoreLiving(stand); restoreLiving(stand);
return stand; return stand;
case BAT: case "BAT":
if (this.dataByte != 0) { if (this.dataByte != 0) {
((Bat) entity).setAwake(true); ((Bat) entity).setAwake(true);
} }
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
case ENDER_DRAGON: case "ENDER_DRAGON":
if (this.dataByte != 0) { if (this.dataByte != 0) {
((EnderDragon) entity).setPhase(EnderDragon.Phase.values()[this.dataByte]); ((EnderDragon) entity).setPhase(EnderDragon.Phase.values()[this.dataByte]);
} }
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
case ENDERMITE: case "ENDERMITE":
case GHAST: case "GHAST":
case MAGMA_CUBE: case "MAGMA_CUBE":
case SQUID: case "SQUID":
case PIG_ZOMBIE: case "PIG_ZOMBIE":
case ZOMBIE: case "HOGLIN":
case WITHER: case "PIGLIN":
case WITCH: case "ZOMBIFIED_PIGLIN":
case SPIDER: case "ZOMBIE":
case CAVE_SPIDER: case "WITHER":
case SILVERFISH: case "WITCH":
case GIANT: case "SPIDER":
case ENDERMAN: case "CAVE_SPIDER":
case CREEPER: case "SILVERFISH":
case BLAZE: case "GIANT":
case SNOWMAN: case "ENDERMAN":
case SHULKER: case "CREEPER":
case GUARDIAN: case "BLAZE":
case ELDER_GUARDIAN: case "SNOWMAN":
case SKELETON: case "SHULKER":
case WITHER_SKELETON: case "GUARDIAN":
case "ELDER_GUARDIAN":
case "SKELETON":
case "WITHER_SKELETON":
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
case IRON_GOLEM: case "IRON_GOLEM":
if (this.dataByte != 0) { if (this.dataByte != 0) {
((IronGolem) entity).setPlayerCreated(true); ((IronGolem) entity).setPlayerCreated(true);
} }