Skip to content

Commit

Permalink
Renamed BuilderBase#generateDataJsons to generateData and generateAss…
Browse files Browse the repository at this point in the history
…etJsons to generateAssets. Sorry plugin devs, forgot to do that sooner
  • Loading branch information
LatvianModder committed Jul 24, 2024
1 parent b05461f commit 18c3772
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dev/latvian/mods/kubejs/block/BlockBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public BuilderBase<Block> displayName(Component name) {
}

@Override
public void generateDataJsons(KubeDataGenerator generator) {
public void generateData(KubeDataGenerator generator) {
var table = generateLootTable();

if (table != null) {
Expand Down Expand Up @@ -226,7 +226,7 @@ public LootTable generateLootTable() {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
if (blockstateJson != null) {
generator.json(newID("blockstates/", ""), blockstateJson);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public String getTranslationKeyGroup() {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Block createObject() {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
generator.blockState(id, bs -> {
bs.simpleVariant("powered=false", "kubejs:block/detector");
bs.simpleVariant("powered=true", "kubejs:block/detector_on");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Item createObject() {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
if (modelJson != null) {
generator.json(KubeAssetGenerator.asItemModelLocation(id), modelJson);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public MultipartShapedBlockBuilder(ResourceLocation i, String... suffixes) {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
if (blockstateJson != null) {
generator.json(newID("blockstates/", ""), blockstateJson);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<PackResources> inject(List<PackResources> original) {
internalAssetPack.reset();

for (var builder : RegistryObjectStorage.ALL_BUILDERS) {
builder.generateAssetJsons(internalAssetPack);
builder.generateAssets(internalAssetPack);
}

KubeJSPlugins.forEachPlugin(internalAssetPack, KubeJSPlugin::generateAssets);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Block createObject() {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
generator.blockState(id, m -> m.simpleVariant("", id.getNamespace() + ":block/" + id.getPath()));
generator.blockModel(id, m -> {
m.parent("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public BucketItem createObject() {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
if (modelJson != null) {
generator.json(KubeAssetGenerator.asItemModelLocation(id), modelJson);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/latvian/mods/kubejs/item/ItemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Item transformObject(Item obj) {
}

@Override
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
if (modelJson != null) {
generator.json(KubeAssetGenerator.asItemModelLocation(id), modelJson);
return;
Expand All @@ -131,7 +131,7 @@ public void generateAssetJsons(KubeAssetGenerator generator) {
m.parent("minecraft:item/generated");
}

if (textureJson.size() == 0) {
if (textureJson.isEmpty()) {
texture(newID("item/", "").toString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ public ResourceLocation newID(String pre, String post) {
}

@HideFromJS
public void generateDataJsons(KubeDataGenerator generator) {
public void generateData(KubeDataGenerator generator) {
}

@HideFromJS
public void generateAssetJsons(KubeAssetGenerator generator) {
public void generateAssets(KubeAssetGenerator generator) {
}

public String getBuilderTranslationKey() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public <T> void add(ResourceKey<Registry<T>> registry, BuilderBase<? extends T>
@Override
public void loadAdditional() {
for (var builder : RegistryObjectStorage.ALL_BUILDERS) {
builder.generateDataJsons(internalDataPack);
builder.generateData(internalDataPack);
}

KubeJSPlugins.forEachPlugin(internalDataPack, KubeJSPlugin::generateData);
Expand Down

0 comments on commit 18c3772

Please sign in to comment.