Fixed seeds, materials and other things
This commit is contained in:
@@ -20,6 +20,7 @@ package appeng.items.misc;
|
||||
|
||||
|
||||
import appeng.api.implementations.items.IGrowableCrystal;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.entity.EntityGrowingCrystal;
|
||||
import appeng.items.AEBaseItem;
|
||||
@@ -33,6 +34,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
@@ -68,6 +70,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
public ItemCrystalSeed(Properties properties, IItemProvider grownItem) {
|
||||
super(properties);
|
||||
this.grownItem = Preconditions.checkNotNull(grownItem);
|
||||
// Expose the growth of the seed to the model system
|
||||
addPropertyOverride(new ResourceLocation("appliedenergistics2:growth"),
|
||||
(is, w, p) -> getGrowthTicks(is) / (float) GROWTH_TICKS_REQUIRED);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.items.misc;
|
||||
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -34,13 +33,12 @@ public class ItemPaintBall extends AEBaseItem
|
||||
{
|
||||
|
||||
private static final String TAG_COLOR = "c";
|
||||
private static final String TAG_LUMEN = "l";
|
||||
|
||||
private static final ITextComponent LUMEN_PREFIX = new TranslationTextComponent(GuiText.Lumen.getTranslationKey())
|
||||
.appendText(" ");
|
||||
private final boolean lumen;
|
||||
|
||||
public ItemPaintBall(Properties properties) {
|
||||
public ItemPaintBall(Properties properties, boolean lumen) {
|
||||
super(properties);
|
||||
this.lumen = lumen;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,12 +51,7 @@ public class ItemPaintBall extends AEBaseItem
|
||||
|
||||
private ITextComponent getExtraName( final ItemStack is )
|
||||
{
|
||||
ITextComponent colorText = new TranslationTextComponent(this.getColor(is).translationKey);
|
||||
if (isLumen(is)) {
|
||||
return LUMEN_PREFIX.shallowCopy().appendSibling(colorText);
|
||||
} else {
|
||||
return colorText;
|
||||
}
|
||||
return new TranslationTextComponent(this.getColor(is).translationKey);
|
||||
}
|
||||
|
||||
public AEColor getColor( final ItemStack is )
|
||||
@@ -80,16 +73,9 @@ public class ItemPaintBall extends AEBaseItem
|
||||
return is;
|
||||
}
|
||||
|
||||
public boolean isLumen( final ItemStack is )
|
||||
public boolean isLumen()
|
||||
{
|
||||
CompoundNBT tag = is.getTag();
|
||||
return tag != null && tag.getBoolean(TAG_LUMEN);
|
||||
}
|
||||
|
||||
public ItemStack setLumen( final ItemStack is, boolean lumen )
|
||||
{
|
||||
is.getOrCreateTag().putBoolean(TAG_LUMEN, lumen);
|
||||
return is;
|
||||
return lumen;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,14 +88,6 @@ public class ItemPaintBall extends AEBaseItem
|
||||
itemStacks.add( setColor(new ItemStack( this ), c) );
|
||||
}
|
||||
}
|
||||
|
||||
for( final AEColor c : AEColor.values() )
|
||||
{
|
||||
if( c != AEColor.TRANSPARENT )
|
||||
{
|
||||
itemStacks.add( setLumen(setColor(new ItemStack( this ), c), true) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,14 +31,10 @@ import appeng.bootstrap.ItemRenderingCustomizer;
|
||||
public class ItemPaintBallRendering extends ItemRenderingCustomizer
|
||||
{
|
||||
|
||||
private static final ModelResourceLocation MODEL_NORMAL = new ModelResourceLocation( "appliedenergistics2:paint_ball" );
|
||||
private static final ModelResourceLocation MODEL_SHIMMER = new ModelResourceLocation( "appliedenergistics2:paint_ball_shimmer" );
|
||||
|
||||
@Override
|
||||
public void customize( IItemRendering rendering )
|
||||
{
|
||||
rendering.color( ItemPaintBallRendering::getColorFromItemstack );
|
||||
rendering.variants( MODEL_NORMAL, MODEL_SHIMMER );
|
||||
// FIXME rendering.meshDefinition( is -> ItemPaintBall.isLumen( is ) ? MODEL_SHIMMER : MODEL_NORMAL );
|
||||
}
|
||||
|
||||
@@ -47,7 +43,7 @@ public class ItemPaintBallRendering extends ItemRenderingCustomizer
|
||||
ItemPaintBall item = (ItemPaintBall) stack.getItem();
|
||||
final AEColor col = item.getColor( stack );
|
||||
|
||||
boolean lumen = item.isLumen(stack);
|
||||
boolean lumen = item.isLumen();
|
||||
final int colorValue = lumen ? col.mediumVariant : col.mediumVariant;
|
||||
final int r = ( colorValue >> 16 ) & 0xff;
|
||||
final int g = ( colorValue >> 8 ) & 0xff;
|
||||
|
||||
Reference in New Issue
Block a user