Spigot Configuration

Provides the basic infrastructure to load and save the Spigot configuration file, spigot.yml

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2013-07-07 09:32:53 +10:00
parent 6b0bae2fb6
commit cba0d1f1ec
7 changed files with 318 additions and 27 deletions

View File

@@ -56,7 +56,7 @@
public abstract class Level implements LevelAccessor, AutoCloseable {
public static final Codec<ResourceKey<Level>> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION);
@@ -121,23 +143,58 @@
@@ -121,23 +143,60 @@
private final DamageSources damageSources;
private long subTickCount;
@@ -79,6 +79,7 @@
+ public List<ItemEntity> captureDrops;
+ public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
+ public boolean populating;
+ public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
+
+ public CraftWorld getWorld() {
+ return this.world;
@@ -91,6 +92,7 @@
+ public abstract ResourceKey<LevelStem> getTypeKey();
+
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
+ this.generator = gen;
+ this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
+
@@ -124,7 +126,7 @@
}
};
} else {
@@ -145,11 +202,47 @@
@@ -145,11 +204,47 @@
}
this.thread = Thread.currentThread();
@@ -177,7 +179,7 @@
}
@Override
@@ -207,6 +300,18 @@
@@ -207,6 +302,18 @@
@Override
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
@@ -196,7 +198,7 @@
if (this.isOutsideBuildHeight(pos)) {
return false;
} else if (!this.isClientSide && this.isDebug()) {
@@ -214,44 +319,117 @@
@@ -214,45 +321,118 @@
} else {
LevelChunk chunk = this.getChunkAt(pos);
Block block = state.getBlock();
@@ -274,10 +276,10 @@
+ // CraftBukkit end
+
return true;
+ }
+ }
+ }
+
}
}
}
+ // CraftBukkit start - Split off from above in order to directly send client and physic updates
+ public void notifyAndUpdatePhysics(BlockPos blockposition, LevelChunk chunk, BlockState oldBlock, BlockState newBlock, BlockState actualBlock, int i, int j) {
+ BlockState iblockdata = newBlock;
@@ -297,7 +299,7 @@
+ if (!this.isClientSide && iblockdata.hasAnalogOutputSignal()) {
+ this.updateNeighbourForOutputSignal(blockposition, newBlock.getBlock());
+ }
}
+ }
+
+ if ((i & 16) == 0 && j > 0) {
+ int k = i & -34;
@@ -323,13 +325,14 @@
+ this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
+ }
+ // CraftBukkit end
}
}
+ }
+ }
+ // CraftBukkit end
+
public void onBlockStateChange(BlockPos pos, BlockState oldBlock, BlockState newBlock) {}
@@ -340,6 +518,14 @@
@Override
@@ -340,6 +520,14 @@
@Override
public BlockState getBlockState(BlockPos pos) {
@@ -344,7 +347,7 @@
if (this.isOutsideBuildHeight(pos)) {
return Blocks.VOID_AIR.defaultBlockState();
} else {
@@ -510,13 +696,29 @@
@@ -510,13 +698,29 @@
@Nullable
@Override
public BlockEntity getBlockEntity(BlockPos pos) {
@@ -375,7 +378,7 @@
this.getChunkAt(blockposition).addAndRegisterBlockEntity(blockEntity);
}
}
@@ -643,7 +845,7 @@
@@ -643,7 +847,7 @@
for (int k = 0; k < j; ++k) {
EnderDragonPart entitycomplexpart = aentitycomplexpart[k];
@@ -384,7 +387,7 @@
if (t0 != null && predicate.test(t0)) {
result.add(t0);
@@ -912,7 +1114,7 @@
@@ -912,7 +1116,7 @@
public static enum ExplosionInteraction implements StringRepresentable {