Permalink
Browse files

Forgot that C1 is actually pretty easy to update

  • Loading branch information...
1 parent 0bb5548 commit 289e29b507baf2ef14ca377be3f1417f30e231d6 @fullwall fullwall committed Jul 2, 2013
Showing with 254 additions and 270 deletions.
  1. BIN libs/craftbukkit2.jar
  2. +1 −1 plugin.yml
  3. +2 −2 src/core/net/citizensnpcs/commands/BasicCommands.java
  4. +1 −1 src/core/net/citizensnpcs/listeners/EntityListen.java
  5. +2 −2 src/core/net/citizensnpcs/properties/properties/BasicProperties.java
  6. +1 −1 src/core/net/citizensnpcs/resources/npclib/AutoPathfinder.java
  7. +7 −7 src/core/net/citizensnpcs/resources/npclib/CraftNPC.java
  8. +1 −1 src/core/net/citizensnpcs/resources/npclib/HumanNPC.java
  9. +2 −2 src/core/net/citizensnpcs/resources/npclib/MinecraftAutoPathfinder.java
  10. +4 −4 src/core/net/citizensnpcs/resources/npclib/NPCAnimator.java
  11. +2 −2 src/core/net/citizensnpcs/resources/npclib/NPCList.java
  12. +1 −1 src/core/net/citizensnpcs/resources/npclib/NPCManager.java
  13. +16 −16 src/core/net/citizensnpcs/resources/npclib/NPCNetHandler.java
  14. +4 −4 src/core/net/citizensnpcs/resources/npclib/NPCNetworkManager.java
  15. +6 −6 src/core/net/citizensnpcs/resources/npclib/NPCSpawner.java
  16. +21 −19 src/core/net/citizensnpcs/resources/npclib/PathNPC.java
  17. +4 −4 src/core/net/citizensnpcs/resources/npclib/creatures/CreatureNPC.java
  18. +3 −3 src/core/net/citizensnpcs/resources/npclib/creatures/CreatureNPCType.java
  19. +6 −7 src/core/net/citizensnpcs/resources/npclib/creatures/EvilCreatureNPC.java
  20. +2 −2 src/core/net/citizensnpcs/utils/PacketUtils.java
  21. +69 −72 src/core/net/citizensnpcs/waypoints/modifiers/HealthModifier.java
  22. +1 −1 src/guard/net/citizensnpcs/guards/Guard.java
  23. +98 −112 src/healer/net/citizensnpcs/healers/Healer.java
