mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
88 lines
5.5 KiB
Diff
88 lines
5.5 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 223259e7a09ada681b6181c898f6857888594f85..ad5ad428b72f696a68a9ed1436bede7135c534e5 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
|
@@ -41,9 +41,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",
|
|
@@ -7623,6 +7623,48 @@ public class Blocks {
|
|
.explosionResistance(1200.0F)
|
|
)
|
|
);
|
|
+ // 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;
|
|
diff --git a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
|
index b441eac617347131f2c58ae5092428eb0538c839..cb5d89b0fb8d9a579438387d5d317d662d0f1e0c 100644
|
|
--- a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
|
+++ b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
|
@@ -126,7 +126,9 @@ public class LegacyTest {
|
|
Material.FLOW_ARMOR_TRIM_SMITHING_TEMPLATE, Material.BOLT_ARMOR_TRIM_SMITHING_TEMPLATE, Material.FLOW_POTTERY_SHERD, Material.GUSTER_POTTERY_SHERD, Material.SCRAPE_POTTERY_SHERD, Material.BREEZE_ROD, Material.OMINOUS_TRIAL_KEY, Material.OMINOUS_BOTTLE,
|
|
// 1.21
|
|
Material.MUSIC_DISC_CREATOR, Material.MUSIC_DISC_CREATOR_MUSIC_BOX, Material.MUSIC_DISC_PRECIPICE,
|
|
- //
|
|
+ // SparklyPaper start - custom blocks
|
|
+ Material.SPARKLYPOWER_RAINBOW_WOOL, Material.SPARKLYPOWER_RAINBOW_CONCRETE, Material.SPARKLYPOWER_RAINBOW_TERRACOTTA, Material.SPARKLYPOWER_ASPHALT_SERVER, Material.SPARKLYPOWER_ASPHALT_SERVER_SLAB, Material.SPARKLYPOWER_ASPHALT_PLAYER, Material.SPARKLYPOWER_ASPHALT_PLAYER_SLAB,
|
|
+ // SparklyPaper end
|
|
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));
|
|
|
|
private final Set<Material> INVERSION_FAILS = new HashSet<>(Arrays.asList(Material.LEGACY_DOUBLE_STEP, Material.LEGACY_GLOWING_REDSTONE_ORE, Material.LEGACY_DIODE_BLOCK_ON, Material.LEGACY_REDSTONE_LAMP_ON, Material.LEGACY_WOOD_DOUBLE_STEP,
|