mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-21 12:32:09 +00:00
- Init: Node Manipulator
This commit is contained in:
1 parent
3c8b5ad23a
commit
4ff4915c5a
11 files changed
+231
-13
No files matched your search
@@ -37,7 +37,7 @@ public class MultiTickEffectDispatcher {
|
||||
VortexDigInfo info = it.next();
|
||||
if(info.dimId != currentRenderWorld.provider.dimensionId) it.remove();
|
||||
info.renderTicks++;
|
||||
if(info.renderTicks > 7) it.remove();
|
||||
if(info.renderTicks > info.tickCap) it.remove();
|
||||
|
||||
Thaumcraft.proxy.boreDigFx(currentRenderWorld, info.tX, info.tY, info.tZ, info.oX, info.oY, info.oZ, info.blockInstance, info.meta);
|
||||
}
|
||||
@@ -60,8 +60,9 @@ public class MultiTickEffectDispatcher {
|
||||
private Block blockInstance;
|
||||
private int meta;
|
||||
private int renderTicks = 0;
|
||||
private int tickCap;
|
||||
|
||||
public VortexDigInfo(int dimId, int oX, int oY, int oZ, int tX, int tY, int tZ, Block blockInstance, int meta) {
|
||||
public VortexDigInfo(int dimId, int oX, int oY, int oZ, int tX, int tY, int tZ, Block blockInstance, int meta, int tickDuration) {
|
||||
this.dimId = dimId;
|
||||
this.oX = oX;
|
||||
this.oY = oY;
|
||||
@@ -71,6 +72,7 @@ public class MultiTickEffectDispatcher {
|
||||
this.tZ = tZ;
|
||||
this.blockInstance = blockInstance;
|
||||
this.meta = meta;
|
||||
this.tickCap = tickDuration;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package makeo.gadomancy.common.blocks;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.blocks.BlockStoneDevice;
|
||||
import thaumcraft.common.tiles.TileWandPedestal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
*
|
||||
* Created by HellFirePvP @ 26.10.2015 19:23
|
||||
*/
|
||||
public class BlockNodeManipulator extends BlockStoneDevice {
|
||||
|
||||
public BlockNodeManipulator() {
|
||||
setBlockName("blockNodeManipulator");
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
//iconPedestal[0]
|
||||
//iconWandPedestal[0]
|
||||
//iconWandPedestal[1]
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//TC stuff...
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
if(metadata == 5)
|
||||
return new TileNodeManipulator();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int rs) {
|
||||
int ret = super.getComparatorInputOverride(world, x, y, z, rs);
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileWandPedestal) return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
par3List.add(new ItemStack(par1, 1, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
//TODO DO!
|
||||
return super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
|
||||
}
|
||||
}
|
||||
@@ -168,6 +168,7 @@ public class GrowingNodeBehavior {
|
||||
}
|
||||
|
||||
public boolean updateBehavior(boolean needUpdate) {
|
||||
//TODO fix empty nodes...
|
||||
if(fixedNode != null && owningNode.ticksExisted % 3 == 0) {
|
||||
if(owningNode.getWorldObj().getBlock(fixedNode.xCoord, fixedNode.yCoord, fixedNode.zCoord) != RegisteredBlocks.blockNode ||
|
||||
owningNode.getWorldObj().getTileEntity(fixedNode.xCoord, fixedNode.yCoord, fixedNode.zCoord) == null ||
|
||||
@@ -209,7 +210,7 @@ public class GrowingNodeBehavior {
|
||||
PacketTCNodeBolt bolt = new PacketTCNodeBolt(ox + 0.5F, oy + 0.5F, oz + 0.5F, fx + 0.5F, fy + 0.5F, fz + 0.5F);
|
||||
PacketHandler.INSTANCE.sendToAllAround(bolt, point);
|
||||
|
||||
PacketAnimationAbsorb packet = new PacketAnimationAbsorb(ox, oy, oz, fx, fy, fz);
|
||||
PacketAnimationAbsorb packet = new PacketAnimationAbsorb(ox, oy, oz, fx, fy, fz, 7);
|
||||
PacketHandler.INSTANCE.sendToAllAround(packet, point);
|
||||
|
||||
world.markBlockForUpdate(fx, fy, fz);
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.util.Random;
|
||||
*
|
||||
* Created by HellFirePvP @ 21.10.2015 23:39
|
||||
*/
|
||||
public class TileExtendedNode extends TileNode {
|
||||
public class TileExtendedNode extends TileNode implements INode {
|
||||
|
||||
public int ticksExisted = 0;
|
||||
private ExtendedNodeType extendedNodeType;
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package makeo.gadomancy.common.blocks.tiles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.wands.IWandable;
|
||||
import thaumcraft.common.tiles.TileWandPedestal;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
*
|
||||
* Created by HellFirePvP @ 26.10.2015 20:16
|
||||
*/
|
||||
public class TileNodeManipulator extends TileWandPedestal implements IAspectContainer, IWandable {
|
||||
|
||||
public TileNodeManipulator() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound compound) {
|
||||
super.readCustomNBT(compound);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound compound) {
|
||||
super.writeCustomNBT(compound);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAspects(AspectList aspectList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerAccept(Aspect aspect) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addToContainer(Aspect aspect, int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(Aspect aspect, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(AspectList aspectList) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(Aspect aspect, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContain(AspectList aspectList) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int containerContains(Aspect aspect) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onWandRightClick(World world, ItemStack stack, EntityPlayer player, int i, int i2, int i3, int i4, int i5) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onWandRightClick(World world, ItemStack stack, EntityPlayer player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingWandTick(ItemStack stack, EntityPlayer player, int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWandStoppedUsing(ItemStack stack, World world, EntityPlayer player, int i) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package makeo.gadomancy.common.items;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import thaumcraft.common.blocks.BlockStoneDeviceItem;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
*
|
||||
* Created by HellFirePvP @ 27.10.2015 13:00
|
||||
*/
|
||||
public class ItemNodeManipulator extends BlockStoneDeviceItem {
|
||||
|
||||
public ItemNodeManipulator(Block par1) {
|
||||
super(par1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,16 +25,18 @@ public class PacketAnimationAbsorb implements IMessage, IMessageHandler<PacketAn
|
||||
|
||||
private int x, y, z;
|
||||
private int targetX, targetY, targetZ;
|
||||
private int tickCap;
|
||||
|
||||
public PacketAnimationAbsorb() {}
|
||||
|
||||
public PacketAnimationAbsorb(int x, int y, int z, int targetX, int targetY, int targetZ) {
|
||||
public PacketAnimationAbsorb(int x, int y, int z, int targetX, int targetY, int targetZ, int tickCap) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.targetX = targetX;
|
||||
this.targetY = targetY;
|
||||
this.targetZ = targetZ;
|
||||
this.tickCap = tickCap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,6 +47,7 @@ public class PacketAnimationAbsorb implements IMessage, IMessageHandler<PacketAn
|
||||
this.targetX = buf.readInt();
|
||||
this.targetY = buf.readInt();
|
||||
this.targetZ = buf.readInt();
|
||||
this.tickCap = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,6 +58,7 @@ public class PacketAnimationAbsorb implements IMessage, IMessageHandler<PacketAn
|
||||
buf.writeInt(targetX);
|
||||
buf.writeInt(targetY);
|
||||
buf.writeInt(targetZ);
|
||||
buf.writeInt(tickCap);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +67,7 @@ public class PacketAnimationAbsorb implements IMessage, IMessageHandler<PacketAn
|
||||
Block b = Minecraft.getMinecraft().theWorld.getBlock(p.targetX, p.targetY, p.targetZ);
|
||||
int md = Minecraft.getMinecraft().theWorld.getBlockMetadata(p.targetX, p.targetY, p.targetZ);
|
||||
MultiTickEffectDispatcher.VortexDigInfo info =
|
||||
new MultiTickEffectDispatcher.VortexDigInfo(Minecraft.getMinecraft().theWorld.provider.dimensionId, p.x, p.y, p.z, p.targetX, p.targetY, p.targetZ, b, md);
|
||||
new MultiTickEffectDispatcher.VortexDigInfo(Minecraft.getMinecraft().theWorld.provider.dimensionId, p.x, p.y, p.z, p.targetX, p.targetY, p.targetZ, b, md, p.tickCap);
|
||||
MultiTickEffectDispatcher.registerVortexDig(info);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -6,21 +6,24 @@ import makeo.gadomancy.common.blocks.BlockArcaneDropper;
|
||||
import makeo.gadomancy.common.blocks.BlockExtendedNodeJar;
|
||||
import makeo.gadomancy.common.blocks.BlockInfusionClaw;
|
||||
import makeo.gadomancy.common.blocks.BlockNode;
|
||||
import makeo.gadomancy.common.blocks.BlockNodeManipulator;
|
||||
import makeo.gadomancy.common.blocks.BlockRemoteJar;
|
||||
import makeo.gadomancy.common.blocks.BlockStickyJar;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileArcaneDropper;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNodeJar;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileRemoteJar;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
|
||||
import makeo.gadomancy.common.items.ItemBlockRemoteJar;
|
||||
import makeo.gadomancy.common.items.ItemNodeManipulator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.blocks.BlockStoneDeviceItem;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.tiles.TileInfusionMatrix;
|
||||
|
||||
@@ -47,6 +50,7 @@ public class RegisteredBlocks {
|
||||
public static BlockRemoteJar blockRemoteJar;
|
||||
public static BlockNode blockNode;
|
||||
public static BlockExtendedNodeJar blockExtendedNodeJar;
|
||||
public static BlockNodeManipulator blockNodeManipulator;
|
||||
|
||||
public static void init() {
|
||||
registerBlocks();
|
||||
@@ -65,6 +69,7 @@ public class RegisteredBlocks {
|
||||
blockRemoteJar = registerBlock(new BlockRemoteJar(), ItemBlockRemoteJar.class);
|
||||
blockNode = (BlockNode) new BlockNode().setBlockName("blockAiry");
|
||||
blockExtendedNodeJar = registerBlock(new BlockExtendedNodeJar());
|
||||
blockNodeManipulator = registerBlock(new BlockNodeManipulator(), ItemNodeManipulator.class);
|
||||
}
|
||||
|
||||
private static <T extends Block> T registerBlock(String name, T block) {
|
||||
@@ -97,6 +102,7 @@ public class RegisteredBlocks {
|
||||
registerTile(TileRemoteJar.class);
|
||||
registerTile(TileExtendedNode.class);
|
||||
registerTile(TileExtendedNodeJar.class);
|
||||
registerTile(TileNodeManipulator.class);
|
||||
}
|
||||
|
||||
private static void registerTile(Class<? extends TileEntity> tile, String name) {
|
||||
|
||||
@@ -81,17 +81,17 @@ public class RegisteredResearches {
|
||||
|
||||
researchGrowingNodes = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING", Gadomancy.MODID, new AspectList(), 2, 2, 5, new ResourceLocation("thaumcraft", "textures/misc/r_nodes.png"))
|
||||
.setSpecial().setLost()
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING.1"), new ResearchPage("gadomancy.research_page.GROWING.2"));//.registerResearchItem();
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING.1"), new ResearchPage("gadomancy.research_page.GROWING.2")).registerResearchItem();
|
||||
|
||||
researchGrowingNodeAgression = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", Gadomancy.MODID, new AspectList(), 5, 3, 6, new ItemStack(ConfigBlocks.blockAiry, 1, 5))
|
||||
.setLost()
|
||||
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING")
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING_AGGRESSION.1"));//.registerResearchItem();
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING_AGGRESSION.1")).registerResearchItem();
|
||||
|
||||
researchGrowingNodeGrowth = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", Gadomancy.MODID, new AspectList(), 3, 5, 6, new ResourceLocation("thaumcraft", "textures/misc/r_nodes_2.png"))
|
||||
.setLost()
|
||||
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING")
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING_GROWTH.1"), new ResearchPage("gadomancy.research_page.GROWING_GROWTH.2"));//.registerResearchItem();
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING_GROWTH.1"), new ResearchPage("gadomancy.research_page.GROWING_GROWTH.2")).registerResearchItem();
|
||||
|
||||
researchGrowingNodeGrowthClue = new ResearchItem(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTHCLUE", Gadomancy.MODID,
|
||||
new AspectList().add(Aspect.AURA, 10).add(Aspect.MAGIC, 15).add(Aspect.ELDRITCH, 5).add(Aspect.VOID, 12).add(Aspect.ENERGY, 12).add(Aspect.ENTROPY, 8).add(Aspect.DEATH, 3)
|
||||
@@ -99,9 +99,9 @@ public class RegisteredResearches {
|
||||
6, 6, 2, new ItemStack(ConfigBlocks.blockAiry, 1, 0))
|
||||
.setSpecial().setRound().setConcealed()
|
||||
.setParents(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH")
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.1"), new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.2"));//.registerResearchItem();
|
||||
.setPages(new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.1"), new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.2")).registerResearchItem();
|
||||
|
||||
//ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTHCLUE", 3);
|
||||
ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTHCLUE", 3);
|
||||
}
|
||||
|
||||
public static void postInit() {
|
||||
|
||||
@@ -132,7 +132,7 @@ public class ExplosionHelper {
|
||||
Block b = world.getBlock(xx, yy, zz);
|
||||
float hardness = b.getBlockHardness(world, xx, yy, zz);
|
||||
if(b != Blocks.air && hardness > 0 && hardness <= 50 && b != RegisteredBlocks.blockNode) {
|
||||
PacketAnimationAbsorb absorb = new PacketAnimationAbsorb(x, y, z, xx, yy, zz);
|
||||
PacketAnimationAbsorb absorb = new PacketAnimationAbsorb(x, y, z, xx, yy, zz, 7);
|
||||
PacketHandler.INSTANCE.sendToAllAround(absorb, new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32D));
|
||||
pastTickBlocks.add(Vec3.createVectorHelper(xx, yy, zz));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user