KubeJS ProjectE

KubeJS ProjectE

146k Downloads

[1.19.2][kubejsprojecte-1.2] setPlayerEMC does the same as addPlayerEMC

MrNovado opened this issue ยท 2 comments

commented

A typo?

KubeJSProjectEPlugin.java#L40

public void setPlayerEMC(Player player, String num) {
            if (player == null) return;
            var cap = player.getCapability(PECapabilities.KNOWLEDGE_CAPABILITY);
            if (cap.isPresent()) {
                var emc = cap.resolve().get();
                emc.setEmc(emc.getEmc().add(new BigDecimal(num).toBigInteger()));
            }
        }
// gets current and then adds `num` on top
emc.setEmc(emc.getEmc().add(new BigDecimal(num).toBigInteger()));
commented

Also, transmutation_table does not update its emc balance after setting/adding emc through KubeJS.
Meaning, it displays old emc balance until a transaction is made (buying/selling an item).
Any chance projectE has some sort of refresh method to push after setting emc?

commented

The first issue now has been fixed, and the second is out of my control. Run a /reload after a /kubejs reload server_scripts to refresh things like that, just as you would with recipes.