1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00
This commit is contained in:
Sfiguz7 2019-08-29 23:18:04 +02:00
parent 7c6d722283
commit c11eb54037
7 changed files with 11 additions and 11 deletions

View File

@ -246,8 +246,6 @@ public class WitherAssembler extends SlimefunItem {
final double offset = Double.parseDouble(BlockStorage.getLocationInfo(b.getLocation(), "offset"));
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;
}
}
}

View File

@ -25,7 +25,7 @@ public class JetBootsTask extends SlimefunTask {
Player p = Bukkit.getPlayer(uuid);
float cost = 0.075F;
float charge = ItemEnergy.getStoredEnergy(p.getInventory().getBoots());
double accuracy = Double.valueOf(new DecimalFormat("##.##").format(speed - 0.7).replace(",", "."));
double accuracy = Double.parseDouble(new DecimalFormat("##.##").format(speed - 0.7).replace(",", "."));
if (charge >= cost) {
p.getInventory().setBoots(ItemEnergy.chargeItem(p.getInventory().getBoots(), -cost));
PlayerInventory.update(p);

View File

@ -34,8 +34,11 @@ public final class SlimefunManager {
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});
for (int i = 0; i < 4; i++) {
if ((effects.length - 1) >= i) if (effects[i].length > 0) new SlimefunArmorPiece(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i), effects[i]).register(slimefun);
else new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
if ((effects.length - 1) >= i) if (effects[i].length > 0) {
new SlimefunArmorPiece(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i), effects[i]).register(slimefun);
} else {
new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
}
}
}

View File

@ -784,7 +784,7 @@ public final class SlimefunGuide {
List<Object> list = new ArrayList<>();
if (history.containsKey(p.getUniqueId())) list = history.get(p.getUniqueId());
if (remove && list.size() >= 1) {
if (remove && !list.isEmpty()) {
Object obj = list.get(list.size() - 1);
list.remove(obj);
}
@ -978,7 +978,7 @@ public final class SlimefunGuide {
});
if (sfItem != null) {
if ((sfItem instanceof SlimefunMachine && ((SlimefunMachine) sfItem).getDisplayRecipes().size() > 0) || (sfItem instanceof SlimefunGadget && ((SlimefunGadget) sfItem).getRecipes().size() > 0)) {
if ((sfItem instanceof SlimefunMachine && !((SlimefunMachine) sfItem).getDisplayRecipes().isEmpty()) || (sfItem instanceof SlimefunGadget && !((SlimefunGadget) sfItem).getRecipes().isEmpty())) {
for (int i = 27; i < 36; i++) {
menu.addItem(i, new CustomItem(Material.LIME_STAINED_GLASS_PANE, SlimefunItem.getByItem(item) instanceof SlimefunMachine ? "&7\u21E9 Recipes made in this Machine \u21E9": " "));
menu.addMenuClickHandler(i,

View File

@ -147,7 +147,6 @@ public class CargoNet extends Network {
super.tick();
if (connectorNodes.isEmpty() && terminusNodes.isEmpty()) {
CargoHologram.update(b, "&7Status: &4&lOFFLINE");
return;
}
else {
CargoHologram.update(b, "&7Status: &a&lONLINE");
@ -418,7 +417,7 @@ public class CargoNet extends Network {
else if (storage.hasInventory(target.getLocation())) {
BlockMenu menu = BlockStorage.getInventory(target.getLocation());
if (BlockStorage.checkID(target.getLocation()).startsWith("BARREL_") && BlockStorage.getLocationInfo(target.getLocation(), "storedItems") != null) {
int stored = Integer.valueOf(BlockStorage.getLocationInfo(target.getLocation(), "storedItems"));
int stored = Integer.parseInt(BlockStorage.getLocationInfo(target.getLocation(), "storedItems"));
for (int slot: menu.getPreset().getSlotsAccessedByItemTransport(menu, ItemTransportFlow.WITHDRAW, null)) {
ItemStack is = menu.getItemInSlot(slot);
if (is != null && CargoManager.matchesFilter(l.getBlock(), is, -1)) {

View File

@ -21,7 +21,7 @@ public class Projector {
public static ArmorStand getArmorStand(Block projector) {
String nametag = BlockStorage.getLocationInfo(projector.getLocation(), "text");
double offset = Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), "offset"));
double offset = Double.parseDouble(BlockStorage.getLocationInfo(projector.getLocation(), "offset"));
Location l = new Location(projector.getWorld(), projector.getX() + 0.5, projector.getY() + offset, projector.getZ() + 0.5);
for (Entity n : l.getChunk().getEntities()) {

View File

@ -71,7 +71,7 @@ public class BackpackListener implements Listener {
else {
SlimefunItem sfItem = SlimefunItem.getByItem(e.getCurrentItem());
if (SlimefunManager.isItemSimiliar(item, SlimefunItem.getItem("COOLER"), false)) {
if (e.getCurrentItem() == null || e.getCurrentItem().getType().equals(Material.AIR));
if (e.getCurrentItem() == null || e.getCurrentItem().getType() == Material.AIR);
else if (!(sfItem instanceof Juice)) e.setCancelled(true);
}
else if (e.getCurrentItem() != null && e.getCurrentItem().getType().toString().contains("SHULKER_BOX")) e.setCancelled(true);