Lots of compile fixes
This commit is contained in:
@@ -27,8 +27,8 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.NonNullList;
|
||||
@@ -59,9 +59,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
public static final int FLUIX = SINGLE_OFFSET * 2;
|
||||
public static final int FINAL_STAGE = SINGLE_OFFSET * 3;
|
||||
|
||||
public ItemCrystalSeed()
|
||||
{
|
||||
this.setHasSubtypes( true );
|
||||
public ItemCrystalSeed(Properties properties) {
|
||||
super(properties);
|
||||
// FIXME this.setHasSubtypes( true );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -75,9 +75,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
.maybeStack( 1 )
|
||||
.map( crystalSeedStack ->
|
||||
{
|
||||
crystalSeedStack.setItemDamage( certus2 );
|
||||
// FIXME crystalSeedStack.setItemDamage( certus2 );
|
||||
crystalSeedStack = newStyle( crystalSeedStack );
|
||||
String itemName = crystalSeedStack.getItem().getRegistryName().getResourcePath();
|
||||
String itemName = crystalSeedStack.getItem().getRegistryName().getPath();
|
||||
return new ResolverResult( itemName, crystalSeedStack.getDamage(), crystalSeedStack.getTag() );
|
||||
} )
|
||||
.orElse( null );
|
||||
@@ -101,7 +101,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
final int progress;
|
||||
final CompoundNBT comp = is.getOrCreateTag();
|
||||
comp.putInt( "progress", progress = is.getDamage() );
|
||||
is.setItemDamage( ( is.getDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET );
|
||||
// FIXME is.setItemDamage( ( is.getDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET );
|
||||
return progress;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
{
|
||||
final CompoundNBT comp = is.getOrCreateTag();
|
||||
comp.putInt( "progress", newDamage );
|
||||
is.setItemDamage( is.getDamage() / LEVEL_OFFSET * LEVEL_OFFSET );
|
||||
// FIXME is.setItemDamage( is.getDamage() / LEVEL_OFFSET * LEVEL_OFFSET );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,22 +239,21 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
|
||||
// lvl 0
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, CERTUS ) ) );
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, NETHER ) ) );
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, FLUIX ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , CERTUS */ ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , NETHER */ ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , FLUIX */ ) ) );
|
||||
|
||||
// lvl 1
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET + CERTUS ) ) );
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET + NETHER ) ) );
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET + FLUIX ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , LEVEL_OFFSET + CERTUS */ ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , LEVEL_OFFSET + NETHER */ ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , LEVEL_OFFSET + FLUIX */ ) ) );
|
||||
|
||||
// lvl 2
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET * 2 + CERTUS ) ) );
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET * 2 + NETHER ) ) );
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET * 2 + FLUIX ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , LEVEL_OFFSET * 2 + CERTUS */ ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , LEVEL_OFFSET * 2 + NETHER */ ) ) );
|
||||
items.add( newStyle( new ItemStack( this, 1 /* FIXME , LEVEL_OFFSET * 2 + FLUIX */ ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.items.misc;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -55,49 +54,49 @@ public class ItemCrystalSeedRendering extends ItemRenderingCustomizer
|
||||
public void customize( IItemRendering rendering )
|
||||
{
|
||||
rendering.variants( ImmutableList.<ResourceLocation>builder().add( MODELS_CERTUS ).add( MODELS_FLUIX ).add( MODELS_NETHER ).build() );
|
||||
rendering.meshDefinition( this.getItemMeshDefinition() );
|
||||
// FIXME rendering.meshDefinition( this.getItemMeshDefinition() );
|
||||
}
|
||||
|
||||
private ItemMeshDefinition getItemMeshDefinition()
|
||||
{
|
||||
return is ->
|
||||
{
|
||||
int damage = ItemCrystalSeed.getProgress( is );
|
||||
|
||||
// Split the damage value into crystal type and growth level
|
||||
int type = damage / ItemCrystalSeed.SINGLE_OFFSET;
|
||||
int level = ( damage % ItemCrystalSeed.SINGLE_OFFSET ) / ItemCrystalSeed.LEVEL_OFFSET;
|
||||
|
||||
// Determine which list of models to use based on the type of crystal
|
||||
ModelResourceLocation[] models;
|
||||
switch( type )
|
||||
{
|
||||
case 0:
|
||||
models = MODELS_CERTUS;
|
||||
break;
|
||||
case 1:
|
||||
models = MODELS_NETHER;
|
||||
break;
|
||||
case 2:
|
||||
models = MODELS_FLUIX;
|
||||
break;
|
||||
default:
|
||||
// We use this as the fallback for broken items
|
||||
models = MODELS_CERTUS;
|
||||
break;
|
||||
}
|
||||
|
||||
// Return one of the 3 models based on the level
|
||||
if( level < 0 )
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
else if( level >= models.length )
|
||||
{
|
||||
level = models.length - 1;
|
||||
}
|
||||
|
||||
return models[level];
|
||||
};
|
||||
}
|
||||
// FIXME private ItemMeshDefinition getItemMeshDefinition()
|
||||
// FIXME {
|
||||
// FIXME return is ->
|
||||
// FIXME {
|
||||
// FIXME int damage = ItemCrystalSeed.getProgress( is );
|
||||
// FIXME
|
||||
// FIXME // Split the damage value into crystal type and growth level
|
||||
// FIXME int type = damage / ItemCrystalSeed.SINGLE_OFFSET;
|
||||
// FIXME int level = ( damage % ItemCrystalSeed.SINGLE_OFFSET ) / ItemCrystalSeed.LEVEL_OFFSET;
|
||||
// FIXME
|
||||
// FIXME // Determine which list of models to use based on the type of crystal
|
||||
// FIXME ModelResourceLocation[] models;
|
||||
// FIXME switch( type )
|
||||
// FIXME {
|
||||
// FIXME case 0:
|
||||
// FIXME models = MODELS_CERTUS;
|
||||
// FIXME break;
|
||||
// FIXME case 1:
|
||||
// FIXME models = MODELS_NETHER;
|
||||
// FIXME break;
|
||||
// FIXME case 2:
|
||||
// FIXME models = MODELS_FLUIX;
|
||||
// FIXME break;
|
||||
// FIXME default:
|
||||
// FIXME // We use this as the fallback for broken items
|
||||
// FIXME models = MODELS_CERTUS;
|
||||
// FIXME break;
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME // Return one of the 3 models based on the level
|
||||
// FIXME if( level < 0 )
|
||||
// FIXME {
|
||||
// FIXME level = 0;
|
||||
// FIXME }
|
||||
// FIXME else if( level >= models.length )
|
||||
// FIXME {
|
||||
// FIXME level = models.length - 1;
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME return models[level];
|
||||
// FIXME };
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
@@ -19,25 +19,6 @@
|
||||
package appeng.items.misc;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.implementations.ICraftingPatternItem;
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -48,6 +29,26 @@ import appeng.helpers.InvalidPatternHelper;
|
||||
import appeng.helpers.PatternHelper;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
|
||||
public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternItem
|
||||
@@ -115,34 +116,35 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
return;
|
||||
}
|
||||
|
||||
stack.setStackDisplayName( TextFormatting.RED + GuiText.InvalidPattern.getLocal() );
|
||||
stack.setDisplayName(new TranslationTextComponent(GuiText.InvalidPattern.getTranslationKey())
|
||||
.applyTextStyle(TextFormatting.RED));
|
||||
|
||||
InvalidPatternHelper invalid = new InvalidPatternHelper( stack );
|
||||
|
||||
final String label = ( invalid.isCraftable() ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": ";
|
||||
final String and = ' ' + GuiText.And.getLocal() + ' ';
|
||||
final String with = GuiText.With.getLocal() + ": ";
|
||||
final ITextComponent label = new TranslationTextComponent( invalid.isCraftable() ? GuiText.Crafts.getTranslationKey() : GuiText.Creates.getTranslationKey() ).appendText(": ");
|
||||
final ITextComponent and = new StringTextComponent(" ").appendSibling(new TranslationTextComponent(GuiText.And.getTranslationKey())).appendText(" ");
|
||||
final ITextComponent with = new TranslationTextComponent(GuiText.With.getTranslationKey()).appendText(": ");
|
||||
|
||||
boolean first = true;
|
||||
for( final InvalidPatternHelper.PatternIngredient output : invalid.getOutputs() )
|
||||
{
|
||||
lines.add( ( first ? label : and ) + output.getFormattedToolTip() );
|
||||
lines.add( ( first ? label : and ).shallowCopy().appendSibling(output.getFormattedToolTip()) );
|
||||
first = false;
|
||||
}
|
||||
|
||||
first = true;
|
||||
for( final InvalidPatternHelper.PatternIngredient input : invalid.getInputs() )
|
||||
{
|
||||
lines.add( ( first ? with : and ) + input.getFormattedToolTip() );
|
||||
lines.add( ( first ? with : and ).shallowCopy().appendSibling(input.getFormattedToolTip()) );
|
||||
first = false;
|
||||
}
|
||||
|
||||
if( invalid.isCraftable() )
|
||||
{
|
||||
final String substitutionLabel = GuiText.Substitute.getLocal() + " ";
|
||||
final String canSubstitute = invalid.canSubstitute() ? GuiText.Yes.getLocal() : GuiText.No.getLocal();
|
||||
final ITextComponent substitutionLabel = new TranslationTextComponent(GuiText.Substitute.getTranslationKey()).appendText(" ");
|
||||
final ITextComponent canSubstitute = new TranslationTextComponent(invalid.canSubstitute() ? GuiText.Yes.getTranslationKey() : GuiText.No.getTranslationKey());
|
||||
|
||||
lines.add( substitutionLabel + canSubstitute );
|
||||
lines.add( substitutionLabel.appendSibling(canSubstitute) );
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -159,9 +161,9 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
final IAEItemStack[] in = details.getCondensedInputs();
|
||||
final IAEItemStack[] out = details.getCondensedOutputs();
|
||||
|
||||
final String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": ";
|
||||
final String and = ' ' + GuiText.And.getLocal() + ' ';
|
||||
final String with = GuiText.With.getLocal() + ": ";
|
||||
final ITextComponent label = ( isCrafting ? GuiText.Crafts.textComponent() : GuiText.Creates.textComponent() ).appendText(": ");
|
||||
final ITextComponent and = new StringTextComponent(" ").appendSibling(GuiText.And.textComponent()).appendText(" ");
|
||||
final ITextComponent with = GuiText.With.textComponent().appendText(": ");
|
||||
|
||||
boolean first = true;
|
||||
for( final IAEItemStack anOut : out )
|
||||
@@ -171,7 +173,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
continue;
|
||||
}
|
||||
|
||||
lines.add( ( first ? label : and ) + anOut.getStackSize() + ' ' + Platform.getItemDisplayName( anOut ) );
|
||||
lines.add( ( first ? label : and ).shallowCopy().appendText(anOut.getStackSize() + " ").appendSibling(Platform.getItemDisplayName( anOut )));
|
||||
first = false;
|
||||
}
|
||||
|
||||
@@ -183,16 +185,16 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
continue;
|
||||
}
|
||||
|
||||
lines.add( ( first ? with : and ) + anIn.getStackSize() + ' ' + Platform.getItemDisplayName( anIn ) );
|
||||
lines.add((first ? with : and).shallowCopy().appendText(anIn.getStackSize() + " ").appendSibling(Platform.getItemDisplayName(anIn)));
|
||||
first = false;
|
||||
}
|
||||
|
||||
if( isCrafting )
|
||||
{
|
||||
final String substitutionLabel = GuiText.Substitute.getLocal() + " ";
|
||||
final String canSubstitute = substitute ? GuiText.Yes.getLocal() : GuiText.No.getLocal();
|
||||
final ITextComponent substitutionLabel = GuiText.Substitute.textComponent().appendText(" ");
|
||||
final ITextComponent canSubstitute = substitute ? GuiText.Yes.textComponent() : GuiText.No.textComponent();
|
||||
|
||||
lines.add( substitutionLabel + canSubstitute );
|
||||
lines.add( substitutionLabel.appendSibling(canSubstitute) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ public class ItemPaintBall extends AEBaseItem
|
||||
|
||||
private static final int DAMAGE_THRESHOLD = 20;
|
||||
|
||||
public ItemPaintBall()
|
||||
{
|
||||
this.setHasSubtypes( true );
|
||||
public ItemPaintBall(Properties properties) {
|
||||
super(properties);
|
||||
// FIXME this.setHasSubtypes( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,7 +84,7 @@ public class ItemPaintBall extends AEBaseItem
|
||||
{
|
||||
if( c != AEColor.TRANSPARENT )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, c.ordinal() ) );
|
||||
itemStacks.add( new ItemStack( this, 1 /* FIXME, c.ordinal() */ ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ItemPaintBall extends AEBaseItem
|
||||
{
|
||||
if( c != AEColor.TRANSPARENT )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, DAMAGE_THRESHOLD + c.ordinal() ) );
|
||||
itemStacks.add( new ItemStack( this, 1 /* FIXME , DAMAGE_THRESHOLD + c.ordinal() */ ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ItemPaintBallRendering extends ItemRenderingCustomizer
|
||||
{
|
||||
rendering.color( ItemPaintBallRendering::getColorFromItemstack );
|
||||
rendering.variants( MODEL_NORMAL, MODEL_SHIMMER );
|
||||
rendering.meshDefinition( is -> ItemPaintBall.isLumen( is ) ? MODEL_SHIMMER : MODEL_NORMAL );
|
||||
// FIXME rendering.meshDefinition( is -> ItemPaintBall.isLumen( is ) ? MODEL_SHIMMER : MODEL_NORMAL );
|
||||
}
|
||||
|
||||
private static int getColorFromItemstack( ItemStack stack, int tintIndex )
|
||||
|
||||
Reference in New Issue
Block a user