Skip to content

Commit

Permalink
Merge branch '2001' into 2004
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNeedsSnacks committed May 20, 2024
2 parents f0f9ba4 + fc38ad0 commit 695f9e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main/java/dev/latvian/mods/kubejs/event/EventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
Expand Down Expand Up @@ -142,7 +142,7 @@ public void listen(ScriptType type, @Nullable Object extraId, IEventHandler hand
map = eventContainers;
} else {
if (extraEventContainers == null) {
extraEventContainers = extra.identity ? new IdentityHashMap<>() : new HashMap<>();
extraEventContainers = extra.identity ? new LinkedHashMap<>() : new HashMap<>();
}

map = extraEventContainers.get(extraId);
Expand Down Expand Up @@ -362,7 +362,7 @@ public Set<Object> findUniqueExtraIds(ScriptType type) {
return Set.of();
}

var set = new HashSet<>();
var set = new LinkedHashSet<>();

forEachListener(type, c -> {
if (c.extraId != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ public BucketItem createObject() {

@Override
public void generateAssetJsons(AssetJsonGenerator generator) {
generator.itemModel(id, m -> m.parent("kubejs:item/generated_bucket"));
if (modelJson != null) {
generator.json(AssetJsonGenerator.asItemModelLocation(id), modelJson);
return;
}

generator.itemModel(id, m -> {
if (!parentModel.isEmpty()) {
m.parent(parentModel);
} else {
m.parent("kubejs:item/generated_bucket");
}

if (textureJson.size() > 0) {
m.textures(textureJson);
}
});
}
}

0 comments on commit 695f9e9

Please sign in to comment.