Merge branch 'rv1' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv2
This commit is contained in:
+23
-5
@@ -1,7 +1,9 @@
|
||||
package appeng.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
@@ -22,6 +24,7 @@ import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class AEConfig extends Configuration implements IConfigureableObject, IConfigManagerHost
|
||||
@@ -91,8 +94,8 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
return prop;
|
||||
}
|
||||
|
||||
public double spatialPowerScaler = 1.5;
|
||||
public double spatialPowerMultiplier = 1500.0;
|
||||
public double spatialPowerScaler = 1.35;
|
||||
public double spatialPowerMultiplier = 1250.0;
|
||||
|
||||
public String grinderOres[] = {
|
||||
// Vanilla Items
|
||||
@@ -102,7 +105,7 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
// AE
|
||||
"CertusQuartz", "Wheat", "Fluix",
|
||||
// Other Mod Ores
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum" };
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium" };
|
||||
|
||||
public double oreDoublePercentage = 90.0;
|
||||
|
||||
@@ -127,6 +130,8 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
public double metoriteClusterChance = 0.1;
|
||||
public double metoriteSpawnChance = 0.3;
|
||||
|
||||
public int craftingCalculationTimePerTick = 5;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs)
|
||||
{
|
||||
@@ -268,8 +273,13 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
featureFlags.add( feature );
|
||||
}
|
||||
|
||||
if ( cpw.mods.fml.common.Loader.isModLoaded( "ImmibisMicroblocks" ) )
|
||||
featureFlags.remove( AEFeature.AlphaPass );
|
||||
ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" );
|
||||
if ( imb != null )
|
||||
{
|
||||
List<String> version = Arrays.asList( new String[] { "59.0.0", "59.0.1", "59.0.2" } );
|
||||
if ( version.contains( imb.getVersion() ) )
|
||||
featureFlags.remove( AEFeature.AlphaPass );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -289,6 +299,14 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
{
|
||||
storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID );
|
||||
storageProviderID = get( "spatialio", "storageProviderID", storageProviderID ).getInt( storageProviderID );
|
||||
spatialPowerMultiplier = get( "spatialio", "spatialPowerMultiplier", spatialPowerMultiplier ).getDouble( spatialPowerMultiplier );
|
||||
spatialPowerScaler = get( "spatialio", "spatialPowerScaler", spatialPowerScaler ).getDouble( spatialPowerScaler );
|
||||
}
|
||||
|
||||
if ( isFeatureEnabled( AEFeature.CraftingCPU ) )
|
||||
{
|
||||
craftingCalculationTimePerTick = get( "craftingcpu", "craftingCalculationTimePerTick", craftingCalculationTimePerTick ).getInt(
|
||||
craftingCalculationTimePerTick );
|
||||
}
|
||||
|
||||
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
|
||||
+19
-11
@@ -1,5 +1,7 @@
|
||||
package appeng.core;
|
||||
|
||||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -14,6 +16,7 @@ import java.util.WeakHashMap;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
@@ -280,22 +283,27 @@ public class WorldSettings extends Configuration
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void sendToPlayer(EntityPlayerMP player)
|
||||
public void sendToPlayer(NetworkManager manager, EntityPlayerMP player)
|
||||
{
|
||||
for (int newDim : get( "DimensionManager", "StorageCells", new int[0] ).getIntList())
|
||||
if ( manager != null )
|
||||
{
|
||||
try
|
||||
for (int newDim : get( "DimensionManager", "StorageCells", new int[0] ).getIntList())
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketNewStorageDimension( newDim ), player );
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
AELog.error( e );
|
||||
try
|
||||
{
|
||||
manager.scheduleOutboundPacket( (new PacketNewStorageDimension( newDim )).getProxy(), new GenericFutureListener[0] );
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (PlayerColor pc : TickHandler.instance.getPlayerColors().values())
|
||||
NetworkHandler.instance.sendToAll( pc.getPacket() );
|
||||
else
|
||||
{
|
||||
for (PlayerColor pc : TickHandler.instance.getPlayerColors().values())
|
||||
NetworkHandler.instance.sendToAll( pc.getPacket() );
|
||||
}
|
||||
}
|
||||
|
||||
public void init()
|
||||
|
||||
@@ -28,6 +28,7 @@ import appeng.api.networking.security.ISecurityGrid;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerNull;
|
||||
@@ -75,7 +76,6 @@ import appeng.parts.misc.PartStorageBus;
|
||||
import appeng.parts.reporting.PartCraftingTerminal;
|
||||
import appeng.parts.reporting.PartMonitor;
|
||||
import appeng.parts.reporting.PartPatternTerminal;
|
||||
import appeng.server.AccessType;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
@@ -395,7 +395,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
World w = player.getEntityWorld();
|
||||
|
||||
if ( Platform.hasPermissions( x, y, z, player, AccessType.BLOCK_ACCESS ) )
|
||||
if ( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, x, y, z ), player ) )
|
||||
{
|
||||
if ( type.isItem() )
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||
import cpw.mods.fml.common.network.FMLEventChannel;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerConnectionFromClientEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
@@ -56,11 +57,17 @@ public class NetworkHandler
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void newConection(ServerConnectionFromClientEvent ev)
|
||||
{
|
||||
WorldSettings.getInstance().sendToPlayer( ev.manager, null );
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void newConection(PlayerLoggedInEvent loginEvent)
|
||||
{
|
||||
if ( loginEvent.player instanceof EntityPlayerMP )
|
||||
WorldSettings.getInstance().sendToPlayer( (EntityPlayerMP) loginEvent.player );
|
||||
WorldSettings.getInstance().sendToPlayer( null, (EntityPlayerMP) loginEvent.player );
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
Reference in New Issue
Block a user