-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from NiklasEi/gamebox-3
Gamebox v3
- Loading branch information
Showing
13 changed files
with
208 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.nikl.logicpuzzles; | ||
|
||
import org.bukkit.inventory.Inventory; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class ExtendedInventory { | ||
private Inventory upperInventory; | ||
private Inventory lowerInventory; | ||
|
||
public ExtendedInventory(Inventory upperInventory, Inventory lowerInventory) { | ||
this.upperInventory = upperInventory; | ||
this.lowerInventory = lowerInventory; | ||
} | ||
|
||
public void setItem(int slot, ItemStack item) { | ||
if (slot >= upperInventory.getSize()) { | ||
lowerInventory.setItem(slot - upperInventory.getSize() + 9, item); | ||
} else { | ||
upperInventory.setItem(slot, item); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,26 @@ | ||
package me.nikl.logicpuzzles; | ||
|
||
import me.nikl.gamebox.GameBox; | ||
import me.nikl.gamebox.Module; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.Plugin; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import me.nikl.gamebox.module.GameBoxModule; | ||
import me.nikl.logicpuzzles.sudoku.Sudoku; | ||
import me.nikl.logicpuzzles.threeinarow.ThreeInARow; | ||
|
||
/** | ||
* Created by Niklas | ||
* | ||
* Main class of the GameBox game Sudoku | ||
*/ | ||
public class LogicPuzzles extends JavaPlugin{ | ||
public class LogicPuzzles extends GameBoxModule { | ||
public static final String SUDOKU = "sudoku"; | ||
public static final String THREE_IN_A_ROW = "threeinarow"; | ||
private GameBox gameBox; | ||
|
||
@Override | ||
public void onEnable(){ | ||
Plugin plugin = Bukkit.getPluginManager().getPlugin("GameBox"); | ||
if(plugin == null || !plugin.isEnabled()){ | ||
getLogger().warning(" GameBox was not found! Disabling LogicPuzzles..."); | ||
Bukkit.getPluginManager().disablePlugin(this); | ||
return; | ||
} | ||
gameBox = (GameBox) plugin; | ||
new Module(gameBox, SUDOKU | ||
, "me.nikl.logicpuzzles.sudoku.Sudoku" | ||
, this, SUDOKU, "su"); | ||
new Module(gameBox, THREE_IN_A_ROW | ||
, "me.nikl.logicpuzzles.threeinarow.ThreeInARow" | ||
, this, THREE_IN_A_ROW, "tiar"); | ||
registerGame(SUDOKU, Sudoku.class, "su"); | ||
registerGame(THREE_IN_A_ROW, ThreeInARow.class, "tiar"); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.