Highly incomplete code. First work on porting to 1.12. Still need to rework a LOT of things.
This commit is contained in:
@@ -32,6 +32,7 @@ import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockStainedGlass;
|
||||
import net.minecraft.block.BlockStainedGlassPane;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -45,6 +46,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -419,9 +422,10 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -77,6 +78,8 @@ import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.util.LookDirection;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
@@ -87,10 +90,11 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
super( AEConfig.instance().getMatterCannonBattery() );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
@@ -191,7 +195,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).expand( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
@@ -213,7 +217,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
final float f1 = 0.3F;
|
||||
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 );
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().grow( f1, f1, f1 );
|
||||
final RayTraceResult RayTraceResult = boundingBox.calculateIntercept( Vec3d, Vec3d1 );
|
||||
|
||||
if( RayTraceResult != null )
|
||||
@@ -309,7 +313,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
hasDestroyed = false;
|
||||
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).expand( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
@@ -331,7 +335,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
final float f1 = 0.3F;
|
||||
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 );
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().grow( f1, f1, f1 );
|
||||
final RayTraceResult RayTraceResult = boundingBox.calculateIntercept( Vec3d, Vec3d1 );
|
||||
|
||||
if( RayTraceResult != null )
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.items.tools.powered;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -78,9 +79,10 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.items.tools.powered;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -70,9 +71,10 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
if( stack.hasTagCompound() )
|
||||
{
|
||||
|
||||
@@ -22,12 +22,12 @@ package appeng.items.tools.powered.powersink;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
@@ -36,6 +36,8 @@ import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
@@ -52,8 +54,9 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
this.powerCapacity = powerCapacity;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
@@ -77,9 +80,9 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
super.getCheckedSubItems( sameItem, creativeTab, itemStacks );
|
||||
super.getCheckedSubItems( creativeTab, itemStacks );
|
||||
|
||||
final ItemStack charged = new ItemStack( this, 1 );
|
||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
|
||||
Reference in New Issue
Block a user