Code Monkey home page Code Monkey logo

appliede's Introduction

AppliedE

CurseForge Total Downloads Modrinth Total Downloads

A Minecraft mod made as an add-on to both Applied Energistics 2 and ProjectE providing more tightly-coupled integration between the two mods. Unlike conventional add-ons integrating the two together, AppliedE works by turning ProjectE's EMC into a distinct "key type" able to be displayed, reported and manipulated by an ME network and converted into items upon request via AE2's auto-crafting facilities.

Currently, the mod is in early beta stages. Beware of any critical bugs, particularly on multiplayer servers, and please report them on the issue tracker as they arise.

Basic Usage

The first step towards using this add-on is to make an ME Transmutation Module. The module retrieves all transmutation/EMC knowledge from the player who placed down the module to provide ME networks with information on stored EMC and transmutable items. It can be placed anywhere at all on the network to function.

EMC module in-world

EMC module crafting recipe

Multiple modules may be placed down on one network by any number of different players / knowledge providers, but only one module per knowledge provider will contribute to the stored EMC figure and available "craftable" known items. If multiple knowledge providers are employed by the modules on a network, any inserted and extracted EMC will be equally (as is possible) distributed among all providers.

EMC and displayed transmutable items Displayed EMC

The module also includes additional safeguards to prevent overflow issues in ME networks, by adding a "tier" system to the EMC stored on a network based on subsequent powers of an arbitrarily large number of EMC units.

Displayed EMC tiers

For further information on how to use the add-on, please consult the in-game AE2 guide's new section added by this add-on.

License

All code is licensed under LGPLv3, in adherence to the same license used by Applied Energistics 2 and with some code borrowed from AE2 itself.

All assets are licensed under CC BY-NC-SA 3.0, in adherence to the same license used by AE2 and with most deriving from AE2's and ProjectE's own assets. Some assets have been provided externally as courtesy of Sea_Kerman.

appliede's People

Contributors

3453890470 avatar 62832 avatar james103 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

appliede's Issues

Idea: Reduce the EMC multiplier per tier from 2^42 to 10^12

Powers of 2^42, while understandable to computers, are hard for humans (players) to understand and recognize quickly, while powers of 10^12 are much more recognizable and understandable for humans using the base-10 counting system.

For example, if an ME EMC Module placed by a given player reports that the player has 5,972,200,000,000,000,224,395,264 EMC available, that will be split as 1,357,921,064,482 EMC^2 units and 310,311,387,136 EMC units, which can be hard for some players to relate to the original EMC total.

With the change, the same 5,972,200,000,000,000,224,395,264 EMC will now split into 5 EMC^3 units, 972,200,000,000 EMC^2 units, and 224,395,264 EMC units. This makes it much easier for players to relate to the original EMC total, as now each EMC^N unit corresponds to exactly 12 digits of their EMC total, with no base conversion necessary.

This can be implemented simply by replacing Math.pow(2, 42) with Math.pow(10, 12) here:

public static final BigInteger TIER_LIMIT = BigInteger.valueOf((long) Math.pow(2, 42));

A side effect of this is a slight further reduction of overflow risk, as 10^12 is about 4 times smaller than 2^42.

Removing custom emc values can cause the transmutation interface to crash the game

This is in referance to an issue I had on ATM9:TTS where, after updating a world from 1.0.6 to version 1.0.7, inserting items in a transmutation interface which have had their emc values removed, but were previously learned by the player, causes the game to crash.

Here is a link to the issue with several changes listed that should hopefully solve the issue.

AllTheMods/All-the-mods-9-Sky#500

As I have only done a quick glance at the code, and am not at all familiar with the codebase, the proposed solutions might not be the correct way to solve the issue, but should work.

Extracting and re-inserting maximally-valuable items voids relatively tiny amounts of EMC

When an ME Transmutation Export Bus is pointed into an ME Transmutation Interface, and both devices are on the same ME Network, setting the ME Transmutation Export Bus to export Compact Sun blocks into the ME Transmutation Interface will void 96 EMC from the network's available EMC total for every Compact Sun moved that way.

This is most likely caused by some of the calculations in at least one of the following 3 mods using 64-bit floating point numbers instead of BigIntegers:

  • ProjectE
  • Project Expansion
  • AppliedE

