From 70e2b07d511b25efafd3494fd1567096701b54dc Mon Sep 17 00:00:00 2001 From: Sanjay Govind Date: Tue, 19 May 2015 21:59:38 +1200 Subject: [PATCH 1/4] Update to 1.8.4 --- pom.xml | 338 +++---- src/main/java/net/citizensnpcs/Citizens.java | 916 +++++++++--------- .../java/net/citizensnpcs/EventListen.java | 6 +- .../net/citizensnpcs/npc/CitizensNPC.java | 586 +++++------ .../citizensnpcs/npc/MobEntityController.java | 10 +- .../npc/ai/AStarNavigationStrategy.java | 2 +- .../net/citizensnpcs/npc/ai/BlockBreaker.java | 26 +- .../npc/ai/FlyingAStarNavigationStrategy.java | 2 +- .../npc/ai/MCNavigationStrategy.java | 6 +- .../citizensnpcs/npc/ai/MCTargetStrategy.java | 10 +- .../npc/entity/BatController.java | 14 +- .../npc/entity/BlazeController.java | 14 +- .../npc/entity/CaveSpiderController.java | 18 +- .../npc/entity/ChickenController.java | 18 +- .../npc/entity/CowController.java | 18 +- .../npc/entity/CreeperController.java | 20 +- .../npc/entity/EnderDragonController.java | 14 +- .../npc/entity/EndermanController.java | 18 +- .../npc/entity/EndermiteController.java | 18 +- .../npc/entity/EntityHumanNPC.java | 46 +- .../npc/entity/GhastController.java | 14 +- .../npc/entity/GiantController.java | 18 +- .../npc/entity/GuardianController.java | 22 +- .../npc/entity/HorseController.java | 18 +- .../npc/entity/HumanController.java | 12 +- .../npc/entity/IronGolemController.java | 18 +- .../npc/entity/MagmaCubeController.java | 18 +- .../npc/entity/MushroomCowController.java | 18 +- .../npc/entity/OcelotController.java | 18 +- .../npc/entity/PigController.java | 20 +- .../npc/entity/PigZombieController.java | 18 +- .../npc/entity/RabbitController.java | 18 +- .../npc/entity/SheepController.java | 18 +- .../npc/entity/SilverfishController.java | 18 +- .../npc/entity/SkeletonController.java | 18 +- .../npc/entity/SlimeController.java | 22 +- .../npc/entity/SnowmanController.java | 18 +- .../npc/entity/SpiderController.java | 18 +- .../npc/entity/SquidController.java | 18 +- .../npc/entity/VillagerController.java | 20 +- .../npc/entity/WitchController.java | 18 +- .../npc/entity/WitherController.java | 14 +- .../npc/entity/WolfController.java | 18 +- .../npc/entity/ZombieController.java | 18 +- .../nonliving/ArmorStandController.java | 18 +- .../npc/entity/nonliving/ArrowController.java | 14 +- .../npc/entity/nonliving/BoatController.java | 14 +- .../npc/entity/nonliving/EggController.java | 18 +- .../nonliving/EnderCrystalController.java | 14 +- .../nonliving/EnderPearlController.java | 16 +- .../nonliving/EnderSignalController.java | 14 +- .../nonliving/ExperienceOrbController.java | 14 +- .../nonliving/FallingBlockController.java | 26 +- .../entity/nonliving/FireworkController.java | 14 +- .../nonliving/FishingHookController.java | 14 +- .../npc/entity/nonliving/ItemController.java | 24 +- .../entity/nonliving/ItemFrameController.java | 14 +- .../nonliving/LargeFireballController.java | 14 +- .../npc/entity/nonliving/LeashController.java | 14 +- .../nonliving/MinecartChestController.java | 14 +- .../nonliving/MinecartCommandController.java | 14 +- .../nonliving/MinecartFurnaceController.java | 14 +- .../nonliving/MinecartHopperController.java | 8 +- .../nonliving/MinecartRideableController.java | 14 +- .../nonliving/MinecartSpawnerController.java | 8 +- .../nonliving/MinecartTNTController.java | 8 +- .../entity/nonliving/PaintingController.java | 14 +- .../nonliving/SmallFireballController.java | 14 +- .../entity/nonliving/SnowballController.java | 14 +- .../entity/nonliving/TNTPrimedController.java | 14 +- .../nonliving/ThrownExpBottleController.java | 14 +- .../nonliving/ThrownPotionController.java | 14 +- .../nonliving/WitherSkullController.java | 14 +- .../npc/network/EmptyNetHandler.java | 10 +- .../npc/network/EmptyNetworkManager.java | 4 +- .../net/citizensnpcs/trait/Controllable.java | 26 +- .../net/citizensnpcs/trait/RabbitType.java | 2 +- .../waypoint/EntityEnderSignalMarker.java | 6 +- src/main/java/net/citizensnpcs/util/NMS.java | 66 +- .../citizensnpcs/util/PlayerAnimation.java | 14 +- .../util/nms/PlayerControllerLook.java | 6 +- .../util/nms/PlayerControllerMove.java | 10 +- .../util/nms/PlayerNavigation.java | 38 +- .../util/nms/PlayerlistTrackerEntry.java | 8 +- 84 files changed, 1570 insertions(+), 1570 deletions(-) diff --git a/pom.xml b/pom.xml index 062082ab9..969898b74 100644 --- a/pom.xml +++ b/pom.xml @@ -1,169 +1,169 @@ - - - - 4.0.0 - - net.citizensnpcs - citizens - 2.0.15-SNAPSHOT - Citizens - - - UTF-8 - 1.8.3-R0.1-SNAPSHOT - 2.0.15-SNAPSHOT - 1.4.1 - 1.4.12 - Unknown - Unknown - - - - - bukkit-repo - http://repo.bukkit.org/content/groups/public/ - - - everything - http://repo.citizensnpcs.co - - - vault-repo - http://nexus.theyeticave.net/content/repositories/pub_releases - - - - - - bukkit-plugins - http://repo.bukkit.org/content/groups/public - - - - - - org.bukkit - bukkit - ${craftbukkit.version} - jar - provided - - - org.bukkit - craftbukkit - ${craftbukkit.version} - jar - provided - - - net.citizensnpcs - citizensapi - ${citizensapi.version} - jar - compile - - - net.sf.trove4j - trove4j - 3.0.3 - compile - - - net.milkbowl.vault - Vault - ${vault.version} - jar - provided - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito - ${powermock.version} - test - - - - http://www.citizensnpcs.co - - jenkins - http://ci.citizensnpcs.co - - - scm:git:git://github.com/CitizensDev/Citizens2.git - scm:git:git:@github.com:CitizensDev/Citizens2.git - https://github.com/CitizensDev/Citizens2/tree/master/ - - - clean package install - ${basedir}/src/main/java - - - - . - true - ${basedir}/src/main/resources - - plugin.yml - *.properties - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.3.2 - - - - org.apache.maven.plugins - maven-shade-plugin - 2.1 - - - package - - shade - - - true - - - net.citizensnpcs:citizensapi - - ** - - - - - - gnu.trove - lib.trove - - - - - - - - - - + + + + 4.0.0 + + net.citizensnpcs + citizens + 2.0.15-SNAPSHOT + Citizens + + + UTF-8 + 1.8.4-R0.1-SNAPSHOT + 2.0.15-SNAPSHOT + 1.4.1 + 1.4.12 + Unknown + Unknown + + + + + bukkit-repo + http://repo.bukkit.org/content/groups/public/ + + + everything + http://repo.citizensnpcs.co + + + vault-repo + http://nexus.theyeticave.net/content/repositories/pub_releases + + + + + + bukkit-plugins + http://repo.bukkit.org/content/groups/public + + + + + + org.bukkit + bukkit + ${craftbukkit.version} + jar + provided + + + org.bukkit + craftbukkit + ${craftbukkit.version} + jar + provided + + + net.citizensnpcs + citizensapi + ${citizensapi.version} + jar + compile + + + net.sf.trove4j + trove4j + 3.0.3 + compile + + + net.milkbowl.vault + Vault + ${vault.version} + jar + provided + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito + ${powermock.version} + test + + + + http://www.citizensnpcs.co + + jenkins + http://ci.citizensnpcs.co + + + scm:git:git://github.com/CitizensDev/Citizens2.git + scm:git:git:@github.com:CitizensDev/Citizens2.git + https://github.com/CitizensDev/Citizens2/tree/master/ + + + clean package install + ${basedir}/src/main/java + + + + . + true + ${basedir}/src/main/resources + + plugin.yml + *.properties + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.2 + + + + org.apache.maven.plugins + maven-shade-plugin + 2.1 + + + package + + shade + + + true + + + net.citizensnpcs:citizensapi + + ** + + + + + + gnu.trove + lib.trove + + + + + + + + + + diff --git a/src/main/java/net/citizensnpcs/Citizens.java b/src/main/java/net/citizensnpcs/Citizens.java index b600e62d7..58be6ad64 100644 --- a/src/main/java/net/citizensnpcs/Citizens.java +++ b/src/main/java/net/citizensnpcs/Citizens.java @@ -1,458 +1,458 @@ -package net.citizensnpcs; - -import java.io.File; -import java.io.IOException; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; - -import net.citizensnpcs.Settings.Setting; -import net.citizensnpcs.api.CitizensAPI; -import net.citizensnpcs.api.CitizensPlugin; -import net.citizensnpcs.api.ai.speech.SpeechFactory; -import net.citizensnpcs.api.command.CommandContext; -import net.citizensnpcs.api.command.CommandManager; -import net.citizensnpcs.api.command.CommandManager.CommandInfo; -import net.citizensnpcs.api.command.Injector; -import net.citizensnpcs.api.event.CitizensDisableEvent; -import net.citizensnpcs.api.event.CitizensEnableEvent; -import net.citizensnpcs.api.event.CitizensReloadEvent; -import net.citizensnpcs.api.event.DespawnReason; -import net.citizensnpcs.api.exception.NPCLoadException; -import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.api.npc.NPCDataStore; -import net.citizensnpcs.api.npc.NPCRegistry; -import net.citizensnpcs.api.npc.SimpleNPCDataStore; -import net.citizensnpcs.api.scripting.EventRegistrar; -import net.citizensnpcs.api.scripting.ObjectProvider; -import net.citizensnpcs.api.scripting.ScriptCompiler; -import net.citizensnpcs.api.trait.Trait; -import net.citizensnpcs.api.trait.TraitFactory; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.api.util.NBTStorage; -import net.citizensnpcs.api.util.Storage; -import net.citizensnpcs.api.util.Translator; -import net.citizensnpcs.api.util.YamlStorage; -import net.citizensnpcs.commands.AdminCommands; -import net.citizensnpcs.commands.EditorCommands; -import net.citizensnpcs.commands.NPCCommands; -import net.citizensnpcs.commands.TemplateCommands; -import net.citizensnpcs.commands.TraitCommands; -import net.citizensnpcs.commands.WaypointCommands; -import net.citizensnpcs.editor.Editor; -import net.citizensnpcs.npc.CitizensNPCRegistry; -import net.citizensnpcs.npc.CitizensTraitFactory; -import net.citizensnpcs.npc.NPCSelector; -import net.citizensnpcs.npc.ai.speech.Chat; -import net.citizensnpcs.npc.ai.speech.CitizensSpeechFactory; -import net.citizensnpcs.util.Messages; -import net.citizensnpcs.util.NMS; -import net.citizensnpcs.util.StringHelper; -import net.citizensnpcs.util.Util; -import net.milkbowl.vault.economy.Economy; - -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.RegisteredServiceProvider; -import org.bukkit.plugin.java.JavaPlugin; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; - -public class Citizens extends JavaPlugin implements CitizensPlugin { - private final CommandManager commands = new CommandManager(); - private boolean compatible; - private Settings config; - private CitizensNPCRegistry npcRegistry; - private NPCDataStore saves; - private NPCSelector selector; - private CitizensSpeechFactory speechFactory; - private final Map storedRegistries = Maps.newHashMap(); - private CitizensTraitFactory traitFactory; - - @Override - public NPCRegistry createAnonymousNPCRegistry(NPCDataStore store) { - return new CitizensNPCRegistry(store); - } - - @Override - public NPCRegistry createNamedNPCRegistry(String name, NPCDataStore store) { - NPCRegistry created = new CitizensNPCRegistry(store); - storedRegistries.put(name, created); - return created; - } - - private NPCDataStore createStorage(File folder) { - Storage saves = null; - String type = Setting.STORAGE_TYPE.asString(); - if (type.equalsIgnoreCase("nbt")) { - saves = new NBTStorage(new File(folder + File.separator + Setting.STORAGE_FILE.asString()), - "Citizens NPC Storage"); - } - if (saves == null) - saves = new YamlStorage(new File(folder, Setting.STORAGE_FILE.asString()), "Citizens NPC Storage"); - if (!saves.load()) - return null; - return SimpleNPCDataStore.create(saves); - } - - private void despawnNPCs() { - Iterator itr = npcRegistry.iterator(); - while (itr.hasNext()) { - NPC npc = itr.next(); - try { - npc.despawn(DespawnReason.REMOVAL); - for (Trait trait : npc.getTraits()) { - trait.onRemove(); - } - } catch (Throwable e) { - e.printStackTrace(); - // ensure that all entities are despawned - } - itr.remove(); - } - } - - private void enableSubPlugins() { - File root = new File(getDataFolder(), Setting.SUBPLUGIN_FOLDER.asString()); - if (!root.exists() || !root.isDirectory()) - return; - File[] files = root.listFiles(); - for (File file : files) { - Plugin plugin; - try { - plugin = Bukkit.getPluginManager().loadPlugin(file); - } catch (Exception e) { - continue; - } - if (plugin == null) - continue; - // code beneath modified from CraftServer - try { - Messaging.logTr(Messages.LOADING_SUB_PLUGIN, plugin.getDescription().getFullName()); - plugin.onLoad(); - } catch (Throwable ex) { - Messaging.severeTr(Messages.ERROR_INITALISING_SUB_PLUGIN, ex.getMessage(), plugin.getDescription() - .getFullName()); - ex.printStackTrace(); - } - } - NMS.loadPlugins(); - } - - public CommandInfo getCommandInfo(String rootCommand, String modifier) { - return commands.getCommand(rootCommand, modifier); - } - - public Iterable getCommands(String base) { - return commands.getCommands(base); - } - - @Override - public net.citizensnpcs.api.npc.NPCSelector getDefaultNPCSelector() { - return selector; - } - - @Override - public NPCRegistry getNamedNPCRegistry(String name) { - return storedRegistries.get(name); - } - - @Override - public Iterable getNPCRegistries() { - return new Iterable() { - @Override - public Iterator iterator() { - return new Iterator() { - Iterator stored; - - @Override - public boolean hasNext() { - return stored == null ? true : stored.hasNext(); - } - - @Override - public NPCRegistry next() { - if (stored == null) { - stored = storedRegistries.values().iterator(); - return npcRegistry; - } - return stored.next(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } - - @Override - public NPCRegistry getNPCRegistry() { - return npcRegistry; - } - - public NPCSelector getNPCSelector() { - return selector; - } - - @Override - public ClassLoader getOwningClassLoader() { - return getClassLoader(); - } - - @Override - public File getScriptFolder() { - return new File(getDataFolder(), "scripts"); - } - - @Override - public SpeechFactory getSpeechFactory() { - return speechFactory; - } - - @Override - public TraitFactory getTraitFactory() { - return traitFactory; - } - - @Override - public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String cmdName, String[] args) { - String modifier = args.length > 0 ? args[0] : ""; - if (!commands.hasCommand(command, modifier) && !modifier.isEmpty()) { - return suggestClosestModifier(sender, command.getName(), modifier); - } - - NPC npc = selector == null ? null : selector.getSelected(sender); - // TODO: change the args supplied to a context style system for - // flexibility (ie. adding more context in the future without - // changing everything) - - Object[] methodArgs = { sender, npc }; - return commands.executeSafe(command, args, sender, methodArgs); - } - - @Override - public void onDisable() { - Bukkit.getPluginManager().callEvent(new CitizensDisableEvent()); - Editor.leaveAll(); - - if (compatible) { - saves.storeAll(npcRegistry); - saves.saveToDiskImmediate(); - despawnNPCs(); - npcRegistry = null; - } - - CitizensAPI.shutdown(); - } - - @Override - public void onEnable() { - setupTranslator(); - CitizensAPI.setImplementation(this); - config = new Settings(getDataFolder()); - // Disable if the server is not using the compatible Minecraft version - String mcVersion = Util.getMinecraftVersion(); - compatible = mcVersion.startsWith(COMPATIBLE_MC_VERSION); - if (Setting.CHECK_MINECRAFT_VERSION.asBoolean() && !compatible) { - Messaging.severeTr(Messages.CITIZENS_INCOMPATIBLE, getDescription().getVersion(), mcVersion); - getServer().getPluginManager().disablePlugin(this); - return; - } - registerScriptHelpers(); - - saves = createStorage(getDataFolder()); - if (saves == null) { - Messaging.severeTr(Messages.FAILED_LOAD_SAVES); - getServer().getPluginManager().disablePlugin(this); - return; - } - - npcRegistry = new CitizensNPCRegistry(saves); - traitFactory = new CitizensTraitFactory(); - selector = new NPCSelector(this); - speechFactory = new CitizensSpeechFactory(); - speechFactory.register(Chat.class, "chat"); - - getServer().getPluginManager().registerEvents(new EventListen(storedRegistries), this); - - if (Setting.NPC_COST.asDouble() > 0) - setupEconomy(); - - registerCommands(); - enableSubPlugins(); - - // Setup NPCs after all plugins have been enabled (allows for multiworld - // support and for NPCs to properly register external settings) - if (getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() { - @Override - public void run() { - saves.loadInto(npcRegistry); - Messaging.logTr(Messages.NUM_LOADED_NOTIFICATION, Iterables.size(npcRegistry), "?"); - startMetrics(); - scheduleSaveTask(Setting.SAVE_TASK_DELAY.asInt()); - Bukkit.getPluginManager().callEvent(new CitizensEnableEvent()); - } - }, 1) == -1) { - Messaging.severeTr(Messages.LOAD_TASK_NOT_SCHEDULED); - getServer().getPluginManager().disablePlugin(this); - } - } - - @Override - public void onImplementationChanged() { - Messaging.severeTr(Messages.CITIZENS_IMPLEMENTATION_DISABLED); - Bukkit.getPluginManager().disablePlugin(this); - } - - public void registerCommandClass(Class clazz) { - try { - commands.register(clazz); - } catch (Throwable ex) { - Messaging.logTr(Messages.CITIZENS_INVALID_COMMAND_CLASS); - ex.printStackTrace(); - } - } - - private void registerCommands() { - commands.setInjector(new Injector(this)); - // Register command classes - commands.register(AdminCommands.class); - commands.register(EditorCommands.class); - commands.register(NPCCommands.class); - commands.register(TemplateCommands.class); - commands.register(TraitCommands.class); - commands.register(WaypointCommands.class); - } - - private void registerScriptHelpers() { - ScriptCompiler compiler = CitizensAPI.getScriptCompiler(); - compiler.registerGlobalContextProvider(new EventRegistrar(this)); - compiler.registerGlobalContextProvider(new ObjectProvider("plugin", this)); - } - - public void reload() throws NPCLoadException { - Editor.leaveAll(); - config.reload(); - despawnNPCs(); - saves.loadInto(npcRegistry); - - getServer().getPluginManager().callEvent(new CitizensReloadEvent()); - } - - @Override - public void removeNamedNPCRegistry(String name) { - storedRegistries.remove(name); - } - - private void scheduleSaveTask(int delay) { - Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { - @Override - public void run() { - storeNPCs(); - saves.saveToDisk(); - } - }, delay, delay); - } - - private void setupEconomy() { - try { - RegisteredServiceProvider provider = Bukkit.getServicesManager().getRegistration(Economy.class); - if (provider != null && provider.getProvider() != null) { - Economy economy = provider.getProvider(); - Bukkit.getPluginManager().registerEvents(new PaymentListener(economy), this); - } - } catch (NoClassDefFoundError e) { - Messaging.logTr(Messages.ERROR_LOADING_ECONOMY); - } - } - - private void setupTranslator() { - Locale locale = Locale.getDefault(); - String setting = Setting.LOCALE.asString(); - if (!setting.isEmpty()) { - String[] parts = setting.split("[\\._]"); - switch (parts.length) { - case 1: - locale = new Locale(parts[0]); - break; - case 2: - locale = new Locale(parts[0], parts[1]); - break; - case 3: - locale = new Locale(parts[0], parts[1], parts[2]); - break; - default: - break; - } - } - Translator.setInstance(new File(getDataFolder(), "lang"), locale); - } - - private void startMetrics() { - try { - Metrics metrics = new Metrics(Citizens.this); - if (metrics.isOptOut()) - return; - metrics.addCustomData(new Metrics.Plotter("Total NPCs") { - @Override - public int getValue() { - if (npcRegistry == null) - return 0; - return Iterables.size(npcRegistry); - } - }); - metrics.addCustomData(new Metrics.Plotter("Total goals") { - @Override - public int getValue() { - if (npcRegistry == null) - return 0; - int goalCount = 0; - for (NPC npc : npcRegistry) { - goalCount += Iterables.size(npc.getDefaultGoalController()); - } - return goalCount; - } - }); - traitFactory.addPlotters(metrics.createGraph("traits")); - metrics.start(); - } catch (IOException e) { - Messaging.logTr(Messages.METRICS_ERROR_NOTIFICATION, e.getMessage()); - } - } - - public void storeNPCs() { - if (saves == null) - return; - for (NPC npc : npcRegistry) { - saves.store(npc); - } - } - - public void storeNPCs(CommandContext args) { - storeNPCs(); - boolean async = args.hasFlag('a'); - if (async) { - saves.saveToDisk(); - } else { - saves.saveToDiskImmediate(); - } - } - - private boolean suggestClosestModifier(CommandSender sender, String command, String modifier) { - String closest = commands.getClosestCommandModifier(command, modifier); - if (!closest.isEmpty()) { - sender.sendMessage(ChatColor.GRAY + Messaging.tr(Messages.UNKNOWN_COMMAND)); - sender.sendMessage(StringHelper.wrap(" /") + command + " " + StringHelper.wrap(closest)); - return true; - } - return false; - } - - private static final String COMPATIBLE_MC_VERSION = "1.8.3"; -} +package net.citizensnpcs; + +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; + +import net.citizensnpcs.Settings.Setting; +import net.citizensnpcs.api.CitizensAPI; +import net.citizensnpcs.api.CitizensPlugin; +import net.citizensnpcs.api.ai.speech.SpeechFactory; +import net.citizensnpcs.api.command.CommandContext; +import net.citizensnpcs.api.command.CommandManager; +import net.citizensnpcs.api.command.CommandManager.CommandInfo; +import net.citizensnpcs.api.command.Injector; +import net.citizensnpcs.api.event.CitizensDisableEvent; +import net.citizensnpcs.api.event.CitizensEnableEvent; +import net.citizensnpcs.api.event.CitizensReloadEvent; +import net.citizensnpcs.api.event.DespawnReason; +import net.citizensnpcs.api.exception.NPCLoadException; +import net.citizensnpcs.api.npc.NPC; +import net.citizensnpcs.api.npc.NPCDataStore; +import net.citizensnpcs.api.npc.NPCRegistry; +import net.citizensnpcs.api.npc.SimpleNPCDataStore; +import net.citizensnpcs.api.scripting.EventRegistrar; +import net.citizensnpcs.api.scripting.ObjectProvider; +import net.citizensnpcs.api.scripting.ScriptCompiler; +import net.citizensnpcs.api.trait.Trait; +import net.citizensnpcs.api.trait.TraitFactory; +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.api.util.NBTStorage; +import net.citizensnpcs.api.util.Storage; +import net.citizensnpcs.api.util.Translator; +import net.citizensnpcs.api.util.YamlStorage; +import net.citizensnpcs.commands.AdminCommands; +import net.citizensnpcs.commands.EditorCommands; +import net.citizensnpcs.commands.NPCCommands; +import net.citizensnpcs.commands.TemplateCommands; +import net.citizensnpcs.commands.TraitCommands; +import net.citizensnpcs.commands.WaypointCommands; +import net.citizensnpcs.editor.Editor; +import net.citizensnpcs.npc.CitizensNPCRegistry; +import net.citizensnpcs.npc.CitizensTraitFactory; +import net.citizensnpcs.npc.NPCSelector; +import net.citizensnpcs.npc.ai.speech.Chat; +import net.citizensnpcs.npc.ai.speech.CitizensSpeechFactory; +import net.citizensnpcs.util.Messages; +import net.citizensnpcs.util.NMS; +import net.citizensnpcs.util.StringHelper; +import net.citizensnpcs.util.Util; +import net.milkbowl.vault.economy.Economy; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.RegisteredServiceProvider; +import org.bukkit.plugin.java.JavaPlugin; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; + +public class Citizens extends JavaPlugin implements CitizensPlugin { + private final CommandManager commands = new CommandManager(); + private boolean compatible; + private Settings config; + private CitizensNPCRegistry npcRegistry; + private NPCDataStore saves; + private NPCSelector selector; + private CitizensSpeechFactory speechFactory; + private final Map storedRegistries = Maps.newHashMap(); + private CitizensTraitFactory traitFactory; + + @Override + public NPCRegistry createAnonymousNPCRegistry(NPCDataStore store) { + return new CitizensNPCRegistry(store); + } + + @Override + public NPCRegistry createNamedNPCRegistry(String name, NPCDataStore store) { + NPCRegistry created = new CitizensNPCRegistry(store); + storedRegistries.put(name, created); + return created; + } + + private NPCDataStore createStorage(File folder) { + Storage saves = null; + String type = Setting.STORAGE_TYPE.asString(); + if (type.equalsIgnoreCase("nbt")) { + saves = new NBTStorage(new File(folder + File.separator + Setting.STORAGE_FILE.asString()), + "Citizens NPC Storage"); + } + if (saves == null) + saves = new YamlStorage(new File(folder, Setting.STORAGE_FILE.asString()), "Citizens NPC Storage"); + if (!saves.load()) + return null; + return SimpleNPCDataStore.create(saves); + } + + private void despawnNPCs() { + Iterator itr = npcRegistry.iterator(); + while (itr.hasNext()) { + NPC npc = itr.next(); + try { + npc.despawn(DespawnReason.REMOVAL); + for (Trait trait : npc.getTraits()) { + trait.onRemove(); + } + } catch (Throwable e) { + e.printStackTrace(); + // ensure that all entities are despawned + } + itr.remove(); + } + } + + private void enableSubPlugins() { + File root = new File(getDataFolder(), Setting.SUBPLUGIN_FOLDER.asString()); + if (!root.exists() || !root.isDirectory()) + return; + File[] files = root.listFiles(); + for (File file : files) { + Plugin plugin; + try { + plugin = Bukkit.getPluginManager().loadPlugin(file); + } catch (Exception e) { + continue; + } + if (plugin == null) + continue; + // code beneath modified from CraftServer + try { + Messaging.logTr(Messages.LOADING_SUB_PLUGIN, plugin.getDescription().getFullName()); + plugin.onLoad(); + } catch (Throwable ex) { + Messaging.severeTr(Messages.ERROR_INITALISING_SUB_PLUGIN, ex.getMessage(), plugin.getDescription() + .getFullName()); + ex.printStackTrace(); + } + } + NMS.loadPlugins(); + } + + public CommandInfo getCommandInfo(String rootCommand, String modifier) { + return commands.getCommand(rootCommand, modifier); + } + + public Iterable getCommands(String base) { + return commands.getCommands(base); + } + + @Override + public net.citizensnpcs.api.npc.NPCSelector getDefaultNPCSelector() { + return selector; + } + + @Override + public NPCRegistry getNamedNPCRegistry(String name) { + return storedRegistries.get(name); + } + + @Override + public Iterable getNPCRegistries() { + return new Iterable() { + @Override + public Iterator iterator() { + return new Iterator() { + Iterator stored; + + @Override + public boolean hasNext() { + return stored == null ? true : stored.hasNext(); + } + + @Override + public NPCRegistry next() { + if (stored == null) { + stored = storedRegistries.values().iterator(); + return npcRegistry; + } + return stored.next(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + }; + } + + @Override + public NPCRegistry getNPCRegistry() { + return npcRegistry; + } + + public NPCSelector getNPCSelector() { + return selector; + } + + @Override + public ClassLoader getOwningClassLoader() { + return getClassLoader(); + } + + @Override + public File getScriptFolder() { + return new File(getDataFolder(), "scripts"); + } + + @Override + public SpeechFactory getSpeechFactory() { + return speechFactory; + } + + @Override + public TraitFactory getTraitFactory() { + return traitFactory; + } + + @Override + public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String cmdName, String[] args) { + String modifier = args.length > 0 ? args[0] : ""; + if (!commands.hasCommand(command, modifier) && !modifier.isEmpty()) { + return suggestClosestModifier(sender, command.getName(), modifier); + } + + NPC npc = selector == null ? null : selector.getSelected(sender); + // TODO: change the args supplied to a context style system for + // flexibility (ie. adding more context in the future without + // changing everything) + + Object[] methodArgs = { sender, npc }; + return commands.executeSafe(command, args, sender, methodArgs); + } + + @Override + public void onDisable() { + Bukkit.getPluginManager().callEvent(new CitizensDisableEvent()); + Editor.leaveAll(); + + if (compatible) { + saves.storeAll(npcRegistry); + saves.saveToDiskImmediate(); + despawnNPCs(); + npcRegistry = null; + } + + CitizensAPI.shutdown(); + } + + @Override + public void onEnable() { + setupTranslator(); + CitizensAPI.setImplementation(this); + config = new Settings(getDataFolder()); + // Disable if the server is not using the compatible Minecraft version + String mcVersion = Util.getMinecraftVersion(); + compatible = mcVersion.startsWith(COMPATIBLE_MC_VERSION); + if (Setting.CHECK_MINECRAFT_VERSION.asBoolean() && !compatible) { + Messaging.severeTr(Messages.CITIZENS_INCOMPATIBLE, getDescription().getVersion(), mcVersion); + getServer().getPluginManager().disablePlugin(this); + return; + } + registerScriptHelpers(); + + saves = createStorage(getDataFolder()); + if (saves == null) { + Messaging.severeTr(Messages.FAILED_LOAD_SAVES); + getServer().getPluginManager().disablePlugin(this); + return; + } + + npcRegistry = new CitizensNPCRegistry(saves); + traitFactory = new CitizensTraitFactory(); + selector = new NPCSelector(this); + speechFactory = new CitizensSpeechFactory(); + speechFactory.register(Chat.class, "chat"); + + getServer().getPluginManager().registerEvents(new EventListen(storedRegistries), this); + + if (Setting.NPC_COST.asDouble() > 0) + setupEconomy(); + + registerCommands(); + enableSubPlugins(); + + // Setup NPCs after all plugins have been enabled (allows for multiworld + // support and for NPCs to properly register external settings) + if (getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() { + @Override + public void run() { + saves.loadInto(npcRegistry); + Messaging.logTr(Messages.NUM_LOADED_NOTIFICATION, Iterables.size(npcRegistry), "?"); + startMetrics(); + scheduleSaveTask(Setting.SAVE_TASK_DELAY.asInt()); + Bukkit.getPluginManager().callEvent(new CitizensEnableEvent()); + } + }, 1) == -1) { + Messaging.severeTr(Messages.LOAD_TASK_NOT_SCHEDULED); + getServer().getPluginManager().disablePlugin(this); + } + } + + @Override + public void onImplementationChanged() { + Messaging.severeTr(Messages.CITIZENS_IMPLEMENTATION_DISABLED); + Bukkit.getPluginManager().disablePlugin(this); + } + + public void registerCommandClass(Class clazz) { + try { + commands.register(clazz); + } catch (Throwable ex) { + Messaging.logTr(Messages.CITIZENS_INVALID_COMMAND_CLASS); + ex.printStackTrace(); + } + } + + private void registerCommands() { + commands.setInjector(new Injector(this)); + // Register command classes + commands.register(AdminCommands.class); + commands.register(EditorCommands.class); + commands.register(NPCCommands.class); + commands.register(TemplateCommands.class); + commands.register(TraitCommands.class); + commands.register(WaypointCommands.class); + } + + private void registerScriptHelpers() { + ScriptCompiler compiler = CitizensAPI.getScriptCompiler(); + compiler.registerGlobalContextProvider(new EventRegistrar(this)); + compiler.registerGlobalContextProvider(new ObjectProvider("plugin", this)); + } + + public void reload() throws NPCLoadException { + Editor.leaveAll(); + config.reload(); + despawnNPCs(); + saves.loadInto(npcRegistry); + + getServer().getPluginManager().callEvent(new CitizensReloadEvent()); + } + + @Override + public void removeNamedNPCRegistry(String name) { + storedRegistries.remove(name); + } + + private void scheduleSaveTask(int delay) { + Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { + @Override + public void run() { + storeNPCs(); + saves.saveToDisk(); + } + }, delay, delay); + } + + private void setupEconomy() { + try { + RegisteredServiceProvider provider = Bukkit.getServicesManager().getRegistration(Economy.class); + if (provider != null && provider.getProvider() != null) { + Economy economy = provider.getProvider(); + Bukkit.getPluginManager().registerEvents(new PaymentListener(economy), this); + } + } catch (NoClassDefFoundError e) { + Messaging.logTr(Messages.ERROR_LOADING_ECONOMY); + } + } + + private void setupTranslator() { + Locale locale = Locale.getDefault(); + String setting = Setting.LOCALE.asString(); + if (!setting.isEmpty()) { + String[] parts = setting.split("[\\._]"); + switch (parts.length) { + case 1: + locale = new Locale(parts[0]); + break; + case 2: + locale = new Locale(parts[0], parts[1]); + break; + case 3: + locale = new Locale(parts[0], parts[1], parts[2]); + break; + default: + break; + } + } + Translator.setInstance(new File(getDataFolder(), "lang"), locale); + } + + private void startMetrics() { + try { + Metrics metrics = new Metrics(Citizens.this); + if (metrics.isOptOut()) + return; + metrics.addCustomData(new Metrics.Plotter("Total NPCs") { + @Override + public int getValue() { + if (npcRegistry == null) + return 0; + return Iterables.size(npcRegistry); + } + }); + metrics.addCustomData(new Metrics.Plotter("Total goals") { + @Override + public int getValue() { + if (npcRegistry == null) + return 0; + int goalCount = 0; + for (NPC npc : npcRegistry) { + goalCount += Iterables.size(npc.getDefaultGoalController()); + } + return goalCount; + } + }); + traitFactory.addPlotters(metrics.createGraph("traits")); + metrics.start(); + } catch (IOException e) { + Messaging.logTr(Messages.METRICS_ERROR_NOTIFICATION, e.getMessage()); + } + } + + public void storeNPCs() { + if (saves == null) + return; + for (NPC npc : npcRegistry) { + saves.store(npc); + } + } + + public void storeNPCs(CommandContext args) { + storeNPCs(); + boolean async = args.hasFlag('a'); + if (async) { + saves.saveToDisk(); + } else { + saves.saveToDiskImmediate(); + } + } + + private boolean suggestClosestModifier(CommandSender sender, String command, String modifier) { + String closest = commands.getClosestCommandModifier(command, modifier); + if (!closest.isEmpty()) { + sender.sendMessage(ChatColor.GRAY + Messaging.tr(Messages.UNKNOWN_COMMAND)); + sender.sendMessage(StringHelper.wrap(" /") + command + " " + StringHelper.wrap(closest)); + return true; + } + return false; + } + + private static final String COMPATIBLE_MC_VERSION = "1.8.4"; +} diff --git a/src/main/java/net/citizensnpcs/EventListen.java b/src/main/java/net/citizensnpcs/EventListen.java index efc03134d..cad901e18 100644 --- a/src/main/java/net/citizensnpcs/EventListen.java +++ b/src/main/java/net/citizensnpcs/EventListen.java @@ -30,13 +30,13 @@ import net.citizensnpcs.trait.Controllable; import net.citizensnpcs.trait.CurrentLocation; import net.citizensnpcs.util.Messages; import net.citizensnpcs.util.NMS; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index 742534805..16701ff3c 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -1,293 +1,293 @@ -package net.citizensnpcs.npc; - -import java.util.Arrays; -import java.util.Collection; -import java.util.UUID; - -import net.citizensnpcs.NPCNeedsRespawnEvent; -import net.citizensnpcs.Settings.Setting; -import net.citizensnpcs.api.CitizensAPI; -import net.citizensnpcs.api.ai.Navigator; -import net.citizensnpcs.api.event.DespawnReason; -import net.citizensnpcs.api.event.NPCDespawnEvent; -import net.citizensnpcs.api.event.NPCSpawnEvent; -import net.citizensnpcs.api.npc.AbstractNPC; -import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.api.npc.NPCRegistry; -import net.citizensnpcs.api.trait.Trait; -import net.citizensnpcs.api.trait.trait.MobType; -import net.citizensnpcs.api.trait.trait.Spawned; -import net.citizensnpcs.api.util.DataKey; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.npc.ai.CitizensNavigator; -import net.citizensnpcs.trait.CurrentLocation; -import net.citizensnpcs.util.Messages; -import net.citizensnpcs.util.NMS; -import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Packet; -import net.minecraft.server.v1_8_R2.PacketPlayOutEntityTeleport; - -import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -import org.bukkit.metadata.FixedMetadataValue; - -import com.google.common.base.Preconditions; -import com.google.common.base.Throwables; -import org.bukkit.scheduler.BukkitRunnable; - -public class CitizensNPC extends AbstractNPC { - private EntityController entityController; - private final CitizensNavigator navigator = new CitizensNavigator(this); - - public CitizensNPC(UUID uuid, int id, String name, EntityController entityController, NPCRegistry registry) { - super(uuid, id, name, registry); - Preconditions.checkNotNull(entityController); - this.entityController = entityController; - } - - @Override - public boolean despawn(DespawnReason reason) { - if (!isSpawned()) { - Messaging.debug("Tried to despawn", getId(), "while already despawned."); - if (reason == DespawnReason.REMOVAL) { - Bukkit.getPluginManager().callEvent(new NPCDespawnEvent(this, reason)); - } - return false; - } - - NPCDespawnEvent event = new NPCDespawnEvent(this, reason); - if (reason == DespawnReason.CHUNK_UNLOAD) { - event.setCancelled(Setting.KEEP_CHUNKS_LOADED.asBoolean()); - } - Bukkit.getPluginManager().callEvent(event); - if (event.isCancelled()) { - getEntity().getLocation().getChunk(); - Messaging.debug("Couldn't despawn", getId(), "due to despawn event cancellation. Force loaded chunk."); - return false; - } - boolean keepSelected = getTrait(Spawned.class).shouldSpawn(); - if (!keepSelected) { - data().remove("selectors"); - } - for (Trait trait : traits.values()) { - trait.onDespawn(); - } - navigator.onDespawn(); - entityController.remove(); - - return true; - } - - @Override - public void faceLocation(Location location) { - if (!isSpawned()) - return; - Util.faceLocation(getEntity(), location); - } - - @Override - public Entity getEntity() { - return entityController == null ? null : entityController.getBukkitEntity(); - } - - @Override - public Navigator getNavigator() { - return navigator; - } - - @Override - public Location getStoredLocation() { - return isSpawned() ? getEntity().getLocation() : getTrait(CurrentLocation.class).getLocation(); - } - - @Override - public boolean isFlyable() { - updateFlyableState(); - return super.isFlyable(); - } - - @Override - public void load(final DataKey root) { - super.load(root); - - // Spawn the NPC - CurrentLocation spawnLocation = getTrait(CurrentLocation.class); - if (getTrait(Spawned.class).shouldSpawn() && spawnLocation.getLocation() != null) { - spawn(spawnLocation.getLocation()); - } - - navigator.load(root.getRelative("navigator")); - } - - @Override - public void save(DataKey root) { - super.save(root); - if (!data().get(NPC.SHOULD_SAVE_METADATA, true)) - return; - navigator.save(root.getRelative("navigator")); - } - - @Override - public void setBukkitEntityType(EntityType type) { - EntityController controller = EntityControllers.createForType(type); - if (controller == null) - throw new IllegalArgumentException("Unsupported entity type " + type); - setEntityController(controller); - } - - public void setEntityController(EntityController newController) { - Preconditions.checkNotNull(newController); - boolean wasSpawned = isSpawned(); - Location prev = null; - if (wasSpawned) { - prev = getEntity().getLocation(); - despawn(DespawnReason.PENDING_RESPAWN); - } - entityController = newController; - if (wasSpawned) { - spawn(prev); - } - } - - @Override - public void setFlyable(boolean flyable) { - super.setFlyable(flyable); - updateFlyableState(); - } - - @Override - public boolean spawn(Location at) { - Preconditions.checkNotNull(at, "location cannot be null"); - if (isSpawned()) { - Messaging.debug("Tried to spawn", getId(), "while already spawned."); - return false; - } - at = at.clone(); - getTrait(CurrentLocation.class).setLocation(at); - entityController.spawn(at, this); - net.minecraft.server.v1_8_R2.Entity mcEntity = ((CraftEntity) getEntity()).getHandle(); - boolean couldSpawn = !Util.isLoaded(at) ? false : mcEntity.world.addEntity(mcEntity, SpawnReason.CUSTOM); - mcEntity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch()); - if (!couldSpawn) { - Messaging.debug("Retrying spawn of", getId(), "later due to chunk being unloaded.", - Util.isLoaded(at) ? "Util.isLoaded true" : "Util.isLoaded false"); - // we need to wait for a chunk load before trying to spawn - entityController.remove(); - Bukkit.getPluginManager().callEvent(new NPCNeedsRespawnEvent(this, at)); - return false; - } - - NMS.setHeadYaw(mcEntity, at.getYaw()); - NPCSpawnEvent spawnEvent = new NPCSpawnEvent(this, at); - Bukkit.getPluginManager().callEvent(spawnEvent); - if (spawnEvent.isCancelled()) { - entityController.remove(); - Messaging.debug("Couldn't spawn", getId(), "due to event cancellation."); - return false; - } - - getEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true)); - - // Set the spawned state - getTrait(CurrentLocation.class).setLocation(at); - getTrait(Spawned.class).setSpawned(true); - - navigator.onSpawn(); - // Modify NPC using traits after the entity has been created - Collection onSpawn = traits.values(); - // work around traits modifying the map during this iteration. - for (Trait trait : onSpawn.toArray(new Trait[onSpawn.size()])) { - try { - trait.onSpawn(); - } catch (Throwable ex) { - Messaging.severeTr(Messages.TRAIT_ONSPAWN_FAILED, trait.getName(), getId()); - ex.printStackTrace(); - } - } - if (getEntity() instanceof LivingEntity) { - LivingEntity entity = (LivingEntity) getEntity(); - entity.setRemoveWhenFarAway(false); - entity.setCustomName(getFullName()); - if (NMS.getStepHeight(entity) < 1) { - NMS.setStepHeight(NMS.getHandle(entity), 1); - } - if (getEntity() instanceof Player) { - final CraftPlayer player = (CraftPlayer) getEntity(); - NMS.replaceTrackerEntry(player); - new BukkitRunnable() { - @Override - public void run() { - NMS.sendPacketsNearby(player, player.getLocation(), Arrays.asList((Packet) new PacketPlayOutPlayerInfo( - PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, player.getHandle())), 200.0); - new BukkitRunnable() { - @Override - public void run() { - NMS.sendPacketsNearby(player, player.getLocation(), Arrays.asList((Packet) new PacketPlayOutPlayerInfo( - PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, player.getHandle())), 200.0); - } - }.runTaskLater(CitizensAPI.getPlugin(), 2); - } - }.runTaskLater(CitizensAPI.getPlugin(), 2); - } - } - return true; - } - - @Override - public void update() { - try { - super.update(); - if (!isSpawned()) - return; - if (data().get(NPC.SWIMMING_METADATA, true)) { - NMS.trySwim(getEntity()); - } - navigator.run(); - - if (!getNavigator().isNavigating() - && getEntity().getWorld().getFullTime() % Setting.PACKET_UPDATE_DELAY.asInt() == 0) { - if (getEntity() instanceof LivingEntity) { - ((LivingEntity) getEntity()).setCustomName(getFullName()); - } - Player player = getEntity() instanceof Player ? (Player) getEntity() : null; - NMS.sendPacketNearby(player, getStoredLocation(), - new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity()))); - } - - if (getEntity() instanceof LivingEntity) { - boolean nameplateVisible = data().get(NPC.NAMEPLATE_VISIBLE_METADATA, true); - ((LivingEntity) getEntity()).setCustomNameVisible(nameplateVisible); - Byte toByte = Byte.valueOf((byte) (nameplateVisible ? 1 : 0)); - try { - ((CraftLivingEntity) getEntity()).getHandle().getDataWatcher().watch(3, toByte); - } catch (NullPointerException e) { - ((CraftLivingEntity) getEntity()).getHandle().getDataWatcher().a(3, toByte); - } - } - } catch (Exception ex) { - Throwable error = Throwables.getRootCause(ex); - Messaging.logTr(Messages.EXCEPTION_UPDATING_NPC, getId(), error.getMessage()); - error.printStackTrace(); - } - } - - private void updateFlyableState() { - EntityType type = getTrait(MobType.class).getType(); - if (type == null) - return; - if (Util.isAlwaysFlyable(type)) { - data().setPersistent(NPC.FLYABLE_METADATA, true); - } - } - - private static final String NPC_METADATA_MARKER = "NPC"; -} +package net.citizensnpcs.npc; + +import java.util.Arrays; +import java.util.Collection; +import java.util.UUID; + +import net.citizensnpcs.NPCNeedsRespawnEvent; +import net.citizensnpcs.Settings.Setting; +import net.citizensnpcs.api.CitizensAPI; +import net.citizensnpcs.api.ai.Navigator; +import net.citizensnpcs.api.event.DespawnReason; +import net.citizensnpcs.api.event.NPCDespawnEvent; +import net.citizensnpcs.api.event.NPCSpawnEvent; +import net.citizensnpcs.api.npc.AbstractNPC; +import net.citizensnpcs.api.npc.NPC; +import net.citizensnpcs.api.npc.NPCRegistry; +import net.citizensnpcs.api.trait.Trait; +import net.citizensnpcs.api.trait.trait.MobType; +import net.citizensnpcs.api.trait.trait.Spawned; +import net.citizensnpcs.api.util.DataKey; +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.npc.ai.CitizensNavigator; +import net.citizensnpcs.trait.CurrentLocation; +import net.citizensnpcs.util.Messages; +import net.citizensnpcs.util.NMS; +import net.citizensnpcs.util.Util; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; + +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.metadata.FixedMetadataValue; + +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; +import org.bukkit.scheduler.BukkitRunnable; + +public class CitizensNPC extends AbstractNPC { + private EntityController entityController; + private final CitizensNavigator navigator = new CitizensNavigator(this); + + public CitizensNPC(UUID uuid, int id, String name, EntityController entityController, NPCRegistry registry) { + super(uuid, id, name, registry); + Preconditions.checkNotNull(entityController); + this.entityController = entityController; + } + + @Override + public boolean despawn(DespawnReason reason) { + if (!isSpawned()) { + Messaging.debug("Tried to despawn", getId(), "while already despawned."); + if (reason == DespawnReason.REMOVAL) { + Bukkit.getPluginManager().callEvent(new NPCDespawnEvent(this, reason)); + } + return false; + } + + NPCDespawnEvent event = new NPCDespawnEvent(this, reason); + if (reason == DespawnReason.CHUNK_UNLOAD) { + event.setCancelled(Setting.KEEP_CHUNKS_LOADED.asBoolean()); + } + Bukkit.getPluginManager().callEvent(event); + if (event.isCancelled()) { + getEntity().getLocation().getChunk(); + Messaging.debug("Couldn't despawn", getId(), "due to despawn event cancellation. Force loaded chunk."); + return false; + } + boolean keepSelected = getTrait(Spawned.class).shouldSpawn(); + if (!keepSelected) { + data().remove("selectors"); + } + for (Trait trait : traits.values()) { + trait.onDespawn(); + } + navigator.onDespawn(); + entityController.remove(); + + return true; + } + + @Override + public void faceLocation(Location location) { + if (!isSpawned()) + return; + Util.faceLocation(getEntity(), location); + } + + @Override + public Entity getEntity() { + return entityController == null ? null : entityController.getBukkitEntity(); + } + + @Override + public Navigator getNavigator() { + return navigator; + } + + @Override + public Location getStoredLocation() { + return isSpawned() ? getEntity().getLocation() : getTrait(CurrentLocation.class).getLocation(); + } + + @Override + public boolean isFlyable() { + updateFlyableState(); + return super.isFlyable(); + } + + @Override + public void load(final DataKey root) { + super.load(root); + + // Spawn the NPC + CurrentLocation spawnLocation = getTrait(CurrentLocation.class); + if (getTrait(Spawned.class).shouldSpawn() && spawnLocation.getLocation() != null) { + spawn(spawnLocation.getLocation()); + } + + navigator.load(root.getRelative("navigator")); + } + + @Override + public void save(DataKey root) { + super.save(root); + if (!data().get(NPC.SHOULD_SAVE_METADATA, true)) + return; + navigator.save(root.getRelative("navigator")); + } + + @Override + public void setBukkitEntityType(EntityType type) { + EntityController controller = EntityControllers.createForType(type); + if (controller == null) + throw new IllegalArgumentException("Unsupported entity type " + type); + setEntityController(controller); + } + + public void setEntityController(EntityController newController) { + Preconditions.checkNotNull(newController); + boolean wasSpawned = isSpawned(); + Location prev = null; + if (wasSpawned) { + prev = getEntity().getLocation(); + despawn(DespawnReason.PENDING_RESPAWN); + } + entityController = newController; + if (wasSpawned) { + spawn(prev); + } + } + + @Override + public void setFlyable(boolean flyable) { + super.setFlyable(flyable); + updateFlyableState(); + } + + @Override + public boolean spawn(Location at) { + Preconditions.checkNotNull(at, "location cannot be null"); + if (isSpawned()) { + Messaging.debug("Tried to spawn", getId(), "while already spawned."); + return false; + } + at = at.clone(); + getTrait(CurrentLocation.class).setLocation(at); + entityController.spawn(at, this); + net.minecraft.server.v1_8_R3.Entity mcEntity = ((CraftEntity) getEntity()).getHandle(); + boolean couldSpawn = !Util.isLoaded(at) ? false : mcEntity.world.addEntity(mcEntity, SpawnReason.CUSTOM); + mcEntity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch()); + if (!couldSpawn) { + Messaging.debug("Retrying spawn of", getId(), "later due to chunk being unloaded.", + Util.isLoaded(at) ? "Util.isLoaded true" : "Util.isLoaded false"); + // we need to wait for a chunk load before trying to spawn + entityController.remove(); + Bukkit.getPluginManager().callEvent(new NPCNeedsRespawnEvent(this, at)); + return false; + } + + NMS.setHeadYaw(mcEntity, at.getYaw()); + NPCSpawnEvent spawnEvent = new NPCSpawnEvent(this, at); + Bukkit.getPluginManager().callEvent(spawnEvent); + if (spawnEvent.isCancelled()) { + entityController.remove(); + Messaging.debug("Couldn't spawn", getId(), "due to event cancellation."); + return false; + } + + getEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true)); + + // Set the spawned state + getTrait(CurrentLocation.class).setLocation(at); + getTrait(Spawned.class).setSpawned(true); + + navigator.onSpawn(); + // Modify NPC using traits after the entity has been created + Collection onSpawn = traits.values(); + // work around traits modifying the map during this iteration. + for (Trait trait : onSpawn.toArray(new Trait[onSpawn.size()])) { + try { + trait.onSpawn(); + } catch (Throwable ex) { + Messaging.severeTr(Messages.TRAIT_ONSPAWN_FAILED, trait.getName(), getId()); + ex.printStackTrace(); + } + } + if (getEntity() instanceof LivingEntity) { + LivingEntity entity = (LivingEntity) getEntity(); + entity.setRemoveWhenFarAway(false); + entity.setCustomName(getFullName()); + if (NMS.getStepHeight(entity) < 1) { + NMS.setStepHeight(NMS.getHandle(entity), 1); + } + if (getEntity() instanceof Player) { + final CraftPlayer player = (CraftPlayer) getEntity(); + NMS.replaceTrackerEntry(player); + new BukkitRunnable() { + @Override + public void run() { + NMS.sendPacketsNearby(player, player.getLocation(), Arrays.asList((Packet) new PacketPlayOutPlayerInfo( + PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, player.getHandle())), 200.0); + new BukkitRunnable() { + @Override + public void run() { + NMS.sendPacketsNearby(player, player.getLocation(), Arrays.asList((Packet) new PacketPlayOutPlayerInfo( + PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, player.getHandle())), 200.0); + } + }.runTaskLater(CitizensAPI.getPlugin(), 2); + } + }.runTaskLater(CitizensAPI.getPlugin(), 2); + } + } + return true; + } + + @Override + public void update() { + try { + super.update(); + if (!isSpawned()) + return; + if (data().get(NPC.SWIMMING_METADATA, true)) { + NMS.trySwim(getEntity()); + } + navigator.run(); + + if (!getNavigator().isNavigating() + && getEntity().getWorld().getFullTime() % Setting.PACKET_UPDATE_DELAY.asInt() == 0) { + if (getEntity() instanceof LivingEntity) { + ((LivingEntity) getEntity()).setCustomName(getFullName()); + } + Player player = getEntity() instanceof Player ? (Player) getEntity() : null; + NMS.sendPacketNearby(player, getStoredLocation(), + new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity()))); + } + + if (getEntity() instanceof LivingEntity) { + boolean nameplateVisible = data().get(NPC.NAMEPLATE_VISIBLE_METADATA, true); + ((LivingEntity) getEntity()).setCustomNameVisible(nameplateVisible); + Byte toByte = Byte.valueOf((byte) (nameplateVisible ? 1 : 0)); + try { + ((CraftLivingEntity) getEntity()).getHandle().getDataWatcher().watch(3, toByte); + } catch (NullPointerException e) { + ((CraftLivingEntity) getEntity()).getHandle().getDataWatcher().a(3, toByte); + } + } + } catch (Exception ex) { + Throwable error = Throwables.getRootCause(ex); + Messaging.logTr(Messages.EXCEPTION_UPDATING_NPC, getId(), error.getMessage()); + error.printStackTrace(); + } + } + + private void updateFlyableState() { + EntityType type = getTrait(MobType.class).getType(); + if (type == null) + return; + if (Util.isAlwaysFlyable(type)) { + data().setPersistent(NPC.FLYABLE_METADATA, true); + } + } + + private static final String NPC_METADATA_MARKER = "NPC"; +} diff --git a/src/main/java/net/citizensnpcs/npc/MobEntityController.java b/src/main/java/net/citizensnpcs/npc/MobEntityController.java index 311a7de93..92e834b48 100644 --- a/src/main/java/net/citizensnpcs/npc/MobEntityController.java +++ b/src/main/java/net/citizensnpcs/npc/MobEntityController.java @@ -4,11 +4,11 @@ import java.lang.reflect.Constructor; import java.util.Map; import net.citizensnpcs.api.npc.NPC; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Location; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_8_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; import org.bukkit.entity.Entity; import com.google.common.collect.Maps; @@ -23,7 +23,7 @@ public abstract class MobEntityController extends AbstractEntityController { @Override protected Entity createEntity(Location at, NPC npc) { - net.minecraft.server.v1_8_R2.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(), + net.minecraft.server.v1_8_R3.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(), npc); entity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch()); @@ -36,9 +36,9 @@ public abstract class MobEntityController extends AbstractEntityController { return entity.getBukkitEntity(); } - private net.minecraft.server.v1_8_R2.Entity createEntityFromClass(Object... args) { + private net.minecraft.server.v1_8_R3.Entity createEntityFromClass(Object... args) { try { - return (net.minecraft.server.v1_8_R2.Entity) constructor.newInstance(args); + return (net.minecraft.server.v1_8_R3.Entity) constructor.newInstance(args); } catch (Exception ex) { ex.printStackTrace(); return null; diff --git a/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java b/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java index 2e10e0804..35b9c01bc 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java +++ b/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java @@ -69,7 +69,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy { } vector = plan.getCurrentVector(); } - net.minecraft.server.v1_8_R2.Entity handle = NMS.getHandle(npc.getEntity()); + net.minecraft.server.v1_8_R3.Entity handle = NMS.getHandle(npc.getEntity()); double dX = vector.getBlockX() - handle.locX; double dZ = vector.getBlockZ() - handle.locZ; double dY = vector.getY() - handle.locY; diff --git a/src/main/java/net/citizensnpcs/npc/ai/BlockBreaker.java b/src/main/java/net/citizensnpcs/npc/ai/BlockBreaker.java index 928f689b0..638b7ddcc 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/BlockBreaker.java +++ b/src/main/java/net/citizensnpcs/npc/ai/BlockBreaker.java @@ -5,20 +5,20 @@ import net.citizensnpcs.api.ai.tree.BehaviorStatus; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.util.PlayerAnimation; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.Blocks; -import net.minecraft.server.v1_8_R2.Enchantment; -import net.minecraft.server.v1_8_R2.EnchantmentManager; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.ItemStack; -import net.minecraft.server.v1_8_R2.Material; -import net.minecraft.server.v1_8_R2.MobEffectList; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.Blocks; +import net.minecraft.server.v1_8_R3.Enchantment; +import net.minecraft.server.v1_8_R3.EnchantmentManager; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.ItemStack; +import net.minecraft.server.v1_8_R3.Material; +import net.minecraft.server.v1_8_R3.MobEffectList; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -46,7 +46,7 @@ public class BlockBreaker extends BehaviorGoalAdapter { return Math.pow(entity.locX - x, 2) + Math.pow(entity.locY - y, 2) + Math.pow(entity.locZ - z, 2); } - private net.minecraft.server.v1_8_R2.ItemStack getCurrentItem() { + private net.minecraft.server.v1_8_R3.ItemStack getCurrentItem() { return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item()) : entity.getEquipment(0); } diff --git a/src/main/java/net/citizensnpcs/npc/ai/FlyingAStarNavigationStrategy.java b/src/main/java/net/citizensnpcs/npc/ai/FlyingAStarNavigationStrategy.java index 434aa4779..c95f54a99 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/FlyingAStarNavigationStrategy.java +++ b/src/main/java/net/citizensnpcs/npc/ai/FlyingAStarNavigationStrategy.java @@ -14,7 +14,7 @@ import net.citizensnpcs.api.astar.pathfinder.VectorNode; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.MathHelper; +import net.minecraft.server.v1_8_R3.MathHelper; import org.bukkit.Location; import org.bukkit.entity.EntityType; diff --git a/src/main/java/net/citizensnpcs/npc/ai/MCNavigationStrategy.java b/src/main/java/net/citizensnpcs/npc/ai/MCNavigationStrategy.java index ada41b56b..175e9bfa8 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/MCNavigationStrategy.java +++ b/src/main/java/net/citizensnpcs/npc/ai/MCNavigationStrategy.java @@ -5,11 +5,11 @@ import net.citizensnpcs.api.ai.TargetType; import net.citizensnpcs.api.ai.event.CancelReason; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.util.NMS; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.NavigationAbstract; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.NavigationAbstract; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; public class MCNavigationStrategy extends AbstractPathStrategy { private final NavigationAbstract navigation; diff --git a/src/main/java/net/citizensnpcs/npc/ai/MCTargetStrategy.java b/src/main/java/net/citizensnpcs/npc/ai/MCTargetStrategy.java index a3b0ccab8..02d97eed2 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/MCTargetStrategy.java +++ b/src/main/java/net/citizensnpcs/npc/ai/MCTargetStrategy.java @@ -8,13 +8,13 @@ import net.citizensnpcs.api.ai.event.CancelReason; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.PlayerAnimation; -import net.minecraft.server.v1_8_R2.Entity; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.NavigationAbstract; +import net.minecraft.server.v1_8_R3.Entity; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.NavigationAbstract; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.LivingEntity; public class MCTargetStrategy implements PathStrategy, EntityTarget { diff --git a/src/main/java/net/citizensnpcs/npc/entity/BatController.java b/src/main/java/net/citizensnpcs/npc/entity/BatController.java index ca896f0d3..45a8d7acc 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/BatController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/BatController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityBat; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityBat; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftBat; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftBat; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Bat; import org.bukkit.util.Vector; @@ -85,7 +85,7 @@ public class BatController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java b/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java index 0b371b606..cc207d1ca 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityBlaze; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityBlaze; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftBlaze; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftBlaze; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Blaze; import org.bukkit.util.Vector; @@ -81,7 +81,7 @@ public class BlazeController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java b/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java index b3d4a35d8..d7b3d2cb3 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityCaveSpider; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityCaveSpider; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftCaveSpider; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCaveSpider; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.CaveSpider; import org.bukkit.util.Vector; @@ -92,7 +92,7 @@ public class CaveSpiderController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java b/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java index 206d85b37..7f6024057 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityChicken; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityChicken; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftChicken; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftChicken; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Chicken; import org.bukkit.util.Vector; @@ -101,7 +101,7 @@ public class ChickenController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/CowController.java b/src/main/java/net/citizensnpcs/npc/entity/CowController.java index 775be2e1f..654d6c9e8 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CowController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityCow; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityCow; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftCow; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCow; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Cow; import org.bukkit.util.Vector; @@ -102,7 +102,7 @@ public class CowController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java b/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java index 3c529f234..4429932d1 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java @@ -7,17 +7,17 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityCreeper; -import net.minecraft.server.v1_8_R2.EntityLightning; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityCreeper; +import net.minecraft.server.v1_8_R3.EntityLightning; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftCreeper; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreeper; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Creeper; import org.bukkit.util.Vector; @@ -92,7 +92,7 @@ public class CreeperController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java b/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java index 55e310972..d84766449 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityEnderDragon; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityEnderDragon; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderDragon; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderDragon; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.EnderDragon; import org.bukkit.util.Vector; @@ -81,7 +81,7 @@ public class EnderDragonController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java b/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java index 4f64e2c8c..cfc453abf 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityEnderman; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityEnderman; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderman; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderman; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Enderman; import org.bukkit.util.Vector; @@ -90,7 +90,7 @@ public class EndermanController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/EndermiteController.java b/src/main/java/net/citizensnpcs/npc/entity/EndermiteController.java index 931275466..d13415805 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EndermiteController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EndermiteController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityEndermite; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityEndermite; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEndermite; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEndermite; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Endermite; import org.bukkit.util.Vector; @@ -90,7 +90,7 @@ public class EndermiteController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index 3e8fb8f75..501315cbe 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -20,29 +20,29 @@ import net.citizensnpcs.util.nms.PlayerControllerJump; import net.citizensnpcs.util.nms.PlayerControllerLook; import net.citizensnpcs.util.nms.PlayerControllerMove; import net.citizensnpcs.util.nms.PlayerNavigation; -import net.minecraft.server.v1_8_R2.AttributeInstance; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.DamageSource; -import net.minecraft.server.v1_8_R2.Entity; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.EnumProtocolDirection; -import net.minecraft.server.v1_8_R2.GenericAttributes; -import net.minecraft.server.v1_8_R2.MathHelper; -import net.minecraft.server.v1_8_R2.MinecraftServer; -import net.minecraft.server.v1_8_R2.NavigationAbstract; -import net.minecraft.server.v1_8_R2.NetworkManager; -import net.minecraft.server.v1_8_R2.Packet; -import net.minecraft.server.v1_8_R2.PacketPlayOutEntityEquipment; -import net.minecraft.server.v1_8_R2.PacketPlayOutEntityHeadRotation; -import net.minecraft.server.v1_8_R2.PlayerInteractManager; -import net.minecraft.server.v1_8_R2.WorldServer; -import net.minecraft.server.v1_8_R2.WorldSettings.EnumGamemode; +import net.minecraft.server.v1_8_R3.AttributeInstance; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.DamageSource; +import net.minecraft.server.v1_8_R3.Entity; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.EnumProtocolDirection; +import net.minecraft.server.v1_8_R3.GenericAttributes; +import net.minecraft.server.v1_8_R3.MathHelper; +import net.minecraft.server.v1_8_R3.MinecraftServer; +import net.minecraft.server.v1_8_R3.NavigationAbstract; +import net.minecraft.server.v1_8_R3.NetworkManager; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityHeadRotation; +import net.minecraft.server.v1_8_R3.PlayerInteractManager; +import net.minecraft.server.v1_8_R3.WorldServer; +import net.minecraft.server.v1_8_R3.WorldSettings.EnumGamemode; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.util.Vector; @@ -78,7 +78,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); @@ -197,9 +197,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { // swallow } - AttributeInstance range = getAttributeInstance(GenericAttributes.b); + AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE); if (range == null) { - range = getAttributeMap().b(GenericAttributes.b); + range = getAttributeMap().b(GenericAttributes.FOLLOW_RANGE); } range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble()); diff --git a/src/main/java/net/citizensnpcs/npc/entity/GhastController.java b/src/main/java/net/citizensnpcs/npc/entity/GhastController.java index 84542a938..3ca903ef9 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GhastController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GhastController.java @@ -1,9 +1,9 @@ package net.citizensnpcs.npc.entity; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftGhast; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGhast; import org.bukkit.entity.Ghast; import org.bukkit.util.Vector; @@ -14,9 +14,9 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityGhast; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityGhast; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; public class GhastController extends MobEntityController { public GhastController() { @@ -72,7 +72,7 @@ public class GhastController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/GiantController.java b/src/main/java/net/citizensnpcs/npc/entity/GiantController.java index cf168d7db..ec6b8ce3c 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GiantController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GiantController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityGiantZombie; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityGiantZombie; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftGiant; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGiant; import org.bukkit.entity.Giant; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class GiantController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/GuardianController.java b/src/main/java/net/citizensnpcs/npc/entity/GuardianController.java index b22f4af80..44365dedf 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GuardianController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GuardianController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityGuardian; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityGuardian; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftGuardian; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftGuardian; import org.bukkit.entity.Guardian; import org.bukkit.util.Vector; @@ -47,10 +47,10 @@ public class GuardianController extends MobEntityController { } @Override - public void a(boolean flag) { + public void setElder(boolean flag) { float oldw = width; float oldl = length; - super.a(flag); + super.setElder(flag); if (oldw != width || oldl != length) { this.setPosition(locX - 0.01, locY, locZ - 0.01); this.setPosition(locX + 0.01, locY, locZ + 0.01); @@ -88,7 +88,7 @@ public class GuardianController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/HorseController.java b/src/main/java/net/citizensnpcs/npc/entity/HorseController.java index 68d0be1b0..56f347c5a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/HorseController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/HorseController.java @@ -8,17 +8,17 @@ import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.trait.HorseModifiers; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityHorse; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityHorse; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftHorse; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHorse; import org.bukkit.entity.Horse; import org.bukkit.util.Vector; @@ -96,7 +96,7 @@ public class HorseController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/HumanController.java b/src/main/java/net/citizensnpcs/npc/entity/HumanController.java index d943e9d31..d9cf06905 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/HumanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/HumanController.java @@ -17,14 +17,14 @@ import net.citizensnpcs.api.util.Colorizer; import net.citizensnpcs.api.util.Messaging; import net.citizensnpcs.npc.AbstractEntityController; import net.citizensnpcs.util.NMS; -import net.minecraft.server.v1_8_R2.PlayerInteractManager; -import net.minecraft.server.v1_8_R2.WorldServer; +import net.minecraft.server.v1_8_R3.PlayerInteractManager; +import net.minecraft.server.v1_8_R3.WorldServer; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -109,7 +109,7 @@ public class HumanController extends AbstractEntityController { skinUUID = npc.data().get(CACHED_SKIN_UUID_METADATA); } if (npc.data().has(PLAYER_SKIN_TEXTURE_PROPERTIES)&&npc.data().get(PLAYER_SKIN_TEXTURE_PROPERTIES).equals("cache")) { - SKIN_THREAD.addRunnable(new SkinFetcher(new UUIDFetcher(skinUUID, npc), nmsWorld.getMinecraftServer().aC(), + SKIN_THREAD.addRunnable(new SkinFetcher(new UUIDFetcher(skinUUID, npc), nmsWorld.getMinecraftServer().aD(), npc)); return; } @@ -120,7 +120,7 @@ public class HumanController extends AbstractEntityController { if (cached != null) { profile.getProperties().put("textures", cached); } else { - SKIN_THREAD.addRunnable(new SkinFetcher(new UUIDFetcher(skinUUID, npc), nmsWorld.getMinecraftServer().aC(), + SKIN_THREAD.addRunnable(new SkinFetcher(new UUIDFetcher(skinUUID, npc), nmsWorld.getMinecraftServer().aD(), npc)); } } diff --git a/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java b/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java index c10032164..e64602329 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityIronGolem; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityIronGolem; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftIronGolem; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftIronGolem; import org.bukkit.entity.IronGolem; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class IronGolemController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java b/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java index 252ab3b6b..db19edc5c 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityMagmaCube; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityMagmaCube; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMagmaCube; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMagmaCube; import org.bukkit.entity.MagmaCube; import org.bukkit.util.Vector; @@ -77,7 +77,7 @@ public class MagmaCubeController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java b/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java index 40342538f..49e9e2bbb 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityMushroomCow; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityMushroomCow; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMushroomCow; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMushroomCow; import org.bukkit.entity.MushroomCow; import org.bukkit.util.Vector; @@ -88,7 +88,7 @@ public class MushroomCowController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java b/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java index 5dc04cb7f..5f89a1b35 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityOcelot; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityOcelot; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftOcelot; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftOcelot; import org.bukkit.entity.Ocelot; import org.bukkit.util.Vector; @@ -87,7 +87,7 @@ public class OcelotController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/PigController.java b/src/main/java/net/citizensnpcs/npc/entity/PigController.java index e6795c079..a1483ad38 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/PigController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/PigController.java @@ -7,17 +7,17 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityLightning; -import net.minecraft.server.v1_8_R2.EntityPig; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityLightning; +import net.minecraft.server.v1_8_R3.EntityPig; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPig; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPig; import org.bukkit.entity.Pig; import org.bukkit.util.Vector; @@ -88,7 +88,7 @@ public class PigController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java b/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java index db699e478..b7d3de934 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityPigZombie; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityPigZombie; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPigZombie; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPigZombie; import org.bukkit.entity.PigZombie; import org.bukkit.util.Vector; @@ -77,7 +77,7 @@ public class PigZombieController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/RabbitController.java b/src/main/java/net/citizensnpcs/npc/entity/RabbitController.java index c995d5cfc..745e7a75a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/RabbitController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/RabbitController.java @@ -1,9 +1,9 @@ package net.citizensnpcs.npc.entity; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftRabbit; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftRabbit; import org.bukkit.entity.Rabbit; import org.bukkit.util.Vector; @@ -14,11 +14,11 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityRabbit; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityRabbit; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; public class RabbitController extends MobEntityController { public RabbitController() { @@ -88,7 +88,7 @@ public class RabbitController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SheepController.java b/src/main/java/net/citizensnpcs/npc/entity/SheepController.java index 457f73712..717b768c2 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SheepController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SheepController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntitySheep; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntitySheep; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSheep; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSheep; import org.bukkit.entity.Sheep; import org.bukkit.util.Vector; @@ -87,7 +87,7 @@ public class SheepController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java b/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java index 930b38b04..62634b8b0 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntitySilverfish; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntitySilverfish; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSilverfish; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSilverfish; import org.bukkit.entity.Silverfish; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class SilverfishController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java b/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java index a731db2c8..2acf31ccf 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntitySkeleton; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntitySkeleton; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSkeleton; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton; import org.bukkit.entity.Skeleton; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class SkeletonController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java b/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java index af71205ce..3b89d9299 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java @@ -7,18 +7,18 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.ControllerMove; -import net.minecraft.server.v1_8_R2.EntityHuman; -import net.minecraft.server.v1_8_R2.EntitySlime; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.ControllerMove; +import net.minecraft.server.v1_8_R3.EntityHuman; +import net.minecraft.server.v1_8_R3.EntitySlime; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSlime; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSlime; import org.bukkit.entity.Slime; import org.bukkit.util.Vector; @@ -88,7 +88,7 @@ public class SlimeController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java b/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java index 0a895df73..5bb42c3be 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntitySnowman; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntitySnowman; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSnowman; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSnowman; import org.bukkit.entity.Snowman; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class SnowmanController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java b/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java index cc653eb17..107b63121 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntitySpider; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntitySpider; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSpider; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSpider; import org.bukkit.entity.Spider; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class SpiderController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/SquidController.java b/src/main/java/net/citizensnpcs/npc/entity/SquidController.java index 575128bcd..b37aeb85b 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SquidController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SquidController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntitySquid; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntitySquid; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSquid; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSquid; import org.bukkit.entity.Squid; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class SquidController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java b/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java index 43a2559fd..fd627cf86 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java @@ -7,17 +7,17 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityHuman; -import net.minecraft.server.v1_8_R2.EntityVillager; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityHuman; +import net.minecraft.server.v1_8_R3.EntityVillager; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftVillager; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftVillager; import org.bukkit.entity.Villager; import org.bukkit.util.Vector; @@ -95,7 +95,7 @@ public class VillagerController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/WitchController.java b/src/main/java/net/citizensnpcs/npc/entity/WitchController.java index 7639093f2..d37b680b9 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WitchController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WitchController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityWitch; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityWitch; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWitch; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWitch; import org.bukkit.entity.Witch; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class WitchController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/WitherController.java b/src/main/java/net/citizensnpcs/npc/entity/WitherController.java index 70ba4ac1e..444a541f5 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WitherController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WitherController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityWither; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityWither; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWither; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWither; import org.bukkit.entity.Wither; import org.bukkit.util.Vector; @@ -67,7 +67,7 @@ public class WitherController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/WolfController.java b/src/main/java/net/citizensnpcs/npc/entity/WolfController.java index 8869f09ab..8303d8e48 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WolfController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WolfController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityWolf; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityWolf; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWolf; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf; import org.bukkit.entity.Wolf; import org.bukkit.util.Vector; @@ -87,7 +87,7 @@ public class WolfController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java b/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java index bb757816c..151c489d3 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java @@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityZombie; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityZombie; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftZombie; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftZombie; import org.bukkit.entity.Zombie; import org.bukkit.util.Vector; @@ -76,7 +76,7 @@ public class ZombieController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArmorStandController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArmorStandController.java index ccee86eb3..8a712d1e2 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArmorStandController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArmorStandController.java @@ -6,16 +6,16 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityArmorStand; -import net.minecraft.server.v1_8_R2.EntityHuman; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.Vec3D; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityArmorStand; +import net.minecraft.server.v1_8_R3.EntityHuman; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.Vec3D; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftArmorStand; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftArmorStand; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.ArmorStand; import org.bukkit.util.Vector; @@ -61,7 +61,7 @@ public class ArmorStandController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArrowController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArrowController.java index 5b18dc53c..92dc5ed63 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArrowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ArrowController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityArrow; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityArrow; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftArrow; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Arrow; import org.bukkit.util.Vector; @@ -59,7 +59,7 @@ public class ArrowController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/BoatController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/BoatController.java index e24bff347..1ff80051e 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/BoatController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/BoatController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityBoat; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityBoat; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftBoat; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftBoat; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Boat; import org.bukkit.util.Vector; @@ -59,7 +59,7 @@ public class BoatController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EggController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EggController.java index ba8071939..3d7d26813 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EggController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EggController.java @@ -6,17 +6,17 @@ import net.citizensnpcs.npc.AbstractEntityController; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityEgg; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; -import net.minecraft.server.v1_8_R2.WorldServer; +import net.minecraft.server.v1_8_R3.EntityEgg; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; +import net.minecraft.server.v1_8_R3.WorldServer; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEgg; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEgg; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.Egg; import org.bukkit.entity.Entity; import org.bukkit.util.Vector; @@ -75,7 +75,7 @@ public class EggController extends AbstractEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderCrystalController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderCrystalController.java index 6bdf6cdbf..85fecd6c9 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderCrystalController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderCrystalController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityEnderCrystal; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityEnderCrystal; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderCrystal; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderCrystal; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.EnderCrystal; import org.bukkit.util.Vector; @@ -59,7 +59,7 @@ public class EnderCrystalController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderPearlController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderPearlController.java index 346511f01..d735a8a12 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderPearlController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderPearlController.java @@ -6,15 +6,15 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityEnderPearl; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityEnderPearl; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderPearl; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderPearl; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.EnderPearl; import org.bukkit.util.Vector; @@ -59,7 +59,7 @@ public class EnderPearlController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderSignalController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderSignalController.java index 6d8dd4ce5..b60f9edab 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderSignalController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/EnderSignalController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityEnderSignal; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityEnderSignal; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderSignal; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEnderSignal; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.EnderSignal; import org.bukkit.util.Vector; @@ -59,7 +59,7 @@ public class EnderSignalController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ExperienceOrbController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ExperienceOrbController.java index 48cbfb40e..6af39bc42 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ExperienceOrbController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ExperienceOrbController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityExperienceOrb; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityExperienceOrb; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftExperienceOrb; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftExperienceOrb; import org.bukkit.entity.ExperienceOrb; import org.bukkit.util.Vector; @@ -40,7 +40,7 @@ public class ExperienceOrbController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/FallingBlockController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/FallingBlockController.java index d65bf69b8..b65a80fd4 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/FallingBlockController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/FallingBlockController.java @@ -6,22 +6,22 @@ import net.citizensnpcs.npc.AbstractEntityController; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.Blocks; -import net.minecraft.server.v1_8_R2.EntityFallingBlock; -import net.minecraft.server.v1_8_R2.IBlockData; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; -import net.minecraft.server.v1_8_R2.WorldServer; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.Blocks; +import net.minecraft.server.v1_8_R3.EntityFallingBlock; +import net.minecraft.server.v1_8_R3.IBlockData; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; +import net.minecraft.server.v1_8_R3.WorldServer; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftFallingSand; -import org.bukkit.craftbukkit.v1_8_R2.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftFallingSand; +import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers; import org.bukkit.entity.Entity; import org.bukkit.entity.FallingBlock; import org.bukkit.util.Vector; @@ -68,7 +68,7 @@ public class FallingBlockController extends AbstractEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/FireworkController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/FireworkController.java index e8a6cb3e2..97848c76a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/FireworkController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/FireworkController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityFireworks; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityFireworks; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftFirework; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftFirework; import org.bukkit.entity.Firework; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class FireworkController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/FishingHookController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/FishingHookController.java index 4dc8b6cd4..480608617 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/FishingHookController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/FishingHookController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityFishingHook; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityFishingHook; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftFish; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftFish; import org.bukkit.entity.Fish; import org.bukkit.util.Vector; @@ -40,7 +40,7 @@ public class FishingHookController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemController.java index 5d5c3d83e..c03788e08 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemController.java @@ -6,21 +6,21 @@ import net.citizensnpcs.npc.AbstractEntityController; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityHuman; -import net.minecraft.server.v1_8_R2.EntityItem; -import net.minecraft.server.v1_8_R2.ItemStack; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; -import net.minecraft.server.v1_8_R2.WorldServer; +import net.minecraft.server.v1_8_R3.EntityHuman; +import net.minecraft.server.v1_8_R3.EntityItem; +import net.minecraft.server.v1_8_R3.ItemStack; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; +import net.minecraft.server.v1_8_R3.WorldServer; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftItem; -import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftItem; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.util.Vector; @@ -62,7 +62,7 @@ public class ItemController extends AbstractEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemFrameController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemFrameController.java index a41ec19f5..4849110a6 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemFrameController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ItemFrameController.java @@ -6,15 +6,15 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityItemFrame; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityItemFrame; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftItemFrame; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftItemFrame; import org.bukkit.entity.ItemFrame; import org.bukkit.util.Vector; @@ -41,7 +41,7 @@ public class ItemFrameController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/LargeFireballController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/LargeFireballController.java index 8b0e79b6f..956a164f1 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/LargeFireballController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/LargeFireballController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityLargeFireball; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityLargeFireball; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLargeFireball; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLargeFireball; import org.bukkit.entity.LargeFireball; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class LargeFireballController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/LeashController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/LeashController.java index 64b3f3325..588cd9c18 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/LeashController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/LeashController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityLeash; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityLeash; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLeash; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLeash; import org.bukkit.entity.LeashHitch; import org.bukkit.util.Vector; @@ -40,7 +40,7 @@ public class LeashController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartChestController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartChestController.java index ca8573838..f2a8b9cfa 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartChestController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartChestController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartChest; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartChest; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartChest; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMinecartChest; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -41,7 +41,7 @@ public class MinecartChestController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartCommandController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartCommandController.java index f592a1802..c1dffe50a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartCommandController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartCommandController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartCommandBlock; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartCommandBlock; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartCommand; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMinecartCommand; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -46,7 +46,7 @@ public class MinecartCommandController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartFurnaceController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartFurnaceController.java index 6e8cce5e3..f90aa7305 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartFurnaceController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartFurnaceController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartFurnace; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartFurnace; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartFurnace; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMinecartFurnace; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -46,7 +46,7 @@ public class MinecartFurnaceController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartHopperController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartHopperController.java index 3ba453063..975656355 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartHopperController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartHopperController.java @@ -7,9 +7,9 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartHopper; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartHopper; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -42,7 +42,7 @@ public class MinecartHopperController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartRideableController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartRideableController.java index 24a21cbe3..63ad4be31 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartRideableController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartRideableController.java @@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartRideable; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartRideable; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartRideable; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftMinecartRideable; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -46,7 +46,7 @@ public class MinecartRideableController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartSpawnerController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartSpawnerController.java index 16300955f..22988f2f6 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartSpawnerController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartSpawnerController.java @@ -7,9 +7,9 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartMobSpawner; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartMobSpawner; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -42,7 +42,7 @@ public class MinecartSpawnerController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartTNTController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartTNTController.java index af862dbf9..92324ce8e 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartTNTController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/MinecartTNTController.java @@ -7,9 +7,9 @@ import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityMinecartTNT; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityMinecartTNT; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.entity.Minecart; import org.bukkit.util.Vector; @@ -42,7 +42,7 @@ public class MinecartTNTController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/PaintingController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/PaintingController.java index da13124e4..65b657c3e 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/PaintingController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/PaintingController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityPainting; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityPainting; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPainting; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPainting; import org.bukkit.entity.Painting; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class PaintingController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/SmallFireballController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/SmallFireballController.java index 950576f04..3458e2d7d 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/SmallFireballController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/SmallFireballController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntitySmallFireball; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntitySmallFireball; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSmallFireball; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSmallFireball; import org.bukkit.entity.SmallFireball; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class SmallFireballController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/SnowballController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/SnowballController.java index 84336dd0e..1fa107657 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/SnowballController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/SnowballController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntitySnowball; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntitySnowball; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSnowball; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSnowball; import org.bukkit.entity.Snowball; import org.bukkit.util.Vector; @@ -59,7 +59,7 @@ public class SnowballController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/TNTPrimedController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/TNTPrimedController.java index 576734194..7093567cf 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/TNTPrimedController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/TNTPrimedController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityTNTPrimed; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityTNTPrimed; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftTNTPrimed; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftTNTPrimed; import org.bukkit.entity.TNTPrimed; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class TNTPrimedController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownExpBottleController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownExpBottleController.java index 6c80a312a..83c2a7737 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownExpBottleController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownExpBottleController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityThrownExpBottle; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityThrownExpBottle; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftThrownExpBottle; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftThrownExpBottle; import org.bukkit.entity.ThrownExpBottle; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class ThrownExpBottleController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownPotionController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownPotionController.java index 0ed34120e..f30dcc3ba 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownPotionController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/ThrownPotionController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityPotion; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityPotion; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftThrownPotion; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftThrownPotion; import org.bukkit.entity.ThrownPotion; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class ThrownPotionController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/entity/nonliving/WitherSkullController.java b/src/main/java/net/citizensnpcs/npc/entity/nonliving/WitherSkullController.java index fe2c212dc..433b32362 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/nonliving/WitherSkullController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/nonliving/WitherSkullController.java @@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.MobEntityController; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityWitherSkull; -import net.minecraft.server.v1_8_R2.NBTTagCompound; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.EntityWitherSkull; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.World; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWitherSkull; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWitherSkull; import org.bukkit.entity.WitherSkull; import org.bukkit.util.Vector; @@ -45,7 +45,7 @@ public class WitherSkullController extends MobEntityController { } @Override - public void collide(net.minecraft.server.v1_8_R2.Entity entity) { + public void collide(net.minecraft.server.v1_8_R3.Entity entity) { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); diff --git a/src/main/java/net/citizensnpcs/npc/network/EmptyNetHandler.java b/src/main/java/net/citizensnpcs/npc/network/EmptyNetHandler.java index 96fb30eaa..8cbab4803 100644 --- a/src/main/java/net/citizensnpcs/npc/network/EmptyNetHandler.java +++ b/src/main/java/net/citizensnpcs/npc/network/EmptyNetHandler.java @@ -1,10 +1,10 @@ package net.citizensnpcs.npc.network; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.MinecraftServer; -import net.minecraft.server.v1_8_R2.NetworkManager; -import net.minecraft.server.v1_8_R2.Packet; -import net.minecraft.server.v1_8_R2.PlayerConnection; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.MinecraftServer; +import net.minecraft.server.v1_8_R3.NetworkManager; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PlayerConnection; public class EmptyNetHandler extends PlayerConnection { public EmptyNetHandler(MinecraftServer minecraftServer, NetworkManager networkManager, EntityPlayer entityPlayer) { diff --git a/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java b/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java index 04a452c98..0a9362cb2 100644 --- a/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java +++ b/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java @@ -3,8 +3,8 @@ package net.citizensnpcs.npc.network; import java.io.IOException; import net.citizensnpcs.util.NMS; -import net.minecraft.server.v1_8_R2.EnumProtocolDirection; -import net.minecraft.server.v1_8_R2.NetworkManager; +import net.minecraft.server.v1_8_R3.EnumProtocolDirection; +import net.minecraft.server.v1_8_R3.NetworkManager; public class EmptyNetworkManager extends NetworkManager { public EmptyNetworkManager(EnumProtocolDirection flag) throws IOException { diff --git a/src/main/java/net/citizensnpcs/trait/Controllable.java b/src/main/java/net/citizensnpcs/trait/Controllable.java index c2d94063d..d9a429e4f 100644 --- a/src/main/java/net/citizensnpcs/trait/Controllable.java +++ b/src/main/java/net/citizensnpcs/trait/Controllable.java @@ -14,11 +14,11 @@ import net.citizensnpcs.api.trait.trait.Owner; import net.citizensnpcs.api.util.DataKey; import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util; -import net.minecraft.server.v1_8_R2.EntityEnderDragon; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.EntityPlayer; +import net.minecraft.server.v1_8_R3.EntityEnderDragon; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.EntityPlayer; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -79,7 +79,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab handle.mount(getHandle()); } - private net.minecraft.server.v1_8_R2.Entity getHandle() { + private net.minecraft.server.v1_8_R3.Entity getHandle() { return NMS.getHandle(npc.getEntity()); } @@ -186,7 +186,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab return enabled; } - private void setMountedYaw(net.minecraft.server.v1_8_R2.Entity handle) { + private void setMountedYaw(net.minecraft.server.v1_8_R3.Entity handle) { if (handle instanceof EntityEnderDragon || !Setting.USE_BOAT_CONTROLS.asBoolean()) return; // EnderDragon handles this separately double tX = handle.locX + handle.motX; @@ -212,8 +212,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab return enabled; } - private double updateHorizontalSpeed(net.minecraft.server.v1_8_R2.Entity handle, - net.minecraft.server.v1_8_R2.Entity passenger, double speed, float speedMod) { + private double updateHorizontalSpeed(net.minecraft.server.v1_8_R3.Entity handle, + net.minecraft.server.v1_8_R3.Entity passenger, double speed, float speedMod) { double oldSpeed = Math.sqrt(handle.motX * handle.motX + handle.motZ * handle.motZ); double horizontal = ((EntityLiving) passenger).ba; if (horizontal > 0.0D) { @@ -259,8 +259,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab @Override public void run(Player rider) { - net.minecraft.server.v1_8_R2.Entity handle = getHandle(); - net.minecraft.server.v1_8_R2.Entity passenger = ((CraftPlayer) rider).getHandle(); + net.minecraft.server.v1_8_R3.Entity handle = getHandle(); + net.minecraft.server.v1_8_R3.Entity passenger = ((CraftPlayer) rider).getHandle(); boolean onGround = handle.onGround; float speedMod = npc.getNavigator().getDefaultParameters() .modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED)); @@ -311,7 +311,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab } Vector dir = rider.getEyeLocation().getDirection(); dir.multiply(npc.getNavigator().getDefaultParameters().speedModifier()); - net.minecraft.server.v1_8_R2.Entity handle = getHandle(); + net.minecraft.server.v1_8_R3.Entity handle = getHandle(); handle.motX = dir.getX(); handle.motY = dir.getY(); handle.motZ = dir.getZ(); @@ -354,8 +354,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab getHandle().motY = 0.001; return; } - net.minecraft.server.v1_8_R2.Entity handle = getHandle(); - net.minecraft.server.v1_8_R2.Entity passenger = ((CraftPlayer) rider).getHandle(); + net.minecraft.server.v1_8_R3.Entity handle = getHandle(); + net.minecraft.server.v1_8_R3.Entity passenger = ((CraftPlayer) rider).getHandle(); speed = updateHorizontalSpeed(handle, passenger, speed, 1F); boolean shouldJump = NMS.shouldJump(passenger); diff --git a/src/main/java/net/citizensnpcs/trait/RabbitType.java b/src/main/java/net/citizensnpcs/trait/RabbitType.java index a3fbe96b7..59de9fee6 100644 --- a/src/main/java/net/citizensnpcs/trait/RabbitType.java +++ b/src/main/java/net/citizensnpcs/trait/RabbitType.java @@ -3,7 +3,7 @@ package net.citizensnpcs.trait; import net.citizensnpcs.api.persistence.Persist; import net.citizensnpcs.api.trait.Trait; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftRabbit; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftRabbit; import org.bukkit.entity.Rabbit; public class RabbitType extends Trait { diff --git a/src/main/java/net/citizensnpcs/trait/waypoint/EntityEnderSignalMarker.java b/src/main/java/net/citizensnpcs/trait/waypoint/EntityEnderSignalMarker.java index 0802c572a..048b234ed 100644 --- a/src/main/java/net/citizensnpcs/trait/waypoint/EntityEnderSignalMarker.java +++ b/src/main/java/net/citizensnpcs/trait/waypoint/EntityEnderSignalMarker.java @@ -1,8 +1,8 @@ package net.citizensnpcs.trait.waypoint; -import net.minecraft.server.v1_8_R2.DamageSource; -import net.minecraft.server.v1_8_R2.EntityEnderSignal; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.DamageSource; +import net.minecraft.server.v1_8_R3.EntityEnderSignal; +import net.minecraft.server.v1_8_R3.World; public class EntityEnderSignalMarker extends EntityEnderSignal { public EntityEnderSignalMarker(World world) { diff --git a/src/main/java/net/citizensnpcs/util/NMS.java b/src/main/java/net/citizensnpcs/util/NMS.java index 47f95f4fa..dd4784d8d 100644 --- a/src/main/java/net/citizensnpcs/util/NMS.java +++ b/src/main/java/net/citizensnpcs/util/NMS.java @@ -18,43 +18,43 @@ import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.npc.network.EmptyChannel; import net.citizensnpcs.util.nms.PlayerlistTrackerEntry; -import net.minecraft.server.v1_8_R2.AttributeInstance; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.ControllerJump; -import net.minecraft.server.v1_8_R2.DamageSource; -import net.minecraft.server.v1_8_R2.EnchantmentManager; -import net.minecraft.server.v1_8_R2.Entity; -import net.minecraft.server.v1_8_R2.EntityHorse; -import net.minecraft.server.v1_8_R2.EntityHuman; -import net.minecraft.server.v1_8_R2.EntityInsentient; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.EntityMinecartAbstract; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.EntityTracker; -import net.minecraft.server.v1_8_R2.EntityTrackerEntry; -import net.minecraft.server.v1_8_R2.EntityTypes; -import net.minecraft.server.v1_8_R2.GenericAttributes; -import net.minecraft.server.v1_8_R2.MathHelper; -import net.minecraft.server.v1_8_R2.NavigationAbstract; -import net.minecraft.server.v1_8_R2.NetworkManager; -import net.minecraft.server.v1_8_R2.Packet; -import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo; -import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo.EnumPlayerInfoAction; -import net.minecraft.server.v1_8_R2.PathfinderGoalSelector; -import net.minecraft.server.v1_8_R2.World; -import net.minecraft.server.v1_8_R2.WorldServer; +import net.minecraft.server.v1_8_R3.AttributeInstance; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.ControllerJump; +import net.minecraft.server.v1_8_R3.DamageSource; +import net.minecraft.server.v1_8_R3.EnchantmentManager; +import net.minecraft.server.v1_8_R3.Entity; +import net.minecraft.server.v1_8_R3.EntityHorse; +import net.minecraft.server.v1_8_R3.EntityHuman; +import net.minecraft.server.v1_8_R3.EntityInsentient; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.EntityMinecartAbstract; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.EntityTracker; +import net.minecraft.server.v1_8_R3.EntityTrackerEntry; +import net.minecraft.server.v1_8_R3.EntityTypes; +import net.minecraft.server.v1_8_R3.GenericAttributes; +import net.minecraft.server.v1_8_R3.MathHelper; +import net.minecraft.server.v1_8_R3.NavigationAbstract; +import net.minecraft.server.v1_8_R3.NetworkManager; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction; +import net.minecraft.server.v1_8_R3.PathfinderGoalSelector; +import net.minecraft.server.v1_8_R3.World; +import net.minecraft.server.v1_8_R3.WorldServer; import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_8_R2.CraftServer; -import org.bukkit.craftbukkit.v1_8_R2.CraftSound; -import org.bukkit.craftbukkit.v1_8_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_8_R3.CraftServer; +import org.bukkit.craftbukkit.v1_8_R3.CraftSound; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; @@ -81,7 +81,7 @@ public class NMS { } public static void attack(EntityLiving handle, Entity target) { - AttributeInstance attackDamage = handle.getAttributeInstance(GenericAttributes.e); + AttributeInstance attackDamage = handle.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE); float f = (float) (attackDamage == null ? 1 : attackDamage.getValue()); int i = 0; @@ -546,7 +546,7 @@ public class NMS { handle.ba = (float) d; } - public static boolean shouldJump(net.minecraft.server.v1_8_R2.Entity entity) { + public static boolean shouldJump(net.minecraft.server.v1_8_R3.Entity entity) { if (JUMP_FIELD == null || !(entity instanceof EntityLiving)) return false; try { diff --git a/src/main/java/net/citizensnpcs/util/PlayerAnimation.java b/src/main/java/net/citizensnpcs/util/PlayerAnimation.java index 8443d9ca1..8092d511a 100644 --- a/src/main/java/net/citizensnpcs/util/PlayerAnimation.java +++ b/src/main/java/net/citizensnpcs/util/PlayerAnimation.java @@ -4,14 +4,14 @@ import java.util.Arrays; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.npc.ai.NPCHolder; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.Packet; -import net.minecraft.server.v1_8_R2.PacketPlayOutAnimation; -import net.minecraft.server.v1_8_R2.PacketPlayOutBed; -import net.minecraft.server.v1_8_R2.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation; +import net.minecraft.server.v1_8_R3.PacketPlayOutBed; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; -import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/main/java/net/citizensnpcs/util/nms/PlayerControllerLook.java b/src/main/java/net/citizensnpcs/util/nms/PlayerControllerLook.java index ba1e519a3..45ee021a9 100644 --- a/src/main/java/net/citizensnpcs/util/nms/PlayerControllerLook.java +++ b/src/main/java/net/citizensnpcs/util/nms/PlayerControllerLook.java @@ -1,9 +1,9 @@ package net.citizensnpcs.util.nms; import net.citizensnpcs.npc.entity.EntityHumanNPC; -import net.minecraft.server.v1_8_R2.Entity; -import net.minecraft.server.v1_8_R2.EntityLiving; -import net.minecraft.server.v1_8_R2.MathHelper; +import net.minecraft.server.v1_8_R3.Entity; +import net.minecraft.server.v1_8_R3.EntityLiving; +import net.minecraft.server.v1_8_R3.MathHelper; public class PlayerControllerLook { private final EntityHumanNPC a; diff --git a/src/main/java/net/citizensnpcs/util/nms/PlayerControllerMove.java b/src/main/java/net/citizensnpcs/util/nms/PlayerControllerMove.java index 78ddf54a1..e0b9c3a8f 100644 --- a/src/main/java/net/citizensnpcs/util/nms/PlayerControllerMove.java +++ b/src/main/java/net/citizensnpcs/util/nms/PlayerControllerMove.java @@ -2,11 +2,11 @@ package net.citizensnpcs.util.nms; import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.util.NMS; -import net.minecraft.server.v1_8_R2.AttributeInstance; -import net.minecraft.server.v1_8_R2.GenericAttributes; -import net.minecraft.server.v1_8_R2.MathHelper; +import net.minecraft.server.v1_8_R3.AttributeInstance; +import net.minecraft.server.v1_8_R3.GenericAttributes; +import net.minecraft.server.v1_8_R3.MathHelper; -import org.bukkit.craftbukkit.v1_8_R2.TrigMath; +import org.bukkit.craftbukkit.v1_8_R3.TrigMath; public class PlayerControllerMove { protected EntityHumanNPC a; @@ -76,7 +76,7 @@ public class PlayerControllerMove { this.a.yaw = a(this.a.yaw, f, 30.0F); NMS.setHeadYaw(a, this.a.yaw); - AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.d); + AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); speed.setValue(0.1D * this.e); float movement = (float) (this.e * speed.getValue()) * 10; this.a.ba = movement; diff --git a/src/main/java/net/citizensnpcs/util/nms/PlayerNavigation.java b/src/main/java/net/citizensnpcs/util/nms/PlayerNavigation.java index a6dc1db0d..e4b1c08ba 100644 --- a/src/main/java/net/citizensnpcs/util/nms/PlayerNavigation.java +++ b/src/main/java/net/citizensnpcs/util/nms/PlayerNavigation.java @@ -1,24 +1,24 @@ package net.citizensnpcs.util.nms; import net.citizensnpcs.npc.entity.EntityHumanNPC; -import net.minecraft.server.v1_8_R2.AttributeInstance; -import net.minecraft.server.v1_8_R2.Block; -import net.minecraft.server.v1_8_R2.BlockPosition; -import net.minecraft.server.v1_8_R2.Blocks; -import net.minecraft.server.v1_8_R2.ChunkCache; -import net.minecraft.server.v1_8_R2.Entity; -import net.minecraft.server.v1_8_R2.EntityChicken; -import net.minecraft.server.v1_8_R2.EntityInsentient; -import net.minecraft.server.v1_8_R2.GenericAttributes; -import net.minecraft.server.v1_8_R2.Material; -import net.minecraft.server.v1_8_R2.MathHelper; -import net.minecraft.server.v1_8_R2.NavigationAbstract; -import net.minecraft.server.v1_8_R2.PathEntity; -import net.minecraft.server.v1_8_R2.PathPoint; -import net.minecraft.server.v1_8_R2.Pathfinder; -import net.minecraft.server.v1_8_R2.PathfinderNormal; -import net.minecraft.server.v1_8_R2.Vec3D; -import net.minecraft.server.v1_8_R2.World; +import net.minecraft.server.v1_8_R3.AttributeInstance; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.Blocks; +import net.minecraft.server.v1_8_R3.ChunkCache; +import net.minecraft.server.v1_8_R3.Entity; +import net.minecraft.server.v1_8_R3.EntityChicken; +import net.minecraft.server.v1_8_R3.EntityInsentient; +import net.minecraft.server.v1_8_R3.GenericAttributes; +import net.minecraft.server.v1_8_R3.Material; +import net.minecraft.server.v1_8_R3.MathHelper; +import net.minecraft.server.v1_8_R3.NavigationAbstract; +import net.minecraft.server.v1_8_R3.PathEntity; +import net.minecraft.server.v1_8_R3.PathPoint; +import net.minecraft.server.v1_8_R3.Pathfinder; +import net.minecraft.server.v1_8_R3.PathfinderNormal; +import net.minecraft.server.v1_8_R3.Vec3D; +import net.minecraft.server.v1_8_R3.World; public class PlayerNavigation extends NavigationAbstract { private final AttributeInstance a; @@ -38,7 +38,7 @@ public class PlayerNavigation extends NavigationAbstract { super(getDummyInsentient(entityinsentient), world); this.b = entityinsentient; this.c = world; - this.a = entityinsentient.getAttributeInstance(GenericAttributes.b); + this.a = entityinsentient.getAttributeInstance(GenericAttributes.FOLLOW_RANGE); this.a.setValue(24); this.j = a(); } diff --git a/src/main/java/net/citizensnpcs/util/nms/PlayerlistTrackerEntry.java b/src/main/java/net/citizensnpcs/util/nms/PlayerlistTrackerEntry.java index 81c06531f..654a3c431 100644 --- a/src/main/java/net/citizensnpcs/util/nms/PlayerlistTrackerEntry.java +++ b/src/main/java/net/citizensnpcs/util/nms/PlayerlistTrackerEntry.java @@ -4,10 +4,10 @@ import java.lang.reflect.Field; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.util.NMS; -import net.minecraft.server.v1_8_R2.Entity; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.EntityTrackerEntry; -import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo; +import net.minecraft.server.v1_8_R3.Entity; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.EntityTrackerEntry; +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; From 6a416bd7e1a8cae08876a20bb28ef6cf33c81bac Mon Sep 17 00:00:00 2001 From: Sanjay Govind Date: Wed, 20 May 2015 21:55:16 +1200 Subject: [PATCH 2/4] missed a deobsufacated field --- src/main/java/net/citizensnpcs/util/NMS.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/util/NMS.java b/src/main/java/net/citizensnpcs/util/NMS.java index dd4784d8d..80d743299 100644 --- a/src/main/java/net/citizensnpcs/util/NMS.java +++ b/src/main/java/net/citizensnpcs/util/NMS.java @@ -656,7 +656,7 @@ public class NMS { private static final Field JUMP_FIELD = getField(EntityLiving.class, "aY"); private static Field NAVIGATION_WORLD_FIELD = getField(NavigationAbstract.class, "c"); private static Field NETWORK_ADDRESS = getField(NetworkManager.class, "l"); - private static Field NETWORK_CHANNEL = getField(NetworkManager.class, "k"); + private static Field NETWORK_CHANNEL = getField(NetworkManager.class, "channel"); private static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0); private static Field PATHFINDING_RANGE = getField(NavigationAbstract.class, "a"); private static final Random RANDOM = Util.getFastRandom(); From 8eec2e27971d0b5df331c78cf79819712b00818e Mon Sep 17 00:00:00 2001 From: Sanjay Govind Date: Sat, 23 May 2015 22:35:53 +1200 Subject: [PATCH 3/4] 1.8.5 - no nms changes. --- src/main/java/net/citizensnpcs/Citizens.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/Citizens.java b/src/main/java/net/citizensnpcs/Citizens.java index 58be6ad64..a642930d3 100644 --- a/src/main/java/net/citizensnpcs/Citizens.java +++ b/src/main/java/net/citizensnpcs/Citizens.java @@ -454,5 +454,5 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { return false; } - private static final String COMPATIBLE_MC_VERSION = "1.8.4"; + private static final String COMPATIBLE_MC_VERSION = "1.8.5"; } From 49a7801d42812ff22d15e32715fbc53e03d01d71 Mon Sep 17 00:00:00 2001 From: Sanjay Govind Date: Sat, 23 May 2015 22:48:41 +1200 Subject: [PATCH 4/4] Update pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 969898b74..4648c89fc 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.8.4-R0.1-SNAPSHOT + 1.8.5-R0.1-SNAPSHOT 2.0.15-SNAPSHOT 1.4.1 1.4.12