Skip to content

Commit

Permalink
feat: make flesh plunderer magic outline emissive
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Aug 10, 2023
1 parent 828e1a5 commit 94d4a55
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.elenterius.biomancy.BiomancyMod;
import com.github.elenterius.biomancy.init.ModItems;
import com.github.elenterius.biomancy.item.weapon.DespoilingSwordItem;
import com.google.gson.JsonObject;
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -13,6 +14,7 @@
import net.minecraftforge.client.model.generators.ItemModelBuilder;
import net.minecraftforge.client.model.generators.ItemModelProvider;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.client.model.generators.loaders.ItemLayersModelBuilder;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
Expand Down Expand Up @@ -80,7 +82,7 @@ protected void registerModels() {
serumItem(ModItems.CORROSIVE_ADDITIVE);

basicItem(ModItems.PRIMORDIAL_CORE);
handheldWeaponItem(ModItems.DESPOIL_SICKLE);
fleshPlunderer(ModItems.DESPOIL_SICKLE);
basicItem(ModItems.CREATOR_MIX);
basicItem(ModItems.NUTRIENT_PASTE);
basicItem(ModItems.NUTRIENT_BAR);
Expand All @@ -102,6 +104,15 @@ protected void registerModels() {
ModItems.ITEMS.getEntries().stream().map(RegistryObject::get).filter(SpawnEggItem.class::isInstance).forEach(this::spawnEggItem);
}

public <T extends DespoilingSwordItem> void fleshPlunderer(RegistryObject<T> registryObject) {
ResourceLocation registryKey = registryObject.getId();
getBuilder(registryKey.toString())
.parent(new ModelFile.UncheckedModelFile("item/handheld"))
.customLoader(ItemLayersModelBuilder::begin).emissive(1).end()
.texture(LAYER_0_TEXTURE, new ResourceLocation(registryKey.getNamespace(), ITEM_FOLDER + "/weapon/" + registryKey.getPath()))
.texture(LAYER_1_TEXTURE, new ResourceLocation(registryKey.getNamespace(), ITEM_FOLDER + "/weapon/" + registryKey.getPath() + "_emissive"));
}

public <T extends Item> ItemModelBuilder basicItem(RegistryObject<T> registryObject) {
return basicItem(registryObject.getId());
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94d4a55

Please sign in to comment.