From cf5d2a5e86ca5d22675f683683af0fdf49fa58a8 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Fri, 1 Jul 2016 17:13:49 -0400 Subject: [PATCH] Entity Fix and Gradle changes --- Bukkit/build.gradle | 14 ++-- .../com/plotsquared/bukkit/BukkitMain.java | 64 +++++++++---------- Sponge/build.gradle | 9 +-- build.gradle | 7 +- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Bukkit/build.gradle b/Bukkit/build.gradle index 67ec86e4d..0d77e6983 100644 --- a/Bukkit/build.gradle +++ b/Bukkit/build.gradle @@ -1,6 +1,12 @@ +repositories { + maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"} + maven { url = "https://oss.sonatype.org/content/repositories/snapshots/"} + maven {url "http://nexus.theyeticave.net/content/repositories/pub_releases"} +} + dependencies { compile project(':Core') - compile 'org.bukkit:Spigot:1.10' + compile 'org.spigotmc:spigot-api:1.10.2-R0.1-SNAPSHOT' compile 'org.mcstats.bukkit:metrics:R7' compile 'net.milkbowl.vault:VaultAPI:1.6' } @@ -17,19 +23,19 @@ processResources { ) } } - -apply plugin: 'com.github.johnrengelman.shadow' // We only want the shadow jar produced jar.enabled = false + shadowJar { dependencies { include(dependency(':Core')) include(dependency('org.mcstats.bukkit:metrics:R7')) } - relocate 'org.mcstats', 'com.plotsquared.stats' + relocate('org.mcstats', 'com.plotsquared.stats') archiveName = "${parent.name}-${project.name}-${parent.version}.jar" destinationDir = file '../target' } + shadowJar.doLast { task -> ant.checksum file: task.archivePath diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java index 7536d23d1..7fb9c2fde 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java @@ -208,7 +208,6 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain Entity entity = iterator.next(); switch (entity.getType()) { case EGG: - case ENDER_CRYSTAL: case COMPLEX_PART: case FISHING_HOOK: case ENDER_SIGNAL: @@ -239,37 +238,39 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain // Not vehicles continue; case ARMOR_STAND: - // Tempirarily classify as vehicle + // Temporarily classify as vehicle case MINECART: case MINECART_CHEST: case MINECART_COMMAND: case MINECART_FURNACE: case MINECART_HOPPER: case MINECART_MOB_SPAWNER: + case ENDER_CRYSTAL: case MINECART_TNT: case BOAT: { - if (!Settings.Enabled_Components.KILL_ROAD_VEHICLES) { - continue; - } - com.intellectualcrafters.plot.object.Location location = BukkitUtil.getLocation(entity.getLocation()); - Plot plot = location.getPlot(); - if (plot == null) { - if (location.isPlotArea()) { + if (Settings.Enabled_Components.KILL_ROAD_VEHICLES) { + com.intellectualcrafters.plot.object.Location location = BukkitUtil.getLocation(entity.getLocation()); + Plot plot = location.getPlot(); + if (plot == null) { + if (location.isPlotArea()) { + iterator.remove(); + entity.remove(); + } + continue; + } + List meta = entity.getMetadata("plot"); + if (meta.isEmpty()) { + continue; + } + Plot origin = (Plot) meta.get(0).value(); + if (!plot.equals(origin.getBasePlot(false))) { iterator.remove(); entity.remove(); } continue; - } - List meta = entity.getMetadata("plot"); - if (meta.isEmpty()) { + } else { continue; } - Plot origin = (Plot) meta.get(0).value(); - if (!plot.equals(origin.getBasePlot(false))) { - iterator.remove(); - entity.remove(); - } - continue; } case SMALL_FIREBALL: case FIREBALL: @@ -316,26 +317,25 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain case ZOMBIE: case SHULKER: default: - if (!Settings.Enabled_Components.KILL_ROAD_MOBS) { - continue; - } - Location location = entity.getLocation(); - if (BukkitUtil.getLocation(location).isPlotRoad()) { - if (entity instanceof LivingEntity) { - LivingEntity livingEntity = (LivingEntity) entity; - if (!livingEntity.isLeashed() || !entity.hasMetadata("keep")) { + if (Settings.Enabled_Components.KILL_ROAD_MOBS) { + Location location = entity.getLocation(); + if (BukkitUtil.getLocation(location).isPlotRoad()) { + if (entity instanceof LivingEntity) { + LivingEntity livingEntity = (LivingEntity) entity; + if (!livingEntity.isLeashed() || !entity.hasMetadata("keep")) { + Entity passenger = entity.getPassenger(); + if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) { + iterator.remove(); + entity.remove(); + } + } + } else { Entity passenger = entity.getPassenger(); if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) { iterator.remove(); entity.remove(); } } - } else { - Entity passenger = entity.getPassenger(); - if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) { - iterator.remove(); - entity.remove(); - } } } } diff --git a/Sponge/build.gradle b/Sponge/build.gradle index 8855fe517..8b036dc26 100644 --- a/Sponge/build.gradle +++ b/Sponge/build.gradle @@ -15,7 +15,6 @@ buildscript { } apply plugin: 'net.minecrell.vanilla.server.library' -apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(':Core') @@ -34,14 +33,10 @@ repositories { name = "Sponge" url = "https://repo.spongepowered.org/maven" } - maven { - name = "Sponge Metrics" - url = "http://repo.mcstats.org/content/repositories/releases/" - } } minecraft { - version = "1.9.4" - mappings = "snapshot_20160530" + version = "1.10.2" + mappings = "snapshot_20160629" runDir = 'run' } diff --git a/build.gradle b/build.gradle index 9574b550b..f8e70859e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,8 @@ import org.ajoberstar.grgit.Grgit buildscript { repositories { mavenCentral() - maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } + maven { url = "https://oss.sonatype.org/content/repositories/snapshots/"} jcenter() - mavenLocal() } dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' @@ -27,6 +26,8 @@ subprojects { apply plugin: 'maven' apply plugin: 'eclipse' apply plugin: 'idea' + apply plugin: 'com.github.johnrengelman.shadow' + dependencies { compile(group: 'com.sk89q.worldedit', name: 'worldedit-core', version:'6.1.3-SNAPSHOT') { @@ -43,9 +44,7 @@ subprojects { mavenCentral() maven {url "http://empcraft.com/maven2"} maven {url "http://repo.mcstats.org/content/repositories/public"} - maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"} maven {url "http://maven.sk89q.com/repo/"} - maven {url "http://nexus.theyeticave.net/content/repositories/pub_releases"} maven {url "http://repo.maven.apache.org/maven2"} } } \ No newline at end of file