64-bit floating point numbers are only integer-precise up to 9 quadrillion, while the Compact Sun has an EMC value of over 2 quintillion.

To reproduce:

  1. Install AE2 + AppliedE + ProjectE + Project Expansion.
  2. Create a new world with cheats enabled.
  3. Create an ME Network consisting of a Creative Energy Cell, ME Transmutation Module, and ME Transmutation Terminal.
  4. Place an ME Transmutation Interface and an ME Transmutation Export Bus, making sure the latter is pointed into the former.
  5. Connect both devices to the same ME network with an ME Transmutation Module and some cable.
  6. Run this command: projecte emc set @s 1000000000000000000000000000, or get that much EMC via other means.
  7. Give yourself a Compact Sun.
  8. Set the ME Transmutation Export Bus to export Compact Suns into the ME Transmutation Interface.
  9. Learn the Compact Sun.
  10. Notice your EMC total reduces by 96 for every Compact Sun moved from the export bus into the interface.
Full mod list
ae2wtlib-15.2.3-forge
appliede-0.11.0-beta
appliedenergistics2-forge-15.2.1
architectury-9.2.14-forge
cloth-config-11.1.118-forge
curios-forge-5.9.0+1.20.1
jei-1.20.1-forge-15.3.0.4
NoChatReports-FORGE-1.20.1-v2.2.2
ProjectE-1.20.1-PE1.0.1
ProjectExpansion-1.20.1-1.1.0

Need to replace all transmutation busses upon rejoin

I'm currently playing on the public ATM9 TTS and after every time you leave and rejoin you have to replace the transmutation busses for them to work again.
Example: You have an inventory connected to your system via a ME Transmutation Import bus. Once you leave the server and rejoin, it will no longer import the EMC. You have to break and replace the bus for it to pull the Items/EMC again

Transmuting items costs significantly more than charging Klein Stars

In Minecraft 1.20.1 and NeoForge 47.1.106, transmuting items to or from EMC appears to be a lot more expensive (power-wise) compared to charging or discharging Klein Stars with the same amount of EMC.

For example, one can fully charge a Klein Star Omega and still run a minimal grid for a few minutes off a single regular Energy Cell, but try to spend the same amount of EMC on items and the grid will shut down, even with four fully-charged Superdense Energy Cells.

This line should mean it only costs 1 AE (or 2 FE) to move 2,000 EMC through an ME Network:

public int getAmountPerOperation() {
return 2000;
}

However, when actually transmuting things to or from EMC, that value is ignored and instead subsituted with what appears to be 1 AE for 1 EMC, here:

var multiplier = BigDecimal.valueOf(PowerMultiplier.CONFIG.multiplier);
var toExpend = new BigDecimal(maxEmc).multiply(multiplier).min(BigDecimal.valueOf(Double.MAX_VALUE));

(where PowerMultiplier.CONFIG.multiplier is 1 by default)

As far as I know, the only ways a server can mitigate this cost without editing the above lines and recompiling the mod are to divide all ME Network energy usage (not just the transmutation energy cost) via the power multiplier in AE2's config, or allow players to craft a Creative Energy Cell for their ME networks.

Otherwise, packs like Project Architect 2 which have late-game items part of the progression worth a trillion EMC can't effectively use AppliedE in their late games as doing so would cause ME Network power requirements to rise steeply.
(All The Mods 9: To The Sky does have AppliedE, but it only has EMC values which range up to a few million, where the power requirements remain manageable for a late-game base.)

Would it be possible to add a separate multiplier for the energy cost to transmute EMC to or from items, so that, for example, one does not need billions of FE stored in their ME network to start a crafting job which costs billions of EMC?

[ATM9:TTS] Bug: ME Transmutation module loses owner info on server reset

This has been a pretty consistent issue. when you attach a transmutation module it shows the placers name. On reboot of the server it reverts to no owner. in game it just doesn't show Owner.
Side effects are the emc crafting or exports into emc doesn't work without an owner.

Fix is to remove and replace the module then it retags owner correctly.

ATM9:TTS Ver 1.0.7
AppliedE version used - 0.13.2-beta

Server Crash ATM9Sky divide by 0 error

crashlog: https://mclo.gs/CxqgAcf

