Skip to content

Commit

Permalink
Spotless apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Cardinalstars committed Nov 5, 2023
1 parent 192be15 commit cca172f
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 33 deletions.
1 change: 1 addition & 0 deletions src/main/java/appeng/api/definitions/Materials.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class Materials {
public AEItemDefinition materialCardCrafting;

public AEItemDefinition materialCardSticky;

public AEItemDefinition materialEnderDust;

public AEItemDefinition materialFlour;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/appeng/api/storage/IMEInventoryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public interface IMEInventoryHandler<StackType extends IAEStack> extends IMEInve
boolean validForPass(int i);

/**
* Gets whether an inventory is "Sticky" i.e. only it and other sticky storages that have partitions
* with certain items are allowed to be put into sticky storages.
* Gets whether an inventory is "Sticky" i.e. only it and other sticky storages that have partitions with certain
* items are allowed to be put into sticky storages.
*
* @return
*/
boolean getSticky();


}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import java.io.IOException;

import appeng.api.config.YesNo;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;

Expand All @@ -23,6 +22,7 @@
import appeng.api.config.FuzzyMode;
import appeng.api.config.Settings;
import appeng.api.config.StorageFilter;
import appeng.api.config.YesNo;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerStorageBus;
Expand Down Expand Up @@ -75,11 +75,7 @@ protected void addButtons() {
this.guiTop + 108,
Settings.ACTIONS,
ActionItems.ORE_FILTER);
this.stickyMode = new GuiImgButton(
this.guiLeft - 18,
this.guiTop + 88,
Settings.STICKY_MODE,
YesNo.NO);
this.stickyMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + 88, Settings.STICKY_MODE, YesNo.NO);

