Fix iris loot & update blocks

This commit is contained in:
Daniel Mills 2021-07-23 17:44:13 -04:00
parent ce2d386b7e
commit 9752f1d492
3 changed files with 14 additions and 10 deletions

View File

@ -163,6 +163,7 @@ public class IrisEngine extends BlockPopulator implements Engine {
try {
PrecisionStopwatch p = PrecisionStopwatch.start();
BurstExecutor b = burst().burst(16);
Hunk<BlockData> blocks = vblocks.listen((xx, y, zz, t) -> catchBlockUpdates(x + xx, y + getMinHeight(), z + zz, t));
// This is a very weird optimization, but it works
// Basically we precache multicore the biome stream which effectivley
@ -188,9 +189,9 @@ public class IrisEngine extends BlockPopulator implements Engine {
getFramework().getCaveModifier().modify(x, z, vblocks);
getFramework().getRavineModifier().modify(x, z, vblocks);
getFramework().getPostModifier().modify(x, z, vblocks);
getFramework().getDecorantActuator().actuate(x, z, vblocks);
getFramework().getEngineParallax().insertParallax(x >> 4, z >> 4, vblocks);
getFramework().getDepositModifier().modify(x, z, vblocks);
getFramework().getDecorantActuator().actuate(x, z, blocks);
getFramework().getEngineParallax().insertParallax(x >> 4, z >> 4, blocks);
getFramework().getDepositModifier().modify(x, z, blocks);
}
case ISLANDS -> {
getFramework().getTerrainActuator().actuate(x, z, vblocks);

View File

@ -74,8 +74,6 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
trySpawn(above.getEntityInitialSpawns(), c, rng);
trySpawn(region.getEntityInitialSpawns(), c, rng);
trySpawn(dim.getEntityInitialSpawns(), c, rng);
}
@Override

View File

@ -38,15 +38,23 @@ import com.volmit.iris.util.scheduling.PrecisionStopwatch;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.block.data.BlockData;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.loot.LootContext;
import org.bukkit.loot.LootTable;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.Random;
public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootProvider, BlockUpdater, Renderer, Hotloadable {
void close();
@ -163,10 +171,8 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
}
if (B.isUpdatable(data)) {
synchronized (getParallax()) {
getParallax().updateBlock(x, y, z);
getParallax().getMetaRW(x >> 4, z >> 4).setUpdates(true);
}
getParallax().updateBlock(x, y, z);
getParallax().getMetaRW(x >> 4, z >> 4).setUpdates(true);
}
}
@ -233,7 +239,6 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
addItems(false, m.getInventory(), rx, tables, slot, x, y, z, 15);
} catch (Throwable e) {
Iris.reportError(e);
}
}
}