mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
Add some SparklyPower-specific patches, update README
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -30,11 +30,6 @@ jobs:
|
||||
run: ./gradlew applyPatches
|
||||
- name: Build
|
||||
run: ./gradlew build
|
||||
- name: Publish publications and dev bundle
|
||||
run: ./gradlew -PpublishDevBundle publishDevBundlePublicationToPerfectDreamsRepository publishMavenPublicationToPerfectDreamsRepository
|
||||
env:
|
||||
ORG_GRADLE_PROJECT_PerfectDreamsUsername: ${{ secrets.PERFECTDREAMS_REPO_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_PerfectDreamsPassword: ${{ secrets.PERFECTDREAMS_REPO_PASSWORD }}
|
||||
- name: Create Paperclip JAR
|
||||
run: ./gradlew createMojmapPaperclipJar createReobfPaperclipJar
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
||||
13
README.md
13
README.md
@@ -12,6 +12,16 @@ SparklyPower's Paper fork, making large servers snappier with high-performance o
|
||||
|
||||
Our fork has handmade patches to add and optimize some of the things that we have in our server, with some cherry-picked patches from other forks.
|
||||
|
||||
## ATTENTION - PLEASE READ!
|
||||
|
||||
SparklyPaper is a fork tailor-made for our Survival server, SparklyPower. It doesn't strive to be a public stable Paper fork like Purpur, Pufferfish, and other similar forks.
|
||||
|
||||
We do provide SparklyPaper builds if you want to use it in your server, but keep in mind that we won't provide support for it! If your server has issues while using SparklyPaper, or if it explodes, we won't help you!
|
||||
|
||||
This also means that unless a PR fixes an issue that we are having in SparklyPower, we (probably) won't accept it!
|
||||
|
||||
If you have the know how, we recommend making your own Paper fork and copying the SparklyPaper's patches that you need for your server.
|
||||
|
||||
## Features
|
||||
|
||||
This does not include all patches included in SparklyPaper, only the patches handmade for SparklyPaper! To see all patches, check out the ["patches" directory](patches).
|
||||
@@ -67,6 +77,9 @@ SparklyPaper's config file is `sparklypaper.yml`, the file is, by default, place
|
||||
* We could use a map for caching, but here's why this is way better than using a map: The block entity ticking list is sorted by chunks! Well, sort of... It is sorted by chunk when the chunk has been loaded, newly placed blocks will be appended to the end of the list until the chunk unloads and loads again. Most block entities are things that players placed to be there for a long time anyway (like hoppers, etc)
|
||||
* But here's the thing: We don't care if we have a small performance penalty if the players have placed new block entities, the small performance hit of when a player placed new block entities is so small ('tis just a long comparsion after all), that the performance boost from already placed block entities is bigger, this helps a lot if your server has a lot of chunks with multiple block entities, and the block entities will be automatically sorted after the chunk is unloaded and loaded again, so it ain't that bad.
|
||||
* And finally, we also cache the chunk's coordinate key when creating the block entity, which is actually "free" because we just reuse the already cached chunk coordinate key from the chunk!
|
||||
* Reset dirty flag when loading maps from the disk
|
||||
* By default, the server will start rewriting all map datas to the disk after loading it, even if the map didn't have any changes
|
||||
* This also slows down world saving a lot if you have a lot of maps if you have an "image on map" plugin that preloads all maps during server startup
|
||||
* Check how much MSPT (milliseconds per tick) each world is using in `/mspt`
|
||||
* Useful to figure out which worlds are lagging your server.
|
||||

|
||||
|
||||
@@ -8,3 +8,8 @@
|
||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
net.minecraft.world.level.block.entity.TickingBlockEntity
|
||||
minecraft net.minecraft.world.level.block.Blocks
|
||||
minecraft net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket
|
||||
minecraft net.minecraft.network.protocol.game.ClientboundRotateHeadPacket
|
||||
minecraft net.minecraft.network.protocol.game.ClientboundAddEntityPacket
|
||||
25
patches/api/0004-SPARKLYPOWER-Add-custom-blocks.patch
Normal file
25
patches/api/0004-SPARKLYPOWER-Add-custom-blocks.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Wed, 12 Jun 2024 11:53:27 -0300
|
||||
Subject: [PATCH] SPARKLYPOWER Add custom blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 7509b61dfdc0a6675256970cb850b08f9e814580..5f6da439b2e7cdb63afd2e93b276a06fc1e677c1 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -3818,6 +3818,14 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BIG_DRIPLEAF_STEM(13167, Dripleaf.class),
|
||||
POTTED_AZALEA_BUSH(20430),
|
||||
POTTED_FLOWERING_AZALEA_BUSH(10609),
|
||||
+ // SparklyPaper start - SparklyPower Survival custom blocks
|
||||
+ // The IDs themselves doesn't have any correlation with anything, Spigot invented that for backwards compatibility
|
||||
+ SPARKLYPOWER_RAINBOW_WOOL(13003),
|
||||
+ SPARKLYPOWER_RAINBOW_CONCRETE(13004),
|
||||
+ SPARKLYPOWER_RAINBOW_TERRACOTTA(13005),
|
||||
+ SPARKLYPOWER_ASPHALT_SERVER(13006),
|
||||
+ SPARKLYPOWER_ASPHALT_PLAYER(13007),
|
||||
+ // SparklyPaper end
|
||||
// ----- Legacy Separator -----
|
||||
@Deprecated
|
||||
LEGACY_AIR(0, 0),
|
||||
@@ -1030,7 +1030,7 @@ index 786e4a8700cb84b16dd9b8892a0d1d5803924d81..a54754c4ff7bfb5101d362bc3a8b3073
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 58c38bc4361ddf24716f326b0c6fc626d434756e..45fc0a8c20eb549d51a7dc90e64bff59a8617fa3 100644
|
||||
index 2f3c3442d8bb3990576b6a56142fefdd2c11fcc7..7517f6780b42f45eb85a266104648bcc8bea945a 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -421,8 +421,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sat, 1 Jun 2024 01:22:41 -0300
|
||||
Subject: [PATCH] Remap SparklyPower hacky legacy NBT tags
|
||||
Subject: [PATCH] SPARKLYPOWER Remap SparklyPower hacky legacy NBT tags
|
||||
|
||||
This is only useful for us in SparklyPower, but yeah...
|
||||
|
||||
72
patches/server/0024-SPARKLYPOWER-Add-custom-blocks.patch
Normal file
72
patches/server/0024-SPARKLYPOWER-Add-custom-blocks.patch
Normal file
@@ -0,0 +1,72 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Wed, 12 Jun 2024 11:53:09 -0300
|
||||
Subject: [PATCH] SPARKLYPOWER Add custom blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
index 260906f493416d98ab574a7262fce5e9b7e40c64..92b6f69e60bfafe5f325b9b16df0e56a73c52124 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -42,9 +42,9 @@ import net.minecraft.world.level.material.PushReaction;
|
||||
|
||||
public class Blocks {
|
||||
private static final BlockBehaviour.StatePredicate NOT_CLOSED_SHULKER = (state, world, pos) -> !(
|
||||
- world.getBlockEntity(pos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity
|
||||
- )
|
||||
- || shulkerBoxBlockEntity.isClosed();
|
||||
+ world.getBlockEntity(pos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity
|
||||
+ )
|
||||
+ || shulkerBoxBlockEntity.isClosed();
|
||||
public static final Block AIR = register("air", new AirBlock(BlockBehaviour.Properties.of().replaceable().noCollission().noLootTable().air()));
|
||||
public static final Block STONE = register(
|
||||
"stone",
|
||||
@@ -7658,6 +7658,48 @@ public class Blocks {
|
||||
.requiredFeatures(FeatureFlags.UPDATE_1_21)
|
||||
)
|
||||
);
|
||||
+ // SparklyPaper start - SparklyPower Survival custom blocks
|
||||
+ // Blocks' strength should be synced with the replaced block on the client side!
|
||||
+ public static final Block SPARKLYPOWER_RAINBOW_WOOL = register(
|
||||
+ "sparklypower_rainbow_wool", new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS))
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_RAINBOW_CONCRETE = register(
|
||||
+ "sparklypower_rainbow_concrete", new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS))
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_RAINBOW_TERRACOTTA = register(
|
||||
+ "sparklypower_rainbow_terracotta", new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS))
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_SERVER = register(
|
||||
+ "sparklypower_asphalt_server", new Block(
|
||||
+ BlockBehaviour.Properties.of()
|
||||
+ .mapColor(MapColor.COLOR_BLACK)
|
||||
+ .instrument(NoteBlockInstrument.BASEDRUM)
|
||||
+ .requiresCorrectToolForDrops()
|
||||
+ .strength(1.5F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_SERVER_SLAB = register(
|
||||
+ "sparklypower_asphalt_server_slab",
|
||||
+ new SlabBlock(
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK).instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(2.0F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_PLAYER = register(
|
||||
+ "sparklypower_asphalt_player", new Block(
|
||||
+ BlockBehaviour.Properties.of()
|
||||
+ .mapColor(MapColor.COLOR_BLACK)
|
||||
+ .instrument(NoteBlockInstrument.BASEDRUM)
|
||||
+ .requiresCorrectToolForDrops()
|
||||
+ .strength(1.5F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_PLAYER_SLAB = register(
|
||||
+ "sparklypower_asphalt_player_slab",
|
||||
+ new SlabBlock(
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK).instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(2.0F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ // SparklyPaper end
|
||||
|
||||
private static ToIntFunction<BlockState> litBlockEmission(int litLevel) {
|
||||
return state -> state.getValue(BlockStateProperties.LIT) ? litLevel : 0;
|
||||
Reference in New Issue
Block a user