Jump to content

AnZaNaMa

Forge Modder
  • Posts

    161
  • Joined

  • Last visited

Posts 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. 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 :P (no offense, I love that mod).

  3. 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;
        }
    

  4. 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

     

     

  5. 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.

  6. 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

     

  7. 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.

  8. 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");
        }
    }
    

  9. 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

  10. 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:

     

     

    As this mod is a work in progress, not all of the ways to get energy have been implemented yet, but there are many planned.

     

    Number 1: By destroying your items!

     

    This method uses a machine called an "Energizer" to turn any items that you drop onto it into pure energy (yes, the items get deleted). Most all vanilla items have energy values, and support for modded items will absolutely be implemented in the future. Also, placing Energy Blocks around the Energizer in certain manners will allow a player to get more energy for each item and transfer energy quicker.

     

    Number 2: Through Liquids!

     

    Not much planning in this aspect has been done. For sure, there will be the ability to convert the energy in you and in machines to liquid energy that can be stored in tanks. There will probably be a machine (or machines) that does/do such. More to come in the future.

     

    Got any other ideas for energy? Tell me about them!

    https://github.com/AnZaNaMa/ExpTools/issues

     

     

     

    Using Energy:

     

     

    Like I said above, the mod is a work in progress, so there will be much more added in the future. As of now, though, there are a few uses for Energy.

     

    Number 1: Tools!

    Of course there are tools. There is a pickaxe, axe, shovel, hoe, and sword. These tools are fairly powerful and never break. The only catch is, each use of them takes 10 energy (the same amount received from one cobblestone). If you try to use a tool without Energy, it will break and you'll be left empty-handed *buh-dum-tss*

     

    Number 2: RedBison

    RedBison is litterally a can of RedBull (or at least it looks like it) that is named RedBison, because I don't want to be sued by RedBull. It is a later game item that is another option for flight. Upon first activation, it takes 500 energy from the player and then while it is active, 1 energy per tick. But while it's active, you get creative flight! Just another option that's maybe a little bit less overpowered than Angel Wings.

     

    *More To Come (Soon)*

     

     

     

    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. :D

     

    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

×
×
  • Create New...

Important Information

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