Skip to content

Commit

Permalink
EAP
Browse files Browse the repository at this point in the history
  • Loading branch information
Starexify committed Jan 14, 2025
1 parent efcea3c commit 37ee09b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parchment_mappings_version=2025.01.05
minecraft_version=1.21.4
minecraft_version_range=[1.21.4, 1.22)

neo_version=21.4.54-beta
neo_version=21.4.57-beta
neo_version_range=[21.4,)
loader_version_range=[4,)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"layers": {
"humanoid": [
{
"texture": "big_swords:biomass"
"texture": "minecraft:biomass"
}
],
"humanoid_leggings": [
{
"texture": "big_swords:biomass"
"texture": "minecraft:biomass"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"layers": {
"humanoid": [
{
"texture": "big_swords:livingmetal"
"texture": "minecraft:livingmetal"
}
],
"humanoid_leggings": [
{
"texture": "big_swords:livingmetal"
"texture": "minecraft:livingmetal"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,21 @@

import net.minecraft.client.data.models.EquipmentAssetProvider;
import net.minecraft.client.resources.model.EquipmentClientInfo;
import net.minecraft.data.CachedOutput;
import net.minecraft.data.DataProvider;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.equipment.EquipmentAsset;
import net.nova.big_swords.BigSwordsR;
import net.nova.big_swords.equipment.BSEquipmentAssets;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;

public class BSEquipmentModelProvider extends EquipmentAssetProvider {
private final PackOutput.PathProvider pathProvider;

public BSEquipmentModelProvider(PackOutput output) {
super(output);
this.pathProvider = output.createPathProvider(PackOutput.Target.RESOURCE_PACK, "equipment");
}

public static void bootstrap(BiConsumer<ResourceKey<EquipmentAsset>, EquipmentClientInfo> consumer) {
consumer.accept(BSEquipmentAssets.LIVINGMETAL, onlyHumanoid("livingmetal"));
consumer.accept(BSEquipmentAssets.BIOMASS, onlyHumanoid("biomass"));
}

public static EquipmentClientInfo onlyHumanoid(String name) {
return EquipmentClientInfo.builder().addHumanoidLayers(BigSwordsR.rl(name)).build();
}

@Override
public CompletableFuture<?> run(CachedOutput output) {
Map<ResourceKey<EquipmentAsset>, EquipmentClientInfo> map = new HashMap<>();
bootstrap((id, model) -> {
if (map.putIfAbsent(id, model) != null) {
throw new IllegalStateException("Tried to register equipment model twice for id: " + id);
}
});
return DataProvider.saveAll(output, EquipmentClientInfo.CODEC, this.pathProvider::json, map);
}

@Override
public String getName() {
return "Big Swords Equipment Model Definitions";
protected void registerModels(BiConsumer<ResourceKey<EquipmentAsset>, EquipmentClientInfo> output) {
output.accept(BSEquipmentAssets.LIVINGMETAL, onlyHumanoid("livingmetal"));
output.accept(BSEquipmentAssets.BIOMASS, onlyHumanoid("biomass"));
}
}

0 comments on commit 37ee09b

Please sign in to comment.