The above log seems to point to AppliedE so I am posting here as well as to the atm github: AllTheMods/All-the-mods-9-Sky#489

Not sure what caused this overnight as it was working fine when i logged out last night. I left the server running and when I try to loging again i got the crashing issue. Hoping you can help me fix the crash as atm9sky doesn't have autobackups and hoping a mod update might fix or workaround the issue.

This seems to be the offending block:
Thread: Server thread
Suspected Mods:
Applied Energistics 2 (ae2), Version: 15.2.4
Issue tracker URL: https://github.com/AppliedEnergistics/Applied-Energistics-2/issues
at TRANSFORMER/[email protected]/appeng.me.storage.NetworkStorage.insert(NetworkStorage.java:136)

AppliedE (appliede), Version: 0.13.1-beta
	Issue tracker URL: https://github.com/62832/AppliedE/issues
	at TRANSFORMER/[email protected]/gripe._90.appliede.me.service.EMCStorage.insert(EMCStorage.java:72)

Stacktrace:
at gripe._90.appliede.me.service.EMCStorage.insert(EMCStorage.java:72) ~[appliede-0.13.1-beta.jar%23413!/:?] {re:classloading}
at appeng.me.storage.NetworkStorage.insert(NetworkStorage.java:136) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
at appeng.api.storage.StorageHelper.poweredInsert(StorageHelper.java:166) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:mixin,re:classloading}
at gripe._90.appliede.part.EMCImportBusPart.lambda$doBusWork$1(EMCImportBusPart.java:82) ~[appliede-0.13.1-beta.jar%23413!/:?] {re:classloading}
at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:137) ~[forge-1.20.1-47.2.20-universal.jar%23688!/:?] {re:mixin,re:classloading,pl:mixin:APP:phosphophyllite.mixins.json:LazyOptionalMixin,pl:mixin:A}
at gripe._90.appliede.part.EMCImportBusPart.doBusWork(EMCImportBusPart.java:76) ~[appliede-0.13.1-beta.jar%23413!/:?] {re:classloading}
at appeng.parts.automation.IOBusPart.tickingRequest(IOBusPart.java:208) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
at appeng.me.service.TickManagerService.unsafeTickingRequest(TickManagerService.java:355) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
at appeng.me.service.TickManagerService.tickQueue(TickManagerService.java:118) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
at appeng.me.service.TickManagerService.tickLevelQueue(TickManagerService.java:90) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
at appeng.me.service.TickManagerService.onLevelEndTick(TickManagerService.java:75) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
at appeng.me.Grid.onLevelEndTick(Grid.java:226) ~[appliedenergistics2-forge-15.2.4.jar%23414!/:15.2.4] {re:classloading}
-- EMCImportBusPart being ticked. --
Details:
Node: node@b183051 hosted by gripe._90.appliede.part.EMCImportBusPart
Part Side: up
Name: ae2:cable_bus // appeng.blockentity.networking.CableBusBlockEntity
Block: CableBusBlock[cable_bus][light_level=0,waterlogged=false]
Block location: World: (4107,72,54), Section: (at 11,8,6 in 256,4,3; chunk contains blocks 4096,-64,48 to 4111,319,63), Region: (8,0; contains chunks 256,0 to 287,31, blocks 4096,-64,0 to 4607,319,511)
Block: CableBusBlock[cable_bus][light_level=0,waterlogged=false]
Block location: World: (4107,72,54), Section: (at 11,8,6 in 256,4,3; chunk contains blocks 4096,-64,48 to 4111,319,63), Region: (8,0; contains chunks 256,0 to 287,31, blocks 4096,-64,0 to 4607,319,511)
Level: ResourceKey[minecraft:dimension / minecraft:overworld]
CurrentTickRate: 40
MinTickRate: 5
MaxTickRate: 40
ConnectedSides: []

Edit: more info after I was able to delete the the block using amulet.
this was an transmutation importer (I think) attached to an energy condenser mk1 crafting phantom membranes. around the energy condenser was a power flower - AM relays then energy collectors attached to them.
This was setup a few days ago so no idea what choked.
edit2: was able to replicate the crash. as soon as i attached a cable to the transmutation importer with 4 acc cards but no listed filters it crashed with the divide by 0

Server Crash

