Skip to content

Commit

Permalink
backport fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Caltinor committed Nov 7, 2023
1 parent a94cb42 commit 4429d0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/main/java/harmonised/pmmo/commands/CmdNodeAdmin.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.event.level.NoteBlockEvent;
import net.minecraftforge.fml.LogicalSide;

public class CmdNodeAdmin {
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/harmonised/pmmo/config/codecs/ObjectData.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,24 @@ public void setNegativeEffects(Map<ResourceLocation, Integer> neg) {
public ObjectData combine(ObjectData two) {
Set<String> tagValues = new HashSet<>();
Map<EventType, Map<String, Long>> xpValues = new HashMap<>();
Map<EventType, List<LogicEntry>> nbtXp = new HashMap<>();
Map<ModifierDataType, Map<String, Double>> bonuses = new HashMap<>();
Map<ModifierDataType, List<LogicEntry>> nbtBonus = new HashMap<>();
Map<ReqType, Map<String, Integer>> reqs = new HashMap<>();
Map<ReqType, List<LogicEntry>> nbtReq = new HashMap<>();
Map<ResourceLocation, Integer> reqEffects = new HashMap<>();
Map<ResourceLocation, SalvageData> salvage = new HashMap<>();
VeinData[] combinedVein = {this.veinData()};

BiConsumer<ObjectData, ObjectData> bothOrNeither = (o, t) -> {
//combine NBT settings
nbtXp.putAll(o.nbtXpValues());
t.nbtXpValues().forEach((event, logic) -> nbtXp.merge(event, logic, (a, b) -> {var list = new ArrayList<>(a); list.addAll(b); return list;}));
nbtBonus.putAll(o.nbtBonuses());
t.nbtBonuses().forEach((modifier, logic) -> nbtBonus.merge(modifier, logic, (a, b) -> {var list = new ArrayList<>(a); list.addAll(b); return list;}));
nbtReq.putAll(o.nbtReqs());
t.nbtReqs().forEach((req, logic) -> nbtReq.merge(req, logic, (a, b) -> {var list = new ArrayList<>(a); list.addAll(b); return list;}));

tagValues.addAll(o.tagValues());
t.tagValues.forEach((rl) -> {
if (!tagValues.contains(rl))
Expand Down

0 comments on commit 4429d0e

Please sign in to comment.