Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
+24
-16
@@ -214,26 +214,29 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
if ( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) )
|
||||
{
|
||||
IAEItemStack stack = null;
|
||||
if ( slot instanceof SlotME )
|
||||
stack = ((SlotME) slot).getAEStack();
|
||||
|
||||
try
|
||||
if ( enableSpaceClicking() )
|
||||
{
|
||||
int slotNum = inventorySlots.inventorySlots.size();
|
||||
IAEItemStack stack = null;
|
||||
if ( slot instanceof SlotME )
|
||||
stack = ((SlotME) slot).getAEStack();
|
||||
|
||||
if ( !(slot instanceof SlotME) && slot != null )
|
||||
slotNum = slot.slotNumber;
|
||||
try
|
||||
{
|
||||
int slotNum = inventorySlots.inventorySlots.size();
|
||||
|
||||
((AEBaseContainer) inventorySlots).setTargetStack( stack );
|
||||
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, null );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
if ( !(slot instanceof SlotME) && slot != null )
|
||||
slotNum = slot.slotNumber;
|
||||
|
||||
((AEBaseContainer) inventorySlots).setTargetStack( stack );
|
||||
PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, null );
|
||||
NetworkHandler.instance.sendToServer( p );
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
return;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( slot instanceof SlotME )
|
||||
@@ -297,6 +300,11 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
super.handleMouseClick( slot, slotIdx, ctrlDown, key );
|
||||
}
|
||||
|
||||
protected boolean enableSpaceClicking()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int p_146983_1_)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package appeng.client.gui.implementations;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerSkyChest;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
|
||||
@@ -28,4 +29,10 @@ public class GuiSkyChest extends AEBaseGui
|
||||
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 2, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean enableSpaceClicking()
|
||||
{
|
||||
return !AppEng.instance.isIntegrationEnabled( "InvTweaks" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -325,31 +325,52 @@ public class MeteoritePlacer
|
||||
InventoryAdaptor ap = InventoryAdaptor.getAdaptor( te, ForgeDirection.UP );
|
||||
|
||||
int primary = Math.max( 1, (int) (Math.random() * 4) );
|
||||
|
||||
if ( primary > 3 ) // in case math breaks...
|
||||
primary = 3;
|
||||
|
||||
for (int zz = 0; zz < primary; zz++)
|
||||
{
|
||||
int r = 0;
|
||||
boolean duplicate = false;
|
||||
|
||||
if ( Math.random() > 0.7 )
|
||||
r = WorldSettings.getInstance().getNextOrderedValue( "presses" );
|
||||
else
|
||||
r = (int) (Math.random() * 1000);
|
||||
|
||||
switch (r % 4)
|
||||
do
|
||||
{
|
||||
case 0:
|
||||
ap.addItems( AEApi.instance().materials().materialCalcProcessorPress.stack( 1 ) );
|
||||
break;
|
||||
case 1:
|
||||
ap.addItems( AEApi.instance().materials().materialEngProcessorPress.stack( 1 ) );
|
||||
break;
|
||||
case 2:
|
||||
ap.addItems( AEApi.instance().materials().materialLogicProcessorPress.stack( 1 ) );
|
||||
break;
|
||||
case 3:
|
||||
ap.addItems( AEApi.instance().materials().materialSiliconPress.stack( 1 ) );
|
||||
break;
|
||||
default:
|
||||
duplicate = false;
|
||||
|
||||
if ( Math.random() > 0.7 )
|
||||
r = WorldSettings.getInstance().getNextOrderedValue( "presses" );
|
||||
else
|
||||
r = (int) (Math.random() * 1000);
|
||||
|
||||
ItemStack toAdd = null;
|
||||
|
||||
switch (r % 4)
|
||||
{
|
||||
case 0:
|
||||
toAdd = AEApi.instance().materials().materialCalcProcessorPress.stack( 1 );
|
||||
break;
|
||||
case 1:
|
||||
toAdd = AEApi.instance().materials().materialEngProcessorPress.stack( 1 );
|
||||
break;
|
||||
case 2:
|
||||
toAdd = AEApi.instance().materials().materialLogicProcessorPress.stack( 1 );
|
||||
break;
|
||||
case 3:
|
||||
toAdd = AEApi.instance().materials().materialSiliconPress.stack( 1 );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
if ( toAdd != null )
|
||||
{
|
||||
if ( ap.simulateRemove( 1, toAdd, null ) == null )
|
||||
ap.addItems( toAdd );
|
||||
else
|
||||
duplicate = true;
|
||||
}
|
||||
}
|
||||
while (duplicate);
|
||||
}
|
||||
|
||||
int secondary = Math.max( 1, (int) (Math.random() * 3) );
|
||||
|
||||
@@ -4,20 +4,19 @@ import invtweaks.api.InvTweaksAPI;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.integration.BaseModule;
|
||||
import appeng.integration.abstraction.IInvTweaks;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class InvTweaks extends BaseModule implements IInvTweaks
|
||||
{
|
||||
|
||||
public static InvTweaks instance;
|
||||
|
||||
@Instance("inventorytweaks")
|
||||
static InvTweaksAPI api;
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
|
||||
api = (InvTweaksAPI) Loader.instance().getIndexedModList().get( "inventorytweaks" ).getMod();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Vendored
+1
-1
@@ -162,7 +162,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
@Override
|
||||
public double getEnergyDemand(double maxRequired)
|
||||
{
|
||||
double required = 0;
|
||||
double required = buffer() - extra;
|
||||
Iterator<IAEPowerStorage> it = requesters.iterator();
|
||||
while (required < maxRequired && it.hasNext())
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
public WorldCoord min;
|
||||
public WorldCoord max;
|
||||
public boolean isDestroyed = false;
|
||||
private boolean updateStatus = true;
|
||||
|
||||
boolean registered = false;
|
||||
private long thisSide;
|
||||
@@ -85,6 +86,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
{
|
||||
if ( center.getWorldObj() == e.world )
|
||||
{
|
||||
updateStatus = false;
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
@@ -209,11 +211,14 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) );
|
||||
}
|
||||
|
||||
center.updateStatus( null, (byte) -1 );
|
||||
|
||||
for (TileQuantumBridge r : Ring)
|
||||
if ( updateStatus )
|
||||
{
|
||||
r.updateStatus( null, (byte) -1 );
|
||||
center.updateStatus( null, (byte) -1 );
|
||||
|
||||
for (TileQuantumBridge r : Ring)
|
||||
{
|
||||
r.updateStatus( null, (byte) -1 );
|
||||
}
|
||||
}
|
||||
|
||||
center = null;
|
||||
|
||||
@@ -41,7 +41,6 @@ public class ASMIntegration implements IClassTransformer
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Greg Tech", "gregtech_addon", "GT" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Universal Electricity", null, "UE" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Logistics Pipes", "LogisticsPipes|Main", "LP" );
|
||||
integrationModules.add( IntegrationSide.CLIENT, "Inventory Tweaks", "", "InvTweaks" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "Mine Factory Reloaded", "MineFactoryReloaded", "MFR" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "Deep Storage Unit", null, "DSU" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Better Storage", "betterstorage" );
|
||||
|
||||
Reference in New Issue
Block a user