Hello Ninety!

It appears as though AppliedE is crashing my Minecraft server. I have uploaded the crashlog below. Unfortunately, due to the nature of this crash, I cannot login in order to investigate exact details of my setup.

I have gotten back into my server and identified the main steps to get this crash to occur. I currently have 1.8G of EMC in my Table, and specifically what I did to cause this crash was; Enter the portal in The End (returning to overworld). I avoided this crash by manually editing my player NBT data back to overworld from the_end.

crash-2024-05-05_02.23.34-server.txt

With 10^(12n) + a small amount in EMC, auto-crafting to auto-transmute fails and puts 10^(12n) EMC and a crafting CPU on hold.

For example, with 1,000,000,000,100 EMC available and the ability to request an Iron Ingot be transmuted via auto-crafting, attempting to request that iron ingot (worth 256 EMC) will cause one of the crafting CPUs on the network to lock up and 1,000,000,000,000 EMC to be held in that CPU until its crafting job is canceled or another 1,000,000,000,000 EMC is injected and made available for use in the ME Network.

To reproduce:

  1. Install AE2 + AppliedE + ProjectE.
  2. Create a new world with cheats enabled.
  3. Run this command: projecte emc set @s 1000000000100, or get exactly that much EMC via other means.1
  4. Create an ME Network consisting of a Creative Energy Cell, ME Transmutation Module, at least one Crafting CPU, and a regular ME storage or crafting terminal.
  5. Give yourself two Transmutation Tables.
  6. Place one down, and learn the other.
  7. Request a Transmutation Table be auto-transmuted through the ME Network's auto-crafting setup.
  8. The request will lock up, causing 1,000,000,000,000 EMC to be held inside the Crafting CPU and the requested item not to be given.
  9. Give yourself another 1,000,000,000,000 EMC, then open up the ME terminal again.
  10. Notice the request completes this time, giving the item and leftover EMC back to the network.
Full mod list
ae2wtlib-15.2.3-forge
appliede-0.11.0-beta
appliedenergistics2-forge-15.2.1
architectury-9.2.14-forge
cloth-config-11.1.118-forge
curios-forge-5.9.0+1.20.1
jei-1.20.1-forge-15.3.0.4
NoChatReports-FORGE-1.20.1-v2.2.2
ProjectE-1.20.1-PE1.0.1
ProjectExpansion-1.20.1-1.1.0

Footnotes

  1. Running projecte emc set @s 1000000000000000000000000000000000000000000000000000000000100 is also sufficient to reproduce this, as does adding or removing twelve zeroes at a time to the number before running the command, hence the 10^(12n) in the title instead of 10^12.

ME Transmutation Interface can void EMC when set to stock maximally-valuable items

When an ME Transmutation Interface is set to stock a high-value EMC item with a maximum stack size above 1, such as a Final Power Flower or Compact Sun from Project Expansion, the interface will void 1-3 times the EMC value of the item to be requested every second and not provide the item requested (assuming the request is for 1 of that item) or maintain 1 fewer than the amount requested (if the amount requested exceeds 1).

This can lead to mass voiding of EMC when attempting to automatically expand Power Flower setups or automatically performing custom crafts which require items worth quadrillions or quintillions of EMC each.

To reproduce:

  1. Install AE2 + AppliedE + ProjectE + Project Expansion.
  2. Create a new world with cheats enabled.
  3. Run this command: projecte emc set @s 1000000000000000000000000000, or get that much EMC via other means.
  4. Create an ME Network consisting of a Creative Energy Cell, ME Transmutation Module, ME Transmutation Terminal, and ME Transmutation Interface.
  5. Give yourself a Final Power Flower or Compact Sun.
  6. Open the ME Transmutation Terminal and dump your inventory into the terminal, making sure to learn the power flower or Compact Sun.
  7. In the ME Transmutation Interface, set a request to keep one Final Power Flower or Compact Sun in stock.
  8. Watch as the item never materializes yet the player's EMC total keeps dropping.

