Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2255f92
start reimplementing regen command
aurorasmiles Sep 3, 2020
fea16ce
start reimplementing regen command
aurorasmiles Sep 3, 2020
ec39b6c
Merge origin/fix-regen into fix-regen
weaondara Sep 6, 2020
37d197a
Formatting and logic tweaks.
MattBDev Sep 8, 2020
3f22422
fix //regen crashing server
weaondara Sep 19, 2020
eee00c2
Merge remote-tracking branch 'upstream/main' into fix-regen
aurorasmiles Sep 20, 2020
52b52c5
added //regen support for 1.16.1 and 1.15.2
weaondara Sep 20, 2020
15058ad
cleanup
weaondara Sep 20, 2020
58daec9
Update the issue template
aurorasmiles Sep 20, 2020
f55aded
Merge branch 'main' of https://github.com/IntellectualSites/FastAsync…
aurorasmiles Sep 20, 2020
9a656b4
improve performance of regen by a factor of 40, approx 1.2 millon blo…
weaondara Sep 22, 2020
e6218ff
Update the issue template
aurorasmiles Sep 20, 2020
adda7ba
Update the issue template & add a config (#640)
aurorasmiles Sep 20, 2020
94b5550
improve performance of regen by a factor of 40, approx 1.2 millon blo…
weaondara Sep 22, 2020
1f4c1dd
Merge branch 'main' into fix-regen
weaondara Sep 23, 2020
05ffff6
Fix entity rotation (#642)
aurorasmiles Sep 20, 2020
b5492f3
Fix toggle permission (#644)
aurorasmiles Sep 21, 2020
0f0aa5c
Fix #647
dordsor21 Sep 21, 2020
ab0c5e2
Squash errors and debug to aid fixing #652 properly
dordsor21 Sep 22, 2020
425c875
Merge remote-tracking branch 'upsteam/main' into main
weaondara Sep 23, 2020
ef68de5
Merge branch 'main' into fix-regen
weaondara Sep 23, 2020
154f12a
cleanup imports
weaondara Sep 23, 2020
319b75f
cleanup imports 2
weaondara Sep 23, 2020
4daf768
cleanup imports 3
weaondara Sep 23, 2020
f2f4a2a
cleanup imports 4
weaondara Sep 23, 2020
083c489
add patch by @SirYwell
aurorasmiles Sep 24, 2020
2f02e9f
aysnc world gen with features and stuff and some minor issues
weaondara Sep 25, 2020
3c9292f
optimizations, full chunkstatus, block populators
weaondara Sep 25, 2020
0d477db
optimizations, cleanup
weaondara Sep 25, 2020
eabfaae
optimizations
weaondara Sep 25, 2020
d99bcf7
fix feature regeneration, fix temp folder deletion
weaondara Sep 26, 2020
c750e50
cleanup
weaondara Sep 26, 2020
409b3d4
make chunk gen multithreaded
weaondara Sep 28, 2020
0d78d33
fix precomputation of chunk lists for RegionLimitedWorldAccess again
weaondara Sep 28, 2020
6c10f9a
added regenerator abstraction, fix aioobe while running through chunk…
weaondara Sep 30, 2020
b6debb8
remove override for getChunkAt in freshnmsworld
weaondara Oct 2, 2020
4ce7454
don't use concurrent chunk gen if custom chunk generators do not supp…
weaondara Oct 2, 2020
69178e1
distinct between generator types
weaondara Oct 3, 2020
79b746f
improve regen speed for overworlds
weaondara Oct 4, 2020
a4421d2
mix
weaondara Oct 4, 2020
41490fa
Add message that regen might take a while
aurorasmiles Oct 4, 2020
b7eda0b
Merge branch 'main' of https://github.com/IntellectualSites/FastAsync…
aurorasmiles Oct 4, 2020
dd860cb
use a shared map for FastAreaLazy, cleanup imports
weaondara Oct 4, 2020
eb2e5a6
Merge origin/fix-regen into fix-regen
weaondara Oct 4, 2020
f4a913a
use custom concurrency levels for chunk stati and process accordingly
weaondara Oct 5, 2020
70145fe
Merge branch 'main' of https://github.com/IntellectualSites/FastAsync…
aurorasmiles Oct 5, 2020
475ccb2
implement new regen in 1.15.2 and 1.16.1 as well
weaondara Oct 6, 2020
5b2e25c
woops
weaondara Oct 6, 2020
5c879b7
further abstraction, finalized regen impl
weaondara Oct 6, 2020
29e6e13
Merge branch 'main' of https://github.com/IntellectualSites/FastAsync…
aurorasmiles Oct 7, 2020
886bee4
Formatting
aurorasmiles Oct 7, 2020
93b07bc
Fix some typos, remove debug
aurorasmiles Oct 7, 2020
5eecfa1
replace wildcard imports
weaondara Oct 7, 2020
99d0cfb
cleanup debug
weaondara Oct 7, 2020
aaab2a4
braces
weaondara Oct 7, 2020
6b4b9f7
serr -> logger
weaondara Oct 7, 2020
93b1e03
move regen impls to seperate classes
weaondara Oct 7, 2020
14c36a5
fix world init for 1.16.1
weaondara Oct 8, 2020
b27404b
fix world init for 1.15.2
weaondara Oct 8, 2020
9171e1b
fix world init for 1.15.2 #2
weaondara Oct 8, 2020
41998e6
use original world name for regeneration
weaondara Oct 8, 2020
c12dd21
Update Regen_v1_15_R2.java
MattBDev Oct 8, 2020
7665191
Update worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adap…
aurorasmiles Oct 8, 2020
d9ed469
Update worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adap…
aurorasmiles Oct 8, 2020
87596bf
Update worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adap…
aurorasmiles Oct 8, 2020
3516470
Merge branch 'main' of https://github.com/IntellectualSites/FastAsync…
aurorasmiles Oct 9, 2020
3dc5fdc
improve documentation, use parallel task count for fawe settings
weaondara Oct 9, 2020
4437b86
fix compile
weaondara Oct 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.internal.wna.WorldNativeAccess;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
Expand All @@ -42,6 +43,7 @@
import com.sk89q.worldedit.util.SideEffectSet;
import com.sk89q.worldedit.util.TreeGenerator;
import com.sk89q.worldedit.world.AbstractWorld;
import com.sk89q.worldedit.world.RegenOptions;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder;
Expand Down Expand Up @@ -202,61 +204,18 @@ public int getBlockLightLevel(BlockVector3 pt) {
}

@Override
public boolean regenerate(Region region, EditSession editSession) {
public boolean regenerate(Region region, Extent extent, RegenOptions options) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
try {
if (adapter != null) {
return adapter.regenerate(getWorld(), region, editSession);
return adapter.regenerate(getWorld(), region, extent, options);
} else {
throw new UnsupportedOperationException("Missing BukkitImplAdapater for this version.");
}
} catch (Exception e) {
logger.warn("Regeneration via adapter failed.", e);
return false;
}
/*
BaseBlock[] history = new BaseBlock[16 * 16 * (getMaxY() + 1)];

for (BlockVector2 chunk : region.getChunks()) {
BlockVector3 min = BlockVector3.at(chunk.getBlockX() * 16, 0, chunk.getBlockZ() * 16);

// First save all the blocks inside
for (int x = 0; x < 16; ++x) {
for (int y = 0; y < (getMaxY() + 1); ++y) {
for (int z = 0; z < 16; ++z) {
BlockVector3 pt = min.add(x, y, z);
int index = y * 16 * 16 + z * 16 + x;
history[index] = editSession.getFullBlock(pt);
}
}
}

try {
getWorld().regenerateChunk(chunk.getBlockX(), chunk.getBlockZ());
} catch (Throwable t) {
logger.warn("Chunk generation via Bukkit raised an error", t);
}

// Then restore
for (int x = 0; x < 16; ++x) {
for (int y = 0; y < (getMaxY() + 1); ++y) {
for (int z = 0; z < 16; ++z) {
BlockVector3 pt = min.add(x, y, z);
int index = y * 16 * 16 + z * 16 + x;

// We have to restore the block if it was outside
if (!region.contains(pt)) {
editSession.smartSetBlock(pt, history[index]);
} else { // Otherwise fool with history
editSession.getChangeSet().add(new BlockChange(pt, history[index], editSession.getFullBlock(pt)));
}
}
}
}
}

return true;
*/
return editSession.regenerate(region);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@
import com.boydti.fawe.bukkit.FaweBukkit;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.internal.wna.WorldNativeAccess;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
Expand Down Expand Up @@ -236,11 +237,12 @@ default void sendFakeChunk(org.bukkit.World world, Player player, ChunkPacket pa
* Regenerate a region in the given world, so it appears "as new".
* @param world the world to regen in
* @param region the region to regen
* @param session the session to use for setting blocks
* @param extent the extent to use for setting blocks
* @param options the regeneration options
* @return true on success, false on failure
*/
default boolean regenerate(org.bukkit.World world, Region region, EditSession session) {
return session.regenerate(region);
default boolean regenerate(World world, Region region, Extent extent, RegenOptions options) throws Exception{
throw new UnsupportedOperationException("This adapter does not support regeneration.");
}

default IChunkGet get(World world, int chunkX, int chunkZ) {
Expand Down
Loading