Optimize Imports

This commit is contained in:
Kam committed 2024-02-15 17:54:28 -05:00
1 parent ec78673fa2
commit e46b78ff71
149 files changed
+931 -1029

No files matched your search

+8 -8
View File
@@ -1,13 +1,13 @@
package foxz.utils;
import java.io.File;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.CustomNpcs;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.roles.RoleTrader;
import noppes.npcs.util.NBTJsonUtil;
import java.io.File;
public class Market {
static public void save(RoleTrader r, String name) {
@@ -15,7 +15,7 @@ public class Market {
return;
File file = getFile(name + "_new");
File file1 = getFile(name);
try {
NBTJsonUtil.SaveFile(file, r.writeNBT(new NBTTagCompound()));
if(file1.exists()){
@@ -23,8 +23,8 @@ public class Market {
}
file.renameTo(file1);
} catch (Exception e) {
}
}
}
@@ -34,11 +34,11 @@ public class Market {
File file = getFile(name);
if(!file.exists())
return;
try {
role.readNBT(NBTJsonUtil.LoadFile(file));
} catch (Exception e) {
}
}
}
private static File getFile(String name){
File dir = new File(CustomNpcs.getWorldSaveDirectory(), "markets");
@@ -52,7 +52,7 @@ public class Market {
return;
if(!getFile(marketName).exists())
Market.save((RoleTrader) npc.roleInterface, marketName);
Market.load((RoleTrader) npc.roleInterface, marketName);
}
}
+7 -7
View File
@@ -1,13 +1,13 @@
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;
import java.util.List;
public class Utils {
@@ -16,11 +16,11 @@ public class Utils {
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){
@@ -32,13 +32,13 @@ public class Utils {
}
return null;
}
// <editor-fold desc="--- Foxz fork (pls keep it)">
// static public void savePlayerAltInv(EntityPlayer p,String n){
// 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));
// }