9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-29 20:19:06 +00:00
This commit is contained in:
Daniel Mills
2020-09-07 20:10:22 -04:00
parent 1993639bf6
commit bdb86808a5
11 changed files with 173 additions and 64 deletions

View File

@@ -113,27 +113,6 @@ public class GenLayerCave extends GenLayer
{
ceiling = pu > ceiling ? pu : ceiling;
floor = pu < floor ? pu : floor;
if(pu > surface - 2)
{
if(dig(x, pu + 1, z, data))
{
ceiling = pu + 1 > ceiling ? pu + 1 : ceiling;
floor = pu + 1 < floor ? pu + 1 : floor;
if(dig(x, pu + 2, z, data))
{
ceiling = pu + 2 > ceiling ? pu + 2 : ceiling;
floor = pu + 2 < floor ? pu + 2 : floor;
if(dig(x, pu + 3, z, data))
{
ceiling = pu + 3 > ceiling ? pu + 3 : ceiling;
floor = pu + 3 < floor ? pu + 3 : floor;
}
}
}
}
}
if(dig(x, pd, z, data))

View File

@@ -6,9 +6,11 @@ import java.util.Map;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
import org.bukkit.craftbukkit.v1_14_R1.CraftWorld;
import org.bukkit.event.Event;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldLoadEvent;
@@ -30,9 +32,17 @@ import net.minecraft.server.v1_14_R1.WorldNBTStorage;
import net.minecraft.server.v1_14_R1.WorldProvider;
import net.minecraft.server.v1_14_R1.WorldServer;
import net.minecraft.server.v1_14_R1.WorldSettings;
import net.minecraft.server.v1_14_R1.ChunkCoordIntPair;
import net.minecraft.server.v1_14_R1.TicketType;
import net.minecraft.server.v1_14_R1.Unit;
public class NMSCreator141
{
public static void addStartTicket(Location center, int size)
{
((CraftWorld) center.getWorld()).getHandle().getChunkProvider().addTicket(TicketType.START, new ChunkCoordIntPair(center.getBlockX() >> 4, center.getBlockZ() >> 4), size, Unit.INSTANCE);
}
@SuppressWarnings({"resource", "deprecation"})
public static World createWorld(WorldCreator creator, boolean loadSpawn)
{

View File

@@ -6,9 +6,11 @@ import java.util.Map;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.craftbukkit.v1_15_R1.CraftServer;
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
import org.bukkit.event.Event;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldLoadEvent;
@@ -30,9 +32,17 @@ import net.minecraft.server.v1_15_R1.WorldNBTStorage;
import net.minecraft.server.v1_15_R1.WorldProvider;
import net.minecraft.server.v1_15_R1.WorldServer;
import net.minecraft.server.v1_15_R1.WorldSettings;
import net.minecraft.server.v1_15_R1.ChunkCoordIntPair;
import net.minecraft.server.v1_15_R1.TicketType;
import net.minecraft.server.v1_15_R1.Unit;
public class NMSCreator151
{
public static void addStartTicket(Location center, int size)
{
((CraftWorld) center.getWorld()).getHandle().getChunkProvider().addTicket(TicketType.START, new ChunkCoordIntPair(center.getBlockX() >> 4, center.getBlockZ() >> 4), size, Unit.INSTANCE);
}
@SuppressWarnings({"resource", "deprecation"})
public static World createWorld(WorldCreator creator, boolean loadSpawn)
{

View File

@@ -11,9 +11,11 @@ import java.util.Random;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.craftbukkit.v1_16_R1.CraftServer;
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
import org.bukkit.event.Event;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldLoadEvent;
@@ -52,9 +54,17 @@ import net.minecraft.server.v1_16_R1.WorldDataServer;
import net.minecraft.server.v1_16_R1.WorldDimension;
import net.minecraft.server.v1_16_R1.WorldServer;
import net.minecraft.server.v1_16_R1.WorldSettings;
import net.minecraft.server.v1_16_R1.ChunkCoordIntPair;
import net.minecraft.server.v1_16_R1.TicketType;
import net.minecraft.server.v1_16_R1.Unit;
public class NMSCreator161
{
public static void addStartTicket(Location center, int size)
{
((CraftWorld) center.getWorld()).getHandle().getChunkProvider().addTicket(TicketType.START, new ChunkCoordIntPair(center.getBlockX() >> 4, center.getBlockZ() >> 4), size, Unit.INSTANCE);
}
@SuppressWarnings({"unchecked", "rawtypes", "resource"})
public static World createWorld(WorldCreator creator, boolean loadSpawn)
{

View File

@@ -270,6 +270,57 @@ public class PostMasterPatcher extends IrisPostBlockFilter
int cc = nearestCaveCeiling(c, x - 1, z, currentPostX, currentPostZ, currentData);
int cd = nearestCaveCeiling(c, x, z - 1, currentPostX, currentPostZ, currentData);
// Cave Nibs
g = 0;
g += fa == f - 1 ? 1 : 0;
g += fb == f - 1 ? 1 : 0;
g += fc == f - 1 ? 1 : 0;
g += fd == f - 1 ? 1 : 0;
if(g >= 3)
{
BlockData bc = getPostBlock(x, f, z, currentPostX, currentPostZ, currentData);
b = getPostBlock(x, f + 1, z, currentPostX, currentPostZ, currentData);
Material m = bc.getMaterial();
if(m.isSolid())
{
setPostBlock(x, f, z, b, currentPostX, currentPostZ, currentData);
updateHeight(x, z, f - 1);
h--;
}
}
else
{
// Cave Potholes
g = 0;
g += fa == f + 1 ? 1 : 0;
g += fb == f + 1 ? 1 : 0;
g += fc == f + 1 ? 1 : 0;
g += fd == f + 1 ? 1 : 0;
if(g >= 3)
{
BlockData ba = getPostBlock(x, fa, z, currentPostX, currentPostZ, currentData);
BlockData bb = getPostBlock(x, fb, z, currentPostX, currentPostZ, currentData);
BlockData bc = getPostBlock(x, fc, z, currentPostX, currentPostZ, currentData);
BlockData bd = getPostBlock(x, fd, z, currentPostX, currentPostZ, currentData);
g = 0;
g = B.isSolid(ba) ? g + 1 : g;
g = B.isSolid(bb) ? g + 1 : g;
g = B.isSolid(bc) ? g + 1 : g;
g = B.isSolid(bd) ? g + 1 : g;
if(g >= 3)
{
setPostBlock(x, f + 1, z, getPostBlock(x, f, z, currentPostX, currentPostZ, currentData), currentPostX, currentPostZ, currentData);
updateHeight(x, z, f + 1);
h++;
}
}
}
if(gen.getDimension().isPostProcessingSlabs())
{
//@builder