Posted June 5, 20169 yr So this mod is my first time working with TileEntities. I cannot for the life of me figure this out. When I place down a block that implements IEnergyReceiver and then place my 'Battery' block next to it, it receives energy indefinitely. I set the energy to 10000 rf on the battery just for testing, but the other block (a furnace) just keeps adding rf. However if I place another furnace down and the battery has 'given' the 10k rf it holds it will not give any rf to the newer block. Here's a gif: http://p455w0rd.net/mc/p1.9te_weirdness.gif[/img] What is happening is the first furnace is taking the 10k rf from the battery, this is the reason for the pause. ( transfers @ 2k rf/t, so 0.5 second needs to pass). The second furnace is placed and no rf is added meaning something is kind of working. I know this is probably really simple, but I've been working on it for probably 3 days now with no ability to get it to stop transferring energy after the 10k the battery has is drained. The relevant TileEntities are: Battery: https://github.com/p455w0rd/p455w0rds1.9Things/blob/master/src/java/p455w0rd/p455w0rdsthings/blocks/tileentities/TileEntityBattery.java Furnace: https://github.com/p455w0rd/p455w0rds1.9Things/blob/master/src/java/p455w0rd/p455w0rdsthings/blocks/tileentities/TileEntityFurnace.java Also, before someone yells at me for it, I plan to convert to capabilities as soon as I get the RF working. SOLUTION don't be a nub like me and remember to register your new Packet messages http://p455w0rd.net/images/forumsignature.png[/img]
June 5, 20169 yr Author Okay, so I've added packet handling and I am trying to update the GUI via detectAndSendChanges in the applicable container..still not getting anything..it is my understanding that in my current situation, I only need for the Battery TE to implement ITickable and do the handling of giving out energy as the handleReceivingEnergy method in the Battery TE calls the corresponding TE's receiveEnergy method..so I extract from bettery TE and receive on the connected (adjacent) TE..I have updated the repo reflect most recent changes...I was told that I simply need to update the client side instance of EnergyStorage, which is what I'm trying to do in the packet, but it just isn't working http://p455w0rd.net/images/forumsignature.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.