Permalink
Browse files

Merge remote-tracking branch 'lenis0012/master'

Fix spout dependency
  • Loading branch information...
1 parent b305635 commit ab70dac5fed4f562977ccec88cb7e67045a26cd1 @Top-Cat committed Apr 7, 2013
View
@@ -42,7 +42,7 @@
<dependency>
<groupId>org.getspout</groupId>
<artifactId>spoutplugin</artifactId>
- <version>dev-SNAPSHOT</version>
+ <version>1.5.1-R0.2-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
@@ -9,14 +9,14 @@
import java.util.Map;
import java.util.logging.Level;
-import net.minecraft.server.v1_4_6.Entity;
-import net.minecraft.server.v1_4_6.PlayerInteractManager;
-import net.minecraft.server.v1_4_6.WorldServer;
+import net.minecraft.server.v1_5_R2.Entity;
+import net.minecraft.server.v1_5_R2.PlayerInteractManager;
+import net.minecraft.server.v1_5_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_4_6.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_5_R2.entity.CraftEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -61,7 +61,7 @@ public void run() {
HashSet<String> toRemove = new HashSet<String>();
for (String i : npcs.keySet()) {
Entity j = npcs.get(i).getEntity();
- j.z();
+ j.x();
if (j.dead) {
toRemove.add(i);
}
@@ -1,16 +1,15 @@
package com.topcat.npclib.entity;
-import net.minecraft.server.v1_4_6.EntityPlayer;
-import net.minecraft.server.v1_4_6.Packet18ArmAnimation;
-import net.minecraft.server.v1_4_6.WorldServer;
+import net.minecraft.server.v1_5_R2.EntityPlayer;
+import net.minecraft.server.v1_5_R2.Packet18ArmAnimation;
+import net.minecraft.server.v1_5_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
-import org.bukkit.craftbukkit.v1_4_6.CraftServer;
+import org.bukkit.craftbukkit.v1_5_R2.CraftServer;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
@@ -98,7 +97,7 @@ public void lookAtPoint(Location point) {
}
getEntity().yaw = (float) (newYaw - 90);
getEntity().pitch = (float) newPitch;
- ((EntityPlayer)getEntity()).ay = (float)(newYaw - 90);
+ ((EntityPlayer)getEntity()).az = (float)(newYaw - 90);
}
}
@@ -3,8 +3,8 @@
import java.util.ArrayList;
import java.util.Iterator;
-import net.minecraft.server.v1_4_6.Entity;
-import net.minecraft.server.v1_4_6.EntityPlayer;
+import net.minecraft.server.v1_5_R2.Entity;
+import net.minecraft.server.v1_5_R2.EntityPlayer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -5,16 +5,16 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import net.minecraft.server.v1_4_6.DedicatedPlayerList;
-import net.minecraft.server.v1_4_6.DedicatedServer;
-import net.minecraft.server.v1_4_6.MinecraftServer;
-import net.minecraft.server.v1_4_6.PropertyManager;
-import net.minecraft.server.v1_4_6.WorldServer;
-import jline.console.ConsoleReader;
+import net.minecraft.server.v1_5_R2.DedicatedPlayerList;
+import net.minecraft.server.v1_5_R2.DedicatedServer;
+import net.minecraft.server.v1_5_R2.MinecraftServer;
+import net.minecraft.server.v1_5_R2.PropertyManager;
+import net.minecraft.server.v1_5_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.v1_4_6.CraftServer;
+import org.bukkit.craftbukkit.libs.jline.console.ConsoleReader;
+import org.bukkit.craftbukkit.v1_5_R2.CraftServer;
/**
* Server hacks for Bukkit
@@ -6,17 +6,17 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import net.minecraft.server.v1_4_6.AxisAlignedBB;
-import net.minecraft.server.v1_4_6.Entity;
-import net.minecraft.server.v1_4_6.EntityPlayer;
-import net.minecraft.server.v1_4_6.PlayerChunkMap;
-import net.minecraft.server.v1_4_6.WorldProvider;
-import net.minecraft.server.v1_4_6.WorldServer;
+import net.minecraft.server.v1_5_R2.AxisAlignedBB;
+import net.minecraft.server.v1_5_R2.Entity;
+import net.minecraft.server.v1_5_R2.EntityPlayer;
+import net.minecraft.server.v1_5_R2.PlayerChunkMap;
+import net.minecraft.server.v1_5_R2.WorldProvider;
+import net.minecraft.server.v1_5_R2.WorldServer;
import org.bukkit.Location;
import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_4_6.CraftWorld;
-import org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer;
+import org.bukkit.craftbukkit.v1_5_R2.CraftWorld;
+import org.bukkit.craftbukkit.v1_5_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@@ -1,13 +1,14 @@
package com.topcat.npclib.nms;
-import net.minecraft.server.v1_4_6.Entity;
-import net.minecraft.server.v1_4_6.EntityHuman;
-import net.minecraft.server.v1_4_6.EntityPlayer;
-import net.minecraft.server.v1_4_6.EnumGamemode;
-import net.minecraft.server.v1_4_6.PlayerInteractManager;
-import net.minecraft.server.v1_4_6.WorldServer;
-
-import org.bukkit.craftbukkit.v1_4_6.CraftServer;
+import net.minecraft.server.v1_5_R2.Entity;
+import net.minecraft.server.v1_5_R2.EntityHuman;
+import net.minecraft.server.v1_5_R2.EntityPlayer;
+import net.minecraft.server.v1_5_R2.EnumGamemode;
+import net.minecraft.server.v1_5_R2.PlayerInteractManager;
+import net.minecraft.server.v1_5_R2.WorldServer;
+
+import org.bukkit.craftbukkit.v1_5_R2.CraftServer;
+import org.bukkit.craftbukkit.v1_5_R2.entity.CraftEntity;
import org.bukkit.event.entity.EntityTargetEvent;
import com.topcat.npclib.NPCManager;
@@ -27,7 +28,7 @@ public NPCEntity(NPCManager npcManager, BWorld world, String s, PlayerInteractMa
itemInWorldManager.b(EnumGamemode.SURVIVAL);
- playerConnection = new NPCNetHandler(npcManager, this);
+ playerConnection = new NPCPlayerConnection(npcManager, this);
lastTargetId = -1;
lastBounceId = -1;
lastBounceTick = 0;
@@ -36,7 +37,7 @@ public NPCEntity(NPCManager npcManager, BWorld world, String s, PlayerInteractMa
}
public void setBukkitEntity(org.bukkit.entity.Entity entity) {
- bukkitEntity = entity;
+ bukkitEntity = (CraftEntity) entity;
}
@Override
@@ -49,7 +50,7 @@ public boolean a(EntityHuman entity) {
}
@Override
- public void c_(EntityHuman entity) {
+ public void b_(EntityHuman entity) {
if ((lastBounceId != entity.id || System.currentTimeMillis() - lastBounceTick > 1000) && entity.getBukkitEntity().getLocation().distanceSquared(getBukkitEntity().getLocation()) <= 1) {
EntityTargetEvent event = new NpcEntityTargetEvent(getBukkitEntity(), entity.getBukkitEntity(), NpcEntityTargetEvent.NpcTargetReason.NPC_BOUNCED);
CraftServer server = ((WorldServer) world).getServer();
@@ -66,7 +67,7 @@ public void c_(EntityHuman entity) {
lastTargetId = entity.id;
}
- super.c_(entity);
+ super.b_(entity);
}
@Override
@@ -3,9 +3,12 @@
import java.io.IOException;
import java.lang.reflect.Field;
-import net.minecraft.server.v1_4_6.Connection;
-import net.minecraft.server.v1_4_6.NetworkManager;
-import net.minecraft.server.v1_4_6.Packet;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.v1_5_R2.CraftServer;
+
+import net.minecraft.server.v1_5_R2.Connection;
+import net.minecraft.server.v1_5_R2.NetworkManager;
+import net.minecraft.server.v1_5_R2.Packet;
/**
*
@@ -14,14 +17,14 @@
public class NPCNetworkManager extends NetworkManager {
public NPCNetworkManager() throws IOException {
- super(new NullSocket(), "NPC Manager", new Connection() {
+ super(((CraftServer) Bukkit.getServer()).getServer().getLogger(), new NullSocket(), "NPC Manager", new Connection() {
@Override
public boolean a() {
return true;
}
}, null);
try {
- Field f = NetworkManager.class.getDeclaredField("m");
+ Field f = NetworkManager.class.getDeclaredField("n");
f.setAccessible(true);
f.set(this, false);
} catch (Exception e) {
@@ -1,36 +1,36 @@
package com.topcat.npclib.nms;
-import net.minecraft.server.v1_4_6.EntityPlayer;
-import net.minecraft.server.v1_4_6.PlayerConnection;
-import net.minecraft.server.v1_4_6.Packet;
-import net.minecraft.server.v1_4_6.Packet101CloseWindow;
-import net.minecraft.server.v1_4_6.Packet102WindowClick;
-import net.minecraft.server.v1_4_6.Packet106Transaction;
-import net.minecraft.server.v1_4_6.Packet10Flying;
-import net.minecraft.server.v1_4_6.Packet130UpdateSign;
-import net.minecraft.server.v1_4_6.Packet14BlockDig;
-import net.minecraft.server.v1_4_6.Packet15Place;
-import net.minecraft.server.v1_4_6.Packet16BlockItemSwitch;
-import net.minecraft.server.v1_4_6.Packet18ArmAnimation;
-import net.minecraft.server.v1_4_6.Packet19EntityAction;
-import net.minecraft.server.v1_4_6.Packet255KickDisconnect;
-import net.minecraft.server.v1_4_6.Packet3Chat;
-import net.minecraft.server.v1_4_6.Packet7UseEntity;
-import net.minecraft.server.v1_4_6.Packet9Respawn;
+import net.minecraft.server.v1_5_R2.EntityPlayer;
+import net.minecraft.server.v1_5_R2.PlayerConnection;
+import net.minecraft.server.v1_5_R2.Packet;
+import net.minecraft.server.v1_5_R2.Packet101CloseWindow;
+import net.minecraft.server.v1_5_R2.Packet102WindowClick;
+import net.minecraft.server.v1_5_R2.Packet106Transaction;
+import net.minecraft.server.v1_5_R2.Packet10Flying;
+import net.minecraft.server.v1_5_R2.Packet130UpdateSign;
+import net.minecraft.server.v1_5_R2.Packet14BlockDig;
+import net.minecraft.server.v1_5_R2.Packet15Place;
+import net.minecraft.server.v1_5_R2.Packet16BlockItemSwitch;
+import net.minecraft.server.v1_5_R2.Packet18ArmAnimation;
+import net.minecraft.server.v1_5_R2.Packet19EntityAction;
+import net.minecraft.server.v1_5_R2.Packet255KickDisconnect;
+import net.minecraft.server.v1_5_R2.Packet3Chat;
+import net.minecraft.server.v1_5_R2.Packet7UseEntity;
+import net.minecraft.server.v1_5_R2.Packet9Respawn;
import org.bukkit.Bukkit;
-import org.bukkit.craftbukkit.v1_4_6.CraftServer;
-import org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer;
+import org.bukkit.craftbukkit.v1_5_R2.CraftServer;
+import org.bukkit.craftbukkit.v1_5_R2.entity.CraftPlayer;
import com.topcat.npclib.NPCManager;
/**
*
* @author martin
*/
-public class NPCNetHandler extends PlayerConnection {
+public class NPCPlayerConnection extends PlayerConnection {
- public NPCNetHandler(NPCManager npcManager, EntityPlayer entityplayer) {
+ public NPCPlayerConnection(NPCManager npcManager, EntityPlayer entityplayer) {
super(npcManager.getServer().getMCServer(), npcManager.getNPCNetworkManager(), entityplayer);
}
@@ -3,11 +3,11 @@
import java.util.ArrayList;
import java.util.List;
-import net.minecraft.server.v1_4_6.AxisAlignedBB;
+import net.minecraft.server.v1_5_R2.AxisAlignedBB;
import org.bukkit.Material;
import org.bukkit.block.Block;
-import org.bukkit.craftbukkit.v1_4_6.CraftWorld;
+import org.bukkit.craftbukkit.v1_5_R2.CraftWorld;
public class Node { // Holds data about each block we check
@@ -38,7 +38,7 @@ public Node(Block b) {
public void update() {
notsolid = true;
if (b.getType() != Material.AIR) {
- AxisAlignedBB box = net.minecraft.server.v1_4_6.Block.byId[b.getTypeId()].e(((CraftWorld) b.getWorld()).getHandle(), b.getX(), b.getY(), b.getZ());
+ AxisAlignedBB box = net.minecraft.server.v1_5_R2.Block.byId[b.getTypeId()].b(((CraftWorld) b.getWorld()).getHandle(), b.getX(), b.getY(), b.getZ());
if (box != null) {
if (Math.abs(box.e - box.b) > 0.2) {
notsolid = false;

1 comment on commit ab70dac

@lenis0012

yay for 1.5.1

Please sign in to comment.