mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
83 lines
5.2 KiB
Diff
83 lines
5.2 KiB
Diff
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 66a07f7cbf1c1d6ecbe055cbf4f63eb07d93e90c..2738ccd47cbb7d26a6c92c2d86b1735003df9e2e 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
|
@@ -6725,10 +6725,55 @@ public class Blocks {
|
|
.pushReaction(PushReaction.DESTROY)
|
|
.requiredFeatures(FeatureFlags.WINTER_DROP)
|
|
);
|
|
+ // 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",
|
|
+ Block::new,
|
|
+ BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS)
|
|
+ );
|
|
+ public static final Block SPARKLYPOWER_RAINBOW_CONCRETE = register(
|
|
+ "sparklypower_rainbow_concrete",
|
|
+ Block::new,
|
|
+ BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS)
|
|
+ );
|
|
+ public static final Block SPARKLYPOWER_RAINBOW_TERRACOTTA = register(
|
|
+ "sparklypower_rainbow_terracotta",
|
|
+ Block::new,
|
|
+ BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS)
|
|
+ );
|
|
+ public static final Block SPARKLYPOWER_ASPHALT_SERVER = register(
|
|
+ "sparklypower_asphalt_server",
|
|
+ Block::new,
|
|
+ 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",
|
|
+ SlabBlock::new,
|
|
+ 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",
|
|
+ Block::new,
|
|
+ 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",
|
|
+ SlabBlock::new,
|
|
+ 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;
|
|
- }
|
|
+ return state -> state.getValue(BlockStateProperties.LIT) ? litLevel : 0; }
|
|
|
|
private static Function<BlockState, MapColor> waterloggedMapColor(MapColor mapColor) {
|
|
return state -> state.getValue(BlockStateProperties.WATERLOGGED) ? MapColor.WATER : mapColor;
|
|
diff --git a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
|
index 91926be355af20bba86be4c569cf7f972c79fbb5..26aa9cf0288055d5c8d9165ddc2ad3707b950ea4 100644
|
|
--- a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
|
+++ b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
|
@@ -132,6 +132,9 @@ public class LegacyTest {
|
|
Material.CREAKING_SPAWN_EGG, Material.PALE_HANGING_MOSS, Material.PALE_MOSS_BLOCK, Material.PALE_MOSS_CARPET, Material.PALE_OAK_BOAT, Material.PALE_OAK_BUTTON, Material.PALE_OAK_CHEST_BOAT, Material.PALE_OAK_DOOR, Material.PALE_OAK_FENCE,
|
|
Material.PALE_OAK_FENCE_GATE, Material.PALE_OAK_HANGING_SIGN, Material.PALE_OAK_LEAVES, Material.PALE_OAK_LOG, Material.PALE_OAK_PLANKS, Material.PALE_OAK_PRESSURE_PLATE, Material.PALE_OAK_SAPLING, Material.PALE_OAK_SIGN, Material.PALE_OAK_SLAB,
|
|
Material.PALE_OAK_STAIRS, Material.PALE_OAK_TRAPDOOR, Material.PALE_OAK_WALL_SIGN, Material.PALE_OAK_WALL_HANGING_SIGN, Material.PALE_OAK_WOOD, Material.POTTED_PALE_OAK_SAPLING, Material.STRIPPED_PALE_OAK_LOG, Material.STRIPPED_PALE_OAK_WOOD,
|
|
+ // SparklyPower custom blocks
|
|
+ Material.SPARKLYPOWER_RAINBOW_WOOL, Material.SPARKLYPOWER_RAINBOW_CONCRETE, Material.SPARKLYPOWER_RAINBOW_TERRACOTTA, Material.SPARKLYPOWER_ASPHALT_PLAYER, Material.SPARKLYPOWER_ASPHALT_SERVER, Material.SPARKLYPOWER_ASPHALT_PLAYER_SLAB,
|
|
+ Material.SPARKLYPOWER_ASPHALT_SERVER_SLAB,
|
|
//
|
|
Material.LEGACY_AIR, Material.LEGACY_DEAD_BUSH, Material.LEGACY_BURNING_FURNACE, Material.LEGACY_WALL_SIGN, Material.LEGACY_REDSTONE_TORCH_OFF, Material.LEGACY_SKULL, Material.LEGACY_REDSTONE_COMPARATOR_ON, Material.LEGACY_WALL_BANNER, Material.LEGACY_MONSTER_EGG));
|
|
|