Update for 1.4.6
This commit is contained in:
parent
5d193587ed
commit
3efa531559
@ -1,5 +1,5 @@
|
||||
name: mcore5
|
||||
version: 1.1.2
|
||||
version: 1.1.3
|
||||
main: com.massivecraft.mcore5.MCore
|
||||
load: startup
|
||||
permissions:
|
||||
|
@ -2,7 +2,7 @@ package com.massivecraft.mcore5.adapter;
|
||||
|
||||
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.ItemStack;
|
||||
|
||||
|
@ -4,10 +4,10 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.server.v1_4_5.NBTBase;
|
||||
import net.minecraft.server.v1_4_5.NBTTagCompound;
|
||||
import net.minecraft.server.v1_4_6.NBTBase;
|
||||
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.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
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ package com.massivecraft.mcore5.adapter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.server.v1_4_5.NBTBase;
|
||||
import net.minecraft.server.v1_4_6.NBTBase;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -4,19 +4,19 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.server.v1_4_5.NBTBase;
|
||||
import net.minecraft.server.v1_4_5.NBTTagByte;
|
||||
import net.minecraft.server.v1_4_5.NBTTagByteArray;
|
||||
import net.minecraft.server.v1_4_5.NBTTagCompound;
|
||||
import net.minecraft.server.v1_4_5.NBTTagDouble;
|
||||
import net.minecraft.server.v1_4_5.NBTTagEnd;
|
||||
import net.minecraft.server.v1_4_5.NBTTagFloat;
|
||||
import net.minecraft.server.v1_4_5.NBTTagInt;
|
||||
import net.minecraft.server.v1_4_5.NBTTagIntArray;
|
||||
import net.minecraft.server.v1_4_5.NBTTagList;
|
||||
import net.minecraft.server.v1_4_5.NBTTagLong;
|
||||
import net.minecraft.server.v1_4_5.NBTTagShort;
|
||||
import net.minecraft.server.v1_4_5.NBTTagString;
|
||||
import net.minecraft.server.v1_4_6.NBTBase;
|
||||
import net.minecraft.server.v1_4_6.NBTTagByte;
|
||||
import net.minecraft.server.v1_4_6.NBTTagByteArray;
|
||||
import net.minecraft.server.v1_4_6.NBTTagCompound;
|
||||
import net.minecraft.server.v1_4_6.NBTTagDouble;
|
||||
import net.minecraft.server.v1_4_6.NBTTagEnd;
|
||||
import net.minecraft.server.v1_4_6.NBTTagFloat;
|
||||
import net.minecraft.server.v1_4_6.NBTTagInt;
|
||||
import net.minecraft.server.v1_4_6.NBTTagIntArray;
|
||||
import net.minecraft.server.v1_4_6.NBTTagList;
|
||||
import net.minecraft.server.v1_4_6.NBTTagLong;
|
||||
import net.minecraft.server.v1_4_6.NBTTagShort;
|
||||
import net.minecraft.server.v1_4_6.NBTTagString;
|
||||
|
||||
import com.massivecraft.mcore5.xlib.gson.JsonArray;
|
||||
import com.massivecraft.mcore5.xlib.gson.JsonElement;
|
||||
|
@ -5,12 +5,12 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.AbstractMap.SimpleEntry;
|
||||
|
||||
import net.minecraft.server.v1_4_5.BiomeBase;
|
||||
import net.minecraft.server.v1_4_5.Chunk;
|
||||
import net.minecraft.server.v1_4_5.WorldServer;
|
||||
import net.minecraft.server.v1_4_6.BiomeBase;
|
||||
import net.minecraft.server.v1_4_6.Chunk;
|
||||
import net.minecraft.server.v1_4_6.WorldServer;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_4_5.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_4_6.CraftWorld;
|
||||
|
||||
public class BiomeUtil
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.craftbukkit.v1_4_5.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_4_6.CraftServer;
|
||||
|
||||
public class BukkitCommandUtil
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
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.InventoryHolder;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
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.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_4_5.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_4_6.CraftWorld;
|
||||
|
||||
public class LightUtil
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.massivecraft.mcore5.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
@ -9,13 +8,13 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.server.v1_4_5.DedicatedServer;
|
||||
import net.minecraft.server.v1_4_5.EntityPlayer;
|
||||
import net.minecraft.server.v1_4_5.Packet8UpdateHealth;
|
||||
import net.minecraft.server.v1_4_6.DedicatedServer;
|
||||
import net.minecraft.server.v1_4_6.EntityPlayer;
|
||||
import net.minecraft.server.v1_4_6.Packet8UpdateHealth;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_4_5.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_4_5.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_4_6.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
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).
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
public static Player getPlayerExact(String exactPlayerName)
|
||||
{
|
||||
if (exactPlayerName == null) return null;
|
||||
CraftServer craftServer = (CraftServer) Bukkit.getServer();
|
||||
List<EntityPlayer> entityPlayers = craftServer.getHandle().players;
|
||||
for (EntityPlayer entityPlayer : entityPlayers)
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
Player player = entityPlayer.netServerHandler.getPlayer();
|
||||
if (player.getName().equals(exactPlayerName))
|
||||
{
|
||||
return player;
|
||||
@ -215,7 +211,7 @@ public class PlayerUtil implements Listener
|
||||
{
|
||||
CraftPlayer cplayer = (CraftPlayer)player;
|
||||
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()));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.massivecraft.mcore5.util;
|
||||
|
||||
import net.minecraft.server.v1_4_5.Packet41MobEffect;
|
||||
import net.minecraft.server.v1_4_5.Packet42RemoveMobEffect;
|
||||
import net.minecraft.server.v1_4_6.Packet41MobEffect;
|
||||
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.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
@ -60,7 +60,7 @@ public class PotionPaketUtil
|
||||
pm.b = effectId;
|
||||
pm.c = amplifier;
|
||||
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)
|
||||
@ -68,7 +68,7 @@ public class PotionPaketUtil
|
||||
Packet42RemoveMobEffect pr = new Packet42RemoveMobEffect();
|
||||
pr.a = entityId;
|
||||
pr.b = effectId;
|
||||
((CraftPlayer)player).getHandle().netServerHandler.sendPacket(pr);
|
||||
((CraftPlayer)player).getHandle().playerConnection.sendPacket(pr);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class TextWrapper
|
||||
private static final char COLOR_CHAR = '\u00A7';
|
||||
private static final int CHAT_WINDOW_WIDTH = 320;
|
||||
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)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
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;
|
||||
|
||||
// PR to add this feature to the API:
|
||||
|
Loading…
Reference in New Issue
Block a user