Edit: There is no need for a Transmutation Interface.

  1. Install AE2 + AppliedE + ProjectE + Project Expansion.
  2. Create a new world with cheats enabled.
  3. Create an ME Network consisting of a Creative Energy Cell, ME Transmutation Module, ME Transmutation Terminal, and ME Transmutation Interface.
  4. Run give @s projectexpansion:final_power_flower
  5. Dump the Final Power Flower into the ME Transmutation Terminal (learning it).
  6. Run projecte emc set @s 10000000000000000000
  7. Shift-click the Final Power Flower out of the Transmutation Terminal.
  8. Shift-click the resulting stack of Final Power Flowers back into the Transmutation Terminal.
  9. Notice one Final Power Flower worth of EMC is voided.
Full mod list
  [✔] ae2wtlib-15.2.3-forge
  [✔] appliede-0.9.0-beta
  [✔] appliedenergistics2-forge-15.1.1
  [✔] architectury-9.2.14-forge
  [✔] cloth-config-11.1.118-forge
  [✔] curios-forge-5.9.0+1.20.1
  [✔] jei-1.20.1-forge-15.3.0.4
  [✔] NoChatReports-FORGE-1.20.1-v2.2.2
  [✔] ProjectE-1.20.1-PE1.0.1
  [✔] ProjectExpansion-1.20.1-1.1.0

[Incompatibility] Versions 0.3.* couse Tooltip Conflict with AE Additions - ExtraCells2 Fork

With Versions 0.3.0, 0.3.1, 0.3.2, and 0.3.3 I get a Tooltip Error.

[16:16:23] [Render thread/ERROR]: Caught an error rendering an Ingredient's tooltip:

-- Ingredient --
Details:
	Name: 1k ME Super Storage Cell
	Mod's Name: AE Additions
	Registry Name: ae2additions:super_cell_1k
	Class Name: class net.minecraft.world.item.ItemStack
	toString Name: 1 super_cell_1k
	Unique Id for JEI (for JEI Blacklist): ae2additions:super_cell_1k
	Ingredient Type for JEI: class net.minecraft.world.item.ItemStack
	Error Info gathered from JEI: 1 super_cell_1k ae2additions:super_cell_1k nbt:{}

-- Stack Trace --

java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.Component.getString()" because the return value of "appeng.api.stacks.AEKeyType.getDescription()" is null

Disabling AppliedE or downgrading to Version 0.2.5 fixes the Issue for me.

latest.log

Division by 0 error

Sadly i don't have the logs since this happened on a public server.
However using ae2 and AppliedE, whenever my base gets loaded in, there happens to be a division by 0 crash. I only use the Emc Module attached to my AE2 network.

Transmutation module attempts to use EMC rather than available crafting materials in storage

Transmutation module attempts to use EMC rather than available crafting materials in storage, this is also the case regardless of whether you have enough EMC to transmute or not i.e. I have taken all the EMC out and it will not allow you to proceed to craft even though materials are available in storage with crafting pattern available.

I have noticed it occasionally allows you to craft using materials opposed to transmuting with EMC, however this is inconsistent and usually defaults to trying to use EMC.

Any chance of adding in options for the user to craft via patterns or transmuting?

Transmuting items to/from EMC does not limit the amount of items based on stored energy

In Minecraft 1.20.1 and NeoForge 47.1.106, transmuting items to or from EMC appears to have no limit on either item count or EMC value, regardless of the amount of energy stored in the network.

An energy injection as low as 4,000 FE is sufficient for an AE network consisting of a single Transmutation Import Bus and Transmutation Module to boot up and transmute up to 96 of any item with an EMC value, no matter how large that EMC value is.
This applies even for Compact Suns, one of the highest-value EMC items across all known ProjectE addons, whereby over 260 quintillion EMC can be imported and transmuted for the same low energy requirement of 4,000 FE.

To reproduce:

  1. Place down a chest.
  2. Attach a Transmutation Import Bus on it.
  3. Upgrade the Transmutation Import Bus with an Alchemical Mastery Card and four Acceleration Cards.
  4. Complete the ME Network with a Transmutation Module and a fully charged Energy Cell.
  5. Place a stack of Red Matter Blocks into the chest and wait. The entire stack gets imported, up to 96, but all energy in the cell is consumed even if only a single Red Matter Block is imported.

Mod list:

appliede-0.14.0
appliedenergistics2-forge-15.2.11
ProjectE-1.20.1-PE1.0.1
ProjectExpansion-1.20.1-1.1.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.