thaumcraft.api.nodes.NodeModifier Java Examples
The following examples show how to use
thaumcraft.api.nodes.NodeModifier.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ItemNodeRenderer.java From Gadomancy with GNU Lesser General Public License v3.0 | 6 votes |
public static void renderNodeItem(IItemRenderer.ItemRenderType type, ItemStack item, AspectList aspects, NodeType nodeType, NodeModifier nodeModifier, Object... data) { if (type == IItemRenderer.ItemRenderType.ENTITY) { GL11.glTranslatef(-0.5F, -0.25F, -0.5F); } else if ((type == IItemRenderer.ItemRenderType.EQUIPPED) && ((data[1] instanceof EntityPlayer))) { GL11.glTranslatef(0.0F, 0.0F, -0.5F); } TileNode tjf = new TileNode(); tjf.setAspects(aspects); tjf.setNodeType(nodeType); tjf.blockType = ConfigBlocks.blockAiry; tjf.blockMetadata = 0; GL11.glPushMatrix(); GL11.glTranslated(0.5D, 0.5D, 0.5D); GL11.glScaled(2.0D, 2.0D, 2.0D); renderItemNode(tjf); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); renderItemNode(tjf); GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); renderItemNode(tjf); GL11.glPopMatrix(); GL11.glEnable(32826); }
Example #2
Source File: RegisteredManipulations.java From Gadomancy with GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean affect(World world, INode node) { if(node.getNodeModifier() == null) { node.setNodeModifier(NodeModifier.BRIGHT); return true; } switch (node.getNodeModifier()) { case BRIGHT: return false; case PALE: node.setNodeModifier(null); break; case FADING: node.setNodeModifier(NodeModifier.PALE); break; } return true; }
Example #3
Source File: RegisteredManipulations.java From Gadomancy with GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean affect(World world, INode node) { if(node.getNodeModifier() == null) { node.setNodeModifier(NodeModifier.PALE); return true; } switch (node.getNodeModifier()) { case BRIGHT: node.setNodeModifier(null); break; case PALE: node.setNodeModifier(NodeModifier.FADING); break; case FADING: return false; } return true; }
Example #4
Source File: TileExtendedNodeJar.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
public void readCustomNBT(NBTTagCompound nbttagcompound) { this.aspects.readFromNBT(nbttagcompound); this.id = nbttagcompound.getString("nodeId"); AspectList al = new AspectList(); NBTTagList tlist = nbttagcompound.getTagList("AspectsBase", 10); for (int j = 0; j < tlist.tagCount(); j++) { NBTTagCompound rs = tlist.getCompoundTagAt(j); if (rs.hasKey("key")) { al.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount")); } } Short oldBase = nbttagcompound.getShort("nodeVisBase"); this.aspectsBase = new AspectList(); if ((oldBase > 0) && (al.size() == 0)) { for (Aspect a : this.aspects.getAspects()) { this.aspectsBase.merge(a, oldBase); } } else { this.aspectsBase = al.copy(); } setNodeType(NodeType.values()[nbttagcompound.getByte("type")]); byte mod = nbttagcompound.getByte("modifier"); if(mod >= 0) setNodeModifier(NodeModifier.values()[mod]); else setNodeModifier(null); byte exType = nbttagcompound.getByte("extendedNodeType"); if(exType >= 0) setExtendedNodeType(ExtendedNodeType.values()[exType]); else setExtendedNodeType(null); if(nbttagcompound.hasKey("Behavior")) { behaviorSnapshot = nbttagcompound.getCompoundTag("Behavior"); } }
Example #5
Source File: ItemExtendedNodeJar.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
public void setNodeAttributes(ItemStack itemstack, NodeType type, NodeModifier mod, ExtendedNodeType extendedNodeType, String id) { if (!itemstack.hasTagCompound()) { itemstack.setTagCompound(new NBTTagCompound()); } itemstack.setTagInfo("nodetype", new NBTTagInt(type.ordinal())); if (mod != null) { itemstack.setTagInfo("nodemod", new NBTTagInt(mod.ordinal())); } if(extendedNodeType != null) { itemstack.setTagInfo("nodeExMod", new NBTTagInt(extendedNodeType.ordinal())); } itemstack.setTagInfo("nodeid", new NBTTagString(id)); }
Example #6
Source File: ItemCreativeNode.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
@Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { ForgeDirection dir = ForgeDirection.getOrientation(side); x += dir.offsetX; y += dir.offsetY; z += dir.offsetZ; if(placeRandomNode(world, x, y, z)) { int metadata = stack.getItemDamage(); TileNode node = (TileNode) world.getTileEntity(x, y, z); if(metadata == 0) { node.setNodeType(NodeType.NORMAL); node.setNodeModifier(NodeModifier.BRIGHT); AspectList aspects = new AspectList(); for(Aspect primal : Aspect.getPrimalAspects()) { aspects.add(primal, 500); } node.setAspects(aspects); node.markDirty(); world.markBlockForUpdate(x, y, z); } else { node.setNodeType(NodeType.values()[metadata]); } return true; } return false; }
Example #7
Source File: WandHandler.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
private static void handleJarForming(World world, int x, int y, int z, int xx, int yy, int zz, boolean degrade) { TileEntity tile = world.getTileEntity(x + xx, y - yy + 2, z + zz); INode node = (INode) tile; AspectList na = node.getAspects().copy(); int nt = node.getNodeType().ordinal(); int nm = -1; int exNt = -1; NBTTagCompound behaviorSnapshot = null; if (node.getNodeModifier() != null) { nm = node.getNodeModifier().ordinal(); } if(tile instanceof TileExtendedNode && ((TileExtendedNode) tile).getExtendedNodeType() != null) { exNt = ((TileExtendedNode) tile).getExtendedNodeType().ordinal(); behaviorSnapshot = ((TileExtendedNode) tile).getBehaviorSnapshot(); } if(degrade) { if (world.rand.nextFloat() < 0.75F) { if (node.getNodeModifier() == null) { nm = NodeModifier.PALE.ordinal(); } else if (node.getNodeModifier() == NodeModifier.BRIGHT) { nm = -1; } else if (node.getNodeModifier() == NodeModifier.PALE) { nm = NodeModifier.FADING.ordinal(); } } } String nid = node.getId(); node.setAspects(new AspectList()); world.removeTileEntity(x + xx, y - yy + 2, z + zz); if(exNt != -1) { world.setBlock(x + xx, y - yy + 2, z + zz, RegisteredBlocks.blockExtendedNodeJar, 0, 3); tile = world.getTileEntity(x + xx, y - yy + 2, z + zz); TileExtendedNodeJar exJar = (TileExtendedNodeJar) tile; exJar.setAspects(na); if (nm >= 0) { exJar.setNodeModifier(NodeModifier.values()[nm]); } exJar.setNodeType(NodeType.values()[nt]); exJar.setExtendedNodeType(ExtendedNodeType.values()[exNt]); if(behaviorSnapshot != null) { exJar.setBehaviorSnapshot(behaviorSnapshot); } exJar.setId(nid); world.addBlockEvent(x + xx, y - yy + 2, z + zz, RegisteredBlocks.blockExtendedNodeJar, 9, 0); } else { world.setBlock(x + xx, y - yy + 2, z + zz, ConfigBlocks.blockJar, 2, 3); tile = world.getTileEntity(x + xx, y - yy + 2, z + zz); TileJarNode jar = (TileJarNode) tile; jar.setAspects(na); if (nm >= 0) { jar.setNodeModifier(NodeModifier.values()[nm]); } jar.setNodeType(NodeType.values()[nt]); jar.setId(nid); world.addBlockEvent(x + xx, y - yy + 2, z + zz, ConfigBlocks.blockJar, 9, 0); } }
Example #8
Source File: TileExtendedNodeJar.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
public void setNodeModifier(NodeModifier nodeModifier) { this.nodeModifier = nodeModifier; }
Example #9
Source File: TileExtendedNodeJar.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
public NodeModifier getNodeModifier() { return this.nodeModifier; }
Example #10
Source File: RegisteredManipulations.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
@Override public boolean canAffect(World world, INode node) { return node.getNodeModifier() != NodeModifier.BRIGHT; }
Example #11
Source File: RegisteredManipulations.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
@Override public boolean canAffect(World world, INode node) { return node.getNodeModifier() != NodeModifier.FADING; }
Example #12
Source File: ItemExtendedNodeJar.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
public NodeModifier getNodeModifier(ItemStack itemstack) { if ((!itemstack.hasTagCompound()) || (!itemstack.getTagCompound().hasKey("nodemod"))) { return null; } return NodeModifier.values()[itemstack.getTagCompound().getInteger("nodemod")]; }
Example #13
Source File: AdapterNode.java From OpenPeripheral-Integration with MIT License | 4 votes |
@ScriptCallable(returnTypes = ReturnType.STRING, description = "Get the modifier of the node") public String getNodeModifier(INode node) { NodeModifier nodeModifier = node.getNodeModifier(); return (nodeModifier != null? nodeModifier.name() : NONE); }
Example #14
Source File: TileEntityPortableNode.java From Electro-Magic-Tools with GNU General Public License v3.0 | 4 votes |
@Override public NodeModifier getNodeModifier() { return NodeModifier.FADING; }