View
Binary file not shown.
View
@@ -1,6 +1,6 @@
name: Citizens
main: net.citizensnpcs.Citizens
-version: 1.2.1
+version: 1.2.4
authors: [fullwall, aPunch]
softdepend: [Vault]
commands:
@@ -35,7 +35,7 @@
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_6_R1.entity.CraftEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -123,7 +123,7 @@ public static void clean(CommandContext args, CommandSender sender, HumanNPC npc
int count = 0;
for (World world : Bukkit.getServer().getWorlds()) {
for (Entity entity : world.getEntities()) {
- net.minecraft.server.v1_5_R3.Entity mcEntity = ((CraftEntity) entity).getHandle();
+ net.minecraft.server.v1_6_R1.Entity mcEntity = ((CraftEntity) entity).getHandle();
if (!(mcEntity instanceof CraftNPC) || mcEntity instanceof CreatureNPC)
continue;
HumanNPC found = ((CraftNPC) mcEntity).npc;
@@ -14,7 +14,7 @@
import net.citizensnpcs.utils.Messaging;
import org.bukkit.Bukkit;
-import org.bukkit.craftbukkit.v1_5_R3.CraftServer;
+import org.bukkit.craftbukkit.v1_6_R1.CraftServer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -27,7 +27,7 @@
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_5_R3.inventory.CraftInventoryPlayer;
+import org.bukkit.craftbukkit.v1_6_R1.inventory.CraftInventoryPlayer;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
@@ -89,7 +89,7 @@ private PlayerInventory getInventory(int UID) {
}
}
}
- PlayerInventory inv = new CraftInventoryPlayer(new net.minecraft.server.v1_5_R3.PlayerInventory(null));
+ PlayerInventory inv = new CraftInventoryPlayer(new net.minecraft.server.v1_6_R1.PlayerInventory(null));
ItemStack[] stacks = inv.getContents();
inv.setContents(array.toArray(stacks));
return inv;
@@ -1,6 +1,6 @@
package net.citizensnpcs.resources.npclib;
-import net.minecraft.server.v1_5_R3.PathEntity;
+import net.minecraft.server.v1_6_R1.PathEntity;
public interface AutoPathfinder {
PathEntity find(PathNPC npc);
@@ -3,12 +3,12 @@
import java.io.IOException;
import net.citizensnpcs.resources.npclib.NPCAnimator.Animation;
-import net.minecraft.server.v1_5_R3.Connection;
-import net.minecraft.server.v1_5_R3.EnumGamemode;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.NetworkManager;
-import net.minecraft.server.v1_5_R3.PlayerInteractManager;
-import net.minecraft.server.v1_5_R3.World;
+import net.minecraft.server.v1_6_R1.Connection;
+import net.minecraft.server.v1_6_R1.EnumGamemode;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.NetworkManager;
+import net.minecraft.server.v1_6_R1.PlayerInteractManager;
+import net.minecraft.server.v1_6_R1.World;
import org.bukkit.entity.LivingEntity;
@@ -25,7 +25,7 @@ public CraftNPC(MinecraftServer minecraftserver, World world, String s, PlayerIn
public boolean a() {
return false;
}
- }, server.F().getPrivate());
+ }, server.H().getPrivate());
this.playerConnection = new NPCNetHandler(minecraftserver, this, netMgr);
netMgr.a(this.playerConnection);
} catch (IOException e) {
@@ -13,7 +13,7 @@
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_5_R3.CraftServer;
+import org.bukkit.craftbukkit.v1_6_R1.CraftServer;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
@@ -2,8 +2,8 @@
import java.util.Random;
-import net.minecraft.server.v1_5_R3.MathHelper;
-import net.minecraft.server.v1_5_R3.PathEntity;
+import net.minecraft.server.v1_6_R1.MathHelper;
+import net.minecraft.server.v1_6_R1.PathEntity;
public class MinecraftAutoPathfinder implements AutoPathfinder {
private final Random random = new Random();
@@ -1,10 +1,10 @@
package net.citizensnpcs.resources.npclib;
import net.citizensnpcs.utils.PacketUtils;
-import net.minecraft.server.v1_5_R3.DataWatcher;
-import net.minecraft.server.v1_5_R3.Packet17EntityLocationAction;
-import net.minecraft.server.v1_5_R3.Packet18ArmAnimation;
-import net.minecraft.server.v1_5_R3.Packet40EntityMetadata;
+import net.minecraft.server.v1_6_R1.DataWatcher;
+import net.minecraft.server.v1_6_R1.Packet17EntityLocationAction;
+import net.minecraft.server.v1_6_R1.Packet18ArmAnimation;
+import net.minecraft.server.v1_6_R1.Packet40EntityMetadata;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -2,7 +2,7 @@
import java.util.concurrent.ConcurrentHashMap;
-import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_6_R1.entity.CraftEntity;
import org.bukkit.entity.Entity;
public class NPCList extends ConcurrentHashMap<Integer, HumanNPC> {
@@ -14,7 +14,7 @@ public HumanNPC getNPC(Entity entity) {
if (entity == null) {
return null;
}
- net.minecraft.server.v1_5_R3.Entity mcEntity = ((CraftEntity) entity).getHandle();
+ net.minecraft.server.v1_6_R1.Entity mcEntity = ((CraftEntity) entity).getHandle();
if (mcEntity instanceof CraftNPC) {
HumanNPC npc = ((CraftNPC) mcEntity).npc;
if (npc == null)
@@ -13,7 +13,7 @@
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_6_R1.entity.CraftEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -1,21 +1,21 @@
package net.citizensnpcs.resources.npclib;
-import net.minecraft.server.v1_5_R3.EntityPlayer;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.NetworkManager;
-import net.minecraft.server.v1_5_R3.Packet;
-import net.minecraft.server.v1_5_R3.Packet102WindowClick;
-import net.minecraft.server.v1_5_R3.Packet106Transaction;
-import net.minecraft.server.v1_5_R3.Packet10Flying;
-import net.minecraft.server.v1_5_R3.Packet130UpdateSign;
-import net.minecraft.server.v1_5_R3.Packet14BlockDig;
-import net.minecraft.server.v1_5_R3.Packet15Place;
-import net.minecraft.server.v1_5_R3.Packet16BlockItemSwitch;
-import net.minecraft.server.v1_5_R3.Packet255KickDisconnect;
-import net.minecraft.server.v1_5_R3.Packet28EntityVelocity;
-import net.minecraft.server.v1_5_R3.Packet3Chat;
-import net.minecraft.server.v1_5_R3.Packet51MapChunk;
-import net.minecraft.server.v1_5_R3.PlayerConnection;
+import net.minecraft.server.v1_6_R1.EntityPlayer;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.NetworkManager;
+import net.minecraft.server.v1_6_R1.Packet;
+import net.minecraft.server.v1_6_R1.Packet102WindowClick;
+import net.minecraft.server.v1_6_R1.Packet106Transaction;
+import net.minecraft.server.v1_6_R1.Packet10Flying;
+import net.minecraft.server.v1_6_R1.Packet130UpdateSign;
+import net.minecraft.server.v1_6_R1.Packet14BlockDig;
+import net.minecraft.server.v1_6_R1.Packet15Place;
+import net.minecraft.server.v1_6_R1.Packet16BlockItemSwitch;
+import net.minecraft.server.v1_6_R1.Packet255KickDisconnect;
+import net.minecraft.server.v1_6_R1.Packet28EntityVelocity;
+import net.minecraft.server.v1_6_R1.Packet3Chat;
+import net.minecraft.server.v1_6_R1.Packet51MapChunk;
+import net.minecraft.server.v1_6_R1.PlayerConnection;
public class NPCNetHandler extends PlayerConnection {
public NPCNetHandler(MinecraftServer minecraftserver, EntityPlayer entityplayer, NetworkManager netMgr) {
@@ -5,10 +5,10 @@
import java.net.Socket;
import java.security.PrivateKey;
-import net.minecraft.server.v1_5_R3.Connection;
-import net.minecraft.server.v1_5_R3.IConsoleLogManager;
-import net.minecraft.server.v1_5_R3.NetworkManager;
-import net.minecraft.server.v1_5_R3.Packet;
+import net.minecraft.server.v1_6_R1.Connection;
+import net.minecraft.server.v1_6_R1.IConsoleLogManager;
+import net.minecraft.server.v1_6_R1.NetworkManager;
+import net.minecraft.server.v1_6_R1.Packet;
public class NPCNetworkManager extends NetworkManager {
public NPCNetworkManager(IConsoleLogManager mgr, Socket paramSocket, String paramString,
@@ -6,16 +6,16 @@
import net.citizensnpcs.resources.npclib.creatures.CreatureNPCType;
import net.citizensnpcs.utils.Messaging;
import net.citizensnpcs.utils.PacketUtils;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.Packet29DestroyEntity;
-import net.minecraft.server.v1_5_R3.PlayerInteractManager;
-import net.minecraft.server.v1_5_R3.World;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.Packet29DestroyEntity;
+import net.minecraft.server.v1_6_R1.PlayerInteractManager;
+import net.minecraft.server.v1_6_R1.World;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Server;
-import org.bukkit.craftbukkit.v1_5_R3.CraftServer;
-import org.bukkit.craftbukkit.v1_5_R3.CraftWorld;
+import org.bukkit.craftbukkit.v1_6_R1.CraftServer;
+import org.bukkit.craftbukkit.v1_6_R1.CraftWorld;
public class NPCSpawner {
public static void despawnNPC(CraftNPC npc, NPCRemoveReason reason) {
@@ -5,20 +5,21 @@
import net.citizensnpcs.resources.npclib.NPCAnimator.Animation;
import net.citizensnpcs.resources.npclib.creatures.CreatureNPC;
import net.citizensnpcs.utils.PacketUtils;
-import net.minecraft.server.v1_5_R3.Entity;
-import net.minecraft.server.v1_5_R3.EntityHuman;
-import net.minecraft.server.v1_5_R3.EntityPlayer;
-import net.minecraft.server.v1_5_R3.MathHelper;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.Packet5EntityEquipment;
-import net.minecraft.server.v1_5_R3.PathEntity;
-import net.minecraft.server.v1_5_R3.PlayerInteractManager;
-import net.minecraft.server.v1_5_R3.Vec3D;
-import net.minecraft.server.v1_5_R3.World;
+import net.minecraft.server.v1_6_R1.Entity;
+import net.minecraft.server.v1_6_R1.EntityHuman;
+import net.minecraft.server.v1_6_R1.EntityPlayer;
+import net.minecraft.server.v1_6_R1.GenericAttributes;
+import net.minecraft.server.v1_6_R1.MathHelper;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.Packet5EntityEquipment;
+import net.minecraft.server.v1_6_R1.PathEntity;
+import net.minecraft.server.v1_6_R1.PlayerInteractManager;
+import net.minecraft.server.v1_6_R1.Vec3D;
+import net.minecraft.server.v1_6_R1.World;
import org.bukkit.Location;
import org.bukkit.Material;
-import org.bukkit.craftbukkit.v1_5_R3.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.v1_6_R1.entity.CraftLivingEntity;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@@ -41,7 +42,7 @@
protected float pathingRange = 16;
private int pathTickLimit = -1;
private int pathTicks = 0;
- private final net.minecraft.server.v1_5_R3.ItemStack[] previousEquipment = { null, null, null, null, null };
+ private final net.minecraft.server.v1_6_R1.ItemStack[] previousEquipment = { null, null, null, null, null };
private int prevX, prevY, prevZ;
protected boolean randomPather = false;
private int stationaryTickLimit = -1;
@@ -76,7 +77,7 @@ private void attackEntity(Entity entity) {
} else {
this.performAction(Animation.SWING_ARM);
LivingEntity other = (LivingEntity) entity.getBukkitEntity();
- other.damage(this.inventory.a(entity));
+ other.damage(this.a(GenericAttributes.e).e());
}
hasAttacked = true;
@@ -142,7 +143,7 @@ private float getYawDifference(double diffZ, double diffX) {
float vectorYaw = (float) (Math.atan2(diffZ, diffX) * 180.0D / Math.PI) - 90.0F;
float diffYaw = vectorYaw - this.yaw;
- this.bE = this.bI;
+ this.bf = (float) this.a(GenericAttributes.d).e();
while (diffYaw >= 180.0F) {
diffYaw -= 360.0F;
}
@@ -166,13 +167,14 @@ private void handleMove(Vec3D vector) {
float diffYaw = getYawDifference(diffZ, diffX);
this.yaw += diffYaw;
- this.aA += diffYaw;
+ this.aP = this.yaw;
+ this.aQ = this.yaw;
if (diffY > 0.0D) {
jump();
}
// TODO: adjust pitch.
// Walk.
- this.e(this.bD, this.bE);
+ this.e(this.be, this.bf);
}
if (this.positionChanged && !this.pathFinished()) {
jump();
@@ -192,7 +194,7 @@ private boolean isHoldingBow() {
}
public boolean isInSight(Entity entity) {
- return this.n(entity);
+ return this.o(entity);
}
private boolean isWithinAttackRange(Entity entity, double distance) {
@@ -300,8 +302,8 @@ public boolean toggleAutoPathfinder() {
private void updateEquipment() {
for (int i = 0; i < previousEquipment.length; i++) {
- net.minecraft.server.v1_5_R3.ItemStack previous = previousEquipment[i];
- net.minecraft.server.v1_5_R3.ItemStack current = getEquipment(i);
+ net.minecraft.server.v1_6_R1.ItemStack previous = previousEquipment[i];
+ net.minecraft.server.v1_6_R1.ItemStack current = getEquipment(i);
if (previous != current) {
PacketUtils.sendPacketNearby(getBukkitEntity().getLocation(), 64, new Packet5EntityEquipment(id, i,
current));
@@ -1,12 +1,12 @@
package net.citizensnpcs.resources.npclib.creatures;
import net.citizensnpcs.resources.npclib.CraftNPC;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.PlayerInteractManager;
-import net.minecraft.server.v1_5_R3.World;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.PlayerInteractManager;
+import net.minecraft.server.v1_6_R1.World;
import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_6_R1.entity.CraftEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@@ -10,9 +10,9 @@
import net.citizensnpcs.resources.npclib.HumanNPC;
import net.citizensnpcs.utils.Messaging;
import net.citizensnpcs.utils.StringUtils;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.PlayerInteractManager;
-import net.minecraft.server.v1_5_R3.World;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.PlayerInteractManager;
+import net.minecraft.server.v1_6_R1.World;
import org.bukkit.Location;
@@ -10,10 +10,10 @@
import net.citizensnpcs.utils.MessageUtils;
import net.citizensnpcs.utils.Messaging;
import net.citizensnpcs.utils.StringUtils;
-import net.minecraft.server.v1_5_R3.EntityHuman;
-import net.minecraft.server.v1_5_R3.MinecraftServer;
-import net.minecraft.server.v1_5_R3.PlayerInteractManager;
-import net.minecraft.server.v1_5_R3.World;
+import net.minecraft.server.v1_6_R1.EntityHuman;
+import net.minecraft.server.v1_6_R1.MinecraftServer;
+import net.minecraft.server.v1_6_R1.PlayerInteractManager;
+import net.minecraft.server.v1_6_R1.World;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@@ -70,8 +70,7 @@ public void onRightClick(Player player) {
InventoryUtils.decreaseItemInHand(player);
isTame = true;
CreatureTask.despawn(this, NPCRemoveReason.OTHER);
- NPCManager.register(npc.getName(), player.getLocation(), player.getName(),
- NPCCreateReason.RESPAWN);
+ NPCManager.register(npc.getName(), player.getLocation(), player.getName(), NPCCreateReason.RESPAWN);
player.sendMessage(ChatColor.GREEN + "You have tamed " + StringUtils.wrap(npc.getName())
+ "! You can now toggle it to be any type.");
} else {
@@ -87,7 +86,7 @@ public void onRightClick(Player player) {
@Override
public void onSpawn() {
npc.getInventory().setItemInHand(new ItemStack(weapons[this.random.nextInt(weapons.length)], 1));
- this.health = Settings.getInt("EvilHealth");
+ this.setHealth((float) Settings.getDouble("EvilHealth"));
super.onSpawn();
}
}
Oops, something went wrong.

0 comments on commit 289e29b

Please sign in to comment.