Removed unneeded imports/suppressed warnings

This commit is contained in:
p455w0rd committed 2016-04-30 13:53:07 -04:00
1 parent 007b4df115
commit c4e9d90118
68 files changed
+168 -303

No files matched your search

@@ -1,8 +1,5 @@
package cofh.api.energy;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
@@ -1,8 +1,5 @@
package cofh.api.energy;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -1,14 +1,10 @@
package net.p455w0rd.wirelesscraftingterminal.api;
import javax.annotation.Nonnull;
//import appeng.api.features.INetworkEncodable;
import appeng.api.features.IWirelessTermHandler;
import appeng.api.implementations.items.IAEItemPowerStorage;
import appeng.api.util.IConfigManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/**
* Provides the required functionality of a wireless terminal.
@@ -9,6 +9,7 @@ public abstract class WCTApi {
protected static WCTApi api = null;
@SuppressWarnings({ "rawtypes", "unchecked" })
@Nullable
public static WCTApi instance()
{
@@ -45,7 +45,6 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
return !this.disable;
}
@SuppressWarnings( "unchecked" )
@Override
public boolean matches( final InventoryCrafting var1, final World world )
{
@@ -18,8 +18,6 @@ import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketCraftRequest;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class GuiCraftAmount extends WCTBaseGui {
@@ -47,6 +45,7 @@ public class GuiCraftAmount extends WCTBaseGui {
myIcon = RandomUtils.getWirelessTerm(inventoryPlayer);
}
@SuppressWarnings({ "unchecked", "unused" })
@Override
public void initGui() {
super.initGui();
@@ -1,7 +1,6 @@
package net.p455w0rd.wirelesscraftingterminal.client.gui;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
@@ -74,6 +73,7 @@ public class GuiCraftConfirm extends WCTBaseGui
return ( (ContainerCraftConfirm) this.inventorySlots ).isAutoStart();
}
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
@@ -170,9 +170,9 @@ public class GuiCraftConfirm extends WCTBaseGui
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
//final long BytesUsed = this.ccc.getUsedBytes();
final long BytesUsed = ((ContainerCraftConfirm) this.inventorySlots).getUsedBytes();
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
//final long BytesUsed = ((ContainerCraftConfirm) this.inventorySlots).getUsedBytes();
//final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
//final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
//this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " -- " + Add, 8, 7, 4210752 );
this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal(), 8, 7, 4210752 );
@@ -113,6 +113,7 @@ public class GuiCraftingCPU extends WCTBaseGui implements ISortSource
}
}
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
@@ -451,18 +452,21 @@ public class GuiCraftingCPU extends WCTBaseGui implements ISortSource
return stack;
}
@SuppressWarnings("rawtypes")
@Override
public Enum getSortBy()
{
return SortOrder.NAME;
}
@SuppressWarnings("rawtypes")
@Override
public Enum getSortDir()
{
return SortDir.ASCENDING;
}
@SuppressWarnings("rawtypes")
@Override
public Enum getSortDisplay()
{
@@ -15,8 +15,6 @@ import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketValueConfig;
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import appeng.api.AEApi;
import appeng.api.definitions.IDefinitions;
@@ -35,6 +33,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
private int originalGui;
private ItemStack myIcon = null;
@SuppressWarnings("unused")
public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( new ContainerCraftingStatus( inventoryPlayer, te ) );
@@ -82,6 +81,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
}
}
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
@@ -2,18 +2,14 @@ package net.p455w0rd.wirelesscraftingterminal.client.gui;
import org.lwjgl.opengl.GL11;
import appeng.helpers.InventoryAction;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ResourceLocation;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerMagnet;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketInventoryAction;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketMagnetFilterMode;
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
@@ -22,7 +18,6 @@ public class GuiMagnet extends GuiContainer {
private GuiButton modeBtn;
public static boolean mode = true;
private ItemStack magnetItem;
private ContainerMagnet container;
public GuiMagnet(ContainerMagnet c) {
super(c);
@@ -31,8 +26,7 @@ public class GuiMagnet extends GuiContainer {
this.ySize = 168;
this.height = this.ySize;
magnetItem = c.heldItem;
this.mode = getMode();
this.container = c;
GuiMagnet.mode = getMode();
}
@Override
@@ -48,11 +42,12 @@ public class GuiMagnet extends GuiContainer {
this.mc.fontRenderer.drawString(I18n.format("container.inventory"), 7, 74, 4210752);
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
this.buttonList.clear();
this.buttonList.add(this.modeBtn = new GuiButton(1, this.guiLeft + 108, this.guiTop + 3, 60, 10, getLabel(this.mode)));
this.buttonList.add(this.modeBtn = new GuiButton(1, this.guiLeft + 108, this.guiTop + 3, 60, 10, getLabel(GuiMagnet.mode)));
}
String getLabel(boolean filterMode) {
@@ -62,9 +57,9 @@ public class GuiMagnet extends GuiContainer {
@Override
protected void actionPerformed(final GuiButton btn) {
if (btn == this.modeBtn) {
btn.displayString = getLabel(!this.mode);
this.mode = !this.mode;
setMode(this.mode);
btn.displayString = getLabel(!GuiMagnet.mode);
GuiMagnet.mode = !GuiMagnet.mode;
setMode(GuiMagnet.mode);
}
}
@@ -72,7 +72,6 @@ import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotFake;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotInaccessible;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotOutput;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotTrash;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryBooster;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketEmptyTrash;
@@ -97,9 +96,8 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
slotYOffset;
protected static final int BUTTON_SEARCH_MODE_ID = 5;
protected static final long TOOLTIP_UPDATE_INTERVAL = 3000L;
private int currScreenWidth, currScreenHeight, previousMouseX = 0, previousMouseY = 0;
private int currScreenWidth, currScreenHeight;
private static final String bgTexturePath = "gui/crafting.png";
private final WCTInventoryBooster inventory;
private final ContainerWirelessCraftingTerminal containerWCT;
private boolean isFullScreen, init = true, reInit, wasResized = false;
public static GuiWirelessCraftingTerminal INSTANCE;
@@ -116,21 +114,17 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
public static int craftingGridOffsetX = 80;
public static int craftingGridOffsetY;
private static String memoryText = "";
private static String memoryText2 = "";
private final ItemRepo repo;
private final int offsetX = 8;
private final IConfigManager configSrc;
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
private GuiTabButton craftingStatusBtn;
private MEGuiTextField searchField;
private int perRow = 9;
private boolean customSortOrder = true;
private int maxRows = Integer.MAX_VALUE;
private GuiImgButton ViewBox;
private GuiImgButton SortByBox;
private GuiImgButton SortDirBox;
private GuiImgButton searchBoxSettings;
private GuiImgButton terminalStyleBox;
private GuiImgButton clearBtn;
private GuiTrashButton trashBtn;
public boolean devicePowered = false;
@@ -140,9 +134,8 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
public GuiWirelessCraftingTerminal(Container container) {
super(container);
this.INSTANCE = this;
GuiWirelessCraftingTerminal.INSTANCE = this;
this.containerWCT = (ContainerWirelessCraftingTerminal) container;
this.inventory = containerWCT.boosterInventory;
this.scrollBar = new GuiScrollbar();
this.subGui = switchingGuis;
switchingGuis = false;
@@ -168,6 +161,7 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
this.getScrollBar().setRange(0, (this.repo.size() + this.perRow - 1) / this.perRow - (AE_NUM_ROWS + 3), Math.max(1, (AE_NUM_ROWS + 3) / 6));
}
@SuppressWarnings("rawtypes")
@Override
protected void actionPerformed(final GuiButton btn) {
if (btn == this.craftingStatusBtn) {
@@ -264,6 +258,7 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
/**
* Initializes the GUI
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void initGui() {
Keyboard.enableRepeatEvents(true);
@@ -288,8 +283,8 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
int offset = this.guiTop + 8;
this.buttonList.clear();
this.buttonList.add(this.clearBtn = new GuiImgButton(this.guiLeft + 134, this.GUI_HEIGHT - this.GUI_LOWER_HEIGHT + 46, Settings.ACTIONS, ActionItems.STASH));
this.buttonList.add(this.trashBtn = new GuiTrashButton(this.guiLeft + 98, this.GUI_HEIGHT - this.GUI_LOWER_HEIGHT + 103));
this.buttonList.add(this.clearBtn = new GuiImgButton(this.guiLeft + 134, GuiWirelessCraftingTerminal.GUI_HEIGHT - GuiWirelessCraftingTerminal.GUI_LOWER_HEIGHT + 46, Settings.ACTIONS, ActionItems.STASH));
this.buttonList.add(this.trashBtn = new GuiTrashButton(this.guiLeft + 98, GuiWirelessCraftingTerminal.GUI_HEIGHT - GuiWirelessCraftingTerminal.GUI_LOWER_HEIGHT + 103));
this.clearBtn.setHalfSize(true);
if (this.customSortOrder) {
this.buttonList.add(this.SortByBox = new GuiImgButton(this.guiLeft - 18, offset, Settings.SORT_BY, this.configSrc.getSetting(Settings.SORT_BY)));
@@ -615,6 +610,7 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
GuiInventory.func_147046_a(this.guiLeft + 51, this.guiTop + GUI_UPPER_HEIGHT + AE_TOTAL_ROWS_HEIGHT + 112, 32, (float) (this.guiLeft + 51) - this.xSize_lo, (float) (this.guiTop + 95 + (AE_NUM_ROWS * AE_ROW_HEIGHT)) - this.ySize_lo, this.mc.thePlayer);
}
@SuppressWarnings("rawtypes")
@Override
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
@@ -987,7 +983,7 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
return;
}
else {
this.itemRender = new RenderItem();
GuiWirelessCraftingTerminal.itemRender = new RenderItem();
try {
final ItemStack is = s.getStack();
if (s instanceof AppEngSlot && (((AppEngSlot) s).renderIconWithItem() || is == null) && (((AppEngSlot) s).shouldDisplay())) {
@@ -1189,6 +1185,7 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
return currentToolTip;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void renderToolTip(final ItemStack stack, final int x, final int y) {
final Slot s = this.getSlot(x, y);
@@ -1205,7 +1202,6 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
}
if (myStack != null) {
@SuppressWarnings("unchecked")
final List<String> currentToolTip = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
if (myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged())) {
@@ -1229,6 +1225,7 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
// super.drawItemStackTooltip( stack, x, y );
}
@SuppressWarnings("rawtypes")
@Override
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
if (this.SortByBox != null) {
@@ -1254,16 +1251,19 @@ public class GuiWirelessCraftingTerminal extends GuiContainer implements ISortSo
this.customSortOrder = customSortOrder;
}
@SuppressWarnings("rawtypes")
@Override
public Enum getSortBy() {
return this.configSrc.getSetting(Settings.SORT_BY);
}
@SuppressWarnings("rawtypes")
@Override
public Enum getSortDir() {
return this.configSrc.getSetting(Settings.SORT_DIRECTION);
}
@SuppressWarnings("rawtypes")
@Override
public Enum getSortDisplay() {
return this.configSrc.getSetting(Settings.VIEW_MODE);
@@ -1,6 +1,5 @@
package net.p455w0rd.wirelesscraftingterminal.client.gui;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.Collection;
@@ -9,6 +9,7 @@ import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class WCTGuiConfig extends GuiConfig {
@SuppressWarnings({ "unchecked", "rawtypes" })
public WCTGuiConfig(GuiScreen guiScreen)
{
super(guiScreen,
@@ -3,7 +3,6 @@ package net.p455w0rd.wirelesscraftingterminal.client.gui.widgets;
import org.lwjgl.opengl.GL11;
import appeng.client.gui.widgets.ITooltip;
import appeng.client.texture.ExtraBlockTextures;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.EnumChatFormatting;
@@ -100,6 +100,7 @@ public class ItemRepo
this.updateView();
}
@SuppressWarnings("rawtypes")
public void updateView()
{
this.view.clear();
@@ -227,6 +228,7 @@ public class ItemRepo
}
}
@SuppressWarnings("rawtypes")
private void updateNEI( final String filter )
{
try
@@ -5,8 +5,6 @@ import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.api.storage.ITerminalHost;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTermHandler;
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftAmount;
@@ -21,8 +19,6 @@ import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerMagnet;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class WCTGuiHandler implements IGuiHandler {
@@ -1,8 +1,6 @@
package net.p455w0rd.wirelesscraftingterminal.common;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.*;
import cpw.mods.fml.common.event.*;
@@ -18,7 +16,6 @@ import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.creativetab.CreativeTabWCT;
import net.p455w0rd.wirelesscraftingterminal.handlers.AchievementHandler;
import net.p455w0rd.wirelesscraftingterminal.handlers.ConfigHandler;
import net.p455w0rd.wirelesscraftingterminal.handlers.KeybindHandler;
import net.p455w0rd.wirelesscraftingterminal.handlers.RecipeHandler;
import net.p455w0rd.wirelesscraftingterminal.integration.IntegrationRegistry;
import net.p455w0rd.wirelesscraftingterminal.proxy.CommonProxy;
@@ -74,7 +71,7 @@ public class WirelessCraftingTerminal {
long stopwatch = WCTLog.beginSection("PostInit");
IntegrationRegistry.INSTANCE.postInit();
FMLCommonHandler.instance().registerCrashCallable(new IntegrationCrashEnhancement());
NetworkRegistry.INSTANCE.registerGuiHandler(this.INSTANCE, new WCTGuiHandler());
NetworkRegistry.INSTANCE.registerGuiHandler(WirelessCraftingTerminal.INSTANCE, new WCTGuiHandler());
NetworkHandler.instance = new NetworkHandler("WCT");
WirelessCraftingTerminal.proxy.removeItemsFromNEI();
WCTLog.endSection("PostInit", stopwatch);
@@ -8,7 +8,6 @@ import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTIActionHost;
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTPlayerSource;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotInaccessible;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryBooster;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.IGrid;
import appeng.api.networking.security.BaseActionSource;
@@ -13,14 +13,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTIActionHost;
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTPlayerSource;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.common.container.guisync.GuiSync;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryBooster;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketMEInventoryUpdate;
@@ -8,7 +8,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraftforge.common.util.ForgeDirection;
import net.p455w0rd.wirelesscraftingterminal.common.container.guisync.GuiSync;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryBooster;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketMEInventoryUpdate;
@@ -18,18 +18,17 @@ import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
public class ContainerMagnet extends Container {
public final InventoryPlayer inventoryPlayer;
private EntityPlayer player;
public ItemStack heldItem;
public WCTInventoryMagnetFilter magnetInventory;
private int distributeState = 0;
private int pressedKeyInRange = -1;
@SuppressWarnings("rawtypes")
private final Set distributeSlotSet = new HashSet();
private final int PLAYER_INV_START = 0, PLAYER_INV_END = 26, HOTBAR_START = 27, HOTBAR_END = 35, FILTERS_START = 36,
FILTERS_END = 62;
public ContainerMagnet(EntityPlayer player, InventoryPlayer inventoryPlayer) {
this.inventoryPlayer = inventoryPlayer;
this.player = player;
this.heldItem = RandomUtils.getMagnet(inventoryPlayer);
this.magnetInventory = new WCTInventoryMagnetFilter(heldItem);
@@ -51,7 +50,6 @@ public class ContainerMagnet extends Container {
this.addSlotToContainer(new SlotMagnetFilter(this.magnetInventory, j + i * 9, j * 18 + 8, 18 + i * 18));
}
}
boolean test1 = false;
}
private boolean isInHotbar(int slotNum) {
@@ -62,6 +60,7 @@ public class ContainerMagnet extends Container {
return (slotNum >= PLAYER_INV_START) && (slotNum <= PLAYER_INV_END);
}
@SuppressWarnings("unused")
private boolean isInFilters(int slotNum) {
return (slotNum >= FILTERS_START) && (slotNum <= FILTERS_END);
}
@@ -80,6 +79,7 @@ public class ContainerMagnet extends Container {
return false;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public ItemStack slotClick(int slotNum, int mouseButton, int modifier, EntityPlayer player) {
if (slotNum >= this.inventorySlots.size()) {
@@ -236,6 +236,7 @@ public class ContainerMagnet extends Container {
return true;
}
@SuppressWarnings("rawtypes")
public static void setSlotStack(Set slotSet, int stackSizeSelector, ItemStack stackToResize, int currentSlotStackSize) {
switch (stackSizeSelector) {
case 0:
@@ -312,7 +313,6 @@ public class ContainerMagnet extends Container {
}
ItemStack phantomStack = stackHeld.copy();
phantomStack.stackSize = stackSize;
ItemStack plainItem = new ItemStack(phantomStack.getItem(), 1);
slot.putStack(phantomStack);
arrangeSlots();
@@ -347,13 +347,11 @@ public class ContainerMagnet extends Container {
@Override
public ItemStack transferStackInSlot(final EntityPlayer p, final int slotIndex) {
ItemStack itemStack = null;
Slot slot = (Slot) inventorySlots.get(slotIndex);
if (slot == null || slot.getStack() == null) {
return null;
}
ItemStack stack = slot.getStack();
itemStack = stack.copy();
if (isInHotbar(slotIndex)) {
if (!mergePhantomStack(stack)) {
if (!mergeItemStack(stack, PLAYER_INV_START, PLAYER_INV_END + 1, false)) {
@@ -16,7 +16,6 @@ import javax.annotation.Nonnull;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IMEMonitorHandlerReceiver;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.api.util.IConfigManager;
@@ -55,9 +54,6 @@ import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.ISecurityGrid;
import appeng.api.networking.storage.IBaseMonitor;
import appeng.container.ContainerNull;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -66,7 +62,6 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
@@ -75,10 +70,8 @@ import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.oredict.OreDictionary;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
@@ -103,7 +96,6 @@ import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotPlayerHot
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotPlayerInv;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotTrash;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryBooster;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryCraftResult;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryCrafting;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryMagnet;
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryTrash;
@@ -129,6 +121,7 @@ public class ContainerWirelessCraftingTerminal extends Container implements ICon
public ItemStack craftItem;
private World worldObj;
private EntityPlayer player;
@SuppressWarnings("unused")
private static final int HOTBAR_START = 1, HOTBAR_END = HOTBAR_START + 8, INV_START = HOTBAR_END + 1,
INV_END = INV_START + 26, ARMOR_START = INV_END + 1, ARMOR_END = ARMOR_START + 3,
CRAFT_GRID_START = ARMOR_END + 1, CRAFT_GRID_END = CRAFT_GRID_START + 8, CRAFT_RESULT = CRAFT_GRID_END + 1,
@@ -146,6 +139,7 @@ public class ContainerWirelessCraftingTerminal extends Container implements ICon
private SlotCraftingMatrix[] craftMatrixSlot;
private SlotCraftingTerm craftingSlot;
public SlotTrash trashSlot;
@SuppressWarnings("unused")
private int firstCraftingSlotNumber = -1, lastCraftingSlotNumber = -1, craftingSlotNumber = -1;
private final WirelessTerminalGuiObject obj;
@@ -957,7 +951,6 @@ public class ContainerWirelessCraftingTerminal extends Container implements ICon
protected boolean networkIsPowered() {
final WCTIActionHost host = this.getActionHost();
boolean test2 = false;
if (host != null) {
final IGridNode gn = host.getActionableNode(Reference.WCT_BOOSTER_ENABLED && this.isBoosterInstalled());
if (gn != null) {
@@ -1124,6 +1117,7 @@ public class ContainerWirelessCraftingTerminal extends Container implements ICon
return this.clientCM;
}
@SuppressWarnings("rawtypes")
@Override
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
if (this.getGui() != null) {
@@ -1623,6 +1617,7 @@ public class ContainerWirelessCraftingTerminal extends Container implements ICon
b.putStack(testB);
}
@SuppressWarnings("unused")
private boolean isCraftMatrixSlot(AppEngSlot cs) {
return (cs.getSlotIndex() >= this.firstCraftingSlotNumber) && !(cs.getSlotIndex() <= this.lastCraftingSlotNumber);
}
@@ -1650,22 +1645,27 @@ public class ContainerWirelessCraftingTerminal extends Container implements ICon
return (index >= INV_START && index <= INV_END);
}
@SuppressWarnings("unused")
private boolean isInArmorSlot(@Nonnull int index) {
return (index >= ARMOR_START && index <= ARMOR_END);
}
@SuppressWarnings("unused")
private boolean isInBoosterSlot(@Nonnull int index) {
return (index == BOOSTER_INDEX);
}
@SuppressWarnings("unused")
private boolean isCraftResult(@Nonnull int index) {
return (index == CRAFT_RESULT);
}
@SuppressWarnings("unused")
private boolean isInCraftMatrix(@Nonnull int index) {
return (index >= CRAFT_GRID_START && index <= CRAFT_GRID_END);
}
@SuppressWarnings("unused")
private boolean notArmorOrBooster(ItemStack is) {
if ((is.getItem() instanceof ItemInfinityBooster) || (is.getItem() instanceof ItemArmor)) {
return false;
@@ -11,7 +11,6 @@ import net.p455w0rd.wirelesscraftingterminal.common.container.WCTBaseContainer;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketProgressBar;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketValueConfig;
public class SyncData
@@ -70,6 +69,7 @@ public class SyncData
}
}
@SuppressWarnings("rawtypes")
private void send( final ICrafting o, final Object val ) throws IOException
{
if( val instanceof String )
@@ -139,6 +139,7 @@ public class SyncData
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
private void updateValue( final Object oldValue, final long val )
{
try
@@ -2,7 +2,6 @@ package net.p455w0rd.wirelesscraftingterminal.common.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
@@ -2,11 +2,9 @@ package net.p455w0rd.wirelesscraftingterminal.common.container.slot;
import net.p455w0rd.wirelesscraftingterminal.items.ItemBoosterBGIcon;
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@@ -20,16 +20,12 @@ import appeng.api.storage.data.IItemList;
import appeng.container.ContainerNull;
import appeng.helpers.IContainerCraftingPacket;
import appeng.helpers.InventoryAction;
import appeng.items.storage.ItemViewCell;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.inv.AdaptorPlayerHand;
import appeng.util.item.AEItemStack;
import appeng.util.prioitylist.IPartitionList;
public class SlotCraftingTerm extends AppEngCraftingSlot
{
public class SlotCraftingTerm extends AppEngCraftingSlot {
private final IInventory craftInv;
private final IInventory pattern;
@@ -37,43 +33,36 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
private final BaseActionSource mySrc;
private final IEnergySource energySrc;
private final IStorageMonitorable storage;
private final IContainerCraftingPacket container;
public SlotCraftingTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp )
{
super( player, cMatrix, output, 0, x, y );
public SlotCraftingTerm(final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc,
final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix,
final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp) {
super(player, cMatrix, output, 0, x, y);
this.energySrc = energySrc;
this.storage = storage;
this.mySrc = mySrc;
this.pattern = cMatrix;
this.craftInv = secondMatrix;
this.container = ccp;
}
public IInventory getCraftingMatrix()
{
public IInventory getCraftingMatrix() {
return this.craftInv;
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
public boolean canTakeStack(final EntityPlayer par1EntityPlayer) {
return false;
}
@Override
public void onPickupFromSlot( final EntityPlayer p, final ItemStack is )
{
public void onPickupFromSlot(final EntityPlayer p, final ItemStack is) {
}
public void doClick( final InventoryAction action, final EntityPlayer who )
{
if( this.getStack() == null )
{
public void doClick(final InventoryAction action, final EntityPlayer who) {
if (this.getStack() == null) {
return;
}
if( Platform.isClient() )
{
if (Platform.isClient()) {
return;
}
@@ -82,131 +71,114 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
int maxTimesToCraft = 0;
InventoryAdaptor ia = null;
if( action == InventoryAction.CRAFT_SHIFT ) // craft into player inventory...
if (action == InventoryAction.CRAFT_SHIFT) // craft into player
// inventory...
{
ia = InventoryAdaptor.getAdaptor( who, null );
maxTimesToCraft = (int) Math.floor( (double) this.getStack().getMaxStackSize() / (double) howManyPerCraft );
}
else if( action == InventoryAction.CRAFT_STACK ) // craft into hand, full stack
ia = InventoryAdaptor.getAdaptor(who, null);
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxStackSize() / (double) howManyPerCraft);
} else if (action == InventoryAction.CRAFT_STACK) // craft into hand,
// full stack
{
ia = new AdaptorPlayerHand( who );
maxTimesToCraft = (int) Math.floor( (double) this.getStack().getMaxStackSize() / (double) howManyPerCraft );
}
else
ia = new AdaptorPlayerHand(who);
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxStackSize() / (double) howManyPerCraft);
} else
// pick up what was crafted...
{
ia = new AdaptorPlayerHand( who );
ia = new AdaptorPlayerHand(who);
maxTimesToCraft = 1;
}
maxTimesToCraft = this.capCraftingAttempts( maxTimesToCraft );
maxTimesToCraft = this.capCraftingAttempts(maxTimesToCraft);
if( ia == null )
{
if (ia == null) {
return;
}
final ItemStack rs = Platform.cloneItemStack( this.getStack() );
if( rs == null )
{
final ItemStack rs = Platform.cloneItemStack(this.getStack());
if (rs == null) {
return;
}
for( int x = 0; x < maxTimesToCraft; x++ )
{
if( ia.simulateAdd( rs ) == null )
{
for (int x = 0; x < maxTimesToCraft; x++) {
if (ia.simulateAdd(rs) == null) {
final IItemList<IAEItemStack> all = inv.getStorageList();
final ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) );
if( extra != null )
{
final ItemStack extra = ia.addItems(this.craftItem(who, rs, inv, all));
if (extra != null) {
final List<ItemStack> drops = new ArrayList<ItemStack>();
drops.add( extra );
Platform.spawnDrops( who.worldObj, (int) who.posX, (int) who.posY, (int) who.posZ, drops );
drops.add(extra);
Platform.spawnDrops(who.worldObj, (int) who.posX, (int) who.posY, (int) who.posZ, drops);
return;
}
}
}
}
private int capCraftingAttempts( final int maxTimesToCraft )
{
private int capCraftingAttempts(final int maxTimesToCraft) {
return maxTimesToCraft;
}
private ItemStack craftItem( final EntityPlayer p, final ItemStack request, final IMEMonitor<IAEItemStack> inv, final IItemList all )
{
@SuppressWarnings({ "rawtypes", "unchecked" })
private ItemStack craftItem(final EntityPlayer p, final ItemStack request, final IMEMonitor<IAEItemStack> inv,
final IItemList all) {
// update crafting matrix...
ItemStack is = this.getStack();
if( is != null && Platform.isSameItem( request, is ) )
{
if (is != null && Platform.isSameItem(request, is)) {
final ItemStack[] set = new ItemStack[this.getPattern().getSizeInventory()];
// add one of each item to the items on the board...
if( Platform.isServer() )
{
final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
for( int x = 0; x < 9; x++ )
{
ic.setInventorySlotContents( x, this.getPattern().getStackInSlot( x ) );
if (Platform.isServer()) {
final InventoryCrafting ic = new InventoryCrafting(new ContainerNull(), 3, 3);
for (int x = 0; x < 9; x++) {
ic.setInventorySlotContents(x, this.getPattern().getStackInSlot(x));
}
final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
final IRecipe r = Platform.findMatchingRecipe(ic, p.worldObj);
if( r == null )
{
if (r == null) {
final Item target = request.getItem();
if( target.isDamageable() && target.isRepairable() )
{
if (target.isDamageable() && target.isRepairable()) {
boolean isBad = false;
for( int x = 0; x < ic.getSizeInventory(); x++ )
{
final ItemStack pis = ic.getStackInSlot( x );
if( pis == null )
{
for (int x = 0; x < ic.getSizeInventory(); x++) {
final ItemStack pis = ic.getStackInSlot(x);
if (pis == null) {
continue;
}
if( pis.getItem() != target )
{
if (pis.getItem() != target) {
isBad = true;
}
}
if( !isBad )
{
super.onPickupFromSlot( p, is );
if (!isBad) {
super.onPickupFromSlot(p, is);
// actually necessary to cleanup this case...
p.openContainer.onCraftMatrixChanged( this.craftInv );
p.openContainer.onCraftMatrixChanged(this.craftInv);
return request;
}
}
return null;
}
is = r.getCraftingResult( ic );
is = r.getCraftingResult(ic);
if( inv != null )
{
for( int x = 0; x < this.getPattern().getSizeInventory(); x++ )
{
if( this.getPattern().getStackInSlot( x ) != null )
{
set[x] = Platform.extractItemsByRecipe( this.energySrc, this.mySrc, inv, p.worldObj, r, is, ic, this.getPattern().getStackInSlot( x ), x, all, Actionable.MODULATE, null );
ic.setInventorySlotContents( x, set[x] );
if (inv != null) {
for (int x = 0; x < this.getPattern().getSizeInventory(); x++) {
if (this.getPattern().getStackInSlot(x) != null) {
set[x] = Platform.extractItemsByRecipe(this.energySrc, this.mySrc, inv, p.worldObj, r, is,
ic, this.getPattern().getStackInSlot(x), x, all, Actionable.MODULATE, null);
ic.setInventorySlotContents(x, set[x]);
}
}
}
}
if( this.preCraft( p, inv, set, is ) )
{
this.makeItem( p, is );
if (this.preCraft(p, inv, set, is)) {
this.makeItem(p, is);
this.postCraft( p, inv, set, is );
this.postCraft(p, inv, set, is);
}
// shouldn't be necessary...
p.openContainer.onCraftMatrixChanged( this.craftInv );
p.openContainer.onCraftMatrixChanged(this.craftInv);
return is;
}
@@ -214,50 +186,42 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return null;
}
private boolean preCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
{
private boolean preCraft(final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set,
final ItemStack result) {
return true;
}
private void makeItem( final EntityPlayer p, final ItemStack is )
{
super.onPickupFromSlot( p, is );
private void makeItem(final EntityPlayer p, final ItemStack is) {
super.onPickupFromSlot(p, is);
}
private void postCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
{
private void postCraft(final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set,
final ItemStack result) {
final List<ItemStack> drops = new ArrayList<ItemStack>();
// add one of each item to the items on the board...
if( Platform.isServer() )
{
if (Platform.isServer()) {
// set new items onto the crafting table...
for( int x = 0; x < this.craftInv.getSizeInventory(); x++ )
{
if( this.craftInv.getStackInSlot( x ) == null )
{
this.craftInv.setInventorySlotContents( x, set[x] );
}
else if( set[x] != null )
{
for (int x = 0; x < this.craftInv.getSizeInventory(); x++) {
if (this.craftInv.getStackInSlot(x) == null) {
this.craftInv.setInventorySlotContents(x, set[x]);
} else if (set[x] != null) {
// eek! put it back!
final IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc );
if( fail != null )
{
drops.add( fail.getItemStack() );
final IAEItemStack fail = inv.injectItems(AEItemStack.create(set[x]), Actionable.MODULATE,
this.mySrc);
if (fail != null) {
drops.add(fail.getItemStack());
}
}
}
}
if( drops.size() > 0 )
{
Platform.spawnDrops( p.worldObj, (int) p.posX, (int) p.posY, (int) p.posZ, drops );
if (drops.size() > 0) {
Platform.spawnDrops(p.worldObj, (int) p.posX, (int) p.posY, (int) p.posZ, drops);
}
}
IInventory getPattern()
{
IInventory getPattern() {
return this.pattern;
}
}
@@ -1,14 +1,11 @@
package net.p455w0rd.wirelesscraftingterminal.common.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
public class SlotTrash extends AppEngSlot {
@@ -1,12 +1,10 @@
package net.p455w0rd.wirelesscraftingterminal.common.inventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
public class WCTInventoryBooster implements IInventory {
@@ -117,6 +117,7 @@ public class WCTInventoryCrafting extends AppEngInternalInventory {
return true;
}
@SuppressWarnings("rawtypes")
@Override
public IMEInventory getMEInventory() {
return new MEIInventoryWrapper(this, null);
@@ -1,12 +1,10 @@
package net.p455w0rd.wirelesscraftingterminal.common.inventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
public class WCTInventoryMagnet implements IInventory {
@@ -1,13 +1,10 @@
package net.p455w0rd.wirelesscraftingterminal.common.inventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
public class WCTInventoryMagnetFilter implements IInventory {
@@ -1,12 +1,10 @@
package net.p455w0rd.wirelesscraftingterminal.common.inventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
public class WCTInventoryTrash implements IInventory {
@@ -5,9 +5,6 @@ import javax.annotation.Nonnull;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import appeng.core.AEConfig;
import appeng.core.features.AEFeature;
public class WCTLog {
public static final Logger log = LogManager.getLogger("Wireless Crafting Terminal");
@@ -3,14 +3,12 @@ package net.p455w0rd.wirelesscraftingterminal.core.sync;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
public abstract class WCTPacket {
private WCTPacketHandlerBase.PacketTypes id;
private ByteBuf p;
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
@@ -37,10 +35,6 @@ public abstract class WCTPacket {
final FMLProxyPacket pp = new FMLProxyPacket(this.p, NetworkHandler.instance.getChannel());
//if (AEConfig.instance.isFeatureEnabled(AEFeature.PacketLogging)) {
// WCTLog.info(this.getClass().getName() + " : " + pp.payload().readableBytes());
//}
return pp;
}
}
@@ -7,10 +7,8 @@ import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import cpw.mods.fml.common.FMLCommonHandler;
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;
@@ -3,10 +3,6 @@ package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
import net.p455w0rd.wirelesscraftingterminal.handlers.ConfigHandler;
@@ -6,12 +6,10 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerCraftAmount;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerCraftConfirm;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerOpenContext;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
@@ -21,7 +19,6 @@ import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.ICraftingGrid;
import appeng.api.networking.crafting.ICraftingJob;
import appeng.util.Platform;
public class PacketCraftRequest extends WCTPacket {
@@ -9,7 +9,6 @@ import net.minecraft.nbt.NBTTagList;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
public class PacketEmptyTrash extends WCTPacket {
@@ -12,7 +12,6 @@ import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.common.container.WCTBaseContainer;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerCraftAmount;
@@ -100,6 +99,7 @@ public class PacketInventoryAction extends WCTPacket
this.configureWrite( data );
}
@SuppressWarnings("unused")
@Override
public void serverPacketData( final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player )
{
@@ -4,16 +4,13 @@ import cpw.mods.fml.common.FMLCommonHandler;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiMagnet;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
public class PacketMagnetFilterMode extends WCTPacket {
@@ -87,6 +87,7 @@ public class PacketNEIRecipe extends WCTPacket
this.configureWrite( data );
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void serverPacketData( final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player )
{
@@ -229,7 +230,7 @@ public class PacketNEIRecipe extends WCTPacket
{
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
final AEItemStack request = AEItemStack.create( patternItem );
final boolean isSimulated = mode == Actionable.SIMULATE;
//final boolean isSimulated = mode == Actionable.SIMULATE;
final boolean checkFuzzy = request.isOre() || patternItem.getItemDamage() == OreDictionary.WILDCARD_VALUE || patternItem.hasTagCompound() || patternItem.isItemStackDamageable();
if( !checkFuzzy )
@@ -1,19 +1,12 @@
package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
import appeng.util.Platform;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerPlayer;
import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.api.WCTApi;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.common.WirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class PacketOpenGui extends WCTPacket {
@@ -37,7 +30,6 @@ public class PacketOpenGui extends WCTPacket {
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
if (player.openContainer instanceof ContainerPlayer) {
if (this.whichGui == Reference.GUI_WCT) {
//WCTApi.instance().interact().openWirelessCraftingTerminalGui(player);
WCTGuiHandler.launchGui(Reference.GUI_WCT, player, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
}
else {
@@ -4,12 +4,9 @@ import appeng.util.Platform;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.common.WirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
@@ -4,7 +4,6 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
@@ -6,7 +6,6 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import appeng.api.config.FuzzyMode;
import appeng.api.config.Settings;
import appeng.api.util.IConfigManager;
import appeng.api.util.IConfigurableObject;
@@ -56,6 +55,7 @@ public class PacketValueConfig extends WCTPacket {
this.configureWrite(data);
}
@SuppressWarnings("unchecked")
@Override
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
final Container c = player.openContainer;
@@ -101,6 +101,7 @@ public class PacketValueConfig extends WCTPacket {
}
}
@SuppressWarnings("unchecked")
@Override
public void clientPacketData(final INetworkInfo network, final WCTPacket packet, final EntityPlayer player) {
final Container c = player.openContainer;
@@ -7,7 +7,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class CreativeTabWCT extends CreativeTabs {
@@ -1,29 +1,14 @@
package net.p455w0rd.wirelesscraftingterminal.handlers;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.player.AchievementEvent;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class AchievementHandler {
@@ -2,10 +2,8 @@ package net.p455w0rd.wirelesscraftingterminal.handlers;
import org.lwjgl.input.Keyboard;
import appeng.util.Platform;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
import cpw.mods.fml.relauncher.Side;
@@ -13,10 +11,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
@@ -8,12 +8,9 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
public class RecipeHandler {
@@ -83,6 +80,7 @@ public class RecipeHandler {
init();
}
@SuppressWarnings("unchecked")
public static void removeRecipes() {
if (recipeList.size() == 0) {
return;
@@ -109,6 +109,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public IItemList<IAEItemStack> getAvailableItems(final IItemList out) {
if (this.itemStorage != null) {
@@ -10,7 +10,6 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.FakePlayer;
import net.p455w0rd.wirelesscraftingterminal.api.IWCTInteractionHelper;
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTermHandler;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketOpenGui;
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
@@ -15,6 +15,7 @@ public final class IntegrationNode
private final String modID;
private final IntegrationType shortName;
private IntegrationStage state = IntegrationStage.PRE_INIT;
@SuppressWarnings("unused")
private IntegrationStage failedStage = IntegrationStage.PRE_INIT;
private Throwable exception = null;
private String name = null;
@@ -1,9 +1,5 @@
package net.p455w0rd.wirelesscraftingterminal.integration.modules;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -20,11 +16,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.client.me.WCTRenderItem;
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotCraftingMatrix;
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotFakeCraftingMatrix;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketNEIRecipe;
import net.p455w0rd.wirelesscraftingterminal.helpers.Reflected;
@@ -32,7 +26,6 @@ import net.p455w0rd.wirelesscraftingterminal.integration.IIntegrationModule;
import net.p455w0rd.wirelesscraftingterminal.integration.IntegrationHelper;
import net.p455w0rd.wirelesscraftingterminal.integration.abstraction.INEI;
import net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import codechicken.nei.PositionedStack;
import codechicken.nei.api.API;
import codechicken.nei.api.IOverlayHandler;
@@ -45,6 +38,7 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
@Reflected
public static NEI instance;
@SuppressWarnings("unused")
private final Class<?> apiClass;
@Reflected
@@ -207,6 +201,7 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
// overlayItems);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void overlayRecipe( final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex, final boolean shift )
{
@@ -223,6 +218,7 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
}
}
@SuppressWarnings("unchecked")
private void overlayRecipe( final GuiContainer gui, final List<PositionedStack> ingredients, final boolean shift )
{
try
@@ -37,6 +37,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting" ) );
}
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes( final String outputId, final Object... results )
{
@@ -62,6 +63,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
}
}
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes( final ItemStack result )
{
@@ -37,6 +37,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
this.transferRects.add( new TemplateRecipeHandler.RecipeTransferRect( new Rectangle( 84, 23, 24, 18 ), "crafting" ) );
}
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes( final String outputId, final Object... results )
{
@@ -62,6 +63,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
}
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes( final ItemStack result )
{
@@ -80,6 +82,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
}
}
@SuppressWarnings("unchecked")
@Override
public void loadUsageRecipes( final ItemStack ingredient )
{
@@ -27,6 +27,7 @@ public class NEICraftingHandler implements IOverlayHandler
{
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void overlayRecipe( final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex, final boolean shift )
{
@@ -43,6 +44,7 @@ public class NEICraftingHandler implements IOverlayHandler
}
}
@SuppressWarnings("unchecked")
private void overlayRecipe( final GuiContainer gui, final List<PositionedStack> ingredients, final boolean shift )
{
try
@@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
@@ -12,10 +12,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.p455w0rd.wirelesscraftingterminal.common.WirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.creativetab.CreativeTabWCT;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
@@ -44,9 +41,10 @@ public class ItemInfinityBooster extends Item {
public int getMaxItemUseDuration(ItemStack stack) {
return 1;
}
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack is, EntityPlayer player, List list, boolean par4) {
String shift = LocaleHandler.PressShift.getLocal().replace("Shift", color("yellow") + "" + color("bold") + "" + color("italics") + "Shift" + color("gray"));
list.add(color("aqua") + "==============================");
@@ -43,7 +43,6 @@ import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTermHandler;
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTIActionHost;
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTPlayerSource;
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
import net.p455w0rd.wirelesscraftingterminal.common.WirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
@@ -60,7 +59,6 @@ public class ItemMagnet extends Item {
private int distanceFromPlayer;
private WirelessTerminalGuiObject obj;
private WCTIActionHost wctAH;
private IPortableCell civ;
private IEnergySource powerSrc;
private IMEMonitor<IAEItemStack> monitor;
@@ -99,6 +97,7 @@ public class ItemMagnet extends Item {
return null;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack is, EntityPlayer player, List list, boolean par4) {
@@ -212,7 +211,6 @@ public class ItemMagnet extends Item {
this.obj = getGuiObject(wirelessTerm, player, world, (int) player.posX, (int) player.posY, (int) player.posZ);
this.civ = (IPortableCell) this.obj;
this.powerSrc = (IEnergySource) this.civ;
this.wctAH = (WCTIActionHost) this.powerSrc;
this.monitor = civ.getItemInventory();
this.cellInv = this.monitor;
this.mySrc = new WCTPlayerSource(player, (WCTIActionHost) this.obj);
@@ -321,6 +319,7 @@ public class ItemMagnet extends Item {
return false;
}
@SuppressWarnings("rawtypes")
private boolean isItemFiltered(ItemStack is, List<ItemStack> itemList) {
if (is != null && itemList != null) {
Iterator thisList = itemList.iterator();
@@ -343,7 +342,6 @@ public class ItemMagnet extends Item {
return null;
}
NBTTagList tagList = nbtTC.getTagList("MagnetFilter", 10);
boolean test1 = false;
if (tagList.tagCount() > 0 && tagList != null) {
List<ItemStack> itemList = new ArrayList<ItemStack>();
for (int i = 0; i < tagList.tagCount(); i++) {
@@ -34,7 +34,6 @@ import net.minecraft.world.World;
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTermHandler;
import net.p455w0rd.wirelesscraftingterminal.api.WCTApi;
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
import net.p455w0rd.wirelesscraftingterminal.creativetab.CreativeTabWCT;
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
@@ -48,9 +47,9 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
public ItemWirelessCraftingTerminal() {
super(Reference.WCT_MAX_POWER, Optional.<String> absent());
this.setUnlocalizedName("wirelessCraftingTerminal");
this.setTextureName(Reference.MODID + ":wirelessCraftingTerminal");
this.setMaxStackSize(1);
setUnlocalizedName("wirelessCraftingTerminal");
setTextureName(Reference.MODID + ":wirelessCraftingTerminal");
setMaxStackSize(1);
}
@SideOnly(Side.CLIENT)
@@ -103,7 +102,7 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
if (wirelessTerminal == null || !(wirelessTerminal.getItem() instanceof ItemWirelessCraftingTerminal)) {
return;
}
this.checkForBooster(wirelessTerminal);
checkForBooster(wirelessTerminal);
}
@Override
@@ -150,12 +149,12 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
@Override
public boolean usePower(final EntityPlayer player, final double amount, final ItemStack is) {
return this.extractAEPower(is, amount) >= amount - 0.5;
return extractAEPower(is, amount) >= amount - 0.5;
}
@Override
public boolean hasPower(final EntityPlayer player, final double amt, final ItemStack is) {
return this.getAECurrentPower(is) >= amt;
return getAECurrentPower(is) >= amt;
}
@Override
@@ -163,7 +162,7 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
final ConfigManager out = new ConfigManager(new IConfigManagerHost() {
@Override
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
public void updateSetting(final IConfigManager manager, @SuppressWarnings("rawtypes") final Enum settingName, @SuppressWarnings("rawtypes") final Enum newValue) {
final NBTTagCompound data = Platform.openNbtData(target);
manager.writeToNBT(data);
}
@@ -197,7 +196,6 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
return true;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addCheckedInformation(ItemStack is, EntityPlayer player, List<String> list, boolean displayMore) {
@@ -254,7 +252,7 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
final NBTTagCompound data = ensureTagCompound(is);
double currentStorage = data.getDouble(POWER_NBT_KEY);
final double maxStorage = this.getAEMaxPower(is);
final double maxStorage = getAEMaxPower(is);
switch (op) {
case INJECT:
@@ -283,7 +281,7 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
@Override
public double getDurabilityForDisplay(ItemStack is) {
return 1 - getAECurrentPower(is) / this.getAEMaxPower(is);
return 1 - getAECurrentPower(is) / getAEMaxPower(is);
}
private NBTTagCompound ensureTagCompound(ItemStack is) {
@@ -295,7 +293,7 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
@Override
public double getAECurrentPower(final ItemStack is) {
return this.getInternalBattery(is, batteryOperation.STORAGE, 0);
return getInternalBattery(is, batteryOperation.STORAGE, 0);
}
@Override
@@ -305,12 +303,12 @@ public class ItemWirelessCraftingTerminal extends AEBasePoweredItem implements I
@Override
public double injectAEPower(final ItemStack is, final double amt) {
return this.getInternalBattery(is, batteryOperation.INJECT, amt);
return getInternalBattery(is, batteryOperation.INJECT, amt);
}
@Override
public double extractAEPower(final ItemStack is, final double amt) {
return this.getInternalBattery(is, batteryOperation.EXTRACT, amt);
return getInternalBattery(is, batteryOperation.EXTRACT, amt);
}
@Override
@@ -3,7 +3,6 @@ package net.p455w0rd.wirelesscraftingterminal.proxy;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.p455w0rd.wirelesscraftingterminal.common.WirelessCraftingTerminal;
import net.p455w0rd.wirelesscraftingterminal.handlers.KeybindHandler;
import net.p455w0rd.wirelesscraftingterminal.integration.IntegrationRegistry;
import net.p455w0rd.wirelesscraftingterminal.integration.IntegrationType;
@@ -2,7 +2,7 @@ package net.p455w0rd.wirelesscraftingterminal.reference;
public class Reference {
public static final String MODID = "ae2wct";
public static final String VERSION = "1.7.10-1.0-alpha-1";
public static final String VERSION = "1.7.10-1.0b";
public static final String NAME = "AE2 Wireless Crafting Terminal";
public static final String SERVER_PROXY_CLASS = "net.p455w0rd.wirelesscraftingterminal.proxy.CommonProxy";
public static final String CLIENT_PROXY_CLASS = "net.p455w0rd.wirelesscraftingterminal.proxy.ClientProxy";
@@ -1,6 +1,5 @@
package net.p455w0rd.wirelesscraftingterminal.transformer;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -61,6 +61,7 @@ public final class ASMIntegration implements IClassTransformer {
return basicClass;
}
@SuppressWarnings("rawtypes")
private boolean removeOptionals(final ClassNode classNode) {
boolean changed = false;
@@ -144,6 +145,7 @@ public final class ASMIntegration implements IClassTransformer {
return false;
}
@SuppressWarnings("rawtypes")
private boolean stripMethod(final ClassNode classNode, final MethodNode mn, final Iterator<MethodNode> i,
final Class class1, final AnnotationNode an) {
if (an.values.size() != 2) {