Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
+7
-5
@@ -10,6 +10,7 @@ import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
@@ -121,9 +122,10 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList();
|
||||
oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage );
|
||||
enableEffects = get( "Client", "enableEffects", true ).getBoolean( true );
|
||||
useLargeFonts= get( "Client", "useTerminalUseLargeFont", true ).getBoolean( true );
|
||||
|
||||
useLargeFonts = get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
|
||||
|
||||
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||
settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL );
|
||||
settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
|
||||
|
||||
spawnChargedChance = (float) (1.0 - get( "worldGen", "spawnChargedChance", 1.0 - spawnChargedChance ).getDouble( 1.0 - spawnChargedChance ));
|
||||
@@ -176,11 +178,11 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
selectedPowerUnit = PowerUnits.AE;
|
||||
}
|
||||
|
||||
for (TickRates tr: TickRates.values() )
|
||||
for (TickRates tr : TickRates.values())
|
||||
{
|
||||
tr.Load(this);
|
||||
tr.Load( this );
|
||||
}
|
||||
|
||||
|
||||
if ( isFeatureEnabled( AEFeature.SpatialIO ) )
|
||||
{
|
||||
storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID );
|
||||
|
||||
+20
-5
@@ -1,6 +1,7 @@
|
||||
package appeng.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import appeng.core.crash.CrashEnhancement;
|
||||
import appeng.core.crash.CrashInfo;
|
||||
@@ -14,12 +15,16 @@ import appeng.server.AECommand;
|
||||
import appeng.services.Profiler;
|
||||
import appeng.services.VersionChecker;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
@@ -82,6 +87,7 @@ public class AppEng
|
||||
// IntegrationSide.BOTH, "Forestry", "Forestry", "Forestry", // Forestry
|
||||
// IntegrationSide.BOTH, "Mekanism", "Mekanism", "Mekanism", // MeK
|
||||
IntegrationSide.CLIENT, "Waila", "Waila", "Waila", // Waila
|
||||
IntegrationSide.BOTH, "Rotatable Blocks", "RotatableBlocks", "RB", // RB
|
||||
IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks", "InvTweaks", // INV
|
||||
IntegrationSide.CLIENT, "Not Enough Items", "NotEnoughItems", "NEI", // NEI
|
||||
IntegrationSide.CLIENT, "Craft Guide", "craftguide", "CraftGuide", // CraftGuide
|
||||
@@ -108,6 +114,7 @@ public class AppEng
|
||||
@EventHandler
|
||||
void PreInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
configPath = event.getModConfigurationDirectory().getPath() + File.separator + "AppliedEnergistics2" + File.separator;
|
||||
|
||||
AEConfig.instance = new AEConfig( configPath );
|
||||
@@ -118,7 +125,8 @@ public class AppEng
|
||||
if ( Platform.isClient() )
|
||||
{
|
||||
CreativeTab.init();
|
||||
CreativeTabFacade.init();
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) )
|
||||
CreativeTabFacade.init();
|
||||
CommonHelper.proxy.init();
|
||||
}
|
||||
|
||||
@@ -136,23 +144,25 @@ public class AppEng
|
||||
startService( "AE2 VersionChecker", new Thread( VersionChecker.instance = new VersionChecker() ) );
|
||||
}
|
||||
|
||||
AELog.info( "PreInit ( end )" );
|
||||
AELog.info( "PreInit ( end " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
void Init(FMLInitializationEvent event)
|
||||
{
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
AELog.info( "Init" );
|
||||
|
||||
Registration.instance.Init( event );
|
||||
integrationModules.init();
|
||||
|
||||
AELog.info( "Init ( end )" );
|
||||
AELog.info( "Init ( end " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
void PostInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
Stopwatch star = Stopwatch.createStarted();
|
||||
AELog.info( "PostInit" );
|
||||
|
||||
Registration.instance.PostInit( event );
|
||||
@@ -163,7 +173,7 @@ public class AppEng
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler );
|
||||
NetworkHandler.instance = new NetworkHandler( "AE2" );
|
||||
|
||||
AELog.info( "PostInit ( end )" );
|
||||
AELog.info( "PostInit ( end " + star.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -174,9 +184,14 @@ public class AppEng
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent evt)
|
||||
public void serverStarting(FMLServerAboutToStartEvent evt)
|
||||
{
|
||||
WorldSettings.getInstance().init();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent evt)
|
||||
{
|
||||
evt.registerServerCommand( new AECommand( evt.getServer() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CellRegistry implements ICellRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICellHandler getHander(ItemStack is)
|
||||
public ICellHandler getHandler(ItemStack is)
|
||||
{
|
||||
if ( is == null )
|
||||
return null;
|
||||
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
@@ -58,7 +60,7 @@ public class BasicCellHandler implements ICellHandler
|
||||
@Override
|
||||
public double cellIdleDrain(ItemStack is, IMEInventory handler)
|
||||
{
|
||||
CellInventory inv = ((CellInventoryHandler) handler).getCellInv();
|
||||
ICellInventory inv = ((ICellInventoryHandler) handler).getCellInv();
|
||||
return inv.getIdleDrain();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public enum ButtonToolTips
|
||||
|
||||
Blocking, NonBlocking, Craft, DontCraft,
|
||||
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks;
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small;
|
||||
|
||||
String root;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import appeng.core.sync.packets.PacketMultiPart;
|
||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||
import appeng.core.sync.packets.PacketPartPlacement;
|
||||
import appeng.core.sync.packets.PacketProgressBar;
|
||||
import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketTransitionEffect;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
@@ -61,7 +62,9 @@ public class AppEngPacketHandlerBase
|
||||
|
||||
PACKET_NEW_STORAGE_DIMENSION(PacketNewStorageDimension.class),
|
||||
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class);
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class),
|
||||
|
||||
PACKET_SWAP_SLOTS(PacketSwapSlots.class);
|
||||
|
||||
final public Class pc;
|
||||
final public Constructor con;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
public class PacketSwapSlots extends AppEngPacket
|
||||
{
|
||||
|
||||
int slotA, slotB;
|
||||
|
||||
// automatic.
|
||||
public PacketSwapSlots(ByteBuf stream) throws IOException {
|
||||
slotA = stream.readInt();
|
||||
slotB = stream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
if ( player != null && player.openContainer instanceof AEBaseContainer )
|
||||
{
|
||||
((AEBaseContainer) player.openContainer).swapSlotContents( slotA, slotB );
|
||||
}
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketSwapSlots(int slotA, int slotB) throws IOException {
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( getPacketID() );
|
||||
data.writeInt( this.slotA = slotA );
|
||||
data.writeInt( this.slotB = slotB );
|
||||
|
||||
configureWrite( data );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user