Jump to content

KeeganDeathman

Forge Modder
  • Posts

    434
  • Joined

  • Last visited

Everything posted by KeeganDeathman

  1. The pipe block has this code: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float par6, float par7, float par8) { if(!world.isRemote) { TileEntity tile = world.getTileEntity(x, y, z); if(tile instanceof TileEntityLiquid) { player.addChatMessage(new ChatComponentText("Network is holding " + ((TileEntityLiquid)tile).getTankInfo(ForgeDirection.UNKNOWN)[0].fluid.amount)); return true; } return false; } return false; }
  2. So, trying to make some pipes. Well it works great! You just can't go west. If you go west, 1000 becomes some random negative value. Hmmm. @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { if (worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) instanceof TileEntityLiquid && from != ForgeDirection.EAST && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) != null) { ((TileEntityLiquid) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord)).fill(ForgeDirection.WEST, resource.copy(), doFill); } if (worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) instanceof TileEntityLiquid && from != ForgeDirection.WEST && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) != null) { ((TileEntityLiquid) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord)).fill(ForgeDirection.EAST, resource.copy(), doFill); } if (worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) instanceof TileEntityLiquid && from != ForgeDirection.UP && worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) != null) { ((TileEntityLiquid) worldObj.getTileEntity(xCoord, yCoord + 1, zCoord)).fill(ForgeDirection.DOWN, resource.copy(), doFill); } if (worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) instanceof TileEntityLiquid && from != ForgeDirection.DOWN && worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) != null) { ((TileEntityLiquid) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord)).fill(ForgeDirection.UP, resource.copy(), doFill); } if (worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) instanceof TileEntityLiquid && from != ForgeDirection.SOUTH && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) != null) { ((TileEntityLiquid) worldObj.getTileEntity(xCoord, yCoord, zCoord + 1)).fill(ForgeDirection.NORTH, resource.copy(), doFill); } if (worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) instanceof TileEntityLiquid && from != ForgeDirection.NORTH && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) != null) { ((TileEntityLiquid) worldObj.getTileEntity(xCoord, yCoord, zCoord - 1)).fill(ForgeDirection.SOUTH, resource.copy(), doFill); } return tank.fill(resource, doFill); } clarification, each pipe has it's own tank, but they are all symbolic to the "network tank." Basically, if theres 1000 buckets in the network, each pipe has 1000 buckets in it's tank. Fill and drain commands are networked across all pipes. Draw 1 mB from 1 pipe, all pipes go down 1 mB. Any help?
  3. It seemed to have been a problem with the classpath. My empty forge project launched and ran fine. By copying the classpath file and adding in extras(the forge project and an api folder) to my mod project, I was able to fix it.
  4. I have a strange problem in eclipse (No external mods) [19:25:42] [server thread/INFO]: Changing view distance to 12, from 10 [19:25:42] [Netty Client IO #0/ERROR] [FML]: NetworkDispatcher exception java.lang.NoSuchMethodError: io.netty.channel.ChannelHandlerContext.read()Lio/netty/channel/ChannelOutboundInvoker; at cpw.mods.fml.common.network.handshake.NetworkDispatcher.read(NetworkDispatcher.java:425) ~[NetworkDispatcher.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeRead(DefaultChannelHandlerContext.java:619) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.read(DefaultChannelHandlerContext.java:600) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.read(DefaultChannelPipeline.java:872) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.AbstractChannel.read(AbstractChannel.java:224) [AbstractChannel.class:4.0.15.Final] at io.netty.channel.DefaultChannelConfig.setAutoRead(DefaultChannelConfig.java:270) [DefaultChannelConfig.class:4.0.15.Final] at net.minecraft.network.NetworkManager.setConnectionState(NetworkManager.java:93) [NetworkManager.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.clientListenForServerHandshake(NetworkDispatcher.java:170) [NetworkDispatcher.class:?] at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$1.accept(FMLHandshakeClientState.java:35) [FMLHandshakeClientState$1.class:?] at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$1.accept(FMLHandshakeClientState.java:29) [FMLHandshakeClientState$1.class:?] at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.userEventTriggered(HandshakeMessageHandler.java:40) [HandshakeMessageHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:309) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:295) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108) [ChannelInboundHandlerAdapter.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:309) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:295) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108) [ChannelInboundHandlerAdapter.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeUserEventTriggered(DefaultChannelHandlerContext.java:309) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireUserEventTriggered(DefaultChannelHandlerContext.java:295) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireUserEventTriggered(DefaultChannelPipeline.java:779) [DefaultChannelPipeline.class:4.0.15.Final] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handlerAdded(NetworkDispatcher.java:137) [NetworkDispatcher.class:?] at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:484) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.callHandlerAdded(DefaultChannelPipeline.java:479) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addBefore0(DefaultChannelPipeline.java:178) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:163) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:153) [DefaultChannelPipeline.class:4.0.15.Final] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.insertIntoChannel(NetworkDispatcher.java:124) [NetworkDispatcher.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.clientToServerHandshake(NetworkDispatcher.java:129) [NetworkDispatcher.class:?] at cpw.mods.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(FMLNetworkHandler.java:66) [FMLNetworkHandler.class:?] at net.minecraft.client.network.NetHandlerLoginClient.handleLoginSuccess(NetHandlerLoginClient.java:107) [NetHandlerLoginClient.class:?] at net.minecraft.network.login.server.S02PacketLoginSuccess.processPacket(S02PacketLoginSuccess.java:49) [s02PacketLoginSuccess.class:?] at net.minecraft.network.login.server.S02PacketLoginSuccess.processPacket(S02PacketLoginSuccess.java:66) [s02PacketLoginSuccess.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:124) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:379) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:312) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.7.0_79] [19:25:43] [Netty Client IO #0/ERROR] [FML]: NetworkDispatcher exception java.lang.NoSuchMethodError: io.netty.channel.ChannelHandlerContext.read()Lio/netty/channel/ChannelOutboundInvoker; at cpw.mods.fml.common.network.handshake.NetworkDispatcher.read(NetworkDispatcher.java:425) ~[NetworkDispatcher.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeRead(DefaultChannelHandlerContext.java:619) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.read(DefaultChannelHandlerContext.java:600) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.read(DefaultChannelPipeline.java:872) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelReadComplete(DefaultChannelPipeline.java:793) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:314) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.7.0_79] [19:25:43] [server thread/ERROR]: Encountered an unexpected exception net.minecraft.util.ReportedException: Ticking memory connection at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Caused by: java.util.NoSuchElementException: packet_handler at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:905) ~[DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:160) ~[DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:153) ~[DefaultChannelPipeline.class:4.0.15.Final] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.insertIntoChannel(NetworkDispatcher.java:124) ~[NetworkDispatcher.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.serverToClientHandshake(NetworkDispatcher.java:117) ~[NetworkDispatcher.class:?] at cpw.mods.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(FMLNetworkHandler.java:60) ~[FMLNetworkHandler.class:?] at net.minecraft.server.network.NetHandlerLoginServer.func_147326_c(NetHandlerLoginServer.java:105) ~[NetHandlerLoginServer.class:?] at net.minecraft.server.network.NetHandlerLoginServer.onNetworkTick(NetHandlerLoginServer.java:64) ~[NetHandlerLoginServer.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:244) ~[NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?] ... 5 more I can't seem to figure out whats happening.
  5. Would you be interested in a class that you can use in your mood that will allow you to run one command and have all required json files created and registered for you, or is that not needed, or already exist.
  6. Didn't think that would work due to lack of knowledge of when things are intialized cointainer wise(thought it was on first use of container). Did it and it worked, thanks anyway.
  7. Hey, for my purposes I need to be able to 'enable' the ability to use a slot in my container when a boolean in the tile entity is true. Any ideas?
  8. dependencies { compile fileTree(dir: 'api', include: ['*.jar']) } dependencies { compile files('api/mod1.jar', 'api/mod2.jar') } dependencies { compile files("api/mod1.jar"), compile files("api/mod2.jar") }
  9. Salut mon amies. Okay, back to english. I am having troubles building my mod which requires some dependencies. I have tried most everything.
  10. Okay, according to Whov's tut, the tile entity is remade in the part class, but your function returns a TileMultipart. Did Whov do it wrong?
  11. Thanks, I'll try and translate that into Java
  12. Oh silly child. EnergyStorage storage; I mean you need to create an EnergyStorage in your IEnergyReceiver
  13. No, you have to actually start using the energy, and only allowing the block to function if you have enough energy! For one, you need an EnergyStorage. Think of it like the code representation of the machines internal buffer, because it is! you'll also want a couple functions. getMaxEnergyStored() - How much energy your buffer can hold. I have two, the public overwritten one, and a protected one, I use for initializing the storage constructer - don't forget to intitalize the storage! It takes one parameter, the max storage receiveEnergy() - just call storage.receiveEnergy() extractEnergy() - see above getEnergyStored() - see above updateEntity() - or wherever you're handling the functions of the machine. Add in an extra if. if(storage.extractEnergy(500, true)) { storage.extractEnergy(500, false); ... } extractEnergy takes two params, the amount, and whether it's a simulation, basically are we checking if we can extract that much. You could also see if getEnergyStored is greater than or equal to your amount, but this is simpler. 500 is the amount, you can change that. Have fun!
  14. New APIs, so fun. I'm attempting to get my ribbon cable multipart to function as a cable, but my method requires being able to access the next block, see if it's a cable, if it is, look at it's values. But thing is, neither world.getBlock or world.getTileEntity work. So how would I go about interacting with nearby multiparts and their tile entities, I have yet to find something equivalent to worlds functions
  15. Seems I got that backwards Changed the block bounds back and shrank the part and were good!
  16. Yes, so what Im getting here is that I should make the bounding boxes small enough to fit other cables in, but leave the part size the same? I've always kept them the same. Ill try it
  17. Collides? It's flatter than a cover, because I'm trying to make ribbon cables Anyway, I want to be able for there to be (potentially) a ribbon cable on every surface of a room or enclosed space. That help? My github is updated now
  18. Yes I'm using FMP. I was following Whov's tutorial, but I seem to have missed a step. I'll update my github real quick. github.com/KeeganDeathman/DeathmanLabsStuff
  19. I have a problem. My custom microblock won't support other micros intersecting it I know its possible but the lack of java tuts online is not helping Any help?
  20. Peachy. So the model is just for one face, and just render it multiple times per block.
  21. How would I go about making a cable like most of the ones from RedPower/ProjectRED I only know how to do ones like framed cables, where they're freestanding and take up a whole block But I want one where you need to have it on a block, and it doesn't automatically go up sides of blocks and stuff. Thanks, Keegan
  22. Then there you go! Like jabelar said, go look at the furnace. Or some source code of other mods. Everything is boolean logic, the rest is details.
  23. 1) the tile entity runs the updateEntity method 2) The method calculates whether a section of that pipe is or should be rendered by checking for appropriate blocks around it, and assigning booleans about that(up, down, east, west, north, south) we also save the current type to an oldType string 3) The if statements come in. First we weed out the invalid pipes, those going vertical. Then we check all legal configurations and assign the tubes "type," whether it be straight, ne, es, sw, or wn, or invalid, if it is illegal. Then we check if the type changed at all by comparing the oldType and current type. If so, we check if it's a corner or straight, and call the appropriate function on the next tube, based on a function that checks for a tube in order, posx, posz, negx, negz. It also checks 2 over on the Z in account of the detector core, which will always be on the z line. It also adds one to the apropiate internal counter of straights or corners, and updates the aporiate boolean of if it has(insertCornerTypeHere) if it is a corner 4)The addBlahBlah function adds one to the correct counter if it would match the source tubes count. If not, it finds the difference, and adds that. After that, it sees if the next tube doesn't have the right number, and calls the add function on that. All is saved to the NBT of the tile entity, where I can see if the function works. It appears all is well, but the add function doesn't seem to make it around corners.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.