This commit is contained in:
@@ -56,6 +56,7 @@ import appeng.hooks.BlockToolDispenseItemBehavior;
|
|||||||
import appeng.hooks.MatterCannonDispenseItemBehavior;
|
import appeng.hooks.MatterCannonDispenseItemBehavior;
|
||||||
import appeng.items.materials.MaterialType;
|
import appeng.items.materials.MaterialType;
|
||||||
import appeng.items.misc.CrystalSeedItem;
|
import appeng.items.misc.CrystalSeedItem;
|
||||||
|
import appeng.items.misc.CrystalSeedRendering;
|
||||||
import appeng.items.misc.EncodedPatternItem;
|
import appeng.items.misc.EncodedPatternItem;
|
||||||
import appeng.items.misc.PaintBallItem;
|
import appeng.items.misc.PaintBallItem;
|
||||||
import appeng.items.misc.PaintBallItemRendering;
|
import appeng.items.misc.PaintBallItemRendering;
|
||||||
@@ -299,24 +300,15 @@ public final class ApiItems implements IItems {
|
|||||||
this.certusCrystalSeed = registry
|
this.certusCrystalSeed = registry
|
||||||
.item("certus_crystal_seed",
|
.item("certus_crystal_seed",
|
||||||
props -> new CrystalSeedItem(props, materials.purifiedCertusQuartzCrystal().item()))
|
props -> new CrystalSeedItem(props, materials.purifiedCertusQuartzCrystal().item()))
|
||||||
.bootstrap(item -> new IClientSetupComponent() {
|
.bootstrap(CrystalSeedRendering::new).features(AEFeature.CRYSTAL_SEEDS).build();
|
||||||
@Override
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public void setup() {
|
|
||||||
// Expose the growth of the seed to the model system
|
|
||||||
ItemModelsProperties.func_239418_a_(item, new ResourceLocation("appliedenergistics2:growth"),
|
|
||||||
(is, w, p) -> CrystalSeedItem.getGrowthTicks(is)
|
|
||||||
/ (float) CrystalSeedItem.GROWTH_TICKS_REQUIRED);
|
|
||||||
}
|
|
||||||
}).features(AEFeature.CRYSTAL_SEEDS).build();
|
|
||||||
this.fluixCrystalSeed = registry
|
this.fluixCrystalSeed = registry
|
||||||
.item("fluix_crystal_seed",
|
.item("fluix_crystal_seed",
|
||||||
props -> new CrystalSeedItem(props, materials.purifiedFluixCrystal().item()))
|
props -> new CrystalSeedItem(props, materials.purifiedFluixCrystal().item()))
|
||||||
.features(AEFeature.CRYSTAL_SEEDS).build();
|
.bootstrap(CrystalSeedRendering::new).features(AEFeature.CRYSTAL_SEEDS).build();
|
||||||
this.netherQuartzSeed = registry
|
this.netherQuartzSeed = registry
|
||||||
.item("nether_quartz_seed",
|
.item("nether_quartz_seed",
|
||||||
props -> new CrystalSeedItem(props, materials.purifiedNetherQuartzCrystal().item()))
|
props -> new CrystalSeedItem(props, materials.purifiedNetherQuartzCrystal().item()))
|
||||||
.features(AEFeature.CRYSTAL_SEEDS).build();
|
.bootstrap(CrystalSeedRendering::new).features(AEFeature.CRYSTAL_SEEDS).build();
|
||||||
|
|
||||||
GrowingCrystalEntity.TYPE = registry
|
GrowingCrystalEntity.TYPE = registry
|
||||||
.<GrowingCrystalEntity>entity("growing_crystal", GrowingCrystalEntity::new, EntityClassification.MISC)
|
.<GrowingCrystalEntity>entity("growing_crystal", GrowingCrystalEntity::new, EntityClassification.MISC)
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package appeng.items.misc;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemModelsProperties;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
import appeng.bootstrap.components.IClientSetupComponent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exposes a predicate "growth", which is used in the item model to
|
||||||
|
* differentiate the growth stages.
|
||||||
|
*/
|
||||||
|
public class CrystalSeedRendering implements IClientSetupComponent {
|
||||||
|
private final Item item;
|
||||||
|
|
||||||
|
public CrystalSeedRendering(Item item) {
|
||||||
|
this.item = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public void setup() {
|
||||||
|
// Expose the growth of the seed to the model system
|
||||||
|
ItemModelsProperties.func_239418_a_(item, new ResourceLocation("appliedenergistics2:growth"),
|
||||||
|
(is, w, p) -> CrystalSeedItem.getGrowthTicks(is) / (float) CrystalSeedItem.GROWTH_TICKS_REQUIRED);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user