mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Reduced technical debt
This commit is contained in:
parent
a83266104e
commit
07271edc47
@ -1,6 +1,6 @@
|
|||||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
|
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.EnumMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -32,7 +32,7 @@ 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};
|
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};
|
||||||
|
|
||||||
public static final Map<Material, Integer> crops = new HashMap<>();
|
public static final Map<Material, Integer> crops = new EnumMap<>(Material.class);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
crops.put(Material.WHEAT, 7);
|
crops.put(Material.WHEAT, 7);
|
||||||
@ -41,6 +41,7 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
|
|||||||
crops.put(Material.NETHER_WART, 3);
|
crops.put(Material.NETHER_WART, 3);
|
||||||
crops.put(Material.BEETROOTS, 3);
|
crops.put(Material.BEETROOTS, 3);
|
||||||
crops.put(Material.COCOA, 8);
|
crops.put(Material.COCOA, 8);
|
||||||
|
crops.put(Material.SWEET_BERRY_BUSH, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CropGrowthAccelerator(Category category, ItemStack item, String name, RecipeType recipeType, ItemStack[] recipe) {
|
public CropGrowthAccelerator(Category category, ItemStack item, String name, RecipeType recipeType, ItemStack[] recipe) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package me.mrCookieSlime.Slimefun.Setup;
|
package me.mrCookieSlime.Slimefun.Setup;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ public final class SlimefunManager {
|
|||||||
|
|
||||||
public static SlimefunStartup plugin;
|
public static SlimefunStartup plugin;
|
||||||
public static String PREFIX;
|
public static String PREFIX;
|
||||||
public static Map<EntityType, List<ItemStack>> drops = new HashMap<>();
|
public static Map<EntityType, List<ItemStack>> drops = new EnumMap<>(EntityType.class);
|
||||||
|
|
||||||
public static void registerArmorSet(ItemStack baseComponent, ItemStack[] items, String idSyntax, PotionEffect[][] effects, boolean special, boolean slimefun) {
|
public static void registerArmorSet(ItemStack baseComponent, ItemStack[] items, String idSyntax, PotionEffect[][] effects, boolean special, boolean slimefun) {
|
||||||
String[] components = new String[] {"_HELMET", "_CHESTPLATE", "_LEGGINGS", "_BOOTS"};
|
String[] components = new String[] {"_HELMET", "_CHESTPLATE", "_LEGGINGS", "_BOOTS"};
|
||||||
@ -33,10 +33,12 @@ public final class SlimefunManager {
|
|||||||
recipes.add(new ItemStack[] {baseComponent, null, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent});
|
recipes.add(new ItemStack[] {baseComponent, null, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent});
|
||||||
recipes.add(new ItemStack[] {baseComponent, baseComponent, baseComponent, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
recipes.add(new ItemStack[] {baseComponent, baseComponent, baseComponent, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
||||||
recipes.add(new ItemStack[] {null, null, null, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
recipes.add(new ItemStack[] {null, null, null, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if ((effects.length - 1) >= i) if (effects[i].length > 0) {
|
if (i < effects.length && effects[i].length > 0) {
|
||||||
new SlimefunArmorPiece(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i), effects[i]).register(slimefun);
|
new SlimefunArmorPiece(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i), effects[i]).register(slimefun);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,10 +52,12 @@ public final class SlimefunManager {
|
|||||||
recipes.add(new ItemStack[] {baseComponent, null, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent});
|
recipes.add(new ItemStack[] {baseComponent, null, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent, baseComponent});
|
||||||
recipes.add(new ItemStack[] {baseComponent, baseComponent, baseComponent, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
recipes.add(new ItemStack[] {baseComponent, baseComponent, baseComponent, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
||||||
recipes.add(new ItemStack[] {null, null, null, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
recipes.add(new ItemStack[] {null, null, null, baseComponent, null, baseComponent, baseComponent, null, baseComponent});
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (vanilla) {
|
if (vanilla) {
|
||||||
new VanillaItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
new VanillaItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2102,10 +2102,11 @@ public final class SlimefunSetup {
|
|||||||
SlimefunStartup.instance.getUtilities().blocks.add(block.getUniqueId());
|
SlimefunStartup.instance.getUtilities().blocks.add(block.getUniqueId());
|
||||||
}
|
}
|
||||||
for (Entity n: ground.getChunk().getEntities()) {
|
for (Entity n: ground.getChunk().getEntities()) {
|
||||||
if (n instanceof LivingEntity && n.getLocation().distance(ground) <= 2.0D && n.getUniqueId() != p.getUniqueId()) {
|
if (n instanceof LivingEntity && n.getLocation().distance(ground) <= 2.0D && !n.getUniqueId().equals(p.getUniqueId())) {
|
||||||
Vector vector = n.getLocation().toVector().subtract(p.getLocation().toVector()).normalize().multiply(1.4);
|
Vector vector = n.getLocation().toVector().subtract(p.getLocation().toVector()).normalize().multiply(1.4);
|
||||||
vector.setY(0.9);
|
vector.setY(0.9);
|
||||||
n.setVelocity(vector);
|
n.setVelocity(vector);
|
||||||
|
|
||||||
if (p.getWorld().getPVP()) {
|
if (p.getWorld().getPVP()) {
|
||||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(p, n, DamageCause.ENTITY_ATTACK, 6D);
|
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(p, n, DamageCause.ENTITY_ATTACK, 6D);
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
@ -2414,9 +2415,10 @@ public final class SlimefunSetup {
|
|||||||
public boolean onRightClick(ItemUseEvent e, Player p, ItemStack item) {
|
public boolean onRightClick(ItemUseEvent e, Player p, ItemStack item) {
|
||||||
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.SCROLL_OF_DIMENSIONAL_TELEPOSITION, true)) {
|
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.SCROLL_OF_DIMENSIONAL_TELEPOSITION, true)) {
|
||||||
for (Entity n: p.getNearbyEntities(10.0, 10.0, 10.0)) {
|
for (Entity n: p.getNearbyEntities(10.0, 10.0, 10.0)) {
|
||||||
if (n instanceof LivingEntity && !(n instanceof ArmorStand) &&n.getUniqueId() != p.getUniqueId()) {
|
if (n instanceof LivingEntity && !(n instanceof ArmorStand) && !n.getUniqueId().equals(p.getUniqueId())) {
|
||||||
float yaw = n.getLocation().getYaw() + 180.0F;
|
float yaw = n.getLocation().getYaw() + 180.0F;
|
||||||
if (yaw > 360.0F) yaw = yaw - 360.0F;
|
if (yaw > 360.0F) yaw = yaw - 360.0F;
|
||||||
|
|
||||||
n.teleport(new Location(n.getWorld(), n.getLocation().getX(), n.getLocation().getY(), n.getLocation().getZ(), yaw, n.getLocation().getPitch()));
|
n.teleport(new Location(n.getWorld(), n.getLocation().getX(), n.getLocation().getY(), n.getLocation().getZ(), yaw, n.getLocation().getPitch()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,6 @@ public final class SlimefunStartup extends JavaPlugin {
|
|||||||
|
|
||||||
public static SlimefunStartup instance;
|
public static SlimefunStartup instance;
|
||||||
|
|
||||||
private static PluginUtils utils;
|
|
||||||
private static Config researches;
|
private static Config researches;
|
||||||
private static Config items;
|
private static Config items;
|
||||||
private static Config whitelist;
|
private static Config whitelist;
|
||||||
@ -142,7 +141,7 @@ public final class SlimefunStartup extends JavaPlugin {
|
|||||||
|
|
||||||
System.out.println("[Slimefun] Loading Config...");
|
System.out.println("[Slimefun] Loading Config...");
|
||||||
|
|
||||||
utils = new PluginUtils(this);
|
PluginUtils utils = new PluginUtils(this);
|
||||||
utils.setupConfig();
|
utils.setupConfig();
|
||||||
|
|
||||||
// Loading all extra configs
|
// Loading all extra configs
|
||||||
|
@ -89,7 +89,8 @@ public class BlockStorage {
|
|||||||
|
|
||||||
File f = new File(path_blocks + w.getName());
|
File f = new File(path_blocks + w.getName());
|
||||||
if (f.exists()) {
|
if (f.exists()) {
|
||||||
long total = f.listFiles().length, start = System.currentTimeMillis();
|
long total = f.listFiles().length;
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
long done = 0;
|
long done = 0;
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
long totalBlocks = 0;
|
long totalBlocks = 0;
|
||||||
@ -525,7 +526,9 @@ public class BlockStorage {
|
|||||||
if (item != null && item.isTicking()) {
|
if (item != null && item.isTicking()) {
|
||||||
String chunk_string = locationToChunkString(l);
|
String chunk_string = locationToChunkString(l);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
Set<Location> locations = ticking_chunks.containsKey(chunk_string) ? ticking_chunks.get(chunk_string): new HashSet<>();
|
Set<Location> locations = ticking_chunks.get(chunk_string);
|
||||||
|
if (locations == null) locations = new HashSet<>();
|
||||||
|
|
||||||
locations.add(l);
|
locations.add(l);
|
||||||
ticking_chunks.put(chunk_string, locations);
|
ticking_chunks.put(chunk_string, locations);
|
||||||
if (!loaded_tickers.contains(chunk_string)) loaded_tickers.add(chunk_string);
|
if (!loaded_tickers.contains(chunk_string)) loaded_tickers.add(chunk_string);
|
||||||
@ -723,6 +726,6 @@ public class BlockStorage {
|
|||||||
|
|
||||||
public boolean hasUniversalInventory(Location l) {
|
public boolean hasUniversalInventory(Location l) {
|
||||||
String id = checkID(l);
|
String id = checkID(l);
|
||||||
return id == null ? false: hasUniversalInventory(id);
|
return id != null && hasUniversalInventory(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,15 +162,12 @@ public abstract class Network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
SlimefunStartup.instance.getServer().getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
|
SlimefunStartup.instance.getServer().getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
|
||||||
@Override
|
for(Location l: connectedLocations) {
|
||||||
public void run() {
|
try {
|
||||||
for(Location l: connectedLocations) {
|
ParticleEffect.REDSTONE.display(l.clone().add(0.5, 0.5, 0.5), 0, 0, 0, 1, 1);
|
||||||
try {
|
} catch(Exception e) {
|
||||||
ParticleEffect.REDSTONE.display(l.clone().add(0.5, 0.5, 0.5), 0, 0, 0, 1, 1);
|
e.printStackTrace();
|
||||||
} catch(Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -34,9 +34,7 @@ public final class CargoHologram {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!createIfNonExists) return null;
|
if (!createIfNonExists) return null;
|
||||||
|
else return ArmorStandFactory.createHidden(l);
|
||||||
ArmorStand hologram = ArmorStandFactory.createHidden(l);
|
|
||||||
return hologram;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,7 @@ public final class EnergyHologram {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!createIfNonExists) return null;
|
if (!createIfNonExists) return null;
|
||||||
|
else return ArmorStandFactory.createHidden(l);
|
||||||
ArmorStand hologram = ArmorStandFactory.createHidden(l);
|
|
||||||
return hologram;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class DamageListener implements Listener {
|
|||||||
Soul.storeItem(e.getEntity().getUniqueId(), item);
|
Soul.storeItem(e.getEntity().getUniqueId(), item);
|
||||||
drops.remove();
|
drops.remove();
|
||||||
}
|
}
|
||||||
else if (SlimefunItem.getByItem(removeEnchantments(item)) != null && SlimefunItem.getByItem(removeEnchantments(item)) instanceof SoulboundItem) {
|
else if (SlimefunItem.getByItem(removeEnchantments(item)) instanceof SoulboundItem) {
|
||||||
Soul.storeItem(e.getEntity().getUniqueId(), item);
|
Soul.storeItem(e.getEntity().getUniqueId(), item);
|
||||||
drops.remove();
|
drops.remove();
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,8 @@ public class ItemListener implements Listener {
|
|||||||
}
|
}
|
||||||
else if (item.getType() == Material.POTION) {
|
else if (item.getType() == Material.POTION) {
|
||||||
SlimefunItem sfItem = SlimefunItem.getByItem(item);
|
SlimefunItem sfItem = SlimefunItem.getByItem(item);
|
||||||
if (sfItem != null && sfItem instanceof Juice) {
|
|
||||||
|
if (sfItem instanceof Juice) {
|
||||||
// Fix for Saturation on potions is no longer working
|
// Fix for Saturation on potions is no longer working
|
||||||
for (PotionEffect effect : ((PotionMeta) item.getItemMeta()).getCustomEffects()) {
|
for (PotionEffect effect : ((PotionMeta) item.getItemMeta()).getCustomEffects()) {
|
||||||
if (effect.getType().equals(PotionEffectType.SATURATION)) {
|
if (effect.getType().equals(PotionEffectType.SATURATION)) {
|
||||||
@ -401,10 +402,10 @@ public class ItemListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (e.getEntity() instanceof Wither) {
|
else if (e.getEntity() instanceof Wither) {
|
||||||
SlimefunItem item = BlockStorage.check(e.getBlock());
|
String id = BlockStorage.checkID(e.getBlock());
|
||||||
if (item != null) {
|
if (id != null) {
|
||||||
if (item.getID().equals("WITHER_PROOF_OBSIDIAN")) e.setCancelled(true);
|
if (id.equals("WITHER_PROOF_OBSIDIAN")) e.setCancelled(true);
|
||||||
else if (item.getID().equals("WITHER_PROOF_GLASS")) e.setCancelled(true);
|
else if (id.equals("WITHER_PROOF_GLASS")) e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,11 +415,14 @@ public class ItemListener implements Listener {
|
|||||||
if (e.getRawSlot() == 2 && e.getWhoClicked() instanceof Player && e.getInventory().getType() == InventoryType.ANVIL) {
|
if (e.getRawSlot() == 2 && e.getWhoClicked() instanceof Player && e.getInventory().getType() == InventoryType.ANVIL) {
|
||||||
ItemStack slot0 = e.getInventory().getContents()[0];
|
ItemStack slot0 = e.getInventory().getContents()[0];
|
||||||
ItemStack slot1 = e.getInventory().getContents()[1];
|
ItemStack slot1 = e.getInventory().getContents()[1];
|
||||||
|
|
||||||
if (SlimefunManager.isItemSimiliar(slot0, SlimefunItems.ELYTRA, true)) return;
|
if (SlimefunManager.isItemSimiliar(slot0, SlimefunItems.ELYTRA, true)) return;
|
||||||
|
|
||||||
if (SlimefunItem.getByItem(slot0) != null && !SlimefunItem.isDisabled(slot0)) {
|
if (SlimefunItem.getByItem(slot0) != null && !SlimefunItem.isDisabled(slot0)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||||
} else if (SlimefunItem.getByItem(slot1) != null && !SlimefunItem.isDisabled(slot1)) {
|
}
|
||||||
|
else if (SlimefunItem.getByItem(slot1) != null && !SlimefunItem.isDisabled(slot1)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||||
}
|
}
|
||||||
@ -427,7 +431,8 @@ public class ItemListener implements Listener {
|
|||||||
if (SlimefunManager.isItemSimiliar(slot0, SlimefunGuide.getItem(BookDesign.BOOK), true)) {
|
if (SlimefunManager.isItemSimiliar(slot0, SlimefunGuide.getItem(BookDesign.BOOK), true)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||||
} else if (SlimefunManager.isItemSimiliar(slot0, SlimefunGuide.getItem(BookDesign.CHEST), true)) {
|
}
|
||||||
|
else if (SlimefunManager.isItemSimiliar(slot0, SlimefunGuide.getItem(BookDesign.CHEST), true)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||||
}
|
}
|
||||||
@ -435,7 +440,8 @@ public class ItemListener implements Listener {
|
|||||||
if (SlimefunManager.isItemSimiliar(slot1, SlimefunGuide.getItem(BookDesign.BOOK), true)) {
|
if (SlimefunManager.isItemSimiliar(slot1, SlimefunGuide.getItem(BookDesign.BOOK), true)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||||
} else if (SlimefunManager.isItemSimiliar(slot1, SlimefunGuide.getItem(BookDesign.CHEST), true)) {
|
}
|
||||||
|
else if (SlimefunManager.isItemSimiliar(slot1, SlimefunGuide.getItem(BookDesign.CHEST), true)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,8 @@ public class TalismanListener implements Listener {
|
|||||||
((Player) ((EntityDamageByEntityEvent) e).getDamager()).playSound(((EntityDamageByEntityEvent) e).getDamager().getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 0.7F, 0.7F);
|
((Player) ((EntityDamageByEntityEvent) e).getDamager()).playSound(((EntityDamageByEntityEvent) e).getDamager().getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 0.7F, 0.7F);
|
||||||
((Player) ((EntityDamageByEntityEvent) e).getDamager()).addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 1));
|
((Player) ((EntityDamageByEntityEvent) e).getDamager()).addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 1));
|
||||||
}
|
}
|
||||||
if (e.getEntity() instanceof Player && !e.isCancelled()) {
|
|
||||||
|
if (e.getEntity() instanceof Player) {
|
||||||
if (e.getCause() == DamageCause.LAVA) Talisman.checkFor(e, SlimefunItem.getByID("LAVA_TALISMAN"));
|
if (e.getCause() == DamageCause.LAVA) Talisman.checkFor(e, SlimefunItem.getByID("LAVA_TALISMAN"));
|
||||||
if (e.getCause() == DamageCause.DROWNING) Talisman.checkFor(e, SlimefunItem.getByID("WATER_TALISMAN"));
|
if (e.getCause() == DamageCause.DROWNING) Talisman.checkFor(e, SlimefunItem.getByID("WATER_TALISMAN"));
|
||||||
if (e.getCause() == DamageCause.FALL) Talisman.checkFor(e, SlimefunItem.getByID("ANGEL_TALISMAN"));
|
if (e.getCause() == DamageCause.FALL) Talisman.checkFor(e, SlimefunItem.getByID("ANGEL_TALISMAN"));
|
||||||
|
Loading…
Reference in New Issue
Block a user