Skip to content

Commit

Permalink
feat: update to latest kubejs changes
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Sep 3, 2024
1 parent 33ae29c commit 57e9dd2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mod_authors=Kli Kli
mod_description=KubeJS Plugin for Occultism

## Dependency Properties
kubejs_version=2101.7.0-build.158
kubejs_version=2101.7.0-build.163
kubejs_version_range=[2100.7.0-build.33,)

occultism_version=1.153.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

package com.klikli_dev.occultism_kubejs;

import com.google.gson.JsonObject;
import com.klikli_dev.occultism.common.item.DummyTooltipItem;
import dev.latvian.mods.kubejs.client.LangKubeEvent;
import dev.latvian.mods.kubejs.generator.KubeAssetGenerator;
import dev.latvian.mods.kubejs.item.ItemBuilder;
import dev.latvian.mods.kubejs.typings.Info;
import net.minecraft.network.chat.Component;
Expand All @@ -42,16 +42,29 @@ public RitualDummyItemType(ResourceLocation rl) {

//make the item just use the ritual dummy parent mode
//Note: we are not using this.parentModel() because it causes textures to be overwritten with a texture location corresponding to the item id unless the correct one is manually specified again
var modelJson = new JsonObject();
modelJson.addProperty("parent", "occultism:item/ritual_dummy");
this.modelJson(modelJson);
//Note: We now use parentModel because this.itemModel is gone, instead we fix the texture issue in generateAssets
this.parentModel(ResourceLocation.parse("occultism:item/ritual_dummy"));
}

@Override
public Item createObject() {
return new DummyTooltipItem(this.createItemProperties());
}

@Override
public void generateAssets(KubeAssetGenerator generator) {
//Copied from super, but without the textures
generator.itemModel(this.id, m -> {
m.parent(this.parentModel != null ? this.parentModel : KubeAssetGenerator.GENERATED_ITEM_MODEL);
// if (textures.isEmpty()) {
// texture(id.withPath(ID.ITEM).toString());
// }

// m.textures(textures);
});
}


@Override
public void generateLang(LangKubeEvent lang) {
super.generateLang(lang);
Expand Down

0 comments on commit 57e9dd2

Please sign in to comment.