本文整理汇总了Java中net.minecraft.stats.StatisticsFile类的典型用法代码示例。如果您正苦于以下问题:Java StatisticsFile类的具体用法?Java StatisticsFile怎么用?Java StatisticsFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatisticsFile类属于net.minecraft.stats包,在下文中一共展示了StatisticsFile类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getStatisticsFile
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
public static StatisticsFile getStatisticsFile(UUID id, String name) {
final File idFile = new File(NeptuneWorldManager.STATS_DIR, id.toString() + ".json");
if (!idFile.exists()) {
final File nameFile = new File(NeptuneWorldManager.STATS_DIR, name + ".json");
if (nameFile.exists() && nameFile.isFile()) {
nameFile.renameTo(idFile);
}
}
final StatisticsFile statisticsFile = new StatisticsFile(MinecraftServer.getServer(), idFile);
statisticsFile.readStatFile();
return statisticsFile;
}
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:17,代码来源:StatisticsHelper.java
示例2: matchesObject
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@Override
public boolean matchesObject(Object test, Object... in)
{
if (in[0] == test && in[1] instanceof EntityPlayerMP)
{
AchievementPage page = (AchievementPage) test;
StatisticsFile file = ((EntityPlayerMP) in[1]).func_147099_x();
for (Achievement a : page.getAchievements())
{
if (!file.hasAchievementUnlocked(a) && a != in[2] && (!(a instanceof Ach) || (((Ach)a).parent.achievementSource != this || !((Ach)a).parent.required.equals(page.getName()))))
{
return false;
}
}
return true;
}
return false;
}
开发者ID:tterrag1098,项目名称:CustomThings,代码行数:19,代码来源:AchievementType.java
示例3: ServerConfigurationManager
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
public ServerConfigurationManager(MinecraftServer server)
{
this.bannedPlayers = new UserListBans(FILE_PLAYERBANS);
this.bannedIPs = new BanList(FILE_IPBANS);
this.ops = new UserListOps(FILE_OPS);
this.whiteListedPlayers = new UserListWhitelist(FILE_WHITELIST);
this.playerStatFiles = Maps.<UUID, StatisticsFile>newHashMap();
this.mcServer = server;
this.bannedPlayers.setLanServer(false);
this.bannedIPs.setLanServer(false);
this.maxPlayers = 8;
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:ServerConfigurationManager.java
示例4: writePlayerData
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
/**
* also stores the NBTTags if this is an intergratedPlayerList
*/
protected void writePlayerData(EntityPlayerMP playerIn)
{
this.playerNBTManagerObj.writePlayerData(playerIn);
StatisticsFile statisticsfile = (StatisticsFile)this.playerStatFiles.get(playerIn.getUniqueID());
if (statisticsfile != null)
{
statisticsfile.saveStatFile();
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:ServerConfigurationManager.java
示例5: onCreated
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@Override
public void onCreated(ItemStack stack, World world, EntityPlayer _player) {
EntityPlayerMP player = (EntityPlayerMP) _player;
NBTTagCompound tag = ItemUtil.getTag(stack);
String ownerId = player.getGameProfile().getId().toString();
String ownerName = player.getName();
StatisticsFile stats = StatUtil.getStatsFile(player);
if (stats == null) return;
int deaths = getDeaths(player);
tag.setString("ownerId", ownerId);
tag.setString("ownerName", ownerName);
tag.setInteger("deathId", deaths);
}
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:15,代码来源:ItemPotency.java
示例6: login
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@SubscribeEvent
public void login(PlayerEvent.PlayerLoggedInEvent event) {
EntityPlayer player = event.player;
StatisticsFile statsFile = StatUtil.getStatsFile(player);
if (statsFile == null) return;
if (StatUtil.load(player, lastArtifact).get() <= 0) {
resetArtifactDelay(player);
} else {
poke(player, true);
}
}
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:12,代码来源:InspirationManager.java
示例7: getStatsFile
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
public static StatisticsFile getStatsFile(EntityPlayer player) {
MinecraftServer server = MinecraftServer.getServer();
if (server == null) return null;
ServerConfigurationManager cm = server.getConfigurationManager();
if (cm == null) return null;
return cm.getPlayerStatsFile(player);
}
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:8,代码来源:StatUtil.java
示例8: breakBlock
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@SubscribeEvent
public void breakBlock(BlockEvent.BreakEvent event) {
if (event.world.rand.nextInt(32) != 0 && !Core.dev_environ) return;
EntityPlayer ply = event.getPlayer();
if (!(ply instanceof EntityPlayerMP) || ply instanceof FakePlayer) {
return;
}
EntityPlayerMP player = (EntityPlayerMP) ply;
if (player.theItemInWorldManager.getGameType() == WorldSettings.GameType.CREATIVE) return;
String name = player.getName();
if (!needyPlayers.contains(name)) {
return;
}
StatisticsFile sfw = StatUtil.getStatsFile(player);
if (sfw == null) return;
if (!sfw.hasAchievementUnlocked(AchievementList.diamonds)) {
return;
}
Item toGive = getGivenItem();
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
ItemStack is = player.inventory.getStackInSlot(i);
if (is == null) continue;
if (is.getItem() == toGive) {
Core.logInfo("%s already had an Colossus Guide, so won't give another one", player);
setGivenBook(player);
return;
}
}
Coord broke = new Coord(event.world, event.pos);
if (!safeArea(broke)) return;
broke.spawnItem(new ItemStack(toGive));
setGivenBook(player);
Core.logInfo("Giving %s a colossus guide", name);
}
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:36,代码来源:DistributeDocs.java
示例9: digestManwhich
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@SubscribeEvent
public void digestManwhich(PlayerEvent.Clone event) {
if (!event.wasDeath) return;
if (event.original.worldObj.getGameRules().getBoolean("keepInventory")) return;
EntityPlayer player = event.entityPlayer;
StatisticsFile stats = StatUtil.getStatsFile(player);
if (stats == null) return;
StatUtil.IFzStat stat = StatUtil.load(player, manwhichStatus);
if (stat.get() > 0) {
stat.add(-1);
stat.sync();
}
}
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:14,代码来源:ItemManSandwich.java
示例10: onAchievement
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@SubscribeEvent
public void onAchievement(AchievementEvent event) {
StatisticsFile file = ((EntityPlayerMP) event.entityPlayer).func_147099_x();
if (!event.entity.worldObj.isRemote && file.canUnlockAchievement(event.achievement) && !file.hasAchievementUnlocked(event.achievement)
&& ConfigHandler.betterAchievements) {
event.entityPlayer.getEntityData().setInteger("fireworksLeft", 9);
event.entityPlayer.getEntityData().setBoolean("fireworkDelay", false);
}
}
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:10,代码来源:FireworkHandler.java
示例11: writePlayerData
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
/**
* also stores the NBTTags if this is an intergratedPlayerList
*/
protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP)
{
this.playerNBTManagerObj.writePlayerData(par1EntityPlayerMP);
StatisticsFile var2 = (StatisticsFile)this.field_148547_k.get(par1EntityPlayerMP.getCommandSenderName());
if (var2 != null)
{
var2.func_150883_b();
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:14,代码来源:ServerConfigurationManager.java
示例12: getPlayerStatsFile
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
/**
* @author jamierocks - 28th October 2016
* @reason Use the global stats directory
*/
@Overwrite
public StatisticsFile getPlayerStatsFile(EntityPlayer playerIn) {
final UUID uuid = playerIn.getUniqueID();
StatisticsFile statisticsFile = this.playerStatFiles.get(uuid);
if (statisticsFile == null) {
statisticsFile = StatisticsHelper.getStatisticsFile(playerIn.getUniqueID(), playerIn.getName());
this.playerStatFiles.put(uuid, statisticsFile);
}
return statisticsFile;
}
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:17,代码来源:MixinServerConfigurationManager.java
示例13: writePlayerData
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
protected void writePlayerData(EntityPlayerMP p_72391_1_)
{
if (p_72391_1_.playerNetServerHandler == null) return;
this.playerNBTManagerObj.writePlayerData(p_72391_1_);
StatisticsFile statisticsfile = (StatisticsFile)this.field_148547_k.get(p_72391_1_.getUniqueID());
if (statisticsfile != null)
{
statisticsfile.func_150883_b();
}
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:13,代码来源:ServerConfigurationManager.java
示例14: triggerAchievement
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
private static void triggerAchievement(AchievementSource source, EntityPlayer player, Object... in)
{
if (!player.worldObj.isRemote && player instanceof EntityPlayerMP) // LP made me do it
{
for (AchievementType type : AchievementType.lookup.get(source))
{
if (source.matchesObject(type.sourceObj, in))
{
if (type.rewardStack != null)
{
StatisticsFile file = ((EntityPlayerMP) player).func_147099_x();
if (!file.hasAchievementUnlocked(type.achievement) && file.canUnlockAchievement(type.achievement))
{
ItemStack stack = type.rewardStack.copy();
if (type.rewardNBT != null) {
stack = ItemUtil.parseStringIntoItemStack(ItemUtil.getStringForItemStack(stack, true, true) + "$" + AchievementType.Template.format(type.rewardNBT, new AchievementData(type.achievement, player)));
}
if (!player.inventory.addItemStackToInventory(stack))
{
player.worldObj.spawnEntityInWorld(new EntityItem(player.worldObj, player.posX, player.posY, player.posZ,
type.rewardStack.copy()));
}
}
}
player.addStat(type.achievement, 1);
}
}
}
}
开发者ID:tterrag1098,项目名称:CustomThings,代码行数:30,代码来源:AchievementHandler.java
示例15: getPlayerStatsFile
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
public static StatisticsFile getPlayerStatsFile(EntityPlayer player) {
if (player instanceof EntityPlayerMP) {
return ((EntityPlayerMP) player).getStatFile();
}
MinecraftServer server = MinecraftServer.getServer();
if (server != null) {
return server.getConfigurationManager().getPlayerStatsFile(player);
}
return null;
}
开发者ID:warriordog,项目名称:BlazeLoader,代码行数:11,代码来源:ApiPlayer.java
示例16: onAchievement
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
@SubscribeEvent
public void onAchievement(AchievementEvent a){
if(Config.Achievements){
StatisticsFile player = ((EntityPlayerMP) a.entityPlayer).func_147099_x();
if(a.achievement.isAchievement() && player.canUnlockAchievement(a.achievement) && !player.hasAchievementUnlocked(a.achievement)){
TkIrc.toIrc.sendMessage(Config.cName,dePing(IRCBot.colorNick(a.entityPlayer.getCommandSenderName()))+" has just earned the achievement \""+a.achievement.func_150951_e().getUnformattedText()+"\"");
}
}
}
开发者ID:alekso56,项目名称:TkIrc,代码行数:10,代码来源:TkEvents.java
示例17: getStatFile
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
/**
* Gets the stats file for reading achievements
*/
public StatisticsFile getStatFile()
{
return this.statsFile;
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:EntityPlayerMP.java
示例18: func_147099_x
import net.minecraft.stats.StatisticsFile; //导入依赖的package包/类
public StatisticsFile func_147099_x()
{
return this.field_147103_bO;
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:EntityPlayerMP.java
注:本文中的net.minecraft.stats.StatisticsFile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论