当前位置: 首页>>代码示例>>Java>>正文


Java Aspect.getAspect方法代码示例

本文整理汇总了Java中thaumcraft.api.aspects.Aspect.getAspect方法的典型用法代码示例。如果您正苦于以下问题:Java Aspect.getAspect方法的具体用法?Java Aspect.getAspect怎么用?Java Aspect.getAspect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thaumcraft.api.aspects.Aspect的用法示例。


在下文中一共展示了Aspect.getAspect方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMessage

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
@Override
public IMessage onMessage(PacketTCNotificationText message, MessageContext ctx) {
    if(message.text == null) return null;
    String translated = StatCollector.translateToLocal(message.text);
    ResourceLocation image = null;
    int color = message.color;
    Aspect a = Aspect.getAspect(message.additionalInfo);
    if(a != null) {
        image = a.getImage();
        color = a.getColor();
    }
    if(message.text.equals("gadomancy.aura.research.unlock")) {
        if(a != null) {
            translated = EnumChatFormatting.GREEN + String.format(translated, a.getName());
        } else {
            translated = EnumChatFormatting.GREEN + String.format(translated, message.additionalInfo);
        }
    }
    color &= 0xFFFFFF;
    PlayerNotifications.addNotification(translated, image, color);
    return null;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:23,代码来源:PacketTCNotificationText.java

示例2: readCustomNBT

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
@Override
public void readCustomNBT(NBTTagCompound compound) {
    this.isInputTile = compound.getBoolean("input");
    this.isMasterTile = compound.getBoolean("master");

    String tag = compound.getString("aspect");
    if (tag != null && !tag.equals("")) {
        this.holdingAspect = Aspect.getAspect(tag);
    } else {
        this.holdingAspect = null;
    }
    this.amount = compound.getInteger("amount");
    this.maxAmount = compound.getInteger("maxAmount");
    this.isPartOfMultiblock = compound.getBoolean("partOfMultiblock");
    this.crystalEssentiaStack = NBTHelper.getStack(compound, "crystalStack");
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:17,代码来源:TileAuraPylon.java

示例3: recieveAspectData

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
private boolean recieveAspectData() {
    String rec = getDataWatcher().getWatchableObjectString(ModConfig.entityAuraCoreDatawatcherAspectsId);
    if(oldAspectDataSent == null || !this.oldAspectDataSent.equals(rec)) {
        oldAspectDataSent = rec;
    } else {
        return false;
    }

    if(rec.equals("")) return false;

    String[] arr = rec.split(SPLIT);
    if(arr.length != 6) throw new IllegalStateException("Server sent wrong Aura Data! '"
            + rec + "' Please report this error to the mod authors!");
    for (int i = 0; i < arr.length; i++) {
        String s = arr[i];
        Aspect a = Aspect.getAspect(s);
        effectAspects[i] = a;
    }
    return true;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:21,代码来源:EntityAuraCore.java

示例4: readFromNBT

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound nbtTagCompound) {
    this.isSaturated = nbtTagCompound.getBoolean("overallSaturated");
    this.overallHappiness = nbtTagCompound.getDouble("overallHappiness");

    if(nbtTagCompound.hasKey("lastFed")) {
        this.lastFedAspect = Aspect.getAspect(nbtTagCompound.getString("lastFedAspect"));
        this.lastFedRow = nbtTagCompound.getInteger("lastFedRow");
    }

    NBTTagList list = nbtTagCompound.getTagList("saturationValues", 10);
    for (int i = 0; i < list.tagCount(); i++) {
        NBTTagCompound aspectCompound = list.getCompoundTagAt(i);
        String name = aspectCompound.getString("aspectName");
        double saturation = aspectCompound.getDouble("aspectSaturation");
        Aspect a = Aspect.getAspect(name);
        if(a != null) {
            aspectSaturation.put(a, saturation);
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:21,代码来源:GrowingNodeBehavior.java

示例5: playerRenderEvent

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void playerRenderEvent(EntityPlayer player, float partialTicks) {
    String ownerName = player.getCommandSenderName();
    if(!clientFamiliars.containsKey(ownerName)) return;

    ExFamiliarData data = clientFamiliars.get(ownerName);
    PartialEntityFamiliar fam = data.familiar;

    Aspect aspect = Aspect.getAspect(data.data.aspectTag);

    if(ENTITY_WISP == null) ENTITY_WISP = new EntityWisp(new FakeWorld());
    ENTITY_WISP.setType(aspect.getTag());
    ENTITY_WISP.ticksExisted = fam.dummyEntity.ticksExisted;
    GL11.glPushMatrix();
    if(fam.owner == null || fam.owner.get() == null) {
        fam.owner = new WeakReference<EntityPlayer>(player);
    }
    EntityPlayer current = Minecraft.getMinecraft().thePlayer;
    double diffX = fam.renderX - current.posX + player.posX;
    double diffY = fam.renderY - current.posY + player.posY + 0.5;
    double diffZ = fam.renderZ - current.posZ + player.posZ;

    String currentPl = current.getCommandSenderName();
    String otherPl = player.getCommandSenderName();

    if(!currentPl.equals(otherPl)) {
        diffY += 1.32;

        EntityLivingBase entity = Minecraft.getMinecraft().renderViewEntity;
        diffX -= ((entity.posX - entity.lastTickPosX) * partialTicks);
        diffY -= ((entity.posY - entity.lastTickPosY) * partialTicks);
        diffZ -= ((entity.posZ - entity.lastTickPosZ) * partialTicks);
    }

    ItemRenderFamiliar.renderEntityWispFor(fam.owner.get(), ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks);
    GL11.glPopMatrix();
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:38,代码来源:FamiliarHandlerClient.java

示例6: refactorAspects

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
private static String[] refactorAspects(String listOfAspects) {
    List<String> aspects = new ArrayList<String>();
    if(listOfAspects != null && listOfAspects.length() > 0) {
        String[] aspectTags = listOfAspects.split(",");
        for (String s : aspectTags) {
            if(Aspect.getAspect(s) != null) aspects.add(s);
        }
    }
    return aspects.toArray(new String[aspects.size()]);
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:11,代码来源:ModConfig.java

示例7: getAspectList

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
public static AspectList getAspectList(NBTTagCompound compound, String tag, AspectList defaultValue) {
    if(!compound.hasKey(tag)) return defaultValue;
    NBTTagCompound cmp = compound.getCompoundTag(tag);
    AspectList out = new AspectList();
    for (Object key : cmp.func_150296_c()) {
        String strKey = (String) key;
        Aspect a = Aspect.getAspect(strKey);
        if(a != null) {
            out.add(a, cmp.getInteger(strKey));
        }
    }
    return out;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:14,代码来源:NBTHelper.java

示例8: createAuraFakeAspect

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
private static Aspect createAuraFakeAspect(String tag) {
    Aspect original = Aspect.getAspect(tag);
    if(original == null) return null;
    String fakeTemp = "GADOMANCY_TEMP_" + tag;

    Aspect fake = new FakeAspect(fakeTemp, original.getColor(), null, original.getImage(), original.getBlend(), true);
    fake.setTag(original.getTag());
    return fake;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:10,代码来源:ResearchPageAuraAspects.java

示例9: getFamiliarAspect

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
public static Aspect getFamiliarAspect(ItemStack stack) {
    if(stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar)) return null;
    String tag = NBTHelper.getData(stack).getString("aspect");
    if(tag == null || tag.equalsIgnoreCase("")) return null;
    return Aspect.getAspect(tag);
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:7,代码来源:ItemEtherealFamiliar.java

示例10: getAspect

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
public Aspect getAspect(ItemStack stack) {
    if(!hasAspect(stack)) return null;
    if(stack == null || !(stack.getItem() instanceof ItemFamiliar_Old)) return null;
    if(!stack.hasTagCompound() || !stack.getTagCompound().hasKey("aspect")) return null;
    return Aspect.getAspect(stack.getTagCompound().getString("aspect"));
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:7,代码来源:ItemFamiliar_Old.java

示例11: hasAspect

import thaumcraft.api.aspects.Aspect; //导入方法依赖的package包/类
public boolean hasAspect(ItemStack stack) {
    if(stack == null || !(stack.getItem() instanceof ItemFamiliar_Old)) return false;
    if(!stack.hasTagCompound() || !stack.getTagCompound().hasKey("aspect")) return false;
    return Aspect.getAspect(stack.getTagCompound().getString("aspect")) != null;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:6,代码来源:ItemFamiliar_Old.java


注:本文中的thaumcraft.api.aspects.Aspect.getAspect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。