this.buttonList.add(
this.priority = new GuiTabButton(
Expand Down Expand Up @@ -152,8 +148,7 @@ protected void actionPerformed(final GuiButton btn) {
NetworkHandler.instance
.sendToServer(new PacketConfigButton(this.storageFilter.getSetting(), backwards));
} else if (btn == this.stickyMode) {
NetworkHandler.instance
.sendToServer(new PacketConfigButton(this.stickyMode.getSetting(), backwards));
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.stickyMode.getSetting(), backwards));
}
} catch (final IOException e) {
AELog.debug(e);
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/appeng/client/gui/widgets/GuiImgButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,14 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) {
ButtonToolTips.CraftingModeIgnoreMissing,
ButtonToolTips.CraftingModeIgnoreMissingDesc);
this.registerApp(16 * 6 + 5, Settings.ACTIONS, ActionItems.EXTRA_OPTIONS, ButtonToolTips.ExtraOptions, "");
this.registerApp(16*6 + 8,
this.registerApp(
16 * 6 + 8,
Settings.STICKY_MODE,
YesNo.NO,
ButtonToolTips.StickyModeOn,
ButtonToolTips.StickyModeOnDesc);
this.registerApp(16*6 + 9,
this.registerApp(
16 * 6 + 9,
Settings.STICKY_MODE,
YesNo.YES,
ButtonToolTips.StickyModeOff,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import java.util.Iterator;

import appeng.api.config.YesNo;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
Expand All @@ -24,6 +23,7 @@
import appeng.api.config.Settings;
import appeng.api.config.StorageFilter;
import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
Expand All @@ -41,7 +41,6 @@ public class ContainerStorageBus extends ContainerUpgradeable {
@GuiSync(3)
public AccessRestriction rwMode = AccessRestriction.READ_WRITE;


@GuiSync(4)
public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY;

Expand Down Expand Up @@ -133,8 +132,7 @@ public void detectAndSendChanges() {
(AccessRestriction) this.getUpgradeable().getConfigManager().getSetting(Settings.ACCESS));
this.setStorageFilter(
(StorageFilter) this.getUpgradeable().getConfigManager().getSetting(Settings.STORAGE_FILTER));
this.setStickyMode(
(YesNo) this.getUpgradeable().getConfigManager().getSetting(Settings.STICKY_MODE));
this.setStickyMode((YesNo) this.getUpgradeable().getConfigManager().getSetting(Settings.STICKY_MODE));
}

this.standardDetectAndSendChanges();
Expand Down Expand Up @@ -200,12 +198,9 @@ public YesNo getStickyMode() {
private void setStickyMode(final YesNo stickyMode) {
this.stickyMode = stickyMode;
}

private void setReadWriteMode(final AccessRestriction rwMode) {
this.rwMode = rwMode;
}





}
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ public IItemDefinition cardCrafting() {
public IItemDefinition cardSticky() {
return this.cardSticky;
}

@Override
public IItemDefinition enderDust() {
return this.enderDust;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/appeng/items/materials/MaterialType.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public enum MaterialType {
CardPatternRefiller(62),
CardAdvancedBlocking(63),
CardSticky(64);

private final EnumSet<AEFeature> features;
// IIcon for the material.
@SideOnly(Side.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ public void setOreFilter(ItemStack is, String filter) {
Platform.openNbtData(is).setString("OreFilter", filter);
}


@Override
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
this.disassembleDrive(stack, world, player);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/appeng/me/storage/MEInventoryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
private boolean hasReadAccess;
protected boolean hasWriteAccess;
protected boolean isSticky;

public MEInventoryHandler(final IMEInventory<T> i, final StorageChannel channel) {
if (i instanceof IMEInventoryHandler) {
this.internal = (IMEInventoryHandler<T>) i;
Expand Down
19 changes: 9 additions & 10 deletions src/main/java/appeng/me/storage/NetworkInventoryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import appeng.api.storage.data.IItemList;
import appeng.me.cache.SecurityCache;
import appeng.util.ItemSorters;
import appeng.util.item.ItemList;

public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHandler<T> {

Expand All @@ -61,13 +60,13 @@ public NetworkInventoryHandler(final StorageChannel chan, final SecurityCache se

public void addNewStorage(final IMEInventoryHandler<T> h) {
final int priority = h.getPriority();
if (!h.getSticky())
{
List<IMEInventoryHandler<T>> list = this.priorityInventory.computeIfAbsent(priority, k -> new ArrayList<>());
if (!h.getSticky()) {
List<IMEInventoryHandler<T>> list = this.priorityInventory
.computeIfAbsent(priority, k -> new ArrayList<>());
list.add(h);
}
else {
List<IMEInventoryHandler<T>> listSticky = this.stickyPriorityInventory.computeIfAbsent(priority, k -> new ArrayList<>());
} else {
List<IMEInventoryHandler<T>> listSticky = this.stickyPriorityInventory
.computeIfAbsent(priority, k -> new ArrayList<>());
listSticky.add(h);
}
}
Expand Down Expand Up @@ -219,7 +218,8 @@ public T extractItems(T request, final Actionable mode, final BaseActionSource s
}
}

final Iterator<List<IMEInventoryHandler<T>>> j = this.stickyPriorityInventory.descendingMap().values().iterator();
final Iterator<List<IMEInventoryHandler<T>>> j = this.stickyPriorityInventory.descendingMap().values()
.iterator();

while (j.hasNext()) {
final List<IMEInventoryHandler<T>> invList = j.next();
Expand Down Expand Up @@ -257,8 +257,7 @@ public IItemList<T> getAvailableItems(IItemList out) {
return out;
}

private IItemList<T> iterateInventories(IItemList out, NavigableMap<Integer, List<IMEInventoryHandler<T>>> map)
{
private IItemList<T> iterateInventories(IItemList out, NavigableMap<Integer, List<IMEInventoryHandler<T>>> map) {
for (final List<IMEInventoryHandler<T>> i : map.values()) {
for (final IMEInventoryHandler<T> j : i) {
out = j.getAvailableItems(out);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/parts/misc/PartStorageBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.Collections;
import java.util.List;

import appeng.api.config.YesNo;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
Expand All @@ -31,6 +30,7 @@
import appeng.api.config.Settings;
import appeng.api.config.StorageFilter;
import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
import appeng.api.networking.IGridNode;
import appeng.api.networking.events.MENetworkCellArrayUpdate;
import appeng.api.networking.events.MENetworkChannelsChanged;
Expand Down

0 comments on commit cca172f

Please sign in to comment.