1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge pull request #1 from TheBusyBiscuit/master

Update from upstream
This commit is contained in:
Steve 2019-06-10 22:31:25 +04:00 committed by GitHub
commit 302062c01f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 3028 additions and 4322 deletions

30
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@ -0,0 +1,30 @@
---
name: Bug Report
about: Report a Bug or an Issue with Slimefun 4.
title: ''
labels: Bug Report
assignees: ''
---
## Description (Required)
<!-- A clear and detailed description of what exactly the Issue consists of. -->
## Steps to reproduce the Issue (Required)
<!-- Youtube Videos and Screenshots are recommended! -->
## Expected behavior (Required)
<!-- What did you expect to happen? -->
## Server Log / Error Report
<!-- Take a look at your Server Log and please provide any error reports you can find via https://pastebin.com/ -->
<!-- We may discard your Issue if you just post it here, as it's unreadable for us. Please use Pastebin! -->
## Environment (Required)
<!-- We may also close your Issue if you are not providing the exact version numbers. -->
<!-- "latest" IS NOT A VERSION NUMBER. -->
<!-- You can also just run "/sf versions" and show us a screenshot of that. -->
- Minecraft Version:
- Slimefun Version:
- CS-CoreLib Version:

2
.gitignore vendored
View File

@ -4,4 +4,4 @@
/.settings/
*.iml
/target
/.idea/

View File

@ -16,6 +16,13 @@ Click on the badge below to go to our "development" build page, where you can do
</a>
</p>
## Discord
Slimefun4 now has a Discord Server too!
Join it for Suggestions/Questions or other discussions about this plugin.
https://discord.gg/fsD4Bkh
## Contributions
You are allowed, even encouraged, to contribute to Slimefun 4 by making Pull Requests.

25
pom.xml
View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.mrCookieSlime</groupId>
<artifactId>Slimefun</artifactId>
<version>4.1.16</version>
<version>4.1.17</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
@ -19,17 +19,17 @@
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>worldedit-repo</id>
<url>http://maven.sk89q.com/repo/</url>
<id>worldedit-worldguard-repo</id>
<url>https://maven.sk89q.com/repo/</url>
</repository>
<repository>
<id>coreprotect-repo</id>
<url>https://maven.playpro.com/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>robomwm-repo</id>
<url>https://dl.bintray.com/robomwm/maven</url>
</repository>
</repositories>
<build>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
@ -55,6 +55,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
@ -72,7 +73,7 @@
</dependency>
<dependency>
<groupId>net.coreprotect</groupId>
<artifactId>CoreProtect</artifactId>
<artifactId>coreprotect</artifactId>
</dependency>
<dependency>
<groupId>me.mrCookieSlime</groupId>
@ -92,7 +93,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<version>1.14.2-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
@ -102,7 +103,7 @@
<dependency>
<groupId>com.github.TheBusyBiscuit</groupId>
<artifactId>CS-CoreLib</artifactId>
<version>a450ddc526</version>
<version>v1.6.1</version>
</dependency>
<dependency>
<groupId>me.minebuilders</groupId>
@ -111,8 +112,8 @@
</dependency>
<dependency>
<groupId>net.coreprotect</groupId>
<artifactId>CoreProtect</artifactId>
<version>2.14.2</version>
<artifactId>coreprotect</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>me.mrCookieSlime</groupId>

View File

@ -20,9 +20,10 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Ageable;
import org.bukkit.block.data.Rotatable;
import org.bukkit.block.Dispenser;
import org.bukkit.block.Skull;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Animals;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
@ -40,12 +41,9 @@ import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Block.TreeCalculator;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuOpeningHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper.ChatHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import me.mrCookieSlime.ExoticGarden.ExoticGarden;
@ -84,6 +82,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
blockblacklist.add(Material.COMMAND_BLOCK);
blockblacklist.add(Material.CHAIN_COMMAND_BLOCK);
blockblacklist.add(Material.REPEATING_COMMAND_BLOCK);
blockblacklist.add(Material.STRUCTURE_BLOCK);
}
private Set<MachineFuel> recipes = new HashSet<MachineFuel>();
@ -100,11 +99,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
public abstract float getFuelEfficiency();
public abstract int getTier();
@SuppressWarnings("deprecation")
public ProgrammableAndroid(Category category, ItemStack item, String name, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, name, recipeType, recipe);
if (getTier() == 1) {
registerFuel(new MachineFuel(80, new ItemStack(Material.COAL)));
registerFuel(new MachineFuel(80, new ItemStack(Material.CHARCOAL)));
@ -162,33 +159,22 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
public void newInstance(BlockMenu menu, final Block b) {
try {
menu.replaceExistingItem(15, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTAxYzdiNTcyNjE3ODk3NGIzYjNhMDFiNDJhNTkwZTU0MzY2MDI2ZmQ0MzgwOGYyYTc4NzY0ODg0M2E3ZjVhIn19fQ=="), "&aStart/Continue"));
menu.addMenuClickHandler(15, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(15, (p, slot, item, action) -> {
Messages.local.sendTranslation(p, "robot.started", true);
BlockStorage.addBlockInfo(b, "paused", "false");
p.closeInventory();
return false;
}
});
menu.replaceExistingItem(17, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTYxMzlmZDFjNTY1NGU1NmU5ZTRlMmM4YmU3ZWIyYmQ1YjQ5OWQ2MzM2MTY2NjNmZWVlOTliNzQzNTJhZDY0In19fQ=="), "&4Pause"));
menu.addMenuClickHandler(17, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(17, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "paused", "true");
Messages.local.sendTranslation(p, "robot.stopped", true);
return false;
}
});
menu.replaceExistingItem(16, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDc4ZjJiN2U1ZTc1NjM5ZWE3ZmI3OTZjMzVkMzY0YzRkZjI4YjQyNDNlNjZiNzYyNzdhYWRjZDYyNjEzMzcifX19"), "&bMemory Core", "", "&8\u21E8 &7Click to open the Script Editor"));
menu.addMenuClickHandler(16, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(16, (p, slot, item, action) -> {
try {
BlockStorage.addBlockInfo(b, "paused", "true");
Messages.local.sendTranslation(p, "robot.stopped", true);
@ -197,7 +183,6 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
e.printStackTrace();
}
return false;
}
});
} catch (Exception e) {
e.printStackTrace();
@ -218,12 +203,12 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
BlockStorage.addBlockInfo(b, "script", "START-TURN_LEFT-REPEAT");
BlockStorage.addBlockInfo(b, "index", "0");
BlockStorage.addBlockInfo(b, "fuel", "0");
BlockStorage.addBlockInfo(b, "rotation", "NORTH");
BlockStorage.addBlockInfo(b, "rotation", p.getFacing().getOppositeFace().toString());
BlockStorage.addBlockInfo(b, "paused", "true");
b.setType(Material.PLAYER_HEAD);
Skull skull = (Skull) b.getState();
skull.setRotation(BlockFace.NORTH);
skull.update(true, false);
Rotatable blockData = (Rotatable) b.getBlockData();
blockData.setRotation(p.getFacing());
b.setBlockData(blockData);
}
@Override
@ -252,7 +237,6 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
});
}
@SuppressWarnings("deprecation")
protected void tick(Block b) {
try {
if (!(b.getState() instanceof Skull)) {
@ -327,9 +311,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
int rotIndex = directions.indexOf(BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) - 1;
if (rotIndex < 0) rotIndex = directions.size() - 1;
BlockFace dir = directions.get(rotIndex);
Skull skull = (Skull) b.getState();
skull.setRotation(dir);
skull.update(true, false);
Rotatable blockData = (Rotatable) b.getBlockData();
blockData.setRotation(dir);
b.setBlockData(blockData);
BlockStorage.addBlockInfo(b, "rotation", dir.toString());
break;
}
@ -337,9 +321,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
int rotIndex = directions.indexOf(BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) + 1;
if (rotIndex == directions.size()) rotIndex = 0;
BlockFace dir = directions.get(rotIndex);
Skull skull = (Skull) b.getState();
skull.setRotation(dir);
skull.update(true, false);
Rotatable blockData = (Rotatable) b.getBlockData();
blockData.setRotation(dir);
b.setBlockData(blockData);
BlockStorage.addBlockInfo(b, "rotation", dir.toString());
break;
}
@ -652,7 +636,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
entities:
for (Entity n: AndroidStatusHologram.getNearbyEntities(b, 4D + getTier())) {
if (n instanceof Monster) continue;
if (n instanceof Ageable && !((Ageable) n).isAdult()) continue;
if (n instanceof org.bukkit.entity.Ageable && !((org.bukkit.entity.Ageable) n).isAdult()) continue;
switch (BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) {
case NORTH: {
if (n instanceof LivingEntity && !(n instanceof ArmorStand) && !(n instanceof Player) && n.getLocation().getZ() < b.getZ()) {
@ -709,16 +693,14 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
}
@SuppressWarnings("deprecation")
private void move(Block b, BlockFace face, Block block) throws Exception {
if (block.getY() < 0 || block.getY() > block.getWorld().getMaxHeight()) return;
if (block.getType() == Material.AIR) {
if (block.getY() < 0 || block.getY() > block.getWorld().getMaxHeight())
return;
if (block.getType() == Material.AIR || block.getType() == Material.CAVE_AIR) {
block.setType(Material.PLAYER_HEAD);
Skull skull = (Skull) block.getState();
skull.setRotation(face);
skull.update(true, false);
Rotatable blockData = (Rotatable) block.getBlockData();
blockData.setRotation(face.getOppositeFace());
block.setBlockData(blockData);
CustomSkull.setSkull(block, CustomSkull.getTexture(getItem()));
b.setType(Material.AIR);
BlockStorage.moveBlockInfo(b.getLocation(), block.getLocation());
@ -752,7 +734,6 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
}
@SuppressWarnings("deprecation")
private void movedig(Block b, BlockFace face, Block block) {
Collection<ItemStack> drops = block.getDrops();
if (!blockblacklist.contains(block.getType()) && !drops.isEmpty() && CSCoreLib.getLib().getProtectionManager().canBuild(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")), block)) {
@ -763,14 +744,11 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
if (SlimefunItem.blockhandler.containsKey(item.getID())) {
if (SlimefunItem.blockhandler.get(item.getID()).onBreak(null, block, item, UnregisterReason.ANDROID_DIG)) {
pushItems(b, BlockStorage.retrieve(block));
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
block.setType(Material.PLAYER_HEAD);
Skull skull = (Skull) block.getState();
skull.setRotation(face);
skull.update(true, false);
Rotatable blockData = (Rotatable) block.getBlockData();
blockData.setRotation(face.getOppositeFace());
block.setBlockData(blockData);
CustomSkull.setSkull(block, CustomSkull.getTexture(getItem()));
b.setType(Material.AIR);
BlockStorage.moveBlockInfo(b.getLocation(), block.getLocation());
@ -784,10 +762,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
pushItems(b, items);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
block.setType(Material.PLAYER_HEAD);
Skull skull = (Skull) block.getState();
skull.setRotation(face);
skull.update(true, false);
Rotatable blockData = (Rotatable) block.getBlockData();
blockData.setRotation(face.getOppositeFace());
block.setBlockData(blockData);
CustomSkull.setSkull(block, CustomSkull.getTexture(getItem()));
b.setType(Material.AIR);
BlockStorage.moveBlockInfo(b.getLocation(), block.getLocation());
@ -807,19 +784,18 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
private boolean isFullGrown(Block block){
org.bukkit.block.data.Ageable ageable = ((org.bukkit.block.data.Ageable)block.getBlockData());
Ageable ageable = ((Ageable) block.getBlockData());
return ageable.getAge() >= ageable.getMaximumAge();
}
private void farm(Block b, Block block) {
switch (block.getType()) {
case WHEAT: {
if (isFullGrown(block)) {
ItemStack drop = new ItemStack(Material.WHEAT, CSCoreLib.randomizer().nextInt(3) + 1);
if (fits(b, drop)) {
pushItems(b, drop);
org.bukkit.block.data.Ageable ageable = (org.bukkit.block.data.Ageable)block.getBlockData();
Ageable ageable = (Ageable) block.getBlockData();
ageable.setAge(0);
block.setBlockData(ageable);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
@ -832,7 +808,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
ItemStack drop = new ItemStack(Material.POTATO, CSCoreLib.randomizer().nextInt(3) + 1);
if (fits(b, drop)) {
pushItems(b, drop);
org.bukkit.block.data.Ageable ageable = (org.bukkit.block.data.Ageable)block.getBlockData();
Ageable ageable = (Ageable) block.getBlockData();
ageable.setAge(0);
block.setBlockData(ageable);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
@ -845,7 +821,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
ItemStack drop = new ItemStack(Material.CARROT, CSCoreLib.randomizer().nextInt(3) + 1);
if (fits(b, drop)) {
pushItems(b, drop);
org.bukkit.block.data.Ageable ageable = (org.bukkit.block.data.Ageable)block.getBlockData();
Ageable ageable = (Ageable) block.getBlockData();
ageable.setAge(0);
block.setBlockData(ageable);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
@ -858,7 +834,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
ItemStack drop = new ItemStack(Material.BEETROOT, CSCoreLib.randomizer().nextInt(3) + 1);
if (fits(b, drop)) {
pushItems(b, drop);
org.bukkit.block.data.Ageable ageable = (org.bukkit.block.data.Ageable)block.getBlockData();
Ageable ageable = (Ageable) block.getBlockData();
ageable.setAge(0);
block.setBlockData(ageable);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
@ -871,7 +847,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
ItemStack drop = new ItemStack(Material.COCOA_BEANS, CSCoreLib.randomizer().nextInt(3) + 1);
if (fits(b, drop)) {
pushItems(b, drop);
org.bukkit.block.data.Ageable ageable = (org.bukkit.block.data.Ageable)block.getBlockData();
Ageable ageable = (Ageable) block.getBlockData();
ageable.setAge(0);
block.setBlockData(ageable);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
@ -884,7 +860,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
ItemStack drop = new ItemStack(Material.NETHER_WART, CSCoreLib.randomizer().nextInt(3) + 1);
if (fits(b, drop)) {
pushItems(b, drop);
org.bukkit.block.data.Ageable ageable = (org.bukkit.block.data.Ageable)block.getBlockData();
Ageable ageable = (Ageable) block.getBlockData();
ageable.setAge(0);
block.setBlockData(ageable);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
@ -911,25 +887,13 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) throws Exception {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : getOutputSlots()) {
@ -949,80 +913,67 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
if (getTier() == 1) {
preset.addItem(34, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTM0M2NlNThkYTU0Yzc5OTI0YTJjOTMzMWNmYzQxN2ZlOGNjYmJlYTliZTQ1YTdhYzg1ODYwYTZjNzMwIn19fQ=="), "&8\u21E9 &cFuel Input &8\u21E9", "", "&rThis Android runs on solid Fuel", "&re.g. Coal, Wood, etc..."),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
return false;
}
});
(p, slot, item, action) -> false
);
}
else if (getTier() == 2){
preset.addItem(34, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTM0M2NlNThkYTU0Yzc5OTI0YTJjOTMzMWNmYzQxN2ZlOGNjYmJlYTliZTQ1YTdhYzg1ODYwYTZjNzMwIn19fQ=="), "&8\u21E9 &cFuel Input &8\u21E9", "", "&rThis Android runs on liquid Fuel", "&re.g. Lava, Oil, Fuel, etc..."),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
return false;
}
});
(p, slot, item, action) -> false
);
}
else {
preset.addItem(34, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTM0M2NlNThkYTU0Yzc5OTI0YTJjOTMzMWNmYzQxN2ZlOGNjYmJlYTliZTQ1YTdhYzg1ODYwYTZjNzMwIn19fQ=="), "&8\u21E9 &cFuel Input &8\u21E9", "", "&rThis Android runs on radioactive Fuel", "&re.g. Uranium, Neptunium or Boosted Uranium"),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}
public void openScriptEditor(Player p, final Block b) throws Exception {
ChestMenu menu = new ChestMenu("&eScript Editor");
menu.addItem(2, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDliZjZkYjRhZWRhOWQ4ODIyYjlmNzM2NTM4ZThjMThiOWE0ODQ0Zjg0ZWI0NTUwNGFkZmJmZWU4N2ViIn19fQ=="), "&2> Edit Script", "", "&aEdits your current Script"),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
menu.addItem(1, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDliZjZkYjRhZWRhOWQ4ODIyYjlmNzM2NTM4ZThjMThiOWE0ODQ0Zjg0ZWI0NTUwNGFkZmJmZWU4N2ViIn19fQ=="), "&2> Edit Script", "", "&aEdits your current Script"),
(pl, slot, item, action) -> {
try {
openScript(p, b, BlockStorage.getLocationInfo(b.getLocation(), "script"));
openScript(pl, b, BlockStorage.getLocationInfo(b.getLocation(), "script"));
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
);
menu.addItem(4, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTcxZDg5NzljMTg3OGEwNTk4N2E3ZmFmMjFiNTZkMWI3NDRmOWQwNjhjNzRjZmZjZGUxZWExZWRhZDU4NTIifX19"), "&4> Create new Script", "", "&cDeletes your current Script", "&cand creates a blank one"),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
menu.addItem(3, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTcxZDg5NzljMTg3OGEwNTk4N2E3ZmFmMjFiNTZkMWI3NDRmOWQwNjhjNzRjZmZjZGUxZWExZWRhZDU4NTIifX19"), "&4> Create new Script", "", "&cDeletes your current Script", "&cand creates a blank one"),
(pl, slot, item, action) -> {
try {
openScript(p, b, "START-TURN_LEFT-REPEAT");
openScript(pl, b, "START-TURN_LEFT-REPEAT");
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
);
menu.addItem(6, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAxNTg2ZTM5ZjZmZmE2M2I0ZmIzMDFiNjVjYTdkYThhOTJmNzM1M2FhYWI4OWQzODg2NTc5MTI1ZGZiYWY5In19fQ=="), "&6> Download a Script", "", "&eDownload a Script from the Server", "&eYou can edit or simply use it"),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
menu.addItem(5, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAxNTg2ZTM5ZjZmZmE2M2I0ZmIzMDFiNjVjYTdkYThhOTJmNzM1M2FhYWI4OWQzODg2NTc5MTI1ZGZiYWY5In19fQ=="), "&6> Download a Script", "", "&eDownload a Script from the Server", "&eYou can edit or simply use it"),
(pl, slot, item, action) -> {
try {
openScriptDownloader(p, b, 1);
openScriptDownloader(pl, b, 1);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
);
menu.addItem(8, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTE4NWM5N2RiYjgzNTNkZTY1MjY5OGQyNGI2NDMyN2I3OTNhM2YzMmE5OGJlNjdiNzE5ZmJlZGFiMzVlIn19fQ=="), "&6> Back", "", "&7Return to the Android's interface"),
(pl, slot, item, action) -> {
try {
BlockStorage.getInventory(b).open(p);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
);
menu.open(p);
}
@ -1031,13 +982,10 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
ChestMenu menu = new ChestMenu("&eScript Editor");
final String[] commands = script.split("-");
menu.addItem(0, ScriptPart.START.toItemStack());
menu.addMenuClickHandler(0, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addItem(0, new CustomItem(ScriptPart.START.toItemStack(), ScriptPart.START.toItemStack().getItemMeta().getDisplayName(), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface"));
menu.addMenuClickHandler(0, (pl, slot, item, action) -> {
BlockStorage.getInventory(b).open(pl);
return false;
}
});
for (int i = 1; i < commands.length; i++) {
@ -1047,84 +995,73 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
if (additional == 1) {
menu.addItem(i, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTcxZDg5NzljMTg3OGEwNTk4N2E3ZmFmMjFiNTZkMWI3NDRmOWQwNjhjNzRjZmZjZGUxZWExZWRhZDU4NTIifX19"), "&7> Add new Command"));
menu.addMenuClickHandler(i, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(i, (pl, slot, item, action) -> {
try {
openScriptComponentEditor(p, b, script, index);
openScriptComponentEditor(pl, b, script, index);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
}
menu.addItem(i + additional, ScriptPart.REPEAT.toItemStack());
menu.addMenuClickHandler(i + additional, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addItem(i + additional, new CustomItem(ScriptPart.REPEAT.toItemStack(), ScriptPart.REPEAT.toItemStack().getItemMeta().getDisplayName(), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface"));
menu.addMenuClickHandler(i + additional, (pl, slot, item, action) -> {
BlockStorage.getInventory(b).open(pl);
return false;
}
});
}
else {
ItemStack stack = ScriptPart.valueOf(commands[i]).toItemStack();
menu.addItem(i, new CustomItem(stack, stack.getItemMeta().getDisplayName(), "", "&7\u21E8 &eLeft Click &7to edit", "&7\u21E8 &eRight Click &7to delete", "&7\u21E8 &eShift + Right Click &7to duplicate"));
menu.addMenuClickHandler(i, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction action) {
menu.addMenuClickHandler(i, (pl, slot, item, action) -> {
if (action.isRightClicked() && action.isShiftClicked()) {
if (commands.length == 54) return false;
int i = 0;
int j = 0;
StringBuilder builder = new StringBuilder("START-");
for (String command : commands) {
if (i > 0) {
if (i == index) {
builder.append(commands[i] + "-");
builder.append(commands[i] + "-");
if (j > 0) {
if (j == index) {
builder.append(commands[j] + "-");
builder.append(commands[j] + "-");
}
else if (i < commands.length - 1) builder.append(command + "-");
else if (j < commands.length - 1) builder.append(command + "-");
}
i++;
j++;
}
builder.append("REPEAT");
BlockStorage.addBlockInfo(b, "script", builder.toString());
try {
openScript(p, b, builder.toString());
openScript(pl, b, builder.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
else if (action.isRightClicked()) {
int i = 0;
int j = 0;
StringBuilder builder = new StringBuilder("START-");
for (String command : commands) {
if (i != index && i > 0 && i < commands.length - 1) builder.append(command + "-");
i++;
if (j != index && j > 0 && j < commands.length - 1) builder.append(command + "-");
j++;
}
builder.append("REPEAT");
BlockStorage.addBlockInfo(b, "script", builder.toString());
try {
openScript(p, b, builder.toString());
openScript(pl, b, builder.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
else {
try {
openScriptComponentEditor(p, b, script, index);
openScriptComponentEditor(pl, b, script, index);
} catch (Exception e) {
e.printStackTrace();
}
}
return false;
}
});
}
}
@ -1133,15 +1070,11 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
private void openScriptDownloader(final Player p, final Block b, final int page) throws Exception {
final ChestMenu menu = new ChestMenu("Slimefun Guide");
final ChestMenu menu = new ChestMenu("Android Scripts");
menu.addMenuOpeningHandler(new MenuOpeningHandler() {
@Override
public void onOpen(Player p) {
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_HAT, 0.7F, 0.7F);
}
});
menu.addMenuOpeningHandler(
(pl) -> pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_HAT, 0.7F, 0.7F)
);
List<Config> scripts = getUploadedScripts();
@ -1150,62 +1083,48 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
for (int i = 45; i < 54; i++) {
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
menu.addMenuClickHandler(i, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(i,
(pl, slot, item, action) -> false
);
}
menu.addItem(46, new CustomItem(new ItemStack(Material.LIME_STAINED_GLASS_PANE), "&r\u21E6 Previous Page", "", "&7(" + page + " / " + pages + ")"));
menu.addMenuClickHandler(46, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(46, (pl, slot, item, action) -> {
int next = page - 1;
if (next < 1) next = pages;
if (next != page) {
try {
openScriptDownloader(p, b, next);
openScriptDownloader(pl, b, next);
} catch (Exception e) {
e.printStackTrace();
}
}
return false;
}
});
menu.addItem(49, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTA1YTJjYWI4YjY4ZWE1N2UzYWY5OTJhMzZlNDdjOGZmOWFhODdjYzg3NzYyODE5NjZmOGMzY2YzMWEzOCJ9fX0="), "&eUpload a Script", "", "&6Click &7to upload your Android's Script", "&7to the Database"));
menu.addMenuClickHandler(49, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addItem(48, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTA1YTJjYWI4YjY4ZWE1N2UzYWY5OTJhMzZlNDdjOGZmOWFhODdjYzg3NzYyODE5NjZmOGMzY2YzMWEzOCJ9fX0="), "&eUpload a Script", "", "&6Click &7to upload your Android's Script", "&7to the Database"));
menu.addMenuClickHandler(48, (pl, slot, item, action) -> {
final String code = BlockStorage.getLocationInfo(b.getLocation(), "script");
int num = 1;
for (Config script: getUploadedScripts()) {
if (script.getString("author").equals(p.getUniqueId().toString())) num++;
if (script.getString("author").equals(pl.getUniqueId().toString())) num++;
if (script.getString("code").equals(code)) {
Messages.local.sendTranslation(p, "android.scripts.already-uploaded", true);
Messages.local.sendTranslation(pl, "android.scripts.already-uploaded", true);
return false;
}
}
final int id = num;
p.closeInventory();
Messages.local.sendTranslation(p, "android.scripts.enter-name", true);
pl.closeInventory();
Messages.local.sendTranslation(pl, "android.scripts.enter-name", true);
MenuHelper.awaitChatInput(p, new ChatHandler() {
@Override
public boolean onChat(Player p, String message) {
MenuHelper.awaitChatInput(pl, (player, message) -> {
Config script = new Config("plugins/Slimefun/scripts/" + getAndroidType().toString() + "/" + p.getName() + " " + id + ".sfs");
script.setValue("author", p.getUniqueId().toString());
script.setValue("author_name", p.getName());
script.setValue("author", player.getUniqueId().toString());
script.setValue("author_name", player.getName());
script.setValue("name", ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', message)));
script.setValue("code", code);
script.setValue("downloads", 0);
@ -1215,35 +1134,39 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
script.save();
try {
Messages.local.sendTranslation(p, "android.uploaded", true);
openScriptDownloader(p, b, page);
Messages.local.sendTranslation(player, "android.uploaded", true);
openScriptDownloader(player, b, page);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
return false;
}
});
menu.addItem(52, new CustomItem(new ItemStack(Material.LIME_STAINED_GLASS_PANE), "&rNext Page \u21E8", "", "&7(" + page + " / " + pages + ")"));
menu.addMenuClickHandler(52, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addItem(50, new CustomItem(new ItemStack(Material.LIME_STAINED_GLASS_PANE), "&rNext Page \u21E8", "", "&7(" + page + " / " + pages + ")"));
menu.addMenuClickHandler(50, (pl, slot, item, action) -> {
int next = page + 1;
if (next > pages) next = 1;
if (next != page) {
try {
openScriptDownloader(p, b, next);
openScriptDownloader(pl, b, next);
} catch (Exception e) {
e.printStackTrace();
}
}
return false;
});
menu.addItem(53, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTE4NWM5N2RiYjgzNTNkZTY1MjY5OGQyNGI2NDMyN2I3OTNhM2YzMmE5OGJlNjdiNzE5ZmJlZGFiMzVlIn19fQ=="), "&6> Back", "", "&7Return to the Android's interface"));
menu.addMenuClickHandler(53, (pl, slot, item, action) -> {
try {
openScriptEditor(pl, b);
} catch (Exception e) {
e.printStackTrace();
}
return false;
});
int category_index = 45 * (page - 1);
@ -1263,18 +1186,15 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
menu.addItem(index, new CustomItem(this.getItem(), "&b" + script.getString("name"), "&7by &r" + author, "", "&7Downloads: &r" + script.getInt("downloads"), "&7Rating: " + getScriptRatingPercentage(script), "&a" + getScriptRating(script, true) + " \u263A &7- &4\u2639 " + getScriptRating(script, false), "", "&eLeft Click &rto download this Script", "&4(This will override your current Script)", "&eShift + Left Click &rto leave a positive Rating", "&eShift + Right Click &rto leave a negative Rating"));
}
menu.addMenuClickHandler(index, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
menu.addMenuClickHandler(index, (pl, slot, item, action) -> {
Config script2 = new Config(script.getFile());
if (action.isShiftClicked()) {
if (script2.getString("author").equals(p.getUniqueId().toString())) {
Messages.local.sendTranslation(p, "android.scripts.rating.own", true);
if (script2.getString("author").equals(pl.getUniqueId().toString())) {
Messages.local.sendTranslation(pl, "android.scripts.rating.own", true);
}
else if (action.isRightClicked()) {
if (!script2.getStringList("rating.negative").contains(p.getUniqueId().toString()) && !script2.getStringList("rating.positive").contains(p.getUniqueId().toString())) {
if (!script2.getStringList("rating.negative").contains(pl.getUniqueId().toString()) && !script2.getStringList("rating.positive").contains(pl.getUniqueId().toString())) {
List<String> list = script2.getStringList("rating.negative");
list.add(p.getUniqueId().toString());
@ -1282,31 +1202,31 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
script2.save();
try {
openScriptDownloader(p, b, page);
openScriptDownloader(pl, b, page);
} catch (Exception e) {
e.printStackTrace();
}
}
else {
Messages.local.sendTranslation(p, "android.scripts.rating.already", true);
Messages.local.sendTranslation(pl, "android.scripts.rating.already", true);
}
}
else {
if (!script2.getStringList("rating.negative").contains(p.getUniqueId().toString()) && !script2.getStringList("rating.positive").contains(p.getUniqueId().toString())) {
if (!script2.getStringList("rating.negative").contains(pl.getUniqueId().toString()) && !script2.getStringList("rating.positive").contains(pl.getUniqueId().toString())) {
List<String> list = script2.getStringList("rating.positive");
list.add(p.getUniqueId().toString());
list.add(pl.getUniqueId().toString());
script2.setValue("rating.positive", list);
script2.save();
try {
openScriptDownloader(p, b, page);
openScriptDownloader(pl, b, page);
} catch (Exception e) {
e.printStackTrace();
}
}
else {
Messages.local.sendTranslation(p, "android.scripts.rating.already", true);
Messages.local.sendTranslation(pl, "android.scripts.rating.already", true);
}
}
}
@ -1316,13 +1236,12 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
script2.save();
BlockStorage.addBlockInfo(b, "script", script2.getString("code"));
openScriptEditor(p, b);
openScriptEditor(pl, b);
} catch (Exception e) {
e.printStackTrace();
}
}
return false;
}
});
index++;
@ -1333,7 +1252,9 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
public float getScriptRating(Config script) {
return Math.round(((getScriptRating(script, true) * 100.0f) / getScriptRating(script, true) + getScriptRating(script, false)) * 100.0f) / 100.0f;
int positive = getScriptRating(script, true) + 1;
int negative = getScriptRating(script, false);
return Math.round((positive / (positive + negative)) * 100.0f) / 100.0f;
}
private int getScriptRating(Config script, boolean positive) {
@ -1360,21 +1281,12 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
for (int i = 0; i < 9; i++) {
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(pl, slot, item, action) -> false
);
}
menu.addItem(9, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTYxMzlmZDFjNTY1NGU1NmU5ZTRlMmM4YmU3ZWIyYmQ1YjQ5OWQ2MzM2MTY2NjNmZWVlOTliNzQzNTJhZDY0In19fQ=="), "&rDo nothing"),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
(pl, slot, item, action) -> {
int i = 0;
StringBuilder builder = new StringBuilder("START-");
for (String command : commands) {
@ -1390,35 +1302,32 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
}
return false;
}
});
);
int i = 10;
for (final ScriptPart part : getAccessibleScriptParts()) {
menu.addItem(i, part.toItemStack(),
new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
int i = 0;
(pl, slot, item, action) -> {
int j = 0;
StringBuilder builder = new StringBuilder("START-");
for (String command : commands) {
if (i > 0) {
if (i == index) builder.append(part.toString() + "-");
else if (i < commands.length - 1) builder.append(command + "-");
if (j > 0) {
if (j == index) builder.append(part.toString() + "-");
else if (j < commands.length - 1) builder.append(command + "-");
}
i++;
j++;
}
builder.append("REPEAT");
BlockStorage.addBlockInfo(b, "script", builder.toString());
try {
openScript(p, b, builder.toString());
openScript(pl, b, builder.toString());
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
);
i++;
}
@ -1429,7 +1338,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot: getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));

View File

@ -74,4 +74,5 @@ public enum ScriptPart {
public AndroidType getRequiredType() {
return this.type;
}
}

View File

@ -47,12 +47,8 @@ public class CSCoreLibLoader {
System.err.println(" ");
System.err.println("#################### - INFO - ####################");
System.err.println(" ");
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
if (connect()) install();
}
}, 10L);
return false;
}

View File

@ -31,6 +31,7 @@ import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.GPS.Elevator;
import me.mrCookieSlime.Slimefun.GPS.GPSNetwork;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Misc.BookDesign;
import me.mrCookieSlime.Slimefun.Objects.Research;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Setup.Messages;
@ -107,7 +108,7 @@ public class SlimefunCommand implements CommandExecutor, Listener {
}
else if (args[0].equalsIgnoreCase("guide")) {
if (sender instanceof Player) {
if (sender.hasPermission("slimefun.command.guide"))((Player) sender).getInventory().addItem(SlimefunGuide.getItem(SlimefunStartup.getCfg().getBoolean("guide.default-view-book")));
if (sender.hasPermission("slimefun.command.guide")) ((Player) sender).getInventory().addItem(SlimefunGuide.getItem(SlimefunStartup.getCfg().getBoolean("guide.default-view-book") ? BookDesign.BOOK : BookDesign.CHEST));
else Messages.local.sendTranslation(sender, "messages.no-permission", true);
}
else Messages.local.sendTranslation(sender, "messages.only-players", true);
@ -318,4 +319,5 @@ public class SlimefunCommand implements CommandExecutor, Listener {
e.setCancelled(true);
}
}
}

View File

@ -27,6 +27,7 @@ public class SlimefunTabCompleter implements TabCompleter {
researches.add(res.getName().toUpperCase().replace(" ", "_"));
}
researches.add("all");
researches.add("reset");
return createReturnList(researches, args[2]);
}
else {
@ -44,7 +45,6 @@ public class SlimefunTabCompleter implements TabCompleter {
* @param string The typed string
* @return Sublist if string is not empty
*/
private List<String> createReturnList(List<String> list, String string) {
if (string.equals("")) return list;
@ -56,4 +56,5 @@ public class SlimefunTabCompleter implements TabCompleter {
}
return returnList;
}
}

View File

@ -13,11 +13,8 @@ import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.general.Chat.TellRawMessage;
import me.mrCookieSlime.CSCoreLibPlugin.general.Chat.TellRawMessage.HoverAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.CustomBookOverlay;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper.ChatHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Setup.Messages;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
@ -30,34 +27,26 @@ public class Elevator {
ChestMenu menu = new ChestMenu("Elevator Settings");
menu.addItem(4, new CustomItem(new ItemStack(Material.NAME_TAG), "&7Floor Name &e(Click to edit)", "", "&r" + ChatColor.translateAlternateColorCodes('&', BlockStorage.getLocationInfo(b.getLocation(), "floor"))));
menu.addMenuClickHandler(4, new MenuClickHandler() {
menu.addMenuClickHandler(4, (pl, slot, item, action) -> {
pl.closeInventory();
pl.sendMessage("");
pl.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &ePlease enter a Name for this Floor in your Chat!"));
pl.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &e(Chat Colors are supported!"));
pl.sendMessage("");
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
p.closeInventory();
p.sendMessage("");
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &ePlease enter a Name for this Floor in your Chat!"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &e(Chat Colors are supported!"));
p.sendMessage("");
MenuHelper.awaitChatInput(p, new ChatHandler() {
@Override
public boolean onChat(Player p, String message) {
MenuHelper.awaitChatInput(pl, (player, message) -> {
BlockStorage.addBlockInfo(b, "floor", message.replaceAll("&", "&"));
p.sendMessage("");
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &eSuccessfully named this Floor:"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &r" + ChatColor.translateAlternateColorCodes('&', message)));
p.sendMessage("");
player.sendMessage("");
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &eSuccessfully named this Floor:"));
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&l>> &r" + ChatColor.translateAlternateColorCodes('&', message)));
player.sendMessage("");
openEditor(p, b);
openEditor(player, b);
return false;
}
});
return false;
}
});
menu.open(p);

View File

@ -20,11 +20,7 @@ import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Variable;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuCloseHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper.ChatHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Math.DoubleHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
@ -73,46 +69,28 @@ public class GPSNetwork {
for (int slot : border) {
menu.addItem(slot, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(pl, slotn, item, action) -> false
);
}
menu.addItem(2, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjBjOWMxYTAyMmY0MGI3M2YxNGI0Y2JhMzdjNzE4YzZhNTMzZjNhMjg2NGI2NTM2ZDVmNDU2OTM0Y2MxZiJ9fX0="), "&7Transmitter Overview &e(Selected)"));
menu.addMenuClickHandler(2, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(2,
(pl, slot, item, action) -> false
);
menu.addItem(4, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGRjZmJhNThmYWYxZjY0ODQ3ODg0MTExODIyYjY0YWZhMjFkN2ZjNjJkNDQ4MWYxNGYzZjNiY2I2MzMwIn19fQ=="), "&7Network Info", "", "&8\u21E8 &7Status: " + (getNetworkComplexity(p.getUniqueId()) > 0 ? "&2&lONLINE": "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &r" + getNetworkComplexity(p.getUniqueId())));
menu.addMenuClickHandler(4, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(4,
(pl, slot, item, action) -> false
);
menu.addItem(6, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0="), "&7Waypoint Overview &r(Select)"));
menu.addMenuClickHandler(6, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(6, (pl, slot, item, action) -> {
try {
openWaypointControlPanel(arg0);
openWaypointControlPanel(pl);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
int index = 0;
@ -121,13 +99,9 @@ public class GPSNetwork {
int slot = inventory[index];
menu.addItem(slot, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjBjOWMxYTAyMmY0MGI3M2YxNGI0Y2JhMzdjNzE4YzZhNTMzZjNhMjg2NGI2NTM2ZDVmNDU2OTM0Y2MxZiJ9fX0="), "&bGPS Transmitter", "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &r" + l.getBlockY(), "&8\u21E8 &7Ping: &r" + DoubleHandler.fixDouble(1000D / l.getY()) + "ms"));
menu.addMenuClickHandler(slot, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(slot,
(pl, slotn, item, action) -> false
);
index++;
}
@ -156,47 +130,29 @@ public class GPSNetwork {
for (int slot: border) {
menu.addItem(slot, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(pl, slotn, item, action) -> false
);
}
menu.addItem(2, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjBjOWMxYTAyMmY0MGI3M2YxNGI0Y2JhMzdjNzE4YzZhNTMzZjNhMjg2NGI2NTM2ZDVmNDU2OTM0Y2MxZiJ9fX0="), "&7Transmitter Overview &r(Select)"));
menu.addMenuClickHandler(2, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(2, (pl, slot, item, action) -> {
try {
openTransmitterControlPanel(arg0);
openTransmitterControlPanel(pl);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
menu.addItem(4, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGRjZmJhNThmYWYxZjY0ODQ3ODg0MTExODIyYjY0YWZhMjFkN2ZjNjJkNDQ4MWYxNGYzZjNiY2I2MzMwIn19fQ=="), "&7Network Info", "", "&8\u21E8 &7Status: " + (getNetworkComplexity(p.getUniqueId()) > 0 ? "&2&lONLINE": "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &r" + getNetworkComplexity(p.getUniqueId())));
menu.addMenuClickHandler(4, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(4,
(pl, slot, item, action) -> false
);
menu.addItem(6, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0="), "&7Waypoint Overview &e(Selected)"));
menu.addMenuClickHandler(6, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(6,
(pl, slot, item, action) -> false
);
int index = 0;
for (final Map.Entry<String, Location> entry : getWaypoints(p.getUniqueId()).entrySet()) {
@ -207,22 +163,18 @@ public class GPSNetwork {
ItemStack globe = getPlanet(entry);
menu.addItem(slot, new CustomItem(globe, entry.getKey(), "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "", "&8\u21E8 &cClick to delete"));
menu.addMenuClickHandler(slot, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(slot, (pl, slotn, item, action) -> {
String id = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', entry.getKey())).toUpperCase().replace(" ", "_");
Config cfg = new Config("data-storage/Slimefun/waypoints/" + arg0.getUniqueId().toString() + ".yml");
Config cfg = new Config("data-storage/Slimefun/waypoints/" + pl.getUniqueId().toString() + ".yml");
cfg.setValue(id, null);
cfg.save();
arg0.playSound(arg0.getLocation(), Sound.UI_BUTTON_CLICK, 1F, 1F);
pl.playSound(pl.getLocation(), Sound.UI_BUTTON_CLICK, 1F, 1F);
try {
openWaypointControlPanel(arg0);
openWaypointControlPanel(pl);
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});
index++;
@ -249,13 +201,9 @@ public class GPSNetwork {
}
Messages.local.sendTranslation(p, "gps.waypoint.new", true);
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 0.5F, 1F);
MenuHelper.awaitChatInput(p, new ChatHandler() {
@Override
public boolean onChat(Player p, String message) {
addWaypoint(p, message, l);
MenuHelper.awaitChatInput(p, (pl, message) -> {
addWaypoint(pl, message, l);
return false;
}
});
}
@ -290,13 +238,8 @@ public class GPSNetwork {
int supply = OreGenSystem.getSupplies(resource, chunk, true);
menu.addItem(index, new CustomItem(resource.getIcon(), "&7Resource: &e" + resource.getName(), "", "&7Scanned Chunk:", "&8\u21E8 &7X: " + chunk.getX() + " Z: " + chunk.getZ(), "", "&7Result: &e" + supply + " " + resource.getMeasurementUnit()),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(pl, slot, item, action) -> false
);
index++;
}
@ -314,34 +257,20 @@ public class GPSNetwork {
ChestMenu menu = new ChestMenu("&3Teleporter");
menu.addMenuCloseHandler(new MenuCloseHandler() {
@Override
public void onClose(Player p) {
TeleportationSequence.players.remove(p.getUniqueId());
}
});
menu.addMenuCloseHandler(
pl -> TeleportationSequence.players.remove(pl.getUniqueId())
);
for (int slot : teleporter_border) {
menu.addItem(slot, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(pl, slotn, item, action) -> false
);
}
menu.addItem(4, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0="), "&7Waypoint Overview &e(Select a Destination)"));
menu.addMenuClickHandler(4, new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(4,
(pl, slot, item, action) -> false
);
final Location source = new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 2D, b.getZ() + 0.5D);
int index = 0;
@ -353,14 +282,10 @@ public class GPSNetwork {
ItemStack globe = getPlanet(entry);
menu.addItem(slot, new CustomItem(globe, entry.getKey(), "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "&8\u21E8 &7Estimated Teleportation Time: &r" + (50 / TeleportationSequence.getSpeed(Slimefun.getGPSNetwork().getNetworkComplexity(uuid), source, l)) + "s", "", "&8\u21E8 &cClick to select"));
menu.addMenuClickHandler(slot, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
p.closeInventory();
TeleportationSequence.start(p.getUniqueId(), complexity, source, l, false);
menu.addMenuClickHandler(slot, (pl, slotn, item, action) -> {
pl.closeInventory();
TeleportationSequence.start(pl.getUniqueId(), complexity, source, l, false);
return false;
}
});
index++;

View File

@ -4,15 +4,19 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.TitleBuilder;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.TitleBuilder.TitleType;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import org.bukkit.*;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.TitleBuilder;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.TitleBuilder.TitleType;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
public class TeleportationSequence {
public static Set<UUID> players = new HashSet<UUID>();
@ -92,12 +96,8 @@ public class TeleportationSequence {
source.getWorld().spawnParticle(Particle.PORTAL, source, progress * 2, 0.2F, 0.8F, 0.2F);
source.getWorld().playSound(source, Sound.UI_BUTTON_CLICK, 1.7F, 0.6F);
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
updateProgress(uuid, speed, progress + speed, source, destination, resistance);
}
}, 10l);
}
} catch (Exception e) {

View File

@ -1,5 +1,8 @@
package me.mrCookieSlime.Slimefun.GitHub;
import java.util.HashMap;
import java.util.Map;
/**
* Represents a contributor on Slimefun4's GitHub repository.
*
@ -7,6 +10,8 @@ package me.mrCookieSlime.Slimefun.GitHub;
*/
public class Contributor {
public static Map<String, String> textures = new HashMap<>();
private String name;
private String job;
private String profile;
@ -61,4 +66,12 @@ public class Contributor {
protected void setProfile(String profile) {
this.profile = profile;
}
/**
* Returns this Creator's head texture
* @return A Base64-Head Texture
*/
public String getTexture() {
return textures.get(name);
}
}

View File

@ -1,10 +1,16 @@
package me.mrCookieSlime.Slimefun.GitHub;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.mrCookieSlime.Slimefun.SlimefunGuide;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
public class GitHubSetup {
@ -31,6 +37,50 @@ public class GitHubSetup {
}
}
SlimefunGuide.contributors.add(new Contributor("AquaLazuryt", "&6Lead Head Artist", 0));
SlimefunStartup.instance.getServer().getScheduler().runTaskAsynchronously(SlimefunStartup.instance, () -> {
for (JsonElement e: array) {
String name = e.getAsJsonObject().get("login").getAsString();
if (Contributor.textures.containsKey(name)) continue;
InputStreamReader profile_reader = null, session_reader = null;
try {
URL profile = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);
profile_reader = new InputStreamReader(profile.openStream());
String uuid = new JsonParser().parse(profile_reader).getAsJsonObject().get("id").getAsString();
URL session = new URL("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid + "?unsigned=false");
session_reader = new InputStreamReader(session.openStream());
JsonArray properties = new JsonParser().parse(session_reader).getAsJsonObject().get("properties").getAsJsonArray();
for (JsonElement el: properties) {
if (el.isJsonObject() && el.getAsJsonObject().get("name").getAsString().equals("textures")) {
Contributor.textures.put(name, el.getAsJsonObject().get("value").getAsString());
break;
}
}
} catch (Exception x) {
Contributor.textures.put(name, null);
} finally {
if (profile_reader != null) {
try {
profile_reader.close();
} catch (IOException x) {
x.printStackTrace();
}
}
if (session_reader != null) {
try {
session_reader.close();
} catch (IOException x) {
x.printStackTrace();
}
}
}
}
});
}
@Override

View File

@ -38,7 +38,7 @@ public class ItemHash {
StringBuilder builder = new StringBuilder(LENGTH * 2);
for (char c: item.getHash().toCharArray()) {
builder.append('§');
builder.append('\u00a7');
builder.append(c);
}

View File

@ -36,8 +36,8 @@ public class RecipeType {
public static final RecipeType FURNACE = new RecipeType(new CustomItem(Material.FURNACE, "&eFurnace Recipe", 0, new String[] {"", "&a&oJust smelt it in a regular Furnace"}));
public static final RecipeType NULL = new RecipeType(null);
ItemStack item;
String machine;
private ItemStack item;
private String machine;
public RecipeType(ItemStack item) {
this.item = item;
@ -51,8 +51,7 @@ public class RecipeType {
public RecipeType(String machine, int seconds, ItemStack[] input, ItemStack[] output) {
this.machine = machine;
SlimefunItem item = getMachine();
this.item = item.getItem();
this.item = getMachine().getItem();
SlimefunRecipes.registerMachineRecipe(machine, seconds, input, output);
}
@ -66,23 +65,23 @@ public class RecipeType {
}
public static List<ItemStack> getRecipeInputs(SlimefunItem machine) {
if (machine == null) return new ArrayList<ItemStack>();
if (machine == null) return new ArrayList<>();
List<ItemStack[]> recipes = (machine instanceof SlimefunMachine ? ((SlimefunMachine) machine).getRecipes(): ((SlimefunGadget) machine).getRecipes());
List<ItemStack> convertable = new ArrayList<ItemStack>();
List<ItemStack> convertible = new ArrayList<>();
for (int i = 0; i < recipes.size(); i++) {
if (i % 2 == 0) convertable.add(recipes.get(i)[0]);
if (i % 2 == 0) convertible.add(recipes.get(i)[0]);
}
return convertable;
return convertible;
}
public static List<ItemStack[]> getRecipeInputList(SlimefunItem machine) {
if (machine == null) return new ArrayList<ItemStack[]>();
if (machine == null) return new ArrayList<>();
List<ItemStack[]> recipes = (machine instanceof SlimefunMachine ? ((SlimefunMachine) machine).getRecipes(): ((SlimefunGadget) machine).getRecipes());
List<ItemStack[]> convertable = new ArrayList<ItemStack[]>();
List<ItemStack[]> convertible = new ArrayList<>();
for (int i = 0; i < recipes.size(); i++) {
if (i % 2 == 0) convertable.add(recipes.get(i));
if (i % 2 == 0) convertible.add(recipes.get(i));
}
return convertable;
return convertible;
}
public static ItemStack getRecipeOutput(SlimefunItem machine, ItemStack input) {

View File

@ -1,11 +1,5 @@
package me.mrCookieSlime.Slimefun.Lists;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomArmor;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomPotion;
import me.mrCookieSlime.CSCoreLibPlugin.general.String.Christmas;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
@ -13,38 +7,42 @@ import org.bukkit.FireworkEffect.Type;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkEffectMeta;
import org.bukkit.material.MaterialData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
@SuppressWarnings("deprecation")
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomArmor;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomPotion;
import me.mrCookieSlime.CSCoreLibPlugin.general.String.Christmas;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
public class SlimefunItems {
/* Items */
public static ItemStack PORTABLE_CRAFTER = null;
public static ItemStack PORTABLE_DUSTBIN = null;
public static ItemStack ENDER_BACKPACK = null;
public static ItemStack MAGIC_EYE_OF_ENDER = new CustomItem(Material.ENDER_EYE, "&6&lMagic Eye of Ender", 0, new String[] {"&4&lRequires full Ender Armor", "", "&7&eRight Click&7 to shoot an Ender Pearl"});
public static ItemStack BROKEN_SPAWNER = new CustomItem(new MaterialData(Material.SPAWNER), "&cBroken Spawner", "&7Type: &b<Type>", "", "&cFractured, must be repaired in an Ancient Altar");
public static ItemStack REPAIRED_SPAWNER = new CustomItem(Material.SPAWNER, "&bReinforced Spawner", 0, new String[] {"&7Type: &b<Type>"});
public static ItemStack INFERNAL_BONEMEAL = new CustomItem(new MaterialData(Material.BONE_MEAL), "&4Infernal Bonemeal", "", "&cSpeeds up the Growth of", "&cNether Warts as well");
public static ItemStack MAGIC_EYE_OF_ENDER = new CustomItem(Material.ENDER_EYE, "&6&lMagic Eye of Ender", "&4&lRequires full Ender Armor", "", "&7&eRight Click&7 to shoot an Ender Pearl");
public static ItemStack BROKEN_SPAWNER = new CustomItem(Material.SPAWNER, "&cBroken Spawner", "&7Type: &b<Type>", "", "&cFractured, must be repaired in an Ancient Altar");
public static ItemStack REPAIRED_SPAWNER = new CustomItem(Material.SPAWNER, "&bReinforced Spawner", "&7Type: &b<Type>");
public static ItemStack INFERNAL_BONEMEAL = new CustomItem(Material.BONE_MEAL, "&4Infernal Bonemeal", "", "&cSpeeds up the Growth of", "&cNether Warts as well");
/* Gadgets */
public static ItemStack GOLD_PAN = new CustomItem(Material.BOWL, "&6Gold Pan", 0, new String[] {"&a&oCan get you all kinds of Goodies...", "", "&7&eRight Click&7 to pan various Stuff out of Gravel"});
public static ItemStack PARACHUTE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&r&lParachute", 0, new String[] {"", "&7Hold &eShift&7 to use"}), Color.WHITE);
public static ItemStack GRAPPLING_HOOK = new CustomItem(Material.LEAD, "&6Grappling Hook", 0, new String[] {"", "&7&eRight Click&7 to use"});
public static ItemStack SOLAR_HELMET = new CustomItem(Material.IRON_HELMET, "&bSolar Helmet", 0, new String[] {"", "&a&oCharges held Items and Armor"});
public static ItemStack CLOTH = new CustomItem(Material.PAPER, "&bCloth", 0);
public static ItemStack GOLD_PAN = new CustomItem(Material.BOWL, "&6Gold Pan", "&a&oCan get you all kinds of Goodies...", "", "&7&eRight Click&7 to pan various Stuff out of Gravel");
public static ItemStack PARACHUTE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&r&lParachute", "", "&7Hold &eShift&7 to use"), Color.WHITE);
public static ItemStack GRAPPLING_HOOK = new CustomItem(Material.LEAD, "&6Grappling Hook", "", "&7&eRight Click&7 to use");
public static ItemStack SOLAR_HELMET = new CustomItem(Material.IRON_HELMET, "&bSolar Helmet", "", "&a&oCharges held Items and Armor");
public static ItemStack CLOTH = new CustomItem(Material.PAPER, "&bCloth");
public static ItemStack CAN = null;
public static ItemStack NIGHT_VISION_GOGGLES = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&aNight Vision Goggles", 0, new String[] {"", "&9+ Night Vision"}), Color.BLACK);
public static ItemStack FARMER_SHOES = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&eFarmer Shoes", 0, new String[] {"", "&6&oPrevents you from trampling your Crops"}), Color.YELLOW);
public static ItemStack NIGHT_VISION_GOGGLES = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&aNight Vision Goggles", "", "&9+ Night Vision"), Color.BLACK);
public static ItemStack FARMER_SHOES = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&eFarmer Shoes", "", "&6&oPrevents you from trampling your Crops"), Color.YELLOW);
public static ItemStack INFUSED_MAGNET = null;
public static ItemStack FLASK_OF_KNOWLEDGE = new CustomItem(Material.GLASS_BOTTLE, "&cFlask of Knowledge", 0, new String[] {"", "&rAllows you to store some of", "&ryour Experience in a Bottle", "&7Cost: &a1 Level"});
public static ItemStack RAG = new CustomItem(Material.PAPER, "&cRag", 0, new String[] {"", "&aLevel I - Medical Supply", "", "&rRestores 2 Hearts", "&rExtinguishes Fire", "", "&7&eRight Click&7 to use"});
public static ItemStack BANDAGE = new CustomItem(Material.PAPER, "&cBandage", 0, new String[] {"", "&aLevel II - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "", "&7&eRight Click&7 to use"});
public static ItemStack SPLINT = new CustomItem(Material.STICK, "&cSplint", 0, new String[] {"", "&aLevel I - Medical Supply", "", "&rRestores 2 Hearts", "", "&7&eRight Click&7 to use"});
public static ItemStack VITAMINS = new CustomItem(Material.NETHER_WART, "&cVitamins", 0, new String[] {"", "&aLevel III - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "&rCures Poison/Wither/Radiation", "", "&7&eRight Click&7 to use"});
public static ItemStack MEDICINE = new CustomItem(Material.POTION, "&cMedicine", 8229, new String[] {"", "&aLevel III - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "&rCures Poison/Wither/Radiation", "", "&7&eRight Click&7 to drink"});
public static ItemStack FLASK_OF_KNOWLEDGE = new CustomItem(Material.GLASS_BOTTLE, "&cFlask of Knowledge", "", "&rAllows you to store some of", "&ryour Experience in a Bottle", "&7Cost: &a1 Level");
public static ItemStack RAG = new CustomItem(Material.PAPER, "&cRag", "", "&aLevel I - Medical Supply", "", "&rRestores 2 Hearts", "&rExtinguishes Fire", "", "&7&eRight Click&7 to use");
public static ItemStack BANDAGE = new CustomItem(Material.PAPER, "&cBandage", "", "&aLevel II - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "", "&7&eRight Click&7 to use");
public static ItemStack SPLINT = new CustomItem(Material.STICK, "&cSplint", "", "&aLevel I - Medical Supply", "", "&rRestores 2 Hearts", "", "&7&eRight Click&7 to use");
public static ItemStack VITAMINS = new CustomItem(Material.NETHER_WART, "&cVitamins", "", "&aLevel III - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "&rCures Poison/Wither/Radiation", "", "&7&eRight Click&7 to use");
public static ItemStack MEDICINE = new CustomPotion("&cMedicine", Color.RED, new PotionEffect(PotionEffectType.HEAL, 0, 0), "", "&aLevel III - Medical Supply", "", "&rRestores 4 Hearts", "&rExtinguishes Fire", "&rCures Poison/Wither/Radiation");
/* Backpacks */
public static ItemStack BACKPACK_SMALL = null;
@ -62,98 +60,98 @@ public class SlimefunItems {
public static ItemStack BOUND_VOIDBAG = null;
/* Jetpacks */
public static ItemStack DURALUMIN_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eI", "", "&8\u21E8 &7Material: &bDuralumin", "&c&o&8\u21E8 &e\u26A1 &70 / 20 J", "&8\u21E8 &7Thrust: &c0.35", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack SOLDER_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eII", "", "&8\u21E8 &7Material: &bSolder", "&c&o&8\u21E8 &e\u26A1 &70 / 30 J", "&8\u21E8 &7Thrust: &c0.4", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack BILLON_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eIII", "", "&8\u21E8 &7Material: &bBillon", "&c&o&8\u21E8 &e\u26A1 &70 / 45 J", "&8\u21E8 &7Thrust: &c0.45", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack STEEL_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eIV", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 60 J", "&8\u21E8 &7Thrust: &c0.5", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack DAMASCUS_STEEL_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eV", "", "&8\u21E8 &7Material: &bDamascus Steel", "&c&o&8\u21E8 &e\u26A1 &70 / 75 J", "&8\u21E8 &7Thrust: &c0.55", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack REINFORCED_ALLOY_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eVI", "", "&8\u21E8 &7Material: &bReinforced Alloy", "&c&o&8\u21E8 &e\u26A1 &70 / 100 J", "&8\u21E8 &7Thrust: &c0.6", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack CARBONADO_JETPACK = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_CHESTPLATE), "&9Electric Jetpack &7- &eVII", "", "&8\u21E8 &7Material: &bCarbonado", "&c&o&8\u21E8 &e\u26A1 &70 / 150 J", "&8\u21E8 &7Thrust: &c0.7", "", "&7Hold &eShift&7 to use"), Color.BLACK);
public static ItemStack ARMORED_JETPACK = new CustomItem(new MaterialData(Material.IRON_CHESTPLATE), "&9Armored Jetpack", "&8\u21E8 &7Material: &bSteel", "", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "&8\u21E8 &7Thrust: &c0.45", "", "&7Hold &eShift&7 to use");
public static ItemStack DURALUMIN_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eI", "", "&8\u21E8 &7Material: &bDuralumin", "&c&o&8\u21E8 &e\u26A1 &70 / 20 J", "&8\u21E8 &7Thrust: &c0.35", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack SOLDER_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eII", "", "&8\u21E8 &7Material: &bSolder", "&c&o&8\u21E8 &e\u26A1 &70 / 30 J", "&8\u21E8 &7Thrust: &c0.4", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack BILLON_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eIII", "", "&8\u21E8 &7Material: &bBillon", "&c&o&8\u21E8 &e\u26A1 &70 / 45 J", "&8\u21E8 &7Thrust: &c0.45", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack STEEL_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eIV", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 60 J", "&8\u21E8 &7Thrust: &c0.5", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack DAMASCUS_STEEL_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eV", "", "&8\u21E8 &7Material: &bDamascus Steel", "&c&o&8\u21E8 &e\u26A1 &70 / 75 J", "&8\u21E8 &7Thrust: &c0.55", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack REINFORCED_ALLOY_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eVI", "", "&8\u21E8 &7Material: &bReinforced Alloy", "&c&o&8\u21E8 &e\u26A1 &70 / 100 J", "&8\u21E8 &7Thrust: &c0.6", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack CARBONADO_JETPACK = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&9Electric Jetpack &7- &eVII", "", "&8\u21E8 &7Material: &bCarbonado", "&c&o&8\u21E8 &e\u26A1 &70 / 150 J", "&8\u21E8 &7Thrust: &c0.7", "", "&7Hold &eShift&7 to use"), Color.BLACK);
public static ItemStack ARMORED_JETPACK = new CustomItem(Material.IRON_CHESTPLATE, "&9Armored Jetpack", "&8\u21E8 &7Material: &bSteel", "", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "&8\u21E8 &7Thrust: &c0.45", "", "&7Hold &eShift&7 to use");
/* Jetboots */
public static ItemStack DURALUMIN_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eI", "", "&8\u21E8 &7Material: &bDuralumin", "&c&o&8\u21E8 &e\u26A1 &70 / 20 J", "&8\u21E8 &7Speed: &a0.35", "&8\u21E8 &7Accuracy: &c50%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack SOLDER_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eII", "", "&8\u21E8 &7Material: &bSolder", "&c&o&8\u21E8 &e\u26A1 &70 / 30 J", "&8\u21E8 &7Speed: &a0.4", "&8\u21E8 &7Accuracy: &660%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack BILLON_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eIII", "", "&8\u21E8 &7Material: &bBillon", "&c&o&8\u21E8 &e\u26A1 &70 / 40 J", "&8\u21E8 &7Speed: &a0.45", "&8\u21E8 &7Accuracy: &665%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack STEEL_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eIV", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "&8\u21E8 &7Speed: &a0.5", "&8\u21E8 &7Accuracy: &e70%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack DAMASCUS_STEEL_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eV", "", "&8\u21E8 &7Material: &bDamascus Steel", "&c&o&8\u21E8 &e\u26A1 &70 / 75 J", "&8\u21E8 &7Speed: &a0.55", "&8\u21E8 &7Accuracy: &a75%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack REINFORCED_ALLOY_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eVI", "", "&8\u21E8 &7Material: &bReinforced Alloy", "&c&o&8\u21E8 &e\u26A1 &70 / 100 J", "&8\u21E8 &7Speed: &a0.6", "&8\u21E8 &7Accuracy: &c80%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack CARBONADO_JETBOOTS = new CustomArmor(new CustomItem(new MaterialData(Material.LEATHER_BOOTS), "&9Jet Boots &7- &eVII", "", "&8\u21E8 &7Material: &bCarbonado", "&c&o&8\u21E8 &e\u26A1 &70 / 125 J", "&8\u21E8 &7Speed: &a0.7", "&8\u21E8 &7Accuracy: &c99.9%", "", "&7Hold &eShift&7 to use"), Color.BLACK);
public static ItemStack ARMORED_JETBOOTS = new CustomItem(new MaterialData(Material.IRON_BOOTS), "&9Armored Jet Boots", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "&8\u21E8 &7Speed: &a0.45", "&8\u21E8 &7Accuracy: &e70%", "", "&7Hold &eShift&7 to use");
public static ItemStack DURALUMIN_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eI", "", "&8\u21E8 &7Material: &bDuralumin", "&c&o&8\u21E8 &e\u26A1 &70 / 20 J", "&8\u21E8 &7Speed: &a0.35", "&8\u21E8 &7Accuracy: &c50%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack SOLDER_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eII", "", "&8\u21E8 &7Material: &bSolder", "&c&o&8\u21E8 &e\u26A1 &70 / 30 J", "&8\u21E8 &7Speed: &a0.4", "&8\u21E8 &7Accuracy: &660%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack BILLON_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eIII", "", "&8\u21E8 &7Material: &bBillon", "&c&o&8\u21E8 &e\u26A1 &70 / 40 J", "&8\u21E8 &7Speed: &a0.45", "&8\u21E8 &7Accuracy: &665%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack STEEL_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eIV", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "&8\u21E8 &7Speed: &a0.5", "&8\u21E8 &7Accuracy: &e70%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack DAMASCUS_STEEL_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eV", "", "&8\u21E8 &7Material: &bDamascus Steel", "&c&o&8\u21E8 &e\u26A1 &70 / 75 J", "&8\u21E8 &7Speed: &a0.55", "&8\u21E8 &7Accuracy: &a75%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack REINFORCED_ALLOY_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eVI", "", "&8\u21E8 &7Material: &bReinforced Alloy", "&c&o&8\u21E8 &e\u26A1 &70 / 100 J", "&8\u21E8 &7Speed: &a0.6", "&8\u21E8 &7Accuracy: &c80%", "", "&7Hold &eShift&7 to use"), Color.SILVER);
public static ItemStack CARBONADO_JETBOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&9Jet Boots &7- &eVII", "", "&8\u21E8 &7Material: &bCarbonado", "&c&o&8\u21E8 &e\u26A1 &70 / 125 J", "&8\u21E8 &7Speed: &a0.7", "&8\u21E8 &7Accuracy: &c99.9%", "", "&7Hold &eShift&7 to use"), Color.BLACK);
public static ItemStack ARMORED_JETBOOTS = new CustomItem(Material.IRON_BOOTS, "&9Armored Jet Boots", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "&8\u21E8 &7Speed: &a0.45", "&8\u21E8 &7Accuracy: &e70%", "", "&7Hold &eShift&7 to use");
/* Multi Tools */
public static ItemStack DURALUMIN_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eI", "", "&8\u21E8 &7Material: &bDuralumin", "&c&o&8\u21E8 &e\u26A1 &70 / 20 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack SOLDER_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eII", "", "&8\u21E8 &7Material: &bSolder", "&c&o&8\u21E8 &e\u26A1 &70 / 30 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack BILLON_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eIII", "", "&8\u21E8 &7Material: &bBillon", "&c&o&8\u21E8 &e\u26A1 &70 / 40 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack STEEL_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eIV", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack DAMASCUS_STEEL_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eV", "", "&8\u21E8 &7Material: &bDamascus Steel", "&c&o&8\u21E8 &e\u26A1 &70 / 60 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack REINFORCED_ALLOY_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eVI", "", "&8\u21E8 &7Material: &bReinforced Alloy", "&c&o&8\u21E8 &e\u26A1 &70 / 75 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack CARBONADO_MULTI_TOOL = new CustomItem(new MaterialData(Material.SHEARS), "&9Multi Tool &7- &eVII", "", "&8\u21E8 &7Material: &bCarbonado", "&c&o&8\u21E8 &e\u26A1 &70 / 100 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack DURALUMIN_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eI", "", "&8\u21E8 &7Material: &bDuralumin", "&c&o&8\u21E8 &e\u26A1 &70 / 20 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack SOLDER_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eII", "", "&8\u21E8 &7Material: &bSolder", "&c&o&8\u21E8 &e\u26A1 &70 / 30 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack BILLON_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eIII", "", "&8\u21E8 &7Material: &bBillon", "&c&o&8\u21E8 &e\u26A1 &70 / 40 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack STEEL_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eIV", "", "&8\u21E8 &7Material: &bSteel", "&c&o&8\u21E8 &e\u26A1 &70 / 50 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack DAMASCUS_STEEL_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eV", "", "&8\u21E8 &7Material: &bDamascus Steel", "&c&o&8\u21E8 &e\u26A1 &70 / 60 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack REINFORCED_ALLOY_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eVI", "", "&8\u21E8 &7Material: &bReinforced Alloy", "&c&o&8\u21E8 &e\u26A1 &70 / 75 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
public static ItemStack CARBONADO_MULTI_TOOL = new CustomItem(Material.SHEARS, "&9Multi Tool &7- &eVII", "", "&8\u21E8 &7Material: &bCarbonado", "&c&o&8\u21E8 &e\u26A1 &70 / 100 J", "", "&7&eRight Click&7 to use", "&7Hold &eShift + Right Click&7 to change the Mode");
/* Food */
public static ItemStack FORTUNE_COOKIE = new CustomItem(Material.COOKIE, "&6Fortune Cookie", 0, new String[] {"", "&a&oTells you stuff about your Future :o"});
public static ItemStack BEEF_JERKY = new CustomItem(Material.COOKED_BEEF, "&6Beef Jerky", 0, new String[] {"", "&a&oSaturating"});
public static ItemStack MAGIC_SUGAR = new CustomItem(Material.SUGAR, "&6Magic Sugar", 0, new String[] {"", "&a&oFeel the Power of Hermes!"});
public static ItemStack MONSTER_JERKY = new CustomItem(Material.ROTTEN_FLESH, "&6Monster Jerky", 0, new String[] {"", "&a&oNo longer hungry"});
public static ItemStack APPLE_JUICE = new CustomPotion("&cApple Juice", 8197, new String[0], new PotionEffect(PotionEffectType.SATURATION, 6, 0));
public static ItemStack MELON_JUICE = new CustomPotion("&cMelon Juice", 8197, new String[0], new PotionEffect(PotionEffectType.SATURATION, 6, 0));
public static ItemStack CARROT_JUICE = new CustomPotion("&6Carrot Juice", 8195, new String[0], new PotionEffect(PotionEffectType.SATURATION, 6, 0));
public static ItemStack PUMPKIN_JUICE = new CustomPotion("&6Pumpkin Juice", 8195, new String[0], new PotionEffect(PotionEffectType.SATURATION, 6, 0));
public static ItemStack GOLDEN_APPLE_JUICE = new CustomPotion("&bGolden Apple Juice", 8195, new String[0], new PotionEffect(PotionEffectType.ABSORPTION, 20 * 20, 0));
public static ItemStack FORTUNE_COOKIE = new CustomItem(Material.COOKIE, "&6Fortune Cookie", "", "&a&oTells you stuff about your Future :o");
public static ItemStack BEEF_JERKY = new CustomItem(Material.COOKED_BEEF, "&6Beef Jerky", "", "&a&oSaturating");
public static ItemStack MAGIC_SUGAR = new CustomItem(Material.SUGAR, "&6Magic Sugar", "", "&a&oFeel the Power of Hermes!");
public static ItemStack MONSTER_JERKY = new CustomItem(Material.ROTTEN_FLESH, "&6Monster Jerky", "", "&a&oNo longer hungry");
public static ItemStack APPLE_JUICE = new CustomPotion("&cApple Juice", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger");
public static ItemStack MELON_JUICE = new CustomPotion("&cMelon Juice", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger");
public static ItemStack CARROT_JUICE = new CustomPotion("&6Carrot Juice", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger");
public static ItemStack PUMPKIN_JUICE = new CustomPotion("&6Pumpkin Juice", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger");
public static ItemStack GOLDEN_APPLE_JUICE = new CustomPotion("&bGolden Apple Juice", Color.YELLOW, new PotionEffect(PotionEffectType.ABSORPTION, 20 * 20, 0));
/* Christmas */
public static ItemStack CHRISTMAS_MILK = new CustomPotion("&6Glass of Milk", 8194, new String[0], new PotionEffect(PotionEffectType.SATURATION, 5, 0));
public static ItemStack CHRISTMAS_CHOCOLATE_MILK = new CustomPotion("&6Chocolate Milk", 8201, new String[0], new PotionEffect(PotionEffectType.SATURATION, 12, 0));
public static ItemStack CHRISTMAS_EGG_NOG = new CustomPotion("&aEgg Nog", 8194, new String[0], new PotionEffect(PotionEffectType.SATURATION, 7, 0));
public static ItemStack CHRISTMAS_APPLE_CIDER = new CustomPotion("&cApple Cider", 8197, new String[0], new PotionEffect(PotionEffectType.SATURATION, 14, 0));
public static ItemStack CHRISTMAS_COOKIE = new CustomItem(Material.COOKIE, Christmas.color("Christmas Cookie"), 0);
public static ItemStack CHRISTMAS_FRUIT_CAKE = new CustomItem(Material.PUMPKIN_PIE, Christmas.color("Fruit Cake"), 0);
public static ItemStack CHRISTMAS_APPLE_PIE = new CustomItem(Material.PUMPKIN_PIE, "&rApple Pie", 0);
public static ItemStack CHRISTMAS_HOT_CHOCOLATE = new CustomPotion("&6Hot Chocolate", 8201, new String[0], new PotionEffect(PotionEffectType.SATURATION, 14, 0));
public static ItemStack CHRISTMAS_CAKE = new CustomItem(Material.PUMPKIN_PIE, Christmas.color("Christmas Cake"), 0);
public static ItemStack CHRISTMAS_CARAMEL = new CustomItem(Material.BRICKS, "&6Caramel", 0);
public static ItemStack CHRISTMAS_CARAMEL_APPLE = new CustomItem(Material.APPLE, "&6Caramel Apple", 0);
public static ItemStack CHRISTMAS_CHOCOLATE_APPLE = new CustomItem(Material.APPLE, "&6Chocolate Apple", 0);
public static ItemStack CHRISTMAS_PRESENT = new CustomItem(Material.CHEST, Christmas.color("Christmas Present"), 0, new String[] {"&7From: &emrCookieSlime", "&7To: &eYou", "", "&eRight Click&7 to open"});
public static ItemStack CHRISTMAS_MILK = new CustomPotion("&6Glass of Milk", Color.WHITE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "", "&7&oRestores &b&o" + "2.5" + " &7&oHunger");
public static ItemStack CHRISTMAS_CHOCOLATE_MILK = new CustomPotion("&6Chocolate Milk", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 12, 0), "", "&7&oRestores &b&o" + "6.0" + " &7&oHunger");
public static ItemStack CHRISTMAS_EGG_NOG = new CustomPotion("&aEgg Nog", Color.GRAY, new PotionEffect(PotionEffectType.SATURATION, 7, 0), "", "&7&oRestores &b&o" + "3.5" + " &7&oHunger");
public static ItemStack CHRISTMAS_APPLE_CIDER = new CustomPotion("&cApple Cider", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 14, 0), "", "&7&oRestores &b&o" + "7.0" + " &7&oHunger");
public static ItemStack CHRISTMAS_COOKIE = new CustomItem(Material.COOKIE, Christmas.color("Christmas Cookie"));
public static ItemStack CHRISTMAS_FRUIT_CAKE = new CustomItem(Material.PUMPKIN_PIE, Christmas.color("Fruit Cake"));
public static ItemStack CHRISTMAS_APPLE_PIE = new CustomItem(Material.PUMPKIN_PIE, "&rApple Pie");
public static ItemStack CHRISTMAS_HOT_CHOCOLATE = new CustomPotion("&6Hot Chocolate", Color.MAROON, new PotionEffect(PotionEffectType.SATURATION, 14, 0), "", "&7&oRestores &b&o" + "7.0" + " &7&oHunger");
public static ItemStack CHRISTMAS_CAKE = new CustomItem(Material.PUMPKIN_PIE, Christmas.color("Christmas Cake"));
public static ItemStack CHRISTMAS_CARAMEL = new CustomItem(Material.BRICKS, "&6Caramel");
public static ItemStack CHRISTMAS_CARAMEL_APPLE = new CustomItem(Material.APPLE, "&6Caramel Apple");
public static ItemStack CHRISTMAS_CHOCOLATE_APPLE = new CustomItem(Material.APPLE, "&6Chocolate Apple");
public static ItemStack CHRISTMAS_PRESENT = new CustomItem(Material.CHEST, Christmas.color("Christmas Present"), "&7From: &emrCookieSlime", "&7To: &eYou", "", "&eRight Click&7 to open");
/* Easter */
public static ItemStack EASTER_EGG = new CustomItem(Material.EGG, "&rEaster Egg", 0, new String[] {"&bSurprise! Surprise!"});
public static ItemStack EASTER_CARROT_PIE = new CustomItem(Material.PUMPKIN_PIE, "&6Carrot Pie", 0);
public static ItemStack EASTER_EGG = new CustomItem(Material.EGG, "&rEaster Egg", "&bSurprise! Surprise!");
public static ItemStack EASTER_CARROT_PIE = new CustomItem(Material.PUMPKIN_PIE, "&6Carrot Pie");
/* Weapons */
public static ItemStack GRANDMAS_WALKING_STICK = new CustomItem(Material.STICK, "&7Grandmas Walking Stick", 0, new String[0], new String[] {"KNOCKBACK-2"});
public static ItemStack GRANDPAS_WALKING_STICK = new CustomItem(Material.STICK, "&7Grandpas Walking Stick", 0, new String[0], new String[] {"KNOCKBACK-5"});
public static ItemStack SWORD_OF_BEHEADING = new CustomItem(Material.IRON_SWORD, "&6Sword of Beheading", 0, new String[] {"&7Beheading II", "", "&rHas a chance to behead Mobs", "&r(even a higher chance for Wither Skeletons)"});
public static ItemStack SWORD_OF_BEHEADING = new CustomItem(Material.IRON_SWORD, "&6Sword of Beheading", "&7Beheading II", "", "&rHas a chance to behead Mobs", "&r(even a higher chance for Wither Skeletons)");
public static ItemStack BLADE_OF_VAMPIRES = new CustomItem(Material.GOLDEN_SWORD, "&cBlade of Vampires", 0, new String[] {"&7Life Steal I", "", "&rEverytime you attack something", "&ryou have a 45% chance to", "&rrecover 2 Hearts of your Health"}, new String[] {"FIRE_ASPECT-2", "DURABILITY-4", "DAMAGE_ALL-2"});
public static ItemStack SEISMIC_AXE = new CustomItem(Material.IRON_AXE, "&aSeismic Axe", 0, new String[] {"", "&7&oA portable Earthquake...", "", "&7&eRight Click&7 to use"});
public static ItemStack SEISMIC_AXE = new CustomItem(Material.IRON_AXE, "&aSeismic Axe", "", "&7&oA portable Earthquake...", "", "&7&eRight Click&7 to use");
/* Bows */
public static ItemStack EXPLOSIVE_BOW = new CustomItem(Material.BOW, "&cExplosive Bow", 0, new String[] {"&rAny Arrows fired using this Bow", "&rwill launch hit enemys into the air"});
public static ItemStack ICY_BOW = new CustomItem(Material.BOW, "&bIcy Bow", 0, new String[] {"&rAny Arrows fired using this Bow", "&rwill prevent hit enemys from moving", "&rfor 2 seconds"});
public static ItemStack EXPLOSIVE_BOW = new CustomItem(Material.BOW, "&cExplosive Bow", "&rAny Arrows fired using this Bow", "&rwill launch hit enemys into the air");
public static ItemStack ICY_BOW = new CustomItem(Material.BOW, "&bIcy Bow", "&rAny Arrows fired using this Bow", "&rwill prevent hit enemys from moving", "&rfor 2 seconds");
/* Tools */
public static ItemStack AUTO_SMELT_PICKAXE = new CustomItem(Material.DIAMOND_PICKAXE, "&6Smelter's Pickaxe", 0, new String[] {"&c&lAuto-Smelting", "", "&9Works with Fortune"});
public static ItemStack LUMBER_AXE = new CustomItem(Material.DIAMOND_AXE, "&6Lumber Axe", 0, new String[] {"&a&oCuts down the whole Tree..."});
public static ItemStack PICKAXE_OF_CONTAINMENT = new CustomItem(Material.IRON_PICKAXE, "&cPickaxe of Containment", 0, new String[] {"", "&9Can pickup Spawners"});
public static ItemStack AUTO_SMELT_PICKAXE = new CustomItem(Material.DIAMOND_PICKAXE, "&6Smelter's Pickaxe", "&c&lAuto-Smelting", "", "&9Works with Fortune");
public static ItemStack LUMBER_AXE = new CustomItem(Material.DIAMOND_AXE, "&6Lumber Axe", "&a&oCuts down the whole Tree...");
public static ItemStack PICKAXE_OF_CONTAINMENT = new CustomItem(Material.IRON_PICKAXE, "&cPickaxe of Containment", "", "&9Can pickup Spawners");
public static ItemStack HERCULES_PICKAXE = new CustomItem(Material.IRON_PICKAXE, "&9Hercules' Pickaxe", 0, new String[] {"", "&rSo powerful that it", "&rcrushes all mined Ores", "&rinto Dust..."}, new String[] {"DURABILITY-2", "DIG_SPEED-4"});
public static ItemStack EXPLOSIVE_PICKAXE = new CustomItem(Material.DIAMOND_PICKAXE, "&eExplosive Pickaxe", 0, new String[] {"", "&rAllows you to mine a good bit", "&rof Blocks at once...", "", "&9Works with Fortune"});
public static ItemStack PICKAXE_OF_THE_SEEKER = new CustomItem(Material.DIAMOND_PICKAXE, "&aPickaxe of the Seeker", 0, new String[] {"&rWill always point you to the nearest Ore", "&rbut might get damaged when doing it", "", "&7&eRight Click&7 to be pointed to the nearest Ore"});
public static ItemStack COBALT_PICKAXE = new CustomItem(Material.IRON_PICKAXE, "&9Cobalt Pickaxe", 0, new String[] {}, new String[] {"DURABILITY-3", "DIG_SPEED-6"});
public static ItemStack PICKAXE_OF_VEIN_MINING = new CustomItem(Material.DIAMOND_PICKAXE, "&ePickaxe of Vein Mining", 0, new String[] {"", "&rThis Pickaxe will dig out", "&rwhole Veins of Ores..."});
public static ItemStack EXPLOSIVE_PICKAXE = new CustomItem(Material.DIAMOND_PICKAXE, "&eExplosive Pickaxe", "", "&rAllows you to mine a good bit", "&rof Blocks at once...", "", "&9Works with Fortune");
public static ItemStack PICKAXE_OF_THE_SEEKER = new CustomItem(Material.DIAMOND_PICKAXE, "&aPickaxe of the Seeker", "&rWill always point you to the nearest Ore", "&rbut might get damaged when doing it", "", "&7&eRight Click&7 to be pointed to the nearest Ore");
public static ItemStack COBALT_PICKAXE = new CustomItem(Material.IRON_PICKAXE, "&9Cobalt Pickaxe", 0, new String[0], new String[] {"DURABILITY-3", "DIG_SPEED-6"});
public static ItemStack PICKAXE_OF_VEIN_MINING = new CustomItem(Material.DIAMOND_PICKAXE, "&ePickaxe of Vein Mining", "", "&rThis Pickaxe will dig out", "&rwhole Veins of Ores...");
/* Armor */
public static ItemStack GLOWSTONE_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&e&lGlowstone Helmet", 0, new String[] {"", "&a&oShining like the sun!", "", "&9+ Night Vision"}), Color.YELLOW);
public static ItemStack GLOWSTONE_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&e&lGlowstone Chestplate", 0, new String[] {"", "&a&oShining like the sun!", "", "&9+ Night Vision"}), Color.YELLOW);
public static ItemStack GLOWSTONE_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&e&lGlowstone Leggings", 0, new String[] {"", "&a&oShining like the sun!", "", "&9+ Night Vision"}), Color.YELLOW);
public static ItemStack GLOWSTONE_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&e&lGlowstone Boots", 0, new String[] {"", "&a&oShining like the sun!", "", "&9+ Night Vision"}), Color.YELLOW);
public static ItemStack ENDER_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&5&lEnder Helmet", 0, new String[] {"", "&a&oSometimes its here, sometimes there!"}), Color.fromRGB(28, 25, 112));
public static ItemStack ENDER_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&5&lEnder Chestplate", 0, new String[] {"", "&a&oSometimes its here, sometimes there!"}), Color.fromRGB(28, 25, 112));
public static ItemStack ENDER_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&5&lEnder Leggings", 0, new String[] {"", "&a&oSometimes its here, sometimes there!"}), Color.fromRGB(28, 25, 112));
public static ItemStack ENDER_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&5&lEnder Boots", 0, new String[] {"", "&a&oSometimes its here, sometimes there!", "" , "&9+ No Enderpearl Damage"}), Color.fromRGB(28, 25, 112));
public static ItemStack SLIME_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&a&lSlime Helmet", 0, new String[] {"", "&a&oBouncy Feeling"}), Color.LIME);
public static ItemStack SLIME_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&a&lSlime Chestplate", 0, new String[] {"", "&a&oBouncy Feeling"}), Color.LIME);
public static ItemStack SLIME_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&a&lSlime Leggings", 0, new String[] {"", "&a&oBouncy Feeling", "", "&9+ Speed"}), Color.LIME);
public static ItemStack SLIME_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&a&lSlime Boots", 0, new String[] {"", "&a&oBouncy Feeling", "", "&9+ Jump Boost", "&9+ No Fall Damage"}), Color.LIME);
public static ItemStack GLOWSTONE_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&e&lGlowstone Helmet", "", "&a&oShining like the sun!", "", "&9+ Night Vision"), Color.YELLOW);
public static ItemStack GLOWSTONE_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&e&lGlowstone Chestplate", "", "&a&oShining like the sun!", "", "&9+ Night Vision"), Color.YELLOW);
public static ItemStack GLOWSTONE_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&e&lGlowstone Leggings", "", "&a&oShining like the sun!", "", "&9+ Night Vision"), Color.YELLOW);
public static ItemStack GLOWSTONE_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&e&lGlowstone Boots", "", "&a&oShining like the sun!", "", "&9+ Night Vision"), Color.YELLOW);
public static ItemStack ENDER_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&5&lEnder Helmet", "", "&a&oSometimes its here, sometimes there!"), Color.fromRGB(28, 25, 112));
public static ItemStack ENDER_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&5&lEnder Chestplate", "", "&a&oSometimes its here, sometimes there!"), Color.fromRGB(28, 25, 112));
public static ItemStack ENDER_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&5&lEnder Leggings", "", "&a&oSometimes its here, sometimes there!"), Color.fromRGB(28, 25, 112));
public static ItemStack ENDER_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&5&lEnder Boots", "", "&a&oSometimes its here, sometimes there!", "" , "&9+ No Enderpearl Damage"), Color.fromRGB(28, 25, 112));
public static ItemStack SLIME_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&a&lSlime Helmet", "", "&a&oBouncy Feeling"), Color.LIME);
public static ItemStack SLIME_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&a&lSlime Chestplate", "", "&a&oBouncy Feeling"), Color.LIME);
public static ItemStack SLIME_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&a&lSlime Leggings", "", "&a&oBouncy Feeling", "", "&9+ Speed"), Color.LIME);
public static ItemStack SLIME_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&a&lSlime Boots", "", "&a&oBouncy Feeling", "", "&9+ Jump Boost", "&9+ No Fall Damage"), Color.LIME);
public static ItemStack CACTUS_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&2Cactus Helmet", 0, new String[0], new String[] {"THORNS-3", "DURABILITY-5"}), Color.GREEN);
public static ItemStack CACTUS_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&2Cactus Chestplate", 0, new String[0], new String[] {"THORNS-3", "DURABILITY-5"}), Color.GREEN);
public static ItemStack CACTUS_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&2Cactus Leggings", 0, new String[0], new String[] {"THORNS-3", "DURABILITY-5"}), Color.GREEN);
@ -166,10 +164,10 @@ public class SlimefunItems {
public static ItemStack REINFORCED_ALLOY_CHESTPLATE = new CustomItem(Material.IRON_CHESTPLATE, "&bReinforced Chestplate", new String[] {"DURABILITY-9", "PROTECTION_ENVIRONMENTAL-9"}, 0);
public static ItemStack REINFORCED_ALLOY_LEGGINGS = new CustomItem(Material.IRON_LEGGINGS, "&bReinforced Leggings", new String[] {"DURABILITY-9", "PROTECTION_ENVIRONMENTAL-9"}, 0);
public static ItemStack REINFORCED_ALLOY_BOOTS = new CustomItem(Material.IRON_BOOTS, "&bReinforced Boots", new String[] {"DURABILITY-9", "PROTECTION_ENVIRONMENTAL-9"}, 0);
public static ItemStack SCUBA_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&cScuba Helmet", 0, new String[] {"", "&bAllows you to breathe Underwater", "&4&oPart of Hazmat Suit"}), Color.ORANGE);
public static ItemStack HAZMATSUIT_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&cHazmat Suit", 0, new String[] {"", "&bAllows you to walk through Fire", "&4&oPart of Hazmat Suit"}), Color.ORANGE);
public static ItemStack HAZMATSUIT_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&cHazmat Suit Leggings", 0, new String[] {"", "&4&oPart of Hazmat Suit"}), Color.ORANGE);
public static ItemStack RUBBER_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&cRubber Boots", 0, new String[] {"", "&4&oPart of Hazmat Suit"}), Color.BLACK);
public static ItemStack SCUBA_HELMET = new CustomArmor(new CustomItem(Material.LEATHER_HELMET, "&cScuba Helmet", "", "&bAllows you to breathe Underwater", "&4&oPart of Hazmat Suit"), Color.ORANGE);
public static ItemStack HAZMATSUIT_CHESTPLATE = new CustomArmor(new CustomItem(Material.LEATHER_CHESTPLATE, "&cHazmat Suit", "", "&bAllows you to walk through Fire", "&4&oPart of Hazmat Suit"), Color.ORANGE);
public static ItemStack HAZMATSUIT_LEGGINGS = new CustomArmor(new CustomItem(Material.LEATHER_LEGGINGS, "&cHazmat Suit Leggings", "", "&4&oPart of Hazmat Suit"), Color.ORANGE);
public static ItemStack RUBBER_BOOTS = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&cRubber Boots", "", "&4&oPart of Hazmat Suit"), Color.BLACK);
public static ItemStack GILDED_IRON_HELMET = new CustomItem(Material.GOLDEN_HELMET, "&6Gilded Iron Helmet", new String[] {"DURABILITY-6", "PROTECTION_ENVIRONMENTAL-8"}, 0);
public static ItemStack GILDED_IRON_CHESTPLATE = new CustomItem(Material.GOLDEN_CHESTPLATE, "&6Gilded Iron Chestplate", new String[] {"DURABILITY-6", "PROTECTION_ENVIRONMENTAL-8"}, 0);
public static ItemStack GILDED_IRON_LEGGINGS = new CustomItem(Material.GOLDEN_LEGGINGS, "&6Gilded Iron Leggings", new String[] {"DURABILITY-6", "PROTECTION_ENVIRONMENTAL-8"}, 0);
@ -182,152 +180,152 @@ public class SlimefunItems {
public static ItemStack SLIME_CHESTPLATE_STEEL = new CustomItem(Material.IRON_CHESTPLATE, "&a&lSlime Chestplate", 0, new String[] {"&7&oReinforced", "", "&a&oBouncy Feeling"}, new String[] {"DURABILITY-4", "PROTECTION_ENVIRONMENTAL-2"});
public static ItemStack SLIME_LEGGINGS_STEEL = new CustomItem(Material.IRON_LEGGINGS, "&a&lSlime Leggings", 0, new String[] {"&7&oReinforced", "", "&a&oBouncy Feeling", "", "&9+ Speed"}, new String[] {"DURABILITY-4", "PROTECTION_ENVIRONMENTAL-2"});
public static ItemStack SLIME_BOOTS_STEEL = new CustomItem(Material.IRON_BOOTS, "&a&lSlime Boots", 0, new String[] {"&7&oReinforced", "", "&a&oBouncy Feeling", "", "&9+ Jump Boost", "&9+ No Fall Damage"}, new String[] {"DURABILITY-4", "PROTECTION_ENVIRONMENTAL-2"});
public static ItemStack BOOTS_OF_THE_STOMPER = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&bBoots of the Stomper", 0, new String[] {"", "&9All Fall Damage you receive", "&9will be applied to nearby Mobs/Players", "", "&9+ No Fall Damage"}), Color.AQUA);
public static ItemStack BOOTS_OF_THE_STOMPER = new CustomArmor(new CustomItem(Material.LEATHER_BOOTS, "&bBoots of the Stomper", "", "&9All Fall Damage you receive", "&9will be applied to nearby Mobs/Players", "", "&9+ No Fall Damage"), Color.AQUA);
public static ItemStack HEAVY_METAL_HELMET = new CustomItem(Material.IRON_HELMET, "&cHeavy Helmet", 0, new String[] {"", "&9+ Strength", "&9+ Slowness"}, new String[] {"DURABILITY-10", "PROTECTION_ENVIRONMENTAL-10"});
public static ItemStack HEAVY_METAL_CHESTPLATE = new CustomItem(Material.IRON_CHESTPLATE, "&cHeavy Chestplate", 0, new String[] {"", "&9+ Strength", "&9+ Slowness"}, new String[] {"DURABILITY-10", "PROTECTION_ENVIRONMENTAL-10"});
public static ItemStack HEAVY_METAL_LEGGINGS = new CustomItem(Material.IRON_LEGGINGS, "&cHeavy Leggings", 0, new String[] {"", "&9+ Strength", "&9+ Slowness"}, new String[] {"DURABILITY-10", "PROTECTION_ENVIRONMENTAL-10"});
public static ItemStack HEAVY_METAL_BOOTS = new CustomItem(Material.IRON_BOOTS, "&cHeavy Boots", 0, new String[] {"", "&9+ Strength", "&9+ Slowness"}, new String[] {"DURABILITY-10", "PROTECTION_ENVIRONMENTAL-10"});
/* Misc */
public static ItemStack MAGIC_LUMP_1 = new CustomItem(Material.GOLD_NUGGET, "&6Magical Lump &7- &eI", 0, new String[] {"", "&c&oTier: I"});
public static ItemStack MAGIC_LUMP_2 = new CustomItem(Material.GOLD_NUGGET, "&6Magical Lump &7- &eII", 0, new String[] {"", "&c&oTier: II"});
public static ItemStack MAGIC_LUMP_3 = new CustomItem(Material.GOLD_NUGGET, "&6Magical Lump &7- &eIII", 0, new String[] {"", "&c&oTier: III"});
public static ItemStack ENDER_LUMP_1 = new CustomItem(Material.GOLD_NUGGET, "&5Ender Lump &7- &eI", 0, new String[] {"", "&c&oTier: I"});
public static ItemStack ENDER_LUMP_2 = new CustomItem(Material.GOLD_NUGGET, "&5Ender Lump &7- &eII", 0, new String[] {"", "&c&oTier: II"});
public static ItemStack ENDER_LUMP_3 = new CustomItem(Material.GOLD_NUGGET, "&5Ender Lump &7- &eIII", 0, new String[] {"", "&c&oTier: III"});
public static ItemStack MAGICAL_BOOK_COVER = new CustomItem(Material.PAPER, "&6Magical Book Cover", 0, new String[] {"", "&a&oUsed for various Magic Books"});
public static ItemStack BASIC_CIRCUIT_BOARD = new CustomItem(Material.ACTIVATOR_RAIL, "&bBasic Circuit Board", 0);
public static ItemStack ADVANCED_CIRCUIT_BOARD = new CustomItem(Material.POWERED_RAIL, "&bAdvanced Circuit Board", 0);
public static ItemStack WHEAT_FLOUR = new CustomItem(Material.SUGAR, "&rWheat Flour", 0);
public static ItemStack STEEL_PLATE = new CustomItem(Material.PAPER, "&7&lSteel Plate", 0);
public static ItemStack MAGIC_LUMP_1 = new CustomItem(Material.GOLD_NUGGET, "&6Magical Lump &7- &eI", "", "&c&oTier: I");
public static ItemStack MAGIC_LUMP_2 = new CustomItem(Material.GOLD_NUGGET, "&6Magical Lump &7- &eII", "", "&c&oTier: II");
public static ItemStack MAGIC_LUMP_3 = new CustomItem(Material.GOLD_NUGGET, "&6Magical Lump &7- &eIII", "", "&c&oTier: III");
public static ItemStack ENDER_LUMP_1 = new CustomItem(Material.GOLD_NUGGET, "&5Ender Lump &7- &eI", "", "&c&oTier: I");
public static ItemStack ENDER_LUMP_2 = new CustomItem(Material.GOLD_NUGGET, "&5Ender Lump &7- &eII", "", "&c&oTier: II");
public static ItemStack ENDER_LUMP_3 = new CustomItem(Material.GOLD_NUGGET, "&5Ender Lump &7- &eIII", "", "&c&oTier: III");
public static ItemStack MAGICAL_BOOK_COVER = new CustomItem(Material.PAPER, "&6Magical Book Cover", "", "&a&oUsed for various Magic Books");
public static ItemStack BASIC_CIRCUIT_BOARD = new CustomItem(Material.ACTIVATOR_RAIL, "&bBasic Circuit Board");
public static ItemStack ADVANCED_CIRCUIT_BOARD = new CustomItem(Material.POWERED_RAIL, "&bAdvanced Circuit Board");
public static ItemStack WHEAT_FLOUR = new CustomItem(Material.SUGAR, "&rWheat Flour");
public static ItemStack STEEL_PLATE = new CustomItem(Material.PAPER, "&7&lSteel Plate");
public static ItemStack COMPRESSED_CARBON = null;
public static ItemStack BATTERY = null;
public static ItemStack CARBON_CHUNK = null;
public static ItemStack STEEL_THRUSTER = new CustomItem(Material.BUCKET, "&7&lSteel Thruster", 0);
public static ItemStack STEEL_THRUSTER = new CustomItem(Material.BUCKET, "&7&lSteel Thruster");
public static ItemStack POWER_CRYSTAL = null;
public static ItemStack CHAIN = new CustomItem(Material.STRING, "&bChain", 0);
public static ItemStack HOOK = new CustomItem(Material.FLINT, "&bHook", 0);
public static ItemStack SIFTED_ORE = new CustomItem(Material.GUNPOWDER, "&6Sifted Ore", 0);
public static ItemStack CHAIN = new CustomItem(Material.STRING, "&bChain");
public static ItemStack HOOK = new CustomItem(Material.FLINT, "&bHook");
public static ItemStack SIFTED_ORE = new CustomItem(Material.GUNPOWDER, "&6Sifted Ore");
public static ItemStack STONE_CHUNK = null;
public static ItemStack LAVA_CRYSTAL = null;
public static ItemStack SALT = new CustomItem(Material.SUGAR, "&rSalt", 0);
public static ItemStack SALT = new CustomItem(Material.SUGAR, "&rSalt");
public static ItemStack BUTTER = null;
public static ItemStack CHEESE = null;
public static ItemStack HEAVY_CREAM = new CustomItem(Material.SNOWBALL, "&rHeavy Cream", 0);
public static ItemStack CRUSHED_ORE = new CustomItem(Material.GUNPOWDER, "&6Crushed Ore", 0);
public static ItemStack PULVERIZED_ORE = new CustomItem(Material.GUNPOWDER, "&6Pulverized Ore", 0);
public static ItemStack PURE_ORE_CLUSTER = new CustomItem(Material.GUNPOWDER, "&6Pure Ore Cluster", 0);
public static ItemStack HEAVY_CREAM = new CustomItem(Material.SNOWBALL, "&rHeavy Cream");
public static ItemStack CRUSHED_ORE = new CustomItem(Material.GUNPOWDER, "&6Crushed Ore");
public static ItemStack PULVERIZED_ORE = new CustomItem(Material.GUNPOWDER, "&6Pulverized Ore");
public static ItemStack PURE_ORE_CLUSTER = new CustomItem(Material.GUNPOWDER, "&6Pure Ore Cluster");
public static ItemStack TINY_URANIUM = null;
public static ItemStack SMALL_URANIUM = null;
public static ItemStack MAGNET = null;
public static ItemStack NECROTIC_SKULL = new CustomItem(new ItemStack(Material.WITHER_SKELETON_SKULL), "&cNecrotic Skull");
public static ItemStack ESSENCE_OF_AFTERLIFE = new CustomItem(Material.GUNPOWDER, "&4Essence of Afterlife", 0);
public static ItemStack NECROTIC_SKULL = new CustomItem(Material.WITHER_SKELETON_SKULL, "&cNecrotic Skull");
public static ItemStack ESSENCE_OF_AFTERLIFE = new CustomItem(Material.GUNPOWDER, "&4Essence of Afterlife");
public static ItemStack ELECTRO_MAGNET = null;
public static ItemStack HEATING_COIL = null;
public static ItemStack COOLING_UNIT = null;
public static ItemStack ELECTRIC_MOTOR = null;
public static ItemStack CARGO_MOTOR = null;
public static ItemStack SCROLL_OF_DIMENSIONAL_TELEPOSITION = new CustomItem(Material.PAPER, "&6Scroll of Dimensional Teleposition", 0, new String[] {"", "&cThis Scroll is capable of creating", "&ca temporary black Hole which pulls", "&cnearby Entities into itself and sends", "&cthem into another Dimension where", "&ceverything is turned around", "", "&rIn other words: Makes Entities turn by 180 Degrees"});
public static ItemStack TOME_OF_KNOWLEDGE_SHARING = new CustomItem(Material.BOOK, "&6Tome of Knowledge Sharing", 0, new String[] {"&7Owner: &bNone", "", "&eRight Click&7 to bind this Tome to yourself", "", "", "&eRight Click&7 to obtain all Researches by", "&7the previously assigned Owner"});
public static ItemStack HARDENED_GLASS = new CustomItem(new ItemStack(Material.LIGHT_GRAY_STAINED_GLASS), "&7Hardened Glass", "", "&rWithstands Explosions");
public static ItemStack WITHER_PROOF_OBSIDIAN = new CustomItem(Material.OBSIDIAN, "&5Wither-Proof Obsidian", 0, new String[] {"", "&rWithstands Explosions", "&rWithstands Wither Bosses"});
public static ItemStack WITHER_PROOF_GLASS = new CustomItem(new ItemStack(Material.PURPLE_STAINED_GLASS), "&5Wither-Proof Glass", "", "&rWithstands Explosions", "&rWithstands Wither Bosses");
public static ItemStack REINFORCED_PLATE = new CustomItem(Material.PAPER, "&7Reinforced Plate", 0);
public static ItemStack ANCIENT_PEDESTAL = new CustomItem(Material.DISPENSER, "&dAncient Pedestal", 0, new String[] {"", "&5Part of the Ancient Altar"});
public static ItemStack ANCIENT_ALTAR = new CustomItem(Material.ENCHANTING_TABLE, "&dAncient Altar", 0, new String[] {"", "&5Multi-Block Altar for", "&5magical Crafting Processes"});
public static ItemStack SCROLL_OF_DIMENSIONAL_TELEPOSITION = new CustomItem(Material.PAPER, "&6Scroll of Dimensional Teleposition", "", "&cThis Scroll is capable of creating", "&ca temporary black Hole which pulls", "&cnearby Entities into itself and sends", "&cthem into another Dimension where", "&ceverything is turned around", "", "&rIn other words: Makes Entities turn by 180 Degrees");
public static ItemStack TOME_OF_KNOWLEDGE_SHARING = new CustomItem(Material.BOOK, "&6Tome of Knowledge Sharing", "&7Owner: &bNone", "", "&eRight Click&7 to bind this Tome to yourself", "", "", "&eRight Click&7 to obtain all Researches by", "&7the previously assigned Owner");
public static ItemStack HARDENED_GLASS = new CustomItem(Material.LIGHT_GRAY_STAINED_GLASS, "&7Hardened Glass", "", "&rWithstands Explosions");
public static ItemStack WITHER_PROOF_OBSIDIAN = new CustomItem(Material.OBSIDIAN, "&5Wither-Proof Obsidian", "", "&rWithstands Explosions", "&rWithstands Wither Bosses");
public static ItemStack WITHER_PROOF_GLASS = new CustomItem(Material.PURPLE_STAINED_GLASS, "&5Wither-Proof Glass", "", "&rWithstands Explosions", "&rWithstands Wither Bosses");
public static ItemStack REINFORCED_PLATE = new CustomItem(Material.PAPER, "&7Reinforced Plate");
public static ItemStack ANCIENT_PEDESTAL = new CustomItem(Material.DISPENSER, "&dAncient Pedestal", "", "&5Part of the Ancient Altar");
public static ItemStack ANCIENT_ALTAR = new CustomItem(Material.ENCHANTING_TABLE, "&dAncient Altar", "", "&5Multi-Block Altar for", "&5magical Crafting Processes");
public static ItemStack DUCT_TAPE = null;
public static ItemStack RAINBOW_WOOL = new CustomItem(new ItemStack(Material.WHITE_WOOL), "&5Rainbow Wool", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_GLASS = new CustomItem(new ItemStack(Material.WHITE_STAINED_GLASS), "&5Rainbow Glass", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_CLAY = new CustomItem(new ItemStack(Material.WHITE_TERRACOTTA), "&5Rainbow Clay", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_GLASS_PANE = new CustomItem(new ItemStack(Material.WHITE_STAINED_GLASS_PANE), "&5Rainbow Glass Pane", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_WOOL = new CustomItem(Material.WHITE_WOOL, "&5Rainbow Wool", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_GLASS = new CustomItem(Material.WHITE_STAINED_GLASS, "&5Rainbow Glass", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_CLAY = new CustomItem(Material.WHITE_TERRACOTTA, "&5Rainbow Clay", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_GLASS_PANE = new CustomItem(Material.WHITE_STAINED_GLASS_PANE, "&5Rainbow Glass Pane", "", "&dCycles through all Colors of the Rainbow!");
public static ItemStack RAINBOW_WOOL_XMAS = new CustomItem(new ItemStack(Material.WHITE_WOOL), "&5Rainbow Wool &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_GLASS_XMAS = new CustomItem(new ItemStack(Material.WHITE_STAINED_GLASS), "&5Rainbow Glass &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_CLAY_XMAS = new CustomItem(new ItemStack(Material.WHITE_TERRACOTTA), "&5Rainbow Clay &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_GLASS_PANE_XMAS = new CustomItem(new ItemStack(Material.WHITE_STAINED_GLASS_PANE), "&5Rainbow Glass Pane &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_WOOL_XMAS = new CustomItem(Material.WHITE_WOOL, "&5Rainbow Wool &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_GLASS_XMAS = new CustomItem(Material.WHITE_STAINED_GLASS, "&5Rainbow Glass &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_CLAY_XMAS = new CustomItem(Material.WHITE_TERRACOTTA, "&5Rainbow Clay &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_GLASS_PANE_XMAS = new CustomItem(Material.WHITE_STAINED_GLASS_PANE, "&5Rainbow Glass Pane &7(Christmas)", "", Christmas.color("< Christmas Edition >"));
public static ItemStack RAINBOW_WOOL_VALENTINE = new CustomItem(new ItemStack(Material.PINK_WOOL), "&5Rainbow Wool &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_GLASS_VALENTINE = new CustomItem(new ItemStack(Material.PINK_STAINED_GLASS), "&5Rainbow Glass &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_CLAY_VALENTINE = new CustomItem(new ItemStack(Material.PINK_TERRACOTTA), "&5Rainbow Clay &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_GLASS_PANE_VALENTINE = new CustomItem(new ItemStack(Material.PINK_STAINED_GLASS_PANE), "&5Rainbow Glass Pane &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_WOOL_VALENTINE = new CustomItem(Material.PINK_WOOL, "&5Rainbow Wool &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_GLASS_VALENTINE = new CustomItem(Material.PINK_STAINED_GLASS, "&5Rainbow Glass &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_CLAY_VALENTINE = new CustomItem(Material.PINK_TERRACOTTA, "&5Rainbow Clay &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
public static ItemStack RAINBOW_GLASS_PANE_VALENTINE = new CustomItem(Material.PINK_STAINED_GLASS_PANE, "&5Rainbow Glass Pane &7(Valentine's Day)", "", "&d< Valentine's Day Edition >");
/* Ingots */
public static ItemStack COPPER_INGOT = new CustomItem(Material.BRICK, "&bCopper Ingot", 0, new String[0]);
public static ItemStack TIN_INGOT = new CustomItem(Material.IRON_INGOT, "&bTin Ingot", 0, new String[0]);
public static ItemStack SILVER_INGOT = new CustomItem(Material.IRON_INGOT, "&bSilver Ingot", 0, new String[0]);
public static ItemStack ALUMINUM_INGOT = new CustomItem(Material.IRON_INGOT, "&bAluminum Ingot", 0, new String[0]);
public static ItemStack LEAD_INGOT = new CustomItem(Material.IRON_INGOT, "&bLead Ingot", 0, new String[0]);
public static ItemStack ZINC_INGOT = new CustomItem(Material.IRON_INGOT, "&bZinc Ingot", 0, new String[0]);
public static ItemStack MAGNESIUM_INGOT = new CustomItem(Material.IRON_INGOT, "&bMagnesium Ingot", 0, new String[0]);
public static ItemStack COPPER_INGOT = new CustomItem(Material.BRICK, "&bCopper Ingot");
public static ItemStack TIN_INGOT = new CustomItem(Material.IRON_INGOT, "&bTin Ingot");
public static ItemStack SILVER_INGOT = new CustomItem(Material.IRON_INGOT, "&bSilver Ingot");
public static ItemStack ALUMINUM_INGOT = new CustomItem(Material.IRON_INGOT, "&bAluminum Ingot");
public static ItemStack LEAD_INGOT = new CustomItem(Material.IRON_INGOT, "&bLead Ingot");
public static ItemStack ZINC_INGOT = new CustomItem(Material.IRON_INGOT, "&bZinc Ingot");
public static ItemStack MAGNESIUM_INGOT = new CustomItem(Material.IRON_INGOT, "&bMagnesium Ingot");
/* Alloy (Carbon + Iron) */
public static ItemStack STEEL_INGOT = new CustomItem(Material.IRON_INGOT, "&bSteel Ingot", 0, new String[0]);
public static ItemStack STEEL_INGOT = new CustomItem(Material.IRON_INGOT, "&bSteel Ingot");
/* Alloy (Copper + Tin) */
public static ItemStack BRONZE_INGOT = new CustomItem(Material.BRICK, "&bBronze Ingot", 0, new String[0]);
public static ItemStack BRONZE_INGOT = new CustomItem(Material.BRICK, "&bBronze Ingot");
/* Alloy (Copper + Aluminum) */
public static ItemStack DURALUMIN_INGOT = new CustomItem(Material.IRON_INGOT, "&bDuralumin Ingot", 0, new String[0]);
public static ItemStack DURALUMIN_INGOT = new CustomItem(Material.IRON_INGOT, "&bDuralumin Ingot");
/* Alloy (Copper + Silver) */
public static ItemStack BILLON_INGOT = new CustomItem(Material.IRON_INGOT, "&bBillon Ingot", 0, new String[0]);
public static ItemStack BILLON_INGOT = new CustomItem(Material.IRON_INGOT, "&bBillon Ingot");
/* Alloy (Copper + Zinc) */
public static ItemStack BRASS_INGOT = new CustomItem(Material.GOLD_INGOT, "&bBrass Ingot", 0, new String[0]);
public static ItemStack BRASS_INGOT = new CustomItem(Material.GOLD_INGOT, "&bBrass Ingot");
/* Alloy (Aluminum + Brass) */
public static ItemStack ALUMINUM_BRASS_INGOT = new CustomItem(Material.GOLD_INGOT, "&bAluminum Brass Ingot", 0, new String[0]);
public static ItemStack ALUMINUM_BRASS_INGOT = new CustomItem(Material.GOLD_INGOT, "&bAluminum Brass Ingot");
/* Alloy (Aluminum + Bronze) */
public static ItemStack ALUMINUM_BRONZE_INGOT = new CustomItem(Material.GOLD_INGOT, "&bAluminum Bronze Ingot", 0, new String[0]);
public static ItemStack ALUMINUM_BRONZE_INGOT = new CustomItem(Material.GOLD_INGOT, "&bAluminum Bronze Ingot");
/* Alloy (Gold + Silver + Copper) */
public static ItemStack CORINTHIAN_BRONZE_INGOT = new CustomItem(Material.GOLD_INGOT, "&bCorinthian Bronze Ingot", 0, new String[0]);
public static ItemStack CORINTHIAN_BRONZE_INGOT = new CustomItem(Material.GOLD_INGOT, "&bCorinthian Bronze Ingot");
/* Alloy (Lead + Tin) */
public static ItemStack SOLDER_INGOT = new CustomItem(Material.IRON_INGOT, "&bSolder Ingot", 0, new String[0]);
public static ItemStack SOLDER_INGOT = new CustomItem(Material.IRON_INGOT, "&bSolder Ingot");
/* Alloy (Steel + Iron + Carbon) */
public static ItemStack DAMASCUS_STEEL_INGOT = new CustomItem(Material.IRON_INGOT, "&bDamascus Steel Ingot", 0, new String[0]);
public static ItemStack DAMASCUS_STEEL_INGOT = new CustomItem(Material.IRON_INGOT, "&bDamascus Steel Ingot");
/* Alloy (Damascus Steel + Duralumin + Compressed Carbon + Aluminium Bronze) */
public static ItemStack HARDENED_METAL_INGOT = new CustomItem(Material.IRON_INGOT, "&b&lHardened Metal", 0);
public static ItemStack HARDENED_METAL_INGOT = new CustomItem(Material.IRON_INGOT, "&b&lHardened Metal");
/* Alloy (Hardened Metal + Corinthian Bronze + Solder + Billon + Damascus Steel) */
public static ItemStack REINFORCED_ALLOY_INGOT = new CustomItem(Material.IRON_INGOT, "&b&lReinforced Alloy Ingot", 0);
public static ItemStack REINFORCED_ALLOY_INGOT = new CustomItem(Material.IRON_INGOT, "&b&lReinforced Alloy Ingot");
/* Alloy (Iron + Silicon) */
public static ItemStack FERROSILICON = new CustomItem(Material.IRON_INGOT, "&bFerrosilicon" , 0);
public static ItemStack FERROSILICON = new CustomItem(Material.IRON_INGOT, "&bFerrosilicon");
/* Alloy (Iron + Gold) */
public static ItemStack GILDED_IRON = new CustomItem(Material.GOLD_INGOT, "&6&lGilded Iron", 0);
public static ItemStack GILDED_IRON = new CustomItem(Material.GOLD_INGOT, "&6&lGilded Iron");
/* Alloy (Redston + Ferrosilicon) */
public static ItemStack REDSTONE_ALLOY = new CustomItem(Material.BRICK, "&cRedstone Alloy Ingot", 0);
public static ItemStack REDSTONE_ALLOY = new CustomItem(Material.BRICK, "&cRedstone Alloy Ingot");
/* Alloy (Iron + Copper) */
public static ItemStack NICKEL_INGOT = new CustomItem(Material.IRON_INGOT, "&bNickel Ingot" , 0);
public static ItemStack NICKEL_INGOT = new CustomItem(Material.IRON_INGOT, "&bNickel Ingot");
/* Alloy (Nickel + Iron + Copper) */
public static ItemStack COBALT_INGOT = new CustomItem(Material.IRON_INGOT, "&9Cobalt Ingot" , 0);
public static ItemStack COBALT_INGOT = new CustomItem(Material.IRON_INGOT, "&9Cobalt Ingot");
/* Gold */
public static ItemStack GOLD_4K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(4-Carat)", 0);
public static ItemStack GOLD_6K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(6-Carat)", 0);
public static ItemStack GOLD_8K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(8-Carat)", 0);
public static ItemStack GOLD_10K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(10-Carat)", 0);
public static ItemStack GOLD_12K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(12-Carat)", 0);
public static ItemStack GOLD_14K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(14-Carat)", 0);
public static ItemStack GOLD_16K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(16-Carat)", 0);
public static ItemStack GOLD_18K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(18-Carat)", 0);
public static ItemStack GOLD_20K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(20-Carat)", 0);
public static ItemStack GOLD_22K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(22-Carat)", 0);
public static ItemStack GOLD_24K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(24-Carat)", 0);
public static ItemStack GOLD_4K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(4-Carat)");
public static ItemStack GOLD_6K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(6-Carat)");
public static ItemStack GOLD_8K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(8-Carat)");
public static ItemStack GOLD_10K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(10-Carat)");
public static ItemStack GOLD_12K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(12-Carat)");
public static ItemStack GOLD_14K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(14-Carat)");
public static ItemStack GOLD_16K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(16-Carat)");
public static ItemStack GOLD_18K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(18-Carat)");
public static ItemStack GOLD_20K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(20-Carat)");
public static ItemStack GOLD_22K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(22-Carat)");
public static ItemStack GOLD_24K = new CustomItem(Material.GOLD_INGOT, "&rGold Ingot &7(24-Carat)");
/* Dusts */
public static ItemStack IRON_DUST = new CustomItem(Material.GUNPOWDER, "&6Iron Dust", 0);
public static ItemStack GOLD_DUST = new CustomItem(Material.GLOWSTONE_DUST, "&6Gold Dust", 0);
public static ItemStack TIN_DUST = new CustomItem(Material.SUGAR, "&6Tin Dust", 0);
public static ItemStack COPPER_DUST = new CustomItem(Material.GLOWSTONE_DUST, "&6Copper Dust", 0);
public static ItemStack SILVER_DUST = new CustomItem(Material.SUGAR, "&6Silver Dust", 0);
public static ItemStack ALUMINUM_DUST = new CustomItem(Material.SUGAR, "&6Aluminum Dust", 0);
public static ItemStack LEAD_DUST = new CustomItem(Material.GUNPOWDER, "&6Lead Dust", 0);
public static ItemStack SULFATE = new CustomItem(Material.GLOWSTONE_DUST, "&6Sulfate", 0);
public static ItemStack ZINC_DUST = new CustomItem(Material.SUGAR, "&6Zinc Dust", 0);
public static ItemStack MAGNESIUM_DUST = new CustomItem(Material.SUGAR, "&6Magnesium", 0);
public static ItemStack IRON_DUST = new CustomItem(Material.GUNPOWDER, "&6Iron Dust");
public static ItemStack GOLD_DUST = new CustomItem(Material.GLOWSTONE_DUST, "&6Gold Dust");
public static ItemStack TIN_DUST = new CustomItem(Material.SUGAR, "&6Tin Dust");
public static ItemStack COPPER_DUST = new CustomItem(Material.GLOWSTONE_DUST, "&6Copper Dust");
public static ItemStack SILVER_DUST = new CustomItem(Material.SUGAR, "&6Silver Dust");
public static ItemStack ALUMINUM_DUST = new CustomItem(Material.SUGAR, "&6Aluminum Dust");
public static ItemStack LEAD_DUST = new CustomItem(Material.GUNPOWDER, "&6Lead Dust");
public static ItemStack SULFATE = new CustomItem(Material.GLOWSTONE_DUST, "&6Sulfate");
public static ItemStack ZINC_DUST = new CustomItem(Material.SUGAR, "&6Zinc Dust");
public static ItemStack MAGNESIUM_DUST = new CustomItem(Material.SUGAR, "&6Magnesium");
public static ItemStack CARBON = null;
public static ItemStack SILICON = new CustomItem(Material.FIREWORK_STAR, "&6Silicon", 0);
public static ItemStack GOLD_24K_BLOCK = new CustomItem(Material.GOLD_BLOCK, "&rGold Block &7(24-Carat)", 0);
public static ItemStack SILICON = new CustomItem(Material.FIREWORK_STAR, "&6Silicon");
public static ItemStack GOLD_24K_BLOCK = new CustomItem(Material.GOLD_BLOCK, "&rGold Block &7(24-Carat)");
/* Gems */
public static ItemStack SYNTHETIC_DIAMOND = new CustomItem(Material.DIAMOND, "&bSynthetic Diamond", 0);
public static ItemStack SYNTHETIC_EMERALD = new CustomItem(Material.EMERALD, "&bSynthetic Emerald", 0);
public static ItemStack SYNTHETIC_SAPPHIRE;
public static ItemStack SYNTHETIC_DIAMOND = new CustomItem(Material.DIAMOND, "&bSynthetic Diamond");
public static ItemStack SYNTHETIC_EMERALD = new CustomItem(Material.EMERALD, "&bSynthetic Emerald");
public static ItemStack SYNTHETIC_SAPPHIRE = null;
public static ItemStack CARBONADO = null;
public static ItemStack RAW_CARBONADO = null;
public static ItemStack URANIUM = null;
@ -336,80 +334,80 @@ public class SlimefunItems {
public static ItemStack BOOSTED_URANIUM = null;
/* Talisman */
public static ItemStack TALISMAN = new CustomItem(Material.EMERALD, "&6Common Talisman", 0);
public static ItemStack TALISMAN_ANVIL = new CustomItem(Material.EMERALD, "&aTalisman of the Anvil", 0, new String[] {"", "&rEach Talisman can prevent", "&r1 Tool from breaking, but will then", "&rbe consumed", "", "&4&lWARNING:", "&4This Talisman does not work on", "&4Tools which are too powerful", "&4due to their complexity"});
public static ItemStack TALISMAN_MINER = new CustomItem(Material.EMERALD, "&aTalisman of the Miner", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it has", "&ra 20% chance of doubling", "&rall Ores you mine"});
public static ItemStack TALISMAN_HUNTER = new CustomItem(Material.EMERALD, "&aTalisman of the Hunter", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it has", "&ra 20% chance of doubling", "&rall Drops from Mobs you kill"});
public static ItemStack TALISMAN_LAVA = new CustomItem(Material.EMERALD, "&aTalisman of the Lava Walker", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you Fire Resistance", "&ras soon as you touch Lava", "&rbut will then be consumed"});
public static ItemStack TALISMAN_WATER = new CustomItem(Material.EMERALD, "&aTalisman of the Water Breather", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you the ability", "&rto breath underwater as", "&rsoon as you start drowning", "&rbut will then be consumed"});
public static ItemStack TALISMAN_ANGEL = new CustomItem(Material.EMERALD, "&aTalisman of the Angel", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it has a", "&r75% chance to prevent you", "&rfrom taking Fall Damage"});
public static ItemStack TALISMAN_FIRE = new CustomItem(Material.EMERALD, "&aTalisman of the Firefighter", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you Fire Resistance", "&ras soon as you start burning", "&rbut will then be consumed"});
public static ItemStack TALISMAN_MAGICIAN = new CustomItem(Material.EMERALD, "&aTalisman of the Magician", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 80% Luck Bonus on Enchanting", "&rYou will sometimes get an Extra Enchantment"});
public static ItemStack TALISMAN_TRAVELLER = new CustomItem(Material.EMERALD, "&aTalisman of the Traveller", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 60% Chance for a decent", "&rSpeed Buff when you start sprinting"});
public static ItemStack TALISMAN_WARRIOR = new CustomItem(Material.EMERALD, "&aTalisman of the Warrior", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou Strength III whenever you get hit", "&rbut will then be consumed"});
public static ItemStack TALISMAN_KNIGHT = new CustomItem(Material.EMERALD, "&aTalisman of the Knight", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 30% Chance for 5 Seconds of Regeneration", "&rwhenever You get hit", "&rbut will then be consumed"});
public static ItemStack TALISMAN_WHIRLWIND = new CustomItem(Material.EMERALD, "&aTalisman of the Whirlwind", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it will reflect", "&r60% of all Projectiles fired at you"});
public static ItemStack TALISMAN_WIZARD = new CustomItem(Material.EMERALD, "&aTalisman of the Wizard", 0, new String[] {"", "&rWhile you have this Talisman", "&rin your Inventory it allows you to", "&robtain Fortune Level 4/5 however", "&rit also has a chance to lower the", "&rLevel of some Enchantments on your Item"});
public static ItemStack TALISMAN = new CustomItem(Material.EMERALD, "&6Common Talisman");
public static ItemStack TALISMAN_ANVIL = new CustomItem(Material.EMERALD, "&aTalisman of the Anvil", "", "&rEach Talisman can prevent", "&r1 Tool from breaking, but will then", "&rbe consumed", "", "&4&lWARNING:", "&4This Talisman does not work on", "&4Tools which are too powerful", "&4due to their complexity");
public static ItemStack TALISMAN_MINER = new CustomItem(Material.EMERALD, "&aTalisman of the Miner", "", "&rWhile you have this Talisman", "&rin your Inventory it has", "&ra 20% chance of doubling", "&rall Ores you mine");
public static ItemStack TALISMAN_HUNTER = new CustomItem(Material.EMERALD, "&aTalisman of the Hunter", "", "&rWhile you have this Talisman", "&rin your Inventory it has", "&ra 20% chance of doubling", "&rall Drops from Mobs you kill");
public static ItemStack TALISMAN_LAVA = new CustomItem(Material.EMERALD, "&aTalisman of the Lava Walker", "", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you Fire Resistance", "&ras soon as you touch Lava", "&rbut will then be consumed");
public static ItemStack TALISMAN_WATER = new CustomItem(Material.EMERALD, "&aTalisman of the Water Breather", "", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you the ability", "&rto breath underwater as", "&rsoon as you start drowning", "&rbut will then be consumed");
public static ItemStack TALISMAN_ANGEL = new CustomItem(Material.EMERALD, "&aTalisman of the Angel", "", "&rWhile you have this Talisman", "&rin your Inventory it has a", "&r75% chance to prevent you", "&rfrom taking Fall Damage");
public static ItemStack TALISMAN_FIRE = new CustomItem(Material.EMERALD, "&aTalisman of the Firefighter", "", "&rWhile you have this Talisman", "&rin your Inventory it will", "&rgive you Fire Resistance", "&ras soon as you start burning", "&rbut will then be consumed");
public static ItemStack TALISMAN_MAGICIAN = new CustomItem(Material.EMERALD, "&aTalisman of the Magician", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 80% Luck Bonus on Enchanting", "&rYou will sometimes get an Extra Enchantment");
public static ItemStack TALISMAN_TRAVELLER = new CustomItem(Material.EMERALD, "&aTalisman of the Traveller", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 60% Chance for a decent", "&rSpeed Buff when you start sprinting");
public static ItemStack TALISMAN_WARRIOR = new CustomItem(Material.EMERALD, "&aTalisman of the Warrior", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou Strength III whenever you get hit", "&rbut will then be consumed");
public static ItemStack TALISMAN_KNIGHT = new CustomItem(Material.EMERALD, "&aTalisman of the Knight", "", "&rWhile you have this Talisman", "&rin your Inventory it gives", "&ryou a 30% Chance for 5 Seconds of Regeneration", "&rwhenever You get hit", "&rbut will then be consumed");
public static ItemStack TALISMAN_WHIRLWIND = new CustomItem(Material.EMERALD, "&aTalisman of the Whirlwind", "", "&rWhile you have this Talisman", "&rin your Inventory it will reflect", "&r60% of all Projectiles fired at you");
public static ItemStack TALISMAN_WIZARD = new CustomItem(Material.EMERALD, "&aTalisman of the Wizard", "", "&rWhile you have this Talisman", "&rin your Inventory it allows you to", "&robtain Fortune Level 4/5 however", "&rit also has a chance to lower the", "&rLevel of some Enchantments on your Item");
/* Staves */
public static ItemStack STAFF_ELEMENTAL = new CustomItem(Material.STICK, "&6Elemental Staff", 0);
public static ItemStack STAFF_ELEMENTAL = new CustomItem(Material.STICK, "&6Elemental Staff");
public static ItemStack STAFF_WIND = new CustomItem(Material.STICK, "&6Elemental Staff &7- &b&oWind", 0, new String[] {"", "&7Element: &b&oWind", "", "&7&eRight Click&7 to launch yourself forward"}, new String[] {"LUCK-1"});
public static ItemStack STAFF_FIRE = new CustomItem(Material.STICK, "&6Elemental Staff &7- &c&oFire", 0, new String[] {"", "&7Element: &c&oFire"}, new String[] {"FIRE_ASPECT-5"});
public static ItemStack STAFF_WATER = new CustomItem(Material.STICK, "&6Elemental Staff &7- &1&oWater", 0, new String[] {"", "&7Element: &1&oWater", "", "&7&eRight Click&7 to extinguish yourself"}, new String[] {"WATER_WORKER-1"});
/* Machines */
public static ItemStack GRIND_STONE = new CustomItem(Material.DISPENSER, "&bGrind Stone", 0, new String[] {"", "&a&oGrinds Items for more Efficiency"});
public static ItemStack ARMOR_FORGE = new CustomItem(Material.ANVIL, "&6Armor Forge", 0, new String[] {"", "&a&oGives you the Ability to create powerful Armor"});
public static ItemStack SMELTERY = new CustomItem(Material.FURNACE, "&6Smeltery", 0, new String[] {"", "&a&oActs as a high-temperature Furnace for Metals"});
public static ItemStack IGNITION_CHAMBER = new CustomItem(new ItemStack(Material.HOPPER), "&4Automatic Ignition Chamber", "&rPrevents the Smeltery from using up fire.", "&rRequires Flint and Steel", "&rMust be placed adjacent to the Smeltery's dispenser");
public static ItemStack ORE_CRUSHER = new CustomItem(Material.DISPENSER, "&bOre Crusher", 0, new String[] {"", "&a&oCrushes Ores to double them"});
public static ItemStack COMPRESSOR = new CustomItem(Material.PISTON, "&bCompressor", 0, new String[] {"", "&a&oCompresses Items"});
public static ItemStack PRESSURE_CHAMBER = new CustomItem(Material.GLASS, "&bPressure Chamber", 0, new String[] {"", "&a&oCompresses Items even more"});
public static ItemStack MAGIC_WORKBENCH = new CustomItem(Material.CRAFTING_TABLE, "&6Magic Workbench", 0, new String[] {"Infuses Items with magical Energy"});
public static ItemStack ORE_WASHER = new CustomItem(Material.CAULDRON, "&6Ore Washer", 0, new String[] {"", "&a&oWashes Sifted Ore to filter Ores", "&a&oand gives you small Stone Chunks"});
public static ItemStack SAW_MILL = new CustomItem(Material.IRON_BARS, "&6Saw Mill", 0, new String[] {"", "&a&oAllows you to get 8 planks from 1 Log"});
public static ItemStack COMPOSTER = new CustomItem(Material.CAULDRON, "&aComposter", 0, new String[] {"", "&a&oCan convert various Materials over Time..."});
public static ItemStack ENHANCED_CRAFTING_TABLE = new CustomItem(Material.CRAFTING_TABLE, "&eEnhanced Crafting Table", 0, new String[] {"", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."});
public static ItemStack CRUCIBLE = new CustomItem(Material.CAULDRON, "&cCrucible", 0, new String[] {"", "&a&oUsed to smelt Items into Liquids"});
public static ItemStack JUICER = new CustomItem(Material.GLASS_BOTTLE, "&aJuicer", 0, new String[] {"", "&a&oAllows you to create delicious Juice"});
public static ItemStack GRIND_STONE = new CustomItem(Material.DISPENSER, "&bGrind Stone", "", "&a&oGrinds Items for more Efficiency");
public static ItemStack ARMOR_FORGE = new CustomItem(Material.ANVIL, "&6Armor Forge", "", "&a&oGives you the Ability to create powerful Armor");
public static ItemStack SMELTERY = new CustomItem(Material.FURNACE, "&6Smeltery", "", "&a&oActs as a high-temperature Furnace for Metals");
public static ItemStack IGNITION_CHAMBER = new CustomItem(Material.HOPPER, "&4Automatic Ignition Chamber", "&rPrevents the Smeltery from using up fire.", "&rRequires Flint and Steel", "&rMust be placed adjacent to the Smeltery's dispenser");
public static ItemStack ORE_CRUSHER = new CustomItem(Material.DISPENSER, "&bOre Crusher", "", "&a&oCrushes Ores to double them");
public static ItemStack COMPRESSOR = new CustomItem(Material.PISTON, "&bCompressor", "", "&a&oCompresses Items");
public static ItemStack PRESSURE_CHAMBER = new CustomItem(Material.GLASS, "&bPressure Chamber", "", "&a&oCompresses Items even more");
public static ItemStack MAGIC_WORKBENCH = new CustomItem(Material.CRAFTING_TABLE, "&6Magic Workbench", "Infuses Items with magical Energy");
public static ItemStack ORE_WASHER = new CustomItem(Material.CAULDRON, "&6Ore Washer", "", "&a&oWashes Sifted Ore to filter Ores", "&a&oand gives you small Stone Chunks");
public static ItemStack SAW_MILL = new CustomItem(Material.IRON_BARS, "&6Saw Mill", "", "&a&oAllows you to get 8 planks from 1 Log");
public static ItemStack COMPOSTER = new CustomItem(Material.CAULDRON, "&aComposter", "", "&a&oCan convert various Materials over Time...");
public static ItemStack ENHANCED_CRAFTING_TABLE = new CustomItem(Material.CRAFTING_TABLE, "&eEnhanced Crafting Table", "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power...");
public static ItemStack CRUCIBLE = new CustomItem(Material.CAULDRON, "&cCrucible", "", "&a&oUsed to smelt Items into Liquids");
public static ItemStack JUICER = new CustomItem(Material.GLASS_BOTTLE, "&aJuicer", "", "&a&oAllows you to create delicious Juice");
public static ItemStack SOLAR_PANEL = new CustomItem(Material.DAYLIGHT_DETECTOR, "&bSolar Panel", 0, new String[] {"", "&a&oTransforms Sunlight to Energy"});
public static ItemStack SOLAR_ARRAY = new CustomItem(Material.DAYLIGHT_DETECTOR, "&bSolar Array", 0, new String[] {"", "&a&oTransforms Sunlight to Energy"});
public static ItemStack DIGITAL_MINER = new CustomItem(Material.IRON_PICKAXE, "&bDigital Miner", 0, new String[] {"", "&a&oDigs out everything!"});
public static ItemStack ADVANCED_DIGITAL_MINER = new CustomItem(Material.DIAMOND_PICKAXE, "&6Advanced Digital Miner", 0, new String[] {"", "&a&oDigs out everything!", "&a&oAutomatically crushes your Ores"});
public static ItemStack AUTOMATED_PANNING_MACHINE = new CustomItem(Material.BOWL, "&aAutomated Panning Machine", 0, new String[] {"", "&a&oA MultiBlock Version of the Gold Pan"});
public static ItemStack SOLAR_PANEL = new CustomItem(Material.DAYLIGHT_DETECTOR, "&bSolar Panel", "", "&a&oTransforms Sunlight to Energy");
public static ItemStack SOLAR_ARRAY = new CustomItem(Material.DAYLIGHT_DETECTOR, "&bSolar Array", "", "&a&oTransforms Sunlight to Energy");
public static ItemStack DIGITAL_MINER = new CustomItem(Material.IRON_PICKAXE, "&bDigital Miner", "", "&a&oDigs out everything!");
public static ItemStack ADVANCED_DIGITAL_MINER = new CustomItem(Material.DIAMOND_PICKAXE, "&6Advanced Digital Miner", "", "&a&oDigs out everything!", "&a&oAutomatically crushes your Ores");
public static ItemStack AUTOMATED_PANNING_MACHINE = new CustomItem(Material.BOWL, "&aAutomated Panning Machine", "", "&a&oA MultiBlock Version of the Gold Pan");
public static ItemStack HOLOGRAM_PROJECTOR = new CustomItem(new MaterialData(Material.QUARTZ_SLAB), "&bHologram Projector", "", "&rProjects an Editable Hologram");
public static ItemStack HOLOGRAM_PROJECTOR = new CustomItem(Material.QUARTZ_SLAB, "&bHologram Projector", "", "&rProjects an Editable Hologram");
/* Enhanced Furnaces */
public static ItemStack ENHANCED_FURNACE = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eI", 0, new String[] {"", "&7Processing Speed: &e1x", "&7Fuel Efficiency: &e1x", "&7Luck Multiplier: &e1x"});
public static ItemStack ENHANCED_FURNACE_2 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eII", 0, new String[] {"", "&7Processing Speed: &e2x", "&7Fuel Efficiency: &e1x", "&7Luck Multiplier: &e1x"});
public static ItemStack ENHANCED_FURNACE_3 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eIII", 0, new String[] {"", "&7Processing Speed: &e2x", "&7Fuel Efficiency: &e2x", "&7Luck Multiplier: &e1x"});
public static ItemStack ENHANCED_FURNACE_4 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eIV", 0, new String[] {"", "&7Processing Speed: &e3x", "&7Fuel Efficiency: &e2x", "&7Luck Multiplier: &e1x"});
public static ItemStack ENHANCED_FURNACE_5 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eV", 0, new String[] {"", "&7Processing Speed: &e3x", "&7Fuel Efficiency: &e2x", "&7Luck Multiplier: &e2x"});
public static ItemStack ENHANCED_FURNACE_6 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eVI", 0, new String[] {"", "&7Processing Speed: &e3x", "&7Fuel Efficiency: &e3x", "&7Luck Multiplier: &e2x"});
public static ItemStack ENHANCED_FURNACE_7 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eVII", 0, new String[] {"", "&7Processing Speed: &e4x", "&7Fuel Efficiency: &e3x", "&7Luck Multiplier: &e2x"});
public static ItemStack ENHANCED_FURNACE_8 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eVIII", 0, new String[] {"", "&7Processing Speed: &e4x", "&7Fuel Efficiency: &e4x", "&7Luck Multiplier: &e2x"});
public static ItemStack ENHANCED_FURNACE_9 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eIX", 0, new String[] {"", "&7Processing Speed: &e5x", "&7Fuel Efficiency: &e4x", "&7Luck Multiplier: &e2x"});
public static ItemStack ENHANCED_FURNACE_10 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eX", 0, new String[] {"", "&7Processing Speed: &e5x", "&7Fuel Efficiency: &e5x", "&7Luck Multiplier: &e2x"});
public static ItemStack ENHANCED_FURNACE_11 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eXI", 0, new String[] {"", "&7Processing Speed: &e5x", "&7Fuel Efficiency: &e5x", "&7Luck Multiplier: &e3x"});
public static ItemStack REINFORCED_FURNACE = new CustomItem(Material.FURNACE, "&7Reinforced Furnace", 0, new String[] {"", "&7Processing Speed: &e10x", "&7Fuel Efficiency: &e10x", "&7Luck Multiplier: &e3x"});
public static ItemStack CARBONADO_EDGED_FURNACE = new CustomItem(Material.FURNACE, "&7Carbonado Edged Furnace", 0, new String[] {"", "&7Processing Speed: &e20x", "&7Fuel Efficiency: &e10x", "&7Luck Multiplier: &e3x"});
public static ItemStack ENHANCED_FURNACE = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eI", "", "&7Processing Speed: &e1x", "&7Fuel Efficiency: &e1x", "&7Luck Multiplier: &e1x");
public static ItemStack ENHANCED_FURNACE_2 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eII", "", "&7Processing Speed: &e2x", "&7Fuel Efficiency: &e1x", "&7Luck Multiplier: &e1x");
public static ItemStack ENHANCED_FURNACE_3 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eIII", "", "&7Processing Speed: &e2x", "&7Fuel Efficiency: &e2x", "&7Luck Multiplier: &e1x");
public static ItemStack ENHANCED_FURNACE_4 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eIV", "", "&7Processing Speed: &e3x", "&7Fuel Efficiency: &e2x", "&7Luck Multiplier: &e1x");
public static ItemStack ENHANCED_FURNACE_5 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eV", "", "&7Processing Speed: &e3x", "&7Fuel Efficiency: &e2x", "&7Luck Multiplier: &e2x");
public static ItemStack ENHANCED_FURNACE_6 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eVI", "", "&7Processing Speed: &e3x", "&7Fuel Efficiency: &e3x", "&7Luck Multiplier: &e2x");
public static ItemStack ENHANCED_FURNACE_7 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eVII", "", "&7Processing Speed: &e4x", "&7Fuel Efficiency: &e3x", "&7Luck Multiplier: &e2x");
public static ItemStack ENHANCED_FURNACE_8 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eVIII", "", "&7Processing Speed: &e4x", "&7Fuel Efficiency: &e4x", "&7Luck Multiplier: &e2x");
public static ItemStack ENHANCED_FURNACE_9 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eIX", "", "&7Processing Speed: &e5x", "&7Fuel Efficiency: &e4x", "&7Luck Multiplier: &e2x");
public static ItemStack ENHANCED_FURNACE_10 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eX", "", "&7Processing Speed: &e5x", "&7Fuel Efficiency: &e5x", "&7Luck Multiplier: &e2x");
public static ItemStack ENHANCED_FURNACE_11 = new CustomItem(Material.FURNACE, "&7Enhanced Furnace - &eXI", "", "&7Processing Speed: &e5x", "&7Fuel Efficiency: &e5x", "&7Luck Multiplier: &e3x");
public static ItemStack REINFORCED_FURNACE = new CustomItem(Material.FURNACE, "&7Reinforced Furnace", "", "&7Processing Speed: &e10x", "&7Fuel Efficiency: &e10x", "&7Luck Multiplier: &e3x");
public static ItemStack CARBONADO_EDGED_FURNACE = new CustomItem(Material.FURNACE, "&7Carbonado Edged Furnace", "", "&7Processing Speed: &e20x", "&7Fuel Efficiency: &e10x", "&7Luck Multiplier: &e3x");
public static ItemStack BLOCK_PLACER = new CustomItem(Material.DISPENSER, "&aBlock Placer", 0, new String[] {"", "&rAll Blocks in this Dispenser", "&rwill automatically get placed"});
public static ItemStack BLOCK_PLACER = new CustomItem(Material.DISPENSER, "&aBlock Placer", "", "&rAll Blocks in this Dispenser", "&rwill automatically get placed");
/* Soulbound Items */
public static ItemStack SOULBOUND_SWORD = new CustomItem(Material.DIAMOND_SWORD, "&cSoulbound Sword", 0);
public static ItemStack SOULBOUND_BOW = new CustomItem(Material.BOW, "&cSoulbound Bow", 0);
public static ItemStack SOULBOUND_PICKAXE = new CustomItem(Material.DIAMOND_PICKAXE, "&cSoulbound Pickaxe", 0);
public static ItemStack SOULBOUND_AXE = new CustomItem(Material.DIAMOND_AXE, "&cSoulbound Axe", 0);
public static ItemStack SOULBOUND_SHOVEL = new CustomItem(Material.DIAMOND_SHOVEL, "&cSoulbound Shovel", 0);
public static ItemStack SOULBOUND_HOE = new CustomItem(Material.DIAMOND_HOE, "&cSoulbound Hoe", 0);
public static ItemStack SOULBOUND_SWORD = new CustomItem(Material.DIAMOND_SWORD, "&cSoulbound Sword");
public static ItemStack SOULBOUND_BOW = new CustomItem(Material.BOW, "&cSoulbound Bow");
public static ItemStack SOULBOUND_PICKAXE = new CustomItem(Material.DIAMOND_PICKAXE, "&cSoulbound Pickaxe");
public static ItemStack SOULBOUND_AXE = new CustomItem(Material.DIAMOND_AXE, "&cSoulbound Axe");
public static ItemStack SOULBOUND_SHOVEL = new CustomItem(Material.DIAMOND_SHOVEL, "&cSoulbound Shovel");
public static ItemStack SOULBOUND_HOE = new CustomItem(Material.DIAMOND_HOE, "&cSoulbound Hoe");
public static ItemStack SOULBOUND_HELMET = new CustomItem(Material.DIAMOND_HELMET, "&cSoulbound Helmet", 0);
public static ItemStack SOULBOUND_CHESTPLATE = new CustomItem(Material.DIAMOND_CHESTPLATE, "&cSoulbound Chestplate", 0);
public static ItemStack SOULBOUND_LEGGINGS = new CustomItem(Material.DIAMOND_LEGGINGS, "&cSoulbound Leggings", 0);
public static ItemStack SOULBOUND_BOOTS = new CustomItem(Material.DIAMOND_BOOTS, "&cSoulbound Boots", 0);
public static ItemStack SOULBOUND_HELMET = new CustomItem(Material.DIAMOND_HELMET, "&cSoulbound Helmet");
public static ItemStack SOULBOUND_CHESTPLATE = new CustomItem(Material.DIAMOND_CHESTPLATE, "&cSoulbound Chestplate");
public static ItemStack SOULBOUND_LEGGINGS = new CustomItem(Material.DIAMOND_LEGGINGS, "&cSoulbound Leggings");
public static ItemStack SOULBOUND_BOOTS = new CustomItem(Material.DIAMOND_BOOTS, "&cSoulbound Boots");
/* Runes */
public static ItemStack BLANK_RUNE = null;
@ -472,28 +470,28 @@ public class SlimefunItems {
}
/* Electricity */
public static ItemStack SOLAR_GENERATOR = new CustomItem(new ItemStack(Material.DAYLIGHT_DETECTOR), "&bSolar Generator", "", "&eBasic Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &74 J/s");
public static ItemStack SOLAR_GENERATOR_2 = new CustomItem(new ItemStack(Material.DAYLIGHT_DETECTOR), "&cAdvanced Solar Generator", "", "&aMedium Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &716 J/s");
public static ItemStack SOLAR_GENERATOR_3 = new CustomItem(new ItemStack(Material.DAYLIGHT_DETECTOR), "&4Carbonado Solar Generator", "", "&4End-Game Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &764 J/s");
public static ItemStack SOLAR_GENERATOR_4 = new CustomItem(new ItemStack(Material.DAYLIGHT_DETECTOR), "&eEnergized Solar Generator", "", "&9Works at Night", "", "&4End-Game Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &7256 J/s (Day)", "&8\u21E8 &e\u26A1 &7128 J/s (Night)");
public static ItemStack SOLAR_GENERATOR = new CustomItem(Material.DAYLIGHT_DETECTOR, "&bSolar Generator", "", "&eBasic Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &74 J/s");
public static ItemStack SOLAR_GENERATOR_2 = new CustomItem(Material.DAYLIGHT_DETECTOR, "&cAdvanced Solar Generator", "", "&aMedium Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &716 J/s");
public static ItemStack SOLAR_GENERATOR_3 = new CustomItem(Material.DAYLIGHT_DETECTOR, "&4Carbonado Solar Generator", "", "&4End-Game Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &764 J/s");
public static ItemStack SOLAR_GENERATOR_4 = new CustomItem(Material.DAYLIGHT_DETECTOR, "&eEnergized Solar Generator", "", "&9Works at Night", "", "&4End-Game Generator", "&8\u21E8 &e\u26A1 &70 J Buffer", "&8\u21E8 &e\u26A1 &7256 J/s (Day)", "&8\u21E8 &e\u26A1 &7128 J/s (Night)");
public static ItemStack COAL_GENERATOR = null;
public static ItemStack LAVA_GENERATOR = null;
public static ItemStack ELECTRIC_FURNACE = new CustomItem(new ItemStack(Material.FURNACE), "&cElectric Furnace", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &74 J/s");
public static ItemStack ELECTRIC_FURNACE_2 = new CustomItem(new ItemStack(Material.FURNACE), "&cElectric Furnace &7- &eII", "", "&aMedium Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &76 J/s");
public static ItemStack ELECTRIC_FURNACE_3 = new CustomItem(new ItemStack(Material.FURNACE), "&cElectric Furnace &7- &eIII", "", "&aMedium Machine", "&8\u21E8 &7Speed: 4x", "&8\u21E8 &e\u26A1 &710 J/s");
public static ItemStack ELECTRIC_FURNACE = new CustomItem(Material.FURNACE, "&cElectric Furnace", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &74 J/s");
public static ItemStack ELECTRIC_FURNACE_2 = new CustomItem(Material.FURNACE, "&cElectric Furnace &7- &eII", "", "&aMedium Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &76 J/s");
public static ItemStack ELECTRIC_FURNACE_3 = new CustomItem(Material.FURNACE, "&cElectric Furnace &7- &eIII", "", "&aMedium Machine", "&8\u21E8 &7Speed: 4x", "&8\u21E8 &e\u26A1 &710 J/s");
public static ItemStack ELECTRIC_ORE_GRINDER = new CustomItem(new ItemStack(Material.FURNACE), "&cElectric Ore Grinder", "","&rWorks as an Ore Crusher and Grind Stone", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &712 J/s");
public static ItemStack ELECTRIC_ORE_GRINDER_2 = new CustomItem(new ItemStack(Material.FURNACE), "&cElectric Ore Grinder &7(&eII&7)", "","&rWorks as an Ore Crusher and Grind Stone", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 4x", "&8\u21E8 &e\u26A1 &730 J/s");
public static ItemStack ELECTRIC_INGOT_PULVERIZER = new CustomItem(new ItemStack(Material.FURNACE), "&cElectric Ingot Pulverizer", "", "&rPulverizes Ingots into Dust", "", "&aMedium Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack AUTO_ENCHANTER = new CustomItem(new ItemStack(Material.ENCHANTING_TABLE), "&5Auto Enchanter", "", "&aMedium Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &718 J/s");
public static ItemStack AUTO_DISENCHANTER = new CustomItem(new ItemStack(Material.ENCHANTING_TABLE), "&5Auto Disenchanter", "", "&aMedium Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &718 J/s");
public static ItemStack AUTO_ANVIL = new CustomItem(new ItemStack(Material.IRON_BLOCK), "&7Auto Anvil", "", "&6Advanced Machine", "&8\u21E8 &7Repair Factor: 10%", "&8\u21E8 &e\u26A1 &724 J/s");
public static ItemStack AUTO_ANVIL_2 = new CustomItem(new ItemStack(Material.IRON_BLOCK), "&7Auto Anvil Mk.II", "", "&4End-Game Machine", "&8\u21E8 &7Repair Factor: 25%", "&8\u21E8 &e\u26A1 &732 J/s");
public static ItemStack ELECTRIC_ORE_GRINDER = new CustomItem(Material.FURNACE, "&cElectric Ore Grinder", "","&rWorks as an Ore Crusher and Grind Stone", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &712 J/s");
public static ItemStack ELECTRIC_ORE_GRINDER_2 = new CustomItem(Material.FURNACE, "&cElectric Ore Grinder &7(&eII&7)", "","&rWorks as an Ore Crusher and Grind Stone", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 4x", "&8\u21E8 &e\u26A1 &730 J/s");
public static ItemStack ELECTRIC_INGOT_PULVERIZER = new CustomItem(Material.FURNACE, "&cElectric Ingot Pulverizer", "", "&rPulverizes Ingots into Dust", "", "&aMedium Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack AUTO_ENCHANTER = new CustomItem(Material.ENCHANTING_TABLE, "&5Auto Enchanter", "", "&aMedium Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &718 J/s");
public static ItemStack AUTO_DISENCHANTER = new CustomItem(Material.ENCHANTING_TABLE, "&5Auto Disenchanter", "", "&aMedium Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &718 J/s");
public static ItemStack AUTO_ANVIL = new CustomItem(Material.IRON_BLOCK, "&7Auto Anvil", "", "&6Advanced Machine", "&8\u21E8 &7Repair Factor: 10%", "&8\u21E8 &e\u26A1 &724 J/s");
public static ItemStack AUTO_ANVIL_2 = new CustomItem(Material.IRON_BLOCK, "&7Auto Anvil Mk.II", "", "&4End-Game Machine", "&8\u21E8 &7Repair Factor: 25%", "&8\u21E8 &e\u26A1 &732 J/s");
public static ItemStack BIO_REACTOR = new CustomItem(new MaterialData(Material.LIME_TERRACOTTA), "&2Bio Reactor", "", "&6Average Generator", "&8\u21E8 &e\u26A1 &7128 J Buffer", "&8\u21E8 &e\u26A1 &78 J/s");
public static ItemStack MULTIMETER = new CustomItem(new MaterialData(Material.CLOCK), "&eMultimeter", "", "&rMeasures the Amount of stored", "&rEnergy in a Block");
public static ItemStack BIO_REACTOR = new CustomItem(Material.LIME_TERRACOTTA, "&2Bio Reactor", "", "&6Average Generator", "&8\u21E8 &e\u26A1 &7128 J Buffer", "&8\u21E8 &e\u26A1 &78 J/s");
public static ItemStack MULTIMETER = new CustomItem(Material.CLOCK, "&eMultimeter", "", "&rMeasures the Amount of stored", "&rEnergy in a Block");
public static ItemStack SMALL_CAPACITOR = null, MEDIUM_CAPACITOR = null, BIG_CAPACITOR = null, LARGE_CAPACITOR = null, CARBONADO_EDGED_CAPACITOR = null;
/* Robots */
@ -520,57 +518,57 @@ public class SlimefunItems {
public static ItemStack GPS_TRANSMITTER_4 = null;
public static ItemStack GPS_CONTROL_PANEL = null;
public static ItemStack GPS_MARKER_TOOL = new CustomItem(new MaterialData(Material.REDSTONE_TORCH), "&bGPS Marker Tool", "", "&rAllows you to set a Waypoint at", "&rthe Location you place this");
public static ItemStack GPS_MARKER_TOOL = new CustomItem(Material.REDSTONE_TORCH, "&bGPS Marker Tool", "", "&rAllows you to set a Waypoint at", "&rthe Location you place this");
public static ItemStack GPS_EMERGENCY_TRANSMITTER = null;
public static ItemStack GPS_GEO_SCANNER = null;
public static ItemStack ANDROID_INTERFACE_FUEL = new CustomItem(new ItemStack(Material.DISPENSER), "&7Android Interface &c(Fuel)", "", "&rItems stored in this Interface", "&rwill be inserted into an Android's Fuel Slot", "&rwhen its Script tells them to do so");
public static ItemStack ANDROID_INTERFACE_ITEMS = new CustomItem(new ItemStack(Material.DISPENSER), "&7Android Interface &9(Items)", "", "&rItems stored in an Android's Inventory", "&rwill be inserted into this Interface", "&rwhen its Script tells them to do so");
public static ItemStack ANDROID_INTERFACE_FUEL = new CustomItem(Material.DISPENSER, "&7Android Interface &c(Fuel)", "", "&rItems stored in this Interface", "&rwill be inserted into an Android's Fuel Slot", "&rwhen its Script tells them to do so");
public static ItemStack ANDROID_INTERFACE_ITEMS = new CustomItem(Material.DISPENSER, "&7Android Interface &9(Items)", "", "&rItems stored in an Android's Inventory", "&rwill be inserted into this Interface", "&rwhen its Script tells them to do so");
public static ItemStack BUCKET_OF_OIL = null;
public static ItemStack BUCKET_OF_FUEL = null;
public static ItemStack OIL_PUMP = null;
public static ItemStack REFINERY = new CustomItem(new ItemStack(Material.PISTON), "&cRefinery", "", "&rRefines Oil to create Fuel");
public static ItemStack REFINERY = new CustomItem(Material.PISTON, "&cRefinery", "", "&rRefines Oil to create Fuel");
public static ItemStack COMBUSTION_REACTOR = null;
public static ItemStack ANDROID_MEMORY_CORE = null;
public static ItemStack GPS_TELEPORTER_PYLON = new CustomItem(new MaterialData(Material.PURPLE_STAINED_GLASS), "&5GPS Teleporter Pylon", "", "&7Teleporter Component");
public static ItemStack GPS_TELEPORTATION_MATRIX = new CustomItem(new MaterialData(Material.IRON_BLOCK), "&bGPS Teleporter Matrix", "", "&rThis is your Teleporter's Main Component", "&rThis Matrix allows Players to choose from all", "&rWaypoints made by the Player who has placed", "&rthis Device.");
public static ItemStack GPS_ACTIVATION_DEVICE_SHARED = new CustomItem(new MaterialData(Material.STONE_PRESSURE_PLATE), "&rGPS Activation Device &3(Shared)", "", "&rPlace this onto a Teleportation Matrix", "&rand step onto this Plate to activate", "&rthe Teleportation Process");
public static ItemStack GPS_ACTIVATION_DEVICE_PERSONAL = new CustomItem(new MaterialData(Material.STONE_PRESSURE_PLATE), "&rGPS Activation Device &a(Personal)", "", "&rPlace this onto a Teleportation Matrix", "&rand step onto this Plate to activate", "&rthe Teleportation Process", "", "&rThis Version only allows the Person who", "&rplaced this Device to use it");
public static ItemStack GPS_TELEPORTER_PYLON = new CustomItem(Material.PURPLE_STAINED_GLASS, "&5GPS Teleporter Pylon", "", "&7Teleporter Component");
public static ItemStack GPS_TELEPORTATION_MATRIX = new CustomItem(Material.IRON_BLOCK, "&bGPS Teleporter Matrix", "", "&rThis is your Teleporter's Main Component", "&rThis Matrix allows Players to choose from all", "&rWaypoints made by the Player who has placed", "&rthis Device.");
public static ItemStack GPS_ACTIVATION_DEVICE_SHARED = new CustomItem(Material.STONE_PRESSURE_PLATE, "&rGPS Activation Device &3(Shared)", "", "&rPlace this onto a Teleportation Matrix", "&rand step onto this Plate to activate", "&rthe Teleportation Process");
public static ItemStack GPS_ACTIVATION_DEVICE_PERSONAL = new CustomItem(Material.STONE_PRESSURE_PLATE, "&rGPS Activation Device &a(Personal)", "", "&rPlace this onto a Teleportation Matrix", "&rand step onto this Plate to activate", "&rthe Teleportation Process", "", "&rThis Version only allows the Person who", "&rplaced this Device to use it");
public static ItemStack ELEVATOR = new CustomItem(new MaterialData(Material.STONE_PRESSURE_PLATE), "&bElevator Plate", "", "&rPlace an Elevator Plate on every floor", "&rand you will be able to teleport between them.", "", "&eRight Click this Block &7to name it");
public static ItemStack ELEVATOR = new CustomItem(Material.STONE_PRESSURE_PLATE, "&bElevator Plate", "", "&rPlace an Elevator Plate on every floor", "&rand you will be able to teleport between them.", "", "&eRight Click this Block &7to name it");
public static ItemStack INFUSED_HOPPER = new CustomItem(new MaterialData(Material.HOPPER), "&5Infused Hopper", "", "&rAutomatically picks up nearby Items in a 7x7x7", "&rRadius when placed.");
public static ItemStack INFUSED_HOPPER = new CustomItem(Material.HOPPER, "&5Infused Hopper", "", "&rAutomatically picks up nearby Items in a 7x7x7", "&rRadius when placed.");
public static ItemStack PLASTIC_SHEET = new CustomItem(new MaterialData(Material.PAPER), "&rPlastic Sheet");
public static ItemStack HEATED_PRESSURE_CHAMBER = new CustomItem(new MaterialData(Material.LIGHT_GRAY_STAINED_GLASS), "&cHeated Pressure Chamber", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &710 J/s");
public static ItemStack HEATED_PRESSURE_CHAMBER_2 = new CustomItem(new MaterialData(Material.LIGHT_GRAY_STAINED_GLASS), "&cHeated Pressure Chamber &7- &eII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 5x", "&8\u21E8 &e\u26A1 &744 J/s");
public static ItemStack PLASTIC_SHEET = new CustomItem(Material.PAPER, "&rPlastic Sheet");
public static ItemStack HEATED_PRESSURE_CHAMBER = new CustomItem(Material.LIGHT_GRAY_STAINED_GLASS, "&cHeated Pressure Chamber", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &710 J/s");
public static ItemStack HEATED_PRESSURE_CHAMBER_2 = new CustomItem(Material.LIGHT_GRAY_STAINED_GLASS, "&cHeated Pressure Chamber &7- &eII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 5x", "&8\u21E8 &e\u26A1 &744 J/s");
public static ItemStack ELECTRIC_SMELTERY = new CustomItem(new MaterialData(Material.FURNACE), "&cElectric Smeltery", "", "&4Alloys-Only, doesn't smelt Dust into Ingots", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &720 J/s");
public static ItemStack ELECTRIC_SMELTERY_2 = new CustomItem(new MaterialData(Material.FURNACE), "&cElectric Smeltery &7- &eII", "", "&4Alloys-Only, doesn't smelt Dust into Ingots", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 3x", "&8\u21E8 &e\u26A1 &740 J/s");
public static ItemStack ELECTRIC_SMELTERY = new CustomItem(Material.FURNACE, "&cElectric Smeltery", "", "&4Alloys-Only, doesn't smelt Dust into Ingots", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &720 J/s");
public static ItemStack ELECTRIC_SMELTERY_2 = new CustomItem(Material.FURNACE, "&cElectric Smeltery &7- &eII", "", "&4Alloys-Only, doesn't smelt Dust into Ingots", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 3x", "&8\u21E8 &e\u26A1 &740 J/s");
public static ItemStack ELECTRIFIED_CRUCIBLE = new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&cElectrified Crucible", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &748 J/s");
public static ItemStack ELECTRIFIED_CRUCIBLE_2 = new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&cElectrified Crucible &7- &eII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &780 J/s");
public static ItemStack ELECTRIFIED_CRUCIBLE_3 = new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&cElectrified Crucible &7- &eIII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 4x", "&8\u21E8 &e\u26A1 &7120 J/s");
public static ItemStack ELECTRIFIED_CRUCIBLE = new CustomItem(Material.RED_TERRACOTTA, "&cElectrified Crucible", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &748 J/s");
public static ItemStack ELECTRIFIED_CRUCIBLE_2 = new CustomItem(Material.RED_TERRACOTTA, "&cElectrified Crucible &7- &eII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &780 J/s");
public static ItemStack ELECTRIFIED_CRUCIBLE_3 = new CustomItem(Material.RED_TERRACOTTA, "&cElectrified Crucible &7- &eIII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 4x", "&8\u21E8 &e\u26A1 &7120 J/s");
public static ItemStack CARBON_PRESS = new CustomItem(new MaterialData(Material.RED_STAINED_GLASS), "&cCarbon Press", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &720 J/s");
public static ItemStack CARBON_PRESS_2 = new CustomItem(new MaterialData(Material.RED_STAINED_GLASS), "&cCarbon Press &7- &eII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 3x", "&8\u21E8 &e\u26A1 &750 J/s");
public static ItemStack CARBON_PRESS_3 = new CustomItem(new MaterialData(Material.RED_STAINED_GLASS), "&cCarbon Press &7- &eIII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 15x", "&8\u21E8 &e\u26A1 &7180 J/s");
public static ItemStack CARBON_PRESS = new CustomItem(Material.BLACK_STAINED_GLASS, "&cCarbon Press", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &720 J/s");
public static ItemStack CARBON_PRESS_2 = new CustomItem(Material.BLACK_STAINED_GLASS, "&cCarbon Press &7- &eII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 3x", "&8\u21E8 &e\u26A1 &750 J/s");
public static ItemStack CARBON_PRESS_3 = new CustomItem(Material.BLACK_STAINED_GLASS, "&cCarbon Press &7- &eIII", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 15x", "&8\u21E8 &e\u26A1 &7180 J/s");
public static ItemStack BLISTERING_INGOT = new CustomItem(new MaterialData(Material.GOLD_INGOT), "&6Blistering Ingot &7(33%)", "", "&2Radiation Level: HIGH", "&4&oHazmat Suit required");
public static ItemStack BLISTERING_INGOT_2 = new CustomItem(new MaterialData(Material.GOLD_INGOT), "&6Blistering Ingot &7(66%)", "", "&2Radiation Level: HIGH", "&4&oHazmat Suit required");
public static ItemStack BLISTERING_INGOT_3 = new CustomItem(new MaterialData(Material.GOLD_INGOT), "&6Blistering Ingot", "", "&2Radiation Level: HIGH", "&4&oHazmat Suit required");
public static ItemStack BLISTERING_INGOT = new CustomItem(Material.GOLD_INGOT, "&6Blistering Ingot &7(33%)", "", "&2Radiation Level: HIGH", "&4&oHazmat Suit required");
public static ItemStack BLISTERING_INGOT_2 = new CustomItem(Material.GOLD_INGOT, "&6Blistering Ingot &7(66%)", "", "&2Radiation Level: HIGH", "&4&oHazmat Suit required");
public static ItemStack BLISTERING_INGOT_3 = new CustomItem(Material.GOLD_INGOT, "&6Blistering Ingot", "", "&2Radiation Level: HIGH", "&4&oHazmat Suit required");
public static ItemStack ENERGY_REGULATOR = null;
public static ItemStack DEBUG_FISH = new CustomItem(new MaterialData(Material.PUFFERFISH), "&3How much is the Fish?", "", "&eRight Click &rany Block to view it's BlockData", "&eLeft Click &rto break a Block", "&eShift + Left Click &rany Block to erase it's BlockData", "&eShift + Right Click &rto place a Placeholder Block");
public static ItemStack DEBUG_FISH = new CustomItem(Material.PUFFERFISH, "&3How much is the Fish?", "", "&eRight Click &rany Block to view it's BlockData", "&eLeft Click &rto break a Block", "&eShift + Left Click &rany Block to erase it's BlockData", "&eShift + Right Click &rto place a Placeholder Block");
public static ItemStack NETHER_ICE = null;
public static ItemStack ENRICHED_NETHER_ICE = null;
public static ItemStack NETHER_ICE_COOLANT_CELL = null;
public static ItemStack NETHER_DRILL = new CustomItem(new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&4Nether Drill", "", "&rAllows you to mine Nether Ice", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7102 J/s", "", "&c&l! &cCan only be used in the Nether!", "&c&l! &cMake sure to Geo-Scan the Chunk first"));
public static ItemStack NETHER_DRILL = new CustomItem(Material.RED_TERRACOTTA, "&4Nether Drill", "", "&rAllows you to mine Nether Ice", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7102 J/s", "", "&c&l! &cCan only be used in the Nether!", "&c&l! &cMake sure to Geo-Scan the Chunk first");
// Cargo
public static ItemStack CARGO_MANAGER = null;
@ -579,68 +577,68 @@ public class SlimefunItems {
public static ItemStack CARGO_OUTPUT = null;
public static ItemStack CARGO_OUTPUT_ADVANCED = null;
public static ItemStack AUTO_BREEDER = null;
public static ItemStack AUTO_BREEDER = new CustomItem(Material.HAY_BLOCK, "&eAuto-Breeder", "", "&rRuns on &aOrganic Food", "", "&4End-Game Machine", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &760 J/Animal");;
public static ItemStack ORGANIC_FOOD = null;
public static ItemStack ORGANIC_FOOD2 = null;
public static ItemStack ORGANIC_FOOD3 = null;
public static ItemStack ORGANIC_FOOD4 = null;
public static ItemStack ORGANIC_FOOD5 = null;
public static ItemStack ORGANIC_FOOD6 = null;
public static ItemStack ORGANIC_FOOD7 = null;
public static ItemStack ORGANIC_FOOD8 = null;
public static ItemStack WHEAT_ORGANIC_FOOD = null;
public static ItemStack CARROT_ORGANIC_FOOD = null;
public static ItemStack POTATO_ORGANIC_FOOD = null;
public static ItemStack SEEDS_ORGANIC_FOOD = null;
public static ItemStack BEETROOT_ORGANIC_FOOD = null;
public static ItemStack MELON_ORGANIC_FOOD = null;
public static ItemStack APPLE_ORGANIC_FOOD = null;
public static ItemStack FERTILIZER = null;
public static ItemStack FERTILIZER2 = null;
public static ItemStack FERTILIZER3 = null;
public static ItemStack FERTILIZER4 = null;
public static ItemStack FERTILIZER5 = null;
public static ItemStack FERTILIZER6 = null;
public static ItemStack FERTILIZER7 = null;
public static ItemStack FERTILIZER8 = null;
public static ItemStack WHEAT_FERTILIZER = null;
public static ItemStack CARROT_FERTILIZER = null;
public static ItemStack POTATO_FERTILIZER = null;
public static ItemStack SEEDS_FERTILIZER = null;
public static ItemStack BEETROOT_FERTILIZER = null;
public static ItemStack MELON_FERTILIZER = null;
public static ItemStack APPLE_FERTILIZER = null;
public static ItemStack ANIMAL_GROWTH_ACCELERATOR = null;
public static ItemStack CROP_GROWTH_ACCELERATOR = null;
public static ItemStack CROP_GROWTH_ACCELERATOR_2 = null;
public static ItemStack ANIMAL_GROWTH_ACCELERATOR = new CustomItem(Material.HAY_BLOCK, "&bAnimal Growth Accelerator", "", "&rRuns on &aOrganic Food", "", "&4End-Game Machine", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &728 J/s");;
public static ItemStack CROP_GROWTH_ACCELERATOR = new CustomItem(Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator", "", "&rRuns on &aOrganic Fertilizer", "", "&4End-Game Machine", "&8\u21E8 &7Radius: 7x7", "&8\u21E8 &7Speed: &a3/time", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &750 J/s");
public static ItemStack CROP_GROWTH_ACCELERATOR_2 = new CustomItem(Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator &7(&eII&7)", "", "&rRuns on &aOrganic Fertilizer", "", "&4End-Game Machine", "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &760 J/s");
public static ItemStack FOOD_FABRICATOR = new CustomItem(new MaterialData(Material.GREEN_STAINED_GLASS), "&cFood Fabricator", "", "&rProduces &aOrganic Food", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack FOOD_FABRICATOR_2 = new CustomItem(new MaterialData(Material.GREEN_STAINED_GLASS), "&cFood Fabricator &7(&eII&7)", "", "&rProduces &aOrganic Food", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 6x", "&8\u21E8 &e\u26A1 &7512 J Buffer", "&8\u21E8 &e\u26A1 &748 J/s");
public static ItemStack FOOD_FABRICATOR = new CustomItem(Material.GREEN_STAINED_GLASS, "&cFood Fabricator", "", "&rProduces &aOrganic Food", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack FOOD_FABRICATOR_2 = new CustomItem(Material.GREEN_STAINED_GLASS, "&cFood Fabricator &7(&eII&7)", "", "&rProduces &aOrganic Food", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 6x", "&8\u21E8 &e\u26A1 &7512 J Buffer", "&8\u21E8 &e\u26A1 &748 J/s");
public static ItemStack FOOD_COMPOSTER = new CustomItem(new MaterialData(Material.GREEN_TERRACOTTA), "&cFood Composter", "", "&rProduces &aOrganic Fertilizer", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &716 J/s");
public static ItemStack FOOD_COMPOSTER_2 = new CustomItem(new MaterialData(Material.GREEN_TERRACOTTA), "&cFood Composter &7(&eII&7)", "", "&rProduces &aOrganic Fertilizer", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 10x", "&8\u21E8 &e\u26A1 &7512 J Buffer", "&8\u21E8 &e\u26A1 &752 J/s");
public static ItemStack FOOD_COMPOSTER = new CustomItem(Material.GREEN_TERRACOTTA, "&cFood Composter", "", "&rProduces &aOrganic Fertilizer", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &716 J/s");
public static ItemStack FOOD_COMPOSTER_2 = new CustomItem(Material.GREEN_TERRACOTTA, "&cFood Composter &7(&eII&7)", "", "&rProduces &aOrganic Fertilizer", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 10x", "&8\u21E8 &e\u26A1 &7512 J Buffer", "&8\u21E8 &e\u26A1 &752 J/s");
public static ItemStack XP_COLLECTOR = null;
public static ItemStack REACTOR_COOLANT_CELL = null;
public static ItemStack NUCLEAR_REACTOR = null;
public static ItemStack NETHERSTAR_REACTOR = null;
public static ItemStack REACTOR_ACCESS_PORT = new CustomItem(new MaterialData(Material.CYAN_TERRACOTTA), "&2Reactor Access Port", "", "&rAllows you to interact with a Reactor", "&rvia Cargo Nodes, can also be used", "&ras a Buffer", "", "&8\u21E8 &eMust be placed &a3 Blocks &eabove the Reactor");
public static ItemStack REACTOR_ACCESS_PORT = new CustomItem(Material.CYAN_TERRACOTTA, "&2Reactor Access Port", "", "&rAllows you to interact with a Reactor", "&rvia Cargo Nodes, can also be used", "&ras a Buffer", "", "&8\u21E8 &eMust be placed &a3 Blocks &eabove the Reactor");
public static ItemStack FREEZER = null;
public static ItemStack FREEZER_2 = null;
public static ItemStack FREEZER = new CustomItem(Material.LIGHT_BLUE_STAINED_GLASS, "&bFreezer", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &718 J/s");;
public static ItemStack FREEZER_2 = new CustomItem(Material.LIGHT_BLUE_STAINED_GLASS, "&bFreezer &7(&eII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &730 J/s");;
public static ItemStack ELECTRIC_GOLD_PAN = new CustomItem(new MaterialData(Material.BROWN_TERRACOTTA), "&6Electric Gold Pan", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &72 J/s");
public static ItemStack ELECTRIC_GOLD_PAN_2 = new CustomItem(new MaterialData(Material.BROWN_TERRACOTTA), "&6Electric Gold Pan &7(&eII&7)", "", "&eBasic Machine", "&8\u21E8 &7Speed: 3x", "&8\u21E8 &e\u26A1 &74 J/s");
public static ItemStack ELECTRIC_GOLD_PAN_3 = new CustomItem(new MaterialData(Material.BROWN_TERRACOTTA), "&6Electric Gold Pan &7(&eIII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 10x", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack ELECTRIC_GOLD_PAN = new CustomItem(Material.BROWN_TERRACOTTA, "&6Electric Gold Pan", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &72 J/s");
public static ItemStack ELECTRIC_GOLD_PAN_2 = new CustomItem(Material.BROWN_TERRACOTTA, "&6Electric Gold Pan &7(&eII&7)", "", "&eBasic Machine", "&8\u21E8 &7Speed: 3x", "&8\u21E8 &e\u26A1 &74 J/s");
public static ItemStack ELECTRIC_GOLD_PAN_3 = new CustomItem(Material.BROWN_TERRACOTTA, "&6Electric Gold Pan &7(&eIII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 10x", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack ELECTRIC_DUST_WASHER = new CustomItem(new MaterialData(Material.BLUE_STAINED_GLASS), "&3Electric Dust Washer", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &76 J/s");
public static ItemStack ELECTRIC_DUST_WASHER_2 = new CustomItem(new MaterialData(Material.BLUE_STAINED_GLASS), "&3Electric Dust Washer &7(&eII&7)", "", "&eBasic Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &710 J/s");
public static ItemStack ELECTRIC_DUST_WASHER_3 = new CustomItem(new MaterialData(Material.BLUE_STAINED_GLASS), "&3Electric Dust Washer &7(&eIII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 10x", "&8\u21E8 &e\u26A1 &730 J/s");
public static ItemStack ELECTRIC_DUST_WASHER = new CustomItem(Material.BLUE_STAINED_GLASS, "&3Electric Dust Washer", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &76 J/s");
public static ItemStack ELECTRIC_DUST_WASHER_2 = new CustomItem(Material.BLUE_STAINED_GLASS, "&3Electric Dust Washer &7(&eII&7)", "", "&eBasic Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &710 J/s");
public static ItemStack ELECTRIC_DUST_WASHER_3 = new CustomItem(Material.BLUE_STAINED_GLASS, "&3Electric Dust Washer &7(&eIII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 10x", "&8\u21E8 &e\u26A1 &730 J/s");
public static ItemStack ELECTRIC_INGOT_FACTORY = new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&cElectric Ingot Factory", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &78 J/s");
public static ItemStack ELECTRIC_INGOT_FACTORY_2 = new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&cElectric Ingot Factory &7(&eII&7)", "", "&eBasic Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack ELECTRIC_INGOT_FACTORY_3 = new CustomItem(new MaterialData(Material.RED_TERRACOTTA), "&cElectric Ingot Factory &7(&eIII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 8x", "&8\u21E8 &e\u26A1 &740 J/s");
public static ItemStack ELECTRIC_INGOT_FACTORY = new CustomItem(Material.RED_TERRACOTTA, "&cElectric Ingot Factory", "", "&eBasic Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &78 J/s");
public static ItemStack ELECTRIC_INGOT_FACTORY_2 = new CustomItem(Material.RED_TERRACOTTA, "&cElectric Ingot Factory &7(&eII&7)", "", "&eBasic Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &714 J/s");
public static ItemStack ELECTRIC_INGOT_FACTORY_3 = new CustomItem(Material.RED_TERRACOTTA, "&cElectric Ingot Factory &7(&eIII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 8x", "&8\u21E8 &e\u26A1 &740 J/s");
public static ItemStack AUTOMATED_CRAFTING_CHAMBER = new CustomItem(new MaterialData(Material.CRAFTING_TABLE), "&6Automated Crafting Chamber", "", "&6Advanced Machine", "&8\u21E8 &e\u26A1 &710 J/Item");
public static ItemStack FLUID_PUMP = new CustomItem(new MaterialData(Material.BLUE_TERRACOTTA), "&9Fluid Pump", "", "&6Advanced Machine", "&8\u21E8 &e\u26A1 &732 J/Block");
public static ItemStack CHARGING_BENCH = new CustomItem(new MaterialData(Material.CRAFTING_TABLE), "&6Charging Bench", "", "&rCharges Items such as Jetpacks", "", "&eBasic Machine", "&8\u21E8 &e\u26A1 &7128 J Buffer", "&8\u21E8 &e\u26A1 &7Energy Loss: &c50%");
public static ItemStack AUTOMATED_CRAFTING_CHAMBER = new CustomItem(Material.CRAFTING_TABLE, "&6Automated Crafting Chamber", "", "&6Advanced Machine", "&8\u21E8 &e\u26A1 &710 J/Item");
public static ItemStack FLUID_PUMP = new CustomItem(Material.BLUE_TERRACOTTA, "&9Fluid Pump", "", "&6Advanced Machine", "&8\u21E8 &e\u26A1 &732 J/Block");
public static ItemStack CHARGING_BENCH = new CustomItem(Material.CRAFTING_TABLE, "&6Charging Bench", "", "&rCharges Items such as Jetpacks", "", "&eBasic Machine", "&8\u21E8 &e\u26A1 &7128 J Buffer", "&8\u21E8 &e\u26A1 &7Energy Loss: &c50%");
public static ItemStack WITHER_ASSEMBLER = new CustomItem(new MaterialData(Material.OBSIDIAN), "&5Wither Assembler", "", "&4End-Game Machine", "&8\u21E8 &7Cooldown: &b30 Seconds", "&8\u21E8 &e\u26A1 &74096 J Buffer", "&8\u21E8 &e\u26A1 &74096 J/Wither");
public static ItemStack WITHER_ASSEMBLER = new CustomItem(Material.OBSIDIAN, "&5Wither Assembler", "", "&4End-Game Machine", "&8\u21E8 &7Cooldown: &b30 Seconds", "&8\u21E8 &e\u26A1 &74096 J Buffer", "&8\u21E8 &e\u26A1 &74096 J/Wither");
public static ItemStack TRASH_CAN = null;
public static ItemStack ELYTRA = new ItemStack(Material.ELYTRA);
public static ItemStack ELYTRA_SCALE = new CustomItem(new ItemStack(Material.FEATHER), "&bEyltra Scale");
public static ItemStack ELYTRA_SCALE = new CustomItem(Material.FEATHER, "&bEyltra Scale");
public static ItemStack INFUSED_ELYTRA = new CustomItem(new CustomItem(ELYTRA, "&5Infused Elytra"), new String[] {"MENDING-1"});
public static ItemStack SOULBOUND_ELYTRA = new CustomItem(ELYTRA, "&cSoulbound Elytra");
@ -755,29 +753,25 @@ public class SlimefunItems {
CARGO_OUTPUT = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTViMjFmZDQ4MGMxYzQzYmYzYjlmODQyYzg2OWJkYzNiYzVhY2MyNTk5YmYyZWI2YjhhMWM5NWRjZTk3OGYifX19"), "&7Cargo Node &c(Output)", "", "&rCargo Output Pipe");
CARGO_OUTPUT_ADVANCED = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTViMjFmZDQ4MGMxYzQzYmYzYjlmODQyYzg2OWJkYzNiYzVhY2MyNTk5YmYyZWI2YjhhMWM5NWRjZTk3OGYifX19"), "&6Advanced Cargo Node &c(Output)", "", "&rCargo Output Pipe");
AUTO_BREEDER = new CustomItem(new MaterialData(Material.HAY_BLOCK), "&eAuto-Breeder", "", "&rRuns on &aOrganic Food", "", "&4End-Game Machine", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &760 J/Animal");
ANIMAL_GROWTH_ACCELERATOR = new CustomItem(new MaterialData(Material.HAY_BLOCK), "&bAnimal Growth Accelerator", "", "&rRuns on &aOrganic Food", "", "&4End-Game Machine", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &728 J/s");
CROP_GROWTH_ACCELERATOR = new CustomItem(new MaterialData(Material.LIME_TERRACOTTA), "&aCrop Growth Accelerator", "", "&rRuns on &aOrganic Fertilizer", "", "&4End-Game Machine", "&8\u21E8 &7Radius: 7x7", "&8\u21E8 &7Speed: &a3/time", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &750 J/s");
CROP_GROWTH_ACCELERATOR_2 = new CustomItem(new MaterialData(Material.LIME_TERRACOTTA), "&aCrop Growth Accelerator &7(&eII&7)", "", "&rRuns on &aOrganic Fertilizer", "", "&4End-Game Machine", "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &760 J/s");
XP_COLLECTOR = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTc2MmExNWIwNDY5MmEyZTRiM2ZiMzY2M2JkNGI3ODQzNGRjZTE3MzJiOGViMWM3YTlmN2MwZmJmNmYifX19"), "&aEXP Collector", "", "&rCollects nearby Exp and stores it", "", "&4End-Game Machine", "&8\u21E8 &e\u26A1 &71024 J Buffer", "&8\u21E8 &e\u26A1 &720 J/s");
ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9X");
ORGANIC_FOOD2 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Wheat");
ORGANIC_FOOD3 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Carrots");
ORGANIC_FOOD4 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Potatoes");
ORGANIC_FOOD5 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Seeds");
ORGANIC_FOOD6 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Beetroot");
ORGANIC_FOOD7 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Melon");
ORGANIC_FOOD8 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Apple");
WHEAT_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Wheat");
CARROT_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Carrots");
POTATO_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Potatoes");
SEEDS_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Seeds");
BEETROOT_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Beetroot");
MELON_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Melon");
APPLE_ORGANIC_FOOD = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Food", "&7Content: &9Apple");
FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9X");
FERTILIZER2 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Wheat");
FERTILIZER3 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Carrots");
FERTILIZER4 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Potatoes");
FERTILIZER5 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Seeds");
FERTILIZER6 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Beetroot");
FERTILIZER7 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Melon");
FERTILIZER8 = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Apple");
WHEAT_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Wheat");
CARROT_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Carrots");
POTATO_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Potatoes");
SEEDS_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Seeds");
BEETROOT_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Beetroot");
MELON_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Melon");
APPLE_FERTILIZER = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWUzZjVhY2JlZTliZTRjNDI1OTI4OWQ2ZDlmMzVjNjM1ZmZhNjYxMTE0Njg3YjNlYTZkZGE4Yzc5In19fQ=="), "&aOrganic Fertilizer", "&7Content: &9Apple");
NETHER_ICE_COOLANT_CELL = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGQzY2Q0MTI1NTVmODk3MDE2MjEzZTVkNmM3NDMxYjQ0OGI5ZTU2NDRlMWIxOWVjNTFiNTMxNmYzNTg0MGUwIn19fQ=="), "&6Nether Ice Coolant Cell");
REACTOR_COOLANT_CELL = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGU0MDczYmU0MGNiM2RlYjMxMGEwYmU5NTliNGNhYzY4ZTgyNTM3MjcyOGZhZmI2YzI5NzNlNGU3YzMzIn19fQ=="), "&bReactor Coolant Cell");
@ -786,9 +780,6 @@ public class SlimefunItems {
CT_IMPORT_BUS = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTEzZGIyZTdlNzJlYTQ0MzJlZWZiZDZlNThhODVlYWEyNDIzZjgzZTY0MmNhNDFhYmM2YTkzMTc3NTdiODg5In19fQ=="), "&3CT Import Bus", "&7If this Block is connected to a", "&7Cargo Network, it will pull any Items from", "&7the Inventory it is attached to and place it", "&7into the CT Network Channel");
CT_EXPORT_BUS = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTEzZGIyZTdlNzJlYTQ0MzJlZWZiZDZlNThhODVlYWEyNDIzZjgzZTY0MmNhNDFhYmM2YTkzMTc3NTdiODg5In19fQ=="), "&3CT Export Bus", "&7If this Block is connected to a", "&7Cargo Network, it will pull any Items from", "&7the CT Network Channel and place these", "&7into the Inventory it is attached to");
FREEZER = new CustomItem(new MaterialData(Material.LIGHT_BLUE_STAINED_GLASS), "&bFreezer", "", "&6Advanced Machine", "&8\u21E8 &7Speed: 1x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &718 J/s");
FREEZER_2 = new CustomItem(new MaterialData(Material.LIGHT_BLUE_STAINED_GLASS), "&bFreezer &7(&eII&7)", "", "&4End-Game Machine", "&8\u21E8 &7Speed: 2x", "&8\u21E8 &e\u26A1 &7256 J Buffer", "&8\u21E8 &e\u26A1 &730 J/s");
BATTERY = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmUyZGRhNmVmNjE4NWQ0ZGQ2ZWE4Njg0ZTk3ZDM5YmE4YWIwMzdlMjVmNzVjZGVhNmJkMjlkZjhlYjM0ZWUifX19"), "&6Battery");
HEATING_COIL = new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2UzYmM0ODkzYmE0MWEzZjczZWUyODE3NGNkZjRmZWY2YjE0NWU0MWZlNmM4MmNiN2JlOGQ4ZTk3NzFhNSJ9fX0="), "&cHeating Coil");
@ -798,4 +789,5 @@ public class SlimefunItems {
e.printStackTrace();
}
}
}

View File

@ -35,6 +35,9 @@ import org.bukkit.entity.Player;
* @since 4.0
*/
public class Research {
private static final int[] research_progress = {23, 44, 57, 92};
/**
* Whether researching is enabled or not;
* @since 4.0
@ -255,55 +258,27 @@ public class Research {
cfg.setValue("researches." + research, true);
cfg.save();
Messages.local.sendTranslation(p, "messages.unlocked", true, new Variable("%research%", getName()));
if(SlimefunStartup.getCfg().getBoolean("options.research-give-fireworks")) FireworkShow.launchRandom(p, 1);
}
else if (!researching.contains(p.getUniqueId())){
if (SlimefunStartup.getCfg().getBoolean("options.research-give-fireworks"))
FireworkShow.launchRandom(p, 1);
} else if (!researching.contains(p.getUniqueId())){
researching.add(p.getUniqueId());
Messages.local.sendTranslation(p, "messages.research.start", true, new Variable("%research%", getName()));
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
for (int i = 1; i < research_progress.length + 1; i++) {
int j = i;
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F);
Messages.local.sendTranslation(p, "messages.research.progress", true, new Variable("%research%", getName()), new Variable("%progress%", "23%"));
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F);
Messages.local.sendTranslation(p, "messages.research.progress", true, new Variable("%research%", getName()), new Variable("%progress%", "44%"));
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F);
Messages.local.sendTranslation(p, "messages.research.progress", true, new Variable("%research%", getName()), new Variable("%progress%", "57%"));
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F);
Messages.local.sendTranslation(p, "messages.research.progress", true, new Variable("%research%", getName()), new Variable("%progress%", "92%"));
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Messages.local.sendTranslation(p, "messages.research.progress", true, new Variable("%research%", getName()), new Variable("%progress%", research_progress[j - 1] + "%"));
}, i*20L);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
Config cfg = new Config(new File("data-storage/Slimefun/Players/" + p.getUniqueId() + ".yml"));
cfg.setValue("researches." + research, true);
cfg.save();
Messages.local.sendTranslation(p, "messages.unlocked", true, new Variable("%research%", getName()));
if(SlimefunStartup.getCfg().getBoolean("options.research-unlock-fireworks")) FireworkShow.launchRandom(p, 1);
if (SlimefunStartup.getCfg().getBoolean("options.research-unlock-fireworks"))
FireworkShow.launchRandom(p, 1);
researching.remove(p.getUniqueId());
}
}, 20L);
}
}, 20L);
}
}, 20L);
}
}, 20L);
}
}, 20L);
}, (research_progress.length + 1)*20L);
}
}
}

View File

@ -6,7 +6,6 @@ import me.mrCookieSlime.Slimefun.Lists.Categories;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.handlers.BlockTicker;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.block.Furnace;
import org.bukkit.inventory.ItemStack;
@ -55,7 +54,7 @@ public class EnhancedFurnace extends SlimefunItem {
}
public int getFuelEfficiency() {
return speed;
return efficiency;
}
public int getOutput() {

View File

@ -330,8 +330,6 @@ public class SlimefunItem {
public static SlimefunItem getByItem(ItemStack item) {
if (item == null) return null;
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BROKEN_SPAWNER, false)) return getByID("BROKEN_SPAWNER");
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.REPAIRED_SPAWNER, false)) return getByID("REINFORCED_SPAWNER");
for (SlimefunItem sfi: items) {
if (sfi instanceof ChargableItem && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
else if (sfi instanceof DamagableChargableItem && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
@ -339,6 +337,8 @@ public class SlimefunItem {
else if (sfi instanceof SlimefunBackpack && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
else if (SlimefunManager.isItemSimiliar(item, sfi.getItem(), true)) return sfi;
}
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BROKEN_SPAWNER, false)) return getByID("BROKEN_SPAWNER");
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.REPAIRED_SPAWNER, false)) return getByID("REINFORCED_SPAWNER");
return null;
}

View File

@ -1,8 +1,6 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
@ -13,37 +11,31 @@ import org.bukkit.inventory.ItemStack;
public class SlimefunMachine extends SlimefunItem {
List<ItemStack[]> recipes;
List<ItemStack> shownRecipes;
Material trigger;
private List<ItemStack[]> recipes;
private List<ItemStack> shownRecipes;
private Material trigger;
public SlimefunMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, Material trigger) {
super(category, item, id, RecipeType.MULTIBLOCK, recipe);
this.recipes = new ArrayList<ItemStack[]>();
this.shownRecipes = new ArrayList<ItemStack>();
for (ItemStack i: machineRecipes) {
this.shownRecipes.add(i);
}
this.recipes = new ArrayList<>();
this.shownRecipes = new ArrayList<>();
this.shownRecipes.addAll(Arrays.asList(machineRecipes));
this.trigger = trigger;
}
public SlimefunMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, Material trigger, boolean ghost) {
super(category, item, id, RecipeType.MULTIBLOCK, recipe, ghost);
this.recipes = new ArrayList<ItemStack[]>();
this.shownRecipes = new ArrayList<ItemStack>();
for (ItemStack i: machineRecipes) {
this.shownRecipes.add(i);
}
this.recipes = new ArrayList<>();
this.shownRecipes = new ArrayList<>();
this.shownRecipes.addAll(Arrays.asList(machineRecipes));
this.trigger = trigger;
}
public SlimefunMachine(Category category, ItemStack item, String id, ItemStack[] recipe, ItemStack[] machineRecipes, Material trigger, String[] keys, Object[] values) {
super(category, item, id, RecipeType.MULTIBLOCK, recipe, keys, values);
this.recipes = new ArrayList<ItemStack[]>();
this.shownRecipes = new ArrayList<ItemStack>();
for (ItemStack i: machineRecipes) {
this.shownRecipes.add(i);
}
this.recipes = new ArrayList<>();
this.shownRecipes = new ArrayList<>();
this.shownRecipes.addAll(Arrays.asList(machineRecipes));
this.trigger = trigger;
}
@ -75,10 +67,9 @@ public class SlimefunMachine extends SlimefunItem {
}
public MultiBlock toMultiBlock() {
List<Material> mats = new ArrayList<Material>();
List<Material> mats = new ArrayList<>();
for (ItemStack i: this.getRecipe()) {
if (i == null) mats.add(null);
else if (i.getType() == Material.CAULDRON) mats.add(Material.CAULDRON);
else if (i.getType() == Material.FLINT_AND_STEEL) mats.add(Material.FIRE);
else mats.add(i.getType());
}

View File

@ -31,7 +31,7 @@ public class Talisman extends SlimefunItem {
private String suffix;
private boolean consumable = true;
private boolean cancel = true;
private PotionEffect[] effects = new PotionEffect[0];
private PotionEffect[] effects;
private int chance = 100;
public Talisman(ItemStack item, String id, ItemStack[] recipe, boolean consumable, boolean cancelEvent, String messageSuffix, PotionEffect... effects) {
@ -58,81 +58,63 @@ public class Talisman extends SlimefunItem {
this.chance = chance;
}
public String getSuffix() { return this.suffix; }
public boolean isConsumable() { return this.consumable; }
public boolean isEventCancelled() { return this.cancel; }
public PotionEffect[] getEffects() { return this.effects; }
public int getChance() { return this.chance; }
public static boolean checkFor(Event e, SlimefunItem talisman) {
if (talisman != null) {
if (talisman instanceof Talisman) {
boolean message = !((Talisman) talisman).getSuffix().equalsIgnoreCase("");
if (SlimefunStartup.chance(100, ((Talisman) talisman).getChance())) {
Player p = null;
if (e instanceof EntityDeathEvent) p = ((EntityDeathEvent) e).getEntity().getKiller();
else if (e instanceof BlockBreakEvent) p = ((BlockBreakEvent) e).getPlayer();
else if (e instanceof PlayerEvent) p = ((PlayerEvent) e).getPlayer();
else if (e instanceof EntityEvent) p = (Player) ((EntityEvent) e).getEntity();
else if (e instanceof EnchantItemEvent) p = ((EnchantItemEvent) e).getEnchanter();
boolean pass = true;
for (PotionEffect effect: ((Talisman) talisman).getEffects()) {
if (effect != null && p.hasPotionEffect(effect.getType())) pass = false;
public String getSuffix() {
return this.suffix;
}
public boolean isConsumable() {
return this.consumable;
}
public boolean isEventCancelled() {
return this.cancel;
}
public PotionEffect[] getEffects() {
return this.effects;
}
public int getChance() {
return this.chance;
}
public static boolean checkFor(Event e, SlimefunItem item) {
if (!(item instanceof Talisman)) {
return false;
}
Talisman talisman = (Talisman) item;
if (!SlimefunStartup.chance(100, talisman.getChance())) {
return false;
}
Player p = getPlayerByEventType(e);
if (!pass(p, talisman)) {
return false;
}
if (pass) {
if (p.getInventory().containsAtLeast(talisman.getItem(), 1)) {
if (Slimefun.hasUnlocked(p, talisman.getItem(), true)) {
if (((Talisman) talisman).isConsumable()) p.getInventory().removeItem(talisman.getItem());
for (PotionEffect effect: ((Talisman) talisman).getEffects()) {
p.addPotionEffect(effect);
}
if (e instanceof Cancellable && ((Talisman) talisman).isEventCancelled()) ((Cancellable) e).setCancelled(true);
if (message) Messages.local.sendTranslation(p, "messages.talisman." + ((Talisman) talisman).getSuffix(),true);
executeTalismanAttributes(e,p,talisman);
return true;
}
else return false;
}
else if (p.getEnderChest().containsAtLeast(((Talisman) talisman).upgrade(), 1)) {
if (Slimefun.hasUnlocked(p, ((Talisman) talisman).upgrade(), true)) {
if (((Talisman) talisman).isConsumable()) p.getEnderChest().removeItem(((Talisman) talisman).upgrade());
for (PotionEffect effect: ((Talisman) talisman).getEffects()) {
p.addPotionEffect(effect);
}
if (e instanceof Cancellable && ((Talisman) talisman).isEventCancelled()) ((Cancellable) e).setCancelled(true);
if (message) Messages.local.sendTranslation(p, "messages.talisman." + ((Talisman) talisman).getSuffix(), true);
} else return false;
} else if (p.getEnderChest().containsAtLeast(talisman.upgrade(), 1)) {
if (Slimefun.hasUnlocked(p, talisman.upgrade(), true)) {
executeTalismanAttributes(e,p,talisman);
return true;
}
else return false;
}
else return false;
}
else return false;
}
else return false;
}
else return false;
}
else return false;
} else return false;
} else return false;
}
public ItemStack upgrade() {
List<String> lore = new ArrayList<String>();
List<String> lore = new ArrayList<>();
lore.add("&7&oEnder Infused");
lore.add("");
for (String line : getItem().getItemMeta().getLore()) {
lore.add(line);
}
ItemStack item = new CustomItem(getItem().getType(), "&5Ender " + ChatColor.stripColor(getItem().getItemMeta().getDisplayName()), getItem().getDurability(), lore.toArray(new String[lore.size()]));
return item;
return new CustomItem(getItem().getType(), "&5Ender " + ChatColor.stripColor(getItem().getItemMeta().getDisplayName()), lore.toArray(new String[lore.size()]));
}
@Override
@ -153,4 +135,52 @@ public class Talisman extends SlimefunItem {
Slimefun.addOfficialWikiPage(getID(), "Talismans");
}
private static boolean isTalismanMessage(Talisman talisman){
return !("").equalsIgnoreCase(talisman.getSuffix());
}
private static void executeTalismanAttributes(Event e, Player p, Talisman talisman){
consumeItem(p,talisman);
applyTalismanEffects(p,talisman);
cancelEvent(e,talisman);
sendMessage(p,talisman);
}
private static void applyTalismanEffects(Player p, Talisman talisman){
for (PotionEffect effect : talisman.getEffects()) {
p.addPotionEffect(effect);
}
}
private static void cancelEvent(Event e, Talisman talisman){
if (e instanceof Cancellable && talisman.isEventCancelled())
((Cancellable) e).setCancelled(true);
}
private static void sendMessage(Player p, Talisman talisman){
if (isTalismanMessage(talisman))
Messages.local.sendTranslation(p, "messages.talisman." + talisman.getSuffix(), true);
}
private static void consumeItem(Player p, Talisman talisman){
if (talisman.isConsumable())
p.getInventory().removeItem(talisman.getItem());
}
private static Player getPlayerByEventType(Event e) {
if (e instanceof EntityDeathEvent) return ((EntityDeathEvent) e).getEntity().getKiller();
else if (e instanceof BlockBreakEvent) return ((BlockBreakEvent) e).getPlayer();
else if (e instanceof PlayerEvent) return ((PlayerEvent) e).getPlayer();
else if (e instanceof EntityEvent) return (Player) ((EntityEvent) e).getEntity();
else if (e instanceof EnchantItemEvent) return ((EnchantItemEvent) e).getEnchanter();
return null;
}
private static boolean pass(Player p, SlimefunItem talisman) {
for (PotionEffect effect : ((Talisman) talisman).getEffects()) {
if (effect != null && p.hasPotionEffect(effect.getType())) return false;
}
return true;
}
}

View File

@ -12,12 +12,12 @@ import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
@ -75,7 +75,6 @@ public abstract class AContainer extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -166,47 +165,23 @@ public abstract class AContainer extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_in) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@ -260,7 +235,7 @@ public abstract class AContainer extends SlimefunItem {
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));
@ -303,14 +278,13 @@ public abstract class AContainer extends SlimefunItem {
super.register(slimefun);
}
@SuppressWarnings("deprecation")
protected void tick(Block b) {
if (isProcessing(b)) {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -8,6 +8,7 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
@ -47,36 +48,18 @@ public abstract class ADrill extends AContainer {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
for (int i: getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@ -127,14 +110,13 @@ public abstract class ADrill extends AContainer {
@Override
public void registerDefaultRecipes() {}
@SuppressWarnings("deprecation")
protected void tick(Block b) {
if (isProcessing(b)) {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -1,9 +1,17 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -18,15 +26,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public abstract class AFarm extends SlimefunItem {
private static final int[] border = {0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 38, 39, 40, 41, 42, 43, 44};
@ -62,7 +61,6 @@ public abstract class AFarm extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -111,7 +109,6 @@ public abstract class AFarm extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -133,36 +130,18 @@ public abstract class AFarm extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {
@ -236,7 +215,7 @@ public abstract class AFarm extends SlimefunItem {
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot: getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));

View File

@ -7,10 +7,20 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
@ -28,16 +38,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public abstract class AGenerator extends SlimefunItem {
public static Map<Location, MachineFuel> processing = new HashMap<Location, MachineFuel>();
@ -79,7 +79,6 @@ public abstract class AGenerator extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -138,7 +137,6 @@ public abstract class AGenerator extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -170,36 +168,18 @@ public abstract class AGenerator extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_in) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i: border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i: getOutputSlots()) {
@ -218,14 +198,8 @@ public abstract class AGenerator extends SlimefunItem {
}
preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public abstract String getInventoryTitle();
@ -257,15 +231,14 @@ public abstract class AGenerator extends SlimefunItem {
public void register(boolean slimefun) {
addItemHandler(new EnergyTicker() {
@SuppressWarnings("deprecation")
@Override
public double generateEnergy(Location l, SlimefunItem sf, Config data) {
if (isProcessing(l)) {
int timeleft = progress.get(l);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(l).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(l).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(l).getTicks()));
@ -291,13 +264,9 @@ public abstract class AGenerator extends SlimefunItem {
}
else {
ItemStack fuel = processing.get(l).getInput();
if (SlimefunManager.isItemSimiliar(fuel, new ItemStack(Material.LAVA_BUCKET), true)) {
pushItems(l, new ItemStack[] {new ItemStack(Material.BUCKET)});
}
else if (SlimefunManager.isItemSimiliar(fuel, SlimefunItems.BUCKET_OF_FUEL, true)) {
pushItems(l, new ItemStack[] {new ItemStack(Material.BUCKET)});
}
else if (SlimefunManager.isItemSimiliar(fuel, SlimefunItems.BUCKET_OF_OIL, true)) {
if (SlimefunManager.isItemSimiliar(fuel, new ItemStack(Material.LAVA_BUCKET), true)
|| SlimefunManager.isItemSimiliar(fuel, SlimefunItems.BUCKET_OF_FUEL, true)
|| SlimefunManager.isItemSimiliar(fuel, SlimefunItems.BUCKET_OF_OIL, true)) {
pushItems(l, new ItemStack[] {new ItemStack(Material.BUCKET)});
}
BlockStorage.getInventory(l).replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "));
@ -349,7 +318,7 @@ public abstract class AGenerator extends SlimefunItem {
int size = BlockStorage.getInventory(l).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot: getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(l).getItemInSlot(slot));
@ -365,4 +334,5 @@ public abstract class AGenerator extends SlimefunItem {
BlockStorage.getInventory(l).replaceExistingItem(slot, inv.getItem(slot));
}
}
}

View File

@ -19,8 +19,6 @@ import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
@ -84,26 +82,18 @@ public abstract class AReactor extends SlimefunItem {
}
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "reactor-mode").equals("generator")) {
menu.replaceExistingItem(4, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTM0M2NlNThkYTU0Yzc5OTI0YTJjOTMzMWNmYzQxN2ZlOGNjYmJlYTliZTQ1YTdhYzg1ODYwYTZjNzMwIn19fQ=="), "&7Focus: &eElectricity", "", "&6Your Reactor will focus on Power Generation", "&6If your Energy Network doesn't need Power", "&6it will not produce any either", "", "&7> Click to change the Focus to &eProduction"));
menu.addMenuClickHandler(4, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(4, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "reactor-mode", "production");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(4, new CustomItem(SlimefunItems.PLUTONIUM, "&7Focus: &eProduction", "", "&6Your Reactor will focus on producing goods", "&6If your Energy Network doesn't need Power", "&6it will continue to run and simply will", "&6not generate any Power in the mean time", "", "&7> Click to change the Focus to &ePower Generation"));
menu.addMenuClickHandler(4, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(4, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "reactor-mode", "generator");
newInstance(menu, b);
return false;
}
});
}
} catch(Exception x) {
@ -125,7 +115,6 @@ public abstract class AReactor extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -164,70 +153,34 @@ public abstract class AReactor extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_1) {
preset.addItem(i, new CustomItem(new ItemStack(Material.LIME_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_3) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GREEN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
preset.addItem(1, new CustomItem(SlimefunItems.URANIUM, "&7Fuel Slot", "", "&rThis Slot accepts radioactive Fuel such as:", "&2Uranium &ror &aNeptunium"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
for (int i : border_2) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
if (needsCooling()) {
@ -238,13 +191,8 @@ public abstract class AReactor extends SlimefunItem {
for (int i : border_4) {
preset.addItem(i, new CustomItem(new ItemStack(Material.BARRIER), "&cNo Coolant Required"),
new MenuClickHandler() {
@Override
public boolean onClick(Player player, int i, ItemStack itemStack, ClickAction clickAction) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}
}
@ -297,7 +245,6 @@ public abstract class AReactor extends SlimefunItem {
Set<Location> explode = new HashSet<Location>();
@SuppressWarnings("deprecation")
@Override
public double generateEnergy(final Location l, SlimefunItem sf, Config data) {
BlockMenu port = getAccessPort(l);
@ -312,18 +259,13 @@ public abstract class AReactor extends SlimefunItem {
ChargableBlock.addCharge(l, getEnergyProduction());
space -= produced;
}
if (space >= produced || !BlockStorage.getBlockInfo(l, "reactor-mode").equals("generator")) {
if (space >= produced || !BlockStorage.getLocationInfo(l, "reactor-mode").equals("generator")) {
progress.put(l, timeleft - 1);
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
if (!l.getBlock().getRelative(cooling[CSCoreLib.randomizer().nextInt(cooling.length)]).isLiquid()) explode.add(l);
}
});
ItemStack item = getProgressBar().clone();
ItemMeta im = item.getItemMeta();
im.setDisplayName(" ");
@ -434,11 +376,8 @@ public abstract class AReactor extends SlimefunItem {
if (explosion) {
BlockStorage.getInventory(l).close();
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
ReactorHologram.remove(l);
}
}, 0);
explode.remove(l);
@ -456,7 +395,7 @@ public abstract class AReactor extends SlimefunItem {
int size = BlockStorage.getInventory(l).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(l).getItemInSlot(slot));
@ -468,7 +407,7 @@ public abstract class AReactor extends SlimefunItem {
int size = BlockStorage.getInventory(l).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : slots) {
inv.setItem(slot, BlockStorage.getInventory(l).getItemInSlot(slot));
@ -511,4 +450,5 @@ public abstract class AReactor extends SlimefunItem {
if (BlockStorage.check(portL, "REACTOR_ACCESS_PORT")) return BlockStorage.getInventory(portL);
return null;
}
}

View File

@ -1,14 +1,12 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -43,84 +41,57 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
try {
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "filter-type") == null || BlockStorage.getLocationInfo(b.getLocation(), "filter-type").equals("whitelist")) {
menu.replaceExistingItem(15, new CustomItem(new ItemStack(Material.WHITE_WOOL), "&7Type: &rWhitelist", "", "&e> Click to change it to Blacklist"));
menu.addMenuClickHandler(15, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(15, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-type", "blacklist");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(15, new CustomItem(new ItemStack(Material.BLACK_WOOL), "&7Type: &8Blacklist", "", "&e> Click to change it to Whitelist"));
menu.addMenuClickHandler(15, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(15, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-type", "whitelist");
newInstance(menu, b);
return false;
}
});
}
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "filter-durability") == null || BlockStorage.getLocationInfo(b.getLocation(), "filter-durability").equals("false")) {
menu.replaceExistingItem(16, new CustomItem(new ItemStack(Material.STONE_SWORD, (byte) 20), "&7Include Sub-IDs/Durability: &4\u2718", "", "&e> Click to toggle whether the Durability has to match"));
menu.addMenuClickHandler(16, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(16, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-durability", "true");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(16, new CustomItem(new ItemStack(Material.GOLDEN_SWORD, (byte) 20), "&7Include Sub-IDs/Durability: &2\u2714", "", "&e> Click to toggle whether the Durability has to match"));
menu.addMenuClickHandler(16, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(16, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-durability", "false");
newInstance(menu, b);
return false;
}
});
}
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "filter-lore") == null || BlockStorage.getLocationInfo(b.getLocation(), "filter-lore").equals("true")) {
menu.replaceExistingItem(25, new CustomItem(new ItemStack(Material.MAP), "&7Include Lore: &2\u2714", "", "&e> Click to toggle whether the Lore has to match"));
menu.addMenuClickHandler(25, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(25, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-lore", "false");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(25, new CustomItem(new ItemStack(Material.MAP), "&7Include Lore: &4\u2718", "", "&e> Click to toggle whether the Lore has to match"));
menu.addMenuClickHandler(25, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(25, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-lore", "true");
newInstance(menu, b);
return false;
}
});
}
menu.replaceExistingItem(41, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjI1OTliZDk4NjY1OWI4Y2UyYzQ5ODg1MjVjOTRlMTlkZGQzOWZhZDA4YTM4Mjg0YTE5N2YxYjcwNjc1YWNjIn19fQ=="), "&bChannel", "", "&e> Click to decrease the Channel ID by 1"));
menu.addMenuClickHandler(41, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(41, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) {
if (CargoNet.EXTRA_CHANNELS) channel = 16;
@ -129,50 +100,37 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
newInstance(menu, b);
return false;
}
});
int channel = ((!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "frequency") == null) ? 0: (Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency"))));
if (channel == 16) {
menu.replaceExistingItem(42, new CustomItem(SlimefunItems.CHEST_TERMINAL, "&bChannel ID: &3" + (channel + 1)));
menu.addMenuClickHandler(42, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(42,
(p, slot, item, action) -> false
);
}
else {
menu.replaceExistingItem(42, new CustomItem(new ItemStack(MaterialHelper.WoolColours[channel]), "&bChannel ID: &3" + (channel + 1)));
menu.addMenuClickHandler(42, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(42,
(p, slot, item, action) -> false
);
}
menu.replaceExistingItem(43, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzJmOTEwYzQ3ZGEwNDJlNGFhMjhhZjZjYzgxY2Y0OGFjNmNhZjM3ZGFiMzVmODhkYjk5M2FjY2I5ZGZlNTE2In19fQ=="), "&bChannel", "", "&e> Click to increase the Channel ID by 1"));
menu.addMenuClickHandler(43, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
menu.addMenuClickHandler(43, (p, slot, item, action) -> {
int channeln = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (CargoNet.EXTRA_CHANNELS) {
if (channel > 16) channel = 0;
if (channeln > 16) channeln = 0;
}
else {
if (channel > 15) channel = 0;
if (channeln > 15) channeln = 0;
}
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channeln));
newInstance(menu, b);
return false;
}
});
} catch (Exception e) {
@ -226,28 +184,17 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(2, new CustomItem(new ItemStack(Material.PAPER), "&3Items", "", "&bPut in all Items you want to", "&bblacklist/whitelist"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public int[] getInputSlots() {
return new int[] {19, 20, 21, 28, 29, 30, 37, 38, 39};
}
}

View File

@ -2,8 +2,6 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -86,14 +84,8 @@ public class AnimalGrowthAccelerator extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}

View File

@ -18,6 +18,7 @@ import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
public abstract class AutoAnvil extends AContainer {
@ -57,8 +58,8 @@ public abstract class AutoAnvil extends AContainer {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));
@ -91,12 +92,14 @@ public abstract class AutoAnvil extends AContainer {
ItemStack target = BlockStorage.getInventory(b).getItemInSlot(slot == getInputSlots()[0] ? getInputSlots()[1]: getInputSlots()[0]);
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot);
if (item != null) {
if (item.getType().getMaxDurability() > 0 && item.getDurability() > 0) {
if (item.getType().getMaxDurability() > 0 && ((Damageable) item.getItemMeta()).getDamage() > 0) {
if (SlimefunManager.isItemSimiliar(target, SlimefunItems.DUCT_TAPE, true)) {
ItemStack newItem = item.clone();
short durability = (short) (newItem.getDurability() - (item.getType().getMaxDurability() / getRepairFactor()));
short durability = (short) (((Damageable) newItem.getItemMeta()).getDamage() - (item.getType().getMaxDurability() / getRepairFactor()));
if (durability < 0) durability = 0;
newItem.setDurability(durability);
ItemMeta meta = newItem.getItemMeta();
((Damageable) meta).setDamage(durability);
newItem.setItemMeta(meta);
r = new MachineRecipe(30, new ItemStack[] {target, item}, new ItemStack[] {newItem});
}
break slots;

View File

@ -1,9 +1,15 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.Animals;
@ -21,14 +27,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class AutoBreeder extends SlimefunItem {
private static final int[] border = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
@ -63,7 +61,6 @@ public class AutoBreeder extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -86,14 +83,8 @@ public class AutoBreeder extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}

View File

@ -11,6 +11,7 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.bukkit.inventory.meta.ItemMeta;
@ -58,8 +59,8 @@ public class AutoDisenchanter extends AContainer {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -25,10 +25,12 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.bukkit.inventory.meta.ItemMeta;
public class AutoEnchanter extends AContainer {
public static int max_emerald_enchantments = 2;
public AutoEnchanter(Category category, ItemStack item, String name, RecipeType recipeType, ItemStack[] recipe) {
@ -59,8 +61,8 @@ public class AutoEnchanter extends AContainer {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -6,10 +6,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
@ -28,15 +35,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import me.mrCookieSlime.Slimefun.api.item_transport.RecipeSorter;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public abstract class AutomatedCraftingChamber extends SlimefunItem {
private static final int[] border = {0, 1, 3, 4, 5, 7, 8, 13, 14, 15, 16, 17, 50, 51, 52, 53};
@ -59,26 +57,18 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
public void newInstance(final BlockMenu menu, final Block b) {
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "enabled") == null || BlockStorage.getLocationInfo(b.getLocation(), "enabled").equals("false")) {
menu.replaceExistingItem(6, new CustomItem(new ItemStack(Material.GUNPOWDER), "&7Enabled: &4\u2718", "", "&e> Click to enable this Machine"));
menu.addMenuClickHandler(6, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(6, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "enabled", "true");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(6, new CustomItem(new ItemStack(Material.REDSTONE), "&7Enabled: &2\u2714", "", "&e> Click to disable this Machine"));
menu.addMenuClickHandler(6, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(6, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "enabled", "false");
newInstance(menu, b);
return false;
}
});
}
}
@ -102,7 +92,14 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
if (menu.getItemInSlot(slot) != null) slots.add(slot);
}
Collections.sort(slots, new RecipeSorter(menu));
return ArrayUtils.toPrimitive(slots.toArray(new Integer[slots.size()]));
int[] array = new int[slots.size()];
for (int i = 0; i < slots.size(); i++) {
array[i] = slots.get(i);
}
return array;
}
};
@ -138,36 +135,18 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_in) {
preset.addItem(i, new CustomItem(new ItemStack(Material.BLUE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : getOutputSlots()) {
@ -186,14 +165,8 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
}
preset.addItem(2, new CustomItem(new ItemStack(Material.CRAFTING_TABLE), "&eRecipe", "", "&bPut in the Recipe you want to craft", "&4Enhanced Crafting Table Recipes ONLY"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public abstract int getEnergyConsumption();
@ -210,7 +183,7 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));

View File

@ -1,14 +1,12 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -40,38 +38,26 @@ public class CargoCraftingNode extends SlimefunItem {
public void newInstance(final BlockMenu menu, final Block b) {
try {
menu.replaceExistingItem(41, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjI1OTliZDk4NjY1OWI4Y2UyYzQ5ODg1MjVjOTRlMTlkZGQzOWZhZDA4YTM4Mjg0YTE5N2YxYjcwNjc1YWNjIn19fQ=="), "&bChannel", "", "&e> Click to decrease the Channel ID by 1"));
menu.addMenuClickHandler(41, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(41, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) channel = 15;
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
newInstance(menu, b);
return false;
}
});
menu.replaceExistingItem(42, new CustomItem(new ItemStack(((!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "frequency") == null) ? Material.WHITE_WOOL : MaterialHelper.WoolColours[(Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")))])), "&bChannel ID: &3" + (((!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "frequency") == null) ? 0: (Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")))) + 1)));
menu.addMenuClickHandler(42, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(42,
(p, slot, item, action) -> false
);
menu.replaceExistingItem(43, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzJmOTEwYzQ3ZGEwNDJlNGFhMjhhZjZjYzgxY2Y0OGFjNmNhZjM3ZGFiMzVmODhkYjk5M2FjY2I5ZGZlNTE2In19fQ=="), "&bChannel", "", "&e> Click to increase the Channel ID by 1"));
menu.addMenuClickHandler(43, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(43, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (channel > 15) channel = 0;
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
newInstance(menu, b);
return false;
}
});
} catch (Exception e) {
@ -121,28 +107,17 @@ public class CargoCraftingNode extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(2, new CustomItem(new ItemStack(Material.CRAFTING_TABLE), "&eRecipe", "", "&bPut in the Recipe you want to craft"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public int[] getInputSlots() {
return new int[] {19, 20, 21, 28, 29, 30, 37, 38, 39};
}
}

View File

@ -7,8 +7,6 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -43,109 +41,74 @@ public class CargoInputNode extends SlimefunItem {
try {
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "filter-type") == null || BlockStorage.getLocationInfo(b.getLocation(), "filter-type").equals("whitelist")) {
menu.replaceExistingItem(15, new CustomItem(new ItemStack(Material.WHITE_WOOL), "&7Type: &rWhitelist", "", "&e> Click to change it to Blacklist"));
menu.addMenuClickHandler(15, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(15, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-type", "blacklist");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(15, new CustomItem(new ItemStack(Material.BLACK_WOOL), "&7Type: &8Blacklist", "", "&e> Click to change it to Whitelist"));
menu.addMenuClickHandler(15, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(15, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-type", "whitelist");
newInstance(menu, b);
return false;
}
});
}
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "filter-durability") == null || BlockStorage.getLocationInfo(b.getLocation(), "filter-durability").equals("false")) {
menu.replaceExistingItem(16, new CustomItem(new ItemStack(Material.STONE_SWORD, (byte) 20), "&7Include Sub-IDs/Durability: &4\u2718", "", "&e> Click to toggle whether the Durability has to match"));
menu.addMenuClickHandler(16, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(16, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-durability", "true");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(16, new CustomItem(new ItemStack(Material.GOLDEN_SWORD, (byte) 20), "&7Include Sub-IDs/Durability: &2\u2714", "", "&e> Click to toggle whether the Durability has to match"));
menu.addMenuClickHandler(16, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(16, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-durability", "false");
newInstance(menu, b);
return false;
}
});
}
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "round-robin") == null || BlockStorage.getLocationInfo(b.getLocation(), "round-robin").equals("false")) {
menu.replaceExistingItem(24, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDc4ZjJiN2U1ZTc1NjM5ZWE3ZmI3OTZjMzVkMzY0YzRkZjI4YjQyNDNlNjZiNzYyNzdhYWRjZDYyNjEzMzcifX19"), "&7Round-Robin Mode: &4\u2718", "", "&e> Click to enable Round Robin Mode", "&e(Items will be equally distributed on the Channel)"));
menu.addMenuClickHandler(24, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(24, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "round-robin", "true");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(24, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDc4ZjJiN2U1ZTc1NjM5ZWE3ZmI3OTZjMzVkMzY0YzRkZjI4YjQyNDNlNjZiNzYyNzdhYWRjZDYyNjEzMzcifX19"), "&7Round-Robin Mode: &2\u2714", "", "&e> Click to disable Round Robin Mode", "&e(Items will be equally distributed on the Channel)"));
menu.addMenuClickHandler(24, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(24, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "round-robin", "false");
newInstance(menu, b);
return false;
}
});
}
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "filter-lore") == null || BlockStorage.getLocationInfo(b.getLocation(), "filter-lore").equals("true")) {
menu.replaceExistingItem(25, new CustomItem(new ItemStack(Material.MAP), "&7Include Lore: &2\u2714", "", "&e> Click to toggle whether the Lore has to match"));
menu.addMenuClickHandler(25, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(25, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-lore", "false");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(25, new CustomItem(new ItemStack(Material.MAP), "&7Include Lore: &4\u2718", "", "&e> Click to toggle whether the Lore has to match"));
menu.addMenuClickHandler(25, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(25, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "filter-lore", "true");
newInstance(menu, b);
return false;
}
});
}
menu.replaceExistingItem(41, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjI1OTliZDk4NjY1OWI4Y2UyYzQ5ODg1MjVjOTRlMTlkZGQzOWZhZDA4YTM4Mjg0YTE5N2YxYjcwNjc1YWNjIn19fQ=="), "&bChannel", "", "&e> Click to decrease the Channel ID by 1"));
menu.addMenuClickHandler(41, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(41, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) {
if (CargoNet.EXTRA_CHANNELS) channel = 16;
@ -154,50 +117,37 @@ public class CargoInputNode extends SlimefunItem {
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
newInstance(menu, b);
return false;
}
});
int channel = ((!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "frequency") == null) ? 0: (Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency"))));
if (channel == 16) {
menu.replaceExistingItem(42, new CustomItem(SlimefunItems.CHEST_TERMINAL, "&bChannel ID: &3" + (channel + 1)));
menu.addMenuClickHandler(42, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(42,
(p, slot, item, action) -> false
);
}
else {
menu.replaceExistingItem(42, new CustomItem(new ItemStack(MaterialHelper.WoolColours[channel]), "&bChannel ID: &3" + (channel + 1)));
menu.addMenuClickHandler(42, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(42,
(p, slot, item, action) -> false
);
}
menu.replaceExistingItem(43, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzJmOTEwYzQ3ZGEwNDJlNGFhMjhhZjZjYzgxY2Y0OGFjNmNhZjM3ZGFiMzVmODhkYjk5M2FjY2I5ZGZlNTE2In19fQ=="), "&bChannel", "", "&e> Click to increase the Channel ID by 1"));
menu.addMenuClickHandler(43, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
menu.addMenuClickHandler(43, (p, slot, item, action) -> {
int channeln = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (CargoNet.EXTRA_CHANNELS) {
if (channel > 16) channel = 0;
if (channeln > 16) channeln = 0;
}
else {
if (channel > 15) channel = 0;
if (channeln > 15) channeln = 0;
}
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channeln));
newInstance(menu, b);
return false;
}
});
} catch (Exception e) {
@ -252,28 +202,17 @@ public class CargoInputNode extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(2, new CustomItem(new ItemStack(Material.PAPER), "&3Items", "", "&bPut in all Items you want to", "&bblacklist/whitelist"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public int[] getInputSlots() {
return new int[] {19, 20, 21, 28, 29, 30, 37, 38, 39};
}
}

View File

@ -1,14 +1,12 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.compatibility.MaterialHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -44,10 +42,7 @@ public class CargoOutputNode extends SlimefunItem {
try {
menu.replaceExistingItem(12, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjI1OTliZDk4NjY1OWI4Y2UyYzQ5ODg1MjVjOTRlMTlkZGQzOWZhZDA4YTM4Mjg0YTE5N2YxYjcwNjc1YWNjIn19fQ=="), "&bChannel", "", "&e> Click to decrease the Channel ID by 1"));
menu.addMenuClickHandler(12, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(12, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) {
if (CargoNet.EXTRA_CHANNELS) channel = 16;
@ -56,50 +51,37 @@ public class CargoOutputNode extends SlimefunItem {
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
newInstance(menu, b);
return false;
}
});
int channel = ((!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "frequency") == null) ? 0: (Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency"))));
if (channel == 16) {
menu.replaceExistingItem(13, new CustomItem(SlimefunItems.CHEST_TERMINAL, "&bChannel ID: &3" + (channel + 1)));
menu.addMenuClickHandler(13, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(13,
(p, slot, item, action) -> false
);
}
else {
menu.replaceExistingItem(13, new CustomItem(new ItemStack(MaterialHelper.WoolColours[channel]), "&bChannel ID: &3" + (channel + 1)));
menu.addMenuClickHandler(13, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
menu.addMenuClickHandler(13,
(p, slot, item, action) -> false
);
}
menu.replaceExistingItem(14, new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzJmOTEwYzQ3ZGEwNDJlNGFhMjhhZjZjYzgxY2Y0OGFjNmNhZjM3ZGFiMzVmODhkYjk5M2FjY2I5ZGZlNTE2In19fQ=="), "&bChannel", "", "&e> Click to increase the Channel ID by 1"));
menu.addMenuClickHandler(14, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
menu.addMenuClickHandler(14, (p, slot, item, action) -> {
int channeln = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (CargoNet.EXTRA_CHANNELS) {
if (channel > 16) channel = 0;
if (channeln > 16) channeln = 0;
}
else {
if (channel > 15) channel = 0;
if (channeln > 15) channeln = 0;
}
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channeln));
newInstance(menu, b);
return false;
}
});
} catch (Exception e) {
@ -140,14 +122,9 @@ public class CargoOutputNode extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
(p, slot, item, action) -> false
);
}
}
});
}
}
}

View File

@ -3,10 +3,15 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.block.data.Ageable;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -23,13 +28,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.block.data.Ageable;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public abstract class CropGrowthAccelerator extends SlimefunItem {
private static final int[] border = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
@ -75,7 +73,6 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -97,14 +94,8 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}
@ -142,7 +133,6 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
super.register(slimefun);
}
@SuppressWarnings("deprecation")
protected void tick(Block b) throws Exception {
int work = 0;
master:
@ -150,8 +140,7 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
for (int z = -getRadius(); z <= getRadius(); z++) {
Block block = b.getRelative(x, 0, z);
if (crops.containsKey(block.getType())) {
if (block.getData() < crops.get(block.getType())) {
slots:
if (((Ageable) block.getBlockData()).getAge() < crops.get(block.getType())) {
for (int slot : getInputSlots()) {
if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.FERTILIZER, false)) {
if (work > (getSpeed() - 1)) break master;
@ -164,7 +153,7 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
block.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, block.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F);
work++;
break slots;
break;
}
}
}

View File

@ -19,6 +19,7 @@ import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
public abstract class ElectricDustWasher extends AContainer {
@ -43,14 +44,13 @@ public abstract class ElectricDustWasher extends AContainer {
public abstract int getSpeed();
public static boolean legacy_dust_washer = false;
@SuppressWarnings("deprecation")
protected void tick(Block b) {
if (isProcessing(b)) {
int timeleft = progress.get(b);
if (timeleft > 0 && getSpeed() < 10) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -19,6 +19,7 @@ import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
public abstract class ElectricGoldPan extends AContainer {
@ -42,14 +43,13 @@ public abstract class ElectricGoldPan extends AContainer {
public abstract int getSpeed();
@SuppressWarnings("deprecation")
protected void tick(Block b) {
if (isProcessing(b)) {
int timeleft = progress.get(b);
if (timeleft > 0 && getSpeed() < 10) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -6,9 +6,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -25,13 +30,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import me.mrCookieSlime.Slimefun.api.item_transport.RecipeSorter;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
public abstract class ElectricSmeltery extends AContainer {
public static Map<Block, MachineRecipe> processing = new HashMap<Block, MachineRecipe>();
@ -84,7 +82,14 @@ public abstract class ElectricSmeltery extends AContainer {
}
else {
Collections.sort(slots, new RecipeSorter(menu));
return ArrayUtils.toPrimitive(slots.toArray(new Integer[slots.size()]));
int[] array = new int[slots.size()];
for (int i = 0; i < slots.size(); i++) {
array[i] = slots.get(i);
}
return array;
}
}
};
@ -93,7 +98,6 @@ public abstract class ElectricSmeltery extends AContainer {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -113,8 +117,8 @@ public abstract class ElectricSmeltery extends AContainer {
}
}
}
progress.remove(b.getLocation());
processing.remove(b.getLocation());
progress.remove(b);
processing.remove(b);
return true;
}
});
@ -125,47 +129,23 @@ public abstract class ElectricSmeltery extends AContainer {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_in) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
for (int i : getOutputSlots()) {
preset.addMenuClickHandler(i, new AdvancedMenuClickHandler() {

View File

@ -5,11 +5,20 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Block.Vein;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
@ -25,16 +34,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class FluidPump extends SlimefunItem{
public static Map<Block, MachineRecipe> processing = new HashMap<Block, MachineRecipe>();
@ -74,36 +73,18 @@ public class FluidPump extends SlimefunItem{
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_in) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_out) {
preset.addItem(i, new CustomItem(new ItemStack(Material.ORANGE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : getOutputSlots()) {
@ -209,7 +190,7 @@ public class FluidPump extends SlimefunItem{
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));

View File

@ -15,13 +15,13 @@ public abstract class FoodComposter extends AContainer {
@Override
public void registerDefaultRecipes() {
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD2}, new ItemStack[] {SlimefunItems.FERTILIZER2});
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD3}, new ItemStack[] {SlimefunItems.FERTILIZER3});
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD4}, new ItemStack[] {SlimefunItems.FERTILIZER4});
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD5}, new ItemStack[] {SlimefunItems.FERTILIZER5});
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD6}, new ItemStack[] {SlimefunItems.FERTILIZER6});
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD7}, new ItemStack[] {SlimefunItems.FERTILIZER7});
registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD8}, new ItemStack[] {SlimefunItems.FERTILIZER8});
registerRecipe(30, new ItemStack[] {SlimefunItems.WHEAT_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.WHEAT_FERTILIZER});
registerRecipe(30, new ItemStack[] {SlimefunItems.CARROT_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.CARROT_FERTILIZER});
registerRecipe(30, new ItemStack[] {SlimefunItems.POTATO_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.POTATO_FERTILIZER});
registerRecipe(30, new ItemStack[] {SlimefunItems.SEEDS_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.SEEDS_FERTILIZER});
registerRecipe(30, new ItemStack[] {SlimefunItems.BEETROOT_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.BEETROOT_FERTILIZER});
registerRecipe(30, new ItemStack[] {SlimefunItems.MELON_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.MELON_FERTILIZER});
registerRecipe(30, new ItemStack[] {SlimefunItems.APPLE_ORGANIC_FOOD}, new ItemStack[] {SlimefunItems.APPLE_FERTILIZER});
}
@Override

View File

@ -16,12 +16,12 @@ public abstract class FoodFabricator extends AContainer {
@Override
public void registerDefaultRecipes() {
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.WHEAT)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD2});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.CARROT)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD3});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.POTATO)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD5});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.BEETROOT)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD6});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.MELON)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD7});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.APPLE)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD8});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.WHEAT)}, new ItemStack[] {SlimefunItems.WHEAT_ORGANIC_FOOD});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.CARROT)}, new ItemStack[] {SlimefunItems.CARROT_ORGANIC_FOOD});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.POTATO)}, new ItemStack[] {SlimefunItems.POTATO_ORGANIC_FOOD});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.BEETROOT)}, new ItemStack[] {SlimefunItems.BEETROOT_ORGANIC_FOOD});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.MELON)}, new ItemStack[] {SlimefunItems.MELON_ORGANIC_FOOD});
registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.APPLE)}, new ItemStack[] {SlimefunItems.APPLE_ORGANIC_FOOD});
}
@Override

View File

@ -6,6 +6,12 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
@ -26,13 +32,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import me.mrCookieSlime.Slimefun.api.item_transport.RecipeSorter;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public abstract class HeatedPressureChamber extends AContainer {
public HeatedPressureChamber(Category category, ItemStack item, String name, RecipeType recipeType, ItemStack[] recipe) {
@ -76,7 +75,14 @@ public abstract class HeatedPressureChamber extends AContainer {
}
else {
Collections.sort(slots, new RecipeSorter(menu));
return ArrayUtils.toPrimitive(slots.toArray(new Integer[slots.size()]));
int[] array = new int[slots.size()];
for (int i = 0; i < slots.size(); i++) {
array[i] = slots.get(i);
}
return array;
}
}
};

View File

@ -7,6 +7,7 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
@ -82,14 +83,13 @@ public abstract class OilPump extends AContainer {
@Override
public void registerDefaultRecipes() {}
@SuppressWarnings("deprecation")
protected void tick(Block b) {
if (isProcessing(b)) {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -2,9 +2,15 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
@ -18,14 +24,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class ReactorAccessPort extends SlimefunItem {
private static final int[] border = {0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 21, 23};
@ -72,7 +70,6 @@ public class ReactorAccessPort extends SlimefunItem {
@Override
public void onPlace(Player p, Block b, SlimefunItem item) {
}
@Override
@ -106,91 +103,43 @@ public class ReactorAccessPort extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_1) {
preset.addItem(i, new CustomItem(new ItemStack(Material.LIME_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_2) {
preset.addItem(i, new CustomItem(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_3) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GREEN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(1, new CustomItem(SlimefunItems.URANIUM, "&7Fuel Slot", "", "&rThis Slot accepts radioactive Fuel such as:", "&2Uranium &ror &aNeptunium"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
preset.addItem(22, new CustomItem(SlimefunItems.PLUTONIUM, "&7Byproduct Slot", "", "&rThis Slot contains the Reactor's Byproduct", "&rsuch as &aNeptunium &ror &7Plutonium"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
preset.addItem(7, new CustomItem(SlimefunItems.REACTOR_COOLANT_CELL, "&bCoolant Slot", "", "&rThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
preset.addItem(7, new CustomItem(SlimefunItems.REACTOR_COOLANT_CELL, "&bCoolant Slot", "", "&rThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public String getInventoryTitle() {
@ -217,7 +166,7 @@ public class ReactorAccessPort extends SlimefunItem {
int size = BlockStorage.getInventory(l).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(l).getItemInSlot(slot));
@ -238,4 +187,5 @@ public class ReactorAccessPort extends SlimefunItem {
}
return null;
}
}

View File

@ -18,6 +18,7 @@ import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
public abstract class Refinery extends AContainer {
@ -49,8 +50,8 @@ public abstract class Refinery extends AContainer {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
((Damageable) im).setDamage(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));

View File

@ -1,8 +1,11 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
@ -13,11 +16,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class TrashCan extends SlimefunItem {
private static final int[] border = {0, 1, 2, 3, 5, 4, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
@ -52,14 +50,8 @@ public class TrashCan extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.RED_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}
@ -95,4 +87,5 @@ public class TrashCan extends SlimefunItem {
super.register(slimefun);
}
}

View File

@ -1,9 +1,15 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Math.DoubleHandler;
@ -22,14 +28,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class WitherAssembler extends SlimefunItem {
private static int lifetime = 0;
@ -53,41 +51,29 @@ public class WitherAssembler extends SlimefunItem {
try {
if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "enabled") == null || BlockStorage.getLocationInfo(b.getLocation(), "enabled").equals("false")) {
menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.GUNPOWDER), "&7Enabled: &4\u2718", "", "&e> Click to enable this Machine"));
menu.addMenuClickHandler(22, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(22, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "enabled", "true");
newInstance(menu, b);
return false;
}
});
}
else {
menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.REDSTONE), "&7Enabled: &2\u2714", "", "&e> Click to disable this Machine"));
menu.addMenuClickHandler(22, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
menu.addMenuClickHandler(22, (p, slot, item, action) -> {
BlockStorage.addBlockInfo(b, "enabled", "false");
newInstance(menu, b);
return false;
}
});
}
double offset = (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), "offset") == null) ? 3.0F: Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "offset"));
menu.replaceExistingItem(31, new CustomItem(new ItemStack(Material.PISTON), "&7Offset: &3" + offset + " Block(s)", "", "&rLeft Click: &7+0.1", "&rRight Click: &7-0.1"));
menu.addMenuClickHandler(31, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
double offset = DoubleHandler.fixDouble(Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "offset")) + (arg3.isRightClicked() ? -0.1F: 0.1F));
BlockStorage.addBlockInfo(b, "offset", String.valueOf(offset));
menu.addMenuClickHandler(31, (p, slot, item, action) -> {
double offsetv = DoubleHandler.fixDouble(Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "offset")) + (action.isRightClicked() ? -0.1F : 0.1F));
BlockStorage.addBlockInfo(b, "offset", String.valueOf(offsetv));
newInstance(menu, b);
return false;
}
});
} catch(Exception x) {
x.printStackTrace();
@ -149,69 +135,33 @@ public class WitherAssembler extends SlimefunItem {
private void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_1) {
preset.addItem(i, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
for (int i : border_2) {
preset.addItem(i, new CustomItem(new ItemStack(Material.BROWN_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
preset.addItem(1, new CustomItem(new ItemStack(Material.WITHER_SKELETON_SKULL, (byte) 1), "&7Wither Skull Slot", "", "&rThis Slot accepts Wither Skeleton Skulls"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
preset.addItem(7, new CustomItem(new ItemStack(Material.SOUL_SAND), "&7Soul Sand Slot", "", "&rThis Slot accepts Soul Sand"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
preset.addItem(13, new CustomItem(new ItemStack(Material.CLOCK), "&7Cooldown: &b30 Seconds", "", "&rThis Machine takes up to half a Minute to operate", "&rso give it some Time!"),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
public String getInventoryTitle() {
@ -296,12 +246,8 @@ public class WitherAssembler extends SlimefunItem {
final double offset = Double.parseDouble(BlockStorage.getLocationInfo(b.getLocation(), "offset"));
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
b.getWorld().spawnEntity(new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + offset, b.getZ() + 0.5D), EntityType.WITHER);
}
});
return;
@ -326,4 +272,5 @@ public class WitherAssembler extends SlimefunItem {
public int getEnergyConsumption() {
return 4096;
}
}

View File

@ -2,10 +2,17 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
@ -19,15 +26,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class XPCollector extends SlimefunItem {
private static final int[] border = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
@ -86,7 +84,7 @@ public class XPCollector extends SlimefunItem {
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
inv.setItem(i, new CustomItem(Material.COMMAND_BLOCK, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US"));
}
for (int slot : getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));
@ -114,14 +112,8 @@ public class XPCollector extends SlimefunItem {
protected void constructMenu(BlockMenuPreset preset) {
for (int i : border) {
preset.addItem(i, new CustomItem(new ItemStack(Material.PURPLE_STAINED_GLASS_PANE), " "),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
(p, slot, item, action) -> false
);
}
}
@ -170,9 +162,9 @@ public class XPCollector extends SlimefunItem {
int withdrawn = 0;
for (int level = 0; level < getEXP(b); level = level + 10) {
if (fits(b, new CustomItem(Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge", 0))) {
if (fits(b, new CustomItem(Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"))) {
withdrawn = withdrawn + 10;
pushItems(b, new CustomItem(Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge", 0));
pushItems(b, new CustomItem(Material.EXPERIENCE_BOTTLE, "&aFlask of Knowledge"));
}
}
BlockStorage.addBlockInfo(b, "stored-exp", String.valueOf(xp - withdrawn));

View File

@ -1,11 +1,6 @@
package me.mrCookieSlime.Slimefun.Objects.tasks;
import java.text.DecimalFormat;
import java.util.UUID;
import me.mrCookieSlime.CSCoreLibPlugin.general.Player.PlayerInventory;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
@ -13,27 +8,20 @@ import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class JetBootsTask implements Runnable {
import me.mrCookieSlime.CSCoreLibPlugin.general.Player.PlayerInventory;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy;
UUID uuid;
double speed;
int id;
public class JetBootsTask extends SlimefunTask {
private double speed;
public JetBootsTask(Player p, double speed) {
this.uuid = p.getUniqueId();
super(p);
this.speed = speed;
}
public void setID(int id) {
this.id = id;
}
@Override
public void run() {
if (Bukkit.getPlayer(uuid) == null) Bukkit.getScheduler().cancelTask(id);
else if (Bukkit.getPlayer(uuid).isDead()) Bukkit.getScheduler().cancelTask(id);
else if (!Bukkit.getPlayer(uuid).isSneaking()) Bukkit.getScheduler().cancelTask(id);
else {
void executeTask() {
Player p = Bukkit.getPlayer(uuid);
float cost = 0.075F;
float charge = ItemEnergy.getStoredEnergy(p.getInventory().getBoots());
@ -54,5 +42,3 @@ public class JetBootsTask implements Runnable {
else Bukkit.getScheduler().cancelTask(id);
}
}
}

View File

@ -1,7 +1,5 @@
package me.mrCookieSlime.Slimefun.Objects.tasks;
import java.util.UUID;
import me.mrCookieSlime.CSCoreLibPlugin.general.Player.PlayerInventory;
import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy;
@ -11,14 +9,11 @@ import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class JetpackTask implements Runnable {
UUID uuid;
double thrust;
int id;
public class JetpackTask extends SlimefunTask {
private double thrust;
public JetpackTask(Player p, double thrust) {
this.uuid = p.getUniqueId();
super(p);
this.thrust = thrust;
}
@ -27,11 +22,7 @@ public class JetpackTask implements Runnable {
}
@Override
public void run() {
if (Bukkit.getPlayer(uuid) == null) Bukkit.getScheduler().cancelTask(id);
else if (Bukkit.getPlayer(uuid).isDead()) Bukkit.getScheduler().cancelTask(id);
else if (!Bukkit.getPlayer(uuid).isSneaking()) Bukkit.getScheduler().cancelTask(id);
else {
void executeTask() {
Player p = Bukkit.getPlayer(uuid);
float cost = 0.08F;
float charge = ItemEnergy.getStoredEnergy(p.getInventory().getChestplate());
@ -51,5 +42,3 @@ public class JetpackTask implements Runnable {
else Bukkit.getScheduler().cancelTask(id);
}
}
}

View File

@ -1,32 +1,19 @@
package me.mrCookieSlime.Slimefun.Objects.tasks;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
public class MagnetTask implements Runnable {
UUID uuid;
int id;
public class MagnetTask extends SlimefunTask {
public MagnetTask(Player p) {
this.uuid = p.getUniqueId();
}
public void setID(int id) {
this.id = id;
super(p);
}
@Override
public void run() {
if (Bukkit.getPlayer(uuid) == null) Bukkit.getScheduler().cancelTask(id);
else if (Bukkit.getPlayer(uuid).isDead()) Bukkit.getScheduler().cancelTask(id);
else if (!Bukkit.getPlayer(uuid).isSneaking()) Bukkit.getScheduler().cancelTask(id);
else {
void executeTask() {
for (Entity item: Bukkit.getPlayer(uuid).getNearbyEntities(6D, 6D, 6D)) {
if (item instanceof Item) {
if (!item.hasMetadata("no_pickup") && ((Item) item).getPickupDelay() <= 0) {
@ -36,6 +23,5 @@ public class MagnetTask implements Runnable {
}
}
}
}
}

View File

@ -1,30 +1,17 @@
package me.mrCookieSlime.Slimefun.Objects.tasks;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class ParachuteTask implements Runnable {
UUID uuid;
int id;
public class ParachuteTask extends SlimefunTask {
public ParachuteTask(Player p) {
this.uuid = p.getUniqueId();
}
public void setID(int id) {
this.id = id;
super(p);
}
@Override
public void run() {
if (Bukkit.getPlayer(uuid) == null) Bukkit.getScheduler().cancelTask(id);
else if (Bukkit.getPlayer(uuid).isDead()) Bukkit.getScheduler().cancelTask(id);
else if (!Bukkit.getPlayer(uuid).isSneaking()) Bukkit.getScheduler().cancelTask(id);
else {
void executeTask() {
Player p = Bukkit.getPlayer(uuid);
Vector vector = new Vector(0, 1, 0);
vector.multiply(-0.1);
@ -32,6 +19,5 @@ public class ParachuteTask implements Runnable {
p.setFallDistance(0.0f);
if (!p.isSneaking()) Bukkit.getScheduler().cancelTask(id);
}
}
}

View File

@ -6,6 +6,7 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.handlers.BlockTicker;
import org.bukkit.block.Block;
import org.bukkit.block.data.Waterlogged;
public class RainbowTicker extends BlockTicker {
@ -30,7 +31,13 @@ public class RainbowTicker extends BlockTicker {
} else if (MaterialHelper.isStainedGlass(b.getType())) {
b.setType(MaterialHelper.StainedGlassColours[meta], false);
} else if (MaterialHelper.isStainedGlassPane(b.getType())){
boolean waterlogged = ((Waterlogged) b.getBlockData()).isWaterlogged();
b.setType(MaterialHelper.StainedGlassPaneColours[meta], true);
if (waterlogged) {
Waterlogged block = (Waterlogged) b.getBlockData();
block.setWaterlogged(true);
b.setBlockData(block);
}
} else if (MaterialHelper.isTerracotta(b.getType())){
b.setType(MaterialHelper.TerracottaColours[meta], false);
}

View File

@ -0,0 +1,40 @@
package me.mrCookieSlime.Slimefun.Objects.tasks;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.UUID;
public abstract class SlimefunTask implements Runnable {
protected UUID uuid;
protected int id;
public SlimefunTask(Player p){
this.uuid = p.getUniqueId();
}
public void setID(int id){
this.id = id;
}
@Override
public void run() {
if(cancelTask())
return;
executeTask();
}
/**
*
* @return True if task was cancelled.
*/
private boolean cancelTask(){
if(Bukkit.getPlayer(uuid) == null || Bukkit.getPlayer(uuid).isDead() || !Bukkit.getPlayer(uuid).isSneaking()) {
Bukkit.getScheduler().cancelTask(id);
return true;
}
return false;
}
abstract void executeTask();
}

View File

@ -187,14 +187,14 @@ public class ResearchSetup {
Slimefun.registerResearch(new Research(189, "Top Tier Transmitter", 44), SlimefunItems.GPS_TRANSMITTER_4);
Slimefun.registerResearch(new Research(190, "Energy Networks 101", 6), SlimefunItems.ENERGY_REGULATOR);
Slimefun.registerResearch(new Research(191, "Butcher Androids", 32), SlimefunItems.PROGRAMMABLE_ANDROID_BUTCHER);
Slimefun.registerResearch(new Research(192, "Organic Food", 25), SlimefunItems.FOOD_FABRICATOR, SlimefunItems.ORGANIC_FOOD2, SlimefunItems.ORGANIC_FOOD3, SlimefunItems.ORGANIC_FOOD4, SlimefunItems.ORGANIC_FOOD5, SlimefunItems.ORGANIC_FOOD6, SlimefunItems.ORGANIC_FOOD7);
Slimefun.registerResearch(new Research(192, "Organic Food", 25), SlimefunItems.FOOD_FABRICATOR, SlimefunItems.WHEAT_ORGANIC_FOOD, SlimefunItems.CARROT_ORGANIC_FOOD, SlimefunItems.POTATO_ORGANIC_FOOD, SlimefunItems.SEEDS_ORGANIC_FOOD, SlimefunItems.BEETROOT_ORGANIC_FOOD, SlimefunItems.MELON_ORGANIC_FOOD, SlimefunItems.APPLE_ORGANIC_FOOD);
Slimefun.registerResearch(new Research(193, "Automated Feeding", 25), SlimefunItems.AUTO_BREEDER);
Slimefun.registerResearch(new Research(194, "Advanced Androids", 60), SlimefunItems.PROGRAMMABLE_ANDROID_2);
Slimefun.registerResearch(new Research(195, "Advanced Androids - Butcher", 30), SlimefunItems.PROGRAMMABLE_ANDROID_2_BUTCHER);
Slimefun.registerResearch(new Research(196, "Advanced Androids - Fisherman", 30), SlimefunItems.PROGRAMMABLE_ANDROID_2_FISHERMAN);
Slimefun.registerResearch(new Research(197, "Animal Growth Manipulation", 32), SlimefunItems.ANIMAL_GROWTH_ACCELERATOR);
Slimefun.registerResearch(new Research(198, "Exp Collector", 36), SlimefunItems.XP_COLLECTOR);
Slimefun.registerResearch(new Research(199, "Organic Fertilizer", 36), SlimefunItems.FOOD_COMPOSTER, SlimefunItems.FERTILIZER2, SlimefunItems.FERTILIZER3, SlimefunItems.FERTILIZER4, SlimefunItems.FERTILIZER5, SlimefunItems.FERTILIZER6, SlimefunItems.FERTILIZER7, SlimefunItems.FERTILIZER8);
Slimefun.registerResearch(new Research(199, "Organic Fertilizer", 36), SlimefunItems.FOOD_COMPOSTER, SlimefunItems.WHEAT_FERTILIZER, SlimefunItems.CARROT_FERTILIZER, SlimefunItems.POTATO_FERTILIZER, SlimefunItems.SEEDS_FERTILIZER, SlimefunItems.BEETROOT_FERTILIZER, SlimefunItems.MELON_FERTILIZER, SlimefunItems.APPLE_FERTILIZER);
Slimefun.registerResearch(new Research(200, "Crop Growth Acceleration", 40), SlimefunItems.CROP_GROWTH_ACCELERATOR);
Slimefun.registerResearch(new Research(201, "Upgraded Crop Growth Accelerator", 44), SlimefunItems.CROP_GROWTH_ACCELERATOR_2);
Slimefun.registerResearch(new Research(202, "Reactor Essentials", 36), SlimefunItems.REACTOR_COOLANT_CELL, SlimefunItems.NEPTUNIUM, SlimefunItems.PLUTONIUM);

View File

@ -1,14 +1,13 @@
package me.mrCookieSlime.Slimefun.Setup;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.potion.PotionEffect;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
@ -79,7 +78,6 @@ public class SlimefunManager {
}
@SuppressWarnings("deprecation")
public static boolean isItemSimiliar(ItemStack item, ItemStack SFitem, boolean lore, DataType data) {
if (item == null) return SFitem == null;
if (SFitem == null) return false;
@ -92,7 +90,7 @@ public class SlimefunManager {
if (!(SFitem.getDurability() == item.getData().getData() && SFitem.getData().getData() == item.getDurability())) return false;
}
}
else*/ if (data.equals(DataType.ALWAYS) && item.getDurability() != SFitem.getDurability()) {
else*/ if (data.equals(DataType.ALWAYS) && ((Damageable) item.getItemMeta()).getDamage() != ((Damageable) SFitem.getItemMeta()).getDamage()) {
return false;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,21 +2,13 @@ package me.mrCookieSlime.Slimefun;
import java.io.File;
import me.mrCookieSlime.Slimefun.listeners.*;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldUnloadEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.PluginUtils;
@ -30,11 +22,11 @@ import me.mrCookieSlime.Slimefun.GEO.OreGenSystem;
import me.mrCookieSlime.Slimefun.GEO.Resources.NetherIceResource;
import me.mrCookieSlime.Slimefun.GEO.Resources.OilResource;
import me.mrCookieSlime.Slimefun.GPS.Elevator;
import me.mrCookieSlime.Slimefun.GitHub.Contributor;
import me.mrCookieSlime.Slimefun.GitHub.GitHubConnector;
import me.mrCookieSlime.Slimefun.GitHub.GitHubSetup;
import me.mrCookieSlime.Slimefun.Hashing.ItemHash;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Misc.BookDesign;
import me.mrCookieSlime.Slimefun.Objects.MultiBlock;
import me.mrCookieSlime.Slimefun.Objects.Research;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunArmorPiece;
@ -61,6 +53,8 @@ import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.CargoNet;
import me.mrCookieSlime.Slimefun.api.item_transport.ChestManipulator;
import me.mrCookieSlime.Slimefun.listeners.*;
import net.coreprotect.CoreProtect;
import net.coreprotect.CoreProtectAPI;
@ -83,9 +77,8 @@ public class SlimefunStartup extends JavaPlugin {
private boolean coreProtect = false;
// Supported Versions of Minecraft
final String[] supported = {"v1_13_"};
final String[] supported = {"v1_14_"};
@SuppressWarnings("deprecation")
@Override
public void onEnable() {
CSCoreLibLoader loader = new CSCoreLibLoader(this);
@ -150,18 +143,10 @@ public class SlimefunStartup extends JavaPlugin {
Messages.setup();
// Creating all necessary Folders
// TODO: Make a shortcut method such as createDir(path)
if (!new File("data-storage/Slimefun/blocks").exists()) new File("data-storage/Slimefun/blocks").mkdirs();
if (!new File("data-storage/Slimefun/stored-blocks").exists()) new File("data-storage/Slimefun/stored-blocks").mkdirs();
if (!new File("data-storage/Slimefun/stored-inventories").exists()) new File("data-storage/Slimefun/stored-inventories").mkdirs();
if (!new File("data-storage/Slimefun/stored-chunks").exists()) new File("data-storage/Slimefun/stored-chunks").mkdirs();
if (!new File("data-storage/Slimefun/universal-inventories").exists()) new File("data-storage/Slimefun/universal-inventories").mkdirs();
if (!new File("data-storage/Slimefun/waypoints").exists()) new File("data-storage/Slimefun/waypoints").mkdirs();
if (!new File("data-storage/Slimefun/block-backups").exists()) new File("data-storage/Slimefun/block-backups").mkdirs();
if (!new File("plugins/Slimefun/scripts").exists()) new File("plugins/Slimefun/scripts").mkdirs();
if (!new File("plugins/Slimefun/generators").exists()) new File("plugins/Slimefun/generators").mkdirs();
if (!new File("plugins/Slimefun/error-reports").exists()) new File("plugins/Slimefun/error-reports").mkdirs();
if (!new File("plugins/Slimefun/cache/github").exists()) new File("plugins/Slimefun/cache/github").mkdirs();
String[] storage = {"blocks", "stored-blocks", "stored-inventories", "stored-chunks", "universal-inventories", "waypoints", "block-backups"};
String[] general = {"scripts", "generators", "error-reports", "cache/github"};
for (String s : storage) createDir("data-storage/Slimefun/" + s);
for (String s : general) createDir("plugins/Slimefun/" + s);
SlimefunManager.plugin = this;
@ -213,57 +198,13 @@ public class SlimefunStartup extends JavaPlugin {
if (config.getBoolean("items.coolers")) new CoolerListener(this);
// Handle Slimefun Guide being given on Join
// TODO: Move it to its own class, was too lazy
if (config.getBoolean("options.give-guide-on-first-join")) {
getServer().getPluginManager().registerEvents(new Listener() {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
if (!e.getPlayer().hasPlayedBefore()) {
Player p = e.getPlayer();
if (!getWhitelist().getBoolean(p.getWorld().getName() + ".enabled")) return;
if (!getWhitelist().getBoolean(p.getWorld().getName() + ".enabled-items.SLIMEFUN_GUIDE")) return;
if (config.getBoolean("guide.default-view-book")) p.getInventory().addItem(SlimefunGuide.getItem(BookDesign.BOOK));
else p.getInventory().addItem(SlimefunGuide.getItem(BookDesign.CHEST));
}
}
}, this);
}
if (config.getBoolean("options.give-guide-on-first-join")) new GuideOnJoinListener(this);
// Load/Unload Worlds in Slimefun
// TODO: Move it to its own class, was too lazy
getServer().getPluginManager().registerEvents(new Listener() {
@EventHandler
public void onWorldLoad(WorldLoadEvent e) {
BlockStorage.getForcedStorage(e.getWorld());
SlimefunStartup.getWhitelist().setDefaultValue(e.getWorld().getName() + ".enabled", true);
SlimefunStartup.getWhitelist().setDefaultValue(e.getWorld().getName() + ".enabled-items.SLIMEFUN_GUIDE", true);
SlimefunStartup.getWhitelist().save();
}
@EventHandler
public void onWorldUnload(WorldUnloadEvent e) {
BlockStorage storage = BlockStorage.getStorage(e.getWorld());
if (storage != null) storage.save(true);
else System.err.println("[Slimefun] Could not save Slimefun Blocks for World \"" + e.getWorld().getName() + "\"");
}
}, this);
new WorldListener(this);
// Clear the Slimefun Guide History upon Player Leaving
// TODO: Move it to its own class, was too lazy
getServer().getPluginManager().registerEvents(new Listener() {
@EventHandler
public void onDisconnect(PlayerQuitEvent e) {
SlimefunGuide.history.remove(e.getPlayer().getUniqueId());
}
}, this);
new PlayerQuitListener(this);
// Initiating various Stuff and all Items with a slightly delay (0ms after the Server finished loading)
getServer().getScheduler().scheduleSyncDelayedTask(this, () -> {
@ -348,17 +289,13 @@ public class SlimefunStartup extends JavaPlugin {
ticker = new TickerTask();
// Starting all ASYNC Tasks
getServer().getScheduler().scheduleAsyncRepeatingTask(this, new AutoSavingTask(), 1200L, config.getInt("options.auto-save-delay-in-minutes") * 60L * 20L);
getServer().getScheduler().scheduleAsyncRepeatingTask(this, ticker, 100L, config.getInt("URID.custom-ticker-delay"));
getServer().getScheduler().runTaskTimerAsynchronously(this, new AutoSavingTask(), 1200L, config.getInt("options.auto-save-delay-in-minutes") * 60L * 20L);
getServer().getScheduler().runTaskTimerAsynchronously(this, ticker, 100L, config.getInt("URID.custom-ticker-delay"));
getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
getServer().getScheduler().runTaskTimerAsynchronously(this, () -> {
for (GitHubConnector connector : GitHubConnector.connectors) {
connector.pullFile();
}
}
}, 80L, 60 * 60 * 20L);
// Hooray!
@ -368,11 +305,8 @@ public class SlimefunStartup extends JavaPlugin {
coreProtect = getServer().getPluginManager().isPluginEnabled("CoreProtect");
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new BukkitRunnable() {
@Override
public void run() {
getServer().getScheduler().runTaskLater(this, () -> {
exoticGarden = getServer().getPluginManager().isPluginEnabled("ExoticGarden"); // Had to do it this way, otherwise it seems disabled.
}
}, 0);
if (clearlag) new ClearLaggIntegration(this);
@ -395,9 +329,11 @@ public class SlimefunStartup extends JavaPlugin {
public void onDisable() {
Bukkit.getScheduler().cancelTasks(this);
if (ticker != null) {
// Finishes all started movements/removals of block data
ticker.HALTED = true;
ticker.run();
}
try {
for (World world: Bukkit.getWorlds()) {
@ -411,7 +347,7 @@ public class SlimefunStartup extends JavaPlugin {
}
SlimefunBackup.start();
} catch (Exception x) {}
} catch (Exception ignored) {}
// Prevent Memory Leaks
config = null;
@ -471,6 +407,7 @@ public class SlimefunStartup extends JavaPlugin {
OreGenSystem.map = null;
SlimefunGuide.contributors = null;
GitHubConnector.connectors = null;
Contributor.textures = null;
ChestManipulator.listeners = null;
ItemHash.digest = null;
ItemHash.map = null;
@ -480,6 +417,12 @@ public class SlimefunStartup extends JavaPlugin {
}
}
private void createDir(String path) {
File file = new File(path);
if (!file.exists())
file.mkdirs();
}
public static Config getCfg() {
return config;
}
@ -521,4 +464,5 @@ public class SlimefunStartup extends JavaPlugin {
public CoreProtectAPI getCoreProtectAPI() {
return coreProtectAPI;
}
}

View File

@ -22,14 +22,11 @@ public class WESlimefunManager {
@Subscribe
public void wrapForLogging(final EditSessionEvent event) {
event.setExtent(new AbstractDelegateExtent(event.getExtent()) {
@Override
public boolean setBlock(BlockVector3 pos, BlockStateHolder block) throws WorldEditException {
if (block.getBlockType().getLegacyId() == 0) {
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 pos, T block) throws WorldEditException {
if (block.getBlockType().getMaterial().isAir()) {
World world = Bukkit.getWorld(event.getWorld().getName());
if (world != null) {
Location l = new Location(world, pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
if (BlockStorage.hasBlockInfo(l)) BlockStorage.clearBlockInfo(l);
@ -37,7 +34,6 @@ public class WESlimefunManager {
}
return getExtent().setBlock(pos, block);
}
});
}

View File

@ -107,7 +107,16 @@ public class BlockStorage {
totalBlocks++;
String json = cfg.getString(key);
Config blockInfo = parseBlockInfo(l, json);
if (blockInfo == null) continue;
if (blockInfo == null || !blockInfo.contains("id")) continue;
if (storage.containsKey(l)) {
// It should not be possible to have two blocks on the same location. Ignore the
// new entry if a block is already present and print an error to the console.
System.out.println("[Slimefun] Ignoring duplicate block @ " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ());
System.out.println("[Slimefun] Old block data: " + serializeBlockInfo(storage.get(l)));
System.out.println("[Slimefun] New block data (" + key + "): " + json);
continue;
}
storage.put(l, blockInfo);
if (SlimefunItem.isTicking(file.getName().replace(".sfb", ""))) {
@ -597,7 +606,10 @@ public class BlockStorage {
BlockMenu menu = getInventory(l);
for (HumanEntity human : new ArrayList<>(menu.toInventory().getViewers())) {
// Prevents "java.lang.IllegalStateException: Asynchronous entity add!" when closing inventory while holding an item
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
human.closeInventory();
});
}
inventories.get(l).delete(l);

View File

@ -81,10 +81,7 @@ public class TickerTask implements Runnable {
try {
item.getBlockTicker().update();
if (item.getBlockTicker().isSynchronized()) {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
try {
long timestamp3 = System.currentTimeMillis();
item.getBlockTicker().tick(b, item, BlockStorage.getLocationInfo(l));
@ -179,20 +176,14 @@ public class TickerTask implements Runnable {
BlockStorage._integrated_removeBlockInfo(l, true);
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
l.getBlock().setType(Material.AIR);
}
});
}
else {
bugged_blocks.put(l, errors);
}
}
}
});
}
else {
@ -214,30 +205,9 @@ public class TickerTask implements Runnable {
if (errors == 1) {
File file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + ".err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(2).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(3).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(4).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(5).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(6).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(7).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(8).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(9).err");
if (file.exists()) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + "(10).err");
}
}
}
}
}
}
}
for (int i = 2; i < 11; i++) {
file = new File("plugins/Slimefun/error-reports/" + Clock.getFormattedTime() + " (" + i + ").err");
if (!file.exists()) break;
}
}
try {
@ -294,13 +264,8 @@ public class TickerTask implements Runnable {
BlockStorage._integrated_removeBlockInfo(l, true);
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
l.getBlock().setType(Material.AIR);
}
});
}
else {

View File

@ -106,10 +106,7 @@ public class ChargableBlock {
}
private static void updateTexture(final Location l) throws Exception {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
try {
Block b = l.getBlock();
int charge = getCharge(b), capacity = getMaxCharge(b);
@ -122,7 +119,6 @@ public class ChargableBlock {
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

View File

@ -148,13 +148,9 @@ public class EnergyNet extends Network {
if (item.getEnergyTicker().explode(source)) {
BlockStorage.clearBlockInfo(source);
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
source.getBlock().setType(Material.LAVA);
source.getWorld().createExplosion(source, 0F, false);
}
});
}
else {

View File

@ -157,10 +157,8 @@ public abstract class BlockMenuPreset extends ChestMenu {
}
public void newInstance(final BlockMenu menu, final Location l) {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
public void run() {
Bukkit.getScheduler().runTask(SlimefunStartup.instance, () -> {
newInstance(menu, l.getBlock());
}
});
}

View File

@ -16,14 +16,12 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Directional;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Math.DoubleHandler;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
@ -49,13 +47,7 @@ public class CargoNet extends Network {
private static final ChestTerminalSorter sorter = new ChestTerminalSorter();
public static final int[] terminal_slots = new int[] {0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42};
private static final ItemStack terminal_noitem_item = new CustomItem(new ItemStack(Material.BARRIER), "&4No Item cached");
private static final MenuClickHandler terminal_noitem_handler = new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack stack, ClickAction action) {
return false;
}
};
private static final MenuClickHandler terminal_noitem_handler = (p, slot, item, action) -> false;
public static CargoNet getNetworkFromLocation(Location l) {
return getNetworkFromLocation(l, CargoNet.class);
@ -195,10 +187,7 @@ public class CargoNet extends Network {
CargoNet self = this;
final BlockStorage storage = BlockStorage.getStorage(b.getWorld());
SlimefunStartup.instance.getServer().getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
SlimefunStartup.instance.getServer().getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
if (BlockStorage.getLocationInfo(b.getLocation(), "visualizer") == null) {
self.display();
}
@ -507,13 +496,9 @@ public class CargoNet extends Network {
im.setLore(lore);
stack.setItemMeta(im);
menu.replaceExistingItem(slot, stack);
menu.addMenuClickHandler(slot, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int slot, ItemStack is, ClickAction action) {
menu.addMenuClickHandler(slot, (p, sl, is, action) -> {
requests.add(new ItemRequest(l, 44, new CustomItem(item.getItem(), action.isRightClicked() ? (item.getAmount() > item.getItem().getMaxStackSize() ? item.getItem().getMaxStackSize(): item.getAmount()): 1), ItemTransportFlow.WITHDRAW));
return false;
}
});
}
@ -529,8 +514,6 @@ public class CargoNet extends Network {
}
}
}
}
});
}
}
@ -549,4 +532,5 @@ public class CargoNet extends Network {
} catch (Exception e) {}
return freq;
}
}

View File

@ -8,10 +8,9 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import org.bukkit.Location;
import org.bukkit.Color;
import me.mrCookieSlime.CSCoreLibPlugin.general.Particles.MC_1_13.ParticleEffect;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import org.bukkit.Particle;
public abstract class Network {
private static List<Network> NETWORK_LIST = new ArrayList<Network>();
@ -158,9 +157,9 @@ public abstract class Network {
public void run() {
for(Location l: connectedLocations) {
try {
l.getWorld().spawnParticle(Particle.REDSTONE, l.clone().add(0.5, 0.5, 0.5), 1, new Particle.DustOptions(Color.RED, 1.0F));
ParticleEffect.REDSTONE.display(l.clone().add(0.5, 0.5, 0.5), 0, 0, 0, 1, 1);
} catch(Exception e) {
e.printStackTrace();
}
}
}

View File

@ -13,13 +13,9 @@ import me.mrCookieSlime.Slimefun.SlimefunStartup;
public class CargoHologram {
public static void update(final Block b, final String name) {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
ArmorStand hologram = getArmorStand(b);
hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', name));
}
});
}

View File

@ -18,24 +18,16 @@ public class EnergyHologram {
}
public static void update(final Block b, final String name) {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
ArmorStand hologram = getArmorStand(b);
hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', name));
}
});
}
public static void remove(final Block b) {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
ArmorStand hologram = getArmorStand(b);
hologram.remove();
}
});
}

View File

@ -10,10 +10,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuHelper.ChatHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Math.DoubleHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.ArmorStandFactory;
@ -23,7 +20,7 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage;
public class Projector {
public static ArmorStand getArmorStand(Block projector) {
String nametag = ChatColor.translateAlternateColorCodes('&', BlockStorage.getLocationInfo(projector.getLocation(), "text"));
String nametag = BlockStorage.getLocationInfo(projector.getLocation(), "text");
double offset = Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset"));
Location l = new Location(projector.getWorld(), projector.getX() + 0.5, projector.getY() + offset, projector.getZ() + 0.5);
@ -42,40 +39,28 @@ public class Projector {
ChestMenu menu = new ChestMenu("Hologram Settings");
menu.addItem(0, new CustomItem(new ItemStack(Material.NAME_TAG), "&7Text &e(Click to edit)", "", "&r" + ChatColor.translateAlternateColorCodes('&', BlockStorage.getLocationInfo(projector.getLocation(), "text"))));
menu.addMenuClickHandler(0, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
p.closeInventory();
Messages.local.sendTranslation(p, "machines.HOLOGRAM_PROJECTOR.enter-text", true);
MenuHelper.awaitChatInput(p, new ChatHandler() {
@Override
public boolean onChat(Player p, String message) {
menu.addMenuClickHandler(0, (pl, slot, item, action) -> {
pl.closeInventory();
Messages.local.sendTranslation(pl, "machines.HOLOGRAM_PROJECTOR.enter-text", true);
MenuHelper.awaitChatInput(pl, (player, message) -> {
ArmorStand hologram = getArmorStand(projector);
hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', message));
BlockStorage.addBlockInfo(projector, "text", message);
openEditor(p, projector);
BlockStorage.addBlockInfo(projector, "text", hologram.getCustomName());
openEditor(player, projector);
return false;
}
});
return false;
}
});
menu.addItem(1, new CustomItem(new ItemStack(Material.CLOCK), "&7Offset: &e" + DoubleHandler.fixDouble(Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset")) + 1.0D), "", "&rLeft Click: &7+0.1", "&rRight Click: &7-0.1"));
menu.addMenuClickHandler(1, new MenuClickHandler() {
@Override
public boolean onClick(Player p, int arg1, ItemStack arg2, ClickAction arg3) {
double offset = DoubleHandler.fixDouble(Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset")) + (arg3.isRightClicked() ? -0.1F: 0.1F));
menu.addMenuClickHandler(1, (pl, slot, item, action) -> {
double offset = DoubleHandler.fixDouble(Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset")) + (action.isRightClicked() ? -0.1F : 0.1F));
ArmorStand hologram = getArmorStand(projector);
Location l = new Location(projector.getWorld(), projector.getX() + 0.5, projector.getY() + offset, projector.getZ() + 0.5);
hologram.teleport(l);
BlockStorage.addBlockInfo(projector, "offset", String.valueOf(offset));
openEditor(p, projector);
openEditor(pl, projector);
return false;
}
});
menu.open(p);

View File

@ -28,14 +28,10 @@ public class ReactorHologram {
}
public static void update(final Location l, final String name) {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
ArmorStand hologram = getArmorStand(l);
if (!hologram.isCustomNameVisible()) hologram.setCustomNameVisible(true);
hologram.setCustomName(ChatColor.translateAlternateColorCodes('&', name));
}
});
}

View File

@ -6,18 +6,6 @@ import java.util.List;
import java.util.Set;
import java.util.UUID;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Variable;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Player.PlayerInventory;
import me.mrCookieSlime.CSCoreLibPlugin.general.String.StringUtils;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.AncientAltar.Pedestals;
import me.mrCookieSlime.Slimefun.AncientAltar.RitualAnimation;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Setup.Messages;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.Variables;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -36,6 +24,18 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.Vector;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Variable;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Player.PlayerInventory;
import me.mrCookieSlime.CSCoreLibPlugin.general.String.StringUtils;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.AncientAltar.Pedestals;
import me.mrCookieSlime.Slimefun.AncientAltar.RitualAnimation;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Setup.Messages;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.Variables;
public class AncientAltarListener implements Listener {
public AncientAltarListener(SlimefunStartup plugin) {
@ -70,12 +70,8 @@ public class AncientAltarListener implements Listener {
final UUID uuid = stack.getUniqueId();
removed_items.add(uuid);
SlimefunStartup.instance.getServer().getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
SlimefunStartup.instance.getServer().getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
removed_items.remove(uuid);
}
}, 30L);
stack.remove();
@ -190,4 +186,5 @@ public class AncientAltarListener implements Listener {
e.setCancelled(true);
}
}
}

View File

@ -31,10 +31,7 @@ public class AndroidKillingListener implements Listener {
if (e.getEntity().hasMetadata("android_killer")) {
for (MetadataValue value: e.getEntity().getMetadata("android_killer")) {
final AndroidObject obj = (AndroidObject) value.value();
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
List<ItemStack> items = new ArrayList<ItemStack>();
for (Entity n : e.getEntity().getNearbyEntities(0.5D, 0.5D, 0.5D)) {
if (n instanceof Item && !n.hasMetadata("no_pickup")) {
@ -63,7 +60,6 @@ public class AndroidKillingListener implements Listener {
obj.getAndroid().addItems(obj.getBlock(), items.toArray(new ItemStack[items.size()]));
ExperienceOrb exp = (ExperienceOrb) e.getEntity().getWorld().spawnEntity(e.getEntity().getLocation(), EntityType.EXPERIENCE_ORB);
exp.setExperience(1 + CSCoreLib.randomizer().nextInt(6));
}
}, 1L);
return;
}

View File

@ -84,13 +84,9 @@ public class BowListener implements Listener {
n.remove();
}
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
Variables.jump.remove(p.getUniqueId());
Variables.remove.remove(p.getUniqueId());
}
}, 20L);
}
}

View File

@ -1,21 +1,18 @@
package me.mrCookieSlime.Slimefun.listeners;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.SkullItem;
import me.mrCookieSlime.EmeraldEnchants.EmeraldEnchants;
import me.mrCookieSlime.EmeraldEnchants.ItemEnchantment;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SoulboundItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.Talisman;
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Variables;
import me.mrCookieSlime.Slimefun.api.Slimefun;
import me.mrCookieSlime.Slimefun.api.Soul;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.*;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.WitherSkeleton;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
@ -24,11 +21,18 @@ import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.ItemStack;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.SkullItem;
import me.mrCookieSlime.EmeraldEnchants.EmeraldEnchants;
import me.mrCookieSlime.EmeraldEnchants.ItemEnchantment;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Variables;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SoulboundItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.Talisman;
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import me.mrCookieSlime.Slimefun.api.Slimefun;
import me.mrCookieSlime.Slimefun.api.Soul;
public class DamageListener implements Listener {
@ -79,17 +83,17 @@ public class DamageListener implements Listener {
if (SlimefunManager.isItemSimiliar(item, SlimefunItem.getItem("SWORD_OF_BEHEADING"), true)) {
if (e.getEntity() instanceof Zombie) {
if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SWORD_OF_BEHEADING", "chance.ZOMBIE"))) {
e.getDrops().add(new CustomItem(Material.ZOMBIE_HEAD, 2));
e.getDrops().add(new ItemStack(Material.ZOMBIE_HEAD));
}
}else if (e.getEntity() instanceof WitherSkeleton) {
if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SWORD_OF_BEHEADING", "chance.WITHER_SKELETON")))
e.getDrops().add(new CustomItem(Material.WITHER_SKELETON_SKULL, 1));
e.getDrops().add(new ItemStack(Material.WITHER_SKELETON_SKULL));
} else if (e.getEntity() instanceof Skeleton) {
if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SWORD_OF_BEHEADING", "chance.SKELETON")))
e.getDrops().add(new CustomItem(Material.SKELETON_SKULL, 0));
e.getDrops().add(new ItemStack(Material.SKELETON_SKULL));
} else if (e.getEntity() instanceof Creeper) {
if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SWORD_OF_BEHEADING", "chance.CREEPER"))) {
e.getDrops().add(new CustomItem(Material.CREEPER_HEAD, 4));
e.getDrops().add(new ItemStack(Material.CREEPER_HEAD));
}
} else if (e.getEntity() instanceof Player) {
if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SWORD_OF_BEHEADING", "chance.PLAYER"))) {

View File

@ -1,11 +1,5 @@
package me.mrCookieSlime.Slimefun.listeners;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Recipe.RecipeCalculator;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.EnhancedFurnace;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import org.bukkit.block.Furnace;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -14,6 +8,13 @@ import org.bukkit.event.inventory.FurnaceBurnEvent;
import org.bukkit.event.inventory.FurnaceSmeltEvent;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.CSCoreLibPlugin.general.Recipe.RecipeCalculator;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.EnhancedFurnace;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
public class FurnaceListener implements Listener {
public FurnaceListener(SlimefunStartup plugin) {
@ -22,24 +23,22 @@ public class FurnaceListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBurn(FurnaceBurnEvent e) {
if (BlockStorage.check(e.getBlock()) != null && BlockStorage.check(e.getBlock()) instanceof EnhancedFurnace) {
EnhancedFurnace furnace = (EnhancedFurnace) BlockStorage.check(e.getBlock());
if (furnace.getFuelEfficiency() > 0) e.setBurnTime(((int) ((1.0 + 0.2 * furnace.getFuelEfficiency()) * e.getBurnTime())));
SlimefunItem furnace = BlockStorage.check(e.getBlock());
if (furnace instanceof EnhancedFurnace) {
if (((EnhancedFurnace) furnace).getFuelEfficiency() > 0)
e.setBurnTime(((int) ((1 + 0.2 * ((EnhancedFurnace) furnace).getFuelEfficiency()) * e.getBurnTime())));
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onSmelt(FurnaceSmeltEvent e) {
if (BlockStorage.check(e.getBlock()) != null && BlockStorage.check(e.getBlock()) instanceof EnhancedFurnace) {
EnhancedFurnace furnace = (EnhancedFurnace) BlockStorage.check(e.getBlock());
SlimefunItem furnace = BlockStorage.check(e.getBlock());
if (furnace instanceof EnhancedFurnace) {
Furnace f = (Furnace) e.getBlock().getState();
int amount = f.getInventory().getSmelting().getType().toString().endsWith("_ORE") ? furnace.getOutput(): 1;
ItemStack output = RecipeCalculator.getSmeltedOutput(f.getInventory().getSmelting().getType());
ItemStack result = f.getInventory().getResult();
if (result != null) result = result.clone();
f.getInventory().setResult(null);
if (result != null) f.getInventory().setResult(new CustomItem(result, result.getAmount() + amount > result.getMaxStackSize() ? result.getMaxStackSize(): result.getAmount() + amount));
else f.getInventory().setResult(new CustomItem(output, output.getAmount() + amount > output.getType().getMaxStackSize() ? output.getType().getMaxStackSize(): output.getAmount() + amount));
int amount = f.getInventory().getSmelting().getType().toString().endsWith("_ORE") ? ((EnhancedFurnace) furnace).getOutput() : 1;
ItemStack result = f.getInventory().getResult() == null ? RecipeCalculator.getSmeltedOutput(f.getInventory().getSmelting().getType()) : f.getInventory().getResult().clone();
if (result != null)
f.getInventory().setResult(new CustomItem(result, result.getAmount() + amount > result.getMaxStackSize() ? result.getMaxStackSize() : result.getAmount() + amount));
}
}

View File

@ -0,0 +1,30 @@
package me.mrCookieSlime.Slimefun.listeners;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import me.mrCookieSlime.Slimefun.SlimefunGuide;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Misc.BookDesign;
public class GuideOnJoinListener implements Listener {
public GuideOnJoinListener(SlimefunStartup plugin) {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
if (!e.getPlayer().hasPlayedBefore()) {
Player p = e.getPlayer();
if (!SlimefunStartup.getWhitelist().getBoolean(p.getWorld().getName() + ".enabled")) return;
if (!SlimefunStartup.getWhitelist().getBoolean(p.getWorld().getName() + ".enabled-items.SLIMEFUN_GUIDE")) return;
p.getInventory().addItem(SlimefunStartup.getCfg().getBoolean("guide.default-view-book")
? SlimefunGuide.getItem(BookDesign.BOOK) : SlimefunGuide.getItem(BookDesign.CHEST));
}
}
}

View File

@ -1,15 +1,16 @@
package me.mrCookieSlime.Slimefun.listeners;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BrewingStand;
import org.bukkit.block.Hopper;
import org.bukkit.block.Skull;
import org.bukkit.block.data.Rotatable;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.entity.Wither;
@ -35,9 +36,9 @@ import org.bukkit.potion.PotionEffectType;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Variable;
import me.mrCookieSlime.CSCoreLibPlugin.events.ItemUseEvent;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Player.PlayerInventory;
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.Slimefun.SlimefunGuide;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Variables;
@ -64,11 +65,6 @@ public class ItemListener implements Listener {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
/**
* Listens to InventoryMoveItemEvent to handle IGNITION_CHAMBER.
* @param e InventoryMoveItemEvent
* @since 4.1.11
*/
@EventHandler
public void onIgnitionChamberItemMove(InventoryMoveItemEvent e) {
if (e.getInitiator().getHolder() instanceof Hopper) {
@ -78,7 +74,6 @@ public class ItemListener implements Listener {
}
}
@SuppressWarnings("deprecation")
@EventHandler
public void debug(PlayerInteractEvent e) {
if (e.getAction().equals(Action.PHYSICAL) || !e.getHand().equals(EquipmentSlot.HAND)) return;
@ -108,11 +103,11 @@ public class ItemListener implements Listener {
}
else if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
p.sendMessage(" ");
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&d" + e.getClickedBlock().getType() + ":" + e.getClickedBlock().getData() + " &e@ X: " + e.getClickedBlock().getX() + " Y: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&d" + e.getClickedBlock().getType() + " &e@ X: " + e.getClickedBlock().getX() + " Y: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dID: " + "&e" + BlockStorage.checkID(e.getClickedBlock())));
if (e.getClickedBlock().getState() instanceof Skull) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dSkull: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dRotation: &e" + ((Skull) e.getClickedBlock().getState()).getRotation().toString()));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dRotation: &e" + ((Rotatable) e.getClickedBlock().getBlockData()).getRotation().toString()));
}
if (BlockStorage.getStorage(e.getClickedBlock().getWorld()).hasInventory(e.getClickedBlock().getLocation())) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&2\u2714"));
@ -122,7 +117,7 @@ public class ItemListener implements Listener {
}
if (BlockStorage.check(e.getClickedBlock()).isTicking()) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dAsync: &e" + (BlockStorage.check(e.getClickedBlock()).getTicker().isSynchronized() ? "&4\u2718": "&2\u2714")));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dAsync: &e" + (BlockStorage.check(e.getClickedBlock()).getBlockTicker().isSynchronized() ? "&4\u2718": "&2\u2714")));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTotal Timings: &e" + SlimefunStartup.ticker.getTimings(BlockStorage.checkID(e.getClickedBlock())) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
@ -156,7 +151,6 @@ public class ItemListener implements Listener {
}
}
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.NORMAL)
public void onRightClick(ItemUseEvent e) {
if (e.getParentEvent() != null && !e.getParentEvent().getHand().equals(EquipmentSlot.HAND)) {
@ -166,6 +160,16 @@ public class ItemListener implements Listener {
final Player p = e.getPlayer();
ItemStack item = e.getItem();
// Fix for placing water on player heads
if (e.getParentEvent().getAction() == Action.RIGHT_CLICK_BLOCK && item != null && item.getType() == Material.WATER_BUCKET) {
Location water = e.getClickedBlock().getRelative(e.getParentEvent().getBlockFace()).getLocation();
if ((p.getWorld().getBlockAt(water).getType() == Material.PLAYER_HEAD || p.getWorld().getBlockAt(water).getType() == Material.PLAYER_WALL_HEAD) && BlockStorage.hasBlockInfo(water)) {
e.setCancelled(true);
p.getWorld().getBlockAt(water).getState().update(true, false);
return;
}
}
if (SlimefunManager.isItemSimiliar(item, SlimefunGuide.getItem(BookDesign.BOOK), true)) {
if (p.isSneaking()) SlimefunGuide.openSettings(p, item);
else SlimefunGuide.openGuide(p, true);
@ -179,7 +183,7 @@ public class ItemListener implements Listener {
else p.chat("/sf cheat");
}
else if (SlimefunManager.isItemSimiliar(item, SlimefunGuide.getDeprecatedItem(true), true)) {
item = SlimefunGuide.getItem(true);
item = SlimefunGuide.getItem(BookDesign.BOOK);
p.getInventory().setItemInMainHand(item);
PlayerInventory.update(p);
@ -187,7 +191,7 @@ public class ItemListener implements Listener {
else SlimefunGuide.openGuide(p, true);
}
else if (SlimefunManager.isItemSimiliar(item, SlimefunGuide.getDeprecatedItem(false), true)) {
item = SlimefunGuide.getItem(false);
item = SlimefunGuide.getItem(BookDesign.CHEST);
p.getInventory().setItemInMainHand(item);
PlayerInventory.update(p);
@ -200,7 +204,13 @@ public class ItemListener implements Listener {
for (ItemHandler handler : SlimefunItem.getHandlers("ItemInteractionHandler")) {
if (((ItemInteractionHandler) handler).onRightClick(e, p, item)) return;
}
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.DURALUMIN_MULTI_TOOL, false) || SlimefunManager.isItemSimiliar(item, SlimefunItems.SOLDER_MULTI_TOOL, false) || SlimefunManager.isItemSimiliar(item, SlimefunItems.BILLON_MULTI_TOOL, false) || SlimefunManager.isItemSimiliar(item, SlimefunItems.STEEL_MULTI_TOOL, false) || SlimefunManager.isItemSimiliar(item, SlimefunItems.DAMASCUS_STEEL_MULTI_TOOL, false) || SlimefunManager.isItemSimiliar(item, SlimefunItems.REINFORCED_ALLOY_MULTI_TOOL, false) || SlimefunManager.isItemSimiliar(item, SlimefunItems.CARBONADO_MULTI_TOOL, false)) {
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.DURALUMIN_MULTI_TOOL, false)
|| SlimefunManager.isItemSimiliar(item, SlimefunItems.SOLDER_MULTI_TOOL, false)
|| SlimefunManager.isItemSimiliar(item, SlimefunItems.BILLON_MULTI_TOOL, false)
|| SlimefunManager.isItemSimiliar(item, SlimefunItems.STEEL_MULTI_TOOL, false)
|| SlimefunManager.isItemSimiliar(item, SlimefunItems.DAMASCUS_STEEL_MULTI_TOOL, false)
|| SlimefunManager.isItemSimiliar(item, SlimefunItems.REINFORCED_ALLOY_MULTI_TOOL, false)
|| SlimefunManager.isItemSimiliar(item, SlimefunItems.CARBONADO_MULTI_TOOL, false)) {
e.setCancelled(true);
ItemStack tool = null;
for (ItemStack mTool : new ItemStack[] {SlimefunItems.DURALUMIN_MULTI_TOOL, SlimefunItems.SOLDER_MULTI_TOOL, SlimefunItems.BILLON_MULTI_TOOL, SlimefunItems.STEEL_MULTI_TOOL, SlimefunItems.DAMASCUS_STEEL_MULTI_TOOL, SlimefunItems.REINFORCED_ALLOY_MULTI_TOOL, SlimefunItems.CARBONADO_MULTI_TOOL}) {
@ -218,14 +228,14 @@ public class ItemListener implements Listener {
float charge = ItemEnergy.getStoredEnergy(item);
float cost = 0.3F;
if (charge >= cost) {
p.setItemInHand(ItemEnergy.chargeItem(item, -cost));
p.getEquipment().setItemInMainHand(ItemEnergy.chargeItem(item, -cost));
Bukkit.getPluginManager().callEvent(new ItemUseEvent(e.getParentEvent(), SlimefunItem.getByID((String) Slimefun.getItemValue(SlimefunItem.getByItem(tool).getID(), "mode." + modes.get(index) + ".item")).getItem(), e.getClickedBlock()));
}
}
else {
index++;
if (index == modes.size()) index = 0;
Messages.local.sendTranslation(p, "messages.mode-change", true, new Variable("%device%", "Multi Tool"), new Variable("%mode%", (String) Slimefun.getItemValue(SlimefunItem.getByItem(tool).getName(), "mode." + modes.get(index) + ".name")));
Messages.local.sendTranslation(p, "messages.mode-change", true, new Variable("%device%", "Multi Tool"), new Variable("%mode%", (String) Slimefun.getItemValue(SlimefunItem.getByItem(tool).getID(), "mode." + modes.get(index) + ".name")));
Variables.mode.put(p.getUniqueId(), index);
}
}
@ -240,7 +250,7 @@ public class ItemListener implements Listener {
else if (canPlaceBlock(p, e.getClickedBlock().getRelative(e.getParentEvent().getBlockFace())) && SlimefunManager.isItemSimiliar(item, SlimefunItems.CARGO_OUTPUT_ADVANCED, true));
else if (canPlaceBlock(p, e.getClickedBlock().getRelative(e.getParentEvent().getBlockFace())) && SlimefunManager.isItemSimiliar(item, SlimefunItems.CT_IMPORT_BUS, true));
else if (canPlaceBlock(p, e.getClickedBlock().getRelative(e.getParentEvent().getBlockFace())) && SlimefunManager.isItemSimiliar(item, SlimefunItems.CT_EXPORT_BUS, true));
else {
else if (!p.isSneaking() || item == null || item.getType() == Material.AIR) {
e.setCancelled(true);
BlockStorage storage = BlockStorage.getStorage(e.getClickedBlock().getWorld());
@ -295,8 +305,7 @@ public class ItemListener implements Listener {
else if (item.getType() == Material.POTION) {
SlimefunItem sfItem = SlimefunItem.getByItem(item);
if (sfItem != null && sfItem instanceof Juice) {
// Fix for 1.11 and 1.12 where Saturation potions are no longer working
// Fix for Saturation on potions is no longer working
for (PotionEffect effect : ((PotionMeta) item.getItemMeta()).getCustomEffects()) {
if (effect.getType().equals(PotionEffectType.SATURATION)) {
p.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, effect.getDuration(), effect.getAmplifier()));
@ -326,22 +335,11 @@ public class ItemListener implements Listener {
// Remove the glass bottle once drunk
final int m = mode;
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
if (m == 0) {
p.getInventory().setItemInMainHand(null);
}
else if (m == 1) {
p.getInventory().setItemInOffHand(null);
}
else if (m == 2) {
p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1));
}
}
}, 1L);
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
if (m == 0) p.getEquipment().setItemInMainHand(null);
else if (m == 1) p.getEquipment().setItemInOffHand(null);
else if (m == 2) p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1));
}, 0L);
}
}
}
@ -372,7 +370,7 @@ public class ItemListener implements Listener {
SlimefunItem item = BlockStorage.check(e.getBlock());
if (item != null) {
if (item.getID().equals("WITHER_PROOF_OBSIDIAN")) e.setCancelled(true);
if (item.getID().equals("WITHER_PROOF_GLASS")) e.setCancelled(true);
else if (item.getID().equals("WITHER_PROOF_GLASS")) e.setCancelled(true);
}
}
}
@ -381,7 +379,6 @@ public class ItemListener implements Listener {
public void onAnvil(InventoryClickEvent e) {
if (e.getRawSlot() == 2 && e.getWhoClicked() instanceof Player && e.getInventory().getType() == InventoryType.ANVIL) {
if (SlimefunManager.isItemSimiliar(e.getInventory().getContents()[0], SlimefunItems.ELYTRA, true)) return;
if (SlimefunItem.getByItem(e.getInventory().getContents()[0]) != null && !SlimefunItem.isDisabled(e.getInventory().getContents()[0])) {
e.setCancelled(true);
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
@ -396,4 +393,5 @@ public class ItemListener implements Listener {
if (e.getRawSlot() < inventory.getSize()) e.setCancelled(SlimefunItem.getByItem(e.getCursor()) != null);
}
}
}

View File

@ -0,0 +1,21 @@
package me.mrCookieSlime.Slimefun.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import me.mrCookieSlime.Slimefun.SlimefunGuide;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
public class PlayerQuitListener implements Listener {
public PlayerQuitListener(SlimefunStartup plugin) {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onDisconnect(PlayerQuitEvent e) {
SlimefunGuide.history.remove(e.getPlayer().getUniqueId());
}
}

View File

@ -12,6 +12,7 @@ import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import me.mrCookieSlime.Slimefun.api.Slimefun;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Sound;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.LivingEntity;
@ -88,12 +89,11 @@ public class TalismanListener implements Listener {
List<String> enchantments = new ArrayList<String>();
for (Enchantment en : Enchantment.values()) {
for (int i = 1; i <= en.getMaxLevel(); i++) {
if ((Boolean) Slimefun.getItemValue("MAGICIAN_TALISMAN", "allow-enchantments." + en.getName() + ".level." + i) && en.canEnchantItem(e.getItem())) enchantments.add(en.getName() + "-" + i);
if ((Boolean) Slimefun.getItemValue("MAGICIAN_TALISMAN", "allow-enchantments." + en.getKey().getKey() + ".level." + i) && en.canEnchantItem(e.getItem())) enchantments.add(en.getKey().getKey() + "-" + i);
}
}
String enchant = enchantments.get(SlimefunStartup.randomize(enchantments.size()));
e.getEnchantsToAdd().put(Enchantment.getByName(enchant.split("-")[0]), Integer.parseInt(enchant.split("-")[1]));
e.getEnchantsToAdd().put(Enchantment.getByKey(NamespacedKey.minecraft(enchant.split("-")[0])), Integer.parseInt(enchant.split("-")[1]));
}
if (!e.getEnchantsToAdd().containsKey(Enchantment.SILK_TOUCH) && Enchantment.LOOT_BONUS_BLOCKS.canEnchantItem(e.getItem())) {
if (Talisman.checkFor(e, SlimefunItem.getByID("WIZARD_TALISMAN"))) {
@ -102,7 +102,6 @@ public class TalismanListener implements Listener {
for (Enchantment en : enchantments) {
if (SlimefunStartup.chance(100, 40)) e.getEnchantsToAdd().put(en, SlimefunStartup.randomize(3) + 1);
}
e.getItem().addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, SlimefunStartup.randomize(3) + 3);
}
}

View File

@ -56,6 +56,10 @@ public class ToolListener implements Listener {
BlockStorage.addBlockInfo(e.getBlock(), "id", sfItem.getID(), true);
if (SlimefunItem.blockhandler.containsKey(sfItem.getID())) {
SlimefunItem.blockhandler.get(sfItem.getID()).onPlace(e.getPlayer(), e.getBlock(), sfItem);
} else {
for (ItemHandler handler : SlimefunItem.getHandlers("BlockPlaceHandler")) {
if (((BlockPlaceHandler) handler).onBlockPlace(e, item)) break;
}
}
}
else {
@ -76,6 +80,9 @@ public class ToolListener implements Listener {
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BASIC_CIRCUIT_BOARD, true)) e.setCancelled(true);
else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.ADVANCED_CIRCUIT_BOARD, true)) e.setCancelled(true);
else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.PORTABLE_CRAFTER, true)) e.setCancelled(true);
else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.PORTABLE_DUSTBIN, true)) e.setCancelled(true);
else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BACKPACK_SMALL, false)) e.setCancelled(true);
else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BACKPACK_MEDIUM, false)) e.setCancelled(true);
else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BACKPACK_LARGE, false)) e.setCancelled(true);
@ -169,11 +176,11 @@ public class ToolListener implements Listener {
public void onBlockBreak(BlockBreakEvent e) {
boolean allow = true;
List<ItemStack> drops = new ArrayList<ItemStack>();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
ItemStack item = e.getPlayer().getEquipment().getItemInMainHand();
int fortune = 1;
Block block2 = e.getBlock().getRelative(BlockFace.UP);
if (StringUtils.equals(block2.getType().toString(), "SAPLING", "WOOD_PLATE", "STONE_PLATE", "IRON_PLATE", "GOLD_PLATE")) {
if (StringUtils.equals(block2.getType().toString(), "SAPLING", "WOOD_PLATE", "STONE_PLATE", "IRON_PLATE", "GOLD_PLATE")) { // ToDo: 1.13 Material names
SlimefunItem sfItem = BlockStorage.check(e.getBlock().getRelative(BlockFace.UP));
if (sfItem != null && !(sfItem instanceof HandledBlock)) {
if (SlimefunItem.blockhandler.containsKey(sfItem.getID())) {
@ -194,6 +201,10 @@ public class ToolListener implements Listener {
if (sfItem != null && !(sfItem instanceof HandledBlock)) {
if (SlimefunItem.blockhandler.containsKey(sfItem.getID())) {
allow = SlimefunItem.blockhandler.get(sfItem.getID()).onBreak(e.getPlayer(), e.getBlock(), sfItem, UnregisterReason.PLAYER_BREAK);
} else {
for (ItemHandler handler : SlimefunItem.getHandlers("BlockBreakHandler")) {
if (((BlockBreakHandler) handler).onBlockBreak(e, item, fortune, drops)) return;
}
}
if (allow) {
drops.add(BlockStorage.retrieve(e.getBlock()));
@ -209,7 +220,6 @@ public class ToolListener implements Listener {
if (fortune <= 0) fortune = 1;
fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + SlimefunStartup.randomize(5) : 1) * (fortune + 1);
}
for (ItemHandler handler : SlimefunItem.getHandlers("BlockBreakHandler")) {
if (((BlockBreakHandler) handler).onBlockBreak(e, item, fortune, drops)) break;
}
@ -254,4 +264,5 @@ public class ToolListener implements Listener {
SlimefunItem item = BlockStorage.check(block);
if (item != null) e.setCancelled(true);
}
}

View File

@ -0,0 +1,33 @@
package me.mrCookieSlime.Slimefun.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldUnloadEvent;
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
public class WorldListener implements Listener {
public WorldListener(SlimefunStartup plugin) {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onWorldLoad(WorldLoadEvent e) {
BlockStorage.getForcedStorage(e.getWorld());
SlimefunStartup.getWhitelist().setDefaultValue(e.getWorld().getName() + ".enabled", true);
SlimefunStartup.getWhitelist().setDefaultValue(e.getWorld().getName() + ".enabled-items.SLIMEFUN_GUIDE", true);
SlimefunStartup.getWhitelist().save();
}
@EventHandler
public void onWorldUnload(WorldUnloadEvent e) {
BlockStorage storage = BlockStorage.getStorage(e.getWorld());
if (storage != null) storage.save(true);
else System.err.println("[Slimefun] Could not save Slimefun Blocks for World \"" + e.getWorld().getName() + "\"");
}
}