Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed OWNER req. logic , also started working on inventory features
- Loading branch information
1 parent
6a88fb4
commit 3422575
Showing
6 changed files
with
44 additions
and
21 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
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
35 changes: 35 additions & 0 deletions
35
src/main/java/net/aufdemrand/denizen/scripts/containers/core/InventoryScriptContainer.java
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,35 @@ | ||
package net.aufdemrand.denizen.scripts.containers.core; | ||
|
||
import net.aufdemrand.denizen.scripts.containers.ScriptContainer; | ||
import org.bukkit.configuration.ConfigurationSection; | ||
import org.bukkit.event.inventory.InventoryType; | ||
|
||
public class InventoryScriptContainer extends ScriptContainer { | ||
|
||
public InventoryScriptContainer(ConfigurationSection configurationSection, String scriptContainerName) { | ||
super(configurationSection, scriptContainerName); | ||
} | ||
|
||
public int getSize() { | ||
InventoryType invType = getInventoryType(); | ||
|
||
if(invType == InventoryType.CHEST) { | ||
return Integer.parseInt(getString("size", "27")); | ||
} | ||
|
||
return invType.getDefaultSize(); | ||
} | ||
|
||
public InventoryType getInventoryType() { | ||
String typeStr = getString("inventory", "chest"); | ||
|
||
try { | ||
InventoryType type = InventoryType.valueOf(typeStr); | ||
return type; | ||
|
||
} catch(Exception e) { | ||
return InventoryType.CHEST; | ||
} | ||
} | ||
|
||
} |
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