mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
spotlessApply
This commit is contained in:
1 parent
11bf706a32
commit
f0aef4e73c
9 files changed
+155
-122
No files matched your search
@@ -18,12 +18,11 @@ import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.network.CPacketSwitchGuis;
|
||||
import java.io.IOException;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GuiFCPriority extends AEBaseGui {
|
||||
|
||||
private GuiNumberBox priority;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.glodblock.github.client.gui;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.StorageFilter;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.client.gui.implementations.GuiUpgradeable;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
@@ -42,9 +41,9 @@ public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
this.clear = new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE);
|
||||
this.partition = new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH);
|
||||
this.rwMode =
|
||||
new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE);
|
||||
this.priority = new GuiTabButton(
|
||||
this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender);
|
||||
new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE);
|
||||
this.priority =
|
||||
new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender);
|
||||
|
||||
this.buttonList.add(this.priority);
|
||||
this.buttonList.add(this.rwMode);
|
||||
@@ -55,9 +54,12 @@ public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.fontRendererObj.drawString(
|
||||
this.getGuiDisplayName(I18n.format(NameConst.GUI_FLUID_STORAGE_BUS)), 8, 6, GuiColors.StorageBusTitle.getColor());
|
||||
this.getGuiDisplayName(I18n.format(NameConst.GUI_FLUID_STORAGE_BUS)),
|
||||
8,
|
||||
6,
|
||||
GuiColors.StorageBusTitle.getColor());
|
||||
this.fontRendererObj.drawString(
|
||||
GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.StorageBusInventory.getColor());
|
||||
GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.StorageBusInventory.getColor());
|
||||
|
||||
if (this.rwMode != null) {
|
||||
this.rwMode.set(((ContainerFluidStorageBus) this.cvb).getReadWriteMode());
|
||||
@@ -87,5 +89,4 @@ public class GuiFluidStorageBus extends GuiUpgradeable {
|
||||
public void update(int id, IAEFluidStack stack) {
|
||||
((ContainerFluidStorageBus) this.cvb).bus.setFluidInSlot(id, stack);
|
||||
}
|
||||
|
||||
}
|
||||
+42
-18
@@ -14,16 +14,17 @@ import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
import com.glodblock.github.inventory.slot.OptionalFluidSlotFakeTypeOnly;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import java.util.Iterator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class ContainerFluidStorageBus extends ContainerFluidConfigurable {
|
||||
|
||||
public final PartFluidStorageBus bus;
|
||||
|
||||
@GuiSync(3)
|
||||
public AccessRestriction rwMode = AccessRestriction.READ_WRITE;
|
||||
|
||||
@GuiSync(4)
|
||||
public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY;
|
||||
|
||||
@@ -45,22 +46,44 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable {
|
||||
final IInventory config = Ae2Reflect.getUpgradeList(this).getInventoryByName("config");
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlotToContainer(new OptionalFluidSlotFakeTypeOnly(config, null, this, y * 9 + x, xo, yo, x, y, y));
|
||||
this.addSlotToContainer(
|
||||
new OptionalFluidSlotFakeTypeOnly(config, null, this, y * 9 + x, xo, yo, x, y, y));
|
||||
}
|
||||
}
|
||||
this.addSlotToContainer((new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getInventoryPlayer()))
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getInventoryPlayer()))
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
1,
|
||||
187,
|
||||
8 + 18,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getInventoryPlayer()))
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
2,
|
||||
187,
|
||||
8 + 18 * 2,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getInventoryPlayer()))
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
3,
|
||||
187,
|
||||
8 + 18 * 3,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
this.addSlotToContainer((new SlotRestrictedInput(
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
upgrades,
|
||||
4,
|
||||
187,
|
||||
8 + 18 * 4,
|
||||
this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
}
|
||||
|
||||
@@ -89,8 +112,10 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable {
|
||||
this.verifyPermissions(SecurityPermissions.BUILD, false);
|
||||
|
||||
if (Platform.isServer()) {
|
||||
this.setReadWriteMode((AccessRestriction) Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.setStorageFilter((StorageFilter) Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.STORAGE_FILTER));
|
||||
this.setReadWriteMode((AccessRestriction)
|
||||
Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.setStorageFilter((StorageFilter)
|
||||
Ae2Reflect.getUpgradeList(this).getConfigManager().getSetting(Settings.STORAGE_FILTER));
|
||||
}
|
||||
|
||||
this.standardDetectAndSendChanges();
|
||||
@@ -116,8 +141,8 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable {
|
||||
final IMEInventory<IAEFluidStack> cellInv = this.bus.getInternalHandler();
|
||||
Iterator<IAEFluidStack> i = new NullIterator<>();
|
||||
if (cellInv != null) {
|
||||
final IItemList<IAEFluidStack> list = cellInv
|
||||
.getAvailableItems(AEApi.instance().storage().createFluidList());
|
||||
final IItemList<IAEFluidStack> list =
|
||||
cellInv.getAvailableItems(AEApi.instance().storage().createFluidList());
|
||||
i = list.iterator();
|
||||
}
|
||||
|
||||
@@ -151,5 +176,4 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable {
|
||||
private void setStorageFilter(final StorageFilter storageFilter) {
|
||||
this.storageFilter = storageFilter;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,14 +9,13 @@ import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemPartFluidStorageBus extends Item implements IPartItem {
|
||||
|
||||
public ItemPartFluidStorageBus() {
|
||||
@@ -33,16 +32,16 @@ public class ItemPartFluidStorageBus extends Item implements IPartItem {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float xOffset,
|
||||
float yOffset,
|
||||
float zOffset) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(), x, y, z, side, player, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ import appeng.tile.networking.TileCableBus;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import appeng.util.prioitylist.FuzzyPriorityList;
|
||||
import appeng.util.prioitylist.PrecisePriorityList;
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
@@ -49,6 +48,9 @@ import com.glodblock.github.util.Util;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import extracells.tileentity.TileEntityFluidInterface;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -56,13 +58,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PartFluidStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEFluidStack>, IPriorityHost {
|
||||
public class PartFluidStorageBus extends PartUpgradeable
|
||||
implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEFluidStack>, IPriorityHost {
|
||||
|
||||
private final BaseActionSource source;
|
||||
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, 63);
|
||||
@@ -154,11 +152,11 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
final IInventory inv,
|
||||
final int slot,
|
||||
final InvOperation mc,
|
||||
final ItemStack removedStack,
|
||||
final ItemStack newStack) {
|
||||
super.onChangeInventory(inv, slot, mc, removedStack, newStack);
|
||||
|
||||
if (inv == this.config) {
|
||||
@@ -167,7 +165,10 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
}
|
||||
|
||||
protected void resetCache(final boolean fullReset) {
|
||||
if (this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorldObj() == null || this.getHost().getTile().getWorldObj().isRemote) {
|
||||
if (this.getHost() == null
|
||||
|| this.getHost().getTile() == null
|
||||
|| this.getHost().getTile().getWorldObj() == null
|
||||
|| this.getHost().getTile().getWorldObj().isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -191,7 +192,8 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
IItemList<IAEFluidStack> before = AEApi.instance().storage().createFluidList();
|
||||
if (in != null) {
|
||||
if (accessChanged) {
|
||||
AccessRestriction currentAccess = (AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
|
||||
AccessRestriction currentAccess =
|
||||
(AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS);
|
||||
if (!currentAccess.hasPermission(AccessRestriction.READ)) {
|
||||
readOncePass = true;
|
||||
}
|
||||
@@ -225,13 +227,19 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(final IBaseMonitor<IAEFluidStack> monitor, final Iterable<IAEFluidStack> change, final BaseActionSource source) {
|
||||
public void postChange(
|
||||
final IBaseMonitor<IAEFluidStack> monitor,
|
||||
final Iterable<IAEFluidStack> change,
|
||||
final BaseActionSource source) {
|
||||
if (this.getProxy().isActive()) {
|
||||
AccessRestriction currentAccess = (AccessRestriction) ((ConfigManager) this.getConfigManager()).getSetting(Settings.ACCESS);
|
||||
AccessRestriction currentAccess =
|
||||
(AccessRestriction) ((ConfigManager) this.getConfigManager()).getSetting(Settings.ACCESS);
|
||||
if (readOncePass) {
|
||||
readOncePass = false;
|
||||
try {
|
||||
this.getProxy().getStorage().postAlterationOfStoredItems(StorageChannel.FLUIDS, change, this.source);
|
||||
this.getProxy()
|
||||
.getStorage()
|
||||
.postAlterationOfStoredItems(StorageChannel.FLUIDS, change, this.source);
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
return;
|
||||
@@ -268,7 +276,8 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
if (iPart == null || iPart instanceof PartFluidInterface) {
|
||||
this.resetCache(true);
|
||||
this.resetCache();
|
||||
} if (ModAndClassUtil.EC2) {
|
||||
}
|
||||
if (ModAndClassUtil.EC2) {
|
||||
if (iPart == null || iPart instanceof extracells.part.PartFluidInterface) {
|
||||
this.resetCache(true);
|
||||
this.resetCache();
|
||||
@@ -294,11 +303,11 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
}
|
||||
if (Platform.isServer()) {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
this.getHost().getTile().getWorldObj(),
|
||||
new BlockPos(this.getHost().getTile()),
|
||||
Objects.requireNonNull(Util.from(this.getSide())),
|
||||
GuiType.FLUID_STORAGE_BUS);
|
||||
player,
|
||||
this.getHost().getTile().getWorldObj(),
|
||||
new BlockPos(this.getHost().getTile()),
|
||||
Objects.requireNonNull(Util.from(this.getSide())),
|
||||
GuiType.FLUID_STORAGE_BUS);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -339,12 +348,12 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
this.monitor = null;
|
||||
if (target != null) {
|
||||
final IExternalStorageHandler esh = AEApi.instance()
|
||||
.registries()
|
||||
.externalStorage()
|
||||
.getHandler(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
.registries()
|
||||
.externalStorage()
|
||||
.getHandler(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
if (esh != null) {
|
||||
final IMEInventory<?> inv =
|
||||
esh.getInventory(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
esh.getInventory(target, this.getSide().getOpposite(), StorageChannel.FLUIDS, this.source);
|
||||
if (inv instanceof MEMonitorIFluidHandler) {
|
||||
final MEMonitorIFluidHandler h = (MEMonitorIFluidHandler) inv;
|
||||
h.setMode((StorageFilter) this.getConfigManager().getSetting(Settings.STORAGE_FILTER));
|
||||
@@ -354,17 +363,17 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
if (inv != null) {
|
||||
this.handler = new MEInventoryHandler(inv, StorageChannel.FLUIDS);
|
||||
this.handler.setBaseAccess(
|
||||
(AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS));
|
||||
(AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS));
|
||||
this.handler.setWhitelist(
|
||||
this.getInstalledUpgrades(Upgrades.INVERTER) > 0
|
||||
? IncludeExclude.BLACKLIST
|
||||
: IncludeExclude.WHITELIST);
|
||||
this.getInstalledUpgrades(Upgrades.INVERTER) > 0
|
||||
? IncludeExclude.BLACKLIST
|
||||
: IncludeExclude.WHITELIST);
|
||||
this.handler.setPriority(this.priority);
|
||||
if (inv instanceof IMEMonitor) {
|
||||
((IBaseMonitor) inv).addListener(this, this.handler);
|
||||
}
|
||||
final IItemList<IAEFluidStack> priorityList =
|
||||
AEApi.instance().storage().createFluidList();
|
||||
AEApi.instance().storage().createFluidList();
|
||||
|
||||
final int slotsToUse = 18 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 9;
|
||||
for (int x = 0; x < this.config.getSizeInventory() && x < slotsToUse; x++) {
|
||||
@@ -445,12 +454,12 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon());
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon());
|
||||
|
||||
rh.setBounds(3, 3, 15, 13, 13, 16);
|
||||
rh.renderInventoryBox(renderer);
|
||||
@@ -465,15 +474,15 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderStatic(
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache()));
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon());
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon());
|
||||
|
||||
rh.setBounds(3, 3, 15, 13, 13, 16);
|
||||
rh.renderBlock(x, y, z, renderer);
|
||||
@@ -482,28 +491,27 @@ public class PartFluidStorageBus extends PartUpgradeable implements IGridTickabl
|
||||
rh.renderBlock(x, y, z, renderer);
|
||||
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon());
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon(),
|
||||
CableBusTextures.PartStorageSides.getIcon());
|
||||
|
||||
rh.setBounds(5, 5, 12, 11, 11, 13);
|
||||
rh.renderBlock(x, y, z, renderer);
|
||||
|
||||
rh.setTexture(
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon(),
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon(),
|
||||
CableBusTextures.PartMonitorBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon(),
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon());
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon(),
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon(),
|
||||
CableBusTextures.PartMonitorBack.getIcon(),
|
||||
FCPartsTexture.PartFluidStorageBus.getIcon(),
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon(),
|
||||
CableBusTextures.PartMonitorSidesStatus.getIcon());
|
||||
|
||||
rh.setBounds(5, 5, 13, 11, 11, 14);
|
||||
rh.renderBlock(x, y, z, renderer);
|
||||
|
||||
this.renderLights(x, y, z, rh, renderer);
|
||||
}
|
||||
|
||||
}
|
||||
+20
-14
@@ -35,7 +35,6 @@ public class ExternalStorageRegistryTransformer extends FCClassTransformer.Class
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TransformGetHandler extends MethodVisitor {
|
||||
@@ -52,11 +51,11 @@ public class ExternalStorageRegistryTransformer extends FCClassTransformer.Class
|
||||
@Override
|
||||
public void visitJumpInsn(int opcode, Label label) {
|
||||
if (opcode == Opcodes.IFEQ) {
|
||||
cnt_if ++;
|
||||
cnt_if++;
|
||||
}
|
||||
if (cnt_if == 3) {
|
||||
L6 = label;
|
||||
cnt_if ++;
|
||||
cnt_if++;
|
||||
super.visitJumpInsn(opcode, L9);
|
||||
return;
|
||||
}
|
||||
@@ -66,28 +65,35 @@ public class ExternalStorageRegistryTransformer extends FCClassTransformer.Class
|
||||
@Override
|
||||
public void visitInsn(int opcode) {
|
||||
if (opcode == Opcodes.ARETURN) {
|
||||
cnt_return ++;
|
||||
cnt_return++;
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
if (cnt_return == 2) {
|
||||
super.visitLabel(L9);
|
||||
super.visitFieldInsn(Opcodes.GETSTATIC, "com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"INSTANCE", "Lcom/glodblock/github/inventory/external/AEFluidTankHandler;");
|
||||
super.visitFieldInsn(
|
||||
Opcodes.GETSTATIC,
|
||||
"com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"INSTANCE",
|
||||
"Lcom/glodblock/github/inventory/external/AEFluidTankHandler;");
|
||||
super.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
super.visitVarInsn(Opcodes.ALOAD, 2);
|
||||
super.visitVarInsn(Opcodes.ALOAD, 3);
|
||||
super.visitVarInsn(Opcodes.ALOAD, 4);
|
||||
super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"canHandle",
|
||||
"(Lnet/minecraft/tileentity/TileEntity;Lnet/minecraftforge/common/util/ForgeDirection;Lappeng/api/storage/StorageChannel;Lappeng/api/networking/security/BaseActionSource;)Z",
|
||||
false);
|
||||
super.visitMethodInsn(
|
||||
Opcodes.INVOKEVIRTUAL,
|
||||
"com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"canHandle",
|
||||
"(Lnet/minecraft/tileentity/TileEntity;Lnet/minecraftforge/common/util/ForgeDirection;Lappeng/api/storage/StorageChannel;Lappeng/api/networking/security/BaseActionSource;)Z",
|
||||
false);
|
||||
super.visitJumpInsn(Opcodes.IFEQ, L6);
|
||||
super.visitFieldInsn(Opcodes.GETSTATIC, "com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"INSTANCE", "Lcom/glodblock/github/inventory/external/AEFluidTankHandler;");
|
||||
super.visitFieldInsn(
|
||||
Opcodes.GETSTATIC,
|
||||
"com/glodblock/github/inventory/external/AEFluidTankHandler",
|
||||
"INSTANCE",
|
||||
"Lcom/glodblock/github/inventory/external/AEFluidTankHandler;");
|
||||
super.visitInsn(Opcodes.ARETURN);
|
||||
cnt_return ++;
|
||||
cnt_return++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,8 +66,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
public IAEFluidStack extractItems(IAEFluidStack request, Actionable type, BaseActionSource src) {
|
||||
FluidStack removed =
|
||||
this.handler.drain(this.side, request.getFluidStack(), type == Actionable.MODULATE);
|
||||
FluidStack removed = this.handler.drain(this.side, request.getFluidStack(), type == Actionable.MODULATE);
|
||||
if (removed != null && removed.amount != 0) {
|
||||
IAEFluidStack o = request.copy();
|
||||
o.setStackSize(removed.amount);
|
||||
@@ -99,8 +98,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
|
||||
if (tankProperties != null) {
|
||||
for (FluidTankInfo tankProperty : tankProperties) {
|
||||
if (this.mode != StorageFilter.EXTRACTABLE_ONLY
|
||||
|| this.handler.drain(this.side, 1, false) != null) {
|
||||
if (this.mode != StorageFilter.EXTRACTABLE_ONLY || this.handler.drain(this.side, 1, false) != null) {
|
||||
currentlyOnStorage.add(AEFluidStack.create(tankProperty.fluid));
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -6,8 +6,6 @@ import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -18,7 +16,9 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
|
||||
if (channel == StorageChannel.FLUIDS) {
|
||||
if (te instanceof ITileStorageMonitorable) {
|
||||
return true;
|
||||
} else return te instanceof TileCableBus && ((TileCableBus) te).getPart(d.getOpposite()) instanceof ITileStorageMonitorable;
|
||||
} else
|
||||
return te instanceof TileCableBus
|
||||
&& ((TileCableBus) te).getPart(d.getOpposite()) instanceof ITileStorageMonitorable;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -29,13 +29,12 @@ public class AEFluidInterfaceHandler implements IExternalStorageHandler {
|
||||
if (channel == StorageChannel.FLUIDS) {
|
||||
if (te instanceof ITileStorageMonitorable) {
|
||||
return ((ITileStorageMonitorable) te).getMonitorable(d, src).getFluidInventory();
|
||||
}
|
||||
else if (te instanceof TileCableBus && ((TileCableBus) te).getPart(d.getOpposite()) instanceof ITileStorageMonitorable) {
|
||||
} else if (te instanceof TileCableBus
|
||||
&& ((TileCableBus) te).getPart(d.getOpposite()) instanceof ITileStorageMonitorable) {
|
||||
ITileStorageMonitorable part = (ITileStorageMonitorable) ((TileCableBus) te).getPart(d.getOpposite());
|
||||
return part.getMonitorable(d, src).getFluidInventory();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,5 +28,4 @@ public class AEFluidTankHandler implements IExternalStorageHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user