-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d4b497
commit 9094bd5
Showing
6 changed files
with
54 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
src/main/java/net/wizards/client/armor/WizardArmorModel.java
This file was deleted.
Oops, something went wrong.
39 changes: 33 additions & 6 deletions
39
src/main/java/net/wizards/client/armor/WizardArmorRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,37 @@ | ||
package net.wizards.client.armor; | ||
|
||
import mod.azure.azurelibarmor.common.api.client.renderer.GeoArmorRenderer; | ||
import net.wizards.item.WizardArmor; | ||
import mod.azure.azurelibarmor.rewrite.render.armor.AzArmorRenderer; | ||
import mod.azure.azurelibarmor.rewrite.render.armor.AzArmorRendererConfig; | ||
import net.minecraft.util.Identifier; | ||
import net.wizards.WizardsMod; | ||
|
||
public class WizardArmorRenderer extends GeoArmorRenderer<WizardArmor> { | ||
public WizardArmorRenderer() { | ||
super(new WizardArmorModel()); | ||
public class WizardArmorRenderer extends AzArmorRenderer { | ||
public static WizardArmorRenderer wizard() { | ||
return new WizardArmorRenderer("wizard_robes", "wizard_robe"); | ||
} | ||
} | ||
public static WizardArmorRenderer arcane() { | ||
return new WizardArmorRenderer("wizard_robes", "arcane_robe"); | ||
} | ||
public static WizardArmorRenderer fire() { | ||
return new WizardArmorRenderer("wizard_robes", "fire_robe"); | ||
} | ||
public static WizardArmorRenderer frost() { | ||
return new WizardArmorRenderer("wizard_robes", "frost_robe"); | ||
} | ||
public static WizardArmorRenderer netheriteArcane() { | ||
return new WizardArmorRenderer("wizard_robes", "netherite_arcane_robe"); | ||
} | ||
public static WizardArmorRenderer netheriteFire() { | ||
return new WizardArmorRenderer("wizard_robes", "netherite_fire_robe"); | ||
} | ||
public static WizardArmorRenderer netheriteFrost() { | ||
return new WizardArmorRenderer("wizard_robes", "netherite_frost_robe"); | ||
} | ||
|
||
public WizardArmorRenderer(String modelName, String textureName) { | ||
super(AzArmorRendererConfig.builder( | ||
Identifier.of(WizardsMod.ID, "geo/" + modelName + ".geo.json"), | ||
Identifier.of(WizardsMod.ID, "textures/armor/" + textureName + ".png") | ||
).build()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,11 @@ | ||
package net.wizards.item; | ||
|
||
import mod.azure.azurelibarmor.common.api.client.renderer.GeoArmorRenderer; | ||
import mod.azure.azurelibarmor.common.api.common.animatable.GeoItem; | ||
import mod.azure.azurelibarmor.common.internal.client.RenderProvider; | ||
import mod.azure.azurelibarmor.common.internal.common.util.AzureLibUtil; | ||
import mod.azure.azurelibarmor.core.animatable.instance.AnimatableInstanceCache; | ||
import mod.azure.azurelibarmor.core.animation.AnimatableManager; | ||
import net.minecraft.client.render.entity.model.BipedEntityModel; | ||
import net.minecraft.entity.EquipmentSlot; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.item.ArmorMaterial; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
import net.spell_engine.api.item.armor.Armor; | ||
import net.wizards.client.armor.WizardArmorRenderer; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public class WizardArmor extends Armor.CustomItem implements GeoItem { | ||
public class WizardArmor extends Armor.CustomItem { | ||
public WizardArmor(RegistryEntry<ArmorMaterial> material, Type slot, Settings settings) { | ||
super(material, slot, settings); | ||
} | ||
|
||
// MARK: GeoItem | ||
|
||
@Override | ||
public void createRenderer(Consumer<RenderProvider> consumer) { | ||
consumer.accept(new RenderProvider() { | ||
private GeoArmorRenderer<?> renderer; | ||
@Override | ||
public BipedEntityModel<LivingEntity> getHumanoidArmorModel(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, BipedEntityModel<LivingEntity> original) { | ||
if (this.renderer == null) { | ||
this.renderer = new WizardArmorRenderer(); | ||
} | ||
this.renderer.prepForRender(livingEntity, itemStack, equipmentSlot, original); | ||
return this.renderer; | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public void registerControllers(AnimatableManager.ControllerRegistrar controllers) { } | ||
|
||
private final AnimatableInstanceCache cache = AzureLibUtil.createInstanceCache(this); | ||
|
||
@Override | ||
public AnimatableInstanceCache getAnimatableInstanceCache() { | ||
return cache; | ||
} | ||
} |