mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Cleaning
This commit is contained in:
parent
7c6d722283
commit
c11eb54037
@ -246,8 +246,6 @@ public class WitherAssembler extends SlimefunItem {
|
|||||||
final double offset = Double.parseDouble(BlockStorage.getLocationInfo(b.getLocation(), "offset"));
|
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));
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class JetBootsTask extends SlimefunTask {
|
|||||||
Player p = Bukkit.getPlayer(uuid);
|
Player p = Bukkit.getPlayer(uuid);
|
||||||
float cost = 0.075F;
|
float cost = 0.075F;
|
||||||
float charge = ItemEnergy.getStoredEnergy(p.getInventory().getBoots());
|
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) {
|
if (charge >= cost) {
|
||||||
p.getInventory().setBoots(ItemEnergy.chargeItem(p.getInventory().getBoots(), -cost));
|
p.getInventory().setBoots(ItemEnergy.chargeItem(p.getInventory().getBoots(), -cost));
|
||||||
PlayerInventory.update(p);
|
PlayerInventory.update(p);
|
||||||
|
@ -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[] {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) new SlimefunArmorPiece(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i), effects[i]).register(slimefun);
|
if ((effects.length - 1) >= i) if (effects[i].length > 0) {
|
||||||
else new SlimefunItem(cat, items[i], idSyntax + components[i], RecipeType.ARMOR_FORGE, recipes.get(i)).register(slimefun);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,7 +784,7 @@ public final class SlimefunGuide {
|
|||||||
List<Object> list = new ArrayList<>();
|
List<Object> list = new ArrayList<>();
|
||||||
if (history.containsKey(p.getUniqueId())) list = history.get(p.getUniqueId());
|
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);
|
Object obj = list.get(list.size() - 1);
|
||||||
list.remove(obj);
|
list.remove(obj);
|
||||||
}
|
}
|
||||||
@ -978,7 +978,7 @@ public final class SlimefunGuide {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (sfItem != null) {
|
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++) {
|
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.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,
|
menu.addMenuClickHandler(i,
|
||||||
|
@ -147,7 +147,6 @@ public class CargoNet extends Network {
|
|||||||
super.tick();
|
super.tick();
|
||||||
if (connectorNodes.isEmpty() && terminusNodes.isEmpty()) {
|
if (connectorNodes.isEmpty() && terminusNodes.isEmpty()) {
|
||||||
CargoHologram.update(b, "&7Status: &4&lOFFLINE");
|
CargoHologram.update(b, "&7Status: &4&lOFFLINE");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CargoHologram.update(b, "&7Status: &a&lONLINE");
|
CargoHologram.update(b, "&7Status: &a&lONLINE");
|
||||||
@ -418,7 +417,7 @@ public class CargoNet extends Network {
|
|||||||
else if (storage.hasInventory(target.getLocation())) {
|
else if (storage.hasInventory(target.getLocation())) {
|
||||||
BlockMenu menu = BlockStorage.getInventory(target.getLocation());
|
BlockMenu menu = BlockStorage.getInventory(target.getLocation());
|
||||||
if (BlockStorage.checkID(target.getLocation()).startsWith("BARREL_") && BlockStorage.getLocationInfo(target.getLocation(), "storedItems") != null) {
|
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)) {
|
for (int slot: menu.getPreset().getSlotsAccessedByItemTransport(menu, ItemTransportFlow.WITHDRAW, null)) {
|
||||||
ItemStack is = menu.getItemInSlot(slot);
|
ItemStack is = menu.getItemInSlot(slot);
|
||||||
if (is != null && CargoManager.matchesFilter(l.getBlock(), is, -1)) {
|
if (is != null && CargoManager.matchesFilter(l.getBlock(), is, -1)) {
|
||||||
|
@ -21,7 +21,7 @@ public class Projector {
|
|||||||
|
|
||||||
public static ArmorStand getArmorStand(Block projector) {
|
public static ArmorStand getArmorStand(Block projector) {
|
||||||
String nametag = BlockStorage.getLocationInfo(projector.getLocation(), "text");
|
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);
|
Location l = new Location(projector.getWorld(), projector.getX() + 0.5, projector.getY() + offset, projector.getZ() + 0.5);
|
||||||
|
|
||||||
for (Entity n : l.getChunk().getEntities()) {
|
for (Entity n : l.getChunk().getEntities()) {
|
||||||
|
@ -71,7 +71,7 @@ public class BackpackListener implements Listener {
|
|||||||
else {
|
else {
|
||||||
SlimefunItem sfItem = SlimefunItem.getByItem(e.getCurrentItem());
|
SlimefunItem sfItem = SlimefunItem.getByItem(e.getCurrentItem());
|
||||||
if (SlimefunManager.isItemSimiliar(item, SlimefunItem.getItem("COOLER"), false)) {
|
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 (!(sfItem instanceof Juice)) e.setCancelled(true);
|
||||||
}
|
}
|
||||||
else if (e.getCurrentItem() != null && e.getCurrentItem().getType().toString().contains("SHULKER_BOX")) e.setCancelled(true);
|
else if (e.getCurrentItem() != null && e.getCurrentItem().getType().toString().contains("SHULKER_BOX")) e.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user