mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-04 00:46:08 +00:00
Code Cleanup, the second.
This commit is contained in:
parent
f6fbcade17
commit
211b15332d
@ -103,24 +103,24 @@ public class CommandIris implements DecreeExecutor {
|
|||||||
@Param(description = "Whether to also remove the folder (if set to false, just does not load the world)", defaultValue = "true")
|
@Param(description = "Whether to also remove the folder (if set to false, just does not load the world)", defaultValue = "true")
|
||||||
boolean delete
|
boolean delete
|
||||||
) {
|
) {
|
||||||
if (!IrisToolbelt.isIrisWorld(world)) {
|
if(!IrisToolbelt.isIrisWorld(world)) {
|
||||||
sender().sendMessage(C.RED + "This is not an Iris world. Iris worlds: " + String.join(", ", Bukkit.getServer().getWorlds().stream().filter(IrisToolbelt::isIrisWorld).map(World::getName).toList()));
|
sender().sendMessage(C.RED + "This is not an Iris world. Iris worlds: " + String.join(", ", Bukkit.getServer().getWorlds().stream().filter(IrisToolbelt::isIrisWorld).map(World::getName).toList()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sender().sendMessage(C.GREEN + "Removing world: " + world.getName());
|
sender().sendMessage(C.GREEN + "Removing world: " + world.getName());
|
||||||
try {
|
try {
|
||||||
if (IrisToolbelt.removeWorld(world)) {
|
if(IrisToolbelt.removeWorld(world)) {
|
||||||
sender().sendMessage(C.GREEN + "Successfully removed " + world.getName() + " from bukkit.yml");
|
sender().sendMessage(C.GREEN + "Successfully removed " + world.getName() + " from bukkit.yml");
|
||||||
} else {
|
} else {
|
||||||
sender().sendMessage(C.YELLOW + "Looks like the world was already removed from bukkit.yml");
|
sender().sendMessage(C.YELLOW + "Looks like the world was already removed from bukkit.yml");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch(IOException e) {
|
||||||
sender().sendMessage(C.RED + "Failed to save bukkit.yml because of " + e.getMessage());
|
sender().sendMessage(C.RED + "Failed to save bukkit.yml because of " + e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
IrisToolbelt.evacuate(world, "Deleting world");
|
IrisToolbelt.evacuate(world, "Deleting world");
|
||||||
Bukkit.unloadWorld(world, false);
|
Bukkit.unloadWorld(world, false);
|
||||||
if (delete && world.getWorldFolder().delete()) {
|
if(delete && world.getWorldFolder().delete()) {
|
||||||
sender().sendMessage(C.GREEN + "Successfully removed world folder");
|
sender().sendMessage(C.GREEN + "Successfully removed world folder");
|
||||||
} else {
|
} else {
|
||||||
sender().sendMessage(C.RED + "Failed to remove world folder");
|
sender().sendMessage(C.RED + "Failed to remove world folder");
|
||||||
@ -316,7 +316,7 @@ public class CommandIris implements DecreeExecutor {
|
|||||||
boolean freshDownload
|
boolean freshDownload
|
||||||
) {
|
) {
|
||||||
if(!confirm) {
|
if(!confirm) {
|
||||||
sender().sendMessage(new String[] {
|
sender().sendMessage(new String[]{
|
||||||
C.RED + "You should always make a backup before using this",
|
C.RED + "You should always make a backup before using this",
|
||||||
C.YELLOW + "Issues caused by this can be, but are not limited to:",
|
C.YELLOW + "Issues caused by this can be, but are not limited to:",
|
||||||
C.YELLOW + " - Broken chunks (cut-offs) between old and new chunks (before & after the update)",
|
C.YELLOW + " - Broken chunks (cut-offs) between old and new chunks (before & after the update)",
|
||||||
|
@ -306,8 +306,7 @@ public class CommandObject implements DecreeExecutor {
|
|||||||
|
|
||||||
Map<Block, BlockData> futureChanges = new HashMap<>();
|
Map<Block, BlockData> futureChanges = new HashMap<>();
|
||||||
|
|
||||||
if(scale != 1)
|
if(scale != 1) {
|
||||||
{
|
|
||||||
o = o.scaled(scale, IrisObjectPlacementScaleInterpolator.TRICUBIC);
|
o = o.scaled(scale, IrisObjectPlacementScaleInterpolator.TRICUBIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,8 +413,7 @@ public class CommandObject implements DecreeExecutor {
|
|||||||
|
|
||||||
Cuboid locs = WorldEditLink.getSelection(sender().player());
|
Cuboid locs = WorldEditLink.getSelection(sender().player());
|
||||||
|
|
||||||
if(locs == null)
|
if(locs == null) {
|
||||||
{
|
|
||||||
sender().sendMessage(C.RED + "You don't have a WorldEdit selection in this world.");
|
sender().sendMessage(C.RED + "You don't have a WorldEdit selection in this world.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -71,13 +71,12 @@ import java.util.function.Supplier;
|
|||||||
|
|
||||||
@Decree(name = "studio", aliases = {"std", "s"}, description = "Studio Commands", studio = true)
|
@Decree(name = "studio", aliases = {"std", "s"}, description = "Studio Commands", studio = true)
|
||||||
public class CommandStudio implements DecreeExecutor {
|
public class CommandStudio implements DecreeExecutor {
|
||||||
public static String hrf(Duration duration) {
|
|
||||||
return duration.toString().substring(2).replaceAll("(\\d[HMS])(?!$)", "$1 ").toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
private CommandFind find;
|
private CommandFind find;
|
||||||
private CommandEdit edit;
|
private CommandEdit edit;
|
||||||
|
|
||||||
|
public static String hrf(Duration duration) {
|
||||||
|
return duration.toString().substring(2).replaceAll("(\\d[HMS])(?!$)", "$1 ").toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
@Decree(description = "Download a project.", aliases = "dl")
|
@Decree(description = "Download a project.", aliases = "dl")
|
||||||
public void download(
|
public void download(
|
||||||
|
@ -473,7 +473,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
if(i == null)
|
if(i == null)
|
||||||
continue;
|
continue;
|
||||||
b++;
|
b++;
|
||||||
items.addAll(i.getLoot(debug, items.isEmpty(), rng, slot, x, y, z, b + b, mgf + b));
|
items.addAll(i.getLoot(debug, rng, slot, x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(PaperLib.isPaper() && getWorld().hasRealWorld()) {
|
if(PaperLib.isPaper() && getWorld().hasRealWorld()) {
|
||||||
|
@ -257,7 +257,7 @@ public class IrisEntity extends IrisRegistrant {
|
|||||||
|
|
||||||
for(String fi : getLoot().getTables()) {
|
for(String fi : getLoot().getTables()) {
|
||||||
IrisLootTable i = gen.getData().getLootLoader().load(fi);
|
IrisLootTable i = gen.getData().getLootLoader().load(fi);
|
||||||
items.addAll(i.getLoot(gen.isStudio(), false, rng.nextParallelRNG(345911), InventorySlotType.STORAGE, finalAt.getBlockX(), finalAt.getBlockY(), finalAt.getBlockZ(), 8, 4));
|
items.addAll(i.getLoot(gen.isStudio(), rng.nextParallelRNG(345911), InventorySlotType.STORAGE, finalAt.getBlockX(), finalAt.getBlockY(), finalAt.getBlockZ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
@ -63,7 +63,7 @@ public class IrisLootTable extends IrisRegistrant {
|
|||||||
@ArrayType(min = 1, type = IrisLoot.class)
|
@ArrayType(min = 1, type = IrisLoot.class)
|
||||||
private KList<IrisLoot> loot = new KList<>();
|
private KList<IrisLoot> loot = new KList<>();
|
||||||
|
|
||||||
public KList<ItemStack> getLoot(boolean debug, boolean doSomething, RNG rng, InventorySlotType slot, int x, int y, int z, int gg, int ffs) {
|
public KList<ItemStack> getLoot(boolean debug, RNG rng, InventorySlotType slot, int x, int y, int z) {
|
||||||
KList<ItemStack> lootf = new KList<>();
|
KList<ItemStack> lootf = new KList<>();
|
||||||
|
|
||||||
int m = 0;
|
int m = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user