本文整理汇总了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;
}
示例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");
}
示例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;
}
示例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);
}
}
}
示例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();
}
示例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()]);
}
示例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;
}
示例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;
}
示例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);
}
示例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"));
}
示例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;
}