Reformat code, updated imports. We are back in 1.7.10 now!

This commit is contained in:
0xSeb
2015-10-21 19:41:44 +02:00
parent 96ef7ed7a6
commit c059b4c03e
10 changed files with 238 additions and 280 deletions
@@ -1,24 +1,20 @@
package de.skate702.craftingkeys;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import de.skate702.craftingkeys.manager.ContainerManager;
import de.skate702.craftingkeys.proxies.CraftingKeysProxy;
import net.minecraft.client.gui.inventory.GuiCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
/**
* The Main Class of the Mod with the important onTick-Method. Some Methods are
@@ -98,7 +94,6 @@ public class CraftingKeys {
}
// Case 1: Classic GUI Screen
if (Helper.isCraftingGUI(Helper.client.currentScreen)) {
@@ -1,5 +1,6 @@
package de.skate702.craftingkeys;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -8,7 +9,6 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraftforge.fml.client.FMLClientHandler;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
@@ -1,9 +1,8 @@
package de.skate702.craftingkeys;
import cpw.mods.fml.client.registry.ClientRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import org.lwjgl.input.Keyboard;
/**
@@ -1,5 +0,0 @@
package de.skate702.craftingkeys;
public class Settings {
}
@@ -2,21 +2,14 @@ package de.skate702.craftingkeys.manager;
import de.skate702.craftingkeys.CraftingKeys;
import de.skate702.craftingkeys.Helper;
import net.minecraft.client.gui.inventory.GuiCrafting;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import net.minecraft.block.Block;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
/**
* Managing Class to move Items in Inventory Containers.
*
* @author skate702
*
*/
public class ContainerManager {
@@ -34,10 +27,8 @@ public class ContainerManager {
/**
* Moves a full Stack from a slot to another.
*
* @param srcIndex
* The Source Slot Index of the Container
* @param destIndex
* The Destination Slot Index of the Container
* @param srcIndex The Source Slot Index of the Container
* @param destIndex The Destination Slot Index of the Container
*/
public void moveAll(int srcIndex, int destIndex) {
@@ -56,12 +47,9 @@ public class ContainerManager {
* Moves a specified amount of Items from a slot to another. [Based on
* INVTW]
*
* @param srcIndex
* The Source Slot Index of the Container
* @param destIndex
* The Destination Slot Index of the Container
* @param amount
* The amount of items to move (can be bigger then Stack Size)
* @param srcIndex The Source Slot Index of the Container
* @param destIndex The Destination Slot Index of the Container
* @param amount The amount of items to move (can be bigger then Stack Size)
*/
public void move(int srcIndex, int destIndex, int amount) {
@@ -103,8 +91,7 @@ public class ContainerManager {
/**
* Returns the ItemStack in a slot [Based on INVTW]
*
* @param index
* The index of the slot in the container
* @param index The index of the slot in the container
* @return Returns the ItemStack
*/
private ItemStack getItemStack(int index) {
@@ -126,8 +113,7 @@ public class ContainerManager {
/**
* Sends a click on the crafting output (craftingGUI or Inventory)
*
* @param isCraftingGUI
* true, if the craftingGUI is opened
* @param isCraftingGUI true, if the craftingGUI is opened
*/
public void clickOnCraftingOutput(boolean isCraftingGUI) {
@@ -149,10 +135,8 @@ public class ContainerManager {
* Takes all items from a slot and moves them to the next empty slot or
* drops them.
*
* @param sourceIndex
* The index of the slot to move items from
* @param isCraftingGUI
* true, if the craftingGUI is opened
* @param sourceIndex The index of the slot to move items from
* @param isCraftingGUI true, if the craftingGUI is opened
*/
public void putStackToNextEmptySlot(int sourceIndex, boolean isCraftingGUI, boolean isHeld) {
@@ -201,8 +185,7 @@ public class ContainerManager {
/**
* Returns the first free index in a inventory
*
* @param isCraftingGUI
* true, if the craftingGUI is opened
* @param isCraftingGUI true, if the craftingGUI is opened
* @return a slot index
*/
private int getFirstPropperSlotIndex(boolean isCraftingGUI, ItemStack movingItem) {
@@ -220,9 +203,6 @@ public class ContainerManager {
}
}
GameRegistry.addShapelessRecipe(new ItemStack(Item.getByNameOrId("Diamond")),
new ItemStack(Block.getBlockFromName("Dirt")));
for (int i = 10; i < container.inventorySlots.size(); i++) {
if (getItemStack(i) == null) {
@@ -240,8 +220,7 @@ public class ContainerManager {
/**
* Executes a left mouse click on a slot. [Based on INVTW]
*
* @param index
* The index of the slot in the container
* @param index The index of the slot in the container
*/
private void leftClick(int index) {
slotClick(index, false);
@@ -250,8 +229,7 @@ public class ContainerManager {
/**
* Executes a right mouse click on a slot. [Based on INVTW]
*
* @param index
* The index of the slot in the container
* @param index The index of the slot in the container
*/
private void rightClick(int index) {
slotClick(index, true);
@@ -260,10 +238,8 @@ public class ContainerManager {
/**
* Executes a mouse click on a slot. [Based on INVTW]
*
* @param index
* The index of the slot in the container
* @param rightClick
* True, if the click is with the right mouse button
* @param index The index of the slot in the container
* @param rightClick True, if the click is with the right mouse button
*/
private void slotClick(int index, boolean rightClick) {
@@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer;
* Client Proxy, extending Common Proxy.
*
* @author skate702
*
*/
public class CraftingKeysClientProxy extends CraftingKeysProxy {
@@ -1,15 +1,14 @@
package de.skate702.craftingkeys.proxies;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* The common proxy.
*
* @author skate702
*
*/
public class CraftingKeysProxy {
@@ -23,18 +22,12 @@ public class CraftingKeysProxy {
/**
* The Minecraft call to send a mouse click to a GUI. [Based on INVTW]
*
* @param controller
* The playerController (from Client)
* @param windowId
* The current Windows ID (from GUI)
* @param slot
* The slot to click on (slot index)
* @param rightClick
* 1, if right click. Otherwise 0
* @param action
* 0
* @param player
* The current player (from Client)
* @param controller The playerController (from Client)
* @param windowId The current Windows ID (from GUI)
* @param slot The slot to click on (slot index)
* @param rightClick 1, if right click. Otherwise 0
* @param action 0
* @param player The current player (from Client)
*/
@SideOnly(Side.CLIENT)
public void sendSlotClick(PlayerControllerMP controller, int windowId, int slot, int rightClick, int action,
@@ -0,0 +1 @@
# dummy
@@ -1,4 +1,4 @@
?# Control Names
# Control Names
key.topleft=1. Top Left
key.topcenter=2. Top Center
key.topright=3. Top Right
@@ -11,4 +11,4 @@ key.lowerright=9. Lower Right
key.stack=Stack Key
key.interact=Interaction Key
# Control Category Name
key.categories.craftingkeys=Crafting Keys (Mostly red Keys are NO problem!)
key.categories.craftingkeys=Crafting Keys
+1 -1
View File
@@ -7,7 +7,7 @@
"mcversion": "${mcversion}",
"url": "http://skate702.de",
"updateUrl": "http://skate702.de",
"authorList": ["skate702"],
"authorList": ["skate702, 0xSeb"],
"credits": "Thanks to Inventory-Tweaks!",
"logoFile": "",
"screenshots": [],