Jump to content

shadowfacts

Forge Modder
  • Posts

    588
  • Joined

  • Last visited

Posts posted by shadowfacts

  1. Sort through the list and check the output to remove the one you want. Psuedo-code:

     

    List<IRecipe> toRemove;

    CraftingManager.getInstance().getRecipeList().stream().filter(recipe -> recipe.getOutput.equals(yourThingy)).forEach(toRemove::add);

    toRemove.stream().forEach(CraftingManager.getInstance().getRecipeList()::remove);

  2. There are a _huge_ number of existing, established launchers and a great number of them allow anyone to upload packs. Use one of those. Minecraft is weird and finicky and it is far more effort to create your own launcher than use an existing one. I know because I built the Temporal Reality one, and I didn't even write the launching code myself, I used a library.

  3. To setup a project SDK you need to go to the first tab of the Project Structure window (under the File menu). In the first tab there is a dropdown that is used to select which JDK you want to use. If you haven't used IntelliJ before, it has no knowledge of any JDKs installed on your computer. Press the New... button and select the home of the JDK installation you wish to use for your project.

  4. If you want other energy using blocks to be able to actively pull from your solar panel, your current implementation will work fine.

     

    If you want your solar panel to actively push into adjacent RF accepting blocks, you will need to add some code. In the updatEntity method of your TE you will need to iterate over all the valid directions, and for each direction, check if the tile entity is A) not null, B) an IEnergyReceiver, and C) can connect on that side. If all of these conditions are true, you can call receiveEnergy on the TileEntity with the correct amount of energy.

     

    Side note: If you wanted to improve upon this implementation, you could only check 1 direction every tick (instead of all 6 every tick) to improve on server-side performance a bit.

     

    Example:

     

    @Override
    public void updateEntity() {
        // generate
        if (storage.getEnergyStored() > 0) { // is there energy to send
            for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
                TileEntity te = world.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
                if (te instanceof IEnergyReceiver) {
                    IEnergyReceiver receiver = (IEnergyReceiver)te;
    
                    int toExtract = receiver.receiveEnergy(dir.getOpposite(), extractEnergy(dir, MAX_EXTRACT, true), false);
                    extractEnergy(dir, toExtract, false);
                }
            }
        }
    }
    

  5. I am currently making a fairly simple mod, it adds only one thing, barrels for liquid storage. It is functionally complete except for one, very important, bug. After I leave and re-enter the world, the fluid has not saved. I've confirmed that at the the end of writeToNBT and readFromNBT the tag compound does contain all the correct values, however, the fluid still is not restored on world load. My code is here on GitHub, any help/advice that anyone can offer would be greatly appreciated. :)

  6. 1. You have to show your code.

    2. You have a method calls itself that calls itself that calls itself that calls itself that calls itself, ad infinitum. This is causing the StackOverflowError because you are continually adding things to the stack but never removing them.

     

    Side note, Failender, it's a different problem, 1 problem per thread.

×
×
  • Create New...

Important Information

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