mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 05:19:41 +00:00
1.7.10 Files
Files added
This commit is contained in:
1 parent
393ea9b463
commit
a31efb2dc3
1768 files changed
+84831
No files matched your search
@@ -0,0 +1,46 @@
|
||||
package foxz.utils;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
public class Utils {
|
||||
|
||||
static public <T> List<T> getNearbeEntityFromPlayer(Class<? extends T> cls,EntityPlayerMP player, int dis) {
|
||||
AxisAlignedBB range = player.boundingBox.expand(dis, dis, dis);
|
||||
List<T> list = player.worldObj.getEntitiesWithinAABB(cls, range);
|
||||
return list;
|
||||
}
|
||||
|
||||
static public EntityPlayer getOnlinePlayer(String playername){
|
||||
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(playername);
|
||||
}
|
||||
|
||||
static public World getWorld(String t){
|
||||
WorldServer[] ws=MinecraftServer.getServer().worldServers;
|
||||
for (WorldServer w:ws){
|
||||
if (w!=null){
|
||||
if ((w.provider.dimensionId + "").equalsIgnoreCase(t)){
|
||||
return w;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// <editor-fold desc="--- Foxz fork (pls keep it)">
|
||||
// static public void savePlayerAltInv(EntityPlayer p,String n){
|
||||
// NBTTagList tag=p.inventory.writeToNBT(new NBTTagList());
|
||||
// p.getEntityData().setTag("AltInv_"+n, tag);
|
||||
// }
|
||||
//
|
||||
// static public void loadPlayerAltInv(EntityPlayer p,String n){
|
||||
// p.inventory.readFromNBT((NBTTagList) p.getEntityData().getTag("AltInv_"+n));
|
||||
// }
|
||||
// </editor-fold>
|
||||
}
|
||||
Reference in new issue
Block a user