Skip to content
Permalink
Browse files

(Initial) update to 1.14.1

  • Loading branch information...
mcmonkey4eva committed May 14, 2019
1 parent 8951284 commit 20ff1a7c8391c512f6f177c6a1664fb2954575aa
@@ -1,7 +1,7 @@
Denizen: Helpful Citizens for Bukkit!
-------------------------------------

**Version 1.0.6**: Compatible with Spigot 1.12.2, 1.13.2, and 1.14!
**Version 1.0.6**: Compatible with Spigot 1.12.2, 1.13.2, and 1.14.1!

#### Download Links:

@@ -80,6 +80,8 @@ public boolean isCorrectMappingsCode() {

public abstract void disableAsyncCatcher();

public abstract void undisableAsyncCatcher();

public abstract Sidebar createSidebar(Player player);

public abstract BlockLight createBlockLight(Location location, int lightLevel, long ticks);
@@ -3,12 +3,17 @@
import net.aufdemrand.denizen.nms.abstracts.ModernBlockData;
import net.aufdemrand.denizen.nms.util.PlayerProfile;
import net.aufdemrand.denizen.nms.util.jnbt.CompoundTag;
import net.aufdemrand.denizencore.objects.dList;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Skull;
import org.bukkit.event.world.PortalCreateEvent;
import org.bukkit.material.MaterialData;

import java.util.List;

public interface BlockHelper {

int idFor(Material mat);
@@ -46,4 +51,6 @@ default BlockData getBlockData(ModernBlockData data) {
default BlockState generateBlockState(Material mat) {
return null;
}

List<Location> getBlocksList(PortalCreateEvent event);
}
@@ -353,15 +353,6 @@ public void onEnable() {
getLogger().warning("-------------------------------------");
}

try {
NMSHandler.getInstance().disableAsyncCatcher();
}
catch (Throwable ex) {
dB.echoError("Running not-Spigot?! AsyncCatcher disable failed!");
dB.echoError(ex);
}


try {
versionTag = this.getDescription().getVersion();

@@ -1731,6 +1722,16 @@ public void preTagExecute() {
}
}

@Override
public void postTagExecute() {
try {
NMSHandler.getInstance().undisableAsyncCatcher();
}
catch (Throwable e) {
dB.echoError("Running not-Spigot?!");
}
}

Boolean tTimeoutSil = null;

@Override
@@ -2,13 +2,15 @@


import net.aufdemrand.denizen.events.BukkitScriptEvent;
import net.aufdemrand.denizen.nms.NMSHandler;
import net.aufdemrand.denizen.objects.dLocation;
import net.aufdemrand.denizen.objects.dWorld;
import net.aufdemrand.denizencore.objects.Element;
import net.aufdemrand.denizencore.objects.dList;
import net.aufdemrand.denizencore.objects.dObject;
import net.aufdemrand.denizencore.scripts.containers.ScriptContainer;
import net.aufdemrand.denizencore.utilities.CoreUtilities;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -87,8 +89,8 @@ public void onPortalCreate(PortalCreateEvent event) {
world = new dWorld(event.getWorld());
reason = new Element(event.getReason().toString());
blocks = new dList();
for (Block block : event.getBlocks()) {
blocks.add(new dLocation(block.getLocation()).identify());
for (Location location : NMSHandler.getInstance().getBlockHelper().getBlocksList(event)) {
blocks.add(new dLocation(location).identify());
}
this.event = event;
fire(event);
@@ -10,7 +10,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.14-R0.1-SNAPSHOT</craftbukkit.version>
<craftbukkit.version>1.14.1-R0.1-SNAPSHOT</craftbukkit.version>
<citizens.version>2.0.25-SNAPSHOT</citizens.version>
<dcore.version>1.40-SNAPSHOT</dcore.version>
<BUILD_NUMBER>Unknown</BUILD_NUMBER>
@@ -30,6 +30,7 @@
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.spigotmc.AsyncCatcher;

import java.util.Map;

@@ -51,9 +52,17 @@

private final ProfileEditor profileEditor = new ProfileEditor_v1_12_R1();

private boolean wasAsyncCatcherEnabled;

@Override
public void disableAsyncCatcher() {
org.spigotmc.AsyncCatcher.enabled = false;
wasAsyncCatcherEnabled = AsyncCatcher.enabled;
AsyncCatcher.enabled = false;
}

@Override
public void undisableAsyncCatcher() {
AsyncCatcher.enabled = wasAsyncCatcherEnabled;
}

@Override
@@ -12,6 +12,7 @@
import net.aufdemrand.denizen.nms.util.jnbt.CompoundTag;
import net.aufdemrand.denizencore.utilities.debugging.dB;
import net.minecraft.server.v1_12_R1.*;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.SkullType;
import org.bukkit.block.Block;
@@ -21,13 +22,25 @@
import org.bukkit.craftbukkit.v1_12_R1.block.CraftBlockState;
import org.bukkit.craftbukkit.v1_12_R1.block.CraftSkull;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
import org.bukkit.event.world.PortalCreateEvent;
import org.bukkit.material.MaterialData;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class BlockHelper_v1_12_R1 implements BlockHelper {

@Override
public List<Location> getBlocksList(PortalCreateEvent event) {
List<Location> blocks = new ArrayList<>();
for (Block block : event.getBlocks()) {
blocks.add(block.getLocation());
}
return blocks;
}

@Override
public int idFor(Material mat) {
return mat.getId();
@@ -34,6 +34,7 @@
import org.bukkit.craftbukkit.v1_13_R2.util.CraftMagicNumbers;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.spigotmc.AsyncCatcher;

import java.util.Map;

@@ -55,9 +56,17 @@

private final ProfileEditor profileEditor = new ProfileEditor_v1_13_R2();

private boolean wasAsyncCatcherEnabled;

@Override
public void disableAsyncCatcher() {
org.spigotmc.AsyncCatcher.enabled = false;
wasAsyncCatcherEnabled = AsyncCatcher.enabled;
AsyncCatcher.enabled = false;
}

@Override
public void undisableAsyncCatcher() {
AsyncCatcher.enabled = wasAsyncCatcherEnabled;
}

@Override
@@ -13,6 +13,7 @@
import net.aufdemrand.denizen.nms.util.jnbt.CompoundTag;
import net.aufdemrand.denizencore.utilities.debugging.dB;
import net.minecraft.server.v1_13_R2.*;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Skull;
@@ -21,13 +22,25 @@
import org.bukkit.craftbukkit.v1_13_R2.block.CraftSkull;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_13_R2.util.CraftLegacy;
import org.bukkit.event.world.PortalCreateEvent;
import org.bukkit.material.MaterialData;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class BlockHelper_v1_13_R2 implements BlockHelper {

@Override
public List<Location> getBlocksList(PortalCreateEvent event) {
List<Location> blocks = new ArrayList<>();
for (Block block : event.getBlocks()) {
blocks.add(block.getLocation());
}
return blocks;
}

public <T extends TileEntity> T getTE(CraftBlockEntityState<T> cbs) {
try {
Field f = CraftBlockEntityState.class.getDeclaredField("tileEntity");
@@ -28,7 +28,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14-R0.1-SNAPSHOT</version>
<version>1.14.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.14-R0.1-SNAPSHOT</version>
<version>1.14.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
@@ -35,6 +35,7 @@
import org.bukkit.craftbukkit.v1_14_R1.util.CraftMagicNumbers;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.spigotmc.AsyncCatcher;

import java.lang.reflect.Field;
import java.util.Map;
@@ -57,14 +58,22 @@

private final ProfileEditor profileEditor = new ProfileEditor_v1_14_R1();

private boolean wasAsyncCatcherEnabled;

@Override
public void disableAsyncCatcher() {
org.spigotmc.AsyncCatcher.enabled = false;
wasAsyncCatcherEnabled = AsyncCatcher.enabled;
AsyncCatcher.enabled = false;
}

@Override
public void undisableAsyncCatcher() {
AsyncCatcher.enabled = wasAsyncCatcherEnabled;
}

@Override
public boolean isCorrectMappingsCode() {
return ((CraftMagicNumbers) CraftMagicNumbers.INSTANCE).getMappingsVersion().equals("30f0a3bd4ceb5c03fe41ac0cfea4ffe3");
return ((CraftMagicNumbers) CraftMagicNumbers.INSTANCE).getMappingsVersion().equals("48be70f51ffe914d865f175ed3bf992d");
}

@Override
@@ -14,6 +14,7 @@
import net.aufdemrand.denizen.nms.util.jnbt.CompoundTag;
import net.aufdemrand.denizencore.utilities.debugging.dB;
import net.minecraft.server.v1_14_R1.*;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Skull;
@@ -22,13 +23,25 @@
import org.bukkit.craftbukkit.v1_14_R1.block.CraftSkull;
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_14_R1.util.CraftLegacy;
import org.bukkit.event.world.PortalCreateEvent;
import org.bukkit.material.MaterialData;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class BlockHelper_v1_14_R1 implements BlockHelper {

@Override
public List<Location> getBlocksList(PortalCreateEvent event) {
List<Location> blocks = new ArrayList<>();
for (org.bukkit.block.BlockState block : event.getBlocks()) {
blocks.add(block.getLocation());
}
return blocks;
}

public <T extends TileEntity> T getTE(CraftBlockEntityState<T> cbs) {
try {
Field f = CraftBlockEntityState.class.getDeclaredField("tileEntity");
@@ -110,7 +110,7 @@ else if (entityType == EntityType.ENDERMAN) {
sendPacket(player, new PacketPlayOutSpawnEntityLiving(entity));
sendPacket(player, new PacketPlayOutCamera(entity));
((CraftServer) Bukkit.getServer()).getHandle().moveToWorld(((CraftPlayer) player).getHandle(),
((CraftWorld) player.getWorld()).getHandle().dimension, true, player.getLocation(), false);
((CraftWorld) player.getWorld()).getHandle().worldProvider.getDimensionManager(), true, player.getLocation(), false);
}

@Override

0 comments on commit 20ff1a7

Please sign in to comment.
You can’t perform that action at this time.