Re-enabled the WAILA handler, using Hwyla.

This commit is contained in:
Gunther De Wachter
2017-07-14 21:48:20 +02:00
parent 458356a2be
commit fdab91323c
19 changed files with 1598 additions and 1570 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ forge_version=14.21.1.2412
######################################################### #########################################################
# Installable # # Installable #
######################################################### #########################################################
waila_version=1.7.0-B3_1.9.4 hwyla_version=1.8.19-B33_1.12
######################################################### #########################################################
# Provided APIs # # Provided APIs #
+10 -4
View File
@@ -53,6 +53,11 @@ repositories {
name 'mcjty' name 'mcjty'
url "http://maven.k-4u.nl/" url "http://maven.k-4u.nl/"
} }
maven { // Hwyla
name 'tehnut'
url "http://tehnut.info/maven"
}
} }
configurations { configurations {
@@ -61,18 +66,19 @@ configurations {
dependencies { dependencies {
// installable runtime dependencies // installable runtime dependencies
//mods "mcp.mobius.waila:Waila:${waila_version}" mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
//mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev" mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}" mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}"
// mods "com.github.mcjty:compatlayer:${compatlayer_version}" // mods "com.github.mcjty:compatlayer:${compatlayer_version}"
// compile against provided APIs // compile against provided APIs
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api" compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
//compileOnly "mcp.mobius.waila:Waila:${waila_version}" compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}"
compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}" compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}"
//compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api" compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api" compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
// deobfCompile "mcp.mobius.waila:Hwyla:${hwyla_version}"
deobfCompile "cofh:RedstoneFlux:${minecraft_version}-${rf_version}:universal" deobfCompile "cofh:RedstoneFlux:${minecraft_version}-${rf_version}:universal"
// at runtime, use the full JEI jar // at runtime, use the full JEI jar
+5 -5
View File
@@ -20,15 +20,15 @@ task wrapper(type: Wrapper) {
gradleVersion = "2.14" gradleVersion = "2.14"
} }
// WAILA // HWYLA
task installWaila(type: Copy, dependsOn: "deinstallWaila") { task installHwyla(type: Copy, dependsOn: "deinstallHwyla") {
from { configurations.mods } from { configurations.mods }
include "**/*Waila*.jar" include "**/*Hwyla*.jar"
into file(minecraft.runDir + "/mods") into file(minecraft.runDir + "/mods")
} }
task deinstallWaila(type: Delete) { task deinstallHwyla(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar") delete fileTree(dir: minecraft.runDir + "/mods", include: "*Hwyla*.jar")
} }
// IC2 // IC2
@@ -19,43 +19,58 @@
package appeng.integration; package appeng.integration;
// import appeng.integration.modules.ic2.IC2Module; import appeng.integration.modules.ic2.IC2Module;
import appeng.integration.modules.jei.JEIModule; import appeng.integration.modules.jei.JEIModule;
import appeng.integration.modules.rf.RFModule;
import appeng.integration.modules.theoneprobe.TheOneProbeModule; import appeng.integration.modules.theoneprobe.TheOneProbeModule;
// import appeng.integration.modules.waila.WailaModule; import appeng.integration.modules.waila.WailaModule;
public enum IntegrationType public enum IntegrationType
{ {
// IC2( IntegrationSide.BOTH, "Industrial Craft 2", "IC2" ) IC2( IntegrationSide.BOTH, "Industrial Craft 2", "ic2" )
// { {
// @Override @Override
// public IIntegrationModule createInstance() public IIntegrationModule createInstance()
// { {
// return Integrations.setIc2( new IC2Module() ); return Integrations.setIc2( new IC2Module() );
// } }
// }, },
RC( IntegrationSide.BOTH, "Railcraft", "Railcraft" ), RC( IntegrationSide.BOTH, "Railcraft", "railcraft" ),
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ), RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "redstoneflux" )
{
@Override
public IIntegrationModule createInstance()
{
return new RFModule();
}
},
RFItem( IntegrationSide.BOTH, "RedstoneFlux Power - Items", "CoFHAPI" ), RFItem( IntegrationSide.BOTH, "RedstoneFlux Power - Items", "redstoneflux" )
{
@Override
public IIntegrationModule createInstance()
{
return new RFModule();
}
},
MFR( IntegrationSide.BOTH, "Mine Factory Reloaded", "MineFactoryReloaded" ), MFR( IntegrationSide.BOTH, "Mine Factory Reloaded", "minefactoryreloaded" ),
// Waila( IntegrationSide.BOTH, "Waila", "Waila" ) Waila( IntegrationSide.BOTH, "Waila", "waila" )
// { {
// @Override @Override
// public IIntegrationModule createInstance() public IIntegrationModule createInstance()
// { {
// return new WailaModule(); return new WailaModule();
// } }
// }, },
InvTweaks( IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks" ), InvTweaks( IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks" ),
JEI( IntegrationSide.CLIENT, "Just Enough Items", "JEI" ) JEI( IntegrationSide.CLIENT, "Just Enough Items", "jei" )
{ {
@Override @Override
public IIntegrationModule createInstance() public IIntegrationModule createInstance()
@@ -64,9 +79,9 @@ public enum IntegrationType
} }
}, },
Mekanism( IntegrationSide.BOTH, "Mekanism", "Mekanism" ), Mekanism( IntegrationSide.BOTH, "Mekanism", "mekanism" ),
OpenComputers( IntegrationSide.BOTH, "OpenComputers", "OpenComputers" ), OpenComputers( IntegrationSide.BOTH, "OpenComputers", "opencomputers" ),
THE_ONE_PROBE( IntegrationSide.BOTH, "TheOneProbe", "theoneprobe" ) THE_ONE_PROBE( IntegrationSide.BOTH, "TheOneProbe", "theoneprobe" )
{ {
@@ -90,7 +105,9 @@ public enum IntegrationType
public IIntegrationModule createInstance() public IIntegrationModule createInstance()
{ {
throw new UnsupportedOperationException(); return new IIntegrationModule()
{
};
} }
} }
@@ -1,74 +1,74 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila; package appeng.integration.modules.waila;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.IWailaDataProvider;
//
//
///** /**
// * Base implementation for {@link mcp.mobius.waila.api.IWailaDataProvider} * Base implementation for {@link mcp.mobius.waila.api.IWailaDataProvider}
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public abstract class BaseWailaDataProvider implements IWailaDataProvider public abstract class BaseWailaDataProvider implements IWailaDataProvider
//{ {
// @Override @Override
// public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return null; return ItemStack.EMPTY;
// } }
//
// @Override @Override
// public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos ) public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos )
// { {
// return tag; return tag;
// } }
//} }
@@ -1,198 +1,198 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila; package appeng.integration.modules.waila;
//
//
//import java.util.List; import java.util.List;
//import java.util.Optional; import java.util.Optional;
//
//import com.google.common.collect.Lists; import com.google.common.collect.Lists;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.IWailaDataProvider;
//
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//import appeng.integration.modules.waila.part.ChannelWailaDataProvider; import appeng.integration.modules.waila.part.ChannelWailaDataProvider;
//import appeng.integration.modules.waila.part.IPartWailaDataProvider; import appeng.integration.modules.waila.part.IPartWailaDataProvider;
//import appeng.integration.modules.waila.part.P2PStateWailaDataProvider; import appeng.integration.modules.waila.part.P2PStateWailaDataProvider;
//import appeng.integration.modules.waila.part.PartAccessor; import appeng.integration.modules.waila.part.PartAccessor;
//import appeng.integration.modules.waila.part.PartStackWailaDataProvider; import appeng.integration.modules.waila.part.PartStackWailaDataProvider;
//import appeng.integration.modules.waila.part.PowerStateWailaDataProvider; import appeng.integration.modules.waila.part.PowerStateWailaDataProvider;
//import appeng.integration.modules.waila.part.StorageMonitorWailaDataProvider; import appeng.integration.modules.waila.part.StorageMonitorWailaDataProvider;
//import appeng.integration.modules.waila.part.Tracer; import appeng.integration.modules.waila.part.Tracer;
//
//
///** /**
// * Delegation provider for parts through {@link IPartWailaDataProvider} * Delegation provider for parts through {@link IPartWailaDataProvider}
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class PartWailaDataProvider implements IWailaDataProvider public final class PartWailaDataProvider implements IWailaDataProvider
//{ {
// /** /**
// * Contains all providers * Contains all providers
// */ */
// private final List<IPartWailaDataProvider> providers; private final List<IPartWailaDataProvider> providers;
//
// /** /**
// * Can access parts through view-hits * Can access parts through view-hits
// */ */
// private final PartAccessor accessor = new PartAccessor(); private final PartAccessor accessor = new PartAccessor();
//
// /** /**
// * Traces views hit on blocks * Traces views hit on blocks
// */ */
// private final Tracer tracer = new Tracer(); private final Tracer tracer = new Tracer();
//
// /** /**
// * Initializes the provider list with all wanted providers * Initializes the provider list with all wanted providers
// */ */
// public PartWailaDataProvider() public PartWailaDataProvider()
// { {
// final IPartWailaDataProvider channel = new ChannelWailaDataProvider(); final IPartWailaDataProvider channel = new ChannelWailaDataProvider();
// final IPartWailaDataProvider storageMonitor = new StorageMonitorWailaDataProvider(); final IPartWailaDataProvider storageMonitor = new StorageMonitorWailaDataProvider();
// final IPartWailaDataProvider powerState = new PowerStateWailaDataProvider(); final IPartWailaDataProvider powerState = new PowerStateWailaDataProvider();
// final IPartWailaDataProvider p2pState = new P2PStateWailaDataProvider(); final IPartWailaDataProvider p2pState = new P2PStateWailaDataProvider();
// final IPartWailaDataProvider partStack = new PartStackWailaDataProvider(); final IPartWailaDataProvider partStack = new PartStackWailaDataProvider();
//
// this.providers = Lists.newArrayList( channel, storageMonitor, powerState, partStack, p2pState ); this.providers = Lists.newArrayList( channel, storageMonitor, powerState, partStack, p2pState );
// } }
//
// @Override @Override
// public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
// final RayTraceResult mop = accessor.getMOP(); final RayTraceResult mop = accessor.getMOP();
//
//
// final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop ); final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
//
// if( maybePart.isPresent() ) if( maybePart.isPresent() )
// { {
// final IPart part = maybePart.get(); final IPart part = maybePart.get();
//
// ItemStack wailaStack = null; ItemStack wailaStack = ItemStack.EMPTY;
//
// for( final IPartWailaDataProvider provider : this.providers ) for( final IPartWailaDataProvider provider : this.providers )
// { {
// wailaStack = provider.getWailaStack( part, config, wailaStack ); wailaStack = provider.getWailaStack( part, config, wailaStack );
// } }
// return wailaStack; return wailaStack;
// } }
//
// return null; return ItemStack.EMPTY;
// } }
//
// @Override @Override
// public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
// final RayTraceResult mop = accessor.getMOP(); final RayTraceResult mop = accessor.getMOP();
//
// final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop ); final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
//
// if( maybePart.isPresent() ) if( maybePart.isPresent() )
// { {
// final IPart part = maybePart.get(); final IPart part = maybePart.get();
//
// for( final IPartWailaDataProvider provider : this.providers ) for( final IPartWailaDataProvider provider : this.providers )
// { {
// provider.getWailaHead( part, currentToolTip, accessor, config ); provider.getWailaHead( part, currentToolTip, accessor, config );
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
// final RayTraceResult mop = accessor.getMOP(); final RayTraceResult mop = accessor.getMOP();
//
// final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop ); final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
//
// if( maybePart.isPresent() ) if( maybePart.isPresent() )
// { {
// final IPart part = maybePart.get(); final IPart part = maybePart.get();
//
// for( final IPartWailaDataProvider provider : this.providers ) for( final IPartWailaDataProvider provider : this.providers )
// { {
// provider.getWailaBody( part, currentToolTip, accessor, config ); provider.getWailaBody( part, currentToolTip, accessor, config );
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
// final RayTraceResult mop = accessor.getMOP(); final RayTraceResult mop = accessor.getMOP();
//
// final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop ); final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
//
// if( maybePart.isPresent() ) if( maybePart.isPresent() )
// { {
// final IPart part = maybePart.get(); final IPart part = maybePart.get();
//
// for( final IPartWailaDataProvider provider : this.providers ) for( final IPartWailaDataProvider provider : this.providers )
// { {
// provider.getWailaTail( part, currentToolTip, accessor, config ); provider.getWailaTail( part, currentToolTip, accessor, config );
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, BlockPos pos ) public NBTTagCompound getNBTData( final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, final World world, BlockPos pos )
// { {
// final RayTraceResult mop = this.tracer.retraceBlock( world, player, pos ); final RayTraceResult mop = this.tracer.retraceBlock( world, player, pos );
//
// if( mop != null ) if( mop != null )
// { {
// final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop ); final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
//
// if( maybePart.isPresent() ) if( maybePart.isPresent() )
// { {
// final IPart part = maybePart.get(); final IPart part = maybePart.get();
//
// for( final IPartWailaDataProvider provider : this.providers ) for( final IPartWailaDataProvider provider : this.providers )
// { {
// provider.getNBTData( player, part, te, tag, world, pos ); provider.getNBTData( player, part, te, tag, world, pos );
// } }
// } }
// } }
//
// return tag; return tag;
// } }
//} }
@@ -1,119 +1,119 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila; package appeng.integration.modules.waila;
//
//
//import java.util.List; import java.util.List;
//
//import com.google.common.collect.Lists; import com.google.common.collect.Lists;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.IWailaDataProvider;
//
//import appeng.integration.modules.waila.tile.ChargerWailaDataProvider; import appeng.integration.modules.waila.tile.ChargerWailaDataProvider;
//import appeng.integration.modules.waila.tile.CraftingMonitorWailaDataProvider; import appeng.integration.modules.waila.tile.CraftingMonitorWailaDataProvider;
//import appeng.integration.modules.waila.tile.PowerStateWailaDataProvider; import appeng.integration.modules.waila.tile.PowerStateWailaDataProvider;
//import appeng.integration.modules.waila.tile.PowerStorageWailaDataProvider; import appeng.integration.modules.waila.tile.PowerStorageWailaDataProvider;
//
//
///** /**
// * Delegation provider for tiles through {@link mcp.mobius.waila.api.IWailaDataProvider} * Delegation provider for tiles through {@link mcp.mobius.waila.api.IWailaDataProvider}
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class TileWailaDataProvider implements IWailaDataProvider public final class TileWailaDataProvider implements IWailaDataProvider
//{ {
// /** /**
// * Contains all providers * Contains all providers
// */ */
// private final List<IWailaDataProvider> providers; private final List<IWailaDataProvider> providers;
//
// /** /**
// * Initializes the provider list with all wanted providers * Initializes the provider list with all wanted providers
// */ */
// public TileWailaDataProvider() public TileWailaDataProvider()
// { {
// final IWailaDataProvider charger = new ChargerWailaDataProvider(); final IWailaDataProvider charger = new ChargerWailaDataProvider();
// final IWailaDataProvider energyCell = new PowerStorageWailaDataProvider(); final IWailaDataProvider energyCell = new PowerStorageWailaDataProvider();
// final IWailaDataProvider craftingBlock = new PowerStateWailaDataProvider(); final IWailaDataProvider craftingBlock = new PowerStateWailaDataProvider();
// final IWailaDataProvider craftingMonitor = new CraftingMonitorWailaDataProvider(); final IWailaDataProvider craftingMonitor = new CraftingMonitorWailaDataProvider();
//
// this.providers = Lists.newArrayList( charger, energyCell, craftingBlock, craftingMonitor ); this.providers = Lists.newArrayList( charger, energyCell, craftingBlock, craftingMonitor );
// } }
//
// @Override @Override
// public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public ItemStack getWailaStack( final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return null; return ItemStack.EMPTY;
// } }
//
// @Override @Override
// public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaHead( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// for( final IWailaDataProvider provider : this.providers ) for( final IWailaDataProvider provider : this.providers )
// { {
// provider.getWailaHead( itemStack, currentToolTip, accessor, config ); provider.getWailaHead( itemStack, currentToolTip, accessor, config );
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// for( final IWailaDataProvider provider : this.providers ) for( final IWailaDataProvider provider : this.providers )
// { {
// provider.getWailaBody( itemStack, currentToolTip, accessor, config ); provider.getWailaBody( itemStack, currentToolTip, accessor, config );
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaTail( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// for( final IWailaDataProvider provider : this.providers ) for( final IWailaDataProvider provider : this.providers )
// { {
// provider.getWailaTail( itemStack, currentToolTip, accessor, config ); provider.getWailaTail( itemStack, currentToolTip, accessor, config );
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos)
// { {
// for( final IWailaDataProvider provider : this.providers ) for( final IWailaDataProvider provider : this.providers )
// { {
// provider.getNBTData( player, te, tag, world, pos ); provider.getNBTData( player, te, tag, world, pos );
// } }
//
// return tag; return tag;
// } }
//} }
@@ -1,64 +1,64 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila; package appeng.integration.modules.waila;
//
//
//import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.event.FMLInterModComms;
//
//import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.IWailaDataProvider;
//import mcp.mobius.waila.api.IWailaRegistrar; import mcp.mobius.waila.api.IWailaRegistrar;
//
//import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
//import appeng.integration.IntegrationHelper; import appeng.integration.IntegrationHelper;
//import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
//
//
//public class WailaModule implements IIntegrationModule public class WailaModule implements IIntegrationModule
//{ {
//
// public WailaModule() public WailaModule()
// { {
// IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaDataProvider.class ); IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaDataProvider.class );
// IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaRegistrar.class ); IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaRegistrar.class );
// IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaConfigHandler.class ); IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaConfigHandler.class );
// IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaDataAccessor.class ); IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.IWailaDataAccessor.class );
// IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.ITaggedList.class ); IntegrationHelper.testClassExistence( this, mcp.mobius.waila.api.ITaggedList.class );
// } }
//
// public static void register( final IWailaRegistrar registrar ) public static void register( final IWailaRegistrar registrar )
// { {
// final IWailaDataProvider partHost = new PartWailaDataProvider(); final IWailaDataProvider partHost = new PartWailaDataProvider();
//
// registrar.registerStackProvider( partHost, AEBaseTile.class ); registrar.registerStackProvider( partHost, AEBaseTile.class );
// registrar.registerBodyProvider( partHost, AEBaseTile.class ); registrar.registerBodyProvider( partHost, AEBaseTile.class );
// registrar.registerNBTProvider( partHost, AEBaseTile.class ); registrar.registerNBTProvider( partHost, AEBaseTile.class );
//
// final IWailaDataProvider tile = new TileWailaDataProvider(); final IWailaDataProvider tile = new TileWailaDataProvider();
//
// registrar.registerBodyProvider( tile, AEBaseTile.class ); registrar.registerBodyProvider( tile, AEBaseTile.class );
// registrar.registerNBTProvider( tile, AEBaseTile.class ); registrar.registerNBTProvider( tile, AEBaseTile.class );
// } }
//
// @Override @Override
// public void init() throws Throwable public void init() throws Throwable
// { {
// FMLInterModComms.sendMessage( "Waila", "register", this.getClass().getName() + ".register" ); FMLInterModComms.sendMessage( "waila", "register", this.getClass().getName() + ".register" );
// } }
//
//} }
@@ -1,75 +1,75 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//
//
///** /**
// * Default implementation of {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} * Default implementation of {@link appeng.integration.modules.waila.part.IPartWailaDataProvider}
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public abstract class BasePartWailaDataProvider implements IPartWailaDataProvider public abstract class BasePartWailaDataProvider implements IPartWailaDataProvider
//{ {
// @Override @Override
// public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, final ItemStack partStack ) public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, final ItemStack partStack )
// { {
// return null; return ItemStack.EMPTY;
// } }
//
// @Override @Override
// public List<String> getWailaHead( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaHead( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public List<String> getWailaTail( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaTail( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos ) public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos )
// { {
// return tag; return tag;
// } }
//} }
@@ -1,163 +1,163 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import gnu.trove.map.TObjectByteMap; import gnu.trove.map.TObjectByteMap;
//import gnu.trove.map.hash.TObjectByteHashMap; import gnu.trove.map.hash.TObjectByteHashMap;
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//import appeng.parts.networking.PartCableSmart; import appeng.parts.networking.PartCableSmart;
//import appeng.parts.networking.PartDenseCable; import appeng.parts.networking.PartDenseCable;
//
//
///** /**
// * Channel-information provider for WAILA * Channel-information provider for WAILA
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class ChannelWailaDataProvider extends BasePartWailaDataProvider public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
//{ {
// /** /**
// * Channel key used for the transferred {@link net.minecraft.nbt.NBTTagCompound} * Channel key used for the transferred {@link net.minecraft.nbt.NBTTagCompound}
// */ */
// private static final String ID_USED_CHANNELS = "usedChannels"; private static final String ID_USED_CHANNELS = "usedChannels";
//
// /** /**
// * Used cache for channels if the channel was not transmitted through the server. * Used cache for channels if the channel was not transmitted through the server.
// * <p/> * <p/>
// * This is useful, when a player just started to look at a tile and thus just requested the new information from the * This is useful, when a player just started to look at a tile and thus just requested the new information from the
// * server. * server.
// * <p/> * <p/>
// * The cache will be updated from the server. * The cache will be updated from the server.
// */ */
// private final TObjectByteMap<IPart> cache = new TObjectByteHashMap<IPart>(); private final TObjectByteMap<IPart> cache = new TObjectByteHashMap<IPart>();
//
// /** /**
// * Adds the used and max channel to the tool tip * Adds the used and max channel to the tool tip
// * *
// * @param part being looked at part * @param part being looked at part
// * @param currentToolTip current tool tip * @param currentToolTip current tool tip
// * @param accessor wrapper for various world information * @param accessor wrapper for various world information
// * @param config config to react to various settings * @param config config to react to various settings
// * *
// * @return modified tool tip * @return modified tool tip
// */ */
// @Override @Override
// public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// if( part instanceof PartCableSmart || part instanceof PartDenseCable ) if( part instanceof PartCableSmart || part instanceof PartDenseCable )
// { {
// final NBTTagCompound tag = accessor.getNBTData(); final NBTTagCompound tag = accessor.getNBTData();
//
// final byte usedChannels = this.getUsedChannels( part, tag, this.cache ); final byte usedChannels = this.getUsedChannels( part, tag, this.cache );
//
// if( usedChannels >= 0 ) if( usedChannels >= 0 )
// { {
// final byte maxChannels = (byte) ( ( part instanceof PartDenseCable ) ? 32 : 8 ); final byte maxChannels = (byte) ( ( part instanceof PartDenseCable ) ? 32 : 8 );
//
// final String formattedToolTip = String.format( WailaText.Channels.getLocal(), usedChannels, maxChannels ); final String formattedToolTip = String.format( WailaText.Channels.getLocal(), usedChannels, maxChannels );
// currentToolTip.add( formattedToolTip ); currentToolTip.add( formattedToolTip );
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// /** /**
// * Determines the source of the channel. * Determines the source of the channel.
// * <p/> * <p/>
// * If the client received information of the channels on the server, they are used, else if the cache contains a * If the client received information of the channels on the server, they are used, else if the cache contains a
// * previous stored value, this will be used. Default value is 0. * previous stored value, this will be used. Default value is 0.
// * *
// * @param part part to be looked at * @param part part to be looked at
// * @param tag tag maybe containing the channel information * @param tag tag maybe containing the channel information
// * @param cache cache with previous knowledge * @param cache cache with previous knowledge
// * *
// * @return used channels on the cable * @return used channels on the cable
// */ */
// private byte getUsedChannels( final IPart part, final NBTTagCompound tag, final TObjectByteMap<IPart> cache ) private byte getUsedChannels( final IPart part, final NBTTagCompound tag, final TObjectByteMap<IPart> cache )
// { {
// final byte usedChannels; final byte usedChannels;
//
// if( tag.hasKey( ID_USED_CHANNELS ) ) if( tag.hasKey( ID_USED_CHANNELS ) )
// { {
// usedChannels = tag.getByte( ID_USED_CHANNELS ); usedChannels = tag.getByte( ID_USED_CHANNELS );
// this.cache.put( part, usedChannels ); this.cache.put( part, usedChannels );
// } }
// else if( this.cache.containsKey( part ) ) else if( this.cache.containsKey( part ) )
// { {
// usedChannels = this.cache.get( part ); usedChannels = this.cache.get( part );
// } }
// else else
// { {
// usedChannels = -1; usedChannels = -1;
// } }
//
// return usedChannels; return usedChannels;
// } }
//
// /** /**
// * Called on server to transfer information from server to client. * Called on server to transfer information from server to client.
// * <p/> * <p/>
// * If the part is a cable, it writes the channel information in the {@code #tag} using the {@code ID_USED_CHANNELS} * If the part is a cable, it writes the channel information in the {@code #tag} using the {@code ID_USED_CHANNELS}
// * key. * key.
// * *
// * @param player player looking at the part * @param player player looking at the part
// * @param part part being looked at * @param part part being looked at
// * @param te host of the part * @param te host of the part
// * @param tag transferred tag which is send to the client * @param tag transferred tag which is send to the client
// * @param world world of the part * @param world world of the part
// * @param pos pos of the part * @param pos pos of the part
// * *
// * @return tag send to the client * @return tag send to the client
// */ */
// @Override @Override
// public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos ) public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos )
// { {
// if( part instanceof PartCableSmart || part instanceof PartDenseCable ) if( part instanceof PartCableSmart || part instanceof PartDenseCable )
// { {
// final NBTTagCompound tempTag = new NBTTagCompound(); final NBTTagCompound tempTag = new NBTTagCompound();
//
// part.writeToNBT( tempTag ); part.writeToNBT( tempTag );
//
// if( tempTag.hasKey( ID_USED_CHANNELS ) ) if( tempTag.hasKey( ID_USED_CHANNELS ) )
// { {
// final byte usedChannels = tempTag.getByte( ID_USED_CHANNELS ); final byte usedChannels = tempTag.getByte( ID_USED_CHANNELS );
//
// tag.setByte( ID_USED_CHANNELS, usedChannels ); tag.setByte( ID_USED_CHANNELS, usedChannels );
// } }
// } }
//
// return tag; return tag;
// } }
//} }
@@ -1,56 +1,56 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//
//
///** /**
// * An abstraction layer of the {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} for * An abstraction layer of the {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} for
// * {@link appeng.api.parts.IPart}. * {@link appeng.api.parts.IPart}.
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public interface IPartWailaDataProvider public interface IPartWailaDataProvider
//{ {
// ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack ); ItemStack getWailaStack( IPart part, IWailaConfigHandler config, ItemStack partStack );
//
// List<String> getWailaHead( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ); List<String> getWailaHead( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config );
//
// List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ); List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config );
//
// List<String> getWailaTail( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config ); List<String> getWailaTail( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config );
//
// NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos ); NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos );
//} }
@@ -1,158 +1,158 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import java.util.List; import java.util.List;
//
//import com.google.common.collect.Iterators; import com.google.common.collect.Iterators;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//import appeng.me.GridAccessException; import appeng.me.GridAccessException;
//import appeng.parts.p2p.PartP2PTunnel; import appeng.parts.p2p.PartP2PTunnel;
//
//
///** /**
// * Provides information about a P2P tunnel to WAILA. * Provides information about a P2P tunnel to WAILA.
// */ */
//public final class P2PStateWailaDataProvider extends BasePartWailaDataProvider public final class P2PStateWailaDataProvider extends BasePartWailaDataProvider
//{ {
//
// private static final int STATE_UNLINKED = 0; private static final int STATE_UNLINKED = 0;
// private static final int STATE_OUTPUT = 1; private static final int STATE_OUTPUT = 1;
// private static final int STATE_INPUT = 2; private static final int STATE_INPUT = 2;
// public static final String TAG_P2P_STATE = "p2p_state"; public static final String TAG_P2P_STATE = "p2p_state";
//
// /** /**
// * Adds state to the tooltip * Adds state to the tooltip
// * *
// * @param part part with state * @param part part with state
// * @param currentToolTip to be added to tooltip * @param currentToolTip to be added to tooltip
// * @param accessor wrapper for various information * @param accessor wrapper for various information
// * @param config config settings * @param config config settings
// * *
// * @return modified tooltip * @return modified tooltip
// */ */
// @Override @Override
// public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// if( part instanceof PartP2PTunnel ) if( part instanceof PartP2PTunnel )
// { {
// NBTTagCompound nbtData = accessor.getNBTData(); NBTTagCompound nbtData = accessor.getNBTData();
// if( nbtData.hasKey( TAG_P2P_STATE ) ) if( nbtData.hasKey( TAG_P2P_STATE ) )
// { {
// int[] stateArr = nbtData.getIntArray( TAG_P2P_STATE ); int[] stateArr = nbtData.getIntArray( TAG_P2P_STATE );
// if( stateArr.length == 2 ) if( stateArr.length == 2 )
// { {
// int state = stateArr[0]; int state = stateArr[0];
// int outputs = stateArr[1]; int outputs = stateArr[1];
//
// switch( state ) switch( state )
// { {
// case STATE_UNLINKED: case STATE_UNLINKED:
// currentToolTip.add( WailaText.P2PUnlinked.getLocal() ); currentToolTip.add( WailaText.P2PUnlinked.getLocal() );
// break; break;
// case STATE_OUTPUT: case STATE_OUTPUT:
// currentToolTip.add( WailaText.P2POutput.getLocal() ); currentToolTip.add( WailaText.P2POutput.getLocal() );
// break; break;
// case STATE_INPUT: case STATE_INPUT:
// currentToolTip.add( getOutputText( outputs ) ); currentToolTip.add( getOutputText( outputs ) );
// break; break;
// } }
// } }
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// @Override @Override
// public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos ) public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, BlockPos pos )
// { {
// if( part instanceof PartP2PTunnel ) if( part instanceof PartP2PTunnel )
// { {
// PartP2PTunnel tunnel = (PartP2PTunnel) part; PartP2PTunnel tunnel = (PartP2PTunnel) part;
//
// // The default state // The default state
// int state = STATE_UNLINKED; int state = STATE_UNLINKED;
// int outputCount = 0; int outputCount = 0;
//
// if( !tunnel.isOutput() ) if( !tunnel.isOutput() )
// { {
// outputCount = getOutputCount( tunnel ); outputCount = getOutputCount( tunnel );
// if( outputCount > 0 ) if( outputCount > 0 )
// { {
// // Only set it to INPUT if we know there are any outputs // Only set it to INPUT if we know there are any outputs
// state = STATE_INPUT; state = STATE_INPUT;
// } }
// } }
// else else
// { {
// PartP2PTunnel input = tunnel.getInput(); PartP2PTunnel input = tunnel.getInput();
// if( input != null ) if( input != null )
// { {
// state = STATE_OUTPUT; state = STATE_OUTPUT;
// } }
// } }
//
// tag.setIntArray( TAG_P2P_STATE, new int[] { tag.setIntArray( TAG_P2P_STATE, new int[] {
// state, state,
// outputCount outputCount
// } ); } );
// } }
//
// return tag; return tag;
// } }
//
// private static int getOutputCount( PartP2PTunnel tunnel ) private static int getOutputCount( PartP2PTunnel tunnel )
// { {
// try try
// { {
// return Iterators.size( tunnel.getOutputs().iterator() ); return Iterators.size( tunnel.getOutputs().iterator() );
// } }
// catch( GridAccessException e ) catch( GridAccessException e )
// { {
// // Well... unknown size it is! // Well... unknown size it is!
// return 0; return 0;
// } }
// } }
//
// private static String getOutputText( int outputs ) private static String getOutputText( int outputs )
// { {
// if( outputs <= 1 ) if( outputs <= 1 )
// { {
// return WailaText.P2PInputOneOutput.getLocal(); return WailaText.P2PInputOneOutput.getLocal();
// } }
// else else
// { {
// return String.format( WailaText.P2PInputManyOutputs.getLocal(), outputs ); return String.format( WailaText.P2PInputManyOutputs.getLocal(), outputs );
// } }
// } }
//
//} }
@@ -1,47 +1,47 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//import appeng.api.parts.PartItemStack; import appeng.api.parts.PartItemStack;
//
//
///** /**
// * Part ItemStack provider for WAILA * Part ItemStack provider for WAILA
// * *
// * @author TheJulianJES * @author TheJulianJES
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public class PartStackWailaDataProvider extends BasePartWailaDataProvider public class PartStackWailaDataProvider extends BasePartWailaDataProvider
//{ {
//
// @Override @Override
// public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, ItemStack partStack ) public ItemStack getWailaStack( final IPart part, final IWailaConfigHandler config, ItemStack partStack )
// { {
// partStack = part.getItemStack( PartItemStack.PICK ); partStack = part.getItemStack( PartItemStack.PICK );
// return partStack; return partStack;
// } }
//
//} }
@@ -1,91 +1,91 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import java.util.List; import java.util.List;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.IPowerChannelState;
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//
//
///** /**
// * Power state provider for WAILA * Power state provider for WAILA
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider
//{ {
// /** /**
// * Adds state to the tooltip * Adds state to the tooltip
// * *
// * @param part part with state * @param part part with state
// * @param currentToolTip to be added to tooltip * @param currentToolTip to be added to tooltip
// * @param accessor wrapper for various information * @param accessor wrapper for various information
// * @param config config settings * @param config config settings
// * *
// * @return modified tooltip * @return modified tooltip
// */ */
// @Override @Override
// public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// if( part instanceof IPowerChannelState ) if( part instanceof IPowerChannelState )
// { {
// final IPowerChannelState state = (IPowerChannelState) part; final IPowerChannelState state = (IPowerChannelState) part;
//
// currentToolTip.add( this.getToolTip( state.isActive(), state.isPowered() ) ); currentToolTip.add( this.getToolTip( state.isActive(), state.isPowered() ) );
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// /** /**
// * Gets the corresponding tool tip for different values of {@code #isActive} and {@code #isPowered} * Gets the corresponding tool tip for different values of {@code #isActive} and {@code #isPowered}
// * *
// * @param isActive if part is active * @param isActive if part is active
// * @param isPowered if part is powered * @param isPowered if part is powered
// * *
// * @return tooltip of the state * @return tooltip of the state
// */ */
// private String getToolTip( final boolean isActive, final boolean isPowered ) private String getToolTip( final boolean isActive, final boolean isPowered )
// { {
// final String result; final String result;
//
// if( isActive && isPowered ) if( isActive && isPowered )
// { {
// result = WailaText.DeviceOnline.getLocal(); result = WailaText.DeviceOnline.getLocal();
// } }
// else if( isPowered ) else if( isPowered )
// { {
// result = WailaText.DeviceMissingChannel.getLocal(); result = WailaText.DeviceMissingChannel.getLocal();
// } }
// else else
// { {
// result = WailaText.DeviceOffline.getLocal(); result = WailaText.DeviceOffline.getLocal();
// } }
//
// return result; return result;
// } }
//} }
@@ -1,81 +1,81 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.part; package appeng.integration.modules.waila.part;
//
//
//import java.util.List; import java.util.List;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.implementations.parts.IPartStorageMonitor; import appeng.api.implementations.parts.IPartStorageMonitor;
//import appeng.api.parts.IPart; import appeng.api.parts.IPart;
//import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEFluidStack;
//import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
//import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IAEStack;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//
//
///** /**
// * Storage monitor provider for WAILA * Storage monitor provider for WAILA
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProvider public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProvider
//{ {
// /** /**
// * Displays the stack if present and if the monitor is locked. * Displays the stack if present and if the monitor is locked.
// * Can handle fluids and items. * Can handle fluids and items.
// * *
// * @param part maybe storage monitor * @param part maybe storage monitor
// * @param currentToolTip to be written to tooltip * @param currentToolTip to be written to tooltip
// * @param accessor information wrapper * @param accessor information wrapper
// * @param config config option * @param config config option
// * *
// * @return modified tooltip * @return modified tooltip
// */ */
// @Override @Override
// public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final IPart part, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// if( part instanceof IPartStorageMonitor ) if( part instanceof IPartStorageMonitor )
// { {
// final IPartStorageMonitor monitor = (IPartStorageMonitor) part; final IPartStorageMonitor monitor = (IPartStorageMonitor) part;
//
// final IAEStack<?> displayed = monitor.getDisplayed(); final IAEStack<?> displayed = monitor.getDisplayed();
// final boolean isLocked = monitor.isLocked(); final boolean isLocked = monitor.isLocked();
//
// if( displayed instanceof IAEItemStack ) if( displayed instanceof IAEItemStack )
// { {
// final IAEItemStack ais = (IAEItemStack) displayed; final IAEItemStack ais = (IAEItemStack) displayed;
// currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() ); currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() );
// } }
// else if( displayed instanceof IAEFluidStack ) else if( displayed instanceof IAEFluidStack )
// { {
// final IAEFluidStack ais = (IAEFluidStack) displayed; final IAEFluidStack ais = (IAEFluidStack) displayed;
// currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) ); currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) );
// } }
//
// currentToolTip.add( ( isLocked ) ? WailaText.Locked.getLocal() : WailaText.Unlocked.getLocal() ); currentToolTip.add( ( isLocked ) ? WailaText.Locked.getLocal() : WailaText.Unlocked.getLocal() );
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//} }
@@ -1,78 +1,83 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.tile; package appeng.integration.modules.waila.tile;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.entity.player.EntityPlayer; import net.minecraft.client.Minecraft;
//import net.minecraft.inventory.IInventory; import net.minecraft.client.util.ITooltipFlag;
//import net.minecraft.item.ItemStack; import net.minecraft.entity.player.EntityPlayer;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.inventory.IInventory;
// import net.minecraft.item.ItemStack;
//import mcp.mobius.waila.api.IWailaConfigHandler; import net.minecraft.tileentity.TileEntity;
//import mcp.mobius.waila.api.IWailaDataAccessor;
// import mcp.mobius.waila.api.IWailaConfigHandler;
//import appeng.core.localization.WailaText; import mcp.mobius.waila.api.IWailaDataAccessor;
//import appeng.integration.modules.waila.BaseWailaDataProvider;
//import appeng.tile.misc.TileCharger; import appeng.core.localization.WailaText;
// import appeng.integration.modules.waila.BaseWailaDataProvider;
// import appeng.tile.misc.TileCharger;
///**
// * Charger provider for WAILA import javax.annotation.Nonnull;
// *
// * @author thatsIch
// * @version rv2 /**
// * @since rv2 * Charger provider for WAILA
// */ *
//public final class ChargerWailaDataProvider extends BaseWailaDataProvider * @author thatsIch
//{ * @version rv2
// /** * @since rv2
// * Displays the holding item and its tooltip */
// * public final class ChargerWailaDataProvider extends BaseWailaDataProvider
// * @param itemStack stack of charger {
// * @param currentToolTip unmodified tooltip /**
// * @param accessor wrapper information * Displays the holding item and its tooltip
// * @param config config option *
// * * @param itemStack stack of charger
// * @return modified tooltip * @param currentToolTip unmodified tooltip
// */ * @param accessor wrapper information
// @Override * @param config config option
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) *
// { * @return modified tooltip
// final TileEntity te = accessor.getTileEntity(); */
// if( te instanceof TileCharger ) @Override
// { public List<String> getWailaBody( @Nonnull final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// final TileCharger charger = (TileCharger) te; {
// final IInventory chargerInventory = charger.getInternalInventory(); final TileEntity te = accessor.getTileEntity();
// final ItemStack chargingItem = chargerInventory.getStackInSlot( 0 ); if( te instanceof TileCharger )
// {
// if( chargingItem != null ) final TileCharger charger = (TileCharger) te;
// { final IInventory chargerInventory = charger.getInternalInventory();
// final String currentInventory = chargingItem.getDisplayName(); final ItemStack chargingItem = chargerInventory.getStackInSlot( 0 );
// final EntityPlayer player = accessor.getPlayer();
// if( !chargingItem.isEmpty() )
// currentToolTip.add( WailaText.Contains + ": " + currentInventory ); {
// chargingItem.getItem().addInformation( chargingItem, player, currentToolTip, true ); final String currentInventory = chargingItem.getDisplayName();
// } final EntityPlayer player = accessor.getPlayer();
// }
// currentToolTip.add( WailaText.Contains + ": " + currentInventory );
// return currentToolTip; ITooltipFlag.TooltipFlags tooltipFlag = Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
// } chargingItem.getItem().addInformation( chargingItem, player.world, currentToolTip, tooltipFlag );
//} }
}
return currentToolTip;
}
}
@@ -1,74 +1,74 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.tile; package appeng.integration.modules.waila.tile;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//import appeng.integration.modules.waila.BaseWailaDataProvider; import appeng.integration.modules.waila.BaseWailaDataProvider;
//import appeng.tile.crafting.TileCraftingMonitorTile; import appeng.tile.crafting.TileCraftingMonitorTile;
//
//
///** /**
// * Crafting-monitor provider for WAILA * Crafting-monitor provider for WAILA
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvider public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvider
//{ {
// /** /**
// * Displays the item currently crafted by the CPU cluster * Displays the item currently crafted by the CPU cluster
// * *
// * @param itemStack stack of crafting monitor * @param itemStack stack of crafting monitor
// * @param currentToolTip unmodified tooltip * @param currentToolTip unmodified tooltip
// * @param accessor information wrapper * @param accessor information wrapper
// * @param config config option * @param config config option
// * *
// * @return modified tooltip * @return modified tooltip
// */ */
// @Override @Override
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
// if( te instanceof TileCraftingMonitorTile ) if( te instanceof TileCraftingMonitorTile )
// { {
// final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) te; final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) te;
// final IAEItemStack displayStack = monitor.getJobProgress(); final IAEItemStack displayStack = monitor.getJobProgress();
//
// if( displayStack != null ) if( displayStack != null )
// { {
// final String currentCrafting = displayStack.getItemStack().getDisplayName(); final String currentCrafting = displayStack.getItemStack().getDisplayName();
//
// currentToolTip.add( WailaText.Crafting.getLocal() + ": " + currentCrafting ); currentToolTip.add( WailaText.Crafting.getLocal() + ": " + currentCrafting );
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//} }
@@ -1,82 +1,82 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.tile; package appeng.integration.modules.waila.tile;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.IPowerChannelState;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//import appeng.integration.modules.waila.BaseWailaDataProvider; import appeng.integration.modules.waila.BaseWailaDataProvider;
//
//
///** /**
// * Power state provider for WAILA * Power state provider for WAILA
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class PowerStateWailaDataProvider extends BaseWailaDataProvider public final class PowerStateWailaDataProvider extends BaseWailaDataProvider
//{ {
// /** /**
// * Adds state to the tooltip * Adds state to the tooltip
// * *
// * @param itemStack stack of power state * @param itemStack stack of power state
// * @param currentToolTip to be added to tooltip * @param currentToolTip to be added to tooltip
// * @param accessor wrapper for various information * @param accessor wrapper for various information
// * @param config config settings * @param config config settings
// * *
// * @return modified tooltip * @return modified tooltip
// */ */
// @Override @Override
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
//
// if( te instanceof IPowerChannelState ) if( te instanceof IPowerChannelState )
// { {
// final IPowerChannelState state = (IPowerChannelState) te; final IPowerChannelState state = (IPowerChannelState) te;
//
// final boolean isActive = state.isActive(); final boolean isActive = state.isActive();
// final boolean isPowered = state.isPowered(); final boolean isPowered = state.isPowered();
//
// if( isActive && isPowered ) if( isActive && isPowered )
// { {
// currentToolTip.add( WailaText.DeviceOnline.getLocal() ); currentToolTip.add( WailaText.DeviceOnline.getLocal() );
// } }
// else if( isPowered ) else if( isPowered )
// { {
// currentToolTip.add( WailaText.DeviceMissingChannel.getLocal() ); currentToolTip.add( WailaText.DeviceMissingChannel.getLocal() );
// } }
// else else
// { {
// currentToolTip.add( WailaText.DeviceOffline.getLocal() ); currentToolTip.add( WailaText.DeviceOffline.getLocal() );
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//} }
@@ -1,174 +1,174 @@
///* /*
// * This file is part of Applied Energistics 2. * This file is part of Applied Energistics 2.
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
// * *
// * Applied Energistics 2 is free software: you can redistribute it and/or modify * Applied Energistics 2 is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
// * the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
// * (at your option) any later version. * (at your option) any later version.
// * *
// * Applied Energistics 2 is distributed in the hope that it will be useful, * Applied Energistics 2 is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
// * *
// * You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>. * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
// */ */
//
//package appeng.integration.modules.waila.tile; package appeng.integration.modules.waila.tile;
//
//
//import java.util.List; import java.util.List;
//
//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
//import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
//import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.World; import net.minecraft.world.World;
//
//import gnu.trove.map.TObjectLongMap; import gnu.trove.map.TObjectLongMap;
//import gnu.trove.map.hash.TObjectLongHashMap; import gnu.trove.map.hash.TObjectLongHashMap;
//import mcp.mobius.waila.api.ITaggedList; import mcp.mobius.waila.api.ITaggedList;
//import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaConfigHandler;
//import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataAccessor;
//
//import appeng.api.networking.energy.IAEPowerStorage; import appeng.api.networking.energy.IAEPowerStorage;
//import appeng.core.localization.WailaText; import appeng.core.localization.WailaText;
//import appeng.integration.modules.waila.BaseWailaDataProvider; import appeng.integration.modules.waila.BaseWailaDataProvider;
//import appeng.util.Platform; import appeng.util.Platform;
//
//
///** /**
// * Power storage provider for WAILA * Power storage provider for WAILA
// * *
// * @author thatsIch * @author thatsIch
// * @version rv2 * @version rv2
// * @since rv2 * @since rv2
// */ */
//public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
//{ {
// /** /**
// * Power key used for the transferred {@link net.minecraft.nbt.NBTTagCompound} * Power key used for the transferred {@link net.minecraft.nbt.NBTTagCompound}
// */ */
// private static final String ID_CURRENT_POWER = "currentPower"; private static final String ID_CURRENT_POWER = "currentPower";
//
// /** /**
// * Used cache for power if the power was not transmitted through the server. * Used cache for power if the power was not transmitted through the server.
// * <p/> * <p/>
// * This is useful, when a player just started to look at a tile and thus just requested the new information from the * This is useful, when a player just started to look at a tile and thus just requested the new information from the
// * server. * server.
// * <p/> * <p/>
// * The cache will be updated from the server. * The cache will be updated from the server.
// */ */
// private final TObjectLongMap<TileEntity> cache = new TObjectLongHashMap<TileEntity>(); private final TObjectLongMap<TileEntity> cache = new TObjectLongHashMap<TileEntity>();
//
// /** /**
// * Adds the current and max power to the tool tip * Adds the current and max power to the tool tip
// * Will ignore if the tile has an energy buffer ( &gt; 0 ) * Will ignore if the tile has an energy buffer ( &gt; 0 )
// * *
// * @param itemStack stack of power storage * @param itemStack stack of power storage
// * @param currentToolTip current tool tip * @param currentToolTip current tool tip
// * @param accessor wrapper for various world information * @param accessor wrapper for various world information
// * @param config config to react to various settings * @param config config to react to various settings
// * *
// * @return modified tool tip * @return modified tool tip
// */ */
// @Override @Override
// public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config )
// { {
// // Removes RF tooltip on WAILA 1.5.9+ // Removes RF tooltip on WAILA 1.5.9+
// ( (ITaggedList<String, String>) currentToolTip ).removeEntries( "RFEnergyStorage" ); ( (ITaggedList<String, String>) currentToolTip ).removeEntries( "RFEnergyStorage" );
//
// final TileEntity te = accessor.getTileEntity(); final TileEntity te = accessor.getTileEntity();
// if( te instanceof IAEPowerStorage ) if( te instanceof IAEPowerStorage )
// { {
// final IAEPowerStorage storage = (IAEPowerStorage) te; final IAEPowerStorage storage = (IAEPowerStorage) te;
//
// final double maxPower = storage.getAEMaxPower(); final double maxPower = storage.getAEMaxPower();
// if( maxPower > 0 ) if( maxPower > 0 )
// { {
// final NBTTagCompound tag = accessor.getNBTData(); final NBTTagCompound tag = accessor.getNBTData();
//
// final long internalCurrentPower = this.getInternalCurrentPower( tag, te ); final long internalCurrentPower = this.getInternalCurrentPower( tag, te );
//
// if( internalCurrentPower >= 0 ) if( internalCurrentPower >= 0 )
// { {
// final long internalMaxPower = (long) ( 100 * maxPower ); final long internalMaxPower = (long) ( 100 * maxPower );
//
// final String formatCurrentPower = Platform.formatPowerLong( internalCurrentPower, false ); final String formatCurrentPower = Platform.formatPowerLong( internalCurrentPower, false );
// final String formatMaxPower = Platform.formatPowerLong( internalMaxPower, false ); final String formatMaxPower = Platform.formatPowerLong( internalMaxPower, false );
//
// currentToolTip.add( WailaText.Contains.getLocal() + ": " + formatCurrentPower + " / " + formatMaxPower ); currentToolTip.add( WailaText.Contains.getLocal() + ": " + formatCurrentPower + " / " + formatMaxPower );
// } }
// } }
// } }
//
// return currentToolTip; return currentToolTip;
// } }
//
// /** /**
// * Called on server to transfer information from server to client. * Called on server to transfer information from server to client.
// * <p/> * <p/>
// * If the {@link net.minecraft.tileentity.TileEntity} is a {@link appeng.api.networking.energy.IAEPowerStorage}, it * If the {@link net.minecraft.tileentity.TileEntity} is a {@link appeng.api.networking.energy.IAEPowerStorage}, it
// * writes the power information to the {@code #tag} using the {@code #ID_CURRENT_POWER} key. * writes the power information to the {@code #tag} using the {@code #ID_CURRENT_POWER} key.
// * *
// * @param player player looking at the power storage * @param player player looking at the power storage
// * @param te power storage * @param te power storage
// * @param tag transferred tag which is send to the client * @param tag transferred tag which is send to the client
// * @param world world of the power storage * @param world world of the power storage
// * @param pos pos of the power storage * @param pos pos of the power storage
// * *
// * @return tag send to the client * @return tag send to the client
// */ */
// @Override @Override
// public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos ) public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos )
// { {
// if( te instanceof IAEPowerStorage ) if( te instanceof IAEPowerStorage )
// { {
// final IAEPowerStorage storage = (IAEPowerStorage) te; final IAEPowerStorage storage = (IAEPowerStorage) te;
//
// if( storage.getAEMaxPower() > 0 ) if( storage.getAEMaxPower() > 0 )
// { {
// final long internalCurrentPower = (long) ( 100 * storage.getAECurrentPower() ); final long internalCurrentPower = (long) ( 100 * storage.getAECurrentPower() );
//
// tag.setLong( ID_CURRENT_POWER, internalCurrentPower ); tag.setLong( ID_CURRENT_POWER, internalCurrentPower );
// } }
// } }
//
// return tag; return tag;
// } }
//
// /** /**
// * Determines the current power. * Determines the current power.
// * <p/> * <p/>
// * If the client received power information on the server, they are used, else if the cache contains a previous * If the client received power information on the server, they are used, else if the cache contains a previous
// * stored value, this will be used. Default value is 0. * stored value, this will be used. Default value is 0.
// * *
// * @param te te to be looked at * @param te te to be looked at
// * @param tag tag maybe containing the channel information * @param tag tag maybe containing the channel information
// * *
// * @return used channels on the cable * @return used channels on the cable
// */ */
// private long getInternalCurrentPower( final NBTTagCompound tag, final TileEntity te ) private long getInternalCurrentPower( final NBTTagCompound tag, final TileEntity te )
// { {
// final long internalCurrentPower; final long internalCurrentPower;
//
// if( tag.hasKey( ID_CURRENT_POWER ) ) if( tag.hasKey( ID_CURRENT_POWER ) )
// { {
// internalCurrentPower = tag.getLong( ID_CURRENT_POWER ); internalCurrentPower = tag.getLong( ID_CURRENT_POWER );
// this.cache.put( te, internalCurrentPower ); this.cache.put( te, internalCurrentPower );
// } }
// else if( this.cache.containsKey( te ) ) else if( this.cache.containsKey( te ) )
// { {
// internalCurrentPower = this.cache.get( te ); internalCurrentPower = this.cache.get( te );
// } }
// else else
// { {
// internalCurrentPower = -1; internalCurrentPower = -1;
// } }
//
// return internalCurrentPower; return internalCurrentPower;
// } }
//} }