Jump to content

AnZaNaMa

Forge Modder
  • Posts

    161
  • Joined

  • Last visited

Everything posted by AnZaNaMa

  1. Hi, I'm posting again. I've been working on the tech system in my mod and I currently working on pipes. These pipes are supposed to transfer energy out of any TileEntity that's a PowerProvider and into any TileEntity that's a PowerAcceptor. That seems to be working fairly well, except that when the pipe grabs energy from a PowerProvider, it is adding power to the pipe but not removing it from the Provider. Here's where the transferPower() function is called: https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/Entity/TileEntity/TileEntityPipe.java#L56 and here's the transferPower function: https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/api/Tech/PowerConnectable.java#L201
  2. yes, but they work in tandem using a PipeSystem and I need to save data from the PipeSystem object. Sorry heres a link to the code: PipeSystem: https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/api/Tech/PipeSystem.java Pipes: https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/Entity/TileEntity/TileEntityPipe.java
  3. So, I am making what I call a PipeSystem to transfer energy around using my mod. The problem is, I'm not sure how I can make it so that the pipe system works after the game has been unloaded and then opened again. The PipeSystem is an object-class that is created whenever a lone machine or pipe is placed. Then, when other eligible TileEntities are placed adjacent to TileEntities in the PipeSystem, they get added to the PipeSystem. I want to either save all the PipeSystems to a world NBT file with unique IDs if possible or somehow save it to the TileEntities themselves, but then I would be required to have a controller TileEntity to save the data in or save it to all of them, which would make for a lot of redundant data. I'd like to avoid having one block that controls the whole system. This isn't logisticspipes (no offense, I love that mod).
  4. good idea! thanks! I was trying to figure out how I could make it into a for loop, but with needing east, west, north, south, up, down, I couldn't figure it out.
  5. I feel like there is a way to simplify this method, but I can't figure out how. Any help is appreciated. public PowerConnectable[] getConnectedMachines(){ PowerConnectable[] machines = new PowerConnectable[]{null}; if(worldObj.getTileEntity(pos.east()) != null && worldObj.getTileEntity(pos.east()) instanceof PowerConnectable){ machines[0] = (PowerConnectable)worldObj.getTileEntity(pos.east()); } if(worldObj.getTileEntity(pos.west()) != null && worldObj.getTileEntity(pos.west()) instanceof PowerConnectable){ machines[machines.length] = (PowerConnectable)worldObj.getTileEntity(pos.west()); } if(worldObj.getTileEntity(pos.north()) != null && worldObj.getTileEntity(pos.north()) instanceof PowerConnectable){ machines[machines.length] = (PowerConnectable)worldObj.getTileEntity(pos.north()); } if(worldObj.getTileEntity(pos.south()) != null && worldObj.getTileEntity(pos.south()) instanceof PowerConnectable){ machines[machines.length] = (PowerConnectable)worldObj.getTileEntity(pos.south()); } if(worldObj.getTileEntity(pos.up()) != null && worldObj.getTileEntity(pos.up()) instanceof PowerConnectable){ machines[machines.length] = (PowerConnectable)worldObj.getTileEntity(pos.up()); } if(worldObj.getTileEntity(pos.down()) != null && worldObj.getTileEntity(pos.down()) instanceof PowerConnectable){ machines[machines.length] = (PowerConnectable)worldObj.getTileEntity(pos.down()); } return machines; }
  6. Even when I added worldObj.markBlockForUpdate() and this.markDirty() to the setStraight and setCorner functions, the blocks are still all rendering with the default texture. I even went into the setSlaveBlocks() function in TileEntityEnergizer and added a worldObj.markBlockRangeForRenderUpdate() and it still won't work.
  7. Oh yeah, I always try to forget networking exists because i'm terrible at it
  8. oh wow, i'm stupid. Thanks for the help! EDIT: Removing the static on the texturenumber and rotation just made it so that all of them get the default texture...
  9. I have a block that has a tile entity called EnergyBlock. I have bound its rendering to a TESR that is supposed to give it a different texture and rotation based on what its class says. However, all of them are rendering with the same texture and rotation, as if they're a block, not a TileEntity. They do, however, change texture when I make them part of the multiblock they are involved in, which means the TESR is in fact handling the rendering, just not well enough. What did I do wrong? TileEntityEnergyBlock: https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/Entity/TileEntity/TileEntityEnergyBlock.java EnergyBlockTESR: https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/Entity/TileEntity/TESR/EnergyBlockTESR.java
  10. oh okay. I had the gitignore before but I removed it thinking i would be able to reuse the files.
  11. So I had been working on my mod from my old laptop, but I'm trying to move it over now. The way I did it was just cloning my Github Repo (http://www.Github.com/AnZaNaMa/EnergyTools). When I move it over, I can set the JDK and get all the code to show up in intellij with no errors, but when I try to run the game from intellij, the window gives me this error: Error:Unable to make the module: EnergyTools, related gradle configuration was not found. Please, re-import the Gradle project and try again. I somehow got it working on my desktop last night, but now I can't get it to work on my Surface. Maybe someone who knows more about Gradle can help.
  12. For some reason, all of a sudden, my resources are broken and all my code works but my textures/models/graphics don't. I have checked to make sure the folder structure is right and the modid and folder name match up. Could someone take a look and see if they can figure out what is wrong? https://github.com/AnZaNaMa/EnergyTools
  13. So, I added pipes into my mod which are going to transfer energy between places, but the way I've been going about this is using what I call a PipeSystem. The constructor for PipeSystem contains 6 parameters: (int numPipes, int numProviders, int numAcceptors, TileEntityPipe[] pipes, PowerProvider[] providers, PowerAcceptor[] acceptors). Each pipe is linked to a pipe system and pipes automatically join pipe systems on construction if they are next to another pipe that has one. Each PowerConnectable (encompasses power providers, acceptors, and pipes) has a field PipeSystem pipeSystem. I need to save this object to NBT when the game is saved, but I have absolutely no idea how I would save a PipeSystem to NBT. Help
  14. Sorry for being dumb guys. I was using item.getUnlocalizedName in RenderRegister. This returns "item." before the actual unlocalizedName. I just made an IEnergyItem and IEnergyBlock that I applied to all of my blocks and items that forced them to have a function called getName(). Also, I checked if(item instanceof IEnergyItem) before I did the register().
  15. I have been checking and rechecking all my files and cross-referencing them with tutorials and other peoples' code (like GreyGhost) and everything required to make them render correctly is there. I have no idea why it's not working.
  16. Why the crap don't you just save these values in NBT...?
  17. BlockPos position = new BlockPos(x, y, z); world.setBlockState(position, ClassThatCreatesInstanceOfBlock.yourBlock.getDefaultState()); there is an optional 3rd parameter called flags, but I didn't look into it enough to see what it did.
  18. My mod used to be ExpTools. I have been working on my mod for a while and over time, I decided to change the name of the mod and use a system of energy instead of the player's experience. Because of this, I wanted to go through and change everything named Exp... or XP... to 'energy' for example, I have XPAxe and I changed it to EnergyAxe. I went through all the files and changed all references, even the models. The blocks render perfectly fine with the textures, but when they are items or I have any of my other items, the textures don't work at all and I can't figure out why. Here's the link to my mod repo: https://github.com/AnZaNaMa/EnergyTools Some Other Places you might want to look at: Item Package (specifically the RenderItemRegister.class): https://github.com/AnZaNaMa/EnergyTools/tree/master/src/main/java/com/AnZaNaMa/EnergyTools/Item Block Package (specifically the RenderBlockRegister.class): https://github.com/AnZaNaMa/EnergyTools/tree/master/src/main/java/com/AnZaNaMa/EnergyTools/Block Client Proxy (where all the rendering and registering textures stuff happens): https://github.com/AnZaNaMa/EnergyTools/blob/master/src/main/java/com/AnZaNaMa/EnergyTools/Proxy/ClientProxy.java Models: https://github.com/AnZaNaMa/EnergyTools/tree/master/src/main/resources/assets/energytools/models Textures: https://github.com/AnZaNaMa/EnergyTools/tree/master/src/main/resources/assets/energytools/textures Please help me figure out why the textures won't load. I've tried a lot of different things to make it work. I tried to be as specific as I could but It's not that much, because I don't know exactly where the problem lies.
  19. thanks diesieben and GreyGhost. I used the tutorial on the forge wiki to sync client and server and got it working.
  20. oh sorry i changed my code when i was troubleshooting. I originally had if(tileEntity instanceof TileEntityEnergizer){ TileEntityEnergizer energizer = (TileEntityEnergizer)tileEntity; if(energizer.getMultiblockSize() == 3){ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer2.png"); } else if(energizer.getMultiblockSize() == 5){ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer3.png"); } else if(energizer.getMultiblockSize() == 7){ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer4.png"); } else{ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer.png"); } }
  21. So, I have a tile entity called TileEntityEnergizer and I have a TESR that renders it just fine, but I want to have it change the texture based on the isMultiblock() and getMultiblockSize() properties of my TileEntityEnergizer. For some reason, when I print out isMultiblock() and getMultiblockSize() from the TESR, they end up with values they never should have, such as 0 for getMultiblockSize(). I know that the method updateTileEntityAt() is passing me a TileEntityEnergizer because I had it check it and it worked. I'm not sure why im not getting the correct values from my methods... TESR: https://github.com/AnZaNaMa/ExpTools/blob/master/src/main/java/com/AnZaNaMa/ExpTools/Entity/TileEntity/EnergyToolsTESR.java TileEntityEnergizer: https://github.com/AnZaNaMa/ExpTools/blob/master/src/main/java/com/AnZaNaMa/ExpTools/Entity/TileEntity/TileEntityEnergizer.java
  22. Energy Tools is a mod i've been working on for a bit that adds a system of "energy" to players. This should not be thought of as electrical energy, but more physical energy. This energy can be acquired through many different methods and can be used in many ways. What better way to explain the mod than to show you? This mod has not yet been released, but the page will be updated as soon as it comes out. Also, i'll [eventually] get AnZaNaMa.com up and running. I have even bought the domain! On to the mod itself: NOTE: I am fully aware that some references to the mod label it "ExpTools" instead of "EnergyTools". This is because the former was the original name of it and I still havent gotten around to changing all of the references. Sorry for any confusing inconveniences. Getting Energy: Using Energy: Like I said earlier, this is a work in progress. It's also my first mod. However, I work on it literally all the time pretty much every day. Even right now, I'm writing this when I should be sleeping, because i'm taking the AP United States History test in ~ 8 hours. I know this post is very short, and I will absolutely finish writing it when I get a chance. I just wanted to get this out there. There will be pictures too. LINKS: Source Code: https://github.com/AnZaNaMa/ExpTools Ideas, Feature Requests, Concerns, Comments, Etc.: https://github.com/AnZaNaMa/ExpTools/issues Wiki (not anywhere near complete): https://github.com/AnZaNaMa/ExpTools/wiki My Website (this is not a legitimate link yet, I just want to have it here for later. It doesn't lead anywhere): http://www.AnZaNaMa.com
  23. So, I tried moving all of my multiblock stuff to the update function and the block position is working fine now, but I just can't figure out why it's not detecting the formation of the multiblock.
  24. okay, I'll try that out. Thanks for the help
×
×
  • Create New...

Important Information

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