Fix custom item entities not showing on the client

Fix crystal growth not syncing
This commit is contained in:
Sebastian Hartte
2020-06-13 20:25:00 +02:00
parent b9381fc2e1
commit 0db7e70722
19 changed files with 111 additions and 51 deletions
@@ -20,7 +20,6 @@ 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;
@@ -111,12 +110,16 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
public void addInformation(final ItemStack stack, final World world, final List<ITextComponent> lines, final ITooltipFlag advancedTooltips )
{
lines.add( ButtonToolTips.DoesntDespawn.getTranslationKey() );
final int progress = getGrowthTicks( stack );
lines.add( new StringTextComponent( Math.round( 100 * progress / (float) GROWTH_TICKS_REQUIRED ) + "%" ) );
lines.add(getGrowthTooltipItem(stack));
super.addInformation( stack, world, lines, advancedTooltips );
}
public ITextComponent getGrowthTooltipItem(ItemStack stack) {
final int progress = getGrowthTicks( stack );
return new StringTextComponent( Math.round( 100 * progress / (float) GROWTH_TICKS_REQUIRED ) + "%" );
}
@Override
public int getEntityLifespan( final ItemStack itemStack, final World world )
{