Update for 1.4.6

This commit is contained in:
Olof Larsson 2012-12-21 08:35:07 +01:00
parent 5d193587ed
commit 3efa531559
13 changed files with 45 additions and 49 deletions

View File

@ -1,5 +1,5 @@
name: mcore5 name: mcore5
version: 1.1.2 version: 1.1.3
main: com.massivecraft.mcore5.MCore main: com.massivecraft.mcore5.MCore
load: startup load: startup
permissions: permissions:

View File

@ -2,7 +2,7 @@ package com.massivecraft.mcore5.adapter;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import org.bukkit.craftbukkit.v1_4_5.inventory.CraftInventoryCustom; import org.bukkit.craftbukkit.v1_4_6.inventory.CraftInventoryCustom;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;

View File

@ -4,10 +4,10 @@ import java.lang.reflect.Field;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Map.Entry; import java.util.Map.Entry;
import net.minecraft.server.v1_4_5.NBTBase; import net.minecraft.server.v1_4_6.NBTBase;
import net.minecraft.server.v1_4_5.NBTTagCompound; import net.minecraft.server.v1_4_6.NBTTagCompound;
import org.bukkit.craftbukkit.v1_4_5.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_4_6.inventory.CraftItemStack;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -191,11 +191,11 @@ public class ItemStackAdapterV1 implements JsonDeserializer<ItemStack>, JsonSeri
} }
} }
public static net.minecraft.server.v1_4_5.ItemStack getHandle(CraftItemStack craftItemStack) public static net.minecraft.server.v1_4_6.ItemStack getHandle(CraftItemStack craftItemStack)
{ {
try try
{ {
return (net.minecraft.server.v1_4_5.ItemStack) fieldCraftItemStackDotHandle.get(craftItemStack); return (net.minecraft.server.v1_4_6.ItemStack) fieldCraftItemStackDotHandle.get(craftItemStack);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -3,7 +3,7 @@ package com.massivecraft.mcore5.adapter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.minecraft.server.v1_4_5.NBTBase; import net.minecraft.server.v1_4_6.NBTBase;
import lombok.Getter; import lombok.Getter;

View File

@ -4,19 +4,19 @@ import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
import net.minecraft.server.v1_4_5.NBTBase; import net.minecraft.server.v1_4_6.NBTBase;
import net.minecraft.server.v1_4_5.NBTTagByte; import net.minecraft.server.v1_4_6.NBTTagByte;
import net.minecraft.server.v1_4_5.NBTTagByteArray; import net.minecraft.server.v1_4_6.NBTTagByteArray;
import net.minecraft.server.v1_4_5.NBTTagCompound; import net.minecraft.server.v1_4_6.NBTTagCompound;
import net.minecraft.server.v1_4_5.NBTTagDouble; import net.minecraft.server.v1_4_6.NBTTagDouble;
import net.minecraft.server.v1_4_5.NBTTagEnd; import net.minecraft.server.v1_4_6.NBTTagEnd;
import net.minecraft.server.v1_4_5.NBTTagFloat; import net.minecraft.server.v1_4_6.NBTTagFloat;
import net.minecraft.server.v1_4_5.NBTTagInt; import net.minecraft.server.v1_4_6.NBTTagInt;
import net.minecraft.server.v1_4_5.NBTTagIntArray; import net.minecraft.server.v1_4_6.NBTTagIntArray;
import net.minecraft.server.v1_4_5.NBTTagList; import net.minecraft.server.v1_4_6.NBTTagList;
import net.minecraft.server.v1_4_5.NBTTagLong; import net.minecraft.server.v1_4_6.NBTTagLong;
import net.minecraft.server.v1_4_5.NBTTagShort; import net.minecraft.server.v1_4_6.NBTTagShort;
import net.minecraft.server.v1_4_5.NBTTagString; import net.minecraft.server.v1_4_6.NBTTagString;
import com.massivecraft.mcore5.xlib.gson.JsonArray; import com.massivecraft.mcore5.xlib.gson.JsonArray;
import com.massivecraft.mcore5.xlib.gson.JsonElement; import com.massivecraft.mcore5.xlib.gson.JsonElement;

View File

@ -5,12 +5,12 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.AbstractMap.SimpleEntry; import java.util.AbstractMap.SimpleEntry;
import net.minecraft.server.v1_4_5.BiomeBase; import net.minecraft.server.v1_4_6.BiomeBase;
import net.minecraft.server.v1_4_5.Chunk; import net.minecraft.server.v1_4_6.Chunk;
import net.minecraft.server.v1_4_5.WorldServer; import net.minecraft.server.v1_4_6.WorldServer;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_4_5.CraftWorld; import org.bukkit.craftbukkit.v1_4_6.CraftWorld;
public class BiomeUtil public class BiomeUtil
{ {

View File

@ -6,7 +6,7 @@ import java.util.Map;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.SimpleCommandMap; import org.bukkit.command.SimpleCommandMap;
import org.bukkit.craftbukkit.v1_4_5.CraftServer; import org.bukkit.craftbukkit.v1_4_6.CraftServer;
public class BukkitCommandUtil public class BukkitCommandUtil
{ {

View File

@ -1,6 +1,6 @@
package com.massivecraft.mcore5.util; package com.massivecraft.mcore5.util;
import org.bukkit.craftbukkit.v1_4_5.inventory.CraftInventoryCustom; import org.bukkit.craftbukkit.v1_4_6.inventory.CraftInventoryCustom;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryHolder;

View File

@ -1,10 +1,10 @@
package com.massivecraft.mcore5.util; package com.massivecraft.mcore5.util;
import net.minecraft.server.v1_4_5.WorldServer; import net.minecraft.server.v1_4_6.WorldServer;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_4_5.CraftWorld; import org.bukkit.craftbukkit.v1_4_6.CraftWorld;
public class LightUtil public class LightUtil
{ {

View File

@ -1,7 +1,6 @@
package com.massivecraft.mcore5.util; package com.massivecraft.mcore5.util;
import java.io.File; import java.io.File;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
@ -9,13 +8,13 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.ConcurrentSkipListMap;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.minecraft.server.v1_4_5.DedicatedServer; import net.minecraft.server.v1_4_6.DedicatedServer;
import net.minecraft.server.v1_4_5.EntityPlayer; import net.minecraft.server.v1_4_6.EntityPlayer;
import net.minecraft.server.v1_4_5.Packet8UpdateHealth; import net.minecraft.server.v1_4_6.Packet8UpdateHealth;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_4_5.CraftServer; import org.bukkit.craftbukkit.v1_4_6.CraftServer;
import org.bukkit.craftbukkit.v1_4_5.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -82,15 +81,12 @@ public class PlayerUtil implements Listener
/** /**
* This is a faster version of the getPlayerExact method since this one is exact for real (no to lower case stuff). * This is a faster version of the getPlayerExact method since this one is exact for real (no to lower case stuff).
*/ */
@SuppressWarnings("unchecked")
public static Player getPlayerExact(String exactPlayerName) public static Player getPlayerExact(String exactPlayerName)
{ {
if (exactPlayerName == null) return null; if (exactPlayerName == null) return null;
CraftServer craftServer = (CraftServer) Bukkit.getServer(); for (Player player : Bukkit.getOnlinePlayers())
List<EntityPlayer> entityPlayers = craftServer.getHandle().players;
for (EntityPlayer entityPlayer : entityPlayers)
{ {
Player player = entityPlayer.netServerHandler.getPlayer();
if (player.getName().equals(exactPlayerName)) if (player.getName().equals(exactPlayerName))
{ {
return player; return player;
@ -215,7 +211,7 @@ public class PlayerUtil implements Listener
{ {
CraftPlayer cplayer = (CraftPlayer)player; CraftPlayer cplayer = (CraftPlayer)player;
EntityPlayer eplayer = cplayer.getHandle(); EntityPlayer eplayer = cplayer.getHandle();
eplayer.netServerHandler.sendPacket(new Packet8UpdateHealth(eplayer.getHealth(), eplayer.getFoodData().a(), eplayer.getFoodData().e())); eplayer.playerConnection.sendPacket(new Packet8UpdateHealth(eplayer.getHealth(), eplayer.getFoodData().a(), eplayer.getFoodData().e()));
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -1,9 +1,9 @@
package com.massivecraft.mcore5.util; package com.massivecraft.mcore5.util;
import net.minecraft.server.v1_4_5.Packet41MobEffect; import net.minecraft.server.v1_4_6.Packet41MobEffect;
import net.minecraft.server.v1_4_5.Packet42RemoveMobEffect; import net.minecraft.server.v1_4_6.Packet42RemoveMobEffect;
import org.bukkit.craftbukkit.v1_4_5.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
@ -60,7 +60,7 @@ public class PotionPaketUtil
pm.b = effectId; pm.b = effectId;
pm.c = amplifier; pm.c = amplifier;
pm.d = duration; pm.d = duration;
((CraftPlayer)player).getHandle().netServerHandler.sendPacket(pm); ((CraftPlayer)player).getHandle().playerConnection.sendPacket(pm);
} }
public static void remove(Player player, int entityId, byte effectId) public static void remove(Player player, int entityId, byte effectId)
@ -68,7 +68,7 @@ public class PotionPaketUtil
Packet42RemoveMobEffect pr = new Packet42RemoveMobEffect(); Packet42RemoveMobEffect pr = new Packet42RemoveMobEffect();
pr.a = entityId; pr.a = entityId;
pr.b = effectId; pr.b = effectId;
((CraftPlayer)player).getHandle().netServerHandler.sendPacket(pr); ((CraftPlayer)player).getHandle().playerConnection.sendPacket(pr);
} }
} }

View File

@ -25,7 +25,7 @@ public class TextWrapper
private static final char COLOR_CHAR = '\u00A7'; private static final char COLOR_CHAR = '\u00A7';
private static final int CHAT_WINDOW_WIDTH = 320; private static final int CHAT_WINDOW_WIDTH = 320;
private static final int CHAT_STRING_LENGTH = 119; private static final int CHAT_STRING_LENGTH = 119;
private static final String allowedChars = net.minecraft.server.v1_4_5.SharedConstants.allowedCharacters; private static final String allowedChars = net.minecraft.server.v1_4_6.SharedConstants.allowedCharacters;
public static int getCharPixelWidth(char ch) public static int getCharPixelWidth(char ch)
{ {

View File

@ -1,6 +1,6 @@
package com.massivecraft.mcore5.util; package com.massivecraft.mcore5.util;
import org.bukkit.craftbukkit.v1_4_5.entity.CraftThrownPotion; import org.bukkit.craftbukkit.v1_4_6.entity.CraftThrownPotion;
import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.ThrownPotion;
// PR to add this feature to the API: // PR to add this feature to the API: