Skip to content

Commit

Permalink
Update neo test mod
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Jun 1, 2024
1 parent 18e6321 commit 9f49b3e
Show file tree
Hide file tree
Showing 18 changed files with 127 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"type": "trimmed:any_trim",
"model_id_template": "testmod:item/adamantium_boots_${material_suffix}_trim"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"type": "trimmed:any_trim",
"model_id_template": "testmod:item/adamantium_chestplate_${material_suffix}_trim"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"type": "trimmed:any_trim",
"model_id_template": "testmod:item/adamantium_helmet_${material_suffix}_trim"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"type": "trimmed:any_trim",
"model_id_template": "testmod:item/adamantium_leggings_${material_suffix}_trim"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": {
"testmod:trims/color_palettes/adamantium": "testmod:trims/color_palettes/adamantium_darker"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": {
"testmod:item/adamantium_boots": "minecraft:trims/items/boots_trim",
"testmod:item/adamantium_chestplate": "minecraft:trims/items/chestplate_trim",
"testmod:item/adamantium_helmet": "minecraft:trims/items/helmet_trim",
"testmod:item/adamantium_leggings": "minecraft:trims/items/leggings_trim"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "trimmed:trims",
"override_textures": "testmod:trim_material_overrides/adamantium",
"template": "trimmed:item/two_layer_trim",
"textures": "testmod:trim_overlays/adamantium_armor"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": {
"testmod:trims/color_palettes/adamantium_darker": "testmod_adamantium_darker"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"append": [
"testmod:adamantium"
],
"values": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"append": [
"testmod:adamantium_armor"
],
"values": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"translate": "trim_pattern.testmod.adamantium"
},
"ingredient": "testmod:adamantium",
"item_model_index": -1.0
"item_model_index": -1.0,
"override_armor_materials": {
"testmod:adamantium": "testmod_adamantium_darker"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dev.dhyces.testmod.client;

import dev.dhyces.testmod.TrimmedTest;
import dev.dhyces.trimmed.api.client.map.ClientMapKeys;
import dev.dhyces.trimmed.api.client.map.ClientMapTypes;
import dev.dhyces.trimmed.api.maps.MapKey;
import dev.dhyces.trimmed.impl.client.maps.KeyResolvers;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -10,15 +12,17 @@

public class TestClientMapKeys {
// MANUAL
public static final MapKey<ResourceLocation, String> MANUAL_TEST_MAP = MapKey.of(TestClientMapTypes.CLIENT_RESOLVER_TEST, TrimmedTest.id("test_map"));
public static final MapKey<Block, String> MANUAL_SCANNER_DESCS = MapKey.of(TestClientMapTypes.SCANNER_DESCRIPTORS, TrimmedTest.id("scanner_descriptors"));
public static final MapKey<Item, String> MANUAL_TEST_ITEM_MAP = MapKey.of(TestClientMapTypes.ITEM_TEST, TrimmedTest.id("checked_item_map"));
public static final MapKey<ResourceLocation, String> MANUAL_TEST_MAP = MapKey.baseKeyOf(TestClientMapTypes.CLIENT_RESOLVER_TEST, TrimmedTest.id("test_map"));
public static final MapKey<Block, String> MANUAL_SCANNER_DESCS = MapKey.baseKeyOf(TestClientMapTypes.SCANNER_DESCRIPTORS, TrimmedTest.id("scanner_descriptors"));
public static final MapKey<Item, String> MANUAL_TEST_ITEM_MAP = MapKey.baseKeyOf(TestClientMapTypes.ITEM_TEST, TrimmedTest.id("checked_item_map"));
// public static final MapKey<Biome, Integer> MANUAL_TEST_BIOME_MAP = MapKey.of(TestClientMapTypes.BIOME_TEST, TrimmedTest.id("checked_biome_map"));

// DATAGENNED
public static final MapKey<ResourceLocation, String> DATAGEN_TEST_MAP_2 = MapKey.of(TestClientMapTypes.CLIENT_RESOLVER_TEST, TrimmedTest.id("test_map_2"));
public static final MapKey<Block, String> DATAGEN_TEST_BLOCK_MAP = MapKey.of(TestClientMapTypes.BLOCK_TEST, TrimmedTest.id("registry_block_map"));
public static final MapKey<EntityType<?>, EntityType<?>> DATAGEN_ENTITY_TRANSFORM = MapKey.of(TestClientMapTypes.ENTITY_CONVERSION, TrimmedTest.id("entity_transform"));
public static final MapKey<ResourceLocation, ResourceLocation> ADAMANTIUM_ARMOR = ClientMapKeys.TRIM_OVERLAYS.makeSubKey(TrimmedTest.id("adamantium_armor"));
public static final MapKey<ResourceLocation, ResourceLocation> ADAMANTIUM_MATERIAL_OVERRIDES = ClientMapKeys.TRIM_MATERIAL_OVERRIDES.makeSubKey(TrimmedTest.id("adamantium"));
public static final MapKey<ResourceLocation, String> DATAGEN_TEST_MAP_2 = MapKey.baseKeyOf(TestClientMapTypes.CLIENT_RESOLVER_TEST, TrimmedTest.id("test_map_2"));
public static final MapKey<Block, String> DATAGEN_TEST_BLOCK_MAP = MapKey.baseKeyOf(TestClientMapTypes.BLOCK_TEST, TrimmedTest.id("registry_block_map"));
public static final MapKey<EntityType<?>, EntityType<?>> DATAGEN_ENTITY_TRANSFORM = MapKey.baseKeyOf(TestClientMapTypes.ENTITY_CONVERSION, TrimmedTest.id("entity_transform"));
// public static final ClientRegistryMapKey<DamageType> DATAGEN_TEST_DAMAGE_TYPE_MAP = ClientRegistryMapKey.of(Registries.DAMAGE_TYPE, TrimmedTest.id("datapacked_damage_type_map"));

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package dev.dhyces.testmod.data;

import dev.dhyces.testmod.data.trimmed.TestModelSourceProvider;
import dev.dhyces.testmod.registry.ModArmorMaterials;
import dev.dhyces.testmod.registry.ModItems;
import dev.dhyces.testmod.ModTrimMaterials;
import dev.dhyces.testmod.ModTrimPatterns;
Expand Down Expand Up @@ -47,15 +49,16 @@ protected void addTranslations() {}
.makeMaterial(ModTrimMaterials.SHELL, Items.NAUTILUS_SHELL, 0xD17E7E)
.makeMaterial(ModTrimMaterials.PRISMARINE, Items.PRISMARINE_CRYSTALS, 0xB2D5C8)
.makeMaterial(ModTrimMaterials.GLOW, Items.GLOW_INK_SAC, 0x7EFCBE)
.makeMaterial(ModTrimMaterials.ADAMANTIUM, ModItems.ADAMANTIUM.asItem(), 0x9d2638)
.makeMaterial(ModTrimMaterials.ADAMANTIUM, ModItems.ADAMANTIUM.asItem(), 0x9d2638, materialConfig -> materialConfig.armorOverride(ModArmorMaterials.ADAMANTIUM, "testmod_adamantium_darker"))
.makePattern(ModTrimPatterns.SPIRAL, ModItems.SPIRAL_PATTERN.asItem(), false, patternConfig -> patternConfig.createCopyRecipe(Items.NAUTILUS_SHELL));

// new TestTrimDatagenSuite(event, TrimmedTest.MODID, langProvider::add);

generator.addProvider(event.includeClient(), langProvider);
generator.addProvider(event.includeClient(), new TestModelProvider(packOutput, TrimmedTest.MODID, event.getExistingFileHelper()));
generator.addProvider(event.includeClient(), new TestModelProvider(packOutput, event.getExistingFileHelper()));

generator.addProvider(event.includeClient(), new TestItemOverrideProvider(packOutput));
generator.addProvider(event.includeClient(), new TestModelSourceProvider(packOutput, event.getExistingFileHelper()));
generator.addProvider(event.includeClient(), new TestClientTagProvider(packOutput, event.getExistingFileHelper()));
generator.addProvider(event.includeClient(), new TestClientItemTagProvider(packOutput, lookupProvider, event.getExistingFileHelper()));
generator.addProvider(event.includeClient(), new TestClientCustomObjTagProvider(packOutput, lookupProvider, event.getExistingFileHelper()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package dev.dhyces.testmod.data;

import dev.dhyces.testmod.TrimmedTest;
import dev.dhyces.testmod.registry.ModItems;
import net.minecraft.data.PackOutput;
import net.neoforged.neoforge.client.model.generators.ItemModelProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;

public class TestModelProvider extends ItemModelProvider {
public TestModelProvider(PackOutput output, String modid, ExistingFileHelper existingFileHelper) {
super(output, modid, existingFileHelper);
public TestModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
super(output, TrimmedTest.MODID, existingFileHelper);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.dhyces.testmod.TrimmedTest;
import dev.dhyces.testmod.client.TestClientKeyResolvers;
import dev.dhyces.testmod.client.TestClientMapKeys;
import dev.dhyces.trimmed.api.client.map.ClientMapKeys;
import dev.dhyces.trimmed.api.data.map.ClientMapDataProvider;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -16,5 +17,18 @@ public TestClientMapProvider(PackOutput packOutput, ExistingFileHelper existingF
@Override
protected void addMaps() {
map(TestClientMapKeys.DATAGEN_TEST_MAP_2).put(TrimmedTest.id("some/kind/of/key"), "aValue");
map(TestClientMapKeys.ADAMANTIUM_ARMOR)
.put(TrimmedTest.id("item/adamantium_helmet"), new ResourceLocation("trims/items/helmet_trim"))
.put(TrimmedTest.id("item/adamantium_chestplate"), new ResourceLocation("trims/items/chestplate_trim"))
.put(TrimmedTest.id("item/adamantium_leggings"), new ResourceLocation("trims/items/leggings_trim"))
.put(TrimmedTest.id("item/adamantium_boots"), new ResourceLocation("trims/items/boots_trim"));
map(ClientMapKeys.TRIM_OVERLAYS)
.append(TestClientMapKeys.ADAMANTIUM_ARMOR);
map(TestClientMapKeys.ADAMANTIUM_MATERIAL_OVERRIDES)
.put(TrimmedTest.id("trims/color_palettes/adamantium"), TrimmedTest.id("trims/color_palettes/adamantium_darker"));
map(ClientMapKeys.TRIM_MATERIAL_OVERRIDES)
.append(TestClientMapKeys.ADAMANTIUM_MATERIAL_OVERRIDES);
map(ClientMapKeys.DARKER_MATERIAL_SUFFIXES)
.put(TrimmedTest.id("trims/color_palettes/adamantium_darker"), "testmod_adamantium_darker");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dev.dhyces.testmod.TrimmedTest;
import dev.dhyces.testmod.client.providers.BlockStateItemOverrideProvider;
import dev.dhyces.testmod.registry.ModItems;
import dev.dhyces.trimmed.api.data.ItemOverrideDataProvider;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.core.component.DataComponents;
Expand All @@ -20,5 +21,8 @@ public TestItemOverrideProvider(PackOutput output) {
protected void addItemOverrides() {
addComponentOverride(Blocks.GRASS_BLOCK, builder -> builder.set(DataComponents.BLOCK_STATE, BlockItemStateProperties.EMPTY.with(GrassBlock.SNOWY, true)), new ModelResourceLocation("minecraft", "grass_block", "snowy=true"));
addItemOverrides(Blocks.BAMBOO_STAIRS, new BlockStateItemOverrideProvider());
anyTrimBuilder(new ArmorSet(ModItems.ADAMANTIUM_HELMET, ModItems.ADAMANTIUM_CHESTPLATE, ModItems.ADAMANTIUM_LEGGINGS, ModItems.ADAMANTIUM_BOOTS))
.defaultTemplate()
.end();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package dev.dhyces.testmod.data.trimmed;

import dev.dhyces.testmod.TrimmedTest;
import dev.dhyces.testmod.registry.ModArmorMaterials;
import dev.dhyces.trimmed.api.data.model.source.ModelSourceDataProvider;
import net.minecraft.data.PackOutput;
import net.neoforged.neoforge.common.data.ExistingFileHelper;

public class TestModelSourceProvider extends ModelSourceDataProvider {
public TestModelSourceProvider(PackOutput packOutput, ExistingFileHelper existingFileHelper) {
super(packOutput, TrimmedTest.MODID, existingFileHelper);
}

@Override
protected void addModelSources() {
addTwoLayerTrimsSource(ModArmorMaterials.ADAMANTIUM.value());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class ModArmorMaterials {

public static final Holder<ArmorMaterial> ADAMANTIUM = REGISTER.register("adamantium", () -> new ArmorMaterial(
Util.make(new Object2IntOpenHashMap<>(), map -> map.defaultReturnValue(4)),
2, SoundEvents.ARMOR_EQUIP_DIAMOND, () -> Ingredient.of(ModItems.ADAMANTIUM.get()), List.of(), 3, 5
2, SoundEvents.ARMOR_EQUIP_DIAMOND, () -> Ingredient.of(ModItems.ADAMANTIUM.get()), List.of(new ArmorMaterial.Layer(TrimmedTest.id("adamantium"))), 3, 5
));
}

0 comments on commit 9f49b3e

Please sign in to comment.