This repository was archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33a0178
commit 91a39e5
Showing
10 changed files
with
333 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -14,5 +14,4 @@ public static List<String> toStringlist(String... s) { | |
} | ||
return strings; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/me/xiaozhangup/natunology/techcore/Datahash.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,21 @@ | ||
package me.xiaozhangup.natunology.techcore; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
|
||
public class Datahash { | ||
|
||
public static HashMap<Integer, ItemStack> items = new HashMap<>(); | ||
public static List<ItemStack> group = new ArrayList<>(); | ||
public static HashMap<Integer, String> itemgroupd = new HashMap<>(); | ||
public static HashMap<ItemStack, String> groupid = new HashMap<>(); | ||
|
||
public static HashMap<Player, String> lastgroup = new HashMap<>(); | ||
|
||
public static HashMap<Integer, List<ItemStack>> crafttable = new HashMap<>(); | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/me/xiaozhangup/natunology/techcore/api/ItemHash.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,33 @@ | ||
package me.xiaozhangup.natunology.techcore.api; | ||
|
||
import me.xiaozhangup.natunology.techcore.Datahash; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class ItemHash { | ||
|
||
public static void addGroup(ItemStack itemStack, String id) { | ||
Datahash.group.add(itemStack); | ||
Datahash.groupid.put(itemStack, id); | ||
} | ||
|
||
public static String getGroupId(ItemStack itemStack) { | ||
try { | ||
return Datahash.groupid.get(itemStack); | ||
} catch (Exception e) { | ||
return null; | ||
} | ||
} | ||
|
||
public static void addItem(ItemStack itemStack, Integer integer, String group) { | ||
Datahash.items.put(integer, itemStack); | ||
Datahash.itemgroupd.put(integer, group); | ||
} | ||
|
||
public static ItemStack getItem(Integer integer) { | ||
try { | ||
return Datahash.items.get(integer); | ||
} catch (Exception e) { | ||
return null; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/me/xiaozhangup/natunology/techcore/api/Test.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,19 @@ | ||
package me.xiaozhangup.natunology.techcore.api; | ||
|
||
import me.xiaozhangup.natunology.techcore.items.Items; | ||
import org.bukkit.Material; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class Test { | ||
|
||
public static void runTest() { | ||
ItemHash.addGroup(new ItemStack(Material.CHEST), "test1"); | ||
ItemHash.addGroup(new ItemStack(Material.GLASS), "test2"); | ||
ItemHash.addGroup(new ItemStack(Material.GRASS), "test3"); | ||
ItemHash.addItem(Items.addId(new ItemStack(Material.LAVA_BUCKET), 42), 42, "misc"); | ||
ItemHash.addItem(Items.addId(new ItemStack(Material.TORCH), 43), 43, "test1"); | ||
ItemHash.addItem(Items.addId(new ItemStack(Material.ACACIA_BOAT), 44), 44, "test2"); | ||
ItemHash.addItem(Items.addId(new ItemStack(Material.EGG), 45), 45, "test3"); | ||
} | ||
|
||
} |
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.