Added older registries back in

This commit is contained in:
Sebastian Hartte
2020-06-04 23:25:11 +02:00
parent 70444999b9
commit 51e82587c7
38 changed files with 453 additions and 434 deletions
@@ -56,9 +56,8 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
// rather simple client side caching.
private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<>();
public ItemEncodedPattern()
{
super(new Item.Properties().maxStackSize(1));
public ItemEncodedPattern(Properties properties) {
super(properties);
}
@Override
@@ -45,12 +45,9 @@ public class ItemPartRendering extends ItemRenderingCustomizer
private final PartModels partModels;
private final ItemPart item;
public ItemPartRendering( PartModels partModels, ItemPart item )
public ItemPartRendering( PartModels partModels )
{
this.partModels = partModels;
this.item = item;
}
@Override
@@ -137,10 +134,10 @@ public class ItemPartRendering extends ItemRenderingCustomizer
this.partModels.registerModels( partResourceLocs );
}
private ModelResourceLocation getItemMeshDefinition( ItemStack is )
{
PartType partType = this.item.getTypeByStack( is );
int variant = this.item.variantOf( is.getDamage() );
return partType.getItemModels().get( variant );
}
// FIXME private ModelResourceLocation getItemMeshDefinition( ItemStack is )
// FIXME {
// FIXME PartType partType = this.item.getTypeByStack( is );
// FIXME int variant = this.item.variantOf( is.getDamage() );
// FIXME return partType.getItemModels().get( variant );
// FIXME }
}
@@ -46,7 +46,6 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
public ItemCreativeStorageCell(Properties props)
{
super(props);
// FIXME this.setMaxStackSize( 1 );
}
@Override
@@ -44,12 +44,11 @@ import appeng.util.prioritylist.PrecisePriorityList;
public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
{
public ItemViewCell()
{
super(new Item.Properties().maxStackSize(1));
public ItemViewCell(Properties properties) {
super(properties);
}
public static IPartitionList<IAEItemStack> createFilter( final ItemStack[] list )
public static IPartitionList<IAEItemStack> createFilter(final ItemStack[] list )
{
IPartitionList<IAEItemStack> myPartitionList = null;
@@ -49,9 +49,8 @@ import appeng.util.Platform;
public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
{
public ToolBiometricCard()
{
super( new Properties().maxStackSize( 1 ) );
public ToolBiometricCard(Properties properties) {
super(properties);
}
@Override
@@ -62,9 +62,8 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
AEColor.TRANSPARENT,
};
public ToolMemoryCard()
{
super( new Properties().maxStackSize( 1 ) );
public ToolMemoryCard(Properties properties) {
super(properties);
}
@Override
@@ -58,9 +58,8 @@ import appeng.util.Platform;
public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench
{
public ToolNetworkTool()
{
super(new Item.Properties().maxStackSize( 1 ).addToolType( ToolType.get("wrench"), 0 ));
public ToolNetworkTool(Properties properties) {
super(properties);
}
@Override
@@ -20,6 +20,7 @@ package appeng.items.tools.powered;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB;
@@ -35,9 +36,9 @@ import appeng.util.Platform;
public class ToolChargedStaff extends AEBasePoweredItem
{
public ToolChargedStaff()
public ToolChargedStaff(Item.Properties props)
{
super( AEConfig.instance().getChargedStaffBattery() );
super( AEConfig.instance().getChargedStaffBattery(), props );
}
@Override
@@ -51,6 +51,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.SnowballItem;
import net.minecraft.nbt.CompoundNBT;
@@ -87,9 +88,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
}
}
public ToolColorApplicator()
public ToolColorApplicator(Item.Properties props)
{
super( AEConfig.instance().getColorApplicatorBattery() );
super( AEConfig.instance().getColorApplicatorBattery(), props );
}
@Override
@@ -31,6 +31,7 @@ import net.minecraft.block.TNTBlock;
import net.minecraft.block.material.Material;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.ActionResult;
@@ -60,9 +61,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
private final Map<InWorldToolOperationIngredient, InWorldToolOperationResult> heatUp;
private final Map<InWorldToolOperationIngredient, InWorldToolOperationResult> coolDown;
public ToolEntropyManipulator()
public ToolEntropyManipulator(Item.Properties props)
{
super( AEConfig.instance().getEntropyManipulatorBattery() );
super( AEConfig.instance().getEntropyManipulatorBattery(), props );
this.heatUp = new HashMap<>();
this.coolDown = new HashMap<>();
@@ -29,6 +29,7 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.passive.SheepEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
@@ -73,9 +74,9 @@ import appeng.util.Platform;
public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<IAEItemStack>
{
public ToolMatterCannon()
public ToolMatterCannon(Item.Properties props)
{
super( AEConfig.instance().getMatterCannonBattery() );
super( AEConfig.instance().getMatterCannonBattery(), props );
}
@OnlyIn( Dist.CLIENT )
@@ -24,6 +24,7 @@ import java.util.Set;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
@@ -60,9 +61,9 @@ import appeng.util.Platform;
public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell<IAEItemStack>, IGuiItem, IItemGroup
{
public ToolPortableCell()
public ToolPortableCell(Item.Properties props)
{
super( AEConfig.instance().getPortableCellBattery() );
super( AEConfig.instance().getPortableCellBattery(), props );
}
@Override
@@ -24,6 +24,7 @@ import java.util.List;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ActionResult;
@@ -52,9 +53,9 @@ import appeng.util.ConfigManager;
public class ToolWirelessTerminal extends AEBasePoweredItem implements IWirelessTermHandler
{
public ToolWirelessTerminal()
public ToolWirelessTerminal(Item.Properties props)
{
super( AEConfig.instance().getWirelessTerminalBattery() );
super( AEConfig.instance().getWirelessTerminalBattery(), props );
}
@Override
@@ -21,6 +21,7 @@ package appeng.items.tools.powered.powersink;
import java.text.MessageFormat;
import java.util.List;
import java.util.function.DoubleSupplier;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemGroup;
@@ -47,14 +48,12 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
{
private static final String CURRENT_POWER_NBT_KEY = "internalCurrentPower";
private static final String MAX_POWER_NBT_KEY = "internalMaxPower";
private final double powerCapacity;
private final DoubleSupplier powerCapacity;
public AEBasePoweredItem( final double powerCapacity )
public AEBasePoweredItem(final DoubleSupplier powerCapacity, Properties props )
{
super(new Properties().maxStackSize( 1 ).maxDamage( 32 ).setNoRepair());
//FIXME
// this.hasSubtypes = false;
// this.setFull3D();
super(props);
// FIXME this.setFull3D();
this.powerCapacity = powerCapacity;
}
@@ -153,7 +152,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
@Override
public double getAEMaxPower( final ItemStack is )
{
return this.powerCapacity;
return this.powerCapacity.getAsDouble();
}
@Override
@@ -33,9 +33,9 @@ public class ToolQuartzAxe extends AxeItem
{
private final AEFeature type;
public ToolQuartzAxe( final AEFeature type )
public ToolQuartzAxe( Item.Properties props, final AEFeature type )
{
super( ItemTier.IRON, 6.0F, -3.1F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) );
super( ItemTier.IRON, 6.0F, -3.1F, props );
this.type = type;
}
@@ -42,13 +42,9 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
{
private final AEFeature type;
public ToolQuartzCuttingKnife( final AEFeature type )
public ToolQuartzCuttingKnife( Item.Properties props, final AEFeature type )
{
super(new Item.Properties()
.group(ItemGroup.TOOLS)
.maxStackSize(1)
.maxDamage(50)
.setNoRepair());
super(props);
this.type = type;
}
@@ -33,9 +33,9 @@ public class ToolQuartzHoe extends HoeItem
{
private final AEFeature type;
public ToolQuartzHoe( final AEFeature type )
public ToolQuartzHoe( Item.Properties props, final AEFeature type )
{
super( ItemTier.IRON, -1.0F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) );
super( ItemTier.IRON, -1.0F, props);
this.type = type;
}
@@ -33,9 +33,9 @@ public class ToolQuartzPickaxe extends PickaxeItem
{
private final AEFeature type;
public ToolQuartzPickaxe( final AEFeature type )
public ToolQuartzPickaxe( Item.Properties props, final AEFeature type )
{
super( ItemTier.IRON, 1, -2.8F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) );
super( ItemTier.IRON, 1, -2.8F, props );
this.type = type;
}
@@ -33,9 +33,9 @@ public class ToolQuartzSpade extends ShovelItem
{
private final AEFeature type;
public ToolQuartzSpade( final AEFeature type )
public ToolQuartzSpade( Item.Properties props, final AEFeature type )
{
super( ItemTier.IRON, 1.5F, -3.0F, ( new Item.Properties() ).group( ItemGroup.TOOLS ) );
super( ItemTier.IRON, 1.5F, -3.0F, props );
this.type = type;
}
@@ -33,9 +33,9 @@ public class ToolQuartzSword extends SwordItem
{
private final AEFeature type;
public ToolQuartzSword( AEFeature type )
public ToolQuartzSword( Item.Properties props, AEFeature type )
{
super( ItemTier.IRON, 3, -2.4F, ( new Item.Properties() ).group( ItemGroup.COMBAT ) );
super( ItemTier.IRON, 3, -2.4F, props );
this.type = type;
}
@@ -22,6 +22,7 @@ package appeng.items.tools.quartz;
import appeng.core.CreativeTab;
import net.minecraft.block.Block;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
@@ -38,11 +39,9 @@ import appeng.util.Platform;
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench
{
public ToolQuartzWrench()
public ToolQuartzWrench(Item.Properties props)
{
super( new Properties()
.group(ItemGroup.TOOLS)
.maxStackSize( 1 ) );
super( props );
}
@Override