mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Merge branch 'master' into map-1.17
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public abstract class AR implements Runnable, CancellableTask {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class AlignedPoint {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDoubleArray;
|
||||
@@ -10,7 +28,7 @@ import com.google.common.util.concurrent.AtomicDoubleArray;
|
||||
* @author cyberpwn
|
||||
*/
|
||||
public class AtomicAverage {
|
||||
protected AtomicDoubleArray values;
|
||||
protected final AtomicDoubleArray values;
|
||||
private double average;
|
||||
private double lastSum;
|
||||
private boolean dirty;
|
||||
@@ -53,7 +71,7 @@ public class AtomicAverage {
|
||||
lastSum = (lastSum - current) + i;
|
||||
values.set(cursor, i);
|
||||
cursor = cursor + 1 < size() ? cursor + 1 : 0;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class AtomicRollingSequence extends AtomicAverage {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
@@ -8,7 +26,7 @@ package com.volmit.iris.util;
|
||||
* @author cyberpwn
|
||||
*/
|
||||
public class Average {
|
||||
protected double[] values;
|
||||
protected final double[] values;
|
||||
private double average;
|
||||
private double lastSum;
|
||||
private boolean dirty;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.object.IrisPosition;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -122,7 +140,7 @@ public class B {
|
||||
BlockData bx = Bukkit.createBlockData(ix);
|
||||
blockDataCache.put(ix, bx);
|
||||
return bx;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
|
||||
@@ -133,7 +151,7 @@ public class B {
|
||||
try {
|
||||
BlockData bd = Material.valueOf(i).createBlockData();
|
||||
blockDataCache.put(ix, bd);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
|
||||
@@ -467,7 +485,7 @@ public class B {
|
||||
|
||||
|
||||
public static String[] getBlockTypes() {
|
||||
KList<String> bt = new KList<String>();
|
||||
KList<String> bt = new KList<>();
|
||||
|
||||
for (Material i : Material.values()) {
|
||||
if (i.isBlock()) {
|
||||
@@ -485,17 +503,17 @@ public class B {
|
||||
}
|
||||
}
|
||||
|
||||
return bt.toArray(new String[bt.size()]);
|
||||
return bt.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public static String[] getItemTypes() {
|
||||
KList<String> bt = new KList<String>();
|
||||
KList<String> bt = new KList<>();
|
||||
|
||||
for (Material i : Material.values()) {
|
||||
String v = i.name().toLowerCase().trim();
|
||||
bt.add(v);
|
||||
}
|
||||
|
||||
return bt.toArray(new String[bt.size()]);
|
||||
return bt.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -35,8 +53,7 @@ public class BlockPosition {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (o instanceof BlockPosition) {
|
||||
BlockPosition ot = (BlockPosition) o;
|
||||
if (o instanceof BlockPosition ot) {
|
||||
|
||||
return ot.x == x && ot.y == y && ot.z == z;
|
||||
}
|
||||
@@ -67,7 +84,7 @@ public class BlockPosition {
|
||||
public static long toLong(int x, int y, int z) {
|
||||
long var3 = 0L;
|
||||
var3 |= (x & m4) << m3;
|
||||
var3 |= (y & m5) << 0L;
|
||||
var3 |= (y & m5);
|
||||
var3 |= (z & m6) << m2;
|
||||
return var3;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.NonNull;
|
||||
@@ -109,12 +127,8 @@ public class Board {
|
||||
team.setSuffix(entry.getSuffix());
|
||||
|
||||
switch (boardSettings.getScoreDirection()) {
|
||||
case UP:
|
||||
objective.getScore(team.getName()).setScore(1 + i);
|
||||
break;
|
||||
case DOWN:
|
||||
objective.getScore(team.getName()).setScore(15 - i);
|
||||
break;
|
||||
case UP -> objective.getScore(team.getName()).setScore(1 + i);
|
||||
case DOWN -> objective.getScore(team.getName()).setScore(15 - i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Getter;
|
||||
@@ -7,6 +25,7 @@ import org.apache.commons.lang.StringUtils;
|
||||
* @author Missionary (missionarymc@gmail.com)
|
||||
* @since 3/29/2018
|
||||
*/
|
||||
@SuppressWarnings("ClassCanBeRecord")
|
||||
public class BoardEntry {
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -11,21 +29,21 @@ import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public class BoardManager {
|
||||
@DontObfuscate
|
||||
|
||||
private final JavaPlugin plugin;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
private BoardSettings boardSettings;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
private final Map<UUID, Board> scoreboards;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
private final BukkitTask updateTask;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public BoardManager(JavaPlugin plugin, BoardSettings boardSettings) {
|
||||
this.plugin = plugin;
|
||||
this.boardSettings = boardSettings;
|
||||
@@ -34,23 +52,23 @@ public class BoardManager {
|
||||
plugin.getServer().getOnlinePlayers().forEach(this::setup);
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public void setBoardSettings(BoardSettings boardSettings) {
|
||||
this.boardSettings = boardSettings;
|
||||
scoreboards.values().forEach(board -> board.setBoardSettings(boardSettings));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public boolean hasBoard(Player player) {
|
||||
return scoreboards.containsKey(player.getUniqueId());
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public Optional<Board> getBoard(Player player) {
|
||||
return Optional.ofNullable(scoreboards.get(player.getUniqueId()));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public void setup(Player player) {
|
||||
Optional.ofNullable(scoreboards.remove(player.getUniqueId())).ifPresent(Board::resetScoreboard);
|
||||
if (player.getScoreboard().equals(Bukkit.getScoreboardManager().getMainScoreboard())) {
|
||||
@@ -59,17 +77,17 @@ public class BoardManager {
|
||||
scoreboards.put(player.getUniqueId(), new Board(player, boardSettings));
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public void remove(Player player) {
|
||||
Optional.ofNullable(scoreboards.remove(player.getUniqueId())).ifPresent(Board::remove);
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public Map<UUID, Board> getScoreboards() {
|
||||
return Collections.unmodifiableMap(scoreboards);
|
||||
}
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public void onDisable() {
|
||||
updateTask.cancel();
|
||||
plugin.getServer().getOnlinePlayers().forEach(this::remove);
|
||||
|
||||
@@ -1,14 +1,32 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
public interface BoardProvider {
|
||||
@DontObfuscate
|
||||
|
||||
String getTitle(Player player);
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
List<String> getLines(Player player);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,34 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
@SuppressWarnings("ClassCanBeRecord")
|
||||
@Getter
|
||||
@Builder
|
||||
public class BoardSettings {
|
||||
@DontObfuscate
|
||||
|
||||
private final BoardProvider boardProvider;
|
||||
|
||||
@DontObfuscate
|
||||
|
||||
private final ScoreDirection scoreDirection;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* Copyright (c) 2010 Graham Edgecombe
|
||||
* All rights reserved.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
* The <code>TAG_Byte_Array</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* Copyright (c) 2010 Graham Edgecombe
|
||||
* All rights reserved.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
* The <code>TAG_Byte</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
@@ -227,11 +245,12 @@ public enum C {
|
||||
private final char code;
|
||||
private final boolean isFormat;
|
||||
private final String toString;
|
||||
private final static Map<Integer, C> BY_ID = new HashMap<Integer, C>();
|
||||
private final static Map<Character, C> BY_CHAR = new HashMap<Character, C>();
|
||||
private final static Map<DyeColor, C> dyeChatMap = new HashMap<DyeColor, C>();
|
||||
private final static Map<C, String> chatHexMap = new HashMap<C, String>();
|
||||
private final static Map<DyeColor, String> dyeHexMap = new HashMap<DyeColor, String>();
|
||||
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
|
||||
private final static Map<Integer, C> BY_ID = new HashMap<>();
|
||||
private final static Map<Character, C> BY_CHAR = new HashMap<>();
|
||||
private final static Map<DyeColor, C> dyeChatMap = new HashMap<>();
|
||||
private final static Map<C, String> chatHexMap = new HashMap<>();
|
||||
private final static Map<DyeColor, String> dyeHexMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
chatHexMap.put(C.BLACK, "#000");
|
||||
@@ -316,7 +335,6 @@ public enum C {
|
||||
/**
|
||||
* get the dye color for the chatcolor
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public DyeColor dye() {
|
||||
return chatToDye(chatColor());
|
||||
@@ -406,9 +424,9 @@ public enum C {
|
||||
}
|
||||
|
||||
public static DyeColor chatToDye(ChatColor color) {
|
||||
for (DyeColor i : dyeChatMap.keySet()) {
|
||||
if (dyeChatMap.get(i).toString().equals(color.toString())) {
|
||||
return i;
|
||||
for (Map.Entry<DyeColor, C> entry : dyeChatMap.entrySet()) {
|
||||
if (entry.getValue().toString().equals(color.toString())) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +455,7 @@ public enum C {
|
||||
hex = hex.substring(1);
|
||||
}
|
||||
|
||||
if (hex.indexOf("x") != -1) {
|
||||
if (hex.contains("x")) {
|
||||
hex = hex.substring(hex.indexOf("x"));
|
||||
}
|
||||
|
||||
@@ -491,7 +509,6 @@ public enum C {
|
||||
/**
|
||||
* Get the ChatColor enum instance instead of C
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ChatColor chatColor() {
|
||||
return ChatColor.getByChar(code);
|
||||
@@ -533,105 +550,43 @@ public enum C {
|
||||
}
|
||||
|
||||
public byte getMeta() {
|
||||
switch (this) {
|
||||
case AQUA:
|
||||
return 11;
|
||||
case BLACK:
|
||||
return 0;
|
||||
case BLUE:
|
||||
return 9;
|
||||
case BOLD:
|
||||
return -1;
|
||||
case DARK_AQUA:
|
||||
return 9;
|
||||
case DARK_BLUE:
|
||||
return 1;
|
||||
case DARK_GRAY:
|
||||
return 8;
|
||||
case DARK_GREEN:
|
||||
return 2;
|
||||
case DARK_PURPLE:
|
||||
return 5;
|
||||
case DARK_RED:
|
||||
return 4;
|
||||
case GOLD:
|
||||
return 6;
|
||||
case GRAY:
|
||||
return 7;
|
||||
case GREEN:
|
||||
return 10;
|
||||
case ITALIC:
|
||||
return -1;
|
||||
case LIGHT_PURPLE:
|
||||
return 13;
|
||||
case MAGIC:
|
||||
return -1;
|
||||
case RED:
|
||||
return 12;
|
||||
case RESET:
|
||||
return -1;
|
||||
case STRIKETHROUGH:
|
||||
return -1;
|
||||
case UNDERLINE:
|
||||
return -1;
|
||||
case WHITE:
|
||||
return 15;
|
||||
case YELLOW:
|
||||
return 14;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return switch (this) {
|
||||
case AQUA -> (byte)11;
|
||||
case BLACK -> (byte)0;
|
||||
case BLUE, DARK_AQUA -> (byte)9;
|
||||
case BOLD, UNDERLINE, STRIKETHROUGH, RESET, MAGIC, ITALIC -> (byte)-1;
|
||||
case DARK_BLUE -> (byte)1;
|
||||
case DARK_GRAY -> (byte)8;
|
||||
case DARK_GREEN -> (byte)2;
|
||||
case DARK_PURPLE -> (byte)5;
|
||||
case DARK_RED -> (byte)4;
|
||||
case GOLD -> (byte)6;
|
||||
case GRAY -> (byte)7;
|
||||
case GREEN -> (byte)10;
|
||||
case LIGHT_PURPLE -> (byte)13;
|
||||
case RED -> (byte)12;
|
||||
case WHITE -> (byte)15;
|
||||
case YELLOW -> (byte)14;
|
||||
};
|
||||
}
|
||||
|
||||
public byte getItemMeta() {
|
||||
switch (this) {
|
||||
case AQUA:
|
||||
return 9;
|
||||
case BLACK:
|
||||
return 15;
|
||||
case BLUE:
|
||||
return 3;
|
||||
case BOLD:
|
||||
return -1;
|
||||
case DARK_AQUA:
|
||||
return 9;
|
||||
case DARK_BLUE:
|
||||
return 11;
|
||||
case DARK_GRAY:
|
||||
return 7;
|
||||
case DARK_GREEN:
|
||||
return 13;
|
||||
case DARK_PURPLE:
|
||||
return 10;
|
||||
case DARK_RED:
|
||||
return 14;
|
||||
case GOLD:
|
||||
return 4;
|
||||
case GRAY:
|
||||
return 8;
|
||||
case GREEN:
|
||||
return 5;
|
||||
case ITALIC:
|
||||
return -1;
|
||||
case LIGHT_PURPLE:
|
||||
return 2;
|
||||
case MAGIC:
|
||||
return -1;
|
||||
case RED:
|
||||
return 14;
|
||||
case RESET:
|
||||
return -1;
|
||||
case STRIKETHROUGH:
|
||||
return -1;
|
||||
case UNDERLINE:
|
||||
return -1;
|
||||
case WHITE:
|
||||
return 0;
|
||||
case YELLOW:
|
||||
return 4;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return switch (this) {
|
||||
case AQUA, DARK_AQUA -> (byte)9;
|
||||
case BLACK -> (byte)15;
|
||||
case BLUE -> (byte)3;
|
||||
case BOLD, UNDERLINE, RESET, STRIKETHROUGH, MAGIC, ITALIC -> (byte)-1;
|
||||
case DARK_BLUE -> (byte)11;
|
||||
case DARK_GRAY -> (byte)7;
|
||||
case DARK_GREEN -> (byte)13;
|
||||
case DARK_PURPLE -> (byte)10;
|
||||
case DARK_RED, RED -> (byte)14;
|
||||
case GOLD, YELLOW -> (byte)4;
|
||||
case GRAY -> (byte)8;
|
||||
case GREEN -> (byte)5;
|
||||
case LIGHT_PURPLE -> (byte)2;
|
||||
case WHITE -> (byte)0;
|
||||
};
|
||||
}
|
||||
|
||||
public static C randomColor() {
|
||||
@@ -645,7 +600,7 @@ public enum C {
|
||||
* @return Any remaining ChatColors to pass onto the next line.
|
||||
*/
|
||||
public static String getLastColors(String input) {
|
||||
String result = "";
|
||||
StringBuilder result = new StringBuilder();
|
||||
int length = input.length();
|
||||
|
||||
// Search backwards from the end as it is faster
|
||||
@@ -656,7 +611,7 @@ public enum C {
|
||||
C color = getByChar(c);
|
||||
|
||||
if (color != null) {
|
||||
result = color + result;
|
||||
result.insert(0, color);
|
||||
|
||||
// Once we find a color or reset we can stop searching
|
||||
if (color.isColor() || color.equals(RESET)) {
|
||||
@@ -666,7 +621,7 @@ public enum C {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public class CDou {
|
||||
private double number;
|
||||
private final double max;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public interface CallbackCV<T> {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public interface CancellableTask {
|
||||
|
||||
@@ -1,10 +1,31 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
@SuppressWarnings("ClassCanBeRecord")
|
||||
@Value
|
||||
public class CarveResult {
|
||||
@SuppressWarnings("RedundantModifiersValueLombok")
|
||||
private final int surface;
|
||||
@SuppressWarnings("RedundantModifiersValueLombok")
|
||||
private final int ceiling;
|
||||
|
||||
public int getHeight() {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class ChronoLatch {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class ChunkPosition {
|
||||
@@ -39,10 +57,9 @@ public class ChunkPosition {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ChunkPosition)) {
|
||||
if (!(obj instanceof ChunkPosition other)) {
|
||||
return false;
|
||||
}
|
||||
ChunkPosition other = (ChunkPosition) obj;
|
||||
return x == other.x && z == other.z;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -27,14 +45,14 @@ public class Chunker<T> {
|
||||
|
||||
public void execute(Consumer<T> consumer, Callback<Double> progress, int progressInterval) {
|
||||
ChronoLatch cl = new ChronoLatch(progressInterval);
|
||||
Contained<Integer> consumed = new Contained<Integer>(0);
|
||||
Contained<Integer> consumed = new Contained<>(0);
|
||||
executor = Executors.newFixedThreadPool(threads);
|
||||
int length = q.size();
|
||||
int remaining = length;
|
||||
|
||||
while (remaining > 0) {
|
||||
int at = remaining;
|
||||
remaining -= (remaining > workload ? workload : remaining);
|
||||
remaining -= (Math.min(remaining, workload));
|
||||
int to = remaining;
|
||||
|
||||
executor.submit(() ->
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -38,9 +56,9 @@ public final class CompoundTag extends Tag {
|
||||
append = "(\"" + this.getName() + "\")";
|
||||
}
|
||||
StringBuilder bldr = new StringBuilder();
|
||||
bldr.append("TAG_Compound" + append + ": " + value.size() + " entries\r\n{\r\n");
|
||||
bldr.append("TAG_Compound").append(append).append(": ").append(value.size()).append(" entries\r\n{\r\n");
|
||||
for (Map.Entry<String, Tag> entry : value.entrySet()) {
|
||||
bldr.append(" " + entry.getValue().toString().replaceAll("\r\n", "\r\n ") + "\r\n");
|
||||
bldr.append(" ").append(entry.getValue().toString().replaceAll("\r\n", "\r\n ")).append("\r\n");
|
||||
}
|
||||
bldr.append("}");
|
||||
return bldr.toString();
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@SuppressWarnings({"hiding", "RedundantSuppression"})
|
||||
@FunctionalInterface
|
||||
public interface Consumer2<A, B> {
|
||||
void accept(A a, B b);
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@SuppressWarnings("ALL")
|
||||
@FunctionalInterface
|
||||
public interface Consumer3<A, B, C> {
|
||||
void accept(A a, B b, C c);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Consumer4<A, B, C, D> {
|
||||
void accept(A a, B b, C c, D d);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Consumer5<A, B, C, D, E> {
|
||||
void accept(A a, B b, C c, D d, E e);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Consumer6<A, B, C, D, E, F> {
|
||||
void accept(A a, B b, C c, D d, E e, F f);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Consumer7<A, B, C, D, E, F, G> {
|
||||
void accept(A a, B b, C c, D d, E e, F f, G g);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Consumer8<A, B, C, D, E, F, G, H> {
|
||||
void accept(A a, B b, C c, D d, E e, F f, G g, H h);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -11,7 +29,7 @@ public abstract class Controller implements IController {
|
||||
tickRate = -1;
|
||||
}
|
||||
|
||||
protected void setTickRate(int rate) {
|
||||
protected void setTickRate(@SuppressWarnings("SameParameterValue") int rate) {
|
||||
this.tickRate = rate;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.File;
|
||||
@@ -5,6 +23,7 @@ import java.io.File;
|
||||
public interface Converter {
|
||||
String getInExtension();
|
||||
|
||||
@SuppressWarnings("SameReturnValue")
|
||||
String getOutExtension();
|
||||
|
||||
void convert(File in, File out);
|
||||
|
||||
@@ -1,9 +1,28 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -39,7 +58,7 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
}
|
||||
|
||||
public KList<Entity> getEntities() {
|
||||
KList<Entity> en = new KList<Entity>();
|
||||
KList<Entity> en = new KList<>();
|
||||
|
||||
for (Chunk i : getChunks()) {
|
||||
for (Entity j : i.getEntities()) {
|
||||
@@ -137,9 +156,10 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
z2 = (Integer) map.get("z2");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Map<String, Object> serialize() {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("worldName", worldName);
|
||||
map.put("x1", x1);
|
||||
map.put("y1", y1);
|
||||
@@ -319,22 +339,15 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
* @return a new Cuboid expanded by the given direction and amount
|
||||
*/
|
||||
public Cuboid expand(CuboidDirection dir, int amount) {
|
||||
switch (dir) {
|
||||
case North:
|
||||
return new Cuboid(worldName, x1 - amount, y1, z1, x2, y2, z2);
|
||||
case South:
|
||||
return new Cuboid(worldName, x1, y1, z1, x2 + amount, y2, z2);
|
||||
case East:
|
||||
return new Cuboid(worldName, x1, y1, z1 - amount, x2, y2, z2);
|
||||
case West:
|
||||
return new Cuboid(worldName, x1, y1, z1, x2, y2, z2 + amount);
|
||||
case Down:
|
||||
return new Cuboid(worldName, x1, y1 - amount, z1, x2, y2, z2);
|
||||
case Up:
|
||||
return new Cuboid(worldName, x1, y1, z1, x2, y2 + amount, z2);
|
||||
default:
|
||||
throw new IllegalArgumentException("invalid direction " + dir);
|
||||
}
|
||||
return switch (dir) {
|
||||
case North -> new Cuboid(worldName, x1 - amount, y1, z1, x2, y2, z2);
|
||||
case South -> new Cuboid(worldName, x1, y1, z1, x2 + amount, y2, z2);
|
||||
case East -> new Cuboid(worldName, x1, y1, z1 - amount, x2, y2, z2);
|
||||
case West -> new Cuboid(worldName, x1, y1, z1, x2, y2, z2 + amount);
|
||||
case Down -> new Cuboid(worldName, x1, y1 - amount, z1, x2, y2, z2);
|
||||
case Up -> new Cuboid(worldName, x1, y1, z1, x2, y2 + amount, z2);
|
||||
default -> throw new IllegalArgumentException("invalid direction " + dir);
|
||||
};
|
||||
}
|
||||
|
||||
public Cuboid expand(Direction dir, int amount) {
|
||||
@@ -367,20 +380,12 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
* @return a new Cuboid outset by the given direction and amount
|
||||
*/
|
||||
public Cuboid outset(CuboidDirection dir, int amount) {
|
||||
Cuboid c;
|
||||
switch (dir) {
|
||||
case Horizontal:
|
||||
c = expand(CuboidDirection.North, amount).expand(CuboidDirection.South, amount).expand(CuboidDirection.East, amount).expand(CuboidDirection.West, amount);
|
||||
break;
|
||||
case Vertical:
|
||||
c = expand(CuboidDirection.Down, amount).expand(CuboidDirection.Up, amount);
|
||||
break;
|
||||
case Both:
|
||||
c = outset(CuboidDirection.Horizontal, amount).outset(CuboidDirection.Vertical, amount);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("invalid direction " + dir);
|
||||
}
|
||||
Cuboid c = switch (dir) {
|
||||
case Horizontal -> expand(CuboidDirection.North, amount).expand(CuboidDirection.South, amount).expand(CuboidDirection.East, amount).expand(CuboidDirection.West, amount);
|
||||
case Vertical -> expand(CuboidDirection.Down, amount).expand(CuboidDirection.Up, amount);
|
||||
case Both -> outset(CuboidDirection.Horizontal, amount).outset(CuboidDirection.Vertical, amount);
|
||||
default -> throw new IllegalArgumentException("invalid direction " + dir);
|
||||
};
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -477,38 +482,43 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
public Cuboid contract(CuboidDirection dir) {
|
||||
Cuboid face = getFace(dir.opposite());
|
||||
switch (dir) {
|
||||
case Down:
|
||||
case Down -> {
|
||||
while (face.containsOnly(Material.AIR) && face.getLowerY() > this.getLowerY()) {
|
||||
face = face.shift(CuboidDirection.Down, 1);
|
||||
}
|
||||
return new Cuboid(worldName, x1, y1, z1, x2, face.getUpperY(), z2);
|
||||
case Up:
|
||||
}
|
||||
case Up -> {
|
||||
while (face.containsOnly(Material.AIR) && face.getUpperY() < this.getUpperY()) {
|
||||
face = face.shift(CuboidDirection.Up, 1);
|
||||
}
|
||||
return new Cuboid(worldName, x1, face.getLowerY(), z1, x2, y2, z2);
|
||||
case North:
|
||||
}
|
||||
case North -> {
|
||||
while (face.containsOnly(Material.AIR) && face.getLowerX() > this.getLowerX()) {
|
||||
face = face.shift(CuboidDirection.North, 1);
|
||||
}
|
||||
return new Cuboid(worldName, x1, y1, z1, face.getUpperX(), y2, z2);
|
||||
case South:
|
||||
}
|
||||
case South -> {
|
||||
while (face.containsOnly(Material.AIR) && face.getUpperX() < this.getUpperX()) {
|
||||
face = face.shift(CuboidDirection.South, 1);
|
||||
}
|
||||
return new Cuboid(worldName, face.getLowerX(), y1, z1, x2, y2, z2);
|
||||
case East:
|
||||
}
|
||||
case East -> {
|
||||
while (face.containsOnly(Material.AIR) && face.getLowerZ() > this.getLowerZ()) {
|
||||
face = face.shift(CuboidDirection.East, 1);
|
||||
}
|
||||
return new Cuboid(worldName, x1, y1, z1, x2, y2, face.getUpperZ());
|
||||
case West:
|
||||
}
|
||||
case West -> {
|
||||
while (face.containsOnly(Material.AIR) && face.getUpperZ() < this.getUpperZ()) {
|
||||
face = face.shift(CuboidDirection.West, 1);
|
||||
}
|
||||
return new Cuboid(worldName, x1, y1, face.getLowerZ(), x2, y2, z2);
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid direction " + dir);
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Invalid direction " + dir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,22 +530,15 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
* @return the Cuboid representing this Cuboid's requested face
|
||||
*/
|
||||
public Cuboid getFace(CuboidDirection dir) {
|
||||
switch (dir) {
|
||||
case Down:
|
||||
return new Cuboid(worldName, x1, y1, z1, x2, y1, z2);
|
||||
case Up:
|
||||
return new Cuboid(worldName, x1, y2, z1, x2, y2, z2);
|
||||
case North:
|
||||
return new Cuboid(worldName, x1, y1, z1, x1, y2, z2);
|
||||
case South:
|
||||
return new Cuboid(worldName, x2, y1, z1, x2, y2, z2);
|
||||
case East:
|
||||
return new Cuboid(worldName, x1, y1, z1, x2, y2, z1);
|
||||
case West:
|
||||
return new Cuboid(worldName, x1, y1, z2, x2, y2, z2);
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid direction " + dir);
|
||||
}
|
||||
return switch (dir) {
|
||||
case Down -> new Cuboid(worldName, x1, y1, z1, x2, y1, z2);
|
||||
case Up -> new Cuboid(worldName, x1, y2, z1, x2, y2, z2);
|
||||
case North -> new Cuboid(worldName, x1, y1, z1, x1, y2, z2);
|
||||
case South -> new Cuboid(worldName, x2, y1, z1, x2, y2, z2);
|
||||
case East -> new Cuboid(worldName, x1, y1, z1, x2, y2, z1);
|
||||
case West -> new Cuboid(worldName, x1, y1, z2, x2, y2, z2);
|
||||
default -> throw new IllegalArgumentException("Invalid direction " + dir);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -608,7 +611,7 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
* @return a list of Chunk objects
|
||||
*/
|
||||
public List<Chunk> getChunks() {
|
||||
List<Chunk> res = new ArrayList<Chunk>();
|
||||
List<Chunk> res = new ArrayList<>();
|
||||
|
||||
World w = getWorld();
|
||||
int x1 = getLowerX() & ~0xf;
|
||||
@@ -623,11 +626,11 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all the blocks within the Cuboid to the given MaterialData, using a
|
||||
* MassBlockUpdate object for fast updates.
|
||||
*
|
||||
* @param mat
|
||||
/*
|
||||
Set all the blocks within the Cuboid to the given MaterialData, using a
|
||||
MassBlockUpdate object for fast updates.
|
||||
|
||||
@param mat
|
||||
* the MaterialData to set
|
||||
* @param mbu
|
||||
* the MassBlockUpdate object
|
||||
@@ -652,8 +655,9 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
*
|
||||
* @see java.lang.Object#clone()
|
||||
*/
|
||||
@SuppressWarnings("MethodDoesntCallSuperMethod")
|
||||
@Override
|
||||
public Cuboid clone() throws CloneNotSupportedException {
|
||||
public Cuboid clone() {
|
||||
return new Cuboid(this);
|
||||
}
|
||||
|
||||
@@ -667,7 +671,7 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
return "Cuboid: " + worldName + "," + x1 + "," + y1 + "," + z1 + "=>" + x2 + "," + y2 + "," + z2;
|
||||
}
|
||||
|
||||
public class CuboidIterator implements Iterator<Block> {
|
||||
public static class CuboidIterator implements Iterator<Block> {
|
||||
private final World w;
|
||||
private final int baseX;
|
||||
private final int baseY;
|
||||
@@ -726,28 +730,18 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
Unknown;
|
||||
|
||||
public CuboidDirection opposite() {
|
||||
switch (this) {
|
||||
case North:
|
||||
return South;
|
||||
case East:
|
||||
return West;
|
||||
case South:
|
||||
return North;
|
||||
case West:
|
||||
return East;
|
||||
case Horizontal:
|
||||
return Vertical;
|
||||
case Vertical:
|
||||
return Horizontal;
|
||||
case Up:
|
||||
return Down;
|
||||
case Down:
|
||||
return Up;
|
||||
case Both:
|
||||
return Both;
|
||||
default:
|
||||
return Unknown;
|
||||
}
|
||||
return switch (this) {
|
||||
case North -> South;
|
||||
case East -> West;
|
||||
case South -> North;
|
||||
case West -> East;
|
||||
case Horizontal -> Vertical;
|
||||
case Vertical -> Horizontal;
|
||||
case Up -> Down;
|
||||
case Down -> Up;
|
||||
case Both -> Both;
|
||||
default -> Unknown;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
@@ -19,9 +37,9 @@ public abstract class DataPalette<T> implements Writable {
|
||||
getPaletteId(defaultValue);
|
||||
}
|
||||
|
||||
public abstract T readType(DataInputStream i) throws IOException;
|
||||
public abstract T readType(DataInputStream i);
|
||||
|
||||
public abstract void writeType(T t, DataOutputStream o) throws IOException;
|
||||
public abstract void writeType(T t, DataOutputStream o);
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream o) throws IOException {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class Denv {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.util.Cuboid.CuboidDirection;
|
||||
@@ -5,6 +23,8 @@ import org.bukkit.Axis;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Directions
|
||||
*
|
||||
@@ -26,68 +46,28 @@ public enum Direction {
|
||||
private final CuboidDirection f;
|
||||
|
||||
public static Direction getDirection(BlockFace f) {
|
||||
switch (f) {
|
||||
case DOWN:
|
||||
return D;
|
||||
case EAST:
|
||||
return E;
|
||||
case EAST_NORTH_EAST:
|
||||
return E;
|
||||
case EAST_SOUTH_EAST:
|
||||
return E;
|
||||
case NORTH:
|
||||
return N;
|
||||
case NORTH_EAST:
|
||||
return N;
|
||||
case NORTH_NORTH_EAST:
|
||||
return N;
|
||||
case NORTH_NORTH_WEST:
|
||||
return N;
|
||||
case NORTH_WEST:
|
||||
return N;
|
||||
case SELF:
|
||||
return U;
|
||||
case SOUTH:
|
||||
return S;
|
||||
case SOUTH_EAST:
|
||||
return S;
|
||||
case SOUTH_SOUTH_EAST:
|
||||
return S;
|
||||
case SOUTH_SOUTH_WEST:
|
||||
return S;
|
||||
case SOUTH_WEST:
|
||||
return S;
|
||||
case UP:
|
||||
return U;
|
||||
case WEST:
|
||||
return W;
|
||||
case WEST_NORTH_WEST:
|
||||
return W;
|
||||
case WEST_SOUTH_WEST:
|
||||
return W;
|
||||
}
|
||||
return switch (f) {
|
||||
case DOWN -> D;
|
||||
case EAST, EAST_SOUTH_EAST, EAST_NORTH_EAST -> E;
|
||||
case NORTH, NORTH_WEST, NORTH_NORTH_WEST, NORTH_NORTH_EAST, NORTH_EAST -> N;
|
||||
case SELF, UP -> U;
|
||||
case SOUTH, SOUTH_WEST, SOUTH_SOUTH_WEST, SOUTH_SOUTH_EAST, SOUTH_EAST -> S;
|
||||
case WEST, WEST_SOUTH_WEST, WEST_NORTH_WEST -> W;
|
||||
};
|
||||
|
||||
return D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case D:
|
||||
return "Down";
|
||||
case E:
|
||||
return "East";
|
||||
case N:
|
||||
return "North";
|
||||
case S:
|
||||
return "South";
|
||||
case U:
|
||||
return "Up";
|
||||
case W:
|
||||
return "West";
|
||||
}
|
||||
return switch (this) {
|
||||
case D -> "Down";
|
||||
case E -> "East";
|
||||
case N -> "North";
|
||||
case S -> "South";
|
||||
case U -> "Up";
|
||||
case W -> "West";
|
||||
};
|
||||
|
||||
return "?";
|
||||
}
|
||||
|
||||
public boolean isVertical() {
|
||||
@@ -167,9 +147,10 @@ public enum Direction {
|
||||
public Vector angle(Vector initial, Direction d) {
|
||||
calculatePermutations();
|
||||
|
||||
for (GBiset<Direction, Direction> i : permute.keySet()) {
|
||||
for (Map.Entry<GBiset<Direction, Direction>, DOP> entry : permute.entrySet()) {
|
||||
GBiset<Direction, Direction> i = entry.getKey();
|
||||
if (i.getA().equals(this) && i.getB().equals(d)) {
|
||||
return permute.get(i).op(initial);
|
||||
return entry.getValue().op(initial);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,11 +273,11 @@ public enum Direction {
|
||||
return;
|
||||
}
|
||||
|
||||
permute = new KMap<GBiset<Direction, Direction>, DOP>();
|
||||
permute = new KMap<>();
|
||||
|
||||
for (Direction i : udnews()) {
|
||||
for (Direction j : udnews()) {
|
||||
GBiset<Direction, Direction> b = new GBiset<Direction, Direction>(i, j);
|
||||
GBiset<Direction, Direction> b = new GBiset<>(i, j);
|
||||
|
||||
if (i.equals(j)) {
|
||||
permute.put(b, new DOP("DIRECT") {
|
||||
@@ -376,40 +357,23 @@ public enum Direction {
|
||||
}
|
||||
|
||||
public BlockFace getFace() {
|
||||
switch (this) {
|
||||
case D:
|
||||
return BlockFace.DOWN;
|
||||
case E:
|
||||
return BlockFace.EAST;
|
||||
case N:
|
||||
return BlockFace.NORTH;
|
||||
case S:
|
||||
return BlockFace.SOUTH;
|
||||
case U:
|
||||
return BlockFace.UP;
|
||||
case W:
|
||||
return BlockFace.WEST;
|
||||
}
|
||||
return switch (this) {
|
||||
case D -> BlockFace.DOWN;
|
||||
case E -> BlockFace.EAST;
|
||||
case N -> BlockFace.NORTH;
|
||||
case S -> BlockFace.SOUTH;
|
||||
case U -> BlockFace.UP;
|
||||
case W -> BlockFace.WEST;
|
||||
};
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Axis getAxis() {
|
||||
switch (this) {
|
||||
case D:
|
||||
return Axis.Y;
|
||||
case E:
|
||||
return Axis.X;
|
||||
case N:
|
||||
return Axis.Z;
|
||||
case S:
|
||||
return Axis.Z;
|
||||
case U:
|
||||
return Axis.Y;
|
||||
case W:
|
||||
return Axis.X;
|
||||
}
|
||||
return switch (this) {
|
||||
case D, U -> Axis.Y;
|
||||
case E, W -> Axis.X;
|
||||
case N, S -> Axis.Z;
|
||||
};
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({FIELD, TYPE, CONSTRUCTOR, METHOD})
|
||||
public @interface DontObfuscate {
|
||||
|
||||
}
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
@@ -7,9 +25,7 @@ import java.util.Arrays;
|
||||
|
||||
public class DoubleArrayUtils {
|
||||
public static void shiftRight(double[] values, double push) {
|
||||
for (int index = values.length - 2; index >= 0; index--) {
|
||||
values[index + 1] = values[index];
|
||||
}
|
||||
if (values.length - 2 + 1 >= 0) System.arraycopy(values, 0, values, 1, values.length - 2 + 1);
|
||||
|
||||
values[0] = push;
|
||||
}
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* Copyright (c) 2010 Graham Edgecombe
|
||||
* All rights reserved.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
* The <code>TAG_Double</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public interface Element {
|
||||
MaterialBlock getMaterial();
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* Copyright (c) 2010 Graham Edgecombe
|
||||
* All rights reserved.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
* The <code>TAG_End</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Setter;
|
||||
@@ -46,10 +64,11 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
||||
public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<String> getListeningPluginChannels() {
|
||||
|
||||
@@ -57,35 +76,38 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
|
||||
public void setMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<MetadataValue> getMetadata(String metadataKey) {
|
||||
public List<MetadataValue> getMetadata(@NotNull String metadataKey) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMetadata(String metadataKey) {
|
||||
public boolean hasMetadata(@NotNull String metadataKey) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMetadata(String metadataKey, Plugin owningPlugin) {
|
||||
public void removeMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getBlockAt(int x, int y, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getBlockAt(Location location) {
|
||||
public Block getBlockAt(@NotNull Location location) {
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -97,71 +119,79 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(Location location) {
|
||||
public int getHighestBlockYAt(@NotNull Location location) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(Location location) {
|
||||
public Block getHighestBlockAt(@NotNull Location location) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(int x, int z, HeightMap heightMap) {
|
||||
public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(Location location, HeightMap heightMap) {
|
||||
public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(int x, int z, HeightMap heightMap) {
|
||||
public Block getHighestBlockAt(int x, int z, @NotNull HeightMap heightMap) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(Location location, HeightMap heightMap) {
|
||||
public Block getHighestBlockAt(@NotNull Location location, @NotNull HeightMap heightMap) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk getChunkAt(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk getChunkAt(Location location) {
|
||||
public Chunk getChunkAt(@NotNull Location location) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk getChunkAt(@NotNull Block block) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(Block block) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkLoaded(Chunk chunk) {
|
||||
public boolean isChunkLoaded(@NotNull Chunk chunk) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk[] getLoadedChunks() {
|
||||
|
||||
@@ -169,7 +199,7 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadChunk(Chunk chunk) {
|
||||
public void loadChunk(@NotNull Chunk chunk) {
|
||||
|
||||
}
|
||||
|
||||
@@ -203,7 +233,7 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unloadChunk(Chunk chunk) {
|
||||
public boolean unloadChunk(@NotNull Chunk chunk) {
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -249,6 +279,7 @@ public class FakeWorld implements World {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Chunk> getForceLoadedChunks() {
|
||||
|
||||
@@ -256,36 +287,39 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addPluginChunkTicket(int x, int z, Plugin plugin) {
|
||||
public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removePluginChunkTicket(int x, int z, Plugin plugin) {
|
||||
public boolean removePluginChunkTicket(int x, int z, @NotNull Plugin plugin) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePluginChunkTickets(Plugin plugin) {
|
||||
public void removePluginChunkTickets(@NotNull Plugin plugin) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Plugin> getPluginChunkTickets(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Map<Plugin, Collection<Chunk>> getPluginChunkTickets() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Item dropItem(Location location, ItemStack item) {
|
||||
public Item dropItem(@NotNull Location location, @NotNull ItemStack item) {
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -296,8 +330,9 @@ public class FakeWorld implements World {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Item dropItemNaturally(Location location, ItemStack item) {
|
||||
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item) {
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -308,168 +343,187 @@ public class FakeWorld implements World {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Arrow spawnArrow(Location location, Vector direction, float speed, float spread) {
|
||||
public Arrow spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends AbstractArrow> T spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class<T> clazz) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends AbstractArrow> T spawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateTree(Location location, TreeType type) {
|
||||
public boolean generateTree(@NotNull Location location, @NotNull TreeType type) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
|
||||
public boolean generateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Entity spawnEntity(Location loc, EntityType type) {
|
||||
public Entity spawnEntity(@NotNull Location loc, @NotNull EntityType type) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public LightningStrike strikeLightning(Location loc) {
|
||||
public LightningStrike strikeLightning(@NotNull Location loc) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public LightningStrike strikeLightningEffect(Location loc) {
|
||||
public LightningStrike strikeLightningEffect(@NotNull Location loc) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Entity> getEntities() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<LivingEntity> getLivingEntities() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@SuppressWarnings({"RedundantSuppression", "unchecked"})
|
||||
@Override
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(@SuppressWarnings("unchecked") Class<T>... classes) {
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(@NotNull @SuppressWarnings("unchecked") Class<T>... classes) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(Class<T> cls) {
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(@NotNull Class<T> cls) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getEntitiesByClasses(Class<?>... classes) {
|
||||
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Player> getPlayers() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(Location location, double x, double y, double z) {
|
||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(Location location, double x, double y, double z, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) {
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
return worldName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public UUID getUID() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Location getSpawnLocation() {
|
||||
|
||||
@@ -477,7 +531,7 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setSpawnLocation(Location location) {
|
||||
public boolean setSpawnLocation(@NotNull Location location) {
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -604,29 +658,30 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power, boolean setFire) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Environment getEnvironment() {
|
||||
|
||||
@@ -661,62 +716,69 @@ public class FakeWorld implements World {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<BlockPopulator> getPopulators() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> T spawn(Location location, Class<T> clazz) throws IllegalArgumentException {
|
||||
public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, Consumer<T> function) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> T spawn(Location location, Class<T> clazz, Consumer<T> function) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(Location location, MaterialData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(Location location, BlockData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(Location location, Material material, byte data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(Location location, Effect effect, int data) {
|
||||
public void playEffect(@NotNull Location location, @NotNull Effect effect, int data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(Location location, Effect effect, int data, int radius) {
|
||||
public void playEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location location, Effect effect, T data) {
|
||||
public <T> void playEffect(@NotNull Location location, @NotNull Effect effect, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location location, Effect effect, T data, int radius) {
|
||||
public <T> void playEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTemp) {
|
||||
|
||||
@@ -740,12 +802,14 @@ public class FakeWorld implements World {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome getBiome(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome getBiome(int x, int y, int z) {
|
||||
|
||||
@@ -753,12 +817,12 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int x, int z, Biome bio) {
|
||||
public void setBiome(int x, int z, @NotNull Biome bio) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int x, int y, int z, Biome bio) {
|
||||
public void setBiome(int x, int y, int z, @NotNull Biome bio) {
|
||||
|
||||
}
|
||||
|
||||
@@ -826,16 +890,18 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDifficulty(Difficulty difficulty) {
|
||||
public void setDifficulty(@NotNull Difficulty difficulty) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Difficulty getDifficulty() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public File getWorldFolder() {
|
||||
|
||||
@@ -976,25 +1042,26 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, Sound sound, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, String sound, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, String sound, SoundCategory category, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String[] getGameRules() {
|
||||
|
||||
@@ -1008,35 +1075,36 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setGameRuleValue(String rule, String value) {
|
||||
public boolean setGameRuleValue(@NotNull String rule, @NotNull String value) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGameRule(String rule) {
|
||||
public boolean isGameRule(@NotNull String rule) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getGameRuleValue(GameRule<T> rule) {
|
||||
public <T> T getGameRuleValue(@NotNull GameRule<T> rule) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getGameRuleDefault(GameRule<T> rule) {
|
||||
public <T> T getGameRuleDefault(@NotNull GameRule<T> rule) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> boolean setGameRule(GameRule<T> rule, T newValue) {
|
||||
public <T> boolean setGameRule(@NotNull GameRule<T> rule, @NotNull T newValue) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public WorldBorder getWorldBorder() {
|
||||
|
||||
@@ -1044,77 +1112,77 @@ public class FakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, Location location, int count) {
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count) {
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored) {
|
||||
public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1123,16 +1191,18 @@ public class FakeWorld implements World {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Spigot spigot() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Raid locateNearestRaid(Location location, int radius) {
|
||||
public Raid locateNearestRaid(@NotNull Location location, int radius) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Raid> getRaids() {
|
||||
return null;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* Copyright (c) 2010 Graham Edgecombe
|
||||
* All rights reserved.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
* The <code>TAG_Float</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.math.BigInteger;
|
||||
@@ -18,7 +36,7 @@ public class Form {
|
||||
private static final NavigableMap<BigInteger, String> MAP;
|
||||
|
||||
static {
|
||||
MAP = new TreeMap<BigInteger, String>();
|
||||
MAP = new TreeMap<>();
|
||||
for (int i = 0; i < NAMES.length; i++) {
|
||||
MAP.put(THOUSAND.pow(i + 1), NAMES[i]);
|
||||
}
|
||||
@@ -36,7 +54,6 @@ public class Form {
|
||||
* @param smx the text
|
||||
* @param viewport the viewport length
|
||||
* @param time the timeline value
|
||||
* @return
|
||||
*/
|
||||
public static String scroll(String smx, int viewport, long time) {
|
||||
String src = Form.repeat(" ", viewport) + smx + Form.repeat(" ", viewport);
|
||||
@@ -55,19 +72,19 @@ public class Form {
|
||||
* @return the capitalized string
|
||||
*/
|
||||
public static String capitalize(String s) {
|
||||
String roll = "";
|
||||
StringBuilder roll = new StringBuilder();
|
||||
boolean f = true;
|
||||
|
||||
for (Character i : s.trim().toCharArray()) {
|
||||
if (f) {
|
||||
roll += Character.toUpperCase(i);
|
||||
roll.append(Character.toUpperCase(i));
|
||||
f = false;
|
||||
} else {
|
||||
roll += i;
|
||||
roll.append(i);
|
||||
}
|
||||
}
|
||||
|
||||
return roll;
|
||||
return roll.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,10 +94,10 @@ public class Form {
|
||||
* @return the capitalized string
|
||||
*/
|
||||
public static String capitalizeWords(String s) {
|
||||
String rollx = "";
|
||||
StringBuilder rollx = new StringBuilder();
|
||||
|
||||
for (String i : s.trim().split(" ")) {
|
||||
rollx += " " + capitalize(i.trim());
|
||||
rollx.append(" ").append(capitalize(i.trim()));
|
||||
}
|
||||
|
||||
return rollx.substring(1);
|
||||
@@ -205,7 +222,6 @@ public class Form {
|
||||
/**
|
||||
* Returns a fancy duration up to Years
|
||||
*
|
||||
* @param rollingSequence
|
||||
* @param duration the duration in ms
|
||||
* @return the fancy duration
|
||||
*/
|
||||
@@ -323,72 +339,33 @@ public class Form {
|
||||
} else {
|
||||
int h = c.get(Calendar.HOUR);
|
||||
h = h == 0 ? 12 : h;
|
||||
String dow = "Error Day";
|
||||
|
||||
switch (c.get(Calendar.DAY_OF_WEEK)) {
|
||||
case Calendar.SUNDAY:
|
||||
dow = "Sunday";
|
||||
break;
|
||||
case Calendar.MONDAY:
|
||||
dow = "Monday";
|
||||
break;
|
||||
case Calendar.TUESDAY:
|
||||
dow = "Tuesday";
|
||||
break;
|
||||
case Calendar.WEDNESDAY:
|
||||
dow = "Wednesday";
|
||||
break;
|
||||
case Calendar.THURSDAY:
|
||||
dow = "Thursday";
|
||||
break;
|
||||
case Calendar.FRIDAY:
|
||||
dow = "Friday";
|
||||
break;
|
||||
case Calendar.SATURDAY:
|
||||
dow = "Saturday";
|
||||
break;
|
||||
}
|
||||
String dow = switch (c.get(Calendar.DAY_OF_WEEK)) {
|
||||
case Calendar.SUNDAY -> "Sunday";
|
||||
case Calendar.MONDAY -> "Monday";
|
||||
case Calendar.TUESDAY -> "Tuesday";
|
||||
case Calendar.WEDNESDAY -> "Wednesday";
|
||||
case Calendar.THURSDAY -> "Thursday";
|
||||
case Calendar.FRIDAY -> "Friday";
|
||||
case Calendar.SATURDAY -> "Saturday";
|
||||
default -> "Error Day";
|
||||
};
|
||||
|
||||
String monthName = "Error Month";
|
||||
int month = c.get(Calendar.MONTH);
|
||||
|
||||
switch (month) {
|
||||
case Calendar.JANUARY:
|
||||
monthName = "Jan";
|
||||
break;
|
||||
case Calendar.FEBRUARY:
|
||||
monthName = "Feb";
|
||||
break;
|
||||
case Calendar.MARCH:
|
||||
monthName = "Mar";
|
||||
break;
|
||||
case Calendar.APRIL:
|
||||
monthName = "Apr";
|
||||
break;
|
||||
case Calendar.MAY:
|
||||
monthName = "May";
|
||||
break;
|
||||
case Calendar.JUNE:
|
||||
monthName = "Jun";
|
||||
break;
|
||||
case Calendar.JULY:
|
||||
monthName = "Jul";
|
||||
break;
|
||||
case Calendar.AUGUST:
|
||||
monthName = "Aug";
|
||||
break;
|
||||
case Calendar.SEPTEMBER:
|
||||
monthName = "Sep";
|
||||
break;
|
||||
case Calendar.OCTOBER:
|
||||
monthName = "Oct";
|
||||
break;
|
||||
case Calendar.NOVEMBER:
|
||||
monthName = "Nov";
|
||||
break;
|
||||
case Calendar.DECEMBER:
|
||||
monthName = "Dec";
|
||||
break;
|
||||
case Calendar.JANUARY -> monthName = "Jan";
|
||||
case Calendar.FEBRUARY -> monthName = "Feb";
|
||||
case Calendar.MARCH -> monthName = "Mar";
|
||||
case Calendar.APRIL -> monthName = "Apr";
|
||||
case Calendar.MAY -> monthName = "May";
|
||||
case Calendar.JUNE -> monthName = "Jun";
|
||||
case Calendar.JULY -> monthName = "Jul";
|
||||
case Calendar.AUGUST -> monthName = "Aug";
|
||||
case Calendar.SEPTEMBER -> monthName = "Sep";
|
||||
case Calendar.OCTOBER -> monthName = "Oct";
|
||||
case Calendar.NOVEMBER -> monthName = "Nov";
|
||||
case Calendar.DECEMBER -> monthName = "Dec";
|
||||
}
|
||||
|
||||
int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
|
||||
@@ -399,72 +376,33 @@ public class Form {
|
||||
} else {
|
||||
int h = c.get(Calendar.HOUR);
|
||||
h = h == 0 ? 12 : h;
|
||||
String dow = "Error Day";
|
||||
|
||||
switch (c.get(Calendar.DAY_OF_WEEK)) {
|
||||
case Calendar.SUNDAY:
|
||||
dow = "Sunday";
|
||||
break;
|
||||
case Calendar.MONDAY:
|
||||
dow = "Monday";
|
||||
break;
|
||||
case Calendar.TUESDAY:
|
||||
dow = "Tuesday";
|
||||
break;
|
||||
case Calendar.WEDNESDAY:
|
||||
dow = "Wednesday";
|
||||
break;
|
||||
case Calendar.THURSDAY:
|
||||
dow = "Thursday";
|
||||
break;
|
||||
case Calendar.FRIDAY:
|
||||
dow = "Friday";
|
||||
break;
|
||||
case Calendar.SATURDAY:
|
||||
dow = "Saturday";
|
||||
break;
|
||||
}
|
||||
String dow = switch (c.get(Calendar.DAY_OF_WEEK)) {
|
||||
case Calendar.SUNDAY -> "Sunday";
|
||||
case Calendar.MONDAY -> "Monday";
|
||||
case Calendar.TUESDAY -> "Tuesday";
|
||||
case Calendar.WEDNESDAY -> "Wednesday";
|
||||
case Calendar.THURSDAY -> "Thursday";
|
||||
case Calendar.FRIDAY -> "Friday";
|
||||
case Calendar.SATURDAY -> "Saturday";
|
||||
default -> "Error Day";
|
||||
};
|
||||
|
||||
String monthName = "Error Month";
|
||||
int month = c.get(Calendar.MONTH);
|
||||
|
||||
switch (month) {
|
||||
case Calendar.JANUARY:
|
||||
monthName = "Jan";
|
||||
break;
|
||||
case Calendar.FEBRUARY:
|
||||
monthName = "Feb";
|
||||
break;
|
||||
case Calendar.MARCH:
|
||||
monthName = "Mar";
|
||||
break;
|
||||
case Calendar.APRIL:
|
||||
monthName = "Apr";
|
||||
break;
|
||||
case Calendar.MAY:
|
||||
monthName = "May";
|
||||
break;
|
||||
case Calendar.JUNE:
|
||||
monthName = "Jun";
|
||||
break;
|
||||
case Calendar.JULY:
|
||||
monthName = "Jul";
|
||||
break;
|
||||
case Calendar.AUGUST:
|
||||
monthName = "Aug";
|
||||
break;
|
||||
case Calendar.SEPTEMBER:
|
||||
monthName = "Sep";
|
||||
break;
|
||||
case Calendar.OCTOBER:
|
||||
monthName = "Oct";
|
||||
break;
|
||||
case Calendar.NOVEMBER:
|
||||
monthName = "Nov";
|
||||
break;
|
||||
case Calendar.DECEMBER:
|
||||
monthName = "Dec";
|
||||
break;
|
||||
case Calendar.JANUARY -> monthName = "Jan";
|
||||
case Calendar.FEBRUARY -> monthName = "Feb";
|
||||
case Calendar.MARCH -> monthName = "Mar";
|
||||
case Calendar.APRIL -> monthName = "Apr";
|
||||
case Calendar.MAY -> monthName = "May";
|
||||
case Calendar.JUNE -> monthName = "Jun";
|
||||
case Calendar.JULY -> monthName = "Jul";
|
||||
case Calendar.AUGUST -> monthName = "Aug";
|
||||
case Calendar.SEPTEMBER -> monthName = "Sep";
|
||||
case Calendar.OCTOBER -> monthName = "Oct";
|
||||
case Calendar.NOVEMBER -> monthName = "Nov";
|
||||
case Calendar.DECEMBER -> monthName = "Dec";
|
||||
}
|
||||
|
||||
int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
|
||||
@@ -484,15 +422,10 @@ public class Form {
|
||||
*/
|
||||
public static String numberSuffix(int i) {
|
||||
String[] sufixes = new String[]{"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"};
|
||||
switch (i % 100) {
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return i + "th";
|
||||
default:
|
||||
return i + sufixes[i % 10];
|
||||
|
||||
}
|
||||
return switch (i % 100) {
|
||||
case 11, 12, 13 -> i + "th";
|
||||
default -> i + sufixes[i % 10];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -704,7 +637,7 @@ public class Form {
|
||||
* @return the string
|
||||
*/
|
||||
public static String ofSize(long s, int div) {
|
||||
Double d = (double) s;
|
||||
double d = (double) s;
|
||||
String sub = "Bytes";
|
||||
|
||||
if (d > div - 1) {
|
||||
@@ -745,7 +678,7 @@ public class Form {
|
||||
* @return the string
|
||||
*/
|
||||
public static String ofSize(long s, int div, int dec) {
|
||||
Double d = (double) s;
|
||||
double d = (double) s;
|
||||
String sub = "Bytes";
|
||||
|
||||
if (d > div - 1) {
|
||||
@@ -786,7 +719,7 @@ public class Form {
|
||||
if (neg) {
|
||||
s = -s;
|
||||
}
|
||||
Double d = (double) s;
|
||||
double d = (double) s;
|
||||
String sub = "Grams";
|
||||
|
||||
if (d > div - 1) {
|
||||
@@ -835,21 +768,21 @@ public class Form {
|
||||
* @return the string representation
|
||||
*/
|
||||
public static String cname(String clazz) {
|
||||
String codeName = "";
|
||||
StringBuilder codeName = new StringBuilder();
|
||||
|
||||
for (Character i : clazz.toCharArray()) {
|
||||
if (Character.isUpperCase(i)) {
|
||||
codeName = codeName + "-" + Character.toLowerCase(i);
|
||||
codeName.append("-").append(Character.toLowerCase(i));
|
||||
} else {
|
||||
codeName = codeName + i;
|
||||
codeName.append(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (codeName.startsWith("-")) {
|
||||
codeName = codeName.substring(1);
|
||||
if (codeName.toString().startsWith("-")) {
|
||||
codeName = new StringBuilder(codeName.substring(1));
|
||||
}
|
||||
|
||||
return codeName;
|
||||
return codeName.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -869,7 +802,6 @@ public class Form {
|
||||
/**
|
||||
* Get a formatted representation of the memory given in kilobytes
|
||||
*
|
||||
* @param mb the kilobytes
|
||||
* @return the string representation with suffixes
|
||||
*/
|
||||
public static String memx(long kb) {
|
||||
@@ -1103,7 +1035,6 @@ public class Form {
|
||||
/**
|
||||
* nanoseconds to seconds (double)
|
||||
*
|
||||
* @param ms the nanoseconds
|
||||
* @return a formatted string to nanoseconds
|
||||
*/
|
||||
public static String nsMs(long ns) {
|
||||
@@ -1113,7 +1044,6 @@ public class Form {
|
||||
/**
|
||||
* nanoseconds to seconds (double) custom decimals
|
||||
*
|
||||
* @param ms the nanoseconds
|
||||
* @param p number of decimal points
|
||||
* @return a formatted string to nanoseconds
|
||||
*/
|
||||
@@ -1124,7 +1054,6 @@ public class Form {
|
||||
/**
|
||||
* nanoseconds to seconds (double) custom decimals
|
||||
*
|
||||
* @param ms the nanoseconds
|
||||
* @param p number of decimal points
|
||||
* @return a formatted string to nanoseconds
|
||||
*/
|
||||
@@ -1139,7 +1068,7 @@ public class Form {
|
||||
* @return the numerals
|
||||
*/
|
||||
public static String toRoman(int num) {
|
||||
LinkedHashMap<String, Integer> roman_numerals = new LinkedHashMap<String, Integer>();
|
||||
LinkedHashMap<String, Integer> roman_numerals = new LinkedHashMap<>();
|
||||
|
||||
roman_numerals.put("M", 1000);
|
||||
roman_numerals.put("CM", 900);
|
||||
@@ -1155,16 +1084,16 @@ public class Form {
|
||||
roman_numerals.put("IV", 4);
|
||||
roman_numerals.put("I", 1);
|
||||
|
||||
String res = "";
|
||||
StringBuilder res = new StringBuilder();
|
||||
|
||||
for (Map.Entry<String, Integer> entry : roman_numerals.entrySet()) {
|
||||
int matches = num / entry.getValue();
|
||||
|
||||
res += repeat(entry.getKey(), matches);
|
||||
res.append(repeat(entry.getKey(), matches));
|
||||
num = num % entry.getValue();
|
||||
}
|
||||
|
||||
return res;
|
||||
return res.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1242,6 +1171,7 @@ public class Form {
|
||||
* @param n the amount of times to repeat
|
||||
* @return the repeated string
|
||||
*/
|
||||
@SuppressWarnings("StringRepeatCanBeUsed")
|
||||
public static String repeat(String s, int n) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Function2<A, B, R> {
|
||||
R apply(A a, B b);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Function3<A, B, C, R> {
|
||||
R apply(A a, B b, C c);
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@FunctionalInterface
|
||||
public interface Function4<A, B, C, D, R> {
|
||||
R apply(A a, B b, C c, D d);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
@@ -57,7 +75,6 @@ public class GBiset<A, B> implements Serializable {
|
||||
/**
|
||||
* Set the second object
|
||||
*
|
||||
* @param b
|
||||
*/
|
||||
public void setB(B b) {
|
||||
this.b = b;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
@@ -18,7 +36,7 @@ public abstract class GListAdapter<FROM, TO> {
|
||||
* @return the to list
|
||||
*/
|
||||
public List<TO> adapt(List<FROM> from) {
|
||||
List<TO> adapted = new KList<TO>();
|
||||
List<TO> adapted = new KList<>();
|
||||
|
||||
for (FROM i : from) {
|
||||
TO t = onAdapt(i);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -13,7 +31,7 @@ public class GroupedExecutor {
|
||||
|
||||
public GroupedExecutor(int threadLimit, int priority, String name) {
|
||||
xc = 1;
|
||||
mirror = new KMap<String, Integer>();
|
||||
mirror = new KMap<>();
|
||||
|
||||
if (threadLimit == 1) {
|
||||
service = Executors.newSingleThreadExecutor((r) ->
|
||||
@@ -25,14 +43,11 @@ public class GroupedExecutor {
|
||||
return t;
|
||||
});
|
||||
} else if (threadLimit > 1) {
|
||||
final ForkJoinWorkerThreadFactory factory = new ForkJoinWorkerThreadFactory() {
|
||||
@Override
|
||||
public ForkJoinWorkerThread newThread(ForkJoinPool pool) {
|
||||
final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
|
||||
worker.setName(name + " " + xc++);
|
||||
worker.setPriority(priority);
|
||||
return worker;
|
||||
}
|
||||
final ForkJoinWorkerThreadFactory factory = pool -> {
|
||||
final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
|
||||
worker.setName(name + " " + xc++);
|
||||
worker.setPriority(priority);
|
||||
return worker;
|
||||
};
|
||||
|
||||
service = new ForkJoinPool(threadLimit, factory, null, false);
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
/*
|
||||
Copyright (c) 2002 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
@@ -87,7 +81,6 @@ public class HTTP {
|
||||
* @param string An HTTP header string.
|
||||
* @return A JSONObject containing the elements and attributes of the XML
|
||||
* string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static JSONObject toJSONObject(String string) throws JSONException {
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
/*
|
||||
Copyright (c) 2002 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The HTTPTokener extends the JSONTokener to provide additional methods for the
|
||||
* parsing of HTTP headers.
|
||||
@@ -47,7 +41,6 @@ public class HTTPTokener extends JSONTokener {
|
||||
* Get the next token or string. This is used in parsing HTTP headers.
|
||||
*
|
||||
* @return A String.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public String nextToken() throws JSONException {
|
||||
char c;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.HeightMap;
|
||||
@@ -24,7 +42,7 @@ import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings({"deprecation", "ClassCanBeRecord", "unchecked"})
|
||||
public class HeightedFakeWorld implements World {
|
||||
private final int height;
|
||||
|
||||
@@ -33,10 +51,11 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
||||
public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<String> getListeningPluginChannels() {
|
||||
|
||||
@@ -44,35 +63,38 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
|
||||
public void setMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<MetadataValue> getMetadata(String metadataKey) {
|
||||
public List<MetadataValue> getMetadata(@NotNull String metadataKey) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMetadata(String metadataKey) {
|
||||
public boolean hasMetadata(@NotNull String metadataKey) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMetadata(String metadataKey, Plugin owningPlugin) {
|
||||
public void removeMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getBlockAt(int x, int y, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getBlockAt(Location location) {
|
||||
public Block getBlockAt(@NotNull Location location) {
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -84,71 +106,79 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(Location location) {
|
||||
public int getHighestBlockYAt(@NotNull Location location) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(Location location) {
|
||||
public Block getHighestBlockAt(@NotNull Location location) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(int x, int z, HeightMap heightMap) {
|
||||
public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(Location location, HeightMap heightMap) {
|
||||
public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(int x, int z, HeightMap heightMap) {
|
||||
public Block getHighestBlockAt(int x, int z, @NotNull HeightMap heightMap) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Block getHighestBlockAt(Location location, HeightMap heightMap) {
|
||||
public Block getHighestBlockAt(@NotNull Location location, @NotNull HeightMap heightMap) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk getChunkAt(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk getChunkAt(Location location) {
|
||||
public Chunk getChunkAt(@NotNull Location location) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk getChunkAt(@NotNull Block block) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(Block block) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkLoaded(Chunk chunk) {
|
||||
public boolean isChunkLoaded(@NotNull Chunk chunk) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Chunk[] getLoadedChunks() {
|
||||
|
||||
@@ -156,7 +186,7 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadChunk(Chunk chunk) {
|
||||
public void loadChunk(@NotNull Chunk chunk) {
|
||||
|
||||
}
|
||||
|
||||
@@ -190,7 +220,7 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unloadChunk(Chunk chunk) {
|
||||
public boolean unloadChunk(@NotNull Chunk chunk) {
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -236,6 +266,7 @@ public class HeightedFakeWorld implements World {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Chunk> getForceLoadedChunks() {
|
||||
|
||||
@@ -243,36 +274,39 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addPluginChunkTicket(int x, int z, Plugin plugin) {
|
||||
public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removePluginChunkTicket(int x, int z, Plugin plugin) {
|
||||
public boolean removePluginChunkTicket(int x, int z, @NotNull Plugin plugin) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePluginChunkTickets(Plugin plugin) {
|
||||
public void removePluginChunkTickets(@NotNull Plugin plugin) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Plugin> getPluginChunkTickets(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Map<Plugin, Collection<Chunk>> getPluginChunkTickets() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Item dropItem(Location location, ItemStack item) {
|
||||
public Item dropItem(@NotNull Location location, @NotNull ItemStack item) {
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -283,8 +317,9 @@ public class HeightedFakeWorld implements World {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Item dropItemNaturally(Location location, ItemStack item) {
|
||||
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item) {
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -295,168 +330,186 @@ public class HeightedFakeWorld implements World {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Arrow spawnArrow(Location location, Vector direction, float speed, float spread) {
|
||||
public Arrow spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends AbstractArrow> T spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class<T> clazz) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends AbstractArrow> T spawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateTree(Location location, TreeType type) {
|
||||
public boolean generateTree(@NotNull Location location, @NotNull TreeType type) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
|
||||
public boolean generateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Entity spawnEntity(Location loc, EntityType type) {
|
||||
public Entity spawnEntity(@NotNull Location loc, @NotNull EntityType type) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public LightningStrike strikeLightning(Location loc) {
|
||||
public LightningStrike strikeLightning(@NotNull Location loc) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public LightningStrike strikeLightningEffect(Location loc) {
|
||||
public LightningStrike strikeLightningEffect(@NotNull Location loc) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Entity> getEntities() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<LivingEntity> getLivingEntities() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(@SuppressWarnings("unchecked") Class<T>... classes) {
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(@NotNull Class<T>... classes) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(Class<T> cls) {
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(@NotNull Class<T> cls) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getEntitiesByClasses(Class<?>... classes) {
|
||||
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Player> getPlayers() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(Location location, double x, double y, double z) {
|
||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(Location location, double x, double y, double z, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance) {
|
||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) {
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<Entity> filter) {
|
||||
public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<Entity> filter) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public UUID getUID() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Location getSpawnLocation() {
|
||||
|
||||
@@ -464,7 +517,7 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setSpawnLocation(Location location) {
|
||||
public boolean setSpawnLocation(@NotNull Location location) {
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -591,29 +644,30 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power, boolean setFire) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) {
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Environment getEnvironment() {
|
||||
|
||||
@@ -648,62 +702,69 @@ public class HeightedFakeWorld implements World {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<BlockPopulator> getPopulators() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> T spawn(Location location, Class<T> clazz) throws IllegalArgumentException {
|
||||
public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, Consumer<T> function) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> T spawn(Location location, Class<T> clazz, Consumer<T> function) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(Location location, MaterialData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(Location location, BlockData data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlock spawnFallingBlock(Location location, Material material, byte data) throws IllegalArgumentException {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(Location location, Effect effect, int data) {
|
||||
public void playEffect(@NotNull Location location, @NotNull Effect effect, int data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(Location location, Effect effect, int data, int radius) {
|
||||
public void playEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location location, Effect effect, T data) {
|
||||
public <T> void playEffect(@NotNull Location location, @NotNull Effect effect, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location location, Effect effect, T data, int radius) {
|
||||
public <T> void playEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTemp) {
|
||||
|
||||
@@ -727,12 +788,14 @@ public class HeightedFakeWorld implements World {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome getBiome(int x, int z) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome getBiome(int x, int y, int z) {
|
||||
|
||||
@@ -740,12 +803,12 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int x, int z, Biome bio) {
|
||||
public void setBiome(int x, int z, @NotNull Biome bio) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int x, int y, int z, Biome bio) {
|
||||
public void setBiome(int x, int y, int z, @NotNull Biome bio) {
|
||||
|
||||
}
|
||||
|
||||
@@ -813,16 +876,18 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDifficulty(Difficulty difficulty) {
|
||||
public void setDifficulty(@NotNull Difficulty difficulty) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Difficulty getDifficulty() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public File getWorldFolder() {
|
||||
|
||||
@@ -963,25 +1028,26 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, Sound sound, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, String sound, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSound(Location location, String sound, SoundCategory category, float volume, float pitch) {
|
||||
public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String[] getGameRules() {
|
||||
|
||||
@@ -995,35 +1061,36 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setGameRuleValue(String rule, String value) {
|
||||
public boolean setGameRuleValue(@NotNull String rule, @NotNull String value) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGameRule(String rule) {
|
||||
public boolean isGameRule(@NotNull String rule) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getGameRuleValue(GameRule<T> rule) {
|
||||
public <T> T getGameRuleValue(@NotNull GameRule<T> rule) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getGameRuleDefault(GameRule<T> rule) {
|
||||
public <T> T getGameRuleDefault(@NotNull GameRule<T> rule) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> boolean setGameRule(GameRule<T> rule, T newValue) {
|
||||
public <T> boolean setGameRule(@NotNull GameRule<T> rule, @NotNull T newValue) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public WorldBorder getWorldBorder() {
|
||||
|
||||
@@ -1031,77 +1098,77 @@ public class HeightedFakeWorld implements World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, Location location, int count) {
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count) {
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored) {
|
||||
public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1110,16 +1177,18 @@ public class HeightedFakeWorld implements World {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Spigot spigot() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Raid locateNearestRaid(Location location, int radius) {
|
||||
public Raid locateNearestRaid(@NotNull Location location, int radius) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Raid> getRaids() {
|
||||
return null;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public interface IActivator {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
@SuppressWarnings("EmptyMethod")
|
||||
public interface IController extends Listener {
|
||||
String getName();
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class ING {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.*;
|
||||
@@ -9,9 +27,9 @@ import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipException;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public class IO {
|
||||
/**
|
||||
* The Unix directory separator character.
|
||||
@@ -51,7 +69,7 @@ public class IO {
|
||||
IO.fullTransfer(gzi, boas, 256);
|
||||
gzi.close();
|
||||
|
||||
return boas.toString(StandardCharsets.UTF_8);
|
||||
return boas.toString();
|
||||
}
|
||||
|
||||
public static byte[] sdecompress(String compressed) throws IOException {
|
||||
@@ -114,7 +132,6 @@ public class IO {
|
||||
*
|
||||
* @param in the input
|
||||
* @param out the output
|
||||
* @param amount the buffer and size to use
|
||||
* @return the actual transfered amount
|
||||
* @throws IOException shit happens
|
||||
*/
|
||||
@@ -313,30 +330,30 @@ public class IO {
|
||||
throw e;
|
||||
}
|
||||
BufferedReader bu = new BufferedReader(fr);
|
||||
String c = "";
|
||||
StringBuilder c = new StringBuilder();
|
||||
String l = "";
|
||||
|
||||
while ((l = bu.readLine()) != null) {
|
||||
c += l + "\n";
|
||||
c.append(l).append("\n");
|
||||
}
|
||||
|
||||
bu.close();
|
||||
|
||||
return c;
|
||||
return c.toString();
|
||||
}
|
||||
|
||||
public static String readAll(InputStream in) throws IOException {
|
||||
BufferedReader bu = new BufferedReader(new InputStreamReader(in));
|
||||
String c = "";
|
||||
StringBuilder c = new StringBuilder();
|
||||
String l = "";
|
||||
|
||||
while ((l = bu.readLine()) != null) {
|
||||
c += l + "\n";
|
||||
c.append(l).append("\n");
|
||||
}
|
||||
|
||||
bu.close();
|
||||
|
||||
return c;
|
||||
return c.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,7 +385,6 @@ public class IO {
|
||||
* @throws NullPointerException if source or destination is null
|
||||
* @throws IOException if source or destination is invalid
|
||||
* @throws IOException if an IO error occurs during copying
|
||||
* @see #copyFileToDirectory
|
||||
*/
|
||||
public static void copyFile(File srcFile, File destFile) throws IOException {
|
||||
copyFile(srcFile, destFile, true);
|
||||
@@ -389,7 +405,6 @@ public class IO {
|
||||
* @throws NullPointerException if source or destination is null
|
||||
* @throws IOException if source or destination is invalid
|
||||
* @throws IOException if an IO error occurs during copying
|
||||
* @see #copyFileToDirectory
|
||||
*/
|
||||
public static void copyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException {
|
||||
if (srcFile == null) {
|
||||
@@ -398,7 +413,7 @@ public class IO {
|
||||
if (destFile == null) {
|
||||
throw new NullPointerException("Destination must not be null");
|
||||
}
|
||||
if (srcFile.exists() == false) {
|
||||
if (!srcFile.exists()) {
|
||||
throw new FileNotFoundException("Source '" + srcFile + "' does not exist");
|
||||
}
|
||||
if (srcFile.isDirectory()) {
|
||||
@@ -407,12 +422,12 @@ public class IO {
|
||||
if (srcFile.getCanonicalPath().equals(destFile.getCanonicalPath())) {
|
||||
throw new IOException("Source '" + srcFile + "' and destination '" + destFile + "' are the same");
|
||||
}
|
||||
if (destFile.getParentFile() != null && destFile.getParentFile().exists() == false) {
|
||||
if (destFile.getParentFile().mkdirs() == false) {
|
||||
if (destFile.getParentFile() != null && !destFile.getParentFile().exists()) {
|
||||
if (!destFile.getParentFile().mkdirs()) {
|
||||
throw new IOException("Destination '" + destFile + "' directory cannot be created");
|
||||
}
|
||||
}
|
||||
if (destFile.exists() && destFile.canWrite() == false) {
|
||||
if (destFile.exists() && !destFile.canWrite()) {
|
||||
throw new IOException("Destination '" + destFile + "' exists but is read-only");
|
||||
}
|
||||
doCopyFile(srcFile, destFile, preserveFileDate);
|
||||
@@ -594,11 +609,9 @@ public class IO {
|
||||
*
|
||||
* @param input the <code>String</code> to convert
|
||||
* @return the requested byte array
|
||||
* @throws NullPointerException if the input is null
|
||||
* @throws IOException if an I/O error occurs (never occurs)
|
||||
* @deprecated Use {@link String#getBytes()}
|
||||
*/
|
||||
public static byte[] toByteArray(String input) throws IOException {
|
||||
public static byte[] toByteArray(String input) {
|
||||
return input.getBytes();
|
||||
}
|
||||
|
||||
@@ -731,11 +744,9 @@ public class IO {
|
||||
*
|
||||
* @param input the byte array to read from
|
||||
* @return the requested String
|
||||
* @throws NullPointerException if the input is null
|
||||
* @throws IOException if an I/O error occurs (never occurs)
|
||||
* @deprecated Use {@link String#String(byte[])}
|
||||
*/
|
||||
public static String toString(byte[] input) throws IOException {
|
||||
public static String toString(byte[] input) {
|
||||
return new String(input);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.object.tile.TileData;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public interface IRare {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,40 +1,25 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
*
|
||||
* Copyright (c) 2015 Neil Wightman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The <code>TAG_Int_Array</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
* JNBT License
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* Copyright (c) 2010 Graham Edgecombe
|
||||
* All rights reserved.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the JNBT team nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/**
|
||||
* The <code>TAG_Int</code> tag.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public enum InterpolationType {
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.generator.ChunkGenerator.BiomeGrid;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class InvertedBiomeGrid implements BiomeGrid {
|
||||
private final BiomeGrid grid;
|
||||
@@ -11,12 +30,14 @@ public class InvertedBiomeGrid implements BiomeGrid {
|
||||
this.grid = real;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Biome getBiome(int arg0, int arg1) {
|
||||
return grid.getBiome(arg0, arg1);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome getBiome(int arg0, int arg1, int arg2) {
|
||||
if (!Iris.biome3d) {
|
||||
@@ -28,12 +49,12 @@ public class InvertedBiomeGrid implements BiomeGrid {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void setBiome(int arg0, int arg1, Biome arg2) {
|
||||
public void setBiome(int arg0, int arg1, @NotNull Biome arg2) {
|
||||
grid.setBiome(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiome(int arg0, int arg1, int arg2, Biome arg3) {
|
||||
public void setBiome(int arg0, int arg1, int arg2, @NotNull Biome arg3) {
|
||||
if (!Iris.biome3d) {
|
||||
setBiome(arg0, arg2, arg3);
|
||||
return;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
@@ -830,8 +848,6 @@ public class IrisInterpolation {
|
||||
return getStarcast(x, z, h, 9D, (xx, zz) -> getHermiteNoise((int) xx, (int) zz, h, n, 0D, 0D));
|
||||
} else if (method.equals(InterpolationMethod.HERMITE_STARCAST_12)) {
|
||||
return getStarcast(x, z, h, 12D, (xx, zz) -> getHermiteNoise((int) xx, (int) zz, h, n, 0D, 0D));
|
||||
} else if (method.equals(InterpolationMethod.BICUBIC)) {
|
||||
return getBicubicNoise(x, z, h, n);
|
||||
} else if (method.equals(InterpolationMethod.BILINEAR_BEZIER)) {
|
||||
return getBilinearBezierNoise(x, z, h, n);
|
||||
} else if (method.equals(InterpolationMethod.BILINEAR_PARAMETRIC_2)) {
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -29,7 +47,7 @@ public class IrisLock {
|
||||
}
|
||||
try {
|
||||
lock.unlock();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.util.Random;
|
||||
@@ -57,30 +75,21 @@ public class IrisMathHelper {
|
||||
if (var0 < var1) {
|
||||
return var1;
|
||||
}
|
||||
if (var0 > var2) {
|
||||
return var2;
|
||||
}
|
||||
return var0;
|
||||
return Math.min(var0, var2);
|
||||
}
|
||||
|
||||
public static float a(final float var0, final float var1, final float var2) {
|
||||
if (var0 < var1) {
|
||||
return var1;
|
||||
}
|
||||
if (var0 > var2) {
|
||||
return var2;
|
||||
}
|
||||
return var0;
|
||||
return Math.min(var0, var2);
|
||||
}
|
||||
|
||||
public static double a(final double var0, final double var2, final double var4) {
|
||||
if (var0 < var2) {
|
||||
return var2;
|
||||
}
|
||||
if (var0 > var4) {
|
||||
return var4;
|
||||
}
|
||||
return var0;
|
||||
return Math.min(var0, var4);
|
||||
}
|
||||
|
||||
public static double b(final double var0, final double var2, final double var4) {
|
||||
@@ -100,7 +109,7 @@ public class IrisMathHelper {
|
||||
if (var2 < 0.0) {
|
||||
var2 = -var2;
|
||||
}
|
||||
return (var0 > var2) ? var0 : var2;
|
||||
return Math.max(var0, var2);
|
||||
}
|
||||
|
||||
public static int a(final int var0, final int var1) {
|
||||
@@ -242,7 +251,7 @@ public class IrisMathHelper {
|
||||
}
|
||||
|
||||
public static long c(final int var0, final int var1, final int var2) {
|
||||
long var3 = (long) (var0 * 3129871) ^ var2 * 116129781L ^ (long) var1;
|
||||
long var3 = (long) (var0 * 3129871L) ^ var2 * 116129781L ^ (long) var1;
|
||||
var3 = var3 * var3 * 42317861L + var3 * 11L;
|
||||
return var3 >> 16;
|
||||
}
|
||||
@@ -322,43 +331,37 @@ public class IrisMathHelper {
|
||||
float var9 = 0.0f;
|
||||
float var10 = 0.0f;
|
||||
switch (var3) {
|
||||
case 0: {
|
||||
case 0 -> {
|
||||
var8 = var2;
|
||||
var9 = var7;
|
||||
var10 = var5;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
case 1 -> {
|
||||
var8 = var6;
|
||||
var9 = var2;
|
||||
var10 = var5;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
case 2 -> {
|
||||
var8 = var5;
|
||||
var9 = var2;
|
||||
var10 = var7;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
case 3 -> {
|
||||
var8 = var5;
|
||||
var9 = var6;
|
||||
var10 = var2;
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
case 4 -> {
|
||||
var8 = var7;
|
||||
var9 = var5;
|
||||
var10 = var2;
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
case 5 -> {
|
||||
var8 = var2;
|
||||
var9 = var5;
|
||||
var10 = var6;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
default -> {
|
||||
throw new RuntimeException("Something went wrong when converting from HSV to RGB. Input was " + var0 + ", " + var1 + ", " + var2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -8,6 +26,7 @@ import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public class J {
|
||||
private static int tid = 0;
|
||||
private static final ExecutorService e = Executors.newCachedThreadPool(new ThreadFactory() {
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
/*
|
||||
Copyright (c) 2002 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
@@ -80,6 +74,7 @@ import java.util.Map;
|
||||
* @author JSON.org
|
||||
* @version 2015-07-22
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public class JSONArray implements Iterable<Object> {
|
||||
|
||||
/**
|
||||
@@ -876,6 +871,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
* @param other The other JSONArray
|
||||
* @return true if they are equal
|
||||
*/
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean similar(Object other) {
|
||||
if (!(other instanceof JSONArray)) {
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
/*
|
||||
Copyright (c) 2008 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
@@ -45,7 +39,6 @@ public class JSONML {
|
||||
* @param ja The JSONArray that is containing the current tag or null if we
|
||||
* are at the outermost level.
|
||||
* @return A JSONArray if the value is the outermost tag, otherwise null.
|
||||
* @throws JSONException
|
||||
*/
|
||||
private static Object parse(XMLTokener x, boolean arrayForm, JSONArray ja) throws JSONException {
|
||||
String attribute;
|
||||
@@ -237,7 +230,6 @@ public class JSONML {
|
||||
*
|
||||
* @param string The source string.
|
||||
* @return A JSONArray containing the structured data from the XML string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static JSONArray toJSONArray(String string) throws JSONException {
|
||||
return toJSONArray(new XMLTokener(string));
|
||||
@@ -254,7 +246,6 @@ public class JSONML {
|
||||
*
|
||||
* @param x An XMLTokener.
|
||||
* @return A JSONArray containing the structured data from the XML string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static JSONArray toJSONArray(XMLTokener x) throws JSONException {
|
||||
return (JSONArray) parse(x, true, null);
|
||||
@@ -272,7 +263,6 @@ public class JSONML {
|
||||
*
|
||||
* @param x An XMLTokener of the XML source text.
|
||||
* @return A JSONObject containing the structured data from the XML string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static JSONObject toJSONObject(XMLTokener x) throws JSONException {
|
||||
return (JSONObject) parse(x, false, null);
|
||||
@@ -290,7 +280,6 @@ public class JSONML {
|
||||
*
|
||||
* @param string The XML source text.
|
||||
* @return A JSONObject containing the structured data from the XML string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static JSONObject toJSONObject(String string) throws JSONException {
|
||||
return toJSONObject(new XMLTokener(string));
|
||||
@@ -301,7 +290,6 @@ public class JSONML {
|
||||
*
|
||||
* @param ja A JSONArray.
|
||||
* @return An XML string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static String toString(JSONArray ja) throws JSONException {
|
||||
int i;
|
||||
@@ -352,7 +340,6 @@ public class JSONML {
|
||||
length = ja.length();
|
||||
if (i >= length) {
|
||||
sb.append('/');
|
||||
sb.append('>');
|
||||
} else {
|
||||
sb.append('>');
|
||||
do {
|
||||
@@ -373,8 +360,8 @@ public class JSONML {
|
||||
sb.append('<');
|
||||
sb.append('/');
|
||||
sb.append(tagName);
|
||||
sb.append('>');
|
||||
}
|
||||
sb.append('>');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -386,7 +373,6 @@ public class JSONML {
|
||||
*
|
||||
* @param jo A JSONObject.
|
||||
* @return An XML string.
|
||||
* @throws JSONException
|
||||
*/
|
||||
public static String toString(JSONObject jo) throws JSONException {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -434,7 +420,6 @@ public class JSONML {
|
||||
ja = jo.optJSONArray("childNodes");
|
||||
if (ja == null) {
|
||||
sb.append('/');
|
||||
sb.append('>');
|
||||
} else {
|
||||
sb.append('>');
|
||||
length = ja.length();
|
||||
@@ -455,8 +440,8 @@ public class JSONML {
|
||||
sb.append('<');
|
||||
sb.append('/');
|
||||
sb.append(tagName);
|
||||
sb.append('>');
|
||||
}
|
||||
sb.append('>');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,23 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
/*
|
||||
Copyright (c) 2002 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
@@ -85,6 +79,7 @@ import java.util.Map.Entry;
|
||||
* @author JSON.org
|
||||
* @version 2015-07-22
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public class JSONObject {
|
||||
/**
|
||||
* JSONObject.NULL is equivalent to the value that JavaScript calls null,
|
||||
@@ -1305,6 +1300,7 @@ public class JSONObject {
|
||||
* @param other The other JSONObject
|
||||
* @return true if they are equal
|
||||
*/
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean similar(Object other) {
|
||||
try {
|
||||
if (!(other instanceof JSONObject)) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user