diff --git a/src/api/java/appeng/api/config/Settings.java b/src/api/java/appeng/api/config/Settings.java index 0a66bd2d4..f755c7c02 100644 --- a/src/api/java/appeng/api/config/Settings.java +++ b/src/api/java/appeng/api/config/Settings.java @@ -23,35 +23,37 @@ package appeng.api.config; + import java.util.EnumSet; + public enum Settings { - LEVEL_EMITTER_MODE(EnumSet.allOf( LevelEmitterMode.class )), + LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ), - REDSTONE_EMITTER(EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL )), REDSTONE_CONTROLLED(EnumSet.allOf( RedstoneMode.class )), + REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ), REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ), - CONDENSER_OUTPUT(EnumSet.allOf( CondenserOutput.class )), + CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ), - POWER_UNITS(EnumSet.allOf( PowerUnits.class )), ACCESS(EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE )), + POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ), ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ), - SORT_DIRECTION(EnumSet.allOf( SortDir.class )), SORT_BY(EnumSet.allOf( SortOrder.class )), + SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ), SORT_BY( EnumSet.allOf( SortOrder.class ) ), - SEARCH_TOOLTIPS(EnumSet.of( YesNo.YES, YesNo.NO )), VIEW_MODE(EnumSet.allOf( ViewItems.class )), SEARCH_MODE(EnumSet.allOf( SearchBoxMode.class )), + SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ), VIEW_MODE( EnumSet.allOf( ViewItems.class ) ), SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ), - ACTIONS(EnumSet.allOf( ActionItems.class )), IO_DIRECTION(EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT )), + ACTIONS( EnumSet.allOf( ActionItems.class ) ), IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ), - BLOCK(EnumSet.of( YesNo.YES, YesNo.NO )), OPERATION_MODE(EnumSet.allOf( OperationMode.class )), + BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ), OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ), - FULLNESS_MODE(EnumSet.allOf( FullnessMode.class )), CRAFT_ONLY(EnumSet.of( YesNo.YES, YesNo.NO )), + FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ), CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ), - FUZZY_MODE(EnumSet.allOf( FuzzyMode.class )), LEVEL_TYPE(EnumSet.allOf( LevelType.class )), + FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ), LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ), - TERMINAL_STYLE(EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL )), COPY_MODE(EnumSet.allOf( CopyMode.class )), + TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ), COPY_MODE( EnumSet.allOf( CopyMode.class ) ), - INTERFACE_TERMINAL(EnumSet.of( YesNo.YES, YesNo.NO )), CRAFT_VIA_REDSTONE(EnumSet.of( YesNo.YES, YesNo.NO )), + INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ), - STORAGE_FILTER(EnumSet.allOf( StorageFilter.class )); + STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ); private final EnumSet values; @@ -60,7 +62,8 @@ public enum Settings return this.values; } - private Settings(EnumSet set) { + private Settings( EnumSet set ) + { if ( set == null || set.isEmpty() ) throw new RuntimeException( "Invalid configuration." ); this.values = set; diff --git a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java index 353ea961c..f836a1a01 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java +++ b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java @@ -18,59 +18,79 @@ package appeng.client.gui.implementations; + +import org.lwjgl.input.Mouse; + import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.InventoryPlayer; import appeng.api.config.FuzzyMode; import appeng.api.config.Settings; +import appeng.api.config.YesNo; import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiTabButton; import appeng.container.implementations.ContainerFormationPlane; import appeng.core.localization.GuiText; import appeng.core.sync.GuiBridge; import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketConfigButton; import appeng.core.sync.packets.PacketSwitchGuis; import appeng.parts.automation.PartFormationPlane; + public class GuiFormationPlane extends GuiUpgradeable { GuiTabButton priority; + GuiImgButton placeMode; - public GuiFormationPlane(InventoryPlayer inventoryPlayer, PartFormationPlane te) { + public GuiFormationPlane( InventoryPlayer inventoryPlayer, PartFormationPlane te ) + { super( new ContainerFormationPlane( inventoryPlayer, te ) ); this.ySize = 251; } @Override - public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) + public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY ) { this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 ); this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 ); if ( this.fuzzyMode != null ) this.fuzzyMode.set( this.cvb.fzMode ); + + if ( this.placeMode != null ) + this.placeMode.set( ( ( ContainerFormationPlane ) this.cvb ).placeMode ); } @Override protected void addButtons() { - this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.placeMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK, YesNo.YES ); + this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) ); + this.buttonList.add( this.placeMode ); this.buttonList.add( this.fuzzyMode ); } @Override - protected void actionPerformed(GuiButton btn) + protected void actionPerformed( GuiButton btn ) { super.actionPerformed( btn ); + boolean backwards = Mouse.isButtonDown( 1 ); + if ( btn == this.priority ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) ); } + else if ( btn == this.placeMode ) + { + NetworkHandler.instance.sendToServer( new PacketConfigButton( this.placeMode.getSetting(), backwards ) ); + } + } @Override diff --git a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java index a98298822..30fe81151 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java @@ -155,6 +155,9 @@ public class GuiImgButton extends GuiButton implements ITooltip this.registerApp( 16 * 3 + 5, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY, ButtonToolTips.ReportInaccessibleItems, ButtonToolTips.ReportInaccessibleItemsNo ); this.registerApp( 16 * 3 + 6, Settings.STORAGE_FILTER, StorageFilter.NONE, ButtonToolTips.ReportInaccessibleItems, ButtonToolTips.ReportInaccessibleItemsYes ); + + this.registerApp( 16 * 14, Settings.PLACE_BLOCK, YesNo.YES, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementYes ); + this.registerApp( 16 * 14 + 1, Settings.PLACE_BLOCK, YesNo.NO, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementNo ); } } @@ -362,7 +365,6 @@ public class GuiImgButton extends GuiButton implements ITooltip } } - private static class ButtonAppearance { public int index; diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index 2476811a1..1c6227168 100644 --- a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java +++ b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java @@ -26,18 +26,25 @@ import appeng.api.config.FuzzyMode; import appeng.api.config.SecurityPermissions; import appeng.api.config.Settings; import appeng.api.config.Upgrades; +import appeng.api.config.YesNo; +import appeng.container.guisync.GuiSync; import appeng.container.slot.OptionalSlotFakeTypeOnly; import appeng.container.slot.SlotFakeTypeOnly; import appeng.container.slot.SlotRestrictedInput; import appeng.parts.automation.PartFormationPlane; import appeng.util.Platform; + public class ContainerFormationPlane extends ContainerUpgradeable { final PartFormationPlane storageBus; - public ContainerFormationPlane(InventoryPlayer ip, PartFormationPlane te) { + @GuiSync( 6 ) + public YesNo placeMode; + + public ContainerFormationPlane( InventoryPlayer ip, PartFormationPlane te ) + { super( ip, te ); this.storageBus = te; } @@ -61,7 +68,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable } @Override - public boolean isSlotEnabled(int idx) + public boolean isSlotEnabled( int idx ) { int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY ); @@ -75,9 +82,9 @@ public class ContainerFormationPlane extends ContainerUpgradeable int yo = 23 + 6; IInventory config = this.upgradeable.getInventoryByName( "config" ); - for (int y = 0; y < 7; y++) + for ( int y = 0; y < 7; y++ ) { - for (int x = 0; x < 9; x++) + for ( int x = 0; x < 9; x++ ) { if ( y < 2 ) this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); @@ -87,11 +94,11 @@ public class ContainerFormationPlane extends ContainerUpgradeable } IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" ); - this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer )).setNotDraggable() ); - this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer )).setNotDraggable() ); - this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer )).setNotDraggable() ); - this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer )).setNotDraggable() ); - this.addSlotToContainer( (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.invPlayer )).setNotDraggable() ); + this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() ); + this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() ); + this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() ); + this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer ) ).setNotDraggable() ); + this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.invPlayer ) ).setNotDraggable() ); } @Override @@ -101,7 +108,8 @@ public class ContainerFormationPlane extends ContainerUpgradeable if ( Platform.isServer() ) { - this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); + this.fzMode = ( FuzzyMode ) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE ); + this.placeMode = ( YesNo ) this.upgradeable.getConfigManager().getSetting( Settings.PLACE_BLOCK ); } this.standardDetectAndSendChanges(); diff --git a/src/main/java/appeng/core/localization/ButtonToolTips.java b/src/main/java/appeng/core/localization/ButtonToolTips.java index 5568e36ff..9c1a4339b 100644 --- a/src/main/java/appeng/core/localization/ButtonToolTips.java +++ b/src/main/java/appeng/core/localization/ButtonToolTips.java @@ -18,8 +18,10 @@ package appeng.core.localization; + import net.minecraft.util.StatCollector; + public enum ButtonToolTips { PowerUnits, IOMode, CondenserOutput, RedstoneMode, MatchingFuzzy, @@ -54,15 +56,19 @@ public enum ButtonToolTips Stash, StashDesc, Encode, EncodeDescription, Substitutions, SubstitutionsOn, SubstitutionsOff, SubstitutionsDesc, CraftOnly, CraftEither, - Craft, Mod, DoesntDespawn, EmitterMode, CraftViaRedstone, EmitWhenCrafting, ReportInaccessibleItems, ReportInaccessibleItemsYes, ReportInaccessibleItemsNo; + Craft, Mod, DoesntDespawn, EmitterMode, CraftViaRedstone, EmitWhenCrafting, ReportInaccessibleItems, ReportInaccessibleItemsYes, ReportInaccessibleItemsNo, + + BlockPlacement, BlockPlacementYes, BlockPlacementNo; final String root; - ButtonToolTips() { + ButtonToolTips() + { this.root = "gui.tooltips.appliedenergistics2"; } - ButtonToolTips(String r) { + ButtonToolTips( String r ) + { this.root = r; } diff --git a/src/main/java/appeng/parts/automation/PartFormationPlane.java b/src/main/java/appeng/parts/automation/PartFormationPlane.java index a48c33177..7ee6975a2 100644 --- a/src/main/java/appeng/parts/automation/PartFormationPlane.java +++ b/src/main/java/appeng/parts/automation/PartFormationPlane.java @@ -18,6 +18,7 @@ package appeng.parts.automation; + import java.util.ArrayList; import java.util.List; @@ -51,6 +52,7 @@ import appeng.api.config.FuzzyMode; import appeng.api.config.IncludeExclude; import appeng.api.config.Settings; import appeng.api.config.Upgrades; +import appeng.api.config.YesNo; import appeng.api.networking.events.MENetworkCellArrayUpdate; import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkEventSubscribe; @@ -80,6 +82,7 @@ import appeng.util.Platform; import appeng.util.prioitylist.FuzzyPriorityList; import appeng.util.prioitylist.PrecisePriorityList; + public class PartFormationPlane extends PartUpgradeable implements ICellContainer, IPriorityHost, IMEInventory { @@ -89,14 +92,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine final MEInventoryHandler myHandler = new MEInventoryHandler( this, StorageChannel.ITEMS ); final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 ); - public PartFormationPlane(ItemStack is) { + public PartFormationPlane( ItemStack is ) + { super( PartFormationPlane.class, is ); this.settings.registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + this.settings.registerSetting( Settings.PLACE_BLOCK, YesNo.YES ); this.updateHandler(); } @Override - public boolean onPartActivate(EntityPlayer player, Vec3 pos) + public boolean onPartActivate( EntityPlayer player, Vec3 pos ) { if ( !player.isSneaking() ) { @@ -117,7 +122,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IInventory getInventoryByName(String name) + public IInventory getInventoryByName( String name ) { if ( name.equals( "config" ) ) return this.Config; @@ -127,7 +132,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine @Override @MENetworkEventSubscribe - public void powerRender(MENetworkPowerStatusChange c) + public void powerRender( MENetworkPowerStatusChange c ) { boolean currentActive = this.proxy.isActive(); if ( this.wasActive != currentActive ) @@ -139,7 +144,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @MENetworkEventSubscribe - public void updateChannels(MENetworkChannelsChanged changedChannels) + public void updateChannels( MENetworkChannelsChanged changedChannels ) { boolean currentActive = this.proxy.isActive(); if ( this.wasActive != currentActive ) @@ -151,8 +156,8 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - @SideOnly(Side.CLIENT) - public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) + @SideOnly( Side.CLIENT ) + public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) { rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), @@ -166,8 +171,8 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - @SideOnly(Side.CLIENT) - public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer) + @SideOnly( Side.CLIENT ) + public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer ) { int minX = 1; int minY = 1; @@ -191,7 +196,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if ( this.isTransitionPlane( te.getWorldObj().getTileEntity( x + u.offsetX, y + u.offsetY, z + u.offsetZ ), this.side ) ) maxY = 16; - boolean isActive = (this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) == (this.POWERED_FLAG | this.CHANNEL_FLAG); + boolean isActive = ( this.clientFlags & ( this.POWERED_FLAG | this.CHANNEL_FLAG ) ) == ( this.POWERED_FLAG | this.CHANNEL_FLAG ); this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache ); rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), @@ -211,18 +216,18 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine this.renderLights( x, y, z, rh, renderer ); } - private boolean isTransitionPlane(TileEntity blockTileEntity, ForgeDirection side) + private boolean isTransitionPlane( TileEntity blockTileEntity, ForgeDirection side ) { if ( blockTileEntity instanceof IPartHost ) { - IPart p = ((IPartHost) blockTileEntity).getPart( side ); + IPart p = ( ( IPartHost ) blockTileEntity ).getPart( side ); return p instanceof PartFormationPlane; } return false; } @Override - public void getBoxes(IPartCollisionHelper bch) + public void getBoxes( IPartCollisionHelper bch ) { int minX = 1; int minY = 1; @@ -265,7 +270,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public List getCellArray(StorageChannel channel) + public List getCellArray( StorageChannel channel ) { if ( this.proxy.isActive() && channel == StorageChannel.ITEMS ) { @@ -277,14 +282,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue) + public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue ) { this.updateHandler(); this.host.markForSave(); } @Override - public void setPriority(int newValue) + public void setPriority( int newValue ) { this.priority = newValue; this.host.markForSave(); @@ -292,7 +297,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) + public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack ) { super.onChangeInventory( inv, slot, mc, removedStack, newStack ); @@ -315,7 +320,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine IItemList priorityList = AEApi.instance().storage().createItemList(); int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9; - for (int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++) + for ( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ ) { IAEItemStack is = this.Config.getAEStackInSlot( x ); if ( is != null ) @@ -323,7 +328,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 ) - this.myHandler.myPartitionList = new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ); + this.myHandler.myPartitionList = new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ); else this.myHandler.myPartitionList = new PrecisePriorityList( priorityList ); @@ -331,14 +336,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() ); } - catch (GridAccessException e) + catch ( GridAccessException e ) { // :P } } @Override - public void writeToNBT(NBTTagCompound data) + public void writeToNBT( NBTTagCompound data ) { super.writeToNBT( data ); this.Config.writeToNBT( data, "config" ); @@ -346,7 +351,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void readFromNBT(NBTTagCompound data) + public void readFromNBT( NBTTagCompound data ) { super.readFromNBT( data ); this.Config.readFromNBT( data, "config" ); @@ -355,13 +360,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) + public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src ) { return null; } @Override - public IItemList getAvailableItems(IItemList out) + public IItemList getAvailableItems( IItemList out ) { return out; } @@ -379,7 +384,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void blinkCell(int slot) + public void blinkCell( int slot ) { // :P } @@ -399,11 +404,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) + public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src ) { if ( this.blocked || input == null || input.getStackSize() <= 0 ) return input; + YesNo placeBlock = ( YesNo ) this.getConfigManager().getSetting( Settings.PLACE_BLOCK ); + ItemStack is = input.getItemStack(); Item i = is.getItem(); @@ -420,17 +427,17 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if ( w.getBlock( x, y, z ).isReplaceable( w, x, y, z ) ) { - if ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem - || i instanceof ItemReed ) + if ( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem + || i instanceof ItemReed ) ) { - EntityPlayer player = Platform.getPlayer( (WorldServer) w ); + EntityPlayer player = Platform.getPlayer( ( WorldServer ) w ); Platform.configurePlayer( player, side, this.tile ); if ( i instanceof ItemFirework ) { Chunk c = w.getChunkFromBlockCoords( x, z ); int sum = 0; - for (List Z : c.entityLists) + for ( List Z : c.entityLists ) sum += Z.size(); if ( sum > 32 ) return input; @@ -473,7 +480,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine worked = true; Chunk c = w.getChunkFromBlockCoords( x, z ); int sum = 0; - for (List Z : c.entityLists) + for ( List Z : c.entityLists ) sum += Z.size(); if ( sum < AEConfig.instance.formationPlaneEntityLimit ) @@ -481,12 +488,12 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine if ( type == Actionable.MODULATE ) { - is.stackSize = (int) maxStorage; + is.stackSize = ( int ) maxStorage; EntityItem ei = new EntityItem( w, // w - ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetX * -0.3 + x, // spawn - ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetY * -0.3 + y, // spawn - ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetZ * -0.3 + z, // spawn - is.copy() ); + ( ( side.offsetX != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetX * -0.3 + x, // spawn + ( ( side.offsetY != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetY * -0.3 + y, // spawn + ( ( side.offsetZ != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.offsetZ * -0.3 + z, // spawn + is.copy() ); Entity result = ei; @@ -531,7 +538,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine } @Override - public void saveChanges(IMEInventory cellInventory) + public void saveChanges( IMEInventory cellInventory ) { // nope! } diff --git a/src/main/resources/assets/appliedenergistics2/lang/en_US.lang b/src/main/resources/assets/appliedenergistics2/lang/en_US.lang index b48f4e2b5..e5e30b2ff 100644 --- a/src/main/resources/assets/appliedenergistics2/lang/en_US.lang +++ b/src/main/resources/assets/appliedenergistics2/lang/en_US.lang @@ -288,6 +288,9 @@ gui.tooltips.appliedenergistics2.EmitWhenCrafting=Emit Redstone while item is cr gui.tooltips.appliedenergistics2.ReportInaccessibleItems=Report Inaccessible Items gui.tooltips.appliedenergistics2.ReportInaccessibleItemsYes=Yes: Items that cannot be extracted will be visible. gui.tooltips.appliedenergistics2.ReportInaccessibleItemsNo=No: Only extractable items will be visible. +gui.tooltips.appliedenergistics2.BlockPlacement=Block Placement +gui.tooltips.appliedenergistics2.BlockPlacementYes=Blocks will be placed as block. +gui.tooltips.appliedenergistics2.BlockPlacementNo=Blocks will be dropped as item. gui.appliedenergistics2.units.appliedenergstics=AE gui.appliedenergistics2.units.buildcraft=Minecraft Joules diff --git a/src/main/resources/assets/appliedenergistics2/textures/guis/states.png b/src/main/resources/assets/appliedenergistics2/textures/guis/states.png index 937e8391c..fc9e11b2f 100644 Binary files a/src/main/resources/assets/appliedenergistics2/textures/guis/states.png and b/src/main/resources/assets/appliedenergistics2/textures/guis/states.png differ