Files
PlazmaBukkitMC/patches/24w44a.patch
AlphaKR93 e37f05bd87 work
2024-10-31 13:18:20 +09:00

9359 lines
504 KiB
Diff

From 38f6f7ba6f5ae757dc5d244be96dcec56fe5fe19 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 31 Oct 2024 12:58:52 +0900
Subject: [PATCH] 24w44a
---
com/mojang/math/MatrixUtil.java | 4 +
net/minecraft/DetectedVersion.java | 10 +-
net/minecraft/SharedConstants.java | 20 +-
.../commands/arguments/blocks/BlockInput.java | 17 ++
net/minecraft/core/BlockPos.java | 38 ++-
.../core/particles/ParticleTypes.java | 5 +-
.../core/particles/TrailParticleOption.java | 34 +++
net/minecraft/data/BlockFamilies.java | 6 +
net/minecraft/data/Main.java | 31 --
.../packs/VanillaAdventureAdvancements.java | 1 +
.../data/loot/BlockLootSubProvider.java | 24 ++
.../data/loot/packs/VanillaBlockLoot.java | 121 ++++----
.../data/loot/packs/VanillaChestLoot.java | 2 +
.../data/models/BlockModelGenerators.java | 274 ++++++++++--------
.../data/models/ItemModelGenerators.java | 22 +-
.../data/models/model/ModelTemplates.java | 2 +
.../data/models/model/TextureMapping.java | 8 +
.../data/models/model/TextureSlot.java | 1 +
.../recipes/packs/VanillaRecipeProvider.java | 26 ++
.../data/structures/StructureUpdater.java | 6 +-
.../data/tags/BiomeTagsProvider.java | 2 +
.../data/tags/EntityTypeTagsProvider.java | 1 +
.../data/tags/VanillaBlockTagsProvider.java | 57 +++-
.../data/tags/VanillaItemTagsProvider.java | 6 +-
.../data/worldgen/biome/BiomeData.java | 1 +
.../data/worldgen/biome/OverworldBiomes.java | 10 +-
.../data/worldgen/features/CaveFeatures.java | 10 +-
.../data/worldgen/features/TreeFeatures.java | 15 +
.../worldgen/features/VegetationFeatures.java | 41 ++-
.../worldgen/placement/PlacementUtils.java | 1 +
.../placement/VegetationPlacements.java | 133 +++++----
net/minecraft/network/chat/Style.java | 145 ++++++---
.../game/ClientGamePacketListener.java | 2 +-
.../game/ClientboundLevelParticlesPacket.java | 30 +-
.../ClientboundPlayerInfoUpdatePacket.java | 10 +-
.../game/ClientboundSetHeldSlotPacket.java | 26 +-
.../protocol/game/GamePacketTypes.java | 3 +-
.../network/protocol/game/GameProtocols.java | 3 +-
.../game/ServerGamePacketListener.java | 4 +-
.../ServerboundPickItemFromBlockPacket.java | 28 ++
.../ServerboundPickItemFromEntityPacket.java | 27 ++
net/minecraft/server/MinecraftServer.java | 2 +-
.../server/commands/AttributeCommand.java | 73 ++++-
.../server/commands/ParticleCommand.java | 2 +-
.../server/commands/PlaceCommand.java | 2 +
.../commands/SpawnArmorTrimsCommand.java | 3 +-
.../server/commands/TimeCommand.java | 2 +
net/minecraft/server/level/ChunkMap.java | 5 +-
.../server/level/ChunkTrackingView.java | 13 +-
.../server/level/DistanceManager.java | 2 +-
net/minecraft/server/level/ServerEntity.java | 3 +-
net/minecraft/server/level/ServerLevel.java | 61 ++--
net/minecraft/server/level/ServerPlayer.java | 4 +-
net/minecraft/server/level/TicketType.java | 1 -
.../network/ServerGamePacketListenerImpl.java | 89 ++++--
net/minecraft/sounds/SoundEvents.java | 16 +
net/minecraft/util/ARGB.java | 18 +-
net/minecraft/util/SpawnUtil.java | 10 +-
net/minecraft/util/datafix/DataFixers.java | 8 +-
.../datafix/fixes/EntityFieldsRenameFix.java | 30 ++
.../util/profiling/jfr/JfrProfiler.java | 23 +-
.../util/profiling/jfr/JvmProfiler.java | 12 +-
.../jfr/callback/ProfiledDuration.java | 2 +-
.../jfr/event/StructureGenerationEvent.java | 56 ++++
.../profiling/jfr/parse/JfrStatsParser.java | 8 +-
.../profiling/jfr/parse/JfrStatsResult.java | 4 +-
.../serialize/JfrResultJsonSerializer.java | 42 +++
.../profiling/jfr/stats/StructureGenStat.java | 17 ++
.../util/thread/BlockableEventLoop.java | 10 +-
.../world/effect/PoisonMobEffect.java | 4 +-
.../world/effect/WitherMobEffect.java | 4 +-
.../world/entity/AreaEffectCloud.java | 13 +-
net/minecraft/world/entity/Entity.java | 5 +-
net/minecraft/world/entity/EntityType.java | 11 +-
net/minecraft/world/entity/LivingEntity.java | 41 +--
.../entity/ai/attributes/AttributeMap.java | 13 +
net/minecraft/world/entity/animal/Bee.java | 22 ++
net/minecraft/world/entity/animal/Salmon.java | 32 +-
.../entity/boss/enderdragon/EnderDragon.java | 2 +-
.../world/entity/item/PrimedTnt.java | 2 +-
.../world/entity/monster/EnderMan.java | 3 +-
.../world/entity/monster/Evoker.java | 2 +-
.../world/entity/monster/Ravager.java | 3 -
.../entity/monster/creaking/Creaking.java | 82 ++++--
.../entity/monster/creaking/CreakingAi.java | 2 +-
.../monster/creaking/CreakingTransient.java | 136 +++++++--
.../world/entity/npc/AbstractVillager.java | 5 +
.../world/entity/npc/ClientSideMerchant.java | 5 +
net/minecraft/world/entity/npc/Villager.java | 3 +-
.../world/entity/npc/VillagerTrades.java | 14 +-
.../world/entity/player/Inventory.java | 25 +-
net/minecraft/world/entity/player/Player.java | 7 +-
.../entity/projectile/AbstractArrow.java | 33 ++-
.../projectile/AbstractHurtingProjectile.java | 31 --
.../world/entity/projectile/Projectile.java | 15 +-
.../entity/projectile/ThrownTrident.java | 1 +
.../world/entity/vehicle/MinecartTNT.java | 26 +-
net/minecraft/world/flag/FeatureFlags.java | 2 -
net/minecraft/world/inventory/ArmorSlot.java | 6 +-
.../world/inventory/BrewingStandMenu.java | 13 +
.../world/inventory/EnchantmentMenu.java | 7 +-
.../world/inventory/HorseInventoryMenu.java | 13 +-
.../world/inventory/InventoryMenu.java | 16 +-
.../world/inventory/MerchantMenu.java | 2 +-
net/minecraft/world/inventory/Slot.java | 3 +-
net/minecraft/world/item/BlockItem.java | 46 ++-
.../world/item/CreativeModeTabs.java | 10 +
net/minecraft/world/item/EggItem.java | 4 +-
net/minecraft/world/item/EnderpearlItem.java | 4 +-
net/minecraft/world/item/Item.java | 54 +++-
net/minecraft/world/item/ItemStack.java | 8 +-
net/minecraft/world/item/Items.java | 22 +-
net/minecraft/world/item/MapItem.java | 2 +-
.../world/item/SmithingTemplateItem.java | 32 +-
net/minecraft/world/item/SnowballItem.java | 4 +-
.../world/item/ThrowablePotionItem.java | 4 +-
net/minecraft/world/item/TridentItem.java | 2 +-
net/minecraft/world/item/WindChargeItem.java | 4 +-
.../world/item/component/CustomData.java | 8 +
.../world/item/enchantment/Enchantments.java | 2 +-
.../item/equipment/trim/TrimMaterials.java | 22 +-
.../world/item/trading/Merchant.java | 2 +
.../world/item/trading/MerchantOffers.java | 7 +-
net/minecraft/world/level/Level.java | 21 +-
.../world/level/ServerExplosion.java | 6 +-
net/minecraft/world/level/biome/Biome.java | 7 +-
.../level/biome/BiomeSpecialEffects.java | 86 ++++--
net/minecraft/world/level/biome/Biomes.java | 1 +
.../MultiNoiseBiomeSourceParameterList.java | 16 +-
.../MultiNoiseBiomeSourceParameterLists.java | 7 -
.../level/biome/OverworldBiomeBuilder.java | 28 +-
.../level/block/AbstractBannerBlock.java | 2 +-
.../world/level/block/AttachedStemBlock.java | 2 +-
.../world/level/block/BambooSaplingBlock.java | 2 +-
.../level/block/BigDripleafStemBlock.java | 2 +-
net/minecraft/world/level/block/Block.java | 4 -
.../world/level/block/BlockTypes.java | 4 +-
net/minecraft/world/level/block/Blocks.java | 183 ++++++------
.../world/level/block/CandleCakeBlock.java | 2 +-
.../world/level/block/CaveVinesBlock.java | 2 +-
.../level/block/CaveVinesPlantBlock.java | 2 +-
.../world/level/block/ComposterBlock.java | 2 +
.../world/level/block/CreakingHeartBlock.java | 73 +++--
.../world/level/block/CropBlock.java | 2 +-
.../world/level/block/DecoratedPotBlock.java | 6 +-
.../world/level/block/EndGatewayBlock.java | 2 +-
.../world/level/block/EndPortalBlock.java | 2 +-
.../world/level/block/EyeblossomBlock.java | 155 ++++++++++
.../world/level/block/FireBlock.java | 8 +-
.../world/level/block/FlowerBlock.java | 7 +
.../world/level/block/FlowerPotBlock.java | 33 ++-
.../world/level/block/FrostedIceBlock.java | 2 +-
.../world/level/block/GlowLichenBlock.java | 2 +-
.../level/block/GrowingPlantBodyBlock.java | 2 +-
.../world/level/block/HangingMossBlock.java | 3 +-
.../world/level/block/LightBlock.java | 2 +-
.../world/level/block/MossyCarpetBlock.java | 11 +-
.../world/level/block/MultifaceBlock.java | 22 +-
.../block/MultifaceSpreadeableBlock.java | 15 +
.../world/level/block/NetherPortalBlock.java | 2 +-
.../world/level/block/NetherWartBlock.java | 2 +-
.../level/block/ParticleLeavesBlock.java | 50 ++++
.../world/level/block/SculkBehaviour.java | 2 +-
.../world/level/block/SculkVeinBlock.java | 5 +-
.../world/level/block/ShulkerBoxBlock.java | 2 +-
.../world/level/block/SnowyDirtBlock.java | 2 +-
.../world/level/block/SoundType.java | 12 +
.../world/level/block/SpongeBlock.java | 28 +-
.../level/block/SpreadingSnowyDirtBlock.java | 2 +-
.../world/level/block/StemBlock.java | 2 +-
.../level/block/SweetBerryBushBlock.java | 2 +-
.../world/level/block/TallSeagrassBlock.java | 2 +-
.../world/level/block/WitherRoseBlock.java | 7 +-
.../world/level/block/entity/BlockEntity.java | 4 -
.../level/block/entity/BlockEntityType.java | 5 +
.../block/entity/CommandBlockEntity.java | 5 -
.../entity/CreakingHeartBlockEntity.java | 97 +++++--
.../block/entity/LecternBlockEntity.java | 5 -
.../entity/SculkShriekerBlockEntity.java | 4 +-
.../level/block/entity/SignBlockEntity.java | 5 -
.../block/entity/SpawnerBlockEntity.java | 5 -
.../block/entity/TrialSpawnerBlockEntity.java | 5 -
.../world/level/block/grower/TreeGrower.java | 2 +-
.../level/block/piston/MovingPistonBlock.java | 2 +-
.../level/block/piston/PistonHeadBlock.java | 2 +-
.../level/block/state/BlockBehaviour.java | 8 +
.../properties/BlockStateProperties.java | 16 +-
.../world/level/chunk/ChunkGenerator.java | 70 +++--
.../level/chunk/status/ChunkStatusTasks.java | 3 +-
.../world/level/chunk/status/ChunkStep.java | 2 +-
.../level/chunk/storage/SectionStorage.java | 10 +-
.../levelgen/feature/SimpleBlockFeature.java | 4 +
.../MultifaceGrowthConfiguration.java | 44 ++-
.../SimpleBlockConfiguration.java | 13 +-
.../CreakingHeartDecorator.java | 5 +-
.../treedecorators/PaleMossDecorator.java | 10 +-
.../trunkplacers/DarkOakTrunkPlacer.java | 2 +-
.../level/levelgen/structure/Structure.java | 27 +-
.../structure/pools/JigsawPlacement.java | 104 ++++---
199 files changed, 2634 insertions(+), 1237 deletions(-)
create mode 100644 net/minecraft/core/particles/TrailParticleOption.java
create mode 100644 net/minecraft/network/protocol/game/ServerboundPickItemFromBlockPacket.java
create mode 100644 net/minecraft/network/protocol/game/ServerboundPickItemFromEntityPacket.java
create mode 100644 net/minecraft/util/datafix/fixes/EntityFieldsRenameFix.java
create mode 100644 net/minecraft/util/profiling/jfr/event/StructureGenerationEvent.java
create mode 100644 net/minecraft/util/profiling/jfr/stats/StructureGenStat.java
create mode 100644 net/minecraft/world/level/block/EyeblossomBlock.java
create mode 100644 net/minecraft/world/level/block/MultifaceSpreadeableBlock.java
create mode 100644 net/minecraft/world/level/block/ParticleLeavesBlock.java
diff --git a/com/mojang/math/MatrixUtil.java b/com/mojang/math/MatrixUtil.java
index 3e83410..5b86d30 100644
--- a/com/mojang/math/MatrixUtil.java
+++ b/com/mojang/math/MatrixUtil.java
@@ -147,6 +147,10 @@ public class MatrixUtil {
return Triple.of(quaternionf1, vector3f, quaternionf.conjugate());
}
+ public static boolean isIdentity(Matrix4f matrix4f) {
+ return (matrix4f.properties() & 4) != 0;
+ }
+
public static boolean isPureTranslation(Matrix4f matrix) {
return (matrix.properties() & 8) != 0;
}
diff --git a/net/minecraft/DetectedVersion.java b/net/minecraft/DetectedVersion.java
index b84ebcf..511891d 100644
--- a/net/minecraft/DetectedVersion.java
+++ b/net/minecraft/DetectedVersion.java
@@ -28,12 +28,12 @@ public class DetectedVersion implements WorldVersion {
private DetectedVersion() {
this.id = UUID.randomUUID().toString().replaceAll("-", "");
- this.name = "1.21.3";
- this.stable = true;
- this.worldVersion = new DataVersion(4082, "main");
+ this.name = "24w44a";
+ this.stable = false;
+ this.worldVersion = new DataVersion(4174, "main");
this.protocolVersion = SharedConstants.getProtocolVersion();
- this.resourcePackVersion = 42;
- this.dataPackVersion = 57;
+ this.resourcePackVersion = 43;
+ this.dataPackVersion = 58;
this.buildTime = new Date();
}
diff --git a/net/minecraft/SharedConstants.java b/net/minecraft/SharedConstants.java
index 2bc0a7f..f14c89e 100644
--- a/net/minecraft/SharedConstants.java
+++ b/net/minecraft/SharedConstants.java
@@ -10,24 +10,24 @@ import net.minecraft.world.level.ChunkPos;
public class SharedConstants {
@Deprecated
- public static final boolean SNAPSHOT = false;
+ public static final boolean SNAPSHOT = true;
@Deprecated
- public static final int WORLD_VERSION = 4082;
+ public static final int WORLD_VERSION = 4174;
@Deprecated
public static final String SERIES = "main";
@Deprecated
- public static final String VERSION_STRING = "1.21.3";
+ public static final String VERSION_STRING = "24w44a";
@Deprecated
- public static final int RELEASE_NETWORK_PROTOCOL_VERSION = 768;
+ public static final int RELEASE_NETWORK_PROTOCOL_VERSION = 769;
@Deprecated
- public static final int SNAPSHOT_NETWORK_PROTOCOL_VERSION = 219;
- public static final int SNBT_NAG_VERSION = 4053;
+ public static final int SNAPSHOT_NETWORK_PROTOCOL_VERSION = 220;
+ public static final int SNBT_NAG_VERSION = 4173;
private static final int SNAPSHOT_PROTOCOL_BIT = 30;
- public static final boolean CRASH_EAGERLY = false;
+ public static final boolean CRASH_EAGERLY = true;
@Deprecated
- public static final int RESOURCE_PACK_FORMAT = 42;
+ public static final int RESOURCE_PACK_FORMAT = 43;
@Deprecated
- public static final int DATA_PACK_FORMAT = 57;
+ public static final int DATA_PACK_FORMAT = 58;
@Deprecated
public static final int LANGUAGE_FORMAT = 1;
public static final int REPORT_FORMAT_VERSION = 1;
@@ -160,7 +160,7 @@ public class SharedConstants {
}
public static int getProtocolVersion() {
- return 768;
+ return 1073742044;
}
public static boolean debugVoidTerrain(ChunkPos chunkPos) {
diff --git a/net/minecraft/commands/arguments/blocks/BlockInput.java b/net/minecraft/commands/arguments/blocks/BlockInput.java
index 7a25156..931cb17 100644
--- a/net/minecraft/commands/arguments/blocks/BlockInput.java
+++ b/net/minecraft/commands/arguments/blocks/BlockInput.java
@@ -64,6 +64,7 @@ public class BlockInput implements Predicate<BlockInWorld> {
blockState = this.state;
}
+ blockState = this.overwriteWithDefinedProperties(blockState);
if (!level.setBlock(pos, blockState, flags)) {
return false;
} else {
@@ -77,4 +78,20 @@ public class BlockInput implements Predicate<BlockInWorld> {
return true;
}
}
+
+ private BlockState overwriteWithDefinedProperties(BlockState blockState) {
+ if (blockState == this.state) {
+ return blockState;
+ } else {
+ for (Property<?> property : this.properties) {
+ blockState = copyProperty(blockState, this.state, property);
+ }
+
+ return blockState;
+ }
+ }
+
+ private static <T extends Comparable<T>> BlockState copyProperty(BlockState blockState, BlockState blockState1, Property<T> property) {
+ return blockState.setValue(property, blockState1.getValue(property));
+ }
}
diff --git a/net/minecraft/core/BlockPos.java b/net/minecraft/core/BlockPos.java
index f29f686..cc8dd03 100644
--- a/net/minecraft/core/BlockPos.java
+++ b/net/minecraft/core/BlockPos.java
@@ -11,6 +11,7 @@ import java.util.Optional;
import java.util.Queue;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
+import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import java.util.stream.Stream;
@@ -496,30 +497,37 @@ public class BlockPos extends Vec3i {
}
public static int breadthFirstTraversal(
- BlockPos startPos, int depth, int visitLimit, BiConsumer<BlockPos, Consumer<BlockPos>> action, Predicate<BlockPos> predicate
+ BlockPos blockPos, int i, int i1, BiConsumer<BlockPos, Consumer<BlockPos>> biConsumer, Function<BlockPos, BlockPos.TraversalNodeStatus> function
) {
Queue<Pair<BlockPos, Integer>> queue = new ArrayDeque<>();
LongSet set = new LongOpenHashSet();
- queue.add(Pair.of(startPos, 0));
- int i = 0;
+ queue.add(Pair.of(blockPos, 0));
+ int i2 = 0;
while (!queue.isEmpty()) {
Pair<BlockPos, Integer> pair = queue.poll();
- BlockPos blockPos = pair.getLeft();
+ BlockPos blockPos1 = pair.getLeft();
int right = pair.getRight();
- long packedBlockPos = blockPos.asLong();
- if (set.add(packedBlockPos) && predicate.test(blockPos)) {
- if (++i >= visitLimit) {
- return i;
- }
+ long packedBlockPos = blockPos1.asLong();
+ if (set.add(packedBlockPos)) {
+ BlockPos.TraversalNodeStatus traversalNodeStatus = function.apply(blockPos1);
+ if (traversalNodeStatus != BlockPos.TraversalNodeStatus.SKIP) {
+ if (traversalNodeStatus == BlockPos.TraversalNodeStatus.STOP) {
+ break;
+ }
+
+ if (++i2 >= i1) {
+ return i2;
+ }
- if (right < depth) {
- action.accept(blockPos, blockPos1 -> queue.add(Pair.of(blockPos1, right + 1)));
+ if (right < i) {
+ biConsumer.accept(blockPos1, blockPos2 -> queue.add(Pair.of(blockPos2, right + 1)));
+ }
}
}
}
- return i;
+ return i2;
}
public static class MutableBlockPos extends BlockPos {
@@ -647,4 +655,10 @@ public class BlockPos extends Vec3i {
return new BlockPos(this);
}
}
+
+ public static enum TraversalNodeStatus {
+ ACCEPT,
+ SKIP,
+ STOP;
+ }
}
diff --git a/net/minecraft/core/particles/ParticleTypes.java b/net/minecraft/core/particles/ParticleTypes.java
index 44f5802..d255e7f 100644
--- a/net/minecraft/core/particles/ParticleTypes.java
+++ b/net/minecraft/core/particles/ParticleTypes.java
@@ -55,6 +55,7 @@ public class ParticleTypes {
public static final SimpleParticleType FLAME = register("flame", false);
public static final SimpleParticleType INFESTED = register("infested", false);
public static final SimpleParticleType CHERRY_LEAVES = register("cherry_leaves", false);
+ public static final SimpleParticleType PALE_OAK_LEAVES = register("pale_oak_leaves", false);
public static final SimpleParticleType SCULK_SOUL = register("sculk_soul", false);
public static final ParticleType<SculkChargeParticleOptions> SCULK_CHARGE = register(
"sculk_charge", true, particleType -> SculkChargeParticleOptions.CODEC, particleType -> SculkChargeParticleOptions.STREAM_CODEC
@@ -71,8 +72,8 @@ public class ParticleTypes {
public static final ParticleType<VibrationParticleOption> VIBRATION = register(
"vibration", true, particleType -> VibrationParticleOption.CODEC, particleType -> VibrationParticleOption.STREAM_CODEC
);
- public static final ParticleType<TargetColorParticleOption> TRAIL = register(
- "trail", false, particleType -> TargetColorParticleOption.CODEC, particleType -> TargetColorParticleOption.STREAM_CODEC
+ public static final ParticleType<TrailParticleOption> TRAIL = register(
+ "trail", false, particleType -> TrailParticleOption.CODEC, particleType -> TrailParticleOption.STREAM_CODEC
);
public static final SimpleParticleType ITEM_SLIME = register("item_slime", false);
public static final SimpleParticleType ITEM_COBWEB = register("item_cobweb", false);
diff --git a/net/minecraft/core/particles/TrailParticleOption.java b/net/minecraft/core/particles/TrailParticleOption.java
new file mode 100644
index 0000000..117338b
--- /dev/null
+++ b/net/minecraft/core/particles/TrailParticleOption.java
@@ -0,0 +1,34 @@
+package net.minecraft.core.particles;
+
+import com.mojang.serialization.MapCodec;
+import com.mojang.serialization.codecs.RecordCodecBuilder;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.codec.ByteBufCodecs;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.util.ExtraCodecs;
+import net.minecraft.world.phys.Vec3;
+
+public record TrailParticleOption(Vec3 target, int color, int duration) implements ParticleOptions {
+ public static final MapCodec<TrailParticleOption> CODEC = RecordCodecBuilder.mapCodec(
+ instance -> instance.group(
+ Vec3.CODEC.fieldOf("target").forGetter(TrailParticleOption::target),
+ ExtraCodecs.RGB_COLOR_CODEC.fieldOf("color").forGetter(TrailParticleOption::color),
+ ExtraCodecs.POSITIVE_INT.fieldOf("duration").forGetter(TrailParticleOption::duration)
+ )
+ .apply(instance, TrailParticleOption::new)
+ );
+ public static final StreamCodec<RegistryFriendlyByteBuf, TrailParticleOption> STREAM_CODEC = StreamCodec.composite(
+ Vec3.STREAM_CODEC,
+ TrailParticleOption::target,
+ ByteBufCodecs.INT,
+ TrailParticleOption::color,
+ ByteBufCodecs.VAR_INT,
+ TrailParticleOption::duration,
+ TrailParticleOption::new
+ );
+
+ @Override
+ public ParticleType<TrailParticleOption> getType() {
+ return ParticleTypes.TRAIL;
+ }
+}
diff --git a/net/minecraft/data/BlockFamilies.java b/net/minecraft/data/BlockFamilies.java
index 9485ea1..22c5036 100644
--- a/net/minecraft/data/BlockFamilies.java
+++ b/net/minecraft/data/BlockFamilies.java
@@ -348,6 +348,12 @@ public class BlockFamilies {
.slab(Blocks.TUFF_BRICK_SLAB)
.chiseled(Blocks.CHISELED_TUFF_BRICKS)
.getFamily();
+ public static final BlockFamily RESIN_BRICKS = familyBuilder(Blocks.RESIN_BRICKS)
+ .wall(Blocks.RESIN_BRICK_WALL)
+ .stairs(Blocks.RESIN_BRICK_STAIRS)
+ .slab(Blocks.RESIN_BRICK_SLAB)
+ .chiseled(Blocks.CHISELED_RESIN_BRICKS)
+ .getFamily();
public static final BlockFamily NETHER_BRICKS = familyBuilder(Blocks.NETHER_BRICKS)
.fence(Blocks.NETHER_BRICK_FENCE)
.wall(Blocks.NETHER_BRICK_WALL)
diff --git a/net/minecraft/data/Main.java b/net/minecraft/data/Main.java
index 5b054f1..40dc0b2 100644
--- a/net/minecraft/data/Main.java
+++ b/net/minecraft/data/Main.java
@@ -16,7 +16,6 @@ import net.minecraft.WorldVersion;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.data.advancements.packs.VanillaAdvancementProvider;
-import net.minecraft.data.advancements.packs.WinterDropAdvancementProvider;
import net.minecraft.data.info.BiomeParametersDumpReport;
import net.minecraft.data.info.BlockListReport;
import net.minecraft.data.info.CommandsReport;
@@ -26,16 +25,13 @@ import net.minecraft.data.info.PacketReport;
import net.minecraft.data.info.RegistryDumpReport;
import net.minecraft.data.loot.packs.TradeRebalanceLootTableProvider;
import net.minecraft.data.loot.packs.VanillaLootTableProvider;
-import net.minecraft.data.loot.packs.WinterDropLootTableProvider;
import net.minecraft.data.metadata.PackMetadataGenerator;
import net.minecraft.data.models.EquipmentModelProvider;
import net.minecraft.data.models.ModelProvider;
import net.minecraft.data.recipes.packs.VanillaRecipeProvider;
-import net.minecraft.data.recipes.packs.WinterDropRecipeProvider;
import net.minecraft.data.registries.RegistriesDatapackGenerator;
import net.minecraft.data.registries.TradeRebalanceRegistries;
import net.minecraft.data.registries.VanillaRegistries;
-import net.minecraft.data.registries.WinterDropRegistries;
import net.minecraft.data.structures.NbtToSnbt;
import net.minecraft.data.structures.SnbtToNbt;
import net.minecraft.data.structures.StructureUpdater;
@@ -57,10 +53,6 @@ import net.minecraft.data.tags.TradeRebalanceStructureTagsProvider;
import net.minecraft.data.tags.VanillaBlockTagsProvider;
import net.minecraft.data.tags.VanillaEnchantmentTagsProvider;
import net.minecraft.data.tags.VanillaItemTagsProvider;
-import net.minecraft.data.tags.WinterDropBiomeTagsProvider;
-import net.minecraft.data.tags.WinterDropBlockTagsProvider;
-import net.minecraft.data.tags.WinterDropEntityTypeTagsProvider;
-import net.minecraft.data.tags.WinterDropItemTagsProvider;
import net.minecraft.data.tags.WorldPresetTagsProvider;
import net.minecraft.network.chat.Component;
import net.minecraft.obfuscate.DontObfuscate;
@@ -193,29 +185,6 @@ public class Main {
output, Component.translatable("dataPack.minecart_improvements.description"), FeatureFlagSet.of(FeatureFlags.MINECART_IMPROVEMENTS)
)
);
- CompletableFuture<RegistrySetBuilder.PatchedRegistries> completableFuture1x = WinterDropRegistries.createLookup(completableFuture);
- completableFuture2 = completableFuture1x.thenApply(RegistrySetBuilder.PatchedRegistries::full);
- builtinDatapack = dataGenerator.getBuiltinDatapack(server, "winter_drop");
- builtinDatapack.addProvider(
- bindRegistries(RegistriesDatapackGenerator::new, completableFuture1x.thenApply(RegistrySetBuilder.PatchedRegistries::patches))
- );
- builtinDatapack.addProvider(bindRegistries(WinterDropRecipeProvider.Runner::new, completableFuture2));
- CompletableFuture<HolderLookup.Provider> finalCompletableFuture = completableFuture2;
- TagsProvider<Block> tagsProvider5 = builtinDatapack.addProvider(
- output -> new WinterDropBlockTagsProvider(output, finalCompletableFuture, tagsProvider.contentsGetter())
- );
- builtinDatapack.addProvider(
- output -> new WinterDropItemTagsProvider(output, finalCompletableFuture, tagsProvider1.contentsGetter(), tagsProvider5.contentsGetter())
- );
- builtinDatapack.addProvider(output -> new WinterDropBiomeTagsProvider(output, finalCompletableFuture, tagsProvider2.contentsGetter()));
- builtinDatapack.addProvider(bindRegistries(WinterDropLootTableProvider::create, completableFuture2));
- builtinDatapack.addProvider(
- output -> PackMetadataGenerator.forFeaturePack(
- output, Component.translatable("dataPack.winter_drop.description"), FeatureFlagSet.of(FeatureFlags.WINTER_DROP)
- )
- );
- builtinDatapack.addProvider(bindRegistries(WinterDropEntityTypeTagsProvider::new, completableFuture2));
- builtinDatapack.addProvider(bindRegistries(WinterDropAdvancementProvider::create, completableFuture2));
return dataGenerator;
}
}
diff --git a/net/minecraft/data/advancements/packs/VanillaAdventureAdvancements.java b/net/minecraft/data/advancements/packs/VanillaAdventureAdvancements.java
index f704f4d..a17f13f 100644
--- a/net/minecraft/data/advancements/packs/VanillaAdventureAdvancements.java
+++ b/net/minecraft/data/advancements/packs/VanillaAdventureAdvancements.java
@@ -96,6 +96,7 @@ public class VanillaAdventureAdvancements implements AdvancementSubProvider {
EntityType.BOGGED,
EntityType.BREEZE,
EntityType.CAVE_SPIDER,
+ EntityType.CREAKING_TRANSIENT,
EntityType.CREEPER,
EntityType.DROWNED,
EntityType.ELDER_GUARDIAN,
diff --git a/net/minecraft/data/loot/BlockLootSubProvider.java b/net/minecraft/data/loot/BlockLootSubProvider.java
index 4f4cccf..6ed8efa 100644
--- a/net/minecraft/data/loot/BlockLootSubProvider.java
+++ b/net/minecraft/data/loot/BlockLootSubProvider.java
@@ -478,6 +478,30 @@ public abstract class BlockLootSubProvider implements LootTableSubProvider {
);
}
+ protected LootTable.Builder createMultifaceBlockDrops(Block block) {
+ return LootTable.lootTable()
+ .withPool(
+ LootPool.lootPool()
+ .add(
+ (LootPoolEntryContainer.Builder<?>)this.applyExplosionDecay(
+ block,
+ LootItem.lootTableItem(block)
+ .apply(
+ Direction.values(),
+ direction -> SetItemCountFunction.setCount(ConstantValue.exactly(1.0F), true)
+ .when(
+ LootItemBlockStatePropertyCondition.hasBlockStateProperties(block)
+ .setProperties(
+ StatePropertiesPredicate.Builder.properties().hasProperty(MultifaceBlock.getFaceProperty(direction), true)
+ )
+ )
+ )
+ .apply(SetItemCountFunction.setCount(ConstantValue.exactly(-1.0F), true))
+ )
+ )
+ );
+ }
+
protected LootTable.Builder createMossyCarpetBlockDrops(Block block) {
return LootTable.lootTable()
.withPool(
diff --git a/net/minecraft/data/loot/packs/VanillaBlockLoot.java b/net/minecraft/data/loot/packs/VanillaBlockLoot.java
index 139cae9..cbc1e8f 100644
--- a/net/minecraft/data/loot/packs/VanillaBlockLoot.java
+++ b/net/minecraft/data/loot/packs/VanillaBlockLoot.java
@@ -116,7 +116,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_PLANKS);
this.dropSelf(Blocks.ACACIA_PLANKS);
this.dropSelf(Blocks.DARK_OAK_PLANKS);
- this.add(Blocks.PALE_OAK_PLANKS, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_PLANKS);
this.dropSelf(Blocks.MANGROVE_PLANKS);
this.dropSelf(Blocks.CHERRY_PLANKS);
this.dropSelf(Blocks.BAMBOO_PLANKS);
@@ -128,7 +128,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_SAPLING);
this.dropSelf(Blocks.ACACIA_SAPLING);
this.dropSelf(Blocks.DARK_OAK_SAPLING);
- this.add(Blocks.PALE_OAK_SAPLING, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_SAPLING);
this.dropSelf(Blocks.CHERRY_SAPLING);
this.dropSelf(Blocks.SAND);
this.add(Blocks.SUSPICIOUS_SAND, noDrop());
@@ -140,7 +140,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_LOG);
this.dropSelf(Blocks.ACACIA_LOG);
this.dropSelf(Blocks.DARK_OAK_LOG);
- this.add(Blocks.PALE_OAK_LOG, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_LOG);
this.dropSelf(Blocks.CHERRY_LOG);
this.dropSelf(Blocks.BAMBOO_BLOCK);
this.dropSelf(Blocks.STRIPPED_OAK_LOG);
@@ -149,7 +149,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.STRIPPED_JUNGLE_LOG);
this.dropSelf(Blocks.STRIPPED_ACACIA_LOG);
this.dropSelf(Blocks.STRIPPED_DARK_OAK_LOG);
- this.add(Blocks.STRIPPED_PALE_OAK_LOG, noDrop());
+ this.dropSelf(Blocks.STRIPPED_PALE_OAK_LOG);
this.dropSelf(Blocks.STRIPPED_MANGROVE_LOG);
this.dropSelf(Blocks.STRIPPED_CHERRY_LOG);
this.dropSelf(Blocks.STRIPPED_BAMBOO_BLOCK);
@@ -161,7 +161,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_WOOD);
this.dropSelf(Blocks.ACACIA_WOOD);
this.dropSelf(Blocks.DARK_OAK_WOOD);
- this.add(Blocks.PALE_OAK_WOOD, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_WOOD);
this.dropSelf(Blocks.MANGROVE_WOOD);
this.dropSelf(Blocks.CHERRY_WOOD);
this.dropSelf(Blocks.STRIPPED_OAK_WOOD);
@@ -170,7 +170,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.STRIPPED_JUNGLE_WOOD);
this.dropSelf(Blocks.STRIPPED_ACACIA_WOOD);
this.dropSelf(Blocks.STRIPPED_DARK_OAK_WOOD);
- this.add(Blocks.STRIPPED_PALE_OAK_WOOD, noDrop());
+ this.dropSelf(Blocks.STRIPPED_PALE_OAK_WOOD);
this.dropSelf(Blocks.STRIPPED_MANGROVE_WOOD);
this.dropSelf(Blocks.STRIPPED_CHERRY_WOOD);
this.dropSelf(Blocks.STRIPPED_CRIMSON_HYPHAE);
@@ -178,6 +178,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.SPONGE);
this.dropSelf(Blocks.WET_SPONGE);
this.dropSelf(Blocks.LAPIS_BLOCK);
+ this.dropSelf(Blocks.RESIN_BLOCK);
this.dropSelf(Blocks.SANDSTONE);
this.dropSelf(Blocks.CHISELED_SANDSTONE);
this.dropSelf(Blocks.CUT_SANDSTONE);
@@ -203,6 +204,8 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.RED_WOOL);
this.dropSelf(Blocks.BLACK_WOOL);
this.dropSelf(Blocks.DANDELION);
+ this.dropSelf(Blocks.OPEN_EYEBLOSSOM);
+ this.dropSelf(Blocks.CLOSED_EYEBLOSSOM);
this.dropSelf(Blocks.POPPY);
this.dropSelf(Blocks.TORCHFLOWER);
this.dropSelf(Blocks.BLUE_ORCHID);
@@ -238,7 +241,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.ACACIA_SIGN);
this.dropSelf(Blocks.JUNGLE_SIGN);
this.dropSelf(Blocks.DARK_OAK_SIGN);
- this.add(Blocks.PALE_OAK_SIGN, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_SIGN);
this.dropSelf(Blocks.MANGROVE_SIGN);
this.dropSelf(Blocks.CHERRY_SIGN);
this.dropSelf(Blocks.BAMBOO_SIGN);
@@ -249,7 +252,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.CHERRY_HANGING_SIGN);
this.dropSelf(Blocks.JUNGLE_HANGING_SIGN);
this.dropSelf(Blocks.DARK_OAK_HANGING_SIGN);
- this.add(Blocks.PALE_OAK_HANGING_SIGN, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_HANGING_SIGN);
this.dropSelf(Blocks.MANGROVE_HANGING_SIGN);
this.dropSelf(Blocks.CRIMSON_HANGING_SIGN);
this.dropSelf(Blocks.WARPED_HANGING_SIGN);
@@ -265,7 +268,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_PRESSURE_PLATE);
this.dropSelf(Blocks.ACACIA_PRESSURE_PLATE);
this.dropSelf(Blocks.DARK_OAK_PRESSURE_PLATE);
- this.add(Blocks.PALE_OAK_PRESSURE_PLATE, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_PRESSURE_PLATE);
this.dropSelf(Blocks.MANGROVE_PRESSURE_PLATE);
this.dropSelf(Blocks.CHERRY_PRESSURE_PLATE);
this.dropSelf(Blocks.BAMBOO_PRESSURE_PLATE);
@@ -294,7 +297,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_TRAPDOOR);
this.dropSelf(Blocks.ACACIA_TRAPDOOR);
this.dropSelf(Blocks.DARK_OAK_TRAPDOOR);
- this.add(Blocks.PALE_OAK_TRAPDOOR, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_TRAPDOOR);
this.dropSelf(Blocks.MANGROVE_TRAPDOOR);
this.dropSelf(Blocks.CHERRY_TRAPDOOR);
this.dropSelf(Blocks.BAMBOO_TRAPDOOR);
@@ -317,6 +320,11 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.BRICK_STAIRS);
this.dropSelf(Blocks.STONE_BRICK_STAIRS);
this.dropSelf(Blocks.LILY_PAD);
+ this.dropSelf(Blocks.RESIN_BRICKS);
+ this.dropSelf(Blocks.RESIN_BRICK_WALL);
+ this.dropSelf(Blocks.RESIN_BRICK_SLAB);
+ this.dropSelf(Blocks.RESIN_BRICK_STAIRS);
+ this.dropSelf(Blocks.CHISELED_RESIN_BRICKS);
this.dropSelf(Blocks.NETHER_BRICKS);
this.dropSelf(Blocks.NETHER_BRICK_FENCE);
this.dropSelf(Blocks.NETHER_BRICK_STAIRS);
@@ -338,7 +346,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_BUTTON);
this.dropSelf(Blocks.ACACIA_BUTTON);
this.dropSelf(Blocks.DARK_OAK_BUTTON);
- this.add(Blocks.PALE_OAK_BUTTON, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_BUTTON);
this.dropSelf(Blocks.MANGROVE_BUTTON);
this.dropSelf(Blocks.CHERRY_BUTTON);
this.dropSelf(Blocks.BAMBOO_BUTTON);
@@ -379,7 +387,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.BLACK_TERRACOTTA);
this.dropSelf(Blocks.ACACIA_STAIRS);
this.dropSelf(Blocks.DARK_OAK_STAIRS);
- this.add(Blocks.PALE_OAK_STAIRS, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_STAIRS);
this.dropSelf(Blocks.CHERRY_STAIRS);
this.dropSelf(Blocks.SLIME_BLOCK);
this.dropSelf(Blocks.IRON_TRAPDOOR);
@@ -421,14 +429,14 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropSelf(Blocks.JUNGLE_FENCE_GATE);
this.dropSelf(Blocks.ACACIA_FENCE_GATE);
this.dropSelf(Blocks.DARK_OAK_FENCE_GATE);
- this.add(Blocks.PALE_OAK_FENCE_GATE, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_FENCE_GATE);
this.dropSelf(Blocks.CHERRY_FENCE_GATE);
this.dropSelf(Blocks.SPRUCE_FENCE);
this.dropSelf(Blocks.BIRCH_FENCE);
this.dropSelf(Blocks.JUNGLE_FENCE);
this.dropSelf(Blocks.ACACIA_FENCE);
this.dropSelf(Blocks.DARK_OAK_FENCE);
- this.add(Blocks.PALE_OAK_FENCE, noDrop());
+ this.dropSelf(Blocks.PALE_OAK_FENCE);
this.dropSelf(Blocks.CHERRY_FENCE);
this.dropSelf(Blocks.END_ROD);
this.dropSelf(Blocks.PURPUR_BLOCK);
@@ -625,9 +633,9 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.PINK_PETALS, this.createPetalsDrops(Blocks.PINK_PETALS));
this.dropSelf(Blocks.BIG_DRIPLEAF);
this.dropSelf(Blocks.MOSS_BLOCK);
- this.add(Blocks.PALE_MOSS_CARPET, noDrop());
- this.add(Blocks.PALE_HANGING_MOSS, noDrop());
- this.add(Blocks.PALE_MOSS_BLOCK, noDrop());
+ this.add(Blocks.PALE_MOSS_CARPET, block -> this.createMossyCarpetBlockDrops(block));
+ this.add(Blocks.PALE_HANGING_MOSS, itemLike -> this.createShearsOrSilkTouchOnlyDrop(itemLike));
+ this.dropSelf(Blocks.PALE_MOSS_BLOCK);
this.dropSelf(Blocks.ROOTED_DIRT);
this.dropSelf(Blocks.COBBLED_DEEPSLATE);
this.dropSelf(Blocks.COBBLED_DEEPSLATE_STAIRS);
@@ -702,19 +710,19 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropOther(Blocks.LAVA_CAULDRON, Blocks.CAULDRON);
this.dropOther(Blocks.POWDER_SNOW_CAULDRON, Blocks.CAULDRON);
this.dropOther(Blocks.BIG_DRIPLEAF_STEM, Blocks.BIG_DRIPLEAF);
- this.add(Blocks.STONE, podzol -> this.createSingleItemTableWithSilkTouch(podzol, Blocks.COBBLESTONE));
- this.add(Blocks.DEEPSLATE, mycelium -> this.createSingleItemTableWithSilkTouch(mycelium, Blocks.COBBLED_DEEPSLATE));
+ this.add(Blocks.STONE, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.COBBLESTONE));
+ this.add(Blocks.DEEPSLATE, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.COBBLED_DEEPSLATE));
this.add(Blocks.GRASS_BLOCK, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.DIRT));
this.add(Blocks.PODZOL, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.DIRT));
this.add(Blocks.MYCELIUM, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.DIRT));
- this.add(Blocks.TUBE_CORAL_BLOCK, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.DEAD_TUBE_CORAL_BLOCK));
- this.add(Blocks.BRAIN_CORAL_BLOCK, coral -> this.createSingleItemTableWithSilkTouch(coral, Blocks.DEAD_BRAIN_CORAL_BLOCK));
- this.add(Blocks.BUBBLE_CORAL_BLOCK, nylium -> this.createSingleItemTableWithSilkTouch(nylium, Blocks.DEAD_BUBBLE_CORAL_BLOCK));
- this.add(Blocks.FIRE_CORAL_BLOCK, nylium -> this.createSingleItemTableWithSilkTouch(nylium, Blocks.DEAD_FIRE_CORAL_BLOCK));
- this.add(Blocks.HORN_CORAL_BLOCK, bookshelf -> this.createSingleItemTableWithSilkTouch(bookshelf, Blocks.DEAD_HORN_CORAL_BLOCK));
- this.add(Blocks.CRIMSON_NYLIUM, clay -> this.createSingleItemTableWithSilkTouch(clay, Blocks.NETHERRACK));
- this.add(Blocks.WARPED_NYLIUM, enderChest -> this.createSingleItemTableWithSilkTouch(enderChest, Blocks.NETHERRACK));
- this.add(Blocks.BOOKSHELF, snow -> this.createSingleItemTableWithSilkTouch(snow, Items.BOOK, ConstantValue.exactly(3.0F)));
+ this.add(Blocks.TUBE_CORAL_BLOCK, nylium -> this.createSingleItemTableWithSilkTouch(nylium, Blocks.DEAD_TUBE_CORAL_BLOCK));
+ this.add(Blocks.BRAIN_CORAL_BLOCK, nylium -> this.createSingleItemTableWithSilkTouch(nylium, Blocks.DEAD_BRAIN_CORAL_BLOCK));
+ this.add(Blocks.BUBBLE_CORAL_BLOCK, bookshelf -> this.createSingleItemTableWithSilkTouch(bookshelf, Blocks.DEAD_BUBBLE_CORAL_BLOCK));
+ this.add(Blocks.FIRE_CORAL_BLOCK, clay -> this.createSingleItemTableWithSilkTouch(clay, Blocks.DEAD_FIRE_CORAL_BLOCK));
+ this.add(Blocks.HORN_CORAL_BLOCK, enderChest -> this.createSingleItemTableWithSilkTouch(enderChest, Blocks.DEAD_HORN_CORAL_BLOCK));
+ this.add(Blocks.CRIMSON_NYLIUM, snow -> this.createSingleItemTableWithSilkTouch(snow, Blocks.NETHERRACK));
+ this.add(Blocks.WARPED_NYLIUM, block -> this.createSingleItemTableWithSilkTouch(block, Blocks.NETHERRACK));
+ this.add(Blocks.BOOKSHELF, block -> this.createSingleItemTableWithSilkTouch(block, Items.BOOK, ConstantValue.exactly(3.0F)));
this.add(Blocks.CLAY, block -> this.createSingleItemTableWithSilkTouch(block, Items.CLAY_BALL, ConstantValue.exactly(4.0F)));
this.add(Blocks.ENDER_CHEST, block -> this.createSingleItemTableWithSilkTouch(block, Blocks.OBSIDIAN, ConstantValue.exactly(8.0F)));
this.add(Blocks.SNOW_BLOCK, block -> this.createSingleItemTableWithSilkTouch(block, Items.SNOWBALL, ConstantValue.exactly(4.0F)));
@@ -725,12 +733,14 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropPottedContents(Blocks.POTTED_JUNGLE_SAPLING);
this.dropPottedContents(Blocks.POTTED_ACACIA_SAPLING);
this.dropPottedContents(Blocks.POTTED_DARK_OAK_SAPLING);
- this.add(Blocks.POTTED_PALE_OAK_SAPLING, noDrop());
+ this.dropPottedContents(Blocks.POTTED_PALE_OAK_SAPLING);
this.dropPottedContents(Blocks.POTTED_MANGROVE_PROPAGULE);
this.dropPottedContents(Blocks.POTTED_CHERRY_SAPLING);
this.dropPottedContents(Blocks.POTTED_FERN);
this.dropPottedContents(Blocks.POTTED_DANDELION);
this.dropPottedContents(Blocks.POTTED_POPPY);
+ this.dropPottedContents(Blocks.POTTED_OPEN_EYEBLOSSOM);
+ this.dropPottedContents(Blocks.POTTED_CLOSED_EYEBLOSSOM);
this.dropPottedContents(Blocks.POTTED_BLUE_ORCHID);
this.dropPottedContents(Blocks.POTTED_ALLIUM);
this.dropPottedContents(Blocks.POTTED_AZURE_BLUET);
@@ -761,7 +771,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.JUNGLE_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.ACACIA_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.DARK_OAK_SLAB, slab -> this.createSlabItemTable(slab));
- this.add(Blocks.PALE_OAK_SLAB, noDrop());
+ this.add(Blocks.PALE_OAK_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.MANGROVE_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.CHERRY_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.BAMBOO_SLAB, slab -> this.createSlabItemTable(slab));
@@ -806,9 +816,9 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.WAXED_OXIDIZED_CUT_COPPER_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.WAXED_WEATHERED_CUT_COPPER_SLAB, slab -> this.createSlabItemTable(slab));
this.add(Blocks.WAXED_EXPOSED_CUT_COPPER_SLAB, slab -> this.createSlabItemTable(slab));
- this.add(Blocks.WAXED_CUT_COPPER_SLAB, slab -> this.createSlabItemTable(slab));
- this.add(Blocks.COBBLED_DEEPSLATE_SLAB, slab -> this.createSlabItemTable(slab));
- this.add(Blocks.POLISHED_DEEPSLATE_SLAB, slab -> this.createSlabItemTable(slab));
+ this.add(Blocks.WAXED_CUT_COPPER_SLAB, door -> this.createSlabItemTable(door));
+ this.add(Blocks.COBBLED_DEEPSLATE_SLAB, door -> this.createSlabItemTable(door));
+ this.add(Blocks.POLISHED_DEEPSLATE_SLAB, door -> this.createSlabItemTable(door));
this.add(Blocks.DEEPSLATE_TILE_SLAB, door -> this.createSlabItemTable(door));
this.add(Blocks.DEEPSLATE_BRICK_SLAB, door -> this.createSlabItemTable(door));
this.add(Blocks.MUD_BRICK_SLAB, door -> this.createSlabItemTable(door));
@@ -818,10 +828,10 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.JUNGLE_DOOR, door -> this.createDoorTable(door));
this.add(Blocks.ACACIA_DOOR, door -> this.createDoorTable(door));
this.add(Blocks.DARK_OAK_DOOR, door -> this.createDoorTable(door));
- this.add(Blocks.PALE_OAK_DOOR, noDrop());
- this.add(Blocks.MANGROVE_DOOR, door -> this.createDoorTable(door));
- this.add(Blocks.CHERRY_DOOR, door -> this.createDoorTable(door));
- this.add(Blocks.BAMBOO_DOOR, door -> this.createDoorTable(door));
+ this.add(Blocks.PALE_OAK_DOOR, block -> this.createDoorTable(block));
+ this.add(Blocks.MANGROVE_DOOR, block -> this.createDoorTable(block));
+ this.add(Blocks.CHERRY_DOOR, block -> this.createDoorTable(block));
+ this.add(Blocks.BAMBOO_DOOR, block -> this.createDoorTable(block));
this.add(Blocks.WARPED_DOOR, block -> this.createDoorTable(block));
this.add(Blocks.CRIMSON_DOOR, block -> this.createDoorTable(block));
this.add(Blocks.IRON_DOOR, block -> this.createDoorTable(block));
@@ -834,18 +844,18 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.WAXED_WEATHERED_COPPER_DOOR, block -> this.createDoorTable(block));
this.add(Blocks.WAXED_OXIDIZED_COPPER_DOOR, block -> this.createDoorTable(block));
this.add(Blocks.BLACK_BED, bed -> this.createSinglePropConditionTable(bed, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.BLUE_BED, bed -> this.createSinglePropConditionTable(bed, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.BROWN_BED, bed -> this.createSinglePropConditionTable(bed, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.CYAN_BED, bed -> this.createSinglePropConditionTable(bed, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.GRAY_BED, bed -> this.createSinglePropConditionTable(bed, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.GREEN_BED, lilac -> this.createSinglePropConditionTable(lilac, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.LIGHT_BLUE_BED, sunflower -> this.createSinglePropConditionTable(sunflower, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.LIGHT_GRAY_BED, peony -> this.createSinglePropConditionTable(peony, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.LIME_BED, bush -> this.createSinglePropConditionTable(bush, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.MAGENTA_BED, cocoa -> this.createSinglePropConditionTable(cocoa, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.BLUE_BED, lilac -> this.createSinglePropConditionTable(lilac, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.BROWN_BED, sunflower -> this.createSinglePropConditionTable(sunflower, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.CYAN_BED, peony -> this.createSinglePropConditionTable(peony, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.GRAY_BED, bush -> this.createSinglePropConditionTable(bush, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.GREEN_BED, cocoa -> this.createSinglePropConditionTable(cocoa, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.LIGHT_BLUE_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.LIGHT_GRAY_BED, seaPickle -> this.createSinglePropConditionTable(seaPickle, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.LIME_BED, composter -> this.createSinglePropConditionTable(composter, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.MAGENTA_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
this.add(Blocks.PURPLE_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.ORANGE_BED, seaPickle -> this.createSinglePropConditionTable(seaPickle, BedBlock.PART, BedPart.HEAD));
- this.add(Blocks.PINK_BED, composter -> this.createSinglePropConditionTable(composter, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.ORANGE_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
+ this.add(Blocks.PINK_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
this.add(Blocks.RED_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
this.add(Blocks.WHITE_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
this.add(Blocks.YELLOW_BED, block -> this.createSinglePropConditionTable(block, BedBlock.PART, BedPart.HEAD));
@@ -1030,7 +1040,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.JUNGLE_LEAVES, block -> this.createLeavesDrops(block, Blocks.JUNGLE_SAPLING, JUNGLE_LEAVES_SAPLING_CHANGES));
this.add(Blocks.ACACIA_LEAVES, block -> this.createLeavesDrops(block, Blocks.ACACIA_SAPLING, NORMAL_LEAVES_SAPLING_CHANCES));
this.add(Blocks.DARK_OAK_LEAVES, block -> this.createOakLeavesDrops(block, Blocks.DARK_OAK_SAPLING, NORMAL_LEAVES_SAPLING_CHANCES));
- this.add(Blocks.PALE_OAK_LEAVES, noDrop());
+ this.add(Blocks.PALE_OAK_LEAVES, block -> this.createLeavesDrops(block, Blocks.PALE_OAK_SAPLING, NORMAL_LEAVES_SAPLING_CHANCES));
this.add(Blocks.CHERRY_LEAVES, block -> this.createLeavesDrops(block, Blocks.CHERRY_SAPLING, NORMAL_LEAVES_SAPLING_CHANCES));
this.add(Blocks.AZALEA_LEAVES, block -> this.createLeavesDrops(block, Blocks.AZALEA, NORMAL_LEAVES_SAPLING_CHANCES));
this.add(Blocks.FLOWERING_AZALEA_LEAVES, block -> this.createLeavesDrops(block, Blocks.FLOWERING_AZALEA, NORMAL_LEAVES_SAPLING_CHANCES));
@@ -1193,6 +1203,7 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.add(Blocks.SEAGRASS, itemLike -> this.createShearsOnlyDrop(itemLike));
this.add(Blocks.VINE, itemLike -> this.createShearsOnlyDrop(itemLike));
this.add(Blocks.GLOW_LICHEN, block -> this.createMultifaceBlockDrops(block, this.hasShears()));
+ this.add(Blocks.RESIN_CLUMP, block -> this.createMultifaceBlockDrops(block));
this.add(Blocks.HANGING_ROOTS, itemLike -> this.createShearsOnlyDrop(itemLike));
this.add(Blocks.SMALL_DRIPLEAF, itemLike -> this.createShearsOnlyDrop(itemLike));
this.add(Blocks.MANGROVE_LEAVES, block -> this.createMangroveLeavesDrops(block));
@@ -1258,6 +1269,19 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
)
)
);
+ this.add(
+ Blocks.CREAKING_HEART,
+ block -> this.createSilkTouchDispatchTable(
+ block,
+ (LootPoolEntryContainer.Builder<?>)this.applyExplosionDecay(
+ block,
+ LootItem.lootTableItem(Items.RESIN_CLUMP)
+ .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
+ .apply(ApplyBonusCount.addUniformBonusCount(registryLookup.getOrThrow(Enchantments.FORTUNE)))
+ .apply(LimitCount.limitCount(IntRange.upperBound(9)))
+ )
+ )
+ );
this.add(
Blocks.NETHER_WART,
block -> LootTable.lootTable()
@@ -1422,7 +1446,6 @@ public class VanillaBlockLoot extends BlockLootSubProvider {
this.dropWhenSilkTouch(Blocks.PACKED_ICE);
this.dropWhenSilkTouch(Blocks.BLUE_ICE);
this.dropWhenSilkTouch(Blocks.TURTLE_EGG);
- this.add(Blocks.CREAKING_HEART, noDrop());
this.dropWhenSilkTouch(Blocks.MUSHROOM_STEM);
this.dropWhenSilkTouch(Blocks.DEAD_TUBE_CORAL);
this.dropWhenSilkTouch(Blocks.DEAD_BRAIN_CORAL);
diff --git a/net/minecraft/data/loot/packs/VanillaChestLoot.java b/net/minecraft/data/loot/packs/VanillaChestLoot.java
index fe742ac..180230d 100644
--- a/net/minecraft/data/loot/packs/VanillaChestLoot.java
+++ b/net/minecraft/data/loot/packs/VanillaChestLoot.java
@@ -1930,6 +1930,8 @@ public record VanillaChestLoot(HolderLookup.Provider registries) implements Loot
.add(LootItem.lootTableItem(Items.MELON_SEEDS).setWeight(10).apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))))
.add(LootItem.lootTableItem(Items.PUMPKIN_SEEDS).setWeight(10).apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))))
.add(LootItem.lootTableItem(Items.BEETROOT_SEEDS).setWeight(10).apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))))
+ .add(LootItem.lootTableItem(Items.RESIN_CLUMP).setWeight(50).apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))))
+ .add(LootItem.lootTableItem(Items.RESIN_BRICK).setWeight(50).apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F))))
)
.withPool(
LootPool.lootPool()
diff --git a/net/minecraft/data/models/BlockModelGenerators.java b/net/minecraft/data/models/BlockModelGenerators.java
index 4a1d908..73115eb 100644
--- a/net/minecraft/data/models/BlockModelGenerators.java
+++ b/net/minecraft/data/models/BlockModelGenerators.java
@@ -226,13 +226,23 @@ public class BlockModelGenerators {
ModelTemplates.FLAT_ITEM.create(ModelLocationUtils.getModelLocation(flatItem), TextureMapping.layer0(flatItem), this.modelOutput);
}
- private void createSimpleFlatItemModel(Block flatBlock) {
+ void createSimpleFlatItemModel(Block flatBlock) {
Item item = flatBlock.asItem();
if (item != Items.AIR) {
ModelTemplates.FLAT_ITEM.create(ModelLocationUtils.getModelLocation(item), TextureMapping.layer0(flatBlock), this.modelOutput);
}
}
+ void createTwoLayerFlatItemModel(Block block, String string) {
+ Item item = block.asItem();
+ ResourceLocation blockTexture = TextureMapping.getBlockTexture(block);
+ ResourceLocation blockTexture1 = TextureMapping.getBlockTexture(block, string);
+ if (item != Items.AIR) {
+ ModelTemplates.TWO_LAYERED_ITEM
+ .create(ModelLocationUtils.getModelLocation(item), TextureMapping.layered(blockTexture, blockTexture1), this.modelOutput);
+ }
+ }
+
private void createSimpleFlatItemModel(Block flatBlock, String layerZeroTextureSuffix) {
Item item = flatBlock.asItem();
ModelTemplates.FLAT_ITEM
@@ -1274,62 +1284,34 @@ public class BlockModelGenerators {
.accept(
MultiVariantGenerator.multiVariant(block)
.with(
- PropertyDispatch.properties(BlockStateProperties.AXIS, CreakingHeartBlock.CREAKING)
- .select(
- Direction.Axis.Y,
- CreakingHeartBlock.CreakingHeartState.DISABLED,
- Variant.variant().with(VariantProperties.MODEL, resourceLocation)
- )
+ PropertyDispatch.properties(BlockStateProperties.AXIS, CreakingHeartBlock.ACTIVE)
+ .select(Direction.Axis.Y, false, Variant.variant().with(VariantProperties.MODEL, resourceLocation))
.select(
Direction.Axis.Z,
- CreakingHeartBlock.CreakingHeartState.DISABLED,
+ false,
Variant.variant()
.with(VariantProperties.MODEL, resourceLocation1)
.with(VariantProperties.X_ROT, VariantProperties.Rotation.R90)
)
.select(
Direction.Axis.X,
- CreakingHeartBlock.CreakingHeartState.DISABLED,
+ false,
Variant.variant()
.with(VariantProperties.MODEL, resourceLocation1)
.with(VariantProperties.X_ROT, VariantProperties.Rotation.R90)
.with(VariantProperties.Y_ROT, VariantProperties.Rotation.R90)
)
- .select(
- Direction.Axis.Y,
- CreakingHeartBlock.CreakingHeartState.DORMANT,
- Variant.variant().with(VariantProperties.MODEL, resourceLocation2)
- )
- .select(
- Direction.Axis.Z,
- CreakingHeartBlock.CreakingHeartState.DORMANT,
- Variant.variant()
- .with(VariantProperties.MODEL, resourceLocation3)
- .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90)
- )
- .select(
- Direction.Axis.X,
- CreakingHeartBlock.CreakingHeartState.DORMANT,
- Variant.variant()
- .with(VariantProperties.MODEL, resourceLocation3)
- .with(VariantProperties.X_ROT, VariantProperties.Rotation.R90)
- .with(VariantProperties.Y_ROT, VariantProperties.Rotation.R90)
- )
- .select(
- Direction.Axis.Y,
- CreakingHeartBlock.CreakingHeartState.ACTIVE,
- Variant.variant().with(VariantProperties.MODEL, resourceLocation2)
- )
+ .select(Direction.Axis.Y, true, Variant.variant().with(VariantProperties.MODEL, resourceLocation2))
.select(
Direction.Axis.Z,
- CreakingHeartBlock.CreakingHeartState.ACTIVE,
+ true,
Variant.variant()
.with(VariantProperties.MODEL, resourceLocation3)
.with(VariantProperties.X_ROT, VariantProperties.Rotation.R90)
)
.select(
Direction.Axis.X,
- CreakingHeartBlock.CreakingHeartState.ACTIVE,
+ true,
Variant.variant()
.with(VariantProperties.MODEL, resourceLocation3)
.with(VariantProperties.X_ROT, VariantProperties.Rotation.R90)
@@ -1499,46 +1481,46 @@ public class BlockModelGenerators {
this.blockStateOutput.accept(createSimpleBlock(block, ModelLocationUtils.getModelLocation(modelBlock)));
}
- private void createCrossBlockWithDefaultItem(Block crossBlock, BlockModelGenerators.TintState tintState) {
- this.createSimpleFlatItemModel(crossBlock);
- this.createCrossBlock(crossBlock, tintState);
+ private void createCrossBlockWithDefaultItem(Block block, BlockModelGenerators.PlantType plantType) {
+ plantType.createItemModel(this, block);
+ this.createCrossBlock(block, plantType);
}
- private void createCrossBlockWithDefaultItem(Block crossBlock, BlockModelGenerators.TintState tintState, TextureMapping textureMapping) {
- this.createSimpleFlatItemModel(crossBlock);
- this.createCrossBlock(crossBlock, tintState, textureMapping);
+ private void createCrossBlockWithDefaultItem(Block block, BlockModelGenerators.PlantType plantType, TextureMapping textureMapping) {
+ this.createSimpleFlatItemModel(block);
+ this.createCrossBlock(block, plantType, textureMapping);
}
- private void createCrossBlock(Block crossBlock, BlockModelGenerators.TintState tintState) {
- TextureMapping textureMapping = TextureMapping.cross(crossBlock);
- this.createCrossBlock(crossBlock, tintState, textureMapping);
+ private void createCrossBlock(Block block, BlockModelGenerators.PlantType plantType) {
+ TextureMapping textureMapping = plantType.getTextureMapping(block);
+ this.createCrossBlock(block, plantType, textureMapping);
}
- private void createCrossBlock(Block crossBlock, BlockModelGenerators.TintState tintState, TextureMapping textureMapping) {
- ResourceLocation resourceLocation = tintState.getCross().create(crossBlock, textureMapping, this.modelOutput);
- this.blockStateOutput.accept(createSimpleBlock(crossBlock, resourceLocation));
+ private void createCrossBlock(Block block, BlockModelGenerators.PlantType plantType, TextureMapping textureMapping) {
+ ResourceLocation resourceLocation = plantType.getCross().create(block, textureMapping, this.modelOutput);
+ this.blockStateOutput.accept(createSimpleBlock(block, resourceLocation));
}
- private void createCrossBlock(Block crossBlock, BlockModelGenerators.TintState tintState, Property<Integer> property, int... propertyValues) {
- if (property.getPossibleValues().size() != propertyValues.length) {
+ private void createCrossBlock(Block block, BlockModelGenerators.PlantType plantType, Property<Integer> property, int... ints) {
+ if (property.getPossibleValues().size() != ints.length) {
throw new IllegalArgumentException("missing values for property: " + property);
} else {
PropertyDispatch propertyDispatch = PropertyDispatch.property(property).generate(integer -> {
- String string = "_stage" + propertyValues[integer];
- TextureMapping textureMapping = TextureMapping.cross(TextureMapping.getBlockTexture(crossBlock, string));
- ResourceLocation resourceLocation = tintState.getCross().createWithSuffix(crossBlock, string, textureMapping, this.modelOutput);
+ String string = "_stage" + ints[integer];
+ TextureMapping textureMapping = TextureMapping.cross(TextureMapping.getBlockTexture(block, string));
+ ResourceLocation resourceLocation = plantType.getCross().createWithSuffix(block, string, textureMapping, this.modelOutput);
return Variant.variant().with(VariantProperties.MODEL, resourceLocation);
});
- this.createSimpleFlatItemModel(crossBlock.asItem());
- this.blockStateOutput.accept(MultiVariantGenerator.multiVariant(crossBlock).with(propertyDispatch));
+ this.createSimpleFlatItemModel(block.asItem());
+ this.blockStateOutput.accept(MultiVariantGenerator.multiVariant(block).with(propertyDispatch));
}
}
- private void createPlant(Block plantBlock, Block pottedPlantBlock, BlockModelGenerators.TintState tintState) {
- this.createCrossBlockWithDefaultItem(plantBlock, tintState);
- TextureMapping textureMapping = TextureMapping.plant(plantBlock);
- ResourceLocation resourceLocation = tintState.getCrossPot().create(pottedPlantBlock, textureMapping, this.modelOutput);
- this.blockStateOutput.accept(createSimpleBlock(pottedPlantBlock, resourceLocation));
+ private void createPlant(Block block, Block block1, BlockModelGenerators.PlantType plantType) {
+ this.createCrossBlockWithDefaultItem(block, plantType);
+ TextureMapping plantTextureMapping = plantType.getPlantTextureMapping(block);
+ ResourceLocation resourceLocation = plantType.getCrossPot().create(block1, plantTextureMapping, this.modelOutput);
+ this.blockStateOutput.accept(createSimpleBlock(block1, resourceLocation));
}
private void createCoralFans(Block coralFanBlock, Block coralWallFanBlock) {
@@ -1614,26 +1596,26 @@ public class BlockModelGenerators {
Block coralWallFanBlock,
Block deadCoralWallFanBlock
) {
- this.createCrossBlockWithDefaultItem(coralBlock, BlockModelGenerators.TintState.NOT_TINTED);
- this.createCrossBlockWithDefaultItem(deadCoralBlock, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createCrossBlockWithDefaultItem(coralBlock, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createCrossBlockWithDefaultItem(deadCoralBlock, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialCube(coralFullBlock);
this.createTrivialCube(deadCoralFullBlock);
this.createCoralFans(coralFanBlock, coralWallFanBlock);
this.createCoralFans(deadCoralFanBlock, deadCoralWallFanBlock);
}
- private void createDoublePlant(Block doublePlantBlock, BlockModelGenerators.TintState tintState) {
- this.createSimpleFlatItemModel(doublePlantBlock, "_top");
- ResourceLocation resourceLocation = this.createSuffixedVariant(doublePlantBlock, "_top", tintState.getCross(), TextureMapping::cross);
- ResourceLocation resourceLocation1 = this.createSuffixedVariant(doublePlantBlock, "_bottom", tintState.getCross(), TextureMapping::cross);
- this.createDoubleBlock(doublePlantBlock, resourceLocation, resourceLocation1);
+ private void createDoublePlant(Block block, BlockModelGenerators.PlantType plantType) {
+ this.createSimpleFlatItemModel(block, "_top");
+ ResourceLocation resourceLocation = this.createSuffixedVariant(block, "_top", plantType.getCross(), TextureMapping::cross);
+ ResourceLocation resourceLocation1 = this.createSuffixedVariant(block, "_bottom", plantType.getCross(), TextureMapping::cross);
+ this.createDoubleBlock(block, resourceLocation, resourceLocation1);
}
private void createSunflower() {
this.createSimpleFlatItemModel(Blocks.SUNFLOWER, "_front");
ResourceLocation modelLocation = ModelLocationUtils.getModelLocation(Blocks.SUNFLOWER, "_top");
ResourceLocation resourceLocation = this.createSuffixedVariant(
- Blocks.SUNFLOWER, "_bottom", BlockModelGenerators.TintState.NOT_TINTED.getCross(), TextureMapping::cross
+ Blocks.SUNFLOWER, "_bottom", BlockModelGenerators.PlantType.NOT_TINTED.getCross(), TextureMapping::cross
);
this.createDoubleBlock(Blocks.SUNFLOWER, modelLocation, resourceLocation);
}
@@ -4423,12 +4405,21 @@ public class BlockModelGenerators {
private void createMultiface(Block multifaceBlock) {
this.createSimpleFlatItemModel(multifaceBlock);
- ResourceLocation modelLocation = ModelLocationUtils.getModelLocation(multifaceBlock);
- MultiPartGenerator multiPartGenerator = MultiPartGenerator.multiPart(multifaceBlock);
+ this.createMultifaceBlockStates(multifaceBlock);
+ }
+
+ private void createMultiface(Block block, Item item) {
+ this.createSimpleFlatItemModel(item);
+ this.createMultifaceBlockStates(block);
+ }
+
+ private void createMultifaceBlockStates(Block block) {
+ ResourceLocation modelLocation = ModelLocationUtils.getModelLocation(block);
+ MultiPartGenerator multiPartGenerator = MultiPartGenerator.multiPart(block);
Condition.TerminalCondition terminalCondition = Util.make(
Condition.condition(),
terminalCondition1 -> MULTIFACE_GENERATOR.stream().map(Pair::getFirst).map(MultifaceBlock::getFaceProperty).forEach(booleanProperty -> {
- if (multifaceBlock.defaultBlockState().hasProperty(booleanProperty)) {
+ if (block.defaultBlockState().hasProperty(booleanProperty)) {
terminalCondition1.term(booleanProperty, false);
}
})
@@ -4437,7 +4428,7 @@ public class BlockModelGenerators {
for (Pair<Direction, Function<ResourceLocation, Variant>> pair : MULTIFACE_GENERATOR) {
BooleanProperty faceProperty = MultifaceBlock.getFaceProperty(pair.getFirst());
Function<ResourceLocation, Variant> function = pair.getSecond();
- if (multifaceBlock.defaultBlockState().hasProperty(faceProperty)) {
+ if (block.defaultBlockState().hasProperty(faceProperty)) {
multiPartGenerator.with(Condition.condition().term(faceProperty, true), function.apply(modelLocation));
multiPartGenerator.with(terminalCondition, function.apply(modelLocation));
}
@@ -4487,7 +4478,7 @@ public class BlockModelGenerators {
_boolean -> {
String string = _boolean ? "_tip" : "";
TextureMapping textureMapping = TextureMapping.cross(TextureMapping.getBlockTexture(block, string));
- ResourceLocation resourceLocation = BlockModelGenerators.TintState.NOT_TINTED
+ ResourceLocation resourceLocation = BlockModelGenerators.PlantType.NOT_TINTED
.getCross()
.createWithSuffix(block, string, textureMapping, this.modelOutput);
return Variant.variant().with(VariantProperties.MODEL, resourceLocation);
@@ -4605,9 +4596,9 @@ public class BlockModelGenerators {
.create(ModelLocationUtils.getModelLocation(shulkerBoxBlock.asItem()), TextureMapping.particle(shulkerBoxBlock), this.modelOutput);
}
- private void createGrowingPlant(Block growingPlantBlock, Block plantBlock, BlockModelGenerators.TintState tintState) {
- this.createCrossBlock(growingPlantBlock, tintState);
- this.createCrossBlock(plantBlock, tintState);
+ private void createGrowingPlant(Block block, Block block1, BlockModelGenerators.PlantType plantType) {
+ this.createCrossBlock(block, plantType);
+ this.createCrossBlock(block1, plantType);
}
private void createBedItem(Block bedBlock, Block woolBlock) {
@@ -4629,9 +4620,9 @@ public class BlockModelGenerators {
}
private void createNetherRoots(Block plantBlock, Block pottedPlantBlock) {
- this.createCrossBlockWithDefaultItem(plantBlock, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createCrossBlockWithDefaultItem(plantBlock, BlockModelGenerators.PlantType.NOT_TINTED);
TextureMapping textureMapping = TextureMapping.plant(TextureMapping.getBlockTexture(plantBlock, "_pot"));
- ResourceLocation resourceLocation = BlockModelGenerators.TintState.NOT_TINTED.getCrossPot().create(pottedPlantBlock, textureMapping, this.modelOutput);
+ ResourceLocation resourceLocation = BlockModelGenerators.PlantType.NOT_TINTED.getCrossPot().create(pottedPlantBlock, textureMapping, this.modelOutput);
this.blockStateOutput.accept(createSimpleBlock(pottedPlantBlock, resourceLocation));
}
@@ -4830,6 +4821,7 @@ public class BlockModelGenerators {
this.createTrivialCube(Blocks.LAPIS_ORE);
this.createTrivialCube(Blocks.DEEPSLATE_LAPIS_ORE);
this.createTrivialCube(Blocks.LAPIS_BLOCK);
+ this.createTrivialCube(Blocks.RESIN_BLOCK);
this.createTrivialCube(Blocks.NETHER_QUARTZ_ORE);
this.createTrivialCube(Blocks.REDSTONE_ORE);
this.createTrivialCube(Blocks.DEEPSLATE_REDSTONE_ORE);
@@ -4962,6 +4954,7 @@ public class BlockModelGenerators {
this.createMultiface(Blocks.VINE);
this.createMultiface(Blocks.GLOW_LICHEN);
this.createMultiface(Blocks.SCULK_VEIN);
+ this.createMultiface(Blocks.RESIN_CLUMP, Items.RESIN_CLUMP);
this.createMagmaBlock();
this.createJigsaw();
this.createSculkSensor();
@@ -5016,7 +5009,7 @@ public class BlockModelGenerators {
this.createCropBlock(Blocks.NETHER_WART, BlockStateProperties.AGE_3, 0, 1, 1, 2);
this.createCropBlock(Blocks.POTATOES, BlockStateProperties.AGE_7, 0, 0, 1, 1, 2, 2, 2, 3);
this.createCropBlock(Blocks.WHEAT, BlockStateProperties.AGE_7, 0, 1, 2, 3, 4, 5, 6, 7);
- this.createCrossBlock(Blocks.TORCHFLOWER_CROP, BlockModelGenerators.TintState.NOT_TINTED, BlockStateProperties.AGE_1, 0, 1);
+ this.createCrossBlock(Blocks.TORCHFLOWER_CROP, BlockModelGenerators.PlantType.NOT_TINTED, BlockStateProperties.AGE_1, 0, 1);
this.createPitcherCrop();
this.createPitcherPlant();
this.blockEntityModels(ModelLocationUtils.decorateBlockModelLocation("decorated_pot"), Blocks.TERRACOTTA).createWithoutBlockItem(Blocks.DECORATED_POT);
@@ -5245,53 +5238,55 @@ public class BlockModelGenerators {
this.createFullAndCarpetBlocks(Blocks.BLACK_WOOL, Blocks.BLACK_CARPET);
this.createTrivialCube(Blocks.MUD);
this.createTrivialCube(Blocks.PACKED_MUD);
- this.createPlant(Blocks.FERN, Blocks.POTTED_FERN, BlockModelGenerators.TintState.TINTED);
- this.createPlant(Blocks.DANDELION, Blocks.POTTED_DANDELION, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.POPPY, Blocks.POTTED_POPPY, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.BLUE_ORCHID, Blocks.POTTED_BLUE_ORCHID, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.ALLIUM, Blocks.POTTED_ALLIUM, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.AZURE_BLUET, Blocks.POTTED_AZURE_BLUET, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.RED_TULIP, Blocks.POTTED_RED_TULIP, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.ORANGE_TULIP, Blocks.POTTED_ORANGE_TULIP, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.WHITE_TULIP, Blocks.POTTED_WHITE_TULIP, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.PINK_TULIP, Blocks.POTTED_PINK_TULIP, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.OXEYE_DAISY, Blocks.POTTED_OXEYE_DAISY, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.CORNFLOWER, Blocks.POTTED_CORNFLOWER, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.LILY_OF_THE_VALLEY, Blocks.POTTED_LILY_OF_THE_VALLEY, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.WITHER_ROSE, Blocks.POTTED_WITHER_ROSE, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.RED_MUSHROOM, Blocks.POTTED_RED_MUSHROOM, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.BROWN_MUSHROOM, Blocks.POTTED_BROWN_MUSHROOM, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.DEAD_BUSH, Blocks.POTTED_DEAD_BUSH, BlockModelGenerators.TintState.NOT_TINTED);
- this.createPlant(Blocks.TORCHFLOWER, Blocks.POTTED_TORCHFLOWER, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.FERN, Blocks.POTTED_FERN, BlockModelGenerators.PlantType.TINTED);
+ this.createPlant(Blocks.DANDELION, Blocks.POTTED_DANDELION, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.POPPY, Blocks.POTTED_POPPY, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.OPEN_EYEBLOSSOM, Blocks.POTTED_OPEN_EYEBLOSSOM, BlockModelGenerators.PlantType.EMISSIVE_NOT_TINTED);
+ this.createPlant(Blocks.CLOSED_EYEBLOSSOM, Blocks.POTTED_CLOSED_EYEBLOSSOM, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.BLUE_ORCHID, Blocks.POTTED_BLUE_ORCHID, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.ALLIUM, Blocks.POTTED_ALLIUM, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.AZURE_BLUET, Blocks.POTTED_AZURE_BLUET, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.RED_TULIP, Blocks.POTTED_RED_TULIP, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.ORANGE_TULIP, Blocks.POTTED_ORANGE_TULIP, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.WHITE_TULIP, Blocks.POTTED_WHITE_TULIP, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.PINK_TULIP, Blocks.POTTED_PINK_TULIP, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.OXEYE_DAISY, Blocks.POTTED_OXEYE_DAISY, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.CORNFLOWER, Blocks.POTTED_CORNFLOWER, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.LILY_OF_THE_VALLEY, Blocks.POTTED_LILY_OF_THE_VALLEY, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.WITHER_ROSE, Blocks.POTTED_WITHER_ROSE, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.RED_MUSHROOM, Blocks.POTTED_RED_MUSHROOM, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.BROWN_MUSHROOM, Blocks.POTTED_BROWN_MUSHROOM, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.DEAD_BUSH, Blocks.POTTED_DEAD_BUSH, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createPlant(Blocks.TORCHFLOWER, Blocks.POTTED_TORCHFLOWER, BlockModelGenerators.PlantType.NOT_TINTED);
this.createPointedDripstone();
this.createMushroomBlock(Blocks.BROWN_MUSHROOM_BLOCK);
this.createMushroomBlock(Blocks.RED_MUSHROOM_BLOCK);
this.createMushroomBlock(Blocks.MUSHROOM_STEM);
- this.createCrossBlockWithDefaultItem(Blocks.SHORT_GRASS, BlockModelGenerators.TintState.TINTED);
- this.createCrossBlock(Blocks.SUGAR_CANE, BlockModelGenerators.TintState.TINTED);
+ this.createCrossBlockWithDefaultItem(Blocks.SHORT_GRASS, BlockModelGenerators.PlantType.TINTED);
+ this.createCrossBlock(Blocks.SUGAR_CANE, BlockModelGenerators.PlantType.TINTED);
this.createSimpleFlatItemModel(Items.SUGAR_CANE);
- this.createGrowingPlant(Blocks.KELP, Blocks.KELP_PLANT, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createGrowingPlant(Blocks.KELP, Blocks.KELP_PLANT, BlockModelGenerators.PlantType.NOT_TINTED);
this.createSimpleFlatItemModel(Items.KELP);
this.skipAutoItemBlock(Blocks.KELP_PLANT);
- this.createCrossBlock(Blocks.HANGING_ROOTS, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createCrossBlock(Blocks.HANGING_ROOTS, BlockModelGenerators.PlantType.NOT_TINTED);
this.skipAutoItemBlock(Blocks.HANGING_ROOTS);
this.skipAutoItemBlock(Blocks.CAVE_VINES_PLANT);
- this.createGrowingPlant(Blocks.WEEPING_VINES, Blocks.WEEPING_VINES_PLANT, BlockModelGenerators.TintState.NOT_TINTED);
- this.createGrowingPlant(Blocks.TWISTING_VINES, Blocks.TWISTING_VINES_PLANT, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createGrowingPlant(Blocks.WEEPING_VINES, Blocks.WEEPING_VINES_PLANT, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createGrowingPlant(Blocks.TWISTING_VINES, Blocks.TWISTING_VINES_PLANT, BlockModelGenerators.PlantType.NOT_TINTED);
this.createSimpleFlatItemModel(Blocks.WEEPING_VINES, "_plant");
this.skipAutoItemBlock(Blocks.WEEPING_VINES_PLANT);
this.createSimpleFlatItemModel(Blocks.TWISTING_VINES, "_plant");
this.skipAutoItemBlock(Blocks.TWISTING_VINES_PLANT);
this.createCrossBlockWithDefaultItem(
- Blocks.BAMBOO_SAPLING, BlockModelGenerators.TintState.TINTED, TextureMapping.cross(TextureMapping.getBlockTexture(Blocks.BAMBOO, "_stage0"))
+ Blocks.BAMBOO_SAPLING, BlockModelGenerators.PlantType.TINTED, TextureMapping.cross(TextureMapping.getBlockTexture(Blocks.BAMBOO, "_stage0"))
);
this.createBamboo();
- this.createCrossBlockWithDefaultItem(Blocks.COBWEB, BlockModelGenerators.TintState.NOT_TINTED);
- this.createDoublePlant(Blocks.LILAC, BlockModelGenerators.TintState.NOT_TINTED);
- this.createDoublePlant(Blocks.ROSE_BUSH, BlockModelGenerators.TintState.NOT_TINTED);
- this.createDoublePlant(Blocks.PEONY, BlockModelGenerators.TintState.NOT_TINTED);
- this.createDoublePlant(Blocks.TALL_GRASS, BlockModelGenerators.TintState.TINTED);
- this.createDoublePlant(Blocks.LARGE_FERN, BlockModelGenerators.TintState.TINTED);
+ this.createCrossBlockWithDefaultItem(Blocks.COBWEB, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createDoublePlant(Blocks.LILAC, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createDoublePlant(Blocks.ROSE_BUSH, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createDoublePlant(Blocks.PEONY, BlockModelGenerators.PlantType.NOT_TINTED);
+ this.createDoublePlant(Blocks.TALL_GRASS, BlockModelGenerators.PlantType.TINTED);
+ this.createDoublePlant(Blocks.LARGE_FERN, BlockModelGenerators.PlantType.TINTED);
this.createSunflower();
this.createTallSeagrass();
this.createSmallDripleaf();
@@ -5354,57 +5349,57 @@ public class BlockModelGenerators {
this.woodProvider(Blocks.ACACIA_LOG).logWithHorizontal(Blocks.ACACIA_LOG).wood(Blocks.ACACIA_WOOD);
this.woodProvider(Blocks.STRIPPED_ACACIA_LOG).logWithHorizontal(Blocks.STRIPPED_ACACIA_LOG).wood(Blocks.STRIPPED_ACACIA_WOOD);
this.createHangingSign(Blocks.STRIPPED_ACACIA_LOG, Blocks.ACACIA_HANGING_SIGN, Blocks.ACACIA_WALL_HANGING_SIGN);
- this.createPlant(Blocks.ACACIA_SAPLING, Blocks.POTTED_ACACIA_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.ACACIA_SAPLING, Blocks.POTTED_ACACIA_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.ACACIA_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.CHERRY_LOG).logUVLocked(Blocks.CHERRY_LOG).wood(Blocks.CHERRY_WOOD);
this.woodProvider(Blocks.STRIPPED_CHERRY_LOG).logUVLocked(Blocks.STRIPPED_CHERRY_LOG).wood(Blocks.STRIPPED_CHERRY_WOOD);
this.createHangingSign(Blocks.STRIPPED_CHERRY_LOG, Blocks.CHERRY_HANGING_SIGN, Blocks.CHERRY_WALL_HANGING_SIGN);
- this.createPlant(Blocks.CHERRY_SAPLING, Blocks.POTTED_CHERRY_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.CHERRY_SAPLING, Blocks.POTTED_CHERRY_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.CHERRY_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.BIRCH_LOG).logWithHorizontal(Blocks.BIRCH_LOG).wood(Blocks.BIRCH_WOOD);
this.woodProvider(Blocks.STRIPPED_BIRCH_LOG).logWithHorizontal(Blocks.STRIPPED_BIRCH_LOG).wood(Blocks.STRIPPED_BIRCH_WOOD);
this.createHangingSign(Blocks.STRIPPED_BIRCH_LOG, Blocks.BIRCH_HANGING_SIGN, Blocks.BIRCH_WALL_HANGING_SIGN);
- this.createPlant(Blocks.BIRCH_SAPLING, Blocks.POTTED_BIRCH_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.BIRCH_SAPLING, Blocks.POTTED_BIRCH_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.BIRCH_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.OAK_LOG).logWithHorizontal(Blocks.OAK_LOG).wood(Blocks.OAK_WOOD);
this.woodProvider(Blocks.STRIPPED_OAK_LOG).logWithHorizontal(Blocks.STRIPPED_OAK_LOG).wood(Blocks.STRIPPED_OAK_WOOD);
this.createHangingSign(Blocks.STRIPPED_OAK_LOG, Blocks.OAK_HANGING_SIGN, Blocks.OAK_WALL_HANGING_SIGN);
- this.createPlant(Blocks.OAK_SAPLING, Blocks.POTTED_OAK_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.OAK_SAPLING, Blocks.POTTED_OAK_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.OAK_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.SPRUCE_LOG).logWithHorizontal(Blocks.SPRUCE_LOG).wood(Blocks.SPRUCE_WOOD);
this.woodProvider(Blocks.STRIPPED_SPRUCE_LOG).logWithHorizontal(Blocks.STRIPPED_SPRUCE_LOG).wood(Blocks.STRIPPED_SPRUCE_WOOD);
this.createHangingSign(Blocks.STRIPPED_SPRUCE_LOG, Blocks.SPRUCE_HANGING_SIGN, Blocks.SPRUCE_WALL_HANGING_SIGN);
- this.createPlant(Blocks.SPRUCE_SAPLING, Blocks.POTTED_SPRUCE_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.SPRUCE_SAPLING, Blocks.POTTED_SPRUCE_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.SPRUCE_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.DARK_OAK_LOG).logWithHorizontal(Blocks.DARK_OAK_LOG).wood(Blocks.DARK_OAK_WOOD);
this.woodProvider(Blocks.STRIPPED_DARK_OAK_LOG).logWithHorizontal(Blocks.STRIPPED_DARK_OAK_LOG).wood(Blocks.STRIPPED_DARK_OAK_WOOD);
this.createHangingSign(Blocks.STRIPPED_DARK_OAK_LOG, Blocks.DARK_OAK_HANGING_SIGN, Blocks.DARK_OAK_WALL_HANGING_SIGN);
- this.createPlant(Blocks.DARK_OAK_SAPLING, Blocks.POTTED_DARK_OAK_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.DARK_OAK_SAPLING, Blocks.POTTED_DARK_OAK_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.DARK_OAK_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.PALE_OAK_LOG).logWithHorizontal(Blocks.PALE_OAK_LOG).wood(Blocks.PALE_OAK_WOOD);
this.woodProvider(Blocks.STRIPPED_PALE_OAK_LOG).logWithHorizontal(Blocks.STRIPPED_PALE_OAK_LOG).wood(Blocks.STRIPPED_PALE_OAK_WOOD);
this.createHangingSign(Blocks.STRIPPED_PALE_OAK_LOG, Blocks.PALE_OAK_HANGING_SIGN, Blocks.PALE_OAK_WALL_HANGING_SIGN);
- this.createPlant(Blocks.PALE_OAK_SAPLING, Blocks.POTTED_PALE_OAK_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.PALE_OAK_SAPLING, Blocks.POTTED_PALE_OAK_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.PALE_OAK_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.JUNGLE_LOG).logWithHorizontal(Blocks.JUNGLE_LOG).wood(Blocks.JUNGLE_WOOD);
this.woodProvider(Blocks.STRIPPED_JUNGLE_LOG).logWithHorizontal(Blocks.STRIPPED_JUNGLE_LOG).wood(Blocks.STRIPPED_JUNGLE_WOOD);
this.createHangingSign(Blocks.STRIPPED_JUNGLE_LOG, Blocks.JUNGLE_HANGING_SIGN, Blocks.JUNGLE_WALL_HANGING_SIGN);
- this.createPlant(Blocks.JUNGLE_SAPLING, Blocks.POTTED_JUNGLE_SAPLING, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.JUNGLE_SAPLING, Blocks.POTTED_JUNGLE_SAPLING, BlockModelGenerators.PlantType.NOT_TINTED);
this.createTrivialBlock(Blocks.JUNGLE_LEAVES, TexturedModel.LEAVES);
this.woodProvider(Blocks.CRIMSON_STEM).log(Blocks.CRIMSON_STEM).wood(Blocks.CRIMSON_HYPHAE);
this.woodProvider(Blocks.STRIPPED_CRIMSON_STEM).log(Blocks.STRIPPED_CRIMSON_STEM).wood(Blocks.STRIPPED_CRIMSON_HYPHAE);
this.createHangingSign(Blocks.STRIPPED_CRIMSON_STEM, Blocks.CRIMSON_HANGING_SIGN, Blocks.CRIMSON_WALL_HANGING_SIGN);
- this.createPlant(Blocks.CRIMSON_FUNGUS, Blocks.POTTED_CRIMSON_FUNGUS, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.CRIMSON_FUNGUS, Blocks.POTTED_CRIMSON_FUNGUS, BlockModelGenerators.PlantType.NOT_TINTED);
this.createNetherRoots(Blocks.CRIMSON_ROOTS, Blocks.POTTED_CRIMSON_ROOTS);
this.woodProvider(Blocks.WARPED_STEM).log(Blocks.WARPED_STEM).wood(Blocks.WARPED_HYPHAE);
this.woodProvider(Blocks.STRIPPED_WARPED_STEM).log(Blocks.STRIPPED_WARPED_STEM).wood(Blocks.STRIPPED_WARPED_HYPHAE);
this.createHangingSign(Blocks.STRIPPED_WARPED_STEM, Blocks.WARPED_HANGING_SIGN, Blocks.WARPED_WALL_HANGING_SIGN);
- this.createPlant(Blocks.WARPED_FUNGUS, Blocks.POTTED_WARPED_FUNGUS, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createPlant(Blocks.WARPED_FUNGUS, Blocks.POTTED_WARPED_FUNGUS, BlockModelGenerators.PlantType.NOT_TINTED);
this.createNetherRoots(Blocks.WARPED_ROOTS, Blocks.POTTED_WARPED_ROOTS);
this.woodProvider(Blocks.BAMBOO_BLOCK).logUVLocked(Blocks.BAMBOO_BLOCK);
this.woodProvider(Blocks.STRIPPED_BAMBOO_BLOCK).logUVLocked(Blocks.STRIPPED_BAMBOO_BLOCK);
this.createHangingSign(Blocks.BAMBOO_PLANKS, Blocks.BAMBOO_HANGING_SIGN, Blocks.BAMBOO_WALL_HANGING_SIGN);
- this.createCrossBlock(Blocks.NETHER_SPROUTS, BlockModelGenerators.TintState.NOT_TINTED);
+ this.createCrossBlock(Blocks.NETHER_SPROUTS, BlockModelGenerators.PlantType.NOT_TINTED);
this.createSimpleFlatItemModel(Items.NETHER_SPROUTS);
this.createDoor(Blocks.IRON_DOOR);
this.createTrapdoor(Blocks.IRON_TRAPDOOR);
@@ -5742,16 +5737,43 @@ public class BlockModelGenerators {
record BookSlotModelCacheKey(ModelTemplate template, String modelSuffix) {
}
- static enum TintState {
- TINTED,
- NOT_TINTED;
+ static enum PlantType {
+ TINTED(ModelTemplates.TINTED_CROSS, ModelTemplates.TINTED_FLOWER_POT_CROSS, false),
+ NOT_TINTED(ModelTemplates.CROSS, ModelTemplates.FLOWER_POT_CROSS, false),
+ EMISSIVE_NOT_TINTED(ModelTemplates.CROSS_EMISSIVE, ModelTemplates.FLOWER_POT_CROSS_EMISSIVE, true);
+
+ private final ModelTemplate blockTemplate;
+ private final ModelTemplate flowerPotTemplate;
+ private final boolean isEmissive;
+
+ private PlantType(final ModelTemplate modelTemplate, final ModelTemplate modelTemplate1, final boolean flag) {
+ this.blockTemplate = modelTemplate;
+ this.flowerPotTemplate = modelTemplate1;
+ this.isEmissive = flag;
+ }
public ModelTemplate getCross() {
- return this == TINTED ? ModelTemplates.TINTED_CROSS : ModelTemplates.CROSS;
+ return this.blockTemplate;
}
public ModelTemplate getCrossPot() {
- return this == TINTED ? ModelTemplates.TINTED_FLOWER_POT_CROSS : ModelTemplates.FLOWER_POT_CROSS;
+ return this.flowerPotTemplate;
+ }
+
+ public void createItemModel(BlockModelGenerators blockModelGenerators, Block block) {
+ if (this.isEmissive) {
+ blockModelGenerators.createTwoLayerFlatItemModel(block, "_emissive");
+ } else {
+ blockModelGenerators.createSimpleFlatItemModel(block);
+ }
+ }
+
+ public TextureMapping getTextureMapping(Block block) {
+ return this.isEmissive ? TextureMapping.crossEmissive(block) : TextureMapping.cross(block);
+ }
+
+ public TextureMapping getPlantTextureMapping(Block block) {
+ return this.isEmissive ? TextureMapping.plantEmissive(block) : TextureMapping.plant(block);
}
}
diff --git a/net/minecraft/data/models/ItemModelGenerators.java b/net/minecraft/data/models/ItemModelGenerators.java
index 0df5e05..954fb11 100644
--- a/net/minecraft/data/models/ItemModelGenerators.java
+++ b/net/minecraft/data/models/ItemModelGenerators.java
@@ -27,16 +27,17 @@ import net.minecraft.world.item.equipment.Equippable;
public class ItemModelGenerators {
public static final ResourceLocation TRIM_TYPE_PREDICATE_ID = ResourceLocation.withDefaultNamespace("trim_type");
private static final List<ItemModelGenerators.TrimModelData> GENERATED_TRIM_MODELS = List.of(
- new ItemModelGenerators.TrimModelData("quartz", 0.1F, Map.of()),
- new ItemModelGenerators.TrimModelData("iron", 0.2F, Map.of(EquipmentModels.IRON, "iron_darker")),
- new ItemModelGenerators.TrimModelData("netherite", 0.3F, Map.of(EquipmentModels.NETHERITE, "netherite_darker")),
- new ItemModelGenerators.TrimModelData("redstone", 0.4F, Map.of()),
- new ItemModelGenerators.TrimModelData("copper", 0.5F, Map.of()),
- new ItemModelGenerators.TrimModelData("gold", 0.6F, Map.of(EquipmentModels.GOLD, "gold_darker")),
- new ItemModelGenerators.TrimModelData("emerald", 0.7F, Map.of()),
- new ItemModelGenerators.TrimModelData("diamond", 0.8F, Map.of(EquipmentModels.DIAMOND, "diamond_darker")),
- new ItemModelGenerators.TrimModelData("lapis", 0.9F, Map.of()),
- new ItemModelGenerators.TrimModelData("amethyst", 1.0F, Map.of())
+ new ItemModelGenerators.TrimModelData("quartz", 0.01F, Map.of()),
+ new ItemModelGenerators.TrimModelData("iron", 0.02F, Map.of(EquipmentModels.IRON, "iron_darker")),
+ new ItemModelGenerators.TrimModelData("netherite", 0.03F, Map.of(EquipmentModels.NETHERITE, "netherite_darker")),
+ new ItemModelGenerators.TrimModelData("redstone", 0.04F, Map.of()),
+ new ItemModelGenerators.TrimModelData("copper", 0.05F, Map.of()),
+ new ItemModelGenerators.TrimModelData("gold", 0.06F, Map.of(EquipmentModels.GOLD, "gold_darker")),
+ new ItemModelGenerators.TrimModelData("emerald", 0.07F, Map.of()),
+ new ItemModelGenerators.TrimModelData("diamond", 0.08F, Map.of(EquipmentModels.DIAMOND, "diamond_darker")),
+ new ItemModelGenerators.TrimModelData("lapis", 0.09F, Map.of()),
+ new ItemModelGenerators.TrimModelData("amethyst", 0.1F, Map.of()),
+ new ItemModelGenerators.TrimModelData("resin", 0.11F, Map.of())
);
private final BiConsumer<ResourceLocation, Supplier<JsonElement>> output;
@@ -330,6 +331,7 @@ public class ItemModelGenerators {
this.generateFlatItem(Items.NETHERITE_SHOVEL, ModelTemplates.FLAT_HANDHELD_ITEM);
this.generateFlatItem(Items.NETHERITE_SWORD, ModelTemplates.FLAT_HANDHELD_ITEM);
this.generateFlatItem(Items.NETHER_BRICK, ModelTemplates.FLAT_ITEM);
+ this.generateFlatItem(Items.RESIN_BRICK, ModelTemplates.FLAT_ITEM);
this.generateFlatItem(Items.NETHER_STAR, ModelTemplates.FLAT_ITEM);
this.generateFlatItem(Items.OAK_BOAT, ModelTemplates.FLAT_ITEM);
this.generateFlatItem(Items.OAK_CHEST_BOAT, ModelTemplates.FLAT_ITEM);
diff --git a/net/minecraft/data/models/model/ModelTemplates.java b/net/minecraft/data/models/model/ModelTemplates.java
index a63c7ed..1d6ef81 100644
--- a/net/minecraft/data/models/model/ModelTemplates.java
+++ b/net/minecraft/data/models/model/ModelTemplates.java
@@ -83,8 +83,10 @@ public class ModelTemplates {
public static final ModelTemplate POINTED_DRIPSTONE = create("pointed_dripstone", TextureSlot.CROSS);
public static final ModelTemplate CROSS = create("cross", TextureSlot.CROSS);
public static final ModelTemplate TINTED_CROSS = create("tinted_cross", TextureSlot.CROSS);
+ public static final ModelTemplate CROSS_EMISSIVE = create("cross_emissive", TextureSlot.CROSS, TextureSlot.CROSS_EMISSIVE);
public static final ModelTemplate FLOWER_POT_CROSS = create("flower_pot_cross", TextureSlot.PLANT);
public static final ModelTemplate TINTED_FLOWER_POT_CROSS = create("tinted_flower_pot_cross", TextureSlot.PLANT);
+ public static final ModelTemplate FLOWER_POT_CROSS_EMISSIVE = create("flower_pot_cross_emissive", TextureSlot.PLANT, TextureSlot.CROSS_EMISSIVE);
public static final ModelTemplate RAIL_FLAT = create("rail_flat", TextureSlot.RAIL);
public static final ModelTemplate RAIL_CURVED = create("rail_curved", "_corner", TextureSlot.RAIL);
public static final ModelTemplate RAIL_RAISED_NE = create("template_rail_raised_ne", "_raised_ne", TextureSlot.RAIL);
diff --git a/net/minecraft/data/models/model/TextureMapping.java b/net/minecraft/data/models/model/TextureMapping.java
index 3efc01a..5451ad1 100644
--- a/net/minecraft/data/models/model/TextureMapping.java
+++ b/net/minecraft/data/models/model/TextureMapping.java
@@ -86,6 +86,10 @@ public class TextureMapping {
return singleSlot(TextureSlot.SIDE, getBlockTexture(block));
}
+ public static TextureMapping crossEmissive(Block block) {
+ return new TextureMapping().put(TextureSlot.CROSS, getBlockTexture(block)).put(TextureSlot.CROSS_EMISSIVE, getBlockTexture(block, "_emissive"));
+ }
+
public static TextureMapping cross(ResourceLocation crossTextureLocation) {
return singleSlot(TextureSlot.CROSS, crossTextureLocation);
}
@@ -94,6 +98,10 @@ public class TextureMapping {
return singleSlot(TextureSlot.PLANT, getBlockTexture(plantBlock));
}
+ public static TextureMapping plantEmissive(Block block) {
+ return new TextureMapping().put(TextureSlot.PLANT, getBlockTexture(block)).put(TextureSlot.CROSS_EMISSIVE, getBlockTexture(block, "_emissive"));
+ }
+
public static TextureMapping plant(ResourceLocation plantTextureLocation) {
return singleSlot(TextureSlot.PLANT, plantTextureLocation);
}
diff --git a/net/minecraft/data/models/model/TextureSlot.java b/net/minecraft/data/models/model/TextureSlot.java
index c2c48c9..fbbda66 100644
--- a/net/minecraft/data/models/model/TextureSlot.java
+++ b/net/minecraft/data/models/model/TextureSlot.java
@@ -19,6 +19,7 @@ public final class TextureSlot {
public static final TextureSlot UP = create("up");
public static final TextureSlot DOWN = create("down");
public static final TextureSlot CROSS = create("cross");
+ public static final TextureSlot CROSS_EMISSIVE = create("cross_emissive");
public static final TextureSlot PLANT = create("plant");
public static final TextureSlot WALL = create("wall", ALL);
public static final TextureSlot RAIL = create("rail");
diff --git a/net/minecraft/data/recipes/packs/VanillaRecipeProvider.java b/net/minecraft/data/recipes/packs/VanillaRecipeProvider.java
index 6ae05c6..0386f36 100644
--- a/net/minecraft/data/recipes/packs/VanillaRecipeProvider.java
+++ b/net/minecraft/data/recipes/packs/VanillaRecipeProvider.java
@@ -76,6 +76,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.planksFromLogs(Blocks.BIRCH_PLANKS, ItemTags.BIRCH_LOGS, 4);
this.planksFromLogs(Blocks.CRIMSON_PLANKS, ItemTags.CRIMSON_STEMS, 4);
this.planksFromLog(Blocks.DARK_OAK_PLANKS, ItemTags.DARK_OAK_LOGS, 4);
+ this.planksFromLog(Blocks.PALE_OAK_PLANKS, ItemTags.PALE_OAK_LOGS, 4);
this.planksFromLogs(Blocks.JUNGLE_PLANKS, ItemTags.JUNGLE_LOGS, 4);
this.planksFromLogs(Blocks.OAK_PLANKS, ItemTags.OAK_LOGS, 4);
this.planksFromLogs(Blocks.SPRUCE_PLANKS, ItemTags.SPRUCE_LOGS, 4);
@@ -84,6 +85,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.woodFromLogs(Blocks.ACACIA_WOOD, Blocks.ACACIA_LOG);
this.woodFromLogs(Blocks.BIRCH_WOOD, Blocks.BIRCH_LOG);
this.woodFromLogs(Blocks.DARK_OAK_WOOD, Blocks.DARK_OAK_LOG);
+ this.woodFromLogs(Blocks.PALE_OAK_WOOD, Blocks.PALE_OAK_LOG);
this.woodFromLogs(Blocks.JUNGLE_WOOD, Blocks.JUNGLE_LOG);
this.woodFromLogs(Blocks.OAK_WOOD, Blocks.OAK_LOG);
this.woodFromLogs(Blocks.SPRUCE_WOOD, Blocks.SPRUCE_LOG);
@@ -93,6 +95,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.woodFromLogs(Blocks.STRIPPED_ACACIA_WOOD, Blocks.STRIPPED_ACACIA_LOG);
this.woodFromLogs(Blocks.STRIPPED_BIRCH_WOOD, Blocks.STRIPPED_BIRCH_LOG);
this.woodFromLogs(Blocks.STRIPPED_DARK_OAK_WOOD, Blocks.STRIPPED_DARK_OAK_LOG);
+ this.woodFromLogs(Blocks.STRIPPED_PALE_OAK_WOOD, Blocks.STRIPPED_PALE_OAK_LOG);
this.woodFromLogs(Blocks.STRIPPED_JUNGLE_WOOD, Blocks.STRIPPED_JUNGLE_LOG);
this.woodFromLogs(Blocks.STRIPPED_OAK_WOOD, Blocks.STRIPPED_OAK_LOG);
this.woodFromLogs(Blocks.STRIPPED_SPRUCE_WOOD, Blocks.STRIPPED_SPRUCE_LOG);
@@ -102,6 +105,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.woodenBoat(Items.ACACIA_BOAT, Blocks.ACACIA_PLANKS);
this.woodenBoat(Items.BIRCH_BOAT, Blocks.BIRCH_PLANKS);
this.woodenBoat(Items.DARK_OAK_BOAT, Blocks.DARK_OAK_PLANKS);
+ this.woodenBoat(Items.PALE_OAK_BOAT, Blocks.PALE_OAK_PLANKS);
this.woodenBoat(Items.JUNGLE_BOAT, Blocks.JUNGLE_PLANKS);
this.woodenBoat(Items.OAK_BOAT, Blocks.OAK_PLANKS);
this.woodenBoat(Items.SPRUCE_BOAT, Blocks.SPRUCE_PLANKS);
@@ -230,6 +234,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.bedFromPlanksAndWool(Items.YELLOW_BED, Blocks.YELLOW_WOOL);
this.banner(Items.YELLOW_BANNER, Blocks.YELLOW_WOOL);
this.carpet(Blocks.MOSS_CARPET, Blocks.MOSS_BLOCK);
+ this.carpet(Blocks.PALE_MOSS_CARPET, Blocks.PALE_MOSS_BLOCK);
this.stainedGlassFromGlassAndDye(Blocks.BLACK_STAINED_GLASS, Items.BLACK_DYE);
this.stainedGlassPaneFromStainedGlass(Blocks.BLACK_STAINED_GLASS_PANE, Blocks.BLACK_STAINED_GLASS);
this.stainedGlassPaneFromGlassPaneAndDye(Blocks.BLACK_STAINED_GLASS_PANE, Items.BLACK_DYE);
@@ -573,6 +578,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.chestBoat(Items.ACACIA_CHEST_BOAT, Items.ACACIA_BOAT);
this.chestBoat(Items.BIRCH_CHEST_BOAT, Items.BIRCH_BOAT);
this.chestBoat(Items.DARK_OAK_CHEST_BOAT, Items.DARK_OAK_BOAT);
+ this.chestBoat(Items.PALE_OAK_CHEST_BOAT, Items.PALE_OAK_BOAT);
this.chestBoat(Items.JUNGLE_CHEST_BOAT, Items.JUNGLE_BOAT);
this.chestBoat(Items.OAK_CHEST_BOAT, Items.OAK_BOAT);
this.chestBoat(Items.SPRUCE_CHEST_BOAT, Items.SPRUCE_BOAT);
@@ -1352,6 +1358,16 @@ public class VanillaRecipeProvider extends RecipeProvider {
}
});
this.twoByTwoPacker(RecipeCategory.BUILDING_BLOCKS, Blocks.NETHER_BRICKS, Items.NETHER_BRICK);
+ this.twoByTwoPacker(RecipeCategory.BUILDING_BLOCKS, Blocks.RESIN_BRICKS, Items.RESIN_BRICK);
+ this.nineBlockStorageRecipes(RecipeCategory.MISC, Items.RESIN_CLUMP, RecipeCategory.BUILDING_BLOCKS, Items.RESIN_BLOCK);
+ this.shaped(RecipeCategory.MISC, Blocks.CREAKING_HEART)
+ .define('R', Items.RESIN_BLOCK)
+ .define('L', Blocks.PALE_OAK_LOG)
+ .pattern(" L ")
+ .pattern(" R ")
+ .pattern(" L ")
+ .unlockedBy("has_resin_block", this.has(Items.RESIN_BLOCK))
+ .save(this.output);
this.threeByThreePacker(RecipeCategory.BUILDING_BLOCKS, Blocks.NETHER_WART_BLOCK, Items.NETHER_WART);
this.shaped(RecipeCategory.REDSTONE, Blocks.NOTE_BLOCK)
.define('#', ItemTags.PLANKS)
@@ -1530,6 +1546,8 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.oneToOneConversionRecipe(Items.RED_DYE, Items.BEETROOT, "red_dye");
this.oneToOneConversionRecipe(Items.RED_DYE, Blocks.POPPY, "red_dye");
this.oneToOneConversionRecipe(Items.RED_DYE, Blocks.ROSE_BUSH, "red_dye", 2);
+ this.oneToOneConversionRecipe(Items.ORANGE_DYE, Blocks.OPEN_EYEBLOSSOM, "orange_dye");
+ this.oneToOneConversionRecipe(Items.GRAY_DYE, Blocks.CLOSED_EYEBLOSSOM, "gray_dye");
this.shapeless(RecipeCategory.MISC, Items.RED_DYE)
.requires(Blocks.RED_TULIP)
.group("red_dye")
@@ -2175,6 +2193,9 @@ public class VanillaRecipeProvider extends RecipeProvider {
SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.NETHERRACK), RecipeCategory.MISC, Items.NETHER_BRICK, 0.1F, 200)
.unlockedBy("has_netherrack", this.has(Blocks.NETHERRACK))
.save(this.output);
+ SimpleCookingRecipeBuilder.smelting(Ingredient.of(Items.RESIN_CLUMP), RecipeCategory.MISC, Items.RESIN_BRICK, 0.1F, 200)
+ .unlockedBy("has_resin_clump", this.has(Blocks.RESIN_CLUMP))
+ .save(this.output);
SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.NETHER_QUARTZ_ORE), RecipeCategory.MISC, Items.QUARTZ, 0.2F, 200)
.unlockedBy("has_nether_quartz_ore", this.has(Blocks.NETHER_QUARTZ_ORE))
.save(this.output);
@@ -2421,6 +2442,10 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.NETHER_BRICK_STAIRS, Blocks.NETHER_BRICKS);
this.stonecutterResultFromBase(RecipeCategory.DECORATIONS, Blocks.NETHER_BRICK_WALL, Blocks.NETHER_BRICKS);
this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.CHISELED_NETHER_BRICKS, Blocks.NETHER_BRICKS);
+ this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.RESIN_BRICK_SLAB, Blocks.RESIN_BRICKS, 2);
+ this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.RESIN_BRICK_STAIRS, Blocks.RESIN_BRICKS);
+ this.stonecutterResultFromBase(RecipeCategory.DECORATIONS, Blocks.RESIN_BRICK_WALL, Blocks.RESIN_BRICKS);
+ this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.CHISELED_RESIN_BRICKS, Blocks.RESIN_BRICKS);
this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.RED_NETHER_BRICK_SLAB, Blocks.RED_NETHER_BRICKS, 2);
this.stonecutterResultFromBase(RecipeCategory.BUILDING_BLOCKS, Blocks.RED_NETHER_BRICK_STAIRS, Blocks.RED_NETHER_BRICKS);
this.stonecutterResultFromBase(RecipeCategory.DECORATIONS, Blocks.RED_NETHER_BRICK_WALL, Blocks.RED_NETHER_BRICKS);
@@ -2636,6 +2661,7 @@ public class VanillaRecipeProvider extends RecipeProvider {
this.hangingSign(Items.ACACIA_HANGING_SIGN, Blocks.STRIPPED_ACACIA_LOG);
this.hangingSign(Items.CHERRY_HANGING_SIGN, Blocks.STRIPPED_CHERRY_LOG);
this.hangingSign(Items.DARK_OAK_HANGING_SIGN, Blocks.STRIPPED_DARK_OAK_LOG);
+ this.hangingSign(Items.PALE_OAK_HANGING_SIGN, Blocks.STRIPPED_PALE_OAK_LOG);
this.hangingSign(Items.MANGROVE_HANGING_SIGN, Blocks.STRIPPED_MANGROVE_LOG);
this.hangingSign(Items.BAMBOO_HANGING_SIGN, Items.STRIPPED_BAMBOO_BLOCK);
this.hangingSign(Items.CRIMSON_HANGING_SIGN, Blocks.STRIPPED_CRIMSON_STEM);
diff --git a/net/minecraft/data/structures/StructureUpdater.java b/net/minecraft/data/structures/StructureUpdater.java
index 5a2c350..1110ca4 100644
--- a/net/minecraft/data/structures/StructureUpdater.java
+++ b/net/minecraft/data/structures/StructureUpdater.java
@@ -22,9 +22,9 @@ public class StructureUpdater implements SnbtToNbt.Filter {
public static CompoundTag update(String structureLocationPath, CompoundTag tag) {
StructureTemplate structureTemplate = new StructureTemplate();
int dataVersion = NbtUtils.getDataVersion(tag, 500);
- int i = 4053;
- if (dataVersion < 4053) {
- LOGGER.warn("SNBT Too old, do not forget to update: {} < {}: {}", dataVersion, 4053, structureLocationPath);
+ int i = 4173;
+ if (dataVersion < 4173) {
+ LOGGER.warn("SNBT Too old, do not forget to update: {} < {}: {}", dataVersion, 4173, structureLocationPath);
}
CompoundTag compoundTag = DataFixTypes.STRUCTURE.updateToCurrentVersion(DataFixers.getDataFixer(), tag, dataVersion);
diff --git a/net/minecraft/data/tags/BiomeTagsProvider.java b/net/minecraft/data/tags/BiomeTagsProvider.java
index 5eca92f..a6ecfd8 100644
--- a/net/minecraft/data/tags/BiomeTagsProvider.java
+++ b/net/minecraft/data/tags/BiomeTagsProvider.java
@@ -44,6 +44,7 @@ public class BiomeTagsProvider extends TagsProvider<Biome> {
.add(Biomes.BIRCH_FOREST)
.add(Biomes.OLD_GROWTH_BIRCH_FOREST)
.add(Biomes.DARK_FOREST)
+ .add(Biomes.PALE_GARDEN)
.add(Biomes.GROVE);
this.tag(BiomeTags.IS_SAVANNA).add(Biomes.SAVANNA).add(Biomes.SAVANNA_PLATEAU).add(Biomes.WINDSWEPT_SAVANNA);
TagsProvider.TagAppender<Biome> tagAppender = this.tag(BiomeTags.IS_NETHER);
@@ -148,6 +149,7 @@ public class BiomeTagsProvider extends TagsProvider<Biome> {
.add(Biomes.FLOWER_FOREST)
.add(Biomes.BIRCH_FOREST)
.add(Biomes.DARK_FOREST)
+ .add(Biomes.PALE_GARDEN)
.add(Biomes.OLD_GROWTH_BIRCH_FOREST)
.add(Biomes.OLD_GROWTH_PINE_TAIGA)
.add(Biomes.OLD_GROWTH_SPRUCE_TAIGA)
diff --git a/net/minecraft/data/tags/EntityTypeTagsProvider.java b/net/minecraft/data/tags/EntityTypeTagsProvider.java
index dd8cdc9..38e1d2e 100644
--- a/net/minecraft/data/tags/EntityTypeTagsProvider.java
+++ b/net/minecraft/data/tags/EntityTypeTagsProvider.java
@@ -170,6 +170,7 @@ public class EntityTypeTagsProvider extends IntrinsicHolderTagsProvider<EntityTy
EntityType.ACACIA_BOAT,
EntityType.CHERRY_BOAT,
EntityType.DARK_OAK_BOAT,
+ EntityType.PALE_OAK_BOAT,
EntityType.MANGROVE_BOAT,
EntityType.BAMBOO_RAFT
);
diff --git a/net/minecraft/data/tags/VanillaBlockTagsProvider.java b/net/minecraft/data/tags/VanillaBlockTagsProvider.java
index b75d520..e248c6c 100644
--- a/net/minecraft/data/tags/VanillaBlockTagsProvider.java
+++ b/net/minecraft/data/tags/VanillaBlockTagsProvider.java
@@ -42,6 +42,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_PLANKS,
Blocks.ACACIA_PLANKS,
Blocks.DARK_OAK_PLANKS,
+ Blocks.PALE_OAK_PLANKS,
Blocks.CRIMSON_PLANKS,
Blocks.WARPED_PLANKS,
Blocks.MANGROVE_PLANKS,
@@ -57,6 +58,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_BUTTON,
Blocks.ACACIA_BUTTON,
Blocks.DARK_OAK_BUTTON,
+ Blocks.PALE_OAK_BUTTON,
Blocks.CRIMSON_BUTTON,
Blocks.WARPED_BUTTON,
Blocks.MANGROVE_BUTTON,
@@ -92,6 +94,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_DOOR,
Blocks.ACACIA_DOOR,
Blocks.DARK_OAK_DOOR,
+ Blocks.PALE_OAK_DOOR,
Blocks.CRIMSON_DOOR,
Blocks.WARPED_DOOR,
Blocks.MANGROVE_DOOR,
@@ -118,6 +121,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_STAIRS,
Blocks.ACACIA_STAIRS,
Blocks.DARK_OAK_STAIRS,
+ Blocks.PALE_OAK_STAIRS,
Blocks.CRIMSON_STAIRS,
Blocks.WARPED_STAIRS,
Blocks.MANGROVE_STAIRS,
@@ -132,6 +136,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_SLAB,
Blocks.ACACIA_SLAB,
Blocks.DARK_OAK_SLAB,
+ Blocks.PALE_OAK_SLAB,
Blocks.CRIMSON_SLAB,
Blocks.WARPED_SLAB,
Blocks.MANGROVE_SLAB,
@@ -143,6 +148,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.OAK_FENCE,
Blocks.ACACIA_FENCE,
Blocks.DARK_OAK_FENCE,
+ Blocks.PALE_OAK_FENCE,
Blocks.SPRUCE_FENCE,
Blocks.BIRCH_FENCE,
Blocks.JUNGLE_FENCE,
@@ -173,6 +179,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_SAPLING,
Blocks.ACACIA_SAPLING,
Blocks.DARK_OAK_SAPLING,
+ Blocks.PALE_OAK_SAPLING,
Blocks.AZALEA,
Blocks.FLOWERING_AZALEA,
Blocks.MANGROVE_PROPAGULE,
@@ -180,6 +187,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
);
this.tag(BlockTags.BAMBOO_BLOCKS).add(Blocks.BAMBOO_BLOCK, Blocks.STRIPPED_BAMBOO_BLOCK);
this.tag(BlockTags.DARK_OAK_LOGS).add(Blocks.DARK_OAK_LOG, Blocks.DARK_OAK_WOOD, Blocks.STRIPPED_DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_WOOD);
+ this.tag(BlockTags.PALE_OAK_LOGS).add(Blocks.PALE_OAK_LOG, Blocks.PALE_OAK_WOOD, Blocks.STRIPPED_PALE_OAK_LOG, Blocks.STRIPPED_PALE_OAK_WOOD);
this.tag(BlockTags.OAK_LOGS).add(Blocks.OAK_LOG, Blocks.OAK_WOOD, Blocks.STRIPPED_OAK_LOG, Blocks.STRIPPED_OAK_WOOD);
this.tag(BlockTags.ACACIA_LOGS).add(Blocks.ACACIA_LOG, Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_LOG, Blocks.STRIPPED_ACACIA_WOOD);
this.tag(BlockTags.BIRCH_LOGS).add(Blocks.BIRCH_LOG, Blocks.BIRCH_WOOD, Blocks.STRIPPED_BIRCH_LOG, Blocks.STRIPPED_BIRCH_WOOD);
@@ -191,6 +199,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
this.tag(BlockTags.CHERRY_LOGS).add(Blocks.CHERRY_LOG, Blocks.CHERRY_WOOD, Blocks.STRIPPED_CHERRY_LOG, Blocks.STRIPPED_CHERRY_WOOD);
this.tag(BlockTags.LOGS_THAT_BURN)
.addTag(BlockTags.DARK_OAK_LOGS)
+ .addTag(BlockTags.PALE_OAK_LOGS)
.addTag(BlockTags.OAK_LOGS)
.addTag(BlockTags.ACACIA_LOGS)
.addTag(BlockTags.BIRCH_LOGS)
@@ -205,6 +214,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
.add(Blocks.JUNGLE_LOG)
.add(Blocks.SPRUCE_LOG)
.add(Blocks.DARK_OAK_LOG)
+ .add(Blocks.PALE_OAK_LOG)
.add(Blocks.MANGROVE_LOG)
.add(Blocks.CHERRY_LOG);
this.tag(BlockTags.LOGS).addTag(BlockTags.LOGS_THAT_BURN).addTag(BlockTags.CRIMSON_STEMS).addTag(BlockTags.WARPED_STEMS);
@@ -212,6 +222,8 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
this.tag(BlockTags.SMALL_FLOWERS)
.add(
Blocks.DANDELION,
+ Blocks.OPEN_EYEBLOSSOM,
+ Blocks.CLOSED_EYEBLOSSOM,
Blocks.POPPY,
Blocks.BLUE_ORCHID,
Blocks.ALLIUM,
@@ -235,6 +247,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.MYCELIUM,
Blocks.ROOTED_DIRT,
Blocks.MOSS_BLOCK,
+ Blocks.PALE_MOSS_BLOCK,
Blocks.MUD,
Blocks.MUDDY_MANGROVE_ROOTS
);
@@ -263,6 +276,8 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
this.tag(BlockTags.FLOWER_POTS)
.add(
Blocks.FLOWER_POT,
+ Blocks.POTTED_OPEN_EYEBLOSSOM,
+ Blocks.POTTED_CLOSED_EYEBLOSSOM,
Blocks.POTTED_POPPY,
Blocks.POTTED_BLUE_ORCHID,
Blocks.POTTED_ALLIUM,
@@ -279,6 +294,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.POTTED_JUNGLE_SAPLING,
Blocks.POTTED_ACACIA_SAPLING,
Blocks.POTTED_DARK_OAK_SAPLING,
+ Blocks.POTTED_PALE_OAK_SAPLING,
Blocks.POTTED_RED_MUSHROOM,
Blocks.POTTED_BROWN_MUSHROOM,
Blocks.POTTED_DEAD_BUSH,
@@ -341,6 +357,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_PRESSURE_PLATE,
Blocks.ACACIA_PRESSURE_PLATE,
Blocks.DARK_OAK_PRESSURE_PLATE,
+ Blocks.PALE_OAK_PRESSURE_PLATE,
Blocks.CRIMSON_PRESSURE_PLATE,
Blocks.WARPED_PRESSURE_PLATE,
Blocks.MANGROVE_PRESSURE_PLATE,
@@ -480,7 +497,8 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.MUD_BRICK_WALL,
Blocks.TUFF_WALL,
Blocks.POLISHED_TUFF_WALL,
- Blocks.TUFF_BRICK_WALL
+ Blocks.TUFF_BRICK_WALL,
+ Blocks.RESIN_BRICK_WALL
);
this.tag(BlockTags.CORAL_PLANTS).add(Blocks.TUBE_CORAL, Blocks.BRAIN_CORAL, Blocks.BUBBLE_CORAL, Blocks.FIRE_CORAL, Blocks.HORN_CORAL);
this.tag(BlockTags.CORALS)
@@ -500,6 +518,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_LEAVES,
Blocks.OAK_LEAVES,
Blocks.SPRUCE_LEAVES,
+ Blocks.PALE_OAK_LEAVES,
Blocks.DARK_OAK_LEAVES,
Blocks.ACACIA_LEAVES,
Blocks.BIRCH_LEAVES,
@@ -534,6 +553,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.ACACIA_TRAPDOOR,
Blocks.BIRCH_TRAPDOOR,
Blocks.DARK_OAK_TRAPDOOR,
+ Blocks.PALE_OAK_TRAPDOOR,
Blocks.JUNGLE_TRAPDOOR,
Blocks.OAK_TRAPDOOR,
Blocks.SPRUCE_TRAPDOOR,
@@ -569,6 +589,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.ACACIA_SIGN,
Blocks.JUNGLE_SIGN,
Blocks.DARK_OAK_SIGN,
+ Blocks.PALE_OAK_SIGN,
Blocks.CRIMSON_SIGN,
Blocks.WARPED_SIGN,
Blocks.MANGROVE_SIGN,
@@ -583,6 +604,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.ACACIA_WALL_SIGN,
Blocks.JUNGLE_WALL_SIGN,
Blocks.DARK_OAK_WALL_SIGN,
+ Blocks.PALE_OAK_WALL_SIGN,
Blocks.CRIMSON_WALL_SIGN,
Blocks.WARPED_WALL_SIGN,
Blocks.MANGROVE_WALL_SIGN,
@@ -599,6 +621,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.CHERRY_HANGING_SIGN,
Blocks.JUNGLE_HANGING_SIGN,
Blocks.DARK_OAK_HANGING_SIGN,
+ Blocks.PALE_OAK_HANGING_SIGN,
Blocks.CRIMSON_HANGING_SIGN,
Blocks.WARPED_HANGING_SIGN,
Blocks.MANGROVE_HANGING_SIGN,
@@ -613,6 +636,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.CHERRY_WALL_HANGING_SIGN,
Blocks.JUNGLE_WALL_HANGING_SIGN,
Blocks.DARK_OAK_WALL_HANGING_SIGN,
+ Blocks.PALE_OAK_WALL_HANGING_SIGN,
Blocks.CRIMSON_WALL_HANGING_SIGN,
Blocks.WARPED_WALL_HANGING_SIGN,
Blocks.MANGROVE_WALL_HANGING_SIGN,
@@ -776,6 +800,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.ACACIA_FENCE_GATE,
Blocks.BIRCH_FENCE_GATE,
Blocks.DARK_OAK_FENCE_GATE,
+ Blocks.PALE_OAK_FENCE_GATE,
Blocks.JUNGLE_FENCE_GATE,
Blocks.OAK_FENCE_GATE,
Blocks.SPRUCE_FENCE_GATE,
@@ -807,6 +832,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
.addTag(BlockTags.TERRACOTTA)
.addTag(BlockTags.IRON_ORES)
.addTag(BlockTags.COPPER_ORES)
+ .addTag(BlockTags.SNOW)
.add(
Blocks.WATER,
Blocks.GRAVEL,
@@ -814,7 +840,6 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.SANDSTONE,
Blocks.RED_SANDSTONE,
Blocks.CALCITE,
- Blocks.SNOW,
Blocks.PACKED_ICE,
Blocks.RAW_IRON_BLOCK,
Blocks.RAW_COPPER_BLOCK
@@ -872,7 +897,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
.add(Blocks.POWDER_SNOW, Blocks.SCULK_VEIN, Blocks.GLOW_LICHEN, Blocks.LILY_PAD, Blocks.SMALL_AMETHYST_BUD, Blocks.PINK_PETALS);
this.tag(BlockTags.COMBINATION_STEP_SOUND_BLOCKS)
.addTag(BlockTags.WOOL_CARPETS)
- .add(Blocks.MOSS_CARPET, Blocks.SNOW, Blocks.NETHER_SPROUTS, Blocks.WARPED_ROOTS, Blocks.CRIMSON_ROOTS);
+ .add(Blocks.MOSS_CARPET, Blocks.PALE_MOSS_CARPET, Blocks.SNOW, Blocks.NETHER_SPROUTS, Blocks.WARPED_ROOTS, Blocks.CRIMSON_ROOTS, Blocks.RESIN_CLUMP);
this.tag(BlockTags.DRIPSTONE_REPLACEABLE).addTag(BlockTags.BASE_STONE_OVERWORLD);
this.tag(BlockTags.CAVE_VINES).add(Blocks.CAVE_VINES_PLANT).add(Blocks.CAVE_VINES);
this.tag(BlockTags.MOSS_REPLACEABLE).addTag(BlockTags.BASE_STONE_OVERWORLD).addTag(BlockTags.CAVE_VINES).addTag(BlockTags.DIRT);
@@ -978,7 +1003,8 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
.addTag(BlockTags.ALL_HANGING_SIGNS)
.add(Blocks.BAMBOO_MOSAIC, Blocks.BAMBOO_MOSAIC_SLAB, Blocks.BAMBOO_MOSAIC_STAIRS)
.addTag(BlockTags.BAMBOO_BLOCKS)
- .add(Blocks.CHISELED_BOOKSHELF);
+ .add(Blocks.CHISELED_BOOKSHELF)
+ .add(Blocks.CREAKING_HEART);
this.tag(BlockTags.MINEABLE_WITH_HOE)
.add(
Blocks.NETHER_WART_BLOCK,
@@ -992,6 +1018,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.JUNGLE_LEAVES,
Blocks.OAK_LEAVES,
Blocks.SPRUCE_LEAVES,
+ Blocks.PALE_OAK_LEAVES,
Blocks.DARK_OAK_LEAVES,
Blocks.ACACIA_LEAVES,
Blocks.BIRCH_LEAVES,
@@ -1002,6 +1029,8 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.CALIBRATED_SCULK_SENSOR,
Blocks.MOSS_BLOCK,
Blocks.MOSS_CARPET,
+ Blocks.PALE_MOSS_BLOCK,
+ Blocks.PALE_MOSS_CARPET,
Blocks.SCULK,
Blocks.SCULK_CATALYST,
Blocks.SCULK_VEIN,
@@ -1028,6 +1057,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.NETHER_GOLD_ORE,
Blocks.LAPIS_ORE,
Blocks.DEEPSLATE_LAPIS_ORE,
+ Blocks.RESIN_BRICKS,
Blocks.LAPIS_BLOCK,
Blocks.DISPENSER,
Blocks.SANDSTONE,
@@ -1396,7 +1426,12 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.WAXED_EXPOSED_COPPER_TRAPDOOR,
Blocks.WAXED_WEATHERED_COPPER_TRAPDOOR,
Blocks.WAXED_OXIDIZED_COPPER_TRAPDOOR,
- Blocks.HEAVY_CORE
+ Blocks.HEAVY_CORE,
+ Blocks.RESIN_BRICKS,
+ Blocks.RESIN_BRICK_SLAB,
+ Blocks.RESIN_BRICK_WALL,
+ Blocks.RESIN_BRICK_STAIRS,
+ Blocks.CHISELED_RESIN_BRICKS
);
this.tag(BlockTags.MINEABLE_WITH_SHOVEL)
.add(
@@ -1459,7 +1494,6 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.CAVE_VINES,
Blocks.CAVE_VINES_PLANT,
Blocks.SPORE_BLOSSOM,
- Blocks.MOSS_CARPET,
Blocks.PINK_PETALS,
Blocks.BIG_DRIPLEAF,
Blocks.BIG_DRIPLEAF_STEM,
@@ -1572,15 +1606,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.WAXED_COPPER_TRAPDOOR,
Blocks.WAXED_EXPOSED_COPPER_TRAPDOOR,
Blocks.WAXED_WEATHERED_COPPER_TRAPDOOR,
- Blocks.WAXED_OXIDIZED_COPPER_TRAPDOOR,
- Blocks.COPPER_DOOR,
- Blocks.EXPOSED_COPPER_DOOR,
- Blocks.WEATHERED_COPPER_DOOR,
- Blocks.OXIDIZED_COPPER_DOOR,
- Blocks.WAXED_COPPER_DOOR,
- Blocks.WAXED_EXPOSED_COPPER_DOOR,
- Blocks.WAXED_WEATHERED_COPPER_DOOR,
- Blocks.WAXED_OXIDIZED_COPPER_DOOR
+ Blocks.WAXED_OXIDIZED_COPPER_TRAPDOOR
);
this.tag(BlockTags.INCORRECT_FOR_NETHERITE_TOOL);
this.tag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL);
@@ -1760,6 +1786,7 @@ public class VanillaBlockTagsProvider extends IntrinsicHolderTagsProvider<Block>
Blocks.COARSE_DIRT,
Blocks.ROOTED_DIRT,
Blocks.MOSS_BLOCK,
+ Blocks.PALE_MOSS_BLOCK,
Blocks.MUD,
Blocks.MUDDY_MANGROVE_ROOTS
);
diff --git a/net/minecraft/data/tags/VanillaItemTagsProvider.java b/net/minecraft/data/tags/VanillaItemTagsProvider.java
index 03f2a99..7c7a1b4 100644
--- a/net/minecraft/data/tags/VanillaItemTagsProvider.java
+++ b/net/minecraft/data/tags/VanillaItemTagsProvider.java
@@ -35,6 +35,7 @@ public class VanillaItemTagsProvider extends ItemTagsProvider {
this.copy(BlockTags.BAMBOO_BLOCKS, ItemTags.BAMBOO_BLOCKS);
this.copy(BlockTags.OAK_LOGS, ItemTags.OAK_LOGS);
this.copy(BlockTags.DARK_OAK_LOGS, ItemTags.DARK_OAK_LOGS);
+ this.copy(BlockTags.PALE_OAK_LOGS, ItemTags.PALE_OAK_LOGS);
this.copy(BlockTags.BIRCH_LOGS, ItemTags.BIRCH_LOGS);
this.copy(BlockTags.ACACIA_LOGS, ItemTags.ACACIA_LOGS);
this.copy(BlockTags.SPRUCE_LOGS, ItemTags.SPRUCE_LOGS);
@@ -103,6 +104,7 @@ public class VanillaItemTagsProvider extends ItemTagsProvider {
Items.JUNGLE_BOAT,
Items.ACACIA_BOAT,
Items.DARK_OAK_BOAT,
+ Items.PALE_OAK_BOAT,
Items.MANGROVE_BOAT,
Items.BAMBOO_RAFT,
Items.CHERRY_BOAT
@@ -136,6 +138,7 @@ public class VanillaItemTagsProvider extends ItemTagsProvider {
Items.JUNGLE_CHEST_BOAT,
Items.ACACIA_CHEST_BOAT,
Items.DARK_OAK_CHEST_BOAT,
+ Items.PALE_OAK_CHEST_BOAT,
Items.MANGROVE_CHEST_BOAT,
Items.BAMBOO_CHEST_RAFT,
Items.CHERRY_CHEST_BOAT
@@ -364,7 +367,8 @@ public class VanillaItemTagsProvider extends ItemTagsProvider {
.add(Items.NETHERITE_INGOT)
.add(Items.REDSTONE)
.add(Items.QUARTZ)
- .add(Items.AMETHYST_SHARD);
+ .add(Items.AMETHYST_SHARD)
+ .add(Items.RESIN_CLUMP);
this.tag(ItemTags.TRIM_TEMPLATES)
.add(Items.WARD_ARMOR_TRIM_SMITHING_TEMPLATE)
.add(Items.SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE)
diff --git a/net/minecraft/data/worldgen/biome/BiomeData.java b/net/minecraft/data/worldgen/biome/BiomeData.java
index d088a55..74febb7 100644
--- a/net/minecraft/data/worldgen/biome/BiomeData.java
+++ b/net/minecraft/data/worldgen/biome/BiomeData.java
@@ -24,6 +24,7 @@ public abstract class BiomeData {
context.register(Biomes.FLOWER_FOREST, OverworldBiomes.forest(holderGetter, holderGetter1, false, false, true));
context.register(Biomes.BIRCH_FOREST, OverworldBiomes.forest(holderGetter, holderGetter1, true, false, false));
context.register(Biomes.DARK_FOREST, OverworldBiomes.darkForest(holderGetter, holderGetter1, false));
+ context.register(Biomes.PALE_GARDEN, OverworldBiomes.darkForest(holderGetter, holderGetter1, true));
context.register(Biomes.OLD_GROWTH_BIRCH_FOREST, OverworldBiomes.forest(holderGetter, holderGetter1, true, true, false));
context.register(Biomes.OLD_GROWTH_PINE_TAIGA, OverworldBiomes.oldGrowthTaiga(holderGetter, holderGetter1, false));
context.register(Biomes.OLD_GROWTH_SPRUCE_TAIGA, OverworldBiomes.oldGrowthTaiga(holderGetter, holderGetter1, true));
diff --git a/net/minecraft/data/worldgen/biome/OverworldBiomes.java b/net/minecraft/data/worldgen/biome/OverworldBiomes.java
index b5c864b..1ca6e38 100644
--- a/net/minecraft/data/worldgen/biome/OverworldBiomes.java
+++ b/net/minecraft/data/worldgen/biome/OverworldBiomes.java
@@ -573,12 +573,17 @@ public class OverworldBiomes {
);
if (!flag) {
BiomeDefaultFeatures.addForestFlowers(builder1);
+ } else {
+ builder1.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, VegetationPlacements.PALE_MOSS_PATCH);
+ builder1.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, VegetationPlacements.PALE_GARDEN_FLOWERS);
}
BiomeDefaultFeatures.addDefaultOres(builder1);
BiomeDefaultFeatures.addDefaultSoftDisks(builder1);
if (!flag) {
BiomeDefaultFeatures.addDefaultFlowers(builder1);
+ } else {
+ builder1.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, VegetationPlacements.FLOWER_PALE_GARDEN);
}
BiomeDefaultFeatures.addForestGrass(builder1);
@@ -587,7 +592,6 @@ public class OverworldBiomes {
}
BiomeDefaultFeatures.addDefaultExtraVegetation(builder1);
- Music music = Musics.createGameMusic(SoundEvents.MUSIC_BIOME_FOREST);
return new Biome.BiomeBuilder()
.hasPrecipitation(true)
.temperature(0.7F)
@@ -602,7 +606,7 @@ public class OverworldBiomes {
.grassColorOverride(7832178)
.foliageColorOverride(8883574)
.ambientMoodSound(AmbientMoodSettings.LEGACY_CAVE_SETTINGS)
- .backgroundMusic(music)
+ .silenceAllBackgroundMusic()
.build()
: new BiomeSpecialEffects.Builder()
.waterColor(4159204)
@@ -611,7 +615,7 @@ public class OverworldBiomes {
.skyColor(calculateSkyColor(0.7F))
.grassColorModifier(BiomeSpecialEffects.GrassColorModifier.DARK_FOREST)
.ambientMoodSound(AmbientMoodSettings.LEGACY_CAVE_SETTINGS)
- .backgroundMusic(music)
+ .backgroundMusic(Musics.createGameMusic(SoundEvents.MUSIC_BIOME_FOREST))
.build()
)
.mobSpawnSettings(builder.build())
diff --git a/net/minecraft/data/worldgen/features/CaveFeatures.java b/net/minecraft/data/worldgen/features/CaveFeatures.java
index 454f435..d2a072d 100644
--- a/net/minecraft/data/worldgen/features/CaveFeatures.java
+++ b/net/minecraft/data/worldgen/features/CaveFeatures.java
@@ -23,7 +23,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CaveVines;
import net.minecraft.world.level.block.CaveVinesBlock;
-import net.minecraft.world.level.block.MultifaceBlock;
+import net.minecraft.world.level.block.MultifaceSpreadeableBlock;
import net.minecraft.world.level.block.SmallDripleafBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@@ -210,13 +210,13 @@ public class CaveFeatures {
)
);
FeatureUtils.register(context, UNDERWATER_MAGMA, Feature.UNDERWATER_MAGMA, new UnderwaterMagmaConfiguration(5, 1, 0.5F));
- MultifaceBlock multifaceBlock = (MultifaceBlock)Blocks.GLOW_LICHEN;
+ MultifaceSpreadeableBlock multifaceSpreadeableBlock = (MultifaceSpreadeableBlock)Blocks.GLOW_LICHEN;
FeatureUtils.register(
context,
GLOW_LICHEN,
Feature.MULTIFACE_GROWTH,
new MultifaceGrowthConfiguration(
- multifaceBlock,
+ multifaceSpreadeableBlock,
20,
false,
true,
@@ -475,13 +475,13 @@ public class CaveFeatures {
);
FeatureUtils.register(context, SCULK_PATCH_DEEP_DARK, Feature.SCULK_PATCH, new SculkPatchConfiguration(10, 32, 64, 0, 1, ConstantInt.of(0), 0.5F));
FeatureUtils.register(context, SCULK_PATCH_ANCIENT_CITY, Feature.SCULK_PATCH, new SculkPatchConfiguration(10, 32, 64, 0, 1, UniformInt.of(1, 3), 0.5F));
- MultifaceBlock multifaceBlock1 = (MultifaceBlock)Blocks.SCULK_VEIN;
+ MultifaceSpreadeableBlock multifaceSpreadeableBlock1 = (MultifaceSpreadeableBlock)Blocks.SCULK_VEIN;
FeatureUtils.register(
context,
SCULK_VEIN,
Feature.MULTIFACE_GROWTH,
new MultifaceGrowthConfiguration(
- multifaceBlock1,
+ multifaceSpreadeableBlock1,
20,
true,
true,
diff --git a/net/minecraft/data/worldgen/features/TreeFeatures.java b/net/minecraft/data/worldgen/features/TreeFeatures.java
index 7101581..d09ff86 100644
--- a/net/minecraft/data/worldgen/features/TreeFeatures.java
+++ b/net/minecraft/data/worldgen/features/TreeFeatures.java
@@ -74,6 +74,7 @@ public class TreeFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> OAK = FeatureUtils.createKey("oak");
public static final ResourceKey<ConfiguredFeature<?, ?>> DARK_OAK = FeatureUtils.createKey("dark_oak");
public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_OAK = FeatureUtils.createKey("pale_oak");
+ public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_OAK_BONEMEAL = FeatureUtils.createKey("pale_oak_bonemeal");
public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_OAK_CREAKING = FeatureUtils.createKey("pale_oak_creaking");
public static final ResourceKey<ConfiguredFeature<?, ?>> BIRCH = FeatureUtils.createKey("birch");
public static final ResourceKey<ConfiguredFeature<?, ?>> ACACIA = FeatureUtils.createKey("acacia");
@@ -349,6 +350,20 @@ public class TreeFeatures {
.ignoreVines()
.build()
);
+ FeatureUtils.register(
+ context,
+ PALE_OAK_BONEMEAL,
+ Feature.TREE,
+ new TreeConfiguration.TreeConfigurationBuilder(
+ BlockStateProvider.simple(Blocks.PALE_OAK_LOG),
+ new DarkOakTrunkPlacer(6, 2, 1),
+ BlockStateProvider.simple(Blocks.PALE_OAK_LEAVES),
+ new DarkOakFoliagePlacer(ConstantInt.of(0), ConstantInt.of(0)),
+ new ThreeLayersFeatureSize(1, 1, 0, 1, 2, OptionalInt.empty())
+ )
+ .ignoreVines()
+ .build()
+ );
FeatureUtils.register(
context,
PALE_OAK_CREAKING,
diff --git a/net/minecraft/data/worldgen/features/VegetationFeatures.java b/net/minecraft/data/worldgen/features/VegetationFeatures.java
index de5f151..e4ae6a5 100644
--- a/net/minecraft/data/worldgen/features/VegetationFeatures.java
+++ b/net/minecraft/data/worldgen/features/VegetationFeatures.java
@@ -70,10 +70,13 @@ public class VegetationFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_PLAIN = FeatureUtils.createKey("flower_plain");
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_MEADOW = FeatureUtils.createKey("flower_meadow");
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_CHERRY = FeatureUtils.createKey("flower_cherry");
+ public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_PALE_GARDEN = FeatureUtils.createKey("flower_pale_garden");
public static final ResourceKey<ConfiguredFeature<?, ?>> FOREST_FLOWERS = FeatureUtils.createKey("forest_flowers");
+ public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_FOREST_FLOWERS = FeatureUtils.createKey("pale_forest_flowers");
public static final ResourceKey<ConfiguredFeature<?, ?>> DARK_FOREST_VEGETATION = FeatureUtils.createKey("dark_forest_vegetation");
public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_GARDEN_VEGETATION = FeatureUtils.createKey("pale_garden_vegetation");
public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_MOSS_VEGETATION = FeatureUtils.createKey("pale_moss_vegetation");
+ public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_MOSS_PATCH = FeatureUtils.createKey("pale_moss_patch");
public static final ResourceKey<ConfiguredFeature<?, ?>> PALE_MOSS_PATCH_BONEMEAL = FeatureUtils.createKey("pale_moss_patch_bonemeal");
public static final ResourceKey<ConfiguredFeature<?, ?>> TREES_FLOWER_FOREST = FeatureUtils.createKey("trees_flower_forest");
public static final ResourceKey<ConfiguredFeature<?, ?>> MEADOW_TREES = FeatureUtils.createKey("meadow_trees");
@@ -435,6 +438,17 @@ public class VegetationFeatures {
96, 6, 2, PlacementUtils.onlyWhenEmpty(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(new WeightedStateProvider(builder)))
)
);
+ FeatureUtils.register(
+ context,
+ FLOWER_PALE_GARDEN,
+ Feature.FLOWER,
+ new RandomPatchConfiguration(
+ 1,
+ 0,
+ 0,
+ PlacementUtils.onlyWhenEmpty(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(Blocks.CLOSED_EYEBLOSSOM), true))
+ )
+ );
FeatureUtils.register(
context,
FOREST_FLOWERS,
@@ -462,6 +476,12 @@ public class VegetationFeatures {
)
)
);
+ FeatureUtils.register(
+ context,
+ PALE_FOREST_FLOWERS,
+ Feature.RANDOM_PATCH,
+ FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(Blocks.CLOSED_EYEBLOSSOM), true))
+ );
FeatureUtils.register(
context,
DARK_FOREST_VEGETATION,
@@ -481,7 +501,7 @@ public class VegetationFeatures {
context,
PALE_GARDEN_VEGETATION,
Feature.RANDOM_SELECTOR,
- new RandomFeatureConfiguration(List.of(new WeightedPlacedFeature(orThrow7, 0.2F), new WeightedPlacedFeature(orThrow6, 0.8F)), orThrow6)
+ new RandomFeatureConfiguration(List.of(new WeightedPlacedFeature(orThrow7, 0.1F), new WeightedPlacedFeature(orThrow6, 0.9F)), orThrow6)
);
FeatureUtils.register(
context,
@@ -491,11 +511,28 @@ public class VegetationFeatures {
new WeightedStateProvider(
SimpleWeightedRandomList.<BlockState>builder()
.add(Blocks.PALE_MOSS_CARPET.defaultBlockState(), 25)
- .add(Blocks.SHORT_GRASS.defaultBlockState(), 50)
+ .add(Blocks.SHORT_GRASS.defaultBlockState(), 25)
.add(Blocks.TALL_GRASS.defaultBlockState(), 10)
)
)
);
+ FeatureUtils.register(
+ context,
+ PALE_MOSS_PATCH,
+ Feature.VEGETATION_PATCH,
+ new VegetationPatchConfiguration(
+ BlockTags.MOSS_REPLACEABLE,
+ BlockStateProvider.simple(Blocks.PALE_MOSS_BLOCK),
+ PlacementUtils.inlinePlaced(holderGetter.getOrThrow(PALE_MOSS_VEGETATION)),
+ CaveSurface.FLOOR,
+ ConstantInt.of(1),
+ 0.0F,
+ 5,
+ 0.3F,
+ UniformInt.of(2, 4),
+ 0.75F
+ )
+ );
FeatureUtils.register(
context,
PALE_MOSS_PATCH_BONEMEAL,
diff --git a/net/minecraft/data/worldgen/placement/PlacementUtils.java b/net/minecraft/data/worldgen/placement/PlacementUtils.java
index 0ba01d9..21fbc10 100644
--- a/net/minecraft/data/worldgen/placement/PlacementUtils.java
+++ b/net/minecraft/data/worldgen/placement/PlacementUtils.java
@@ -28,6 +28,7 @@ import net.minecraft.world.level.levelgen.placement.PlacementModifier;
public class PlacementUtils {
public static final PlacementModifier HEIGHTMAP = HeightmapPlacement.onHeightmap(Heightmap.Types.MOTION_BLOCKING);
+ public static final PlacementModifier HEIGHTMAP_NO_LEAVES = HeightmapPlacement.onHeightmap(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES);
public static final PlacementModifier HEIGHTMAP_TOP_SOLID = HeightmapPlacement.onHeightmap(Heightmap.Types.OCEAN_FLOOR_WG);
public static final PlacementModifier HEIGHTMAP_WORLD_SURFACE = HeightmapPlacement.onHeightmap(Heightmap.Types.WORLD_SURFACE_WG);
public static final PlacementModifier HEIGHTMAP_OCEAN_FLOOR = HeightmapPlacement.onHeightmap(Heightmap.Types.OCEAN_FLOOR);
diff --git a/net/minecraft/data/worldgen/placement/VegetationPlacements.java b/net/minecraft/data/worldgen/placement/VegetationPlacements.java
index d91a44d..edf69ba 100644
--- a/net/minecraft/data/worldgen/placement/VegetationPlacements.java
+++ b/net/minecraft/data/worldgen/placement/VegetationPlacements.java
@@ -80,11 +80,14 @@ public class VegetationPlacements {
public static final ResourceKey<PlacedFeature> FLOWER_PLAINS = PlacementUtils.createKey("flower_plains");
public static final ResourceKey<PlacedFeature> FLOWER_MEADOW = PlacementUtils.createKey("flower_meadow");
public static final ResourceKey<PlacedFeature> FLOWER_CHERRY = PlacementUtils.createKey("flower_cherry");
+ public static final ResourceKey<PlacedFeature> FLOWER_PALE_GARDEN = PlacementUtils.createKey("flower_pale_garden");
public static final ResourceKey<PlacedFeature> TREES_PLAINS = PlacementUtils.createKey("trees_plains");
public static final ResourceKey<PlacedFeature> DARK_FOREST_VEGETATION = PlacementUtils.createKey("dark_forest_vegetation");
public static final ResourceKey<PlacedFeature> PALE_GARDEN_VEGETATION = PlacementUtils.createKey("pale_garden_vegetation");
public static final ResourceKey<PlacedFeature> FLOWER_FOREST_FLOWERS = PlacementUtils.createKey("flower_forest_flowers");
public static final ResourceKey<PlacedFeature> FOREST_FLOWERS = PlacementUtils.createKey("forest_flowers");
+ public static final ResourceKey<PlacedFeature> PALE_GARDEN_FLOWERS = PlacementUtils.createKey("pale_garden_flowers");
+ public static final ResourceKey<PlacedFeature> PALE_MOSS_PATCH = PlacementUtils.createKey("pale_moss_patch");
public static final ResourceKey<PlacedFeature> TREES_FLOWER_FOREST = PlacementUtils.createKey("trees_flower_forest");
public static final ResourceKey<PlacedFeature> TREES_MEADOW = PlacementUtils.createKey("trees_meadow");
public static final ResourceKey<PlacedFeature> TREES_CHERRY = PlacementUtils.createKey("trees_cherry");
@@ -176,31 +179,34 @@ public class VegetationPlacements {
Holder<ConfiguredFeature<?, ?>> orThrow22 = holderGetter.getOrThrow(VegetationFeatures.FLOWER_PLAIN);
Holder<ConfiguredFeature<?, ?>> orThrow23 = holderGetter.getOrThrow(VegetationFeatures.FLOWER_MEADOW);
Holder<ConfiguredFeature<?, ?>> orThrow24 = holderGetter.getOrThrow(VegetationFeatures.FLOWER_CHERRY);
- Holder<ConfiguredFeature<?, ?>> orThrow25 = holderGetter.getOrThrow(VegetationFeatures.TREES_PLAINS);
- Holder<ConfiguredFeature<?, ?>> orThrow26 = holderGetter.getOrThrow(VegetationFeatures.DARK_FOREST_VEGETATION);
- Holder<ConfiguredFeature<?, ?>> orThrow27 = holderGetter.getOrThrow(VegetationFeatures.PALE_GARDEN_VEGETATION);
- Holder<ConfiguredFeature<?, ?>> orThrow28 = holderGetter.getOrThrow(VegetationFeatures.FOREST_FLOWERS);
- Holder<ConfiguredFeature<?, ?>> orThrow29 = holderGetter.getOrThrow(VegetationFeatures.TREES_FLOWER_FOREST);
- Holder<ConfiguredFeature<?, ?>> orThrow30 = holderGetter.getOrThrow(VegetationFeatures.MEADOW_TREES);
- Holder<ConfiguredFeature<?, ?>> orThrow31 = holderGetter.getOrThrow(VegetationFeatures.TREES_TAIGA);
- Holder<ConfiguredFeature<?, ?>> orThrow32 = holderGetter.getOrThrow(VegetationFeatures.TREES_GROVE);
- Holder<ConfiguredFeature<?, ?>> orThrow33 = holderGetter.getOrThrow(TreeFeatures.OAK);
- Holder<ConfiguredFeature<?, ?>> orThrow34 = holderGetter.getOrThrow(TreeFeatures.SPRUCE);
- Holder<ConfiguredFeature<?, ?>> orThrow35 = holderGetter.getOrThrow(TreeFeatures.CHERRY_BEES_005);
- Holder<ConfiguredFeature<?, ?>> orThrow36 = holderGetter.getOrThrow(TreeFeatures.SWAMP_OAK);
- Holder<ConfiguredFeature<?, ?>> orThrow37 = holderGetter.getOrThrow(VegetationFeatures.TREES_SAVANNA);
- Holder<ConfiguredFeature<?, ?>> orThrow38 = holderGetter.getOrThrow(VegetationFeatures.BIRCH_TALL);
- Holder<ConfiguredFeature<?, ?>> orThrow39 = holderGetter.getOrThrow(TreeFeatures.BIRCH_BEES_0002);
- Holder<ConfiguredFeature<?, ?>> orThrow40 = holderGetter.getOrThrow(VegetationFeatures.TREES_WINDSWEPT_HILLS);
- Holder<ConfiguredFeature<?, ?>> orThrow41 = holderGetter.getOrThrow(VegetationFeatures.TREES_WATER);
- Holder<ConfiguredFeature<?, ?>> orThrow42 = holderGetter.getOrThrow(VegetationFeatures.TREES_BIRCH_AND_OAK);
- Holder<ConfiguredFeature<?, ?>> orThrow43 = holderGetter.getOrThrow(VegetationFeatures.TREES_SPARSE_JUNGLE);
- Holder<ConfiguredFeature<?, ?>> orThrow44 = holderGetter.getOrThrow(VegetationFeatures.TREES_OLD_GROWTH_SPRUCE_TAIGA);
- Holder<ConfiguredFeature<?, ?>> orThrow45 = holderGetter.getOrThrow(VegetationFeatures.TREES_OLD_GROWTH_PINE_TAIGA);
- Holder<ConfiguredFeature<?, ?>> orThrow46 = holderGetter.getOrThrow(VegetationFeatures.TREES_JUNGLE);
- Holder<ConfiguredFeature<?, ?>> orThrow47 = holderGetter.getOrThrow(VegetationFeatures.BAMBOO_VEGETATION);
- Holder<ConfiguredFeature<?, ?>> orThrow48 = holderGetter.getOrThrow(VegetationFeatures.MUSHROOM_ISLAND_VEGETATION);
- Holder<ConfiguredFeature<?, ?>> orThrow49 = holderGetter.getOrThrow(VegetationFeatures.MANGROVE_VEGETATION);
+ Holder<ConfiguredFeature<?, ?>> orThrow25 = holderGetter.getOrThrow(VegetationFeatures.FLOWER_PALE_GARDEN);
+ Holder<ConfiguredFeature<?, ?>> orThrow26 = holderGetter.getOrThrow(VegetationFeatures.TREES_PLAINS);
+ Holder<ConfiguredFeature<?, ?>> orThrow27 = holderGetter.getOrThrow(VegetationFeatures.DARK_FOREST_VEGETATION);
+ Holder<ConfiguredFeature<?, ?>> orThrow28 = holderGetter.getOrThrow(VegetationFeatures.PALE_GARDEN_VEGETATION);
+ Holder<ConfiguredFeature<?, ?>> orThrow29 = holderGetter.getOrThrow(VegetationFeatures.FOREST_FLOWERS);
+ Holder<ConfiguredFeature<?, ?>> orThrow30 = holderGetter.getOrThrow(VegetationFeatures.PALE_FOREST_FLOWERS);
+ Holder<ConfiguredFeature<?, ?>> orThrow31 = holderGetter.getOrThrow(VegetationFeatures.PALE_MOSS_PATCH);
+ Holder<ConfiguredFeature<?, ?>> orThrow32 = holderGetter.getOrThrow(VegetationFeatures.TREES_FLOWER_FOREST);
+ Holder<ConfiguredFeature<?, ?>> orThrow33 = holderGetter.getOrThrow(VegetationFeatures.MEADOW_TREES);
+ Holder<ConfiguredFeature<?, ?>> orThrow34 = holderGetter.getOrThrow(VegetationFeatures.TREES_TAIGA);
+ Holder<ConfiguredFeature<?, ?>> orThrow35 = holderGetter.getOrThrow(VegetationFeatures.TREES_GROVE);
+ Holder<ConfiguredFeature<?, ?>> orThrow36 = holderGetter.getOrThrow(TreeFeatures.OAK);
+ Holder<ConfiguredFeature<?, ?>> orThrow37 = holderGetter.getOrThrow(TreeFeatures.SPRUCE);
+ Holder<ConfiguredFeature<?, ?>> orThrow38 = holderGetter.getOrThrow(TreeFeatures.CHERRY_BEES_005);
+ Holder<ConfiguredFeature<?, ?>> orThrow39 = holderGetter.getOrThrow(TreeFeatures.SWAMP_OAK);
+ Holder<ConfiguredFeature<?, ?>> orThrow40 = holderGetter.getOrThrow(VegetationFeatures.TREES_SAVANNA);
+ Holder<ConfiguredFeature<?, ?>> orThrow41 = holderGetter.getOrThrow(VegetationFeatures.BIRCH_TALL);
+ Holder<ConfiguredFeature<?, ?>> orThrow42 = holderGetter.getOrThrow(TreeFeatures.BIRCH_BEES_0002);
+ Holder<ConfiguredFeature<?, ?>> orThrow43 = holderGetter.getOrThrow(VegetationFeatures.TREES_WINDSWEPT_HILLS);
+ Holder<ConfiguredFeature<?, ?>> orThrow44 = holderGetter.getOrThrow(VegetationFeatures.TREES_WATER);
+ Holder<ConfiguredFeature<?, ?>> orThrow45 = holderGetter.getOrThrow(VegetationFeatures.TREES_BIRCH_AND_OAK);
+ Holder<ConfiguredFeature<?, ?>> orThrow46 = holderGetter.getOrThrow(VegetationFeatures.TREES_SPARSE_JUNGLE);
+ Holder<ConfiguredFeature<?, ?>> orThrow47 = holderGetter.getOrThrow(VegetationFeatures.TREES_OLD_GROWTH_SPRUCE_TAIGA);
+ Holder<ConfiguredFeature<?, ?>> orThrow48 = holderGetter.getOrThrow(VegetationFeatures.TREES_OLD_GROWTH_PINE_TAIGA);
+ Holder<ConfiguredFeature<?, ?>> orThrow49 = holderGetter.getOrThrow(VegetationFeatures.TREES_JUNGLE);
+ Holder<ConfiguredFeature<?, ?>> orThrow50 = holderGetter.getOrThrow(VegetationFeatures.BAMBOO_VEGETATION);
+ Holder<ConfiguredFeature<?, ?>> orThrow51 = holderGetter.getOrThrow(VegetationFeatures.MUSHROOM_ISLAND_VEGETATION);
+ Holder<ConfiguredFeature<?, ?>> orThrow52 = holderGetter.getOrThrow(VegetationFeatures.MANGROVE_VEGETATION);
PlacementUtils.register(
context, BAMBOO_LIGHT, orThrow, RarityFilter.onAverageOnceEvery(4), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome()
);
@@ -402,11 +408,20 @@ public class VegetationPlacements {
BiomeFilter.biome()
);
PlacementUtils.register(context, FLOWER_MEADOW, orThrow23, InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome());
+ PlacementUtils.register(
+ context,
+ FLOWER_PALE_GARDEN,
+ orThrow25,
+ RarityFilter.onAverageOnceEvery(32),
+ InSquarePlacement.spread(),
+ PlacementUtils.HEIGHTMAP,
+ BiomeFilter.biome()
+ );
PlacementModifier placementModifier = SurfaceWaterDepthFilter.forMaxDepth(0);
PlacementUtils.register(
context,
TREES_PLAINS,
- orThrow25,
+ orThrow26,
PlacementUtils.countExtra(0, 0.05F, 1),
InSquarePlacement.spread(),
placementModifier,
@@ -417,7 +432,7 @@ public class VegetationPlacements {
PlacementUtils.register(
context,
DARK_FOREST_VEGETATION,
- orThrow26,
+ orThrow27,
CountPlacement.of(16),
InSquarePlacement.spread(),
placementModifier,
@@ -427,7 +442,7 @@ public class VegetationPlacements {
PlacementUtils.register(
context,
PALE_GARDEN_VEGETATION,
- orThrow27,
+ orThrow28,
CountPlacement.of(16),
InSquarePlacement.spread(),
placementModifier,
@@ -437,7 +452,7 @@ public class VegetationPlacements {
PlacementUtils.register(
context,
FLOWER_FOREST_FLOWERS,
- orThrow28,
+ orThrow29,
RarityFilter.onAverageOnceEvery(7),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP,
@@ -447,24 +462,36 @@ public class VegetationPlacements {
PlacementUtils.register(
context,
FOREST_FLOWERS,
- orThrow28,
+ orThrow29,
RarityFilter.onAverageOnceEvery(7),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP,
CountPlacement.of(ClampedInt.of(UniformInt.of(-3, 1), 0, 1)),
BiomeFilter.biome()
);
- PlacementUtils.register(context, TREES_FLOWER_FOREST, orThrow29, treePlacement(PlacementUtils.countExtra(6, 0.1F, 1)));
- PlacementUtils.register(context, TREES_MEADOW, orThrow30, treePlacement(RarityFilter.onAverageOnceEvery(100)));
- PlacementUtils.register(context, TREES_CHERRY, orThrow35, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1), Blocks.CHERRY_SAPLING));
- PlacementUtils.register(context, TREES_TAIGA, orThrow31, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
- PlacementUtils.register(context, TREES_GROVE, orThrow32, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
- PlacementUtils.register(context, TREES_BADLANDS, orThrow33, treePlacement(PlacementUtils.countExtra(5, 0.1F, 1), Blocks.OAK_SAPLING));
- PlacementUtils.register(context, TREES_SNOWY, orThrow34, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1), Blocks.SPRUCE_SAPLING));
+ PlacementUtils.register(
+ context,
+ PALE_GARDEN_FLOWERS,
+ orThrow30,
+ RarityFilter.onAverageOnceEvery(8),
+ InSquarePlacement.spread(),
+ PlacementUtils.HEIGHTMAP_NO_LEAVES,
+ BiomeFilter.biome()
+ );
+ PlacementUtils.register(
+ context, PALE_MOSS_PATCH, orThrow31, CountPlacement.of(1), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_NO_LEAVES, BiomeFilter.biome()
+ );
+ PlacementUtils.register(context, TREES_FLOWER_FOREST, orThrow32, treePlacement(PlacementUtils.countExtra(6, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_MEADOW, orThrow33, treePlacement(RarityFilter.onAverageOnceEvery(100)));
+ PlacementUtils.register(context, TREES_CHERRY, orThrow38, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1), Blocks.CHERRY_SAPLING));
+ PlacementUtils.register(context, TREES_TAIGA, orThrow34, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_GROVE, orThrow35, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_BADLANDS, orThrow36, treePlacement(PlacementUtils.countExtra(5, 0.1F, 1), Blocks.OAK_SAPLING));
+ PlacementUtils.register(context, TREES_SNOWY, orThrow37, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1), Blocks.SPRUCE_SAPLING));
PlacementUtils.register(
context,
TREES_SWAMP,
- orThrow36,
+ orThrow39,
PlacementUtils.countExtra(2, 0.1F, 1),
InSquarePlacement.spread(),
SurfaceWaterDepthFilter.forMaxDepth(2),
@@ -472,24 +499,24 @@ public class VegetationPlacements {
BiomeFilter.biome(),
BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(Blocks.OAK_SAPLING.defaultBlockState(), BlockPos.ZERO))
);
- PlacementUtils.register(context, TREES_WINDSWEPT_SAVANNA, orThrow37, treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)));
- PlacementUtils.register(context, TREES_SAVANNA, orThrow37, treePlacement(PlacementUtils.countExtra(1, 0.1F, 1)));
- PlacementUtils.register(context, BIRCH_TALL, orThrow38, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
- PlacementUtils.register(context, TREES_BIRCH, orThrow39, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1), Blocks.BIRCH_SAPLING));
- PlacementUtils.register(context, TREES_WINDSWEPT_FOREST, orThrow40, treePlacement(PlacementUtils.countExtra(3, 0.1F, 1)));
- PlacementUtils.register(context, TREES_WINDSWEPT_HILLS, orThrow40, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1)));
- PlacementUtils.register(context, TREES_WATER, orThrow41, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1)));
- PlacementUtils.register(context, TREES_BIRCH_AND_OAK, orThrow42, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
- PlacementUtils.register(context, TREES_SPARSE_JUNGLE, orThrow43, treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)));
- PlacementUtils.register(context, TREES_OLD_GROWTH_SPRUCE_TAIGA, orThrow44, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
- PlacementUtils.register(context, TREES_OLD_GROWTH_PINE_TAIGA, orThrow45, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
- PlacementUtils.register(context, TREES_JUNGLE, orThrow46, treePlacement(PlacementUtils.countExtra(50, 0.1F, 1)));
- PlacementUtils.register(context, BAMBOO_VEGETATION, orThrow47, treePlacement(PlacementUtils.countExtra(30, 0.1F, 1)));
- PlacementUtils.register(context, MUSHROOM_ISLAND_VEGETATION, orThrow48, InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome());
+ PlacementUtils.register(context, TREES_WINDSWEPT_SAVANNA, orThrow40, treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_SAVANNA, orThrow40, treePlacement(PlacementUtils.countExtra(1, 0.1F, 1)));
+ PlacementUtils.register(context, BIRCH_TALL, orThrow41, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_BIRCH, orThrow42, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1), Blocks.BIRCH_SAPLING));
+ PlacementUtils.register(context, TREES_WINDSWEPT_FOREST, orThrow43, treePlacement(PlacementUtils.countExtra(3, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_WINDSWEPT_HILLS, orThrow43, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_WATER, orThrow44, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_BIRCH_AND_OAK, orThrow45, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_SPARSE_JUNGLE, orThrow46, treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_OLD_GROWTH_SPRUCE_TAIGA, orThrow47, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_OLD_GROWTH_PINE_TAIGA, orThrow48, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
+ PlacementUtils.register(context, TREES_JUNGLE, orThrow49, treePlacement(PlacementUtils.countExtra(50, 0.1F, 1)));
+ PlacementUtils.register(context, BAMBOO_VEGETATION, orThrow50, treePlacement(PlacementUtils.countExtra(30, 0.1F, 1)));
+ PlacementUtils.register(context, MUSHROOM_ISLAND_VEGETATION, orThrow51, InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome());
PlacementUtils.register(
context,
TREES_MANGROVE,
- orThrow49,
+ orThrow52,
CountPlacement.of(25),
InSquarePlacement.spread(),
SurfaceWaterDepthFilter.forMaxDepth(5),
diff --git a/net/minecraft/network/chat/Style.java b/net/minecraft/network/chat/Style.java
index 9fdef05..415884a 100644
--- a/net/minecraft/network/chat/Style.java
+++ b/net/minecraft/network/chat/Style.java
@@ -11,13 +11,16 @@ import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.ExtraCodecs;
public class Style {
- public static final Style EMPTY = new Style(null, null, null, null, null, null, null, null, null, null);
+ public static final Style EMPTY = new Style(null, null, null, null, null, null, null, null, null, null, null);
public static final ResourceLocation DEFAULT_FONT = ResourceLocation.withDefaultNamespace("default");
@Nullable
final TextColor color;
@Nullable
+ final Integer shadowColor;
+ @Nullable
final Boolean bold;
@Nullable
final Boolean italic;
@@ -37,54 +40,58 @@ public class Style {
final ResourceLocation font;
private static Style create(
- Optional<TextColor> color,
- Optional<Boolean> bold,
- Optional<Boolean> italic,
- Optional<Boolean> underlined,
- Optional<Boolean> strikethrough,
- Optional<Boolean> obfuscated,
- Optional<ClickEvent> clickEvent,
- Optional<HoverEvent> hoverEvent,
- Optional<String> insertion,
- Optional<ResourceLocation> font
+ Optional<TextColor> optional,
+ Optional<Integer> optional1,
+ Optional<Boolean> optional2,
+ Optional<Boolean> optional3,
+ Optional<Boolean> optional4,
+ Optional<Boolean> optional5,
+ Optional<Boolean> optional6,
+ Optional<ClickEvent> optional7,
+ Optional<HoverEvent> optional8,
+ Optional<String> optional9,
+ Optional<ResourceLocation> optional10
) {
Style style = new Style(
- color.orElse(null),
- bold.orElse(null),
- italic.orElse(null),
- underlined.orElse(null),
- strikethrough.orElse(null),
- obfuscated.orElse(null),
- clickEvent.orElse(null),
- hoverEvent.orElse(null),
- insertion.orElse(null),
- font.orElse(null)
+ optional.orElse(null),
+ optional1.orElse(null),
+ optional2.orElse(null),
+ optional3.orElse(null),
+ optional4.orElse(null),
+ optional5.orElse(null),
+ optional6.orElse(null),
+ optional7.orElse(null),
+ optional8.orElse(null),
+ optional9.orElse(null),
+ optional10.orElse(null)
);
return style.equals(EMPTY) ? EMPTY : style;
}
private Style(
- @Nullable TextColor color,
- @Nullable Boolean bold,
- @Nullable Boolean italic,
- @Nullable Boolean underlined,
- @Nullable Boolean strikethrough,
- @Nullable Boolean obfuscated,
+ @Nullable TextColor textColor,
+ @Nullable Integer integer,
+ @Nullable Boolean _boolean,
+ @Nullable Boolean _boolean1,
+ @Nullable Boolean _boolean2,
+ @Nullable Boolean _boolean3,
+ @Nullable Boolean _boolean4,
@Nullable ClickEvent clickEvent,
@Nullable HoverEvent hoverEvent,
- @Nullable String insertion,
- @Nullable ResourceLocation font
+ @Nullable String string,
+ @Nullable ResourceLocation resourceLocation
) {
- this.color = color;
- this.bold = bold;
- this.italic = italic;
- this.underlined = underlined;
- this.strikethrough = strikethrough;
- this.obfuscated = obfuscated;
+ this.color = textColor;
+ this.shadowColor = integer;
+ this.bold = _boolean;
+ this.italic = _boolean1;
+ this.underlined = _boolean2;
+ this.strikethrough = _boolean3;
+ this.obfuscated = _boolean4;
this.clickEvent = clickEvent;
this.hoverEvent = hoverEvent;
- this.insertion = insertion;
- this.font = font;
+ this.insertion = string;
+ this.font = resourceLocation;
}
@Nullable
@@ -92,6 +99,11 @@ public class Style {
return this.color;
}
+ @Nullable
+ public Integer getShadowColor() {
+ return this.shadowColor;
+ }
+
public boolean isBold() {
return this.bold == Boolean.TRUE;
}
@@ -145,6 +157,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -168,12 +181,33 @@ public class Style {
return this.withColor(TextColor.fromRgb(rgb));
}
+ public Style withShadowColor(int i) {
+ return checkEmptyAfterChange(
+ new Style(
+ this.color,
+ i,
+ this.bold,
+ this.italic,
+ this.underlined,
+ this.strikethrough,
+ this.obfuscated,
+ this.clickEvent,
+ this.hoverEvent,
+ this.insertion,
+ this.font
+ ),
+ this.shadowColor,
+ i
+ );
+ }
+
public Style withBold(@Nullable Boolean bold) {
return Objects.equals(this.bold, bold)
? this
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
bold,
this.italic,
this.underlined,
@@ -195,6 +229,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
italic,
this.underlined,
@@ -216,6 +251,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
underlined,
@@ -237,6 +273,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -258,6 +295,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -279,6 +317,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -300,6 +339,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -321,6 +361,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -342,6 +383,7 @@ public class Style {
: checkEmptyAfterChange(
new Style(
this.color,
+ this.shadowColor,
this.bold,
this.italic,
this.underlined,
@@ -386,7 +428,9 @@ public class Style {
textColor = TextColor.fromLegacyFormat(formatting);
}
- return new Style(textColor, _boolean, _boolean1, _boolean3, _boolean2, _boolean4, this.clickEvent, this.hoverEvent, this.insertion, this.font);
+ return new Style(
+ textColor, this.shadowColor, _boolean, _boolean1, _boolean3, _boolean2, _boolean4, this.clickEvent, this.hoverEvent, this.insertion, this.font
+ );
}
public Style applyLegacyFormat(ChatFormatting formatting) {
@@ -423,7 +467,9 @@ public class Style {
textColor = TextColor.fromLegacyFormat(formatting);
}
- return new Style(textColor, _boolean, _boolean1, _boolean3, _boolean2, _boolean4, this.clickEvent, this.hoverEvent, this.insertion, this.font);
+ return new Style(
+ textColor, this.shadowColor, _boolean, _boolean1, _boolean3, _boolean2, _boolean4, this.clickEvent, this.hoverEvent, this.insertion, this.font
+ );
}
public Style applyFormats(ChatFormatting... formats) {
@@ -458,7 +504,9 @@ public class Style {
}
}
- return new Style(textColor, _boolean, _boolean1, _boolean3, _boolean2, _boolean4, this.clickEvent, this.hoverEvent, this.insertion, this.font);
+ return new Style(
+ textColor, this.shadowColor, _boolean, _boolean1, _boolean3, _boolean2, _boolean4, this.clickEvent, this.hoverEvent, this.insertion, this.font
+ );
}
public Style applyTo(Style style) {
@@ -469,6 +517,7 @@ public class Style {
? this
: new Style(
this.color != null ? this.color : style.color,
+ this.shadowColor != null ? this.shadowColor : style.shadowColor,
this.bold != null ? this.bold : style.bold,
this.italic != null ? this.italic : style.italic,
this.underlined != null ? this.underlined : style.underlined,
@@ -520,6 +569,7 @@ public class Style {
Collector collector = new Collector();
collector.addValueString("color", this.color);
+ collector.addValueString("shadowColor", this.shadowColor);
collector.addFlagString("bold", this.bold);
collector.addFlagString("italic", this.italic);
collector.addFlagString("underlined", this.underlined);
@@ -539,6 +589,7 @@ public class Style {
|| other instanceof Style style
&& this.bold == style.bold
&& Objects.equals(this.getColor(), style.getColor())
+ && Objects.equals(this.getShadowColor(), style.getShadowColor())
&& this.italic == style.italic
&& this.obfuscated == style.obfuscated
&& this.strikethrough == style.strikethrough
@@ -552,7 +603,16 @@ public class Style {
@Override
public int hashCode() {
return Objects.hash(
- this.color, this.bold, this.italic, this.underlined, this.strikethrough, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion
+ this.color,
+ this.shadowColor,
+ this.bold,
+ this.italic,
+ this.underlined,
+ this.strikethrough,
+ this.obfuscated,
+ this.clickEvent,
+ this.hoverEvent,
+ this.insertion
);
}
@@ -560,6 +620,7 @@ public class Style {
public static final MapCodec<Style> MAP_CODEC = RecordCodecBuilder.mapCodec(
instance -> instance.group(
TextColor.CODEC.optionalFieldOf("color").forGetter(serializer -> Optional.ofNullable(serializer.color)),
+ ExtraCodecs.ARGB_COLOR_CODEC.optionalFieldOf("shadow_color").forGetter(serializer -> Optional.ofNullable(serializer.shadowColor)),
Codec.BOOL.optionalFieldOf("bold").forGetter(serializer -> Optional.ofNullable(serializer.bold)),
Codec.BOOL.optionalFieldOf("italic").forGetter(serializer -> Optional.ofNullable(serializer.italic)),
Codec.BOOL.optionalFieldOf("underlined").forGetter(serializer -> Optional.ofNullable(serializer.underlined)),
@@ -568,7 +629,7 @@ public class Style {
ClickEvent.CODEC.optionalFieldOf("clickEvent").forGetter(serializer -> Optional.ofNullable(serializer.clickEvent)),
HoverEvent.CODEC.optionalFieldOf("hoverEvent").forGetter(serializer -> Optional.ofNullable(serializer.hoverEvent)),
Codec.STRING.optionalFieldOf("insertion").forGetter(serializer -> Optional.ofNullable(serializer.insertion)),
- ResourceLocation.CODEC.optionalFieldOf("font").forGetter(serializer -> Optional.ofNullable(serializer.font))
+ ResourceLocation.CODEC.optionalFieldOf("font").forGetter(style -> Optional.ofNullable(style.font))
)
.apply(instance, Style::create)
);
diff --git a/net/minecraft/network/protocol/game/ClientGamePacketListener.java b/net/minecraft/network/protocol/game/ClientGamePacketListener.java
index ed3cce9..9408ee9 100644
--- a/net/minecraft/network/protocol/game/ClientGamePacketListener.java
+++ b/net/minecraft/network/protocol/game/ClientGamePacketListener.java
@@ -4,7 +4,7 @@ import net.minecraft.network.ConnectionProtocol;
import net.minecraft.network.protocol.common.ClientCommonPacketListener;
import net.minecraft.network.protocol.ping.ClientPongPacketListener;
-public interface ClientGamePacketListener extends ClientCommonPacketListener, ClientPongPacketListener {
+public interface ClientGamePacketListener extends ClientPongPacketListener, ClientCommonPacketListener {
@Override
default ConnectionProtocol protocol() {
return ConnectionProtocol.PLAY;
diff --git a/net/minecraft/network/protocol/game/ClientboundLevelParticlesPacket.java b/net/minecraft/network/protocol/game/ClientboundLevelParticlesPacket.java
index 731f351..64506b5 100644
--- a/net/minecraft/network/protocol/game/ClientboundLevelParticlesPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundLevelParticlesPacket.java
@@ -20,25 +20,28 @@ public class ClientboundLevelParticlesPacket implements Packet<ClientGamePacketL
private final float maxSpeed;
private final int count;
private final boolean overrideLimiter;
+ private final boolean alwaysShow;
private final ParticleOptions particle;
public <T extends ParticleOptions> ClientboundLevelParticlesPacket(
- T particle, boolean overrideLimiter, double x, double y, double z, float xDist, float yDist, float zDist, float maxSpeed, int count
+ T particleOptions, boolean flag, boolean flag1, double d, double d1, double d2, float f, float f1, float f2, float f3, int i
) {
- this.particle = particle;
- this.overrideLimiter = overrideLimiter;
- this.x = x;
- this.y = y;
- this.z = z;
- this.xDist = xDist;
- this.yDist = yDist;
- this.zDist = zDist;
- this.maxSpeed = maxSpeed;
- this.count = count;
+ this.particle = particleOptions;
+ this.overrideLimiter = flag;
+ this.alwaysShow = flag1;
+ this.x = d;
+ this.y = d1;
+ this.z = d2;
+ this.xDist = f;
+ this.yDist = f1;
+ this.zDist = f2;
+ this.maxSpeed = f3;
+ this.count = i;
}
private ClientboundLevelParticlesPacket(RegistryFriendlyByteBuf buffer) {
this.overrideLimiter = buffer.readBoolean();
+ this.alwaysShow = buffer.readBoolean();
this.x = buffer.readDouble();
this.y = buffer.readDouble();
this.z = buffer.readDouble();
@@ -52,6 +55,7 @@ public class ClientboundLevelParticlesPacket implements Packet<ClientGamePacketL
private void write(RegistryFriendlyByteBuf buffer) {
buffer.writeBoolean(this.overrideLimiter);
+ buffer.writeBoolean(this.alwaysShow);
buffer.writeDouble(this.x);
buffer.writeDouble(this.y);
buffer.writeDouble(this.z);
@@ -77,6 +81,10 @@ public class ClientboundLevelParticlesPacket implements Packet<ClientGamePacketL
return this.overrideLimiter;
}
+ public boolean alwaysShow() {
+ return this.alwaysShow;
+ }
+
public double getX() {
return this.x;
}
diff --git a/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
index 8f2536a..c1c3bc8 100644
--- a/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
@@ -19,6 +19,7 @@ import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketType;
import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.world.entity.player.PlayerModelPart;
import net.minecraft.world.level.GameType;
public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacketListener> {
@@ -46,6 +47,7 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED,
ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LATENCY,
ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME,
+ ClientboundPlayerInfoUpdatePacket.Action.UPDATE_HAT,
ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LIST_ORDER
);
return new ClientboundPlayerInfoUpdatePacket(set, players);
@@ -126,7 +128,8 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
(entryBuilder, buffer) -> entryBuilder.displayName = FriendlyByteBuf.readNullable(buffer, ComponentSerialization.TRUSTED_STREAM_CODEC),
(buffer, entry) -> FriendlyByteBuf.writeNullable(buffer, entry.displayName(), ComponentSerialization.TRUSTED_STREAM_CODEC)
),
- UPDATE_LIST_ORDER((entryBuilder, buffer) -> entryBuilder.listOrder = buffer.readVarInt(), (buffer, entry) -> buffer.writeVarInt(entry.listOrder));
+ UPDATE_LIST_ORDER((entryBuilder, buffer) -> entryBuilder.listOrder = buffer.readVarInt(), (buffer, entry) -> buffer.writeVarInt(entry.listOrder)),
+ UPDATE_HAT((entryBuilder, buffer) -> entryBuilder.showHat = buffer.readBoolean(), (buffer, entry) -> buffer.writeBoolean(entry.showHat));
final ClientboundPlayerInfoUpdatePacket.Action.Reader reader;
final ClientboundPlayerInfoUpdatePacket.Action.Writer writer;
@@ -152,6 +155,7 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
int latency,
GameType gameMode,
@Nullable Component displayName,
+ boolean showHat,
int listOrder,
@Nullable RemoteChatSession.Data chatSession
) {
@@ -163,6 +167,7 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
player.connection.latency(),
player.gameMode.getGameModeForPlayer(),
player.getTabListDisplayName(),
+ player.isModelPartShown(PlayerModelPart.HAT),
player.getTabListOrder(),
Optionull.map(player.getChatSession(), RemoteChatSession::asData)
);
@@ -178,6 +183,7 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
GameType gameMode = GameType.DEFAULT_MODE;
@Nullable
Component displayName;
+ boolean showHat;
int listOrder;
@Nullable
RemoteChatSession.Data chatSession;
@@ -188,7 +194,7 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
ClientboundPlayerInfoUpdatePacket.Entry build() {
return new ClientboundPlayerInfoUpdatePacket.Entry(
- this.profileId, this.profile, this.listed, this.latency, this.gameMode, this.displayName, this.listOrder, this.chatSession
+ this.profileId, this.profile, this.listed, this.latency, this.gameMode, this.displayName, this.showHat, this.listOrder, this.chatSession
);
}
}
diff --git a/net/minecraft/network/protocol/game/ClientboundSetHeldSlotPacket.java b/net/minecraft/network/protocol/game/ClientboundSetHeldSlotPacket.java
index 27a15c3..442af7c 100644
--- a/net/minecraft/network/protocol/game/ClientboundSetHeldSlotPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundSetHeldSlotPacket.java
@@ -1,27 +1,15 @@
package net.minecraft.network.protocol.game;
-import net.minecraft.network.FriendlyByteBuf;
+import io.netty.buffer.ByteBuf;
+import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketType;
-public class ClientboundSetHeldSlotPacket implements Packet<ClientGamePacketListener> {
- public static final StreamCodec<FriendlyByteBuf, ClientboundSetHeldSlotPacket> STREAM_CODEC = Packet.codec(
- ClientboundSetHeldSlotPacket::write, ClientboundSetHeldSlotPacket::new
+public record ClientboundSetHeldSlotPacket(int slot) implements Packet<ClientGamePacketListener> {
+ public static final StreamCodec<ByteBuf, ClientboundSetHeldSlotPacket> STREAM_CODEC = StreamCodec.composite(
+ ByteBufCodecs.VAR_INT, ClientboundSetHeldSlotPacket::slot, ClientboundSetHeldSlotPacket::new
);
- private final int slot;
-
- public ClientboundSetHeldSlotPacket(int i) {
- this.slot = i;
- }
-
- private ClientboundSetHeldSlotPacket(FriendlyByteBuf friendlyByteBuf) {
- this.slot = friendlyByteBuf.readByte();
- }
-
- private void write(FriendlyByteBuf friendlyByteBuf) {
- friendlyByteBuf.writeByte(this.slot);
- }
@Override
public PacketType<ClientboundSetHeldSlotPacket> type() {
@@ -32,8 +20,4 @@ public class ClientboundSetHeldSlotPacket implements Packet<ClientGamePacketList
public void handle(ClientGamePacketListener handler) {
handler.handleSetHeldSlot(this);
}
-
- public int getSlot() {
- return this.slot;
- }
}
diff --git a/net/minecraft/network/protocol/game/GamePacketTypes.java b/net/minecraft/network/protocol/game/GamePacketTypes.java
index fd888b2..3d3b760 100644
--- a/net/minecraft/network/protocol/game/GamePacketTypes.java
+++ b/net/minecraft/network/protocol/game/GamePacketTypes.java
@@ -160,7 +160,8 @@ public class GamePacketTypes {
public static final PacketType<ServerboundMovePlayerPacket.StatusOnly> SERVERBOUND_MOVE_PLAYER_STATUS_ONLY = createServerbound("move_player_status_only");
public static final PacketType<ServerboundMoveVehiclePacket> SERVERBOUND_MOVE_VEHICLE = createServerbound("move_vehicle");
public static final PacketType<ServerboundPaddleBoatPacket> SERVERBOUND_PADDLE_BOAT = createServerbound("paddle_boat");
- public static final PacketType<ServerboundPickItemPacket> SERVERBOUND_PICK_ITEM = createServerbound("pick_item");
+ public static final PacketType<ServerboundPickItemFromBlockPacket> SERVERBOUND_PICK_ITEM_FROM_BLOCK = createServerbound("pick_item_from_block");
+ public static final PacketType<ServerboundPickItemFromEntityPacket> SERVERBOUND_PICK_ITEM_FROM_ENTITY = createServerbound("pick_item_from_entity");
public static final PacketType<ServerboundPlaceRecipePacket> SERVERBOUND_PLACE_RECIPE = createServerbound("place_recipe");
public static final PacketType<ServerboundPlayerAbilitiesPacket> SERVERBOUND_PLAYER_ABILITIES = createServerbound("player_abilities");
public static final PacketType<ServerboundPlayerActionPacket> SERVERBOUND_PLAYER_ACTION = createServerbound("player_action");
diff --git a/net/minecraft/network/protocol/game/GameProtocols.java b/net/minecraft/network/protocol/game/GameProtocols.java
index f18fc0b..d73e570 100644
--- a/net/minecraft/network/protocol/game/GameProtocols.java
+++ b/net/minecraft/network/protocol/game/GameProtocols.java
@@ -67,7 +67,8 @@ public class GameProtocols {
.addPacket(GamePacketTypes.SERVERBOUND_MOVE_PLAYER_STATUS_ONLY, ServerboundMovePlayerPacket.StatusOnly.STREAM_CODEC)
.addPacket(GamePacketTypes.SERVERBOUND_MOVE_VEHICLE, ServerboundMoveVehiclePacket.STREAM_CODEC)
.addPacket(GamePacketTypes.SERVERBOUND_PADDLE_BOAT, ServerboundPaddleBoatPacket.STREAM_CODEC)
- .addPacket(GamePacketTypes.SERVERBOUND_PICK_ITEM, ServerboundPickItemPacket.STREAM_CODEC)
+ .addPacket(GamePacketTypes.SERVERBOUND_PICK_ITEM_FROM_BLOCK, ServerboundPickItemFromBlockPacket.STREAM_CODEC)
+ .addPacket(GamePacketTypes.SERVERBOUND_PICK_ITEM_FROM_ENTITY, ServerboundPickItemFromEntityPacket.STREAM_CODEC)
.addPacket(PingPacketTypes.SERVERBOUND_PING_REQUEST, ServerboundPingRequestPacket.STREAM_CODEC)
.addPacket(GamePacketTypes.SERVERBOUND_PLACE_RECIPE, ServerboundPlaceRecipePacket.STREAM_CODEC)
.addPacket(GamePacketTypes.SERVERBOUND_PLAYER_ABILITIES, ServerboundPlayerAbilitiesPacket.STREAM_CODEC)
diff --git a/net/minecraft/network/protocol/game/ServerGamePacketListener.java b/net/minecraft/network/protocol/game/ServerGamePacketListener.java
index a9282c3..67a0647 100644
--- a/net/minecraft/network/protocol/game/ServerGamePacketListener.java
+++ b/net/minecraft/network/protocol/game/ServerGamePacketListener.java
@@ -74,7 +74,9 @@ public interface ServerGamePacketListener extends ServerCommonPacketListener, Se
void handleSetCommandMinecart(ServerboundSetCommandMinecartPacket packet);
- void handlePickItem(ServerboundPickItemPacket packet);
+ void handlePickItemFromBlock(ServerboundPickItemFromBlockPacket serverboundPickItemFromBlockPacket);
+
+ void handlePickItemFromEntity(ServerboundPickItemFromEntityPacket serverboundPickItemFromEntityPacket);
void handleRenameItem(ServerboundRenameItemPacket packet);
diff --git a/net/minecraft/network/protocol/game/ServerboundPickItemFromBlockPacket.java b/net/minecraft/network/protocol/game/ServerboundPickItemFromBlockPacket.java
new file mode 100644
index 0000000..9c51901
--- /dev/null
+++ b/net/minecraft/network/protocol/game/ServerboundPickItemFromBlockPacket.java
@@ -0,0 +1,28 @@
+package net.minecraft.network.protocol.game;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.core.BlockPos;
+import net.minecraft.network.codec.ByteBufCodecs;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.network.protocol.Packet;
+import net.minecraft.network.protocol.PacketType;
+
+public record ServerboundPickItemFromBlockPacket(BlockPos pos, boolean includeData) implements Packet<ServerGamePacketListener> {
+ public static final StreamCodec<ByteBuf, ServerboundPickItemFromBlockPacket> STREAM_CODEC = StreamCodec.composite(
+ BlockPos.STREAM_CODEC,
+ ServerboundPickItemFromBlockPacket::pos,
+ ByteBufCodecs.BOOL,
+ ServerboundPickItemFromBlockPacket::includeData,
+ ServerboundPickItemFromBlockPacket::new
+ );
+
+ @Override
+ public PacketType<ServerboundPickItemFromBlockPacket> type() {
+ return GamePacketTypes.SERVERBOUND_PICK_ITEM_FROM_BLOCK;
+ }
+
+ @Override
+ public void handle(ServerGamePacketListener handler) {
+ handler.handlePickItemFromBlock(this);
+ }
+}
diff --git a/net/minecraft/network/protocol/game/ServerboundPickItemFromEntityPacket.java b/net/minecraft/network/protocol/game/ServerboundPickItemFromEntityPacket.java
new file mode 100644
index 0000000..44b5b2a
--- /dev/null
+++ b/net/minecraft/network/protocol/game/ServerboundPickItemFromEntityPacket.java
@@ -0,0 +1,27 @@
+package net.minecraft.network.protocol.game;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.network.codec.ByteBufCodecs;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.network.protocol.Packet;
+import net.minecraft.network.protocol.PacketType;
+
+public record ServerboundPickItemFromEntityPacket(int id, boolean includeData) implements Packet<ServerGamePacketListener> {
+ public static final StreamCodec<ByteBuf, ServerboundPickItemFromEntityPacket> STREAM_CODEC = StreamCodec.composite(
+ ByteBufCodecs.VAR_INT,
+ ServerboundPickItemFromEntityPacket::id,
+ ByteBufCodecs.BOOL,
+ ServerboundPickItemFromEntityPacket::includeData,
+ ServerboundPickItemFromEntityPacket::new
+ );
+
+ @Override
+ public PacketType<ServerboundPickItemFromEntityPacket> type() {
+ return GamePacketTypes.SERVERBOUND_PICK_ITEM_FROM_ENTITY;
+ }
+
+ @Override
+ public void handle(ServerGamePacketListener handler) {
+ handler.handlePickItemFromEntity(this);
+ }
+}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 37dba85..b76ccbd 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -349,7 +349,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.forceDifficulty();
this.prepareLevels(chunkProgressListener);
if (profiledDuration != null) {
- profiledDuration.finish();
+ profiledDuration.finish(true);
}
if (flag) {
diff --git a/net/minecraft/server/commands/AttributeCommand.java b/net/minecraft/server/commands/AttributeCommand.java
index 1aec979..532a42f 100644
--- a/net/minecraft/server/commands/AttributeCommand.java
+++ b/net/minecraft/server/commands/AttributeCommand.java
@@ -6,9 +6,11 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType;
import com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
+import java.util.stream.Stream;
import net.minecraft.commands.CommandBuildContext;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
+import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.commands.arguments.EntityArgument;
import net.minecraft.commands.arguments.ResourceArgument;
import net.minecraft.commands.arguments.ResourceLocationArgument;
@@ -109,6 +111,16 @@ public class AttributeCommand {
)
)
)
+ .then(
+ Commands.literal("reset")
+ .executes(
+ context1 -> resetAttributeBase(
+ context1.getSource(),
+ EntityArgument.getEntity(context1, "target"),
+ ResourceArgument.getAttribute(context1, "attribute")
+ )
+ )
+ )
)
.then(
Commands.literal("modifier")
@@ -164,6 +176,15 @@ public class AttributeCommand {
Commands.literal("remove")
.then(
Commands.argument("id", ResourceLocationArgument.id())
+ .suggests(
+ (commandContext, suggestionsBuilder) -> SharedSuggestionProvider.suggestResource(
+ getAttributeModifiers(
+ EntityArgument.getEntity(commandContext, "target"),
+ ResourceArgument.getAttribute(commandContext, "attribute")
+ ),
+ suggestionsBuilder
+ )
+ )
.executes(
context1 -> removeModifier(
context1.getSource(),
@@ -180,24 +201,33 @@ public class AttributeCommand {
Commands.literal("get")
.then(
Commands.argument("id", ResourceLocationArgument.id())
+ .suggests(
+ (commandContext, suggestionsBuilder) -> SharedSuggestionProvider.suggestResource(
+ getAttributeModifiers(
+ EntityArgument.getEntity(commandContext, "target"),
+ ResourceArgument.getAttribute(commandContext, "attribute")
+ ),
+ suggestionsBuilder
+ )
+ )
.executes(
- context1 -> getAttributeModifier(
- context1.getSource(),
- EntityArgument.getEntity(context1, "target"),
- ResourceArgument.getAttribute(context1, "attribute"),
- ResourceLocationArgument.getId(context1, "id"),
+ commandContext -> getAttributeModifier(
+ commandContext.getSource(),
+ EntityArgument.getEntity(commandContext, "target"),
+ ResourceArgument.getAttribute(commandContext, "attribute"),
+ ResourceLocationArgument.getId(commandContext, "id"),
1.0
)
)
.then(
Commands.argument("scale", DoubleArgumentType.doubleArg())
.executes(
- context1 -> getAttributeModifier(
- context1.getSource(),
- EntityArgument.getEntity(context1, "target"),
- ResourceArgument.getAttribute(context1, "attribute"),
- ResourceLocationArgument.getId(context1, "id"),
- DoubleArgumentType.getDouble(context1, "scale")
+ commandContext -> getAttributeModifier(
+ commandContext.getSource(),
+ EntityArgument.getEntity(commandContext, "target"),
+ ResourceArgument.getAttribute(commandContext, "attribute"),
+ ResourceLocationArgument.getId(commandContext, "id"),
+ DoubleArgumentType.getDouble(commandContext, "scale")
)
)
)
@@ -276,6 +306,11 @@ public class AttributeCommand {
}
}
+ private static Stream<ResourceLocation> getAttributeModifiers(Entity entity, Holder<Attribute> holder) throws CommandSyntaxException {
+ AttributeInstance attributeInstance = getAttributeInstance(entity, holder);
+ return attributeInstance.getModifiers().stream().map(AttributeModifier::id);
+ }
+
private static int setAttributeBase(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double value) throws CommandSyntaxException {
getAttributeInstance(entity, attribute).setBaseValue(value);
source.sendSuccess(
@@ -284,6 +319,22 @@ public class AttributeCommand {
return 1;
}
+ private static int resetAttributeBase(CommandSourceStack commandSourceStack, Entity entity, Holder<Attribute> holder) throws CommandSyntaxException {
+ LivingEntity livingEntity = getLivingEntity(entity);
+ if (!livingEntity.getAttributes().resetBaseValue(holder)) {
+ throw ERROR_NO_SUCH_ATTRIBUTE.create(entity.getName(), getAttributeDescription(holder));
+ } else {
+ double attributeBaseValue = livingEntity.getAttributeBaseValue(holder);
+ commandSourceStack.sendSuccess(
+ () -> Component.translatable(
+ "commands.attribute.base_value.reset.success", getAttributeDescription(holder), entity.getName(), attributeBaseValue
+ ),
+ false
+ );
+ return 1;
+ }
+ }
+
private static int addModifier(
CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id, double amount, AttributeModifier.Operation operation
) throws CommandSyntaxException {
diff --git a/net/minecraft/server/commands/ParticleCommand.java b/net/minecraft/server/commands/ParticleCommand.java
index 75b484a..f66937c 100644
--- a/net/minecraft/server/commands/ParticleCommand.java
+++ b/net/minecraft/server/commands/ParticleCommand.java
@@ -145,7 +145,7 @@ public class ParticleCommand {
int i = 0;
for (ServerPlayer serverPlayer : viewers) {
- if (source.getLevel().sendParticles(serverPlayer, particleData, force, pos.x, pos.y, pos.z, count, delta.x, delta.y, delta.z, speed)) {
+ if (source.getLevel().sendParticles(serverPlayer, particleData, force, false, pos.x, pos.y, pos.z, count, delta.x, delta.y, delta.z, speed)) {
i++;
}
}
diff --git a/net/minecraft/server/commands/PlaceCommand.java b/net/minecraft/server/commands/PlaceCommand.java
index c2297c4..eed9161 100644
--- a/net/minecraft/server/commands/PlaceCommand.java
+++ b/net/minecraft/server/commands/PlaceCommand.java
@@ -264,6 +264,8 @@ public class PlaceCommand {
Structure structure1 = structure.value();
ChunkGenerator generator = level.getChunkSource().getGenerator();
StructureStart structureStart = structure1.generate(
+ structure,
+ level.dimension(),
source.registryAccess(),
generator,
generator.getBiomeSource(),
diff --git a/net/minecraft/server/commands/SpawnArmorTrimsCommand.java b/net/minecraft/server/commands/SpawnArmorTrimsCommand.java
index 2b6eddb..44c0adf 100644
--- a/net/minecraft/server/commands/SpawnArmorTrimsCommand.java
+++ b/net/minecraft/server/commands/SpawnArmorTrimsCommand.java
@@ -65,7 +65,8 @@ public class SpawnArmorTrimsCommand {
TrimMaterials.EMERALD,
TrimMaterials.DIAMOND,
TrimMaterials.LAPIS,
- TrimMaterials.AMETHYST
+ TrimMaterials.AMETHYST,
+ TrimMaterials.RESIN
);
private static final ToIntFunction<ResourceKey<TrimPattern>> TRIM_PATTERN_ORDER = Util.createIndexLookup(VANILLA_TRIM_PATTERNS);
private static final ToIntFunction<ResourceKey<TrimMaterial>> TRIM_MATERIAL_ORDER = Util.createIndexLookup(VANILLA_TRIM_MATERIALS);
diff --git a/net/minecraft/server/commands/TimeCommand.java b/net/minecraft/server/commands/TimeCommand.java
index 8a0ecbe..bec93ae 100644
--- a/net/minecraft/server/commands/TimeCommand.java
+++ b/net/minecraft/server/commands/TimeCommand.java
@@ -60,6 +60,7 @@ public class TimeCommand {
serverLevel.setDayTime(time);
}
+ source.getServer().forceTimeSynchronization();
source.sendSuccess(() -> Component.translatable("commands.time.set", time), true);
return getDayTime(source.getLevel());
}
@@ -69,6 +70,7 @@ public class TimeCommand {
serverLevel.setDayTime(serverLevel.getDayTime() + amount);
}
+ source.getServer().forceTimeSynchronization();
int dayTime = getDayTime(source.getLevel());
source.sendSuccess(() -> Component.translatable("commands.time.set", dayTime), true);
return dayTime;
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
index b41480a..5b8b34d 100644
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
@@ -591,10 +591,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
Throwable throwable1 = throwable instanceof ReportedException reportedException ? reportedException.getCause() : throwable;
boolean flag = throwable1 instanceof Error;
boolean flag1 = throwable1 instanceof IOException || throwable1 instanceof NbtException;
- if (!flag) {
- if (!flag1) {
- }
-
+ if (!flag && flag1) {
this.level.getServer().reportChunkLoadFailure(throwable1, this.storageInfo(), chunkPos);
return this.createEmptyChunk(chunkPos);
} else {
diff --git a/net/minecraft/server/level/ChunkTrackingView.java b/net/minecraft/server/level/ChunkTrackingView.java
index b17f6b8..bee9033 100644
--- a/net/minecraft/server/level/ChunkTrackingView.java
+++ b/net/minecraft/server/level/ChunkTrackingView.java
@@ -73,13 +73,12 @@ public interface ChunkTrackingView {
}
static boolean isWithinDistance(int centerX, int centerZ, int viewDistance, int x, int z, boolean includeOuterChunksAdjacentToViewBorder) {
- int max = Math.max(0, Math.abs(x - centerX) - 1);
- int max1 = Math.max(0, Math.abs(z - centerZ) - 1);
- long l = Math.max(0, Math.max(max, max1) - (includeOuterChunksAdjacentToViewBorder ? 1 : 0));
- long l1 = Math.min(max, max1);
- long l2 = l1 * l1 + l * l;
- int i = viewDistance * viewDistance;
- return l2 < i;
+ int i = includeOuterChunksAdjacentToViewBorder ? 2 : 1;
+ long l = Math.max(0, Math.abs(x - centerX) - i);
+ long l1 = Math.max(0, Math.abs(z - centerZ) - i);
+ long l2 = l * l + l1 * l1;
+ int i1 = viewDistance * viewDistance;
+ return l2 < i1;
}
public record Positioned(ChunkPos center, int viewDistance) implements ChunkTrackingView {
diff --git a/net/minecraft/server/level/DistanceManager.java b/net/minecraft/server/level/DistanceManager.java
index e2e9933..68bd370 100644
--- a/net/minecraft/server/level/DistanceManager.java
+++ b/net/minecraft/server/level/DistanceManager.java
@@ -299,7 +299,7 @@ public abstract class DistanceManager {
}
public void removeTicketsOnClosing() {
- ImmutableSet<TicketType<?>> set = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT);
+ ImmutableSet<TicketType<?>> set = ImmutableSet.of(TicketType.UNKNOWN);
ObjectIterator<Entry<SortedArraySet<Ticket<?>>>> objectIterator = this.tickets.long2ObjectEntrySet().fastIterator();
while (objectIterator.hasNext()) {
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
index 1d58dfa..ef3d71b 100644
--- a/net/minecraft/server/level/ServerEntity.java
+++ b/net/minecraft/server/level/ServerEntity.java
@@ -170,8 +170,7 @@ public class ServerEntity {
flag4 = true;
}
- if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying())
- && this.tickCount > 0) {
+ if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
Vec3 deltaMovement = this.entity.getDeltaMovement();
double d = deltaMovement.distanceToSqr(this.lastSentMovement);
if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index b7cac1c..7900900 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -19,6 +19,7 @@ import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
@@ -1188,39 +1189,44 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public <T extends ParticleOptions> int sendParticles(
T type, double posX, double posY, double posZ, int particleCount, double xOffset, double yOffset, double zOffset, double speed
+ ) {
+ return this.sendParticles(type, false, false, posX, posY, posZ, particleCount, xOffset, yOffset, zOffset, speed);
+ }
+
+ public <T extends ParticleOptions> int sendParticles(
+ T particleOptions, boolean flag, boolean flag1, double d, double d1, double d2, int i, double d3, double d4, double d5, double d6
) {
ClientboundLevelParticlesPacket clientboundLevelParticlesPacket = new ClientboundLevelParticlesPacket(
- type, false, posX, posY, posZ, (float)xOffset, (float)yOffset, (float)zOffset, (float)speed, particleCount
+ particleOptions, flag, flag1, d, d1, d2, (float)d3, (float)d4, (float)d5, (float)d6, i
);
- int i = 0;
+ int i1 = 0;
- for (int i1 = 0; i1 < this.players.size(); i1++) {
- ServerPlayer serverPlayer = this.players.get(i1);
- if (this.sendParticles(serverPlayer, false, posX, posY, posZ, clientboundLevelParticlesPacket)) {
- i++;
+ for (int i2 = 0; i2 < this.players.size(); i2++) {
+ ServerPlayer serverPlayer = this.players.get(i2);
+ if (this.sendParticles(serverPlayer, flag, d, d1, d2, clientboundLevelParticlesPacket)) {
+ i1++;
}
}
- return i;
+ return i1;
}
public <T extends ParticleOptions> boolean sendParticles(
- ServerPlayer player,
- T type,
- boolean longDistance,
- double posX,
- double posY,
- double posZ,
- int particleCount,
- double xOffset,
- double yOffset,
- double zOffset,
- double speed
+ ServerPlayer serverPlayer,
+ T particleOptions,
+ boolean flag,
+ boolean flag1,
+ double d,
+ double d1,
+ double d2,
+ int i,
+ double d3,
+ double d4,
+ double d5,
+ double d6
) {
- Packet<?> packet = new ClientboundLevelParticlesPacket(
- type, longDistance, posX, posY, posZ, (float)xOffset, (float)yOffset, (float)zOffset, (float)speed, particleCount
- );
- return this.sendParticles(player, longDistance, posX, posY, posZ, packet);
+ Packet<?> packet = new ClientboundLevelParticlesPacket(particleOptions, flag, flag1, d, d1, d2, (float)d3, (float)d4, (float)d5, (float)d6, i);
+ return this.sendParticles(serverPlayer, flag, d, d1, d2, packet);
}
private boolean sendParticles(ServerPlayer player, boolean longDistance, double posX, double posY, double posZ, Packet<?> packet) {
@@ -1243,6 +1249,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
return this.getEntities().get(id);
}
+ @Nullable
+ public Entity getEntity(UUID uniqueId) {
+ return this.getEntities().get(uniqueId);
+ }
+
@Deprecated
@Nullable
public Entity getEntityOrPart(int id) {
@@ -1250,9 +1261,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
return entity != null ? entity : this.dragonParts.get(id);
}
- @Nullable
- public Entity getEntity(UUID uniqueId) {
- return this.getEntities().get(uniqueId);
+ @Override
+ public Collection<EnderDragonPart> dragonParts() {
+ return this.dragonParts.values();
}
@Nullable
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 07c2551..8a31d8a 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1595,8 +1595,6 @@ public class ServerPlayer extends Player {
@Override
public boolean teleportTo(ServerLevel serverLevel, double d, double d1, double d2, Set<Relative> set, float f, float f1, boolean flag) {
- ChunkPos chunkPos = new ChunkPos(BlockPos.containing(d, d1, d2));
- serverLevel.getChunkSource().addRegionTicket(TicketType.POST_TELEPORT, chunkPos, 1, this.getId());
if (this.isSleeping()) {
this.stopSleepInBed(true, true);
}
@@ -1784,7 +1782,7 @@ public class ServerPlayer extends Player {
}
@Override
- protected int getPermissionLevel() {
+ public int getPermissionLevel() {
return this.server.getProfilePermissions(this.getGameProfile());
}
diff --git a/net/minecraft/server/level/TicketType.java b/net/minecraft/server/level/TicketType.java
index 99d8be8..d53b71b 100644
--- a/net/minecraft/server/level/TicketType.java
+++ b/net/minecraft/server/level/TicketType.java
@@ -16,7 +16,6 @@ public class TicketType<T> {
public static final TicketType<ChunkPos> FORCED = create("forced", Comparator.comparingLong(ChunkPos::toLong));
public static final TicketType<BlockPos> PORTAL = create("portal", Vec3i::compareTo, 300);
public static final TicketType<ChunkPos> ENDER_PEARL = create("ender_pearl", Comparator.comparingLong(ChunkPos::toLong), 40);
- public static final TicketType<Integer> POST_TELEPORT = create("post_teleport", Integer::compareTo, 5);
public static final TicketType<ChunkPos> UNKNOWN = create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1);
public static <T> TicketType<T> create(String name, Comparator<T> comparator) {
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 06c5c8f..3cf1ebb 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -99,7 +99,8 @@ import net.minecraft.network.protocol.game.ServerboundLockDifficultyPacket;
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
import net.minecraft.network.protocol.game.ServerboundMoveVehiclePacket;
import net.minecraft.network.protocol.game.ServerboundPaddleBoatPacket;
-import net.minecraft.network.protocol.game.ServerboundPickItemPacket;
+import net.minecraft.network.protocol.game.ServerboundPickItemFromBlockPacket;
+import net.minecraft.network.protocol.game.ServerboundPickItemFromEntityPacket;
import net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket;
import net.minecraft.network.protocol.game.ServerboundPlayerAbilitiesPacket;
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
@@ -150,6 +151,7 @@ import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.ChatVisiblity;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.entity.player.PlayerModelPart;
import net.minecraft.world.entity.player.ProfilePublicKey;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.entity.vehicle.AbstractBoat;
@@ -163,7 +165,6 @@ import net.minecraft.world.item.BucketItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
-import net.minecraft.world.item.component.CustomData;
import net.minecraft.world.item.component.WritableBookContent;
import net.minecraft.world.item.component.WrittenBookContent;
import net.minecraft.world.item.crafting.RecipeHolder;
@@ -631,13 +632,65 @@ public class ServerGamePacketListenerImpl
}
@Override
- public void handlePickItem(ServerboundPickItemPacket packet) {
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
- this.player.getInventory().pickSlot(packet.getSlot());
- int i = this.player.getInventory().selected;
- this.player.connection.send(this.player.getInventory().createInventoryUpdatePacket(i));
- this.player.connection.send(this.player.getInventory().createInventoryUpdatePacket(packet.getSlot()));
- this.player.connection.send(new ClientboundSetHeldSlotPacket(i));
+ public void handlePickItemFromBlock(ServerboundPickItemFromBlockPacket serverboundPickItemFromBlockPacket) {
+ ServerLevel serverLevel = this.player.serverLevel();
+ PacketUtils.ensureRunningOnSameThread(serverboundPickItemFromBlockPacket, this, serverLevel);
+ BlockPos blockPos = serverboundPickItemFromBlockPacket.pos();
+ if (this.player.canInteractWithBlock(blockPos, 1.0)) {
+ if (serverLevel.isLoaded(blockPos)) {
+ BlockState blockState = serverLevel.getBlockState(blockPos);
+ ItemStack cloneItemStack = blockState.getCloneItemStack(serverLevel, blockPos);
+ if (!cloneItemStack.isEmpty()) {
+ if (this.player.hasInfiniteMaterials() && serverboundPickItemFromBlockPacket.includeData()) {
+ addBlockDataToItem(blockState, serverLevel, blockPos, cloneItemStack);
+ }
+
+ this.tryPickItem(cloneItemStack);
+ }
+ }
+ }
+ }
+
+ private static void addBlockDataToItem(BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, ItemStack itemStack) {
+ BlockEntity blockEntity = blockState.hasBlockEntity() ? serverLevel.getBlockEntity(blockPos) : null;
+ if (blockEntity != null) {
+ CompoundTag compoundTag = blockEntity.saveCustomOnly(serverLevel.registryAccess());
+ blockEntity.removeComponentsFromTag(compoundTag);
+ BlockItem.setBlockEntityData(itemStack, blockEntity.getType(), compoundTag);
+ itemStack.applyComponents(blockEntity.collectComponents());
+ }
+ }
+
+ @Override
+ public void handlePickItemFromEntity(ServerboundPickItemFromEntityPacket serverboundPickItemFromEntityPacket) {
+ ServerLevel serverLevel = this.player.serverLevel();
+ PacketUtils.ensureRunningOnSameThread(serverboundPickItemFromEntityPacket, this, serverLevel);
+ Entity entity = serverLevel.getEntity(serverboundPickItemFromEntityPacket.id());
+ if (entity != null && this.player.canInteractWithEntity(entity, 3.0)) {
+ ItemStack pickResult = entity.getPickResult();
+ if (pickResult != null && !pickResult.isEmpty()) {
+ this.tryPickItem(pickResult);
+ }
+ }
+ }
+
+ private void tryPickItem(ItemStack itemStack) {
+ if (itemStack.isItemEnabled(this.player.level().enabledFeatures())) {
+ Inventory inventory = this.player.getInventory();
+ int i = inventory.findSlotMatchingItem(itemStack);
+ if (i != -1) {
+ if (Inventory.isHotbarSlot(i)) {
+ inventory.selected = i;
+ } else {
+ inventory.pickSlot(i);
+ }
+ } else if (this.player.hasInfiniteMaterials()) {
+ inventory.addAndPickItem(itemStack);
+ }
+
+ this.player.connection.send(new ClientboundSetHeldSlotPacket(inventory.selected));
+ this.player.inventoryMenu.broadcastChanges();
+ }
}
@Override
@@ -1714,27 +1767,15 @@ public class ServerGamePacketListenerImpl
if (this.player.gameMode.isCreative()) {
boolean flag = packet.slotNum() < 0;
ItemStack itemStack = packet.itemStack();
- ItemStack itemStack1 = itemStack.copy();
if (!itemStack.isItemEnabled(this.player.level().enabledFeatures())) {
return;
}
- CustomData customData = itemStack.getOrDefault(DataComponents.BLOCK_ENTITY_DATA, CustomData.EMPTY);
- if (customData.contains("x") && customData.contains("y") && customData.contains("z")) {
- BlockPos posFromTag = BlockEntity.getPosFromTag(customData.getUnsafe());
- if (this.player.level().isLoaded(posFromTag)) {
- BlockEntity blockEntity = this.player.level().getBlockEntity(posFromTag);
- if (blockEntity != null) {
- blockEntity.saveToItem(itemStack, this.player.level().registryAccess());
- }
- }
- }
-
boolean flag1 = packet.slotNum() >= 1 && packet.slotNum() <= 45;
boolean flag2 = itemStack.isEmpty() || itemStack.getCount() <= itemStack.getMaxStackSize();
if (flag1 && flag2) {
this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemStack);
- this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack1);
+ this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack);
this.player.inventoryMenu.broadcastChanges();
} else if (flag && flag2) {
if (this.dropSpamThrottler.isUnderThreshold()) {
@@ -1775,7 +1816,11 @@ public class ServerGamePacketListenerImpl
@Override
public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
+ boolean isModelPartShown = this.player.isModelPartShown(PlayerModelPart.HAT);
this.player.updateOptions(packet.information());
+ if (this.player.isModelPartShown(PlayerModelPart.HAT) != isModelPartShown) {
+ this.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_HAT, this.player));
+ }
}
@Override
diff --git a/net/minecraft/sounds/SoundEvents.java b/net/minecraft/sounds/SoundEvents.java
index a26ba45..f076ce7 100644
--- a/net/minecraft/sounds/SoundEvents.java
+++ b/net/minecraft/sounds/SoundEvents.java
@@ -392,6 +392,7 @@ public class SoundEvents {
public static final SoundEvent CREAKING_UNFREEZE = register("entity.creaking.unfreeze");
public static final SoundEvent CREAKING_SPAWN = register("entity.creaking.spawn");
public static final SoundEvent CREAKING_SWAY = register("entity.creaking.sway");
+ public static final SoundEvent CREAKING_TWITCH = register("entity.creaking.twitch");
public static final SoundEvent CREAKING_HEART_BREAK = register("block.creaking_heart.break");
public static final SoundEvent CREAKING_HEART_FALL = register("block.creaking_heart.fall");
public static final SoundEvent CREAKING_HEART_HIT = register("block.creaking_heart.hit");
@@ -530,6 +531,11 @@ public class SoundEvents {
public static final SoundEvent EVOKER_PREPARE_WOLOLO = register("entity.evoker.prepare_wololo");
public static final SoundEvent EXPERIENCE_BOTTLE_THROW = register("entity.experience_bottle.throw");
public static final SoundEvent EXPERIENCE_ORB_PICKUP = register("entity.experience_orb.pickup");
+ public static final SoundEvent EYEBLOSSOM_OPEN_LONG = register("block.eyeblossom.open_long");
+ public static final SoundEvent EYEBLOSSOM_OPEN = register("block.eyeblossom.open");
+ public static final SoundEvent EYEBLOSSOM_CLOSE_LONG = register("block.eyeblossom.close_long");
+ public static final SoundEvent EYEBLOSSOM_CLOSE = register("block.eyeblossom.close");
+ public static final SoundEvent EYEBLOSSOM_IDLE = register("block.eyeblossom.idle");
public static final SoundEvent FENCE_GATE_CLOSE = register("block.fence_gate.close");
public static final SoundEvent FENCE_GATE_OPEN = register("block.fence_gate.open");
public static final SoundEvent FIRECHARGE_USE = register("item.firecharge.use");
@@ -1324,6 +1330,16 @@ public class SoundEvents {
public static final SoundEvent SPAWNER_HIT = register("block.spawner.hit");
public static final SoundEvent SPAWNER_PLACE = register("block.spawner.place");
public static final SoundEvent SPAWNER_STEP = register("block.spawner.step");
+ public static final SoundEvent RESIN_BREAK = register("block.resin.break");
+ public static final SoundEvent RESIN_FALL = register("block.resin.fall");
+ public static final SoundEvent RESIN_HIT = register("block.resin.hit");
+ public static final SoundEvent RESIN_PLACE = register("block.resin.place");
+ public static final SoundEvent RESIN_STEP = register("block.resin.step");
+ public static final SoundEvent RESIN_BRICKS_BREAK = register("block.resin_bricks.break");
+ public static final SoundEvent RESIN_BRICKS_FALL = register("block.resin_bricks.fall");
+ public static final SoundEvent RESIN_BRICKS_HIT = register("block.resin_bricks.hit");
+ public static final SoundEvent RESIN_BRICKS_PLACE = register("block.resin_bricks.place");
+ public static final SoundEvent RESIN_BRICKS_STEP = register("block.resin_bricks.step");
public static final SoundEvent SPORE_BLOSSOM_BREAK = register("block.spore_blossom.break");
public static final SoundEvent SPORE_BLOSSOM_FALL = register("block.spore_blossom.fall");
public static final SoundEvent SPORE_BLOSSOM_HIT = register("block.spore_blossom.hit");
diff --git a/net/minecraft/util/ARGB.java b/net/minecraft/util/ARGB.java
index 44f4132..a555878 100644
--- a/net/minecraft/util/ARGB.java
+++ b/net/minecraft/util/ARGB.java
@@ -110,7 +110,23 @@ public class ARGB {
return Mth.floor(f * 255.0F);
}
- public static float from8BitChannel(int i) {
+ public static float alphaFloat(int i) {
+ return from8BitChannel(alpha(i));
+ }
+
+ public static float redFloat(int i) {
+ return from8BitChannel(red(i));
+ }
+
+ public static float greenFloat(int i) {
+ return from8BitChannel(green(i));
+ }
+
+ public static float blueFloat(int i) {
+ return from8BitChannel(blue(i));
+ }
+
+ private static float from8BitChannel(int i) {
return i / 255.0F;
}
diff --git a/net/minecraft/util/SpawnUtil.java b/net/minecraft/util/SpawnUtil.java
index 0e46c4d..53d7861 100644
--- a/net/minecraft/util/SpawnUtil.java
+++ b/net/minecraft/util/SpawnUtil.java
@@ -24,7 +24,8 @@ public class SpawnUtil {
int i,
int i1,
int i2,
- SpawnUtil.Strategy strategy
+ SpawnUtil.Strategy strategy,
+ boolean flag
) {
BlockPos.MutableBlockPos mutableBlockPos = blockPos.mutable();
@@ -32,7 +33,12 @@ public class SpawnUtil {
int i4 = Mth.randomBetweenInclusive(serverLevel.random, -i1, i1);
int i5 = Mth.randomBetweenInclusive(serverLevel.random, -i1, i1);
mutableBlockPos.setWithOffset(blockPos, i4, i2, i5);
- if (serverLevel.getWorldBorder().isWithinBounds(mutableBlockPos) && moveToPossibleSpawnPosition(serverLevel, i2, mutableBlockPos, strategy)) {
+ if (serverLevel.getWorldBorder().isWithinBounds(mutableBlockPos)
+ && moveToPossibleSpawnPosition(serverLevel, i2, mutableBlockPos, strategy)
+ && (
+ !flag
+ || serverLevel.noCollision(entityType.getSpawnAABB(mutableBlockPos.getX() + 0.5, mutableBlockPos.getY(), mutableBlockPos.getZ() + 0.5))
+ )) {
T mob = (T)entityType.create(serverLevel, null, mutableBlockPos, entitySpawnReason, false, false);
if (mob != null) {
if (mob.checkSpawnRules(serverLevel, entitySpawnReason) && mob.checkSpawnObstruction(serverLevel)) {
diff --git a/net/minecraft/util/datafix/DataFixers.java b/net/minecraft/util/datafix/DataFixers.java
index 9dd9b11..6ebf02b 100644
--- a/net/minecraft/util/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -91,6 +91,7 @@ import net.minecraft.util.datafix.fixes.EntityCodSalmonFix;
import net.minecraft.util.datafix.fixes.EntityCustomNameToComponentFix;
import net.minecraft.util.datafix.fixes.EntityElderGuardianSplitFix;
import net.minecraft.util.datafix.fixes.EntityEquipmentToArmorAndHandFix;
+import net.minecraft.util.datafix.fixes.EntityFieldsRenameFix;
import net.minecraft.util.datafix.fixes.EntityGoatMissingStateFix;
import net.minecraft.util.datafix.fixes.EntityHealthFix;
import net.minecraft.util.datafix.fixes.EntityHorseSaddleFix;
@@ -98,7 +99,6 @@ import net.minecraft.util.datafix.fixes.EntityHorseSplitFix;
import net.minecraft.util.datafix.fixes.EntityIdFix;
import net.minecraft.util.datafix.fixes.EntityItemFrameDirectionFix;
import net.minecraft.util.datafix.fixes.EntityMinecartIdentifiersFix;
-import net.minecraft.util.datafix.fixes.EntityPaintingFieldsRenameFix;
import net.minecraft.util.datafix.fixes.EntityPaintingItemFrameDirectionFix;
import net.minecraft.util.datafix.fixes.EntityPaintingMotiveFix;
import net.minecraft.util.datafix.fixes.EntityProjectileOwnerFix;
@@ -1144,7 +1144,9 @@ public class DataFixers {
)
);
Schema schema163 = builder.addSchema(3090, SAME_NAMESPACED);
- builder.addFixer(new EntityPaintingFieldsRenameFix(schema163));
+ builder.addFixer(
+ new EntityFieldsRenameFix(schema163, "EntityPaintingFieldsRenameFix", "minecraft:painting", Map.of("Motive", "variant", "Facing", "facing"))
+ );
Schema schema164 = builder.addSchema(3093, SAME_NAMESPACED);
builder.addFixer(new EntityGoatMissingStateFix(schema164));
Schema schema165 = builder.addSchema(3094, SAME_NAMESPACED);
@@ -1392,6 +1394,8 @@ public class DataFixers {
builder.addFixer(new AddNewChoices(schema235, "Added Creaking Heart", References.BLOCK_ENTITY));
Schema schema236 = builder.addSchema(4081, SAME_NAMESPACED);
builder.addFixer(new EntitySalmonSizeFix(schema236));
+ Schema schema237 = builder.addSchema(4173, SAME_NAMESPACED);
+ builder.addFixer(new EntityFieldsRenameFix(schema237, "Rename TNT Minecart fuse", "minecraft:tnt_minecart", Map.of("TNTFuse", "fuse")));
}
private static UnaryOperator<String> createRenamerNoNamespace(Map<String, String> renameMap) {
diff --git a/net/minecraft/util/datafix/fixes/EntityFieldsRenameFix.java b/net/minecraft/util/datafix/fixes/EntityFieldsRenameFix.java
new file mode 100644
index 0000000..c588435
--- /dev/null
+++ b/net/minecraft/util/datafix/fixes/EntityFieldsRenameFix.java
@@ -0,0 +1,30 @@
+package net.minecraft.util.datafix.fixes;
+
+import com.mojang.datafixers.DSL;
+import com.mojang.datafixers.Typed;
+import com.mojang.datafixers.schemas.Schema;
+import com.mojang.serialization.Dynamic;
+import java.util.Map;
+import java.util.Map.Entry;
+
+public class EntityFieldsRenameFix extends NamedEntityFix {
+ private final Map<String, String> renames;
+
+ public EntityFieldsRenameFix(Schema outputSchema, String name, String entityName, Map<String, String> map) {
+ super(outputSchema, false, name, References.ENTITY, entityName);
+ this.renames = map;
+ }
+
+ public Dynamic<?> fixTag(Dynamic<?> dynamic) {
+ for (Entry<String, String> entry : this.renames.entrySet()) {
+ dynamic = dynamic.renameField(entry.getKey(), entry.getValue());
+ }
+
+ return dynamic;
+ }
+
+ @Override
+ protected Typed<?> fix(Typed<?> typed) {
+ return typed.update(DSL.remainderFinder(), this::fixTag);
+ }
+}
diff --git a/net/minecraft/util/profiling/jfr/JfrProfiler.java b/net/minecraft/util/profiling/jfr/JfrProfiler.java
index 94cb039..ba7505d 100644
--- a/net/minecraft/util/profiling/jfr/JfrProfiler.java
+++ b/net/minecraft/util/profiling/jfr/JfrProfiler.java
@@ -29,6 +29,7 @@ import jdk.jfr.RecordingState;
import net.minecraft.FileUtil;
import net.minecraft.SharedConstants;
import net.minecraft.Util;
+import net.minecraft.core.Holder;
import net.minecraft.network.ConnectionProtocol;
import net.minecraft.network.protocol.PacketType;
import net.minecraft.resources.ResourceKey;
@@ -40,11 +41,13 @@ import net.minecraft.util.profiling.jfr.event.NetworkSummaryEvent;
import net.minecraft.util.profiling.jfr.event.PacketReceivedEvent;
import net.minecraft.util.profiling.jfr.event.PacketSentEvent;
import net.minecraft.util.profiling.jfr.event.ServerTickTimeEvent;
+import net.minecraft.util.profiling.jfr.event.StructureGenerationEvent;
import net.minecraft.util.profiling.jfr.event.WorldLoadFinishedEvent;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.storage.RegionFileVersion;
import net.minecraft.world.level.chunk.storage.RegionStorageInfo;
+import net.minecraft.world.level.levelgen.structure.Structure;
import org.slf4j.Logger;
public class JfrProfiler implements JvmProfiler {
@@ -62,6 +65,7 @@ public class JfrProfiler implements JvmProfiler {
PacketSentEvent.class,
NetworkSummaryEvent.class,
ServerTickTimeEvent.class,
+ StructureGenerationEvent.class,
WorldLoadFinishedEvent.class
);
private static final String FLIGHT_RECORDER_CONFIG = "/flightrecorder-config.jfc";
@@ -243,7 +247,7 @@ public class JfrProfiler implements JvmProfiler {
} else {
WorldLoadFinishedEvent worldLoadFinishedEvent = new WorldLoadFinishedEvent();
worldLoadFinishedEvent.begin();
- return worldLoadFinishedEvent::commit;
+ return flag -> worldLoadFinishedEvent.commit();
}
}
@@ -255,7 +259,22 @@ public class JfrProfiler implements JvmProfiler {
} else {
ChunkGenerationEvent chunkGenerationEvent = new ChunkGenerationEvent(chunkPos, level, name);
chunkGenerationEvent.begin();
- return chunkGenerationEvent::commit;
+ return flag -> chunkGenerationEvent.commit();
+ }
+ }
+
+ @Nullable
+ @Override
+ public ProfiledDuration onStructureGenerate(ChunkPos chunkPos, ResourceKey<Level> resourceKey, Holder<Structure> holder) {
+ if (!StructureGenerationEvent.TYPE.isEnabled()) {
+ return null;
+ } else {
+ StructureGenerationEvent structureGenerationEvent = new StructureGenerationEvent(chunkPos, holder, resourceKey);
+ structureGenerationEvent.begin();
+ return flag -> {
+ structureGenerationEvent.success = flag;
+ structureGenerationEvent.commit();
+ };
}
}
}
diff --git a/net/minecraft/util/profiling/jfr/JvmProfiler.java b/net/minecraft/util/profiling/jfr/JvmProfiler.java
index 24e88ee..4ee797a 100644
--- a/net/minecraft/util/profiling/jfr/JvmProfiler.java
+++ b/net/minecraft/util/profiling/jfr/JvmProfiler.java
@@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils;
import java.net.SocketAddress;
import java.nio.file.Path;
import javax.annotation.Nullable;
+import net.minecraft.core.Holder;
import net.minecraft.network.ConnectionProtocol;
import net.minecraft.network.protocol.PacketType;
import net.minecraft.resources.ResourceKey;
@@ -12,6 +13,7 @@ import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.storage.RegionFileVersion;
import net.minecraft.world.level.chunk.storage.RegionStorageInfo;
+import net.minecraft.world.level.levelgen.structure.Structure;
import org.slf4j.Logger;
public interface JvmProfiler {
@@ -43,9 +45,12 @@ public interface JvmProfiler {
@Nullable
ProfiledDuration onChunkGenerate(ChunkPos chunkPos, ResourceKey<Level> level, String name);
+ @Nullable
+ ProfiledDuration onStructureGenerate(ChunkPos chunkPos, ResourceKey<Level> resourceKey, Holder<Structure> holder);
+
public static class NoOpProfiler implements JvmProfiler {
private static final Logger LOGGER = LogUtils.getLogger();
- static final ProfiledDuration noOpCommit = () -> {};
+ static final ProfiledDuration noOpCommit = flag -> {};
@Override
public boolean start(Environment environment) {
@@ -98,5 +103,10 @@ public interface JvmProfiler {
public ProfiledDuration onChunkGenerate(ChunkPos chunkPos, ResourceKey<Level> level, String name) {
return null;
}
+
+ @Override
+ public ProfiledDuration onStructureGenerate(ChunkPos chunkPos, ResourceKey<Level> resourceKey, Holder<Structure> holder) {
+ return noOpCommit;
+ }
}
}
diff --git a/net/minecraft/util/profiling/jfr/callback/ProfiledDuration.java b/net/minecraft/util/profiling/jfr/callback/ProfiledDuration.java
index 8304694..6da97f7 100644
--- a/net/minecraft/util/profiling/jfr/callback/ProfiledDuration.java
+++ b/net/minecraft/util/profiling/jfr/callback/ProfiledDuration.java
@@ -2,5 +2,5 @@ package net.minecraft.util.profiling.jfr.callback;
@FunctionalInterface
public interface ProfiledDuration {
- void finish();
+ void finish(boolean flag);
}
diff --git a/net/minecraft/util/profiling/jfr/event/StructureGenerationEvent.java b/net/minecraft/util/profiling/jfr/event/StructureGenerationEvent.java
new file mode 100644
index 0000000..2976571
--- /dev/null
+++ b/net/minecraft/util/profiling/jfr/event/StructureGenerationEvent.java
@@ -0,0 +1,56 @@
+package net.minecraft.util.profiling.jfr.event;
+
+import jdk.jfr.Category;
+import jdk.jfr.Enabled;
+import jdk.jfr.Event;
+import jdk.jfr.EventType;
+import jdk.jfr.Label;
+import jdk.jfr.Name;
+import jdk.jfr.StackTrace;
+import net.minecraft.core.Holder;
+import net.minecraft.obfuscate.DontObfuscate;
+import net.minecraft.resources.ResourceKey;
+import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.levelgen.structure.Structure;
+
+@Name("minecraft.StructureGeneration")
+@Label("Structure Generation")
+@Category({"Minecraft", "World Generation"})
+@StackTrace(false)
+@Enabled(false)
+@DontObfuscate
+public class StructureGenerationEvent extends Event {
+ public static final String EVENT_NAME = "minecraft.StructureGeneration";
+ public static final EventType TYPE = EventType.getEventType(StructureGenerationEvent.class);
+ @Name("chunkPosX")
+ @Label("Chunk X Position")
+ public final int chunkPosX;
+ @Name("chunkPosZ")
+ @Label("Chunk Z Position")
+ public final int chunkPosZ;
+ @Name("structure")
+ @Label("Structure")
+ public final String structure;
+ @Name("level")
+ @Label("Level")
+ public final String level;
+ @Name("success")
+ @Label("Success")
+ public boolean success;
+
+ public StructureGenerationEvent(ChunkPos chunkPos, Holder<Structure> holder, ResourceKey<Level> resourceKey) {
+ this.chunkPosX = chunkPos.x;
+ this.chunkPosZ = chunkPos.z;
+ this.structure = holder.getRegisteredName();
+ this.level = resourceKey.location().toString();
+ }
+
+ public interface Fields {
+ String CHUNK_POS_X = "chunkPosX";
+ String CHUNK_POS_Z = "chunkPosZ";
+ String STRUCTURE = "structure";
+ String LEVEL = "level";
+ String SUCCESS = "success";
+ }
+}
diff --git a/net/minecraft/util/profiling/jfr/parse/JfrStatsParser.java b/net/minecraft/util/profiling/jfr/parse/JfrStatsParser.java
index ebe610b..62a46dd 100644
--- a/net/minecraft/util/profiling/jfr/parse/JfrStatsParser.java
+++ b/net/minecraft/util/profiling/jfr/parse/JfrStatsParser.java
@@ -25,6 +25,7 @@ import net.minecraft.util.profiling.jfr.stats.FileIOStat;
import net.minecraft.util.profiling.jfr.stats.GcHeapStat;
import net.minecraft.util.profiling.jfr.stats.IoSummary;
import net.minecraft.util.profiling.jfr.stats.PacketIdentification;
+import net.minecraft.util.profiling.jfr.stats.StructureGenStat;
import net.minecraft.util.profiling.jfr.stats.ThreadAllocationStat;
import net.minecraft.util.profiling.jfr.stats.TickTimeStat;
@@ -32,6 +33,7 @@ public class JfrStatsParser {
private Instant recordingStarted = Instant.EPOCH;
private Instant recordingEnded = Instant.EPOCH;
private final List<ChunkGenStat> chunkGenStats = Lists.newArrayList();
+ private final List<StructureGenStat> structureGenStats = Lists.newArrayList();
private final List<CpuLoadStat> cpuLoadStat = Lists.newArrayList();
private final Map<PacketIdentification, JfrStatsParser.MutableCountAndSize> receivedPackets = Maps.newHashMap();
private final Map<PacketIdentification, JfrStatsParser.MutableCountAndSize> sentPackets = Maps.newHashMap();
@@ -101,7 +103,8 @@ public class JfrStatsParser {
collectIoStats(duration, this.readChunks),
FileIOStat.summary(duration, this.fileWrites),
FileIOStat.summary(duration, this.fileReads),
- this.chunkGenStats
+ this.chunkGenStats,
+ this.structureGenStats
);
}
@@ -120,6 +123,9 @@ public class JfrStatsParser {
case "minecraft.ChunkGeneration":
this.chunkGenStats.add(ChunkGenStat.from(recordedEvent));
break;
+ case "minecraft.StructureGeneration":
+ this.structureGenStats.add(StructureGenStat.from(recordedEvent));
+ break;
case "minecraft.LoadWorld":
this.worldCreationDuration = recordedEvent.getDuration();
break;
diff --git a/net/minecraft/util/profiling/jfr/parse/JfrStatsResult.java b/net/minecraft/util/profiling/jfr/parse/JfrStatsResult.java
index dd8c18d..dd08548 100644
--- a/net/minecraft/util/profiling/jfr/parse/JfrStatsResult.java
+++ b/net/minecraft/util/profiling/jfr/parse/JfrStatsResult.java
@@ -16,6 +16,7 @@ import net.minecraft.util.profiling.jfr.stats.FileIOStat;
import net.minecraft.util.profiling.jfr.stats.GcHeapStat;
import net.minecraft.util.profiling.jfr.stats.IoSummary;
import net.minecraft.util.profiling.jfr.stats.PacketIdentification;
+import net.minecraft.util.profiling.jfr.stats.StructureGenStat;
import net.minecraft.util.profiling.jfr.stats.ThreadAllocationStat;
import net.minecraft.util.profiling.jfr.stats.TickTimeStat;
import net.minecraft.util.profiling.jfr.stats.TimedStatSummary;
@@ -36,7 +37,8 @@ public record JfrStatsResult(
IoSummary<ChunkIdentification> readChunks,
FileIOStat.Summary fileWrites,
FileIOStat.Summary fileReads,
- List<ChunkGenStat> chunkGenStats
+ List<ChunkGenStat> chunkGenStats,
+ List<StructureGenStat> structureGenStats
) {
public List<Pair<ChunkStatus, TimedStatSummary<ChunkGenStat>>> chunkGenSummary() {
Map<ChunkStatus, List<ChunkGenStat>> map = this.chunkGenStats.stream().collect(Collectors.groupingBy(ChunkGenStat::status));
diff --git a/net/minecraft/util/profiling/jfr/serialize/JfrResultJsonSerializer.java b/net/minecraft/util/profiling/jfr/serialize/JfrResultJsonSerializer.java
index 79dccb8..18d27b3 100644
--- a/net/minecraft/util/profiling/jfr/serialize/JfrResultJsonSerializer.java
+++ b/net/minecraft/util/profiling/jfr/serialize/JfrResultJsonSerializer.java
@@ -16,6 +16,7 @@ import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.ToDoubleFunction;
+import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
import net.minecraft.Util;
import net.minecraft.util.profiling.jfr.Percentiles;
@@ -27,6 +28,7 @@ import net.minecraft.util.profiling.jfr.stats.FileIOStat;
import net.minecraft.util.profiling.jfr.stats.GcHeapStat;
import net.minecraft.util.profiling.jfr.stats.IoSummary;
import net.minecraft.util.profiling.jfr.stats.PacketIdentification;
+import net.minecraft.util.profiling.jfr.stats.StructureGenStat;
import net.minecraft.util.profiling.jfr.stats.ThreadAllocationStat;
import net.minecraft.util.profiling.jfr.stats.TickTimeStat;
import net.minecraft.util.profiling.jfr.stats.TimedStatSummary;
@@ -69,6 +71,7 @@ public class JfrResultJsonSerializer {
jsonObject.add("serverTick", this.serverTicks(result.tickTimes()));
jsonObject.add("threadAllocation", this.threadAllocations(result.threadAllocationSummary()));
jsonObject.add("chunkGen", this.chunkGen(result.chunkGenSummary()));
+ jsonObject.add("structureGen", this.structureGen(result.structureGenStats()));
return this.gson.toJson((JsonElement)jsonObject);
}
@@ -81,6 +84,45 @@ public class JfrResultJsonSerializer {
return jsonObject;
}
+ private JsonElement structureGen(List<StructureGenStat> list) {
+ JsonObject jsonObject = new JsonObject();
+ TimedStatSummary<StructureGenStat> timedStatSummary = TimedStatSummary.summary(list);
+ JsonArray jsonArray = new JsonArray();
+ jsonObject.add("structure", jsonArray);
+ list.stream()
+ .collect(Collectors.groupingBy(StructureGenStat::structureName))
+ .forEach(
+ (string, list1) -> {
+ JsonObject jsonObject1 = new JsonObject();
+ jsonArray.add(jsonObject1);
+ jsonObject1.addProperty("name", string);
+ TimedStatSummary<StructureGenStat> timedStatSummary1 = TimedStatSummary.summary((List<StructureGenStat>)list1);
+ jsonObject1.addProperty("count", timedStatSummary1.count());
+ jsonObject1.addProperty("durationNanosTotal", timedStatSummary1.totalDuration().toNanos());
+ jsonObject1.addProperty("durationNanosAvg", timedStatSummary1.totalDuration().toNanos() / timedStatSummary1.count());
+ JsonObject jsonObject2 = Util.make(new JsonObject(), jsonObject3 -> jsonObject1.add("durationNanosPercentiles", jsonObject3));
+ timedStatSummary1.percentilesNanos().forEach((integer, _double) -> jsonObject2.addProperty("p" + integer, _double));
+ Function<StructureGenStat, JsonElement> function = structureGenStat -> {
+ JsonObject jsonObject3 = new JsonObject();
+ jsonObject3.addProperty("durationNanos", structureGenStat.duration().toNanos());
+ jsonObject3.addProperty("chunkPosX", structureGenStat.chunkPos().x);
+ jsonObject3.addProperty("chunkPosZ", structureGenStat.chunkPos().z);
+ jsonObject3.addProperty("structureName", structureGenStat.structureName());
+ jsonObject3.addProperty("level", structureGenStat.level());
+ jsonObject3.addProperty("success", structureGenStat.success());
+ return jsonObject3;
+ };
+ jsonObject.add("fastest", function.apply(timedStatSummary.fastest()));
+ jsonObject.add("slowest", function.apply(timedStatSummary.slowest()));
+ jsonObject.add(
+ "secondSlowest",
+ (JsonElement)(timedStatSummary.secondSlowest() != null ? function.apply(timedStatSummary.secondSlowest()) : JsonNull.INSTANCE)
+ );
+ }
+ );
+ return jsonObject;
+ }
+
private JsonElement chunkGen(List<Pair<ChunkStatus, TimedStatSummary<ChunkGenStat>>> summary) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("durationNanosTotal", summary.stream().mapToDouble(pair1 -> pair1.getSecond().totalDuration().toNanos()).sum());
diff --git a/net/minecraft/util/profiling/jfr/stats/StructureGenStat.java b/net/minecraft/util/profiling/jfr/stats/StructureGenStat.java
new file mode 100644
index 0000000..0c4a58c
--- /dev/null
+++ b/net/minecraft/util/profiling/jfr/stats/StructureGenStat.java
@@ -0,0 +1,17 @@
+package net.minecraft.util.profiling.jfr.stats;
+
+import java.time.Duration;
+import jdk.jfr.consumer.RecordedEvent;
+import net.minecraft.world.level.ChunkPos;
+
+public record StructureGenStat(@Override Duration duration, ChunkPos chunkPos, String structureName, String level, boolean success) implements TimedStat {
+ public static StructureGenStat from(RecordedEvent recordedEvent) {
+ return new StructureGenStat(
+ recordedEvent.getDuration(),
+ new ChunkPos(recordedEvent.getInt("chunkPosX"), recordedEvent.getInt("chunkPosX")),
+ recordedEvent.getString("structure"),
+ recordedEvent.getString("level"),
+ recordedEvent.getBoolean("success")
+ );
+ }
+}
diff --git a/net/minecraft/util/thread/BlockableEventLoop.java b/net/minecraft/util/thread/BlockableEventLoop.java
index 700f11a..1c425d6 100644
--- a/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/net/minecraft/util/thread/BlockableEventLoop.java
@@ -143,13 +143,13 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
}
protected void doRunTask(R task) {
- try (Zone zone = TracyClient.beginZone("Task", SharedConstants.IS_RUNNING_IN_IDE)) {
- task.run();
+ try {
+ try (Zone zone = TracyClient.beginZone("Task", SharedConstants.IS_RUNNING_IN_IDE)) {
+ task.run();
+ }
} catch (Exception var7) {
LOGGER.error(LogUtils.FATAL_MARKER, "Error executing task on {}", this.name(), var7);
- if (isNonRecoverable(var7)) {
- throw var7;
- }
+ throw var7;
}
}
diff --git a/net/minecraft/world/effect/PoisonMobEffect.java b/net/minecraft/world/effect/PoisonMobEffect.java
index c165662..321ebcc 100644
--- a/net/minecraft/world/effect/PoisonMobEffect.java
+++ b/net/minecraft/world/effect/PoisonMobEffect.java
@@ -3,7 +3,9 @@ package net.minecraft.world.effect;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.LivingEntity;
-class PoisonMobEffect extends MobEffect {
+public class PoisonMobEffect extends MobEffect {
+ public static final int DAMAGE_INTERVAL = 25;
+
protected PoisonMobEffect(MobEffectCategory category, int color) {
super(category, color);
}
diff --git a/net/minecraft/world/effect/WitherMobEffect.java b/net/minecraft/world/effect/WitherMobEffect.java
index 42190ac..84d0960 100644
--- a/net/minecraft/world/effect/WitherMobEffect.java
+++ b/net/minecraft/world/effect/WitherMobEffect.java
@@ -3,7 +3,9 @@ package net.minecraft.world.effect;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.LivingEntity;
-class WitherMobEffect extends MobEffect {
+public class WitherMobEffect extends MobEffect {
+ public static final int DAMAGE_INTERVAL = 40;
+
protected WitherMobEffect(MobEffectCategory category, int color) {
super(category, color);
}
diff --git a/net/minecraft/world/entity/AreaEffectCloud.java b/net/minecraft/world/entity/AreaEffectCloud.java
index 58b53aa..50743ae 100644
--- a/net/minecraft/world/entity/AreaEffectCloud.java
+++ b/net/minecraft/world/entity/AreaEffectCloud.java
@@ -309,14 +309,15 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
@Nullable
@Override
public LivingEntity getOwner() {
- if (this.owner == null && this.ownerUUID != null && this.level() instanceof ServerLevel) {
- Entity entity = ((ServerLevel)this.level()).getEntity(this.ownerUUID);
- if (entity instanceof LivingEntity) {
- this.owner = (LivingEntity)entity;
+ if (this.owner != null && !this.owner.isRemoved()) {
+ return this.owner;
+ } else {
+ if (this.ownerUUID != null && this.level() instanceof ServerLevel serverLevel) {
+ this.owner = serverLevel.getEntity(this.ownerUUID) instanceof LivingEntity livingEntity ? livingEntity : null;
}
- }
- return this.owner;
+ return this.owner;
+ }
}
@Override
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index bd4b7b1..45563b3 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -750,9 +750,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
this.movementThisTick.add(new Entity.Movement(vec3, vec31));
- this.checkInsideBlocks(this.movementThisTick, this.blocksInside);
- boolean flag = Iterables.any(this.blocksInside, blockState1 -> blockState1.is(BlockTags.FIRE) || blockState1.is(Blocks.LAVA));
+ List<Entity.Movement> list = List.copyOf(this.movementThisTick);
this.movementThisTick.clear();
+ this.checkInsideBlocks(list, this.blocksInside);
+ boolean flag = Iterables.any(this.blocksInside, blockState1 -> blockState1.is(BlockTags.FIRE) || blockState1.is(Blocks.LAVA));
this.blocksInside.clear();
if (!flag && this.isAlive()) {
if (this.remainingFireTicks <= 0) {
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
index c110ce0..18bcdf9 100644
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
@@ -342,13 +342,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
"cow", EntityType.Builder.of(Cow::new, MobCategory.CREATURE).sized(0.9F, 1.4F).eyeHeight(1.3F).passengerAttachments(1.36875F).clientTrackingRange(10)
);
public static final EntityType<Creaking> CREAKING = register(
- "creaking",
- EntityType.Builder.of(Creaking::new, MobCategory.MONSTER)
- .fireImmune()
- .sized(0.9F, 2.7F)
- .eyeHeight(2.3F)
- .clientTrackingRange(8)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
+ "creaking", EntityType.Builder.of(Creaking::new, MobCategory.MONSTER).sized(0.9F, 2.7F).eyeHeight(2.3F).clientTrackingRange(8)
);
public static final EntityType<CreakingTransient> CREAKING_TRANSIENT = register(
"creaking_transient",
@@ -359,7 +353,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
.sized(0.9F, 2.7F)
.eyeHeight(2.3F)
.clientTrackingRange(8)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final EntityType<Creeper> CREEPER = register(
"creeper", EntityType.Builder.of(Creeper::new, MobCategory.MONSTER).sized(0.6F, 1.7F).clientTrackingRange(8)
@@ -713,7 +706,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
.sized(1.375F, 0.5625F)
.eyeHeight(0.5625F)
.clientTrackingRange(10)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final EntityType<ChestBoat> PALE_OAK_CHEST_BOAT = register(
"pale_oak_chest_boat",
@@ -722,7 +714,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
.sized(1.375F, 0.5625F)
.eyeHeight(0.5625F)
.clientTrackingRange(10)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final EntityType<Panda> PANDA = register(
"panda", EntityType.Builder.of(Panda::new, MobCategory.CREATURE).sized(1.3F, 1.25F).clientTrackingRange(10)
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 0cbf7bc..620ea93 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -24,7 +24,6 @@ import java.util.Optional;
import java.util.Set;
import java.util.Map.Entry;
import java.util.function.BiConsumer;
-import java.util.function.DoubleSupplier;
import java.util.function.Function;
import java.util.function.Predicate;
import javax.annotation.Nonnull;
@@ -1606,30 +1605,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
return !this.isRemoved() && this.getHealth() > 0.0F;
}
- public boolean isLookingAtMe(
- LivingEntity livingEntity, double d, boolean flag, boolean flag1, Predicate<LivingEntity> predicate, DoubleSupplier... doubleSuppliers
- ) {
- if (!predicate.test(livingEntity)) {
- return false;
- } else {
- Vec3 vec3 = livingEntity.getViewVector(1.0F).normalize();
-
- for (DoubleSupplier doubleSupplier : doubleSuppliers) {
- Vec3 vec31 = new Vec3(
- this.getX() - livingEntity.getX(), doubleSupplier.getAsDouble() - livingEntity.getEyeY(), this.getZ() - livingEntity.getZ()
- );
- double len = vec31.length();
- vec31 = vec31.normalize();
- double d1 = vec3.dot(vec31);
- if (d1 > 1.0 - d / (flag ? len : 1.0)) {
- return livingEntity.hasLineOfSight(
- this, flag1 ? ClipContext.Block.VISUAL : ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, doubleSupplier
- );
- }
- }
+ public boolean isLookingAtMe(LivingEntity livingEntity, double d, boolean flag, boolean flag1, double... doubles) {
+ Vec3 vec3 = livingEntity.getViewVector(1.0F).normalize();
- return false;
+ for (double d1 : doubles) {
+ Vec3 vec31 = new Vec3(this.getX() - livingEntity.getX(), d1 - livingEntity.getEyeY(), this.getZ() - livingEntity.getZ());
+ double len = vec31.length();
+ vec31 = vec31.normalize();
+ double d2 = vec3.dot(vec31);
+ if (d2 > 1.0 - d / (flag ? len : 1.0)) {
+ return livingEntity.hasLineOfSight(this, flag1 ? ClipContext.Block.VISUAL : ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, d1);
+ }
}
+
+ return false;
}
@Override
@@ -3018,15 +3007,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
public boolean hasLineOfSight(Entity entity) {
- return this.hasLineOfSight(entity, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, entity::getEyeY);
+ return this.hasLineOfSight(entity, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, entity.getEyeY());
}
- public boolean hasLineOfSight(Entity entity, ClipContext.Block block, ClipContext.Fluid fluid, DoubleSupplier doubleSupplier) {
+ public boolean hasLineOfSight(Entity entity, ClipContext.Block block, ClipContext.Fluid fluid, double d) {
if (entity.level() != this.level()) {
return false;
} else {
Vec3 vec3 = new Vec3(this.getX(), this.getEyeY(), this.getZ());
- Vec3 vec31 = new Vec3(entity.getX(), doubleSupplier.getAsDouble(), entity.getZ());
+ Vec3 vec31 = new Vec3(entity.getX(), d, entity.getZ());
return !(vec31.distanceTo(vec3) > 128.0) && this.level().clip(new ClipContext(vec3, vec31, block, fluid, this)).getType() == HitResult.Type.MISS;
}
}
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index af6c817..3f26c1a 100644
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -122,6 +122,19 @@ public class AttributeMap {
});
}
+ public boolean resetBaseValue(Holder<Attribute> holder) {
+ if (!this.supplier.hasAttribute(holder)) {
+ return false;
+ } else {
+ AttributeInstance attributeInstance = this.attributes.get(holder);
+ if (attributeInstance != null) {
+ attributeInstance.setBaseValue(this.supplier.getBaseValue(holder));
+ }
+
+ return true;
+ }
+ }
+
public ListTag save() {
ListTag listTag = new ListTag();
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
index 8a03c4a..52099ba 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
@@ -32,6 +32,8 @@ import net.minecraft.util.TimeUtil;
import net.minecraft.util.VisibleForDebug;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.Difficulty;
+import net.minecraft.world.InteractionHand;
+import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
@@ -65,6 +67,7 @@ import net.minecraft.world.entity.ai.util.HoverRandomPos;
import net.minecraft.world.entity.ai.village.poi.PoiManager;
import net.minecraft.world.entity.ai.village.poi.PoiRecord;
import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.level.Level;
@@ -74,6 +77,7 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.level.block.DoublePlantBlock;
+import net.minecraft.world.level.block.FlowerBlock;
import net.minecraft.world.level.block.StemBlock;
import net.minecraft.world.level.block.SweetBerryBushBlock;
import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
@@ -571,6 +575,24 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
return flyingPathNavigation;
}
+ @Override
+ public InteractionResult mobInteract(Player player, InteractionHand hand) {
+ ItemStack itemInHand = player.getItemInHand(hand);
+ if (itemInHand.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof FlowerBlock flowerBlock) {
+ MobEffectInstance beeInteractionEffect = flowerBlock.getBeeInteractionEffect();
+ if (beeInteractionEffect != null) {
+ this.usePlayerItem(player, hand, itemInHand);
+ if (!this.level().isClientSide) {
+ this.addEffect(beeInteractionEffect);
+ }
+
+ return InteractionResult.SUCCESS;
+ }
+ }
+
+ return super.mobInteract(player, hand);
+ }
+
@Override
public boolean isFood(ItemStack stack) {
return stack.is(ItemTags.BEE_FOOD);
diff --git a/net/minecraft/world/entity/animal/Salmon.java b/net/minecraft/world/entity/animal/Salmon.java
index 30918a9..8a3f523 100644
--- a/net/minecraft/world/entity/animal/Salmon.java
+++ b/net/minecraft/world/entity/animal/Salmon.java
@@ -1,5 +1,6 @@
package net.minecraft.world.entity.animal;
+import java.util.function.IntFunction;
import javax.annotation.Nullable;
import net.minecraft.core.component.DataComponents;
import net.minecraft.nbt.CompoundTag;
@@ -8,6 +9,7 @@ import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
+import net.minecraft.util.ByIdMap;
import net.minecraft.util.StringRepresentable;
import net.minecraft.util.random.SimpleWeightedRandomList;
import net.minecraft.world.DifficultyInstance;
@@ -25,7 +27,8 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor;
public class Salmon extends AbstractSchoolingFish implements VariantHolder<Salmon.Variant> {
- private static final EntityDataAccessor<String> DATA_TYPE = SynchedEntityData.defineId(Salmon.class, EntityDataSerializers.STRING);
+ private static final String TAG_TYPE = "type";
+ private static final EntityDataAccessor<Integer> DATA_TYPE = SynchedEntityData.defineId(Salmon.class, EntityDataSerializers.INT);
public Salmon(EntityType<? extends Salmon> entityType, Level level) {
super(entityType, level);
@@ -65,7 +68,7 @@ public class Salmon extends AbstractSchoolingFish implements VariantHolder<Salmo
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
- builder.define(DATA_TYPE, Salmon.Variant.MEDIUM.type);
+ builder.define(DATA_TYPE, Salmon.Variant.MEDIUM.id());
}
@Override
@@ -102,12 +105,12 @@ public class Salmon extends AbstractSchoolingFish implements VariantHolder<Salmo
@Override
public void setVariant(Salmon.Variant variant) {
- this.entityData.set(DATA_TYPE, variant.type);
+ this.entityData.set(DATA_TYPE, variant.id);
}
@Override
public Salmon.Variant getVariant() {
- return Salmon.Variant.byName(this.entityData.get(DATA_TYPE));
+ return Salmon.Variant.BY_ID.apply(this.entityData.get(DATA_TYPE));
}
@Nullable
@@ -136,22 +139,29 @@ public class Salmon extends AbstractSchoolingFish implements VariantHolder<Salmo
}
public static enum Variant implements StringRepresentable {
- SMALL("small", 0.5F),
- MEDIUM("medium", 1.0F),
- LARGE("large", 1.5F);
+ SMALL("small", 0, 0.5F),
+ MEDIUM("medium", 1, 1.0F),
+ LARGE("large", 2, 1.5F);
public static final StringRepresentable.EnumCodec<Salmon.Variant> CODEC = StringRepresentable.fromEnum(Salmon.Variant::values);
- final String type;
+ static final IntFunction<Salmon.Variant> BY_ID = ByIdMap.continuous(Salmon.Variant::id, values(), ByIdMap.OutOfBoundsStrategy.CLAMP);
+ private final String name;
+ final int id;
final float boundingBoxScale;
- private Variant(final String string, final float f) {
- this.type = string;
+ private Variant(final String string, final int i, final float f) {
+ this.name = string;
+ this.id = i;
this.boundingBoxScale = f;
}
@Override
public String getSerializedName() {
- return this.type;
+ return this.name;
+ }
+
+ int id() {
+ return this.id;
}
static Salmon.Variant byName(String string) {
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index 5a5f7b5..4384036 100644
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -863,7 +863,7 @@ public class EnderDragon extends Mob implements Enemy {
EnderDragonPart[] subEntities = this.getSubEntities();
for (int i = 0; i < subEntities.length; i++) {
- subEntities[i].setId(i + packet.getId());
+ subEntities[i].setId(i + packet.getId() + 1);
}
}
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
index 3dc3e70..c06c8f1 100644
--- a/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
@@ -33,7 +33,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
private static final int DEFAULT_FUSE_TIME = 80;
private static final float DEFAULT_EXPLOSION_POWER = 4.0F;
private static final String TAG_BLOCK_STATE = "block_state";
- private static final String TAG_FUSE = "fuse";
+ public static final String TAG_FUSE = "fuse";
private static final String TAG_EXPLOSION_POWER = "explosion_power";
private static final ExplosionDamageCalculator USED_PORTAL_DAMAGE_CALCULATOR = new ExplosionDamageCalculator() {
@Override
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
index 9aca178..6c11933 100644
--- a/net/minecraft/world/entity/monster/EnderMan.java
+++ b/net/minecraft/world/entity/monster/EnderMan.java
@@ -3,7 +3,6 @@ package net.minecraft.world.entity.monster;
import java.util.EnumSet;
import java.util.Optional;
import java.util.UUID;
-import java.util.function.DoubleSupplier;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@@ -213,7 +212,7 @@ public class EnderMan extends Monster implements NeutralMob {
}
boolean isBeingStaredBy(Player player) {
- return this.isLookingAtMe(player, 0.025, true, false, LivingEntity.PLAYER_NOT_WEARING_DISGUISE_ITEM, new DoubleSupplier[]{this::getEyeY});
+ return LivingEntity.PLAYER_NOT_WEARING_DISGUISE_ITEM.test(player) && this.isLookingAtMe(player, 0.025, true, false, new double[]{this.getEyeY()});
}
@Override
diff --git a/net/minecraft/world/entity/monster/Evoker.java b/net/minecraft/world/entity/monster/Evoker.java
index c49d40d..817454c 100644
--- a/net/minecraft/world/entity/monster/Evoker.java
+++ b/net/minecraft/world/entity/monster/Evoker.java
@@ -56,7 +56,7 @@ public class Evoker extends SpellcasterIllager {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new Evoker.EvokerCastingSpellGoal());
this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 0.6, 1.0));
- this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0, 1.2));
+ this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 0.6, 1.0));
this.goalSelector.addGoal(4, new Evoker.EvokerSummonSpellGoal());
this.goalSelector.addGoal(5, new Evoker.EvokerAttackSpellGoal());
this.goalSelector.addGoal(6, new Evoker.EvokerWololoSpellGoal());
diff --git a/net/minecraft/world/entity/monster/Ravager.java b/net/minecraft/world/entity/monster/Ravager.java
index 58ae308..0420ec0 100644
--- a/net/minecraft/world/entity/monster/Ravager.java
+++ b/net/minecraft/world/entity/monster/Ravager.java
@@ -18,7 +18,6 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
-import net.minecraft.world.entity.ai.goal.AvoidEntityGoal;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
@@ -27,7 +26,6 @@ import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.animal.IronGolem;
-import net.minecraft.world.entity.monster.creaking.Creaking;
import net.minecraft.world.entity.npc.AbstractVillager;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.raid.Raider;
@@ -72,7 +70,6 @@ public class Ravager extends Raider {
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(0, new FloatGoal(this));
- this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0, 1.2));
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
index f4cb3b4..12a0a93 100644
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
@@ -2,8 +2,6 @@ package net.minecraft.world.entity.monster.creaking;
import com.mojang.serialization.Dynamic;
import java.util.List;
-import java.util.function.DoubleSupplier;
-import java.util.function.Predicate;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.network.protocol.game.DebugPackets;
@@ -39,19 +37,20 @@ import net.minecraft.world.level.gameevent.GameEvent;
public class Creaking extends Monster {
private static final EntityDataAccessor<Boolean> CAN_MOVE = SynchedEntityData.defineId(Creaking.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Boolean> IS_ACTIVE = SynchedEntityData.defineId(Creaking.class, EntityDataSerializers.BOOLEAN);
- private static final int ATTACK_ANIMATION_DURATION = 20;
+ private static final int ATTACK_ANIMATION_DURATION = 15;
private static final int MAX_HEALTH = 1;
- private static final float ATTACK_DAMAGE = 2.0F;
+ private static final float ATTACK_DAMAGE = 3.0F;
private static final float FOLLOW_RANGE = 32.0F;
private static final float ACTIVATION_RANGE_SQ = 144.0F;
public static final int ATTACK_INTERVAL = 40;
- private static final float MOVEMENT_SPEED_WHEN_FIGHTING = 0.3F;
- public static final float SPEED_MULTIPLIER_WHEN_IDLING = 0.2F;
+ private static final float MOVEMENT_SPEED_WHEN_FIGHTING = 0.4F;
+ public static final float SPEED_MULTIPLIER_WHEN_IDLING = 0.3F;
public static final int CREAKING_ORANGE = 16545810;
public static final int CREAKING_GRAY = 6250335;
private int attackAnimationRemainingTicks;
public final AnimationState attackAnimationState = new AnimationState();
public final AnimationState invulnerabilityAnimationState = new AnimationState();
+ public final AnimationState deathAnimationState = new AnimationState();
public Creaking(EntityType<? extends Creaking> entityType, Level level) {
super(entityType, level);
@@ -88,10 +87,10 @@ public class Creaking extends Monster {
public static AttributeSupplier.Builder createAttributes() {
return Monster.createMonsterAttributes()
.add(Attributes.MAX_HEALTH, 1.0)
- .add(Attributes.MOVEMENT_SPEED, 0.3F)
- .add(Attributes.ATTACK_DAMAGE, 2.0)
+ .add(Attributes.MOVEMENT_SPEED, 0.4F)
+ .add(Attributes.ATTACK_DAMAGE, 3.0)
.add(Attributes.FOLLOW_RANGE, 32.0)
- .add(Attributes.STEP_HEIGHT, 1.0);
+ .add(Attributes.STEP_HEIGHT, 1.0625);
}
public boolean canMove() {
@@ -103,7 +102,7 @@ public class Creaking extends Monster {
if (!(entity instanceof LivingEntity)) {
return false;
} else {
- this.attackAnimationRemainingTicks = 20;
+ this.attackAnimationRemainingTicks = 15;
this.level().broadcastEntityEvent(this, (byte)4);
return super.doHurtTarget(serverLevel, entity);
}
@@ -161,6 +160,12 @@ public class Creaking extends Monster {
}
}
+ @Override
+ protected void updateWalkAnimation(float partialTick) {
+ float min = Math.min(partialTick * 25.0F, 3.0F);
+ this.walkAnimation.update(min, 0.4F, 1.0F);
+ }
+
private void setupAnimationStates() {
this.attackAnimationState.animateWhen(this.attackAnimationRemainingTicks > 0, this.tickCount);
}
@@ -168,7 +173,7 @@ public class Creaking extends Monster {
@Override
public void handleEntityEvent(byte id) {
if (id == 4) {
- this.attackAnimationRemainingTicks = 20;
+ this.attackAnimationRemainingTicks = 15;
this.playAttackSound();
} else {
super.handleEntityEvent(id);
@@ -221,40 +226,57 @@ public class Creaking extends Monster {
public boolean checkCanMove() {
List<Player> list = this.brain.getMemory(MemoryModuleType.NEAREST_PLAYERS).orElse(List.of());
+ boolean isActive = this.isActive();
if (list.isEmpty()) {
- if (this.isActive()) {
- this.gameEvent(GameEvent.ENTITY_ACTION);
- this.makeSound(SoundEvents.CREAKING_DEACTIVATE);
- this.setIsActive(false);
+ if (isActive) {
+ this.deactivate();
}
return true;
} else {
- Predicate<LivingEntity> predicate = this.isActive() ? LivingEntity.PLAYER_NOT_WEARING_DISGUISE_ITEM : livingEntity -> true;
+ boolean flag = false;
for (Player player : list) {
- if (!player.isCreative()
- && this.isLookingAtMe(
- player, 0.5, false, true, predicate, new DoubleSupplier[]{this::getEyeY, this::getY, () -> (this.getEyeY() + this.getY()) / 2.0}
- )) {
- if (this.isActive()) {
- return false;
- }
-
- if (player.distanceToSqr(this) < 144.0) {
- this.gameEvent(GameEvent.ENTITY_ACTION);
- this.makeSound(SoundEvents.CREAKING_ACTIVATE);
- this.setIsActive(true);
- this.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, player);
- return false;
+ if (this.canAttack(player) && !this.isAlliedTo(player)) {
+ flag = true;
+ if ((!isActive || LivingEntity.PLAYER_NOT_WEARING_DISGUISE_ITEM.test(player))
+ && this.isLookingAtMe(
+ player, 0.5, false, true, new double[]{this.getEyeY(), this.getY() + 0.5 * this.getScale(), (this.getEyeY() + this.getY()) / 2.0}
+ )) {
+ if (isActive) {
+ return false;
+ }
+
+ if (player.distanceToSqr(this) < 144.0) {
+ this.activate(player);
+ return false;
+ }
}
}
}
+ if (!flag && isActive) {
+ this.deactivate();
+ }
+
return true;
}
}
+ public void activate(Player player) {
+ this.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, player);
+ this.gameEvent(GameEvent.ENTITY_ACTION);
+ this.makeSound(SoundEvents.CREAKING_ACTIVATE);
+ this.setIsActive(true);
+ }
+
+ public void deactivate() {
+ this.getBrain().eraseMemory(MemoryModuleType.ATTACK_TARGET);
+ this.gameEvent(GameEvent.ENTITY_ACTION);
+ this.makeSound(SoundEvents.CREAKING_DEACTIVATE);
+ this.setIsActive(false);
+ }
+
public void setIsActive(boolean flag) {
this.entityData.set(IS_ACTIVE, flag);
}
diff --git a/net/minecraft/world/entity/monster/creaking/CreakingAi.java b/net/minecraft/world/entity/monster/creaking/CreakingAi.java
index f7ba6d8..78f54ed 100644
--- a/net/minecraft/world/entity/monster/creaking/CreakingAi.java
+++ b/net/minecraft/world/entity/monster/creaking/CreakingAi.java
@@ -62,7 +62,7 @@ public class CreakingAi {
SetEntityLookTargetSometimes.create(8.0F, UniformInt.of(30, 60)),
new RunOne<>(
ImmutableList.of(
- Pair.of(RandomStroll.stroll(0.2F), 2), Pair.of(SetWalkTargetFromLookTarget.create(0.2F, 3), 2), Pair.of(new DoNothing(30, 60), 1)
+ Pair.of(RandomStroll.stroll(0.3F), 2), Pair.of(SetWalkTargetFromLookTarget.create(0.3F, 3), 2), Pair.of(new DoNothing(30, 60), 1)
)
)
)
diff --git a/net/minecraft/world/entity/monster/creaking/CreakingTransient.java b/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
index 15fc1c0..3119b0c 100644
--- a/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
+++ b/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
@@ -1,23 +1,31 @@
package net.minecraft.world.entity.monster.creaking;
+import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Vec3i;
import net.minecraft.core.particles.BlockParticleOption;
import net.minecraft.core.particles.ParticleTypes;
+import net.minecraft.network.syncher.EntityDataAccessor;
+import net.minecraft.network.syncher.EntityDataSerializers;
+import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.server.level.ServerLevel;
+import net.minecraft.sounds.SoundEvents;
import net.minecraft.tags.DamageTypeTags;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
+import net.minecraft.world.entity.ai.memory.MemoryModuleType;
import net.minecraft.world.entity.ai.navigation.GroundPathNavigation;
import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CreakingHeartBlock;
import net.minecraft.world.level.block.entity.CreakingHeartBlockEntity;
+import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.pathfinder.PathFinder;
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.level.pathfinder.PathfindingContext;
@@ -27,12 +35,23 @@ import net.minecraft.world.phys.Vec3;
public class CreakingTransient extends Creaking {
public static final int INVULNERABILITY_ANIMATION_DURATION = 8;
+ public static final int TWITCH_DEATH_DURATION = 45;
+ private static final int MAX_PLAYER_STUCK_COUNTER = 4;
+ private static final EntityDataAccessor<Boolean> IS_TEARING_DOWN = SynchedEntityData.defineId(CreakingTransient.class, EntityDataSerializers.BOOLEAN);
private int invulnerabilityAnimationRemainingTicks;
+ private boolean eyesGlowing;
+ private int nextFlickerTime;
@Nullable
BlockPos homePos;
+ private int playerStuckCounter;
public CreakingTransient(EntityType<? extends Creaking> entityType, Level level) {
super(entityType, level);
+ this.setPathfindingMalus(PathType.DAMAGE_OTHER, 8.0F);
+ this.setPathfindingMalus(PathType.POWDER_SNOW, 8.0F);
+ this.setPathfindingMalus(PathType.LAVA, 8.0F);
+ this.setPathfindingMalus(PathType.DAMAGE_FIRE, 0.0F);
+ this.setPathfindingMalus(PathType.DANGER_FIRE, 0.0F);
}
public void bindToCreakingHeart(BlockPos blockPos) {
@@ -46,23 +65,34 @@ public class CreakingTransient extends Creaking {
} else if (damageSource.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
return super.hurtServer(serverLevel, damageSource, f);
} else if (!this.isInvulnerableTo(serverLevel, damageSource) && this.invulnerabilityAnimationRemainingTicks <= 0) {
- this.invulnerabilityAnimationRemainingTicks = 8;
- this.level().broadcastEntityEvent(this, (byte)66);
- if (this.level().getBlockEntity(this.homePos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
- && creakingHeartBlockEntity.isProtector(this)) {
- if (damageSource.getEntity() instanceof Player) {
- creakingHeartBlockEntity.creakingHurt();
+ Entity directEntity = damageSource.getDirectEntity();
+ if (!(directEntity instanceof LivingEntity) && !(directEntity instanceof Projectile)) {
+ return false;
+ } else {
+ this.invulnerabilityAnimationRemainingTicks = 8;
+ this.level().broadcastEntityEvent(this, (byte)66);
+ if (this.level().getBlockEntity(this.homePos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
+ && creakingHeartBlockEntity.isProtector(this)) {
+ if (damageSource.getEntity() instanceof Player) {
+ creakingHeartBlockEntity.creakingHurt();
+ }
+
+ this.playHurtSound(damageSource);
}
- this.playHurtSound(damageSource);
+ return true;
}
-
- return true;
} else {
return false;
}
}
+ @Override
+ protected void defineSynchedData(SynchedEntityData.Builder builder) {
+ super.defineSynchedData(builder);
+ builder.define(IS_TEARING_DOWN, false);
+ }
+
@Override
public void aiStep() {
if (this.invulnerabilityAnimationRemainingTicks > 0) {
@@ -74,16 +104,34 @@ public class CreakingTransient extends Creaking {
@Override
public void tick() {
- if (this.level().isClientSide
- || this.homePos != null
- && this.level().getBlockEntity(this.homePos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
- && creakingHeartBlockEntity.isProtector(this)) {
- super.tick();
- if (this.level().isClientSide) {
- this.setupAnimationStates();
+ if (!this.level().isClientSide
+ && (
+ this.homePos == null
+ || !(
+ this.level().getBlockEntity(this.homePos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
+ && creakingHeartBlockEntity.isProtector(this)
+ )
+ )) {
+ this.homePos = null;
+ this.setHealth(0.0F);
+ }
+
+ super.tick();
+ if (this.level().isClientSide) {
+ this.setupAnimationStates();
+ this.checkEyeBlink();
+ }
+ }
+
+ @Override
+ protected void tickDeath() {
+ if (this.isTearingDown()) {
+ this.deathTime++;
+ if (this.deathTime > 45 && !this.level().isClientSide() && !this.isRemoved()) {
+ this.tearDown();
}
} else {
- this.setRemoved(Entity.RemovalReason.DISCARDED);
+ super.tickDeath();
}
}
@@ -99,9 +147,10 @@ public class CreakingTransient extends Creaking {
private void setupAnimationStates() {
this.invulnerabilityAnimationState.animateWhen(this.invulnerabilityAnimationRemainingTicks > 0, this.tickCount);
+ this.deathAnimationState.animateWhen(this.isTearingDown(), this.tickCount);
}
- public void tearDown(@Nullable DamageSource damageSource) {
+ public void tearDown() {
if (this.level() instanceof ServerLevel serverLevel) {
AABB boundingBox = this.getBoundingBox();
Vec3 center = boundingBox.getCenter();
@@ -121,8 +170,7 @@ public class CreakingTransient extends Creaking {
);
serverLevel.sendParticles(
new BlockParticleOption(
- ParticleTypes.BLOCK_CRUMBLE,
- Blocks.CREAKING_HEART.defaultBlockState().setValue(CreakingHeartBlock.CREAKING, CreakingHeartBlock.CreakingHeartState.ACTIVE)
+ ParticleTypes.BLOCK_CRUMBLE, Blocks.CREAKING_HEART.defaultBlockState().setValue(CreakingHeartBlock.ACTIVE, Boolean.valueOf(true))
),
center.x,
center.y,
@@ -136,11 +184,16 @@ public class CreakingTransient extends Creaking {
}
this.makeSound(this.getDeathSound());
+ this.gameEvent(GameEvent.ENTITY_DIE);
+ this.remove(Entity.RemovalReason.DISCARDED);
+ }
+
+ public void creakingDeathEffects(@Nullable DamageSource damageSource) {
if (this.deathScore >= 0 && damageSource != null && damageSource.getEntity() instanceof LivingEntity livingEntity) {
livingEntity.awardKillScore(this, this.deathScore, damageSource);
}
- this.remove(Entity.RemovalReason.DISCARDED);
+ this.makeSound(SoundEvents.CREAKING_TWITCH);
}
@Override
@@ -168,6 +221,46 @@ public class CreakingTransient extends Creaking {
return new CreakingTransient.CreakingPathNavigation(this, level);
}
+ public boolean playerIsStuckInYou() {
+ List<Player> list = this.brain.getMemory(MemoryModuleType.NEAREST_PLAYERS).orElse(List.of());
+ if (list.isEmpty()) {
+ this.playerStuckCounter = 0;
+ return false;
+ } else {
+ AABB boundingBox = this.getBoundingBox();
+
+ for (Player player : list) {
+ if (boundingBox.contains(player.getEyePosition())) {
+ this.playerStuckCounter++;
+ return this.playerStuckCounter > 4;
+ }
+ }
+
+ this.playerStuckCounter = 0;
+ return false;
+ }
+ }
+
+ public void setTearingDown() {
+ this.entityData.set(IS_TEARING_DOWN, true);
+ }
+
+ public boolean isTearingDown() {
+ return this.entityData.get(IS_TEARING_DOWN);
+ }
+
+ public boolean hasGlowingEyes() {
+ return this.eyesGlowing;
+ }
+
+ public void checkEyeBlink() {
+ if (this.deathTime > this.nextFlickerTime) {
+ this.nextFlickerTime = this.deathTime
+ + this.getRandom().nextIntBetweenInclusive(this.eyesGlowing ? 2 : this.deathTime / 4, this.eyesGlowing ? 8 : this.deathTime / 2);
+ this.eyesGlowing = !this.eyesGlowing;
+ }
+ }
+
class CreakingPathNavigation extends GroundPathNavigation {
CreakingPathNavigation(final Creaking mob, final Level level) {
super(mob, level);
@@ -183,6 +276,7 @@ public class CreakingTransient extends Creaking {
@Override
protected PathFinder createPathFinder(int maxVisitedNodes) {
this.nodeEvaluator = CreakingTransient.this.new HomeNodeEvaluator();
+ this.nodeEvaluator.setCanPassDoors(true);
return new PathFinder(this.nodeEvaluator, maxVisitedNodes);
}
}
diff --git a/net/minecraft/world/entity/npc/AbstractVillager.java b/net/minecraft/world/entity/npc/AbstractVillager.java
index 2eab91c..e4cb5b2 100644
--- a/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -256,4 +256,9 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
public boolean isClientSide() {
return this.level().isClientSide;
}
+
+ @Override
+ public boolean stillValid(Player player) {
+ return this.getTradingPlayer() == player && this.isAlive() && player.canInteractWithEntity(this, 4.0);
+ }
}
diff --git a/net/minecraft/world/entity/npc/ClientSideMerchant.java b/net/minecraft/world/entity/npc/ClientSideMerchant.java
index e71490d..debc4a5 100644
--- a/net/minecraft/world/entity/npc/ClientSideMerchant.java
+++ b/net/minecraft/world/entity/npc/ClientSideMerchant.java
@@ -51,6 +51,11 @@ public class ClientSideMerchant implements Merchant {
return this.source.level().isClientSide;
}
+ @Override
+ public boolean stillValid(Player player) {
+ return this.source == player;
+ }
+
@Override
public int getVillagerXp() {
return this.xp;
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
index 665b7a7..4a1bceb 100644
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
@@ -882,7 +882,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
10,
8,
6,
- SpawnUtil.Strategy.LEGACY_IRON_GOLEM
+ SpawnUtil.Strategy.LEGACY_IRON_GOLEM,
+ false
)
.isEmpty()) {
entitiesOfClass.forEach(GolemSensor::golemDetected);
diff --git a/net/minecraft/world/entity/npc/VillagerTrades.java b/net/minecraft/world/entity/npc/VillagerTrades.java
index 4967033..17b4e76 100644
--- a/net/minecraft/world/entity/npc/VillagerTrades.java
+++ b/net/minecraft/world/entity/npc/VillagerTrades.java
@@ -681,6 +681,7 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.OXEYE_DAISY, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.CORNFLOWER, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.LILY_OF_THE_VALLEY, 1, 1, 7, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.OPEN_EYEBLOSSOM, 1, 1, 7, 1),
new VillagerTrades.ItemsForEmeralds(Items.WHEAT_SEEDS, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.BEETROOT_SEEDS, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.PUMPKIN_SEEDS, 1, 1, 12, 1),
@@ -688,10 +689,12 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.ACACIA_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.BIRCH_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.DARK_OAK_SAPLING, 5, 1, 8, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_OAK_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.JUNGLE_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.OAK_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.SPRUCE_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.CHERRY_SAPLING, 5, 1, 8, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_OAK_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.MANGROVE_PROPAGULE, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.RED_DYE, 1, 3, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.WHITE_DYE, 1, 3, 12, 1),
@@ -715,6 +718,7 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.HORN_CORAL_BLOCK, 3, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.TUBE_CORAL_BLOCK, 3, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.VINE, 1, 1, 12, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_HANGING_MOSS, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.BROWN_MUSHROOM, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.RED_MUSHROOM, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.LILY_PAD, 1, 2, 5, 1),
@@ -723,7 +727,8 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.RED_SAND, 1, 4, 6, 1),
new VillagerTrades.ItemsForEmeralds(Items.POINTED_DRIPSTONE, 1, 2, 5, 1),
new VillagerTrades.ItemsForEmeralds(Items.ROOTED_DIRT, 1, 2, 5, 1),
- new VillagerTrades.ItemsForEmeralds(Items.MOSS_BLOCK, 1, 2, 5, 1)
+ new VillagerTrades.ItemsForEmeralds(Items.MOSS_BLOCK, 1, 2, 5, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_MOSS_BLOCK, 1, 2, 5, 1)
},
2,
new VillagerTrades.ItemListing[]{
@@ -1306,6 +1311,7 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.OXEYE_DAISY, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.CORNFLOWER, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.LILY_OF_THE_VALLEY, 1, 1, 7, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.OPEN_EYEBLOSSOM, 1, 1, 7, 1),
new VillagerTrades.ItemsForEmeralds(Items.WHEAT_SEEDS, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.BEETROOT_SEEDS, 1, 1, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.PUMPKIN_SEEDS, 1, 1, 12, 1),
@@ -1313,10 +1319,12 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.ACACIA_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.BIRCH_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.DARK_OAK_SAPLING, 5, 1, 8, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_OAK_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.JUNGLE_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.OAK_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.SPRUCE_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.CHERRY_SAPLING, 5, 1, 8, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_OAK_SAPLING, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.MANGROVE_PROPAGULE, 5, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.RED_DYE, 1, 3, 12, 1),
new VillagerTrades.ItemsForEmeralds(Items.WHITE_DYE, 1, 3, 12, 1),
@@ -1340,6 +1348,7 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.HORN_CORAL_BLOCK, 3, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.TUBE_CORAL_BLOCK, 3, 1, 8, 1),
new VillagerTrades.ItemsForEmeralds(Items.VINE, 1, 3, 4, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_HANGING_MOSS, 1, 3, 4, 1),
new VillagerTrades.ItemsForEmeralds(Items.BROWN_MUSHROOM, 1, 3, 4, 1),
new VillagerTrades.ItemsForEmeralds(Items.RED_MUSHROOM, 1, 3, 4, 1),
new VillagerTrades.ItemsForEmeralds(Items.LILY_PAD, 1, 5, 2, 1),
@@ -1348,7 +1357,8 @@ public class VillagerTrades {
new VillagerTrades.ItemsForEmeralds(Items.RED_SAND, 1, 4, 6, 1),
new VillagerTrades.ItemsForEmeralds(Items.POINTED_DRIPSTONE, 1, 2, 5, 1),
new VillagerTrades.ItemsForEmeralds(Items.ROOTED_DIRT, 1, 2, 5, 1),
- new VillagerTrades.ItemsForEmeralds(Items.MOSS_BLOCK, 1, 2, 5, 1)
+ new VillagerTrades.ItemsForEmeralds(Items.MOSS_BLOCK, 1, 2, 5, 1),
+ new VillagerTrades.ItemsForEmeralds(Items.PALE_MOSS_BLOCK, 1, 2, 5, 1)
},
5
)
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
index 317da9b..2159547 100644
--- a/net/minecraft/world/entity/player/Inventory.java
+++ b/net/minecraft/world/entity/player/Inventory.java
@@ -65,25 +65,16 @@ public class Inventory implements Container, Nameable {
return -1;
}
- public void setPickedItem(ItemStack stack) {
- int i = this.findSlotMatchingItem(stack);
- if (isHotbarSlot(i)) {
- this.selected = i;
- } else {
- if (i == -1) {
- this.selected = this.getSuitableHotbarSlot();
- if (!this.items.get(this.selected).isEmpty()) {
- int freeSlot = this.getFreeSlot();
- if (freeSlot != -1) {
- this.items.set(freeSlot, this.items.get(this.selected));
- }
- }
-
- this.items.set(this.selected, stack);
- } else {
- this.pickSlot(i);
+ public void addAndPickItem(ItemStack itemStack) {
+ this.selected = this.getSuitableHotbarSlot();
+ if (!this.items.get(this.selected).isEmpty()) {
+ int freeSlot = this.getFreeSlot();
+ if (freeSlot != -1) {
+ this.items.set(freeSlot, this.items.get(this.selected));
}
}
+
+ this.items.set(this.selected, itemStack);
}
public void pickSlot(int index) {
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
index f14526d..55c1b8b 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -1967,7 +1967,7 @@ public abstract class Player extends LivingEntity {
return this.abilities.instabuild && this.getPermissionLevel() >= 2;
}
- protected int getPermissionLevel() {
+ public int getPermissionLevel() {
return 0;
}
@@ -2142,6 +2142,11 @@ public abstract class Player extends LivingEntity {
return true;
}
+ @Override
+ public boolean onClimbable() {
+ return !this.abilities.flying && super.onClimbable();
+ }
+
public static enum BedSleepingProblem {
NOT_POSSIBLE_HERE,
NOT_POSSIBLE_NOW(Component.translatable("block.minecraft.bed.no_sleep")),
diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java
index 05a361d..30839b5 100644
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -50,7 +50,9 @@ import net.minecraft.world.phys.shapes.VoxelShape;
public abstract class AbstractArrow extends Projectile {
private static final double ARROW_BASE_DAMAGE = 2.0;
- public static final int SHAKE_TIME = 7;
+ private static final int SHAKE_TIME = 7;
+ private static final float WATER_INERTIA = 0.6F;
+ private static final float INERTIA = 0.99F;
private static final EntityDataAccessor<Byte> ID_FLAGS = SynchedEntityData.defineId(AbstractArrow.class, EntityDataSerializers.BYTE);
private static final EntityDataAccessor<Byte> PIERCE_LEVEL = SynchedEntityData.defineId(AbstractArrow.class, EntityDataSerializers.BYTE);
private static final EntityDataAccessor<Boolean> IN_GROUND = SynchedEntityData.defineId(AbstractArrow.class, EntityDataSerializers.BOOLEAN);
@@ -150,7 +152,7 @@ public abstract class AbstractArrow extends Projectile {
@Override
public void lerpMotion(double x, double y, double z) {
- this.setDeltaMovement(x, y, z);
+ super.lerpMotion(x, y, z);
this.life = 0;
if (this.isInGround() && Mth.lengthSquared(x, y, z) > 0.0) {
this.setInGround(false);
@@ -210,6 +212,7 @@ public abstract class AbstractArrow extends Projectile {
this.inGroundTime = 0;
Vec3 vec31 = this.position();
if (this.isInWater()) {
+ this.applyInertia(this.getWaterInertia());
this.addBubbleParticles(vec31);
}
@@ -247,7 +250,10 @@ public abstract class AbstractArrow extends Projectile {
this.applyEffectsFromBlocks();
}
- this.applyInertia();
+ if (!this.isInWater()) {
+ this.applyInertia(0.99F);
+ }
+
if (flag && !this.isInGround()) {
this.applyGravity();
}
@@ -284,13 +290,8 @@ public abstract class AbstractArrow extends Projectile {
}
}
- private void applyInertia() {
+ private void applyInertia(float f) {
Vec3 deltaMovement = this.getDeltaMovement();
- float f = 0.99F;
- if (this.isInWater()) {
- f = this.getWaterInertia();
- }
-
this.setDeltaMovement(deltaMovement.scale(f));
}
@@ -366,6 +367,20 @@ public abstract class AbstractArrow extends Projectile {
this.firedFromWeapon = null;
}
+ @Override
+ public void onInsideBubbleColumn(boolean downwards) {
+ if (!this.isInGround()) {
+ super.onInsideBubbleColumn(downwards);
+ }
+ }
+
+ @Override
+ public void push(double x, double y, double z) {
+ if (!this.isInGround()) {
+ super.push(x, y, z);
+ }
+ }
+
@Override
protected void onHitEntity(EntityHitResult result) {
super.onHitEntity(result);
diff --git a/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
index 21c3434..7ef2c11 100644
--- a/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
+++ b/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
@@ -4,11 +4,7 @@ import javax.annotation.Nullable;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
-import net.minecraft.network.protocol.Packet;
-import net.minecraft.network.protocol.game.ClientGamePacketListener;
-import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.network.syncher.SynchedEntityData;
-import net.minecraft.server.level.ServerEntity;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
@@ -177,33 +173,6 @@ public abstract class AbstractHurtingProjectile extends Projectile {
return 1.0F;
}
- @Override
- public Packet<ClientGamePacketListener> getAddEntityPacket(ServerEntity entity) {
- Entity owner = this.getOwner();
- int i = owner == null ? 0 : owner.getId();
- Vec3 positionBase = entity.getPositionBase();
- return new ClientboundAddEntityPacket(
- this.getId(),
- this.getUUID(),
- positionBase.x(),
- positionBase.y(),
- positionBase.z(),
- entity.getLastSentXRot(),
- entity.getLastSentYRot(),
- this.getType(),
- i,
- entity.getLastSentMovement(),
- 0.0
- );
- }
-
- @Override
- public void recreateFromPacket(ClientboundAddEntityPacket packet) {
- super.recreateFromPacket(packet);
- Vec3 vec3 = new Vec3(packet.getXa(), packet.getYa(), packet.getZa());
- this.setDeltaMovement(vec3);
- }
-
private void assignDirectionalMovement(Vec3 movement, double accelerationPower) {
this.setDeltaMovement(movement.normalize().scale(accelerationPower));
this.hasImpulse = true;
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
index fcf271f..5acc807 100644
--- a/net/minecraft/world/entity/projectile/Projectile.java
+++ b/net/minecraft/world/entity/projectile/Projectile.java
@@ -303,19 +303,6 @@ public abstract class Projectile extends Entity implements TraceableEntity {
blockState.onProjectileHit(this.level(), blockState, result, this);
}
- @Override
- public void lerpMotion(double x, double y, double z) {
- this.setDeltaMovement(x, y, z);
- if (this.xRotO == 0.0F && this.yRotO == 0.0F) {
- double squareRoot = Math.sqrt(x * x + z * z);
- this.setXRot((float)(Mth.atan2(y, squareRoot) * 180.0F / (float)Math.PI));
- this.setYRot((float)(Mth.atan2(x, z) * 180.0F / (float)Math.PI));
- this.xRotO = this.getXRot();
- this.yRotO = this.getYRot();
- this.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
- }
- }
-
protected boolean canHitEntity(Entity target) {
if (!target.canBeHitByProjectile()) {
return false;
@@ -353,6 +340,8 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@Override
public void recreateFromPacket(ClientboundAddEntityPacket packet) {
super.recreateFromPacket(packet);
+ Vec3 vec3 = new Vec3(packet.getXa(), packet.getYa(), packet.getZa());
+ this.setDeltaMovement(vec3);
Entity entity = this.level().getEntity(packet.getData());
if (entity != null) {
this.setOwner(entity);
diff --git a/net/minecraft/world/entity/projectile/ThrownTrident.java b/net/minecraft/world/entity/projectile/ThrownTrident.java
index 7cbf0ea..bece499 100644
--- a/net/minecraft/world/entity/projectile/ThrownTrident.java
+++ b/net/minecraft/world/entity/projectile/ThrownTrident.java
@@ -26,6 +26,7 @@ import net.minecraft.world.phys.Vec3;
public class ThrownTrident extends AbstractArrow {
private static final EntityDataAccessor<Byte> ID_LOYALTY = SynchedEntityData.defineId(ThrownTrident.class, EntityDataSerializers.BYTE);
private static final EntityDataAccessor<Boolean> ID_FOIL = SynchedEntityData.defineId(ThrownTrident.class, EntityDataSerializers.BOOLEAN);
+ private static final float WATER_INERTIA = 0.99F;
private boolean dealtDamage;
public int clientSideReturnTridentTickCount;
diff --git a/net/minecraft/world/entity/vehicle/MinecartTNT.java b/net/minecraft/world/entity/vehicle/MinecartTNT.java
index 82f6a90..b62ce5a 100644
--- a/net/minecraft/world/entity/vehicle/MinecartTNT.java
+++ b/net/minecraft/world/entity/vehicle/MinecartTNT.java
@@ -12,7 +12,7 @@ import net.minecraft.tags.DamageTypeTags;
import net.minecraft.util.Mth;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.entity.projectile.AbstractArrow;
+import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
@@ -26,9 +26,13 @@ import net.minecraft.world.level.material.FluidState;
public class MinecartTNT extends AbstractMinecart {
private static final byte EVENT_PRIME = 10;
private static final String TAG_EXPLOSION_POWER = "explosion_power";
+ private static final String TAG_EXPLOSION_SPEED_FACTOR = "explosion_speed_factor";
+ private static final String TAG_FUSE = "fuse";
private static final float DEFAULT_EXPLOSION_POWER_BASE = 4.0F;
+ private static final float DEFAULT_EXPLOSION_SPEED_FACTOR = 1.0F;
private int fuse = -1;
private float explosionPowerBase = 4.0F;
+ private float explosionSpeedFactor = 1.0F;
public MinecartTNT(EntityType<? extends MinecartTNT> entityType, Level level) {
super(entityType, level);
@@ -59,9 +63,9 @@ public class MinecartTNT extends AbstractMinecart {
@Override
public boolean hurtServer(ServerLevel serverLevel, DamageSource damageSource, float f) {
- if (damageSource.getDirectEntity() instanceof AbstractArrow abstractArrow && abstractArrow.isOnFire()) {
+ if (damageSource.getDirectEntity() instanceof Projectile projectile && projectile.isOnFire()) {
DamageSource damageSource1 = this.damageSources().explosion(this, damageSource.getEntity());
- this.explode(damageSource1, abstractArrow.getDeltaMovement().lengthSqr());
+ this.explode(damageSource1, projectile.getDeltaMovement().lengthSqr());
}
return super.hurtServer(serverLevel, damageSource, f);
@@ -104,7 +108,7 @@ public class MinecartTNT extends AbstractMinecart {
this.getX(),
this.getY(),
this.getZ(),
- (float)(this.explosionPowerBase + this.random.nextDouble() * 1.5 * min),
+ (float)(this.explosionPowerBase + this.explosionSpeedFactor * this.random.nextDouble() * 1.5 * min),
false,
Level.ExplosionInteraction.TNT
);
@@ -174,22 +178,30 @@ public class MinecartTNT extends AbstractMinecart {
@Override
protected void readAdditionalSaveData(CompoundTag compound) {
super.readAdditionalSaveData(compound);
- if (compound.contains("TNTFuse", 99)) {
- this.fuse = compound.getInt("TNTFuse");
+ if (compound.contains("fuse", 99)) {
+ this.fuse = compound.getInt("fuse");
}
if (compound.contains("explosion_power", 99)) {
this.explosionPowerBase = Mth.clamp(compound.getFloat("explosion_power"), 0.0F, 128.0F);
}
+
+ if (compound.contains("explosion_speed_factor", 99)) {
+ this.explosionSpeedFactor = Mth.clamp(compound.getFloat("explosion_speed_factor"), 0.0F, 128.0F);
+ }
}
@Override
protected void addAdditionalSaveData(CompoundTag compound) {
super.addAdditionalSaveData(compound);
- compound.putInt("TNTFuse", this.fuse);
+ compound.putInt("fuse", this.fuse);
if (this.explosionPowerBase != 4.0F) {
compound.putFloat("explosion_power", this.explosionPowerBase);
}
+
+ if (this.explosionSpeedFactor != 1.0F) {
+ compound.putFloat("explosion_speed_factor", this.explosionSpeedFactor);
+ }
}
@Override
diff --git a/net/minecraft/world/flag/FeatureFlags.java b/net/minecraft/world/flag/FeatureFlags.java
index d46dd10..79fc506 100644
--- a/net/minecraft/world/flag/FeatureFlags.java
+++ b/net/minecraft/world/flag/FeatureFlags.java
@@ -7,7 +7,6 @@ import net.minecraft.resources.ResourceLocation;
public class FeatureFlags {
public static final FeatureFlag VANILLA;
- public static final FeatureFlag WINTER_DROP;
public static final FeatureFlag TRADE_REBALANCE;
public static final FeatureFlag REDSTONE_EXPERIMENTS;
public static final FeatureFlag MINECART_IMPROVEMENTS;
@@ -33,7 +32,6 @@ public class FeatureFlags {
static {
FeatureFlagRegistry.Builder builder = new FeatureFlagRegistry.Builder("main");
VANILLA = builder.createVanilla("vanilla");
- WINTER_DROP = builder.createVanilla("winter_drop");
TRADE_REBALANCE = builder.createVanilla("trade_rebalance");
REDSTONE_EXPERIMENTS = builder.createVanilla("redstone_experiments");
MINECART_IMPROVEMENTS = builder.createVanilla("minecart_improvements");
diff --git a/net/minecraft/world/inventory/ArmorSlot.java b/net/minecraft/world/inventory/ArmorSlot.java
index 6398c30..6a1c0f2 100644
--- a/net/minecraft/world/inventory/ArmorSlot.java
+++ b/net/minecraft/world/inventory/ArmorSlot.java
@@ -1,6 +1,5 @@
package net.minecraft.world.inventory;
-import com.mojang.datafixers.util.Pair;
import javax.annotation.Nullable;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
@@ -47,8 +46,9 @@ class ArmorSlot extends Slot {
&& super.mayPickup(player);
}
+ @Nullable
@Override
- public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
- return this.emptyIcon != null ? Pair.of(InventoryMenu.BLOCK_ATLAS, this.emptyIcon) : super.getNoItemIcon();
+ public ResourceLocation getNoItemIcon() {
+ return this.emptyIcon;
}
}
diff --git a/net/minecraft/world/inventory/BrewingStandMenu.java b/net/minecraft/world/inventory/BrewingStandMenu.java
index 07744e7..bf716cf 100644
--- a/net/minecraft/world/inventory/BrewingStandMenu.java
+++ b/net/minecraft/world/inventory/BrewingStandMenu.java
@@ -4,6 +4,7 @@ import java.util.Optional;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.core.Holder;
import net.minecraft.core.component.DataComponents;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.Container;
@@ -17,6 +18,8 @@ import net.minecraft.world.item.alchemy.PotionBrewing;
import net.minecraft.world.item.alchemy.PotionContents;
public class BrewingStandMenu extends AbstractContainerMenu {
+ static final ResourceLocation EMPTY_SLOT_FUEL = ResourceLocation.withDefaultNamespace("container/slot/brewing_fuel");
+ static final ResourceLocation EMPTY_SLOT_POTION = ResourceLocation.withDefaultNamespace("container/slot/potion");
private static final int BOTTLE_SLOT_START = 0;
private static final int BOTTLE_SLOT_END = 2;
private static final int INGREDIENT_SLOT = 3;
@@ -132,6 +135,11 @@ public class BrewingStandMenu extends AbstractContainerMenu {
public static boolean mayPlaceItem(ItemStack itemStack) {
return itemStack.is(ItemTags.BREWING_FUEL);
}
+
+ @Override
+ public ResourceLocation getNoItemIcon() {
+ return BrewingStandMenu.EMPTY_SLOT_FUEL;
+ }
}
static class IngredientsSlot extends Slot {
@@ -176,5 +184,10 @@ public class BrewingStandMenu extends AbstractContainerMenu {
public static boolean mayPlaceItem(ItemStack stack) {
return stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE);
}
+
+ @Override
+ public ResourceLocation getNoItemIcon() {
+ return BrewingStandMenu.EMPTY_SLOT_POTION;
+ }
}
}
diff --git a/net/minecraft/world/inventory/EnchantmentMenu.java b/net/minecraft/world/inventory/EnchantmentMenu.java
index 5f007db..a04411b 100644
--- a/net/minecraft/world/inventory/EnchantmentMenu.java
+++ b/net/minecraft/world/inventory/EnchantmentMenu.java
@@ -1,6 +1,5 @@
package net.minecraft.world.inventory;
-import com.mojang.datafixers.util.Pair;
import java.util.List;
import java.util.Optional;
import net.minecraft.Util;
@@ -31,7 +30,7 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.EnchantingTableBlock;
public class EnchantmentMenu extends AbstractContainerMenu {
- static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = ResourceLocation.withDefaultNamespace("item/empty_slot_lapis_lazuli");
+ static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = ResourceLocation.withDefaultNamespace("container/slot/lapis_lazuli");
private final Container enchantSlots = new SimpleContainer(2) {
@Override
public void setChanged() {
@@ -66,8 +65,8 @@ public class EnchantmentMenu extends AbstractContainerMenu {
}
@Override
- public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
- return Pair.of(InventoryMenu.BLOCK_ATLAS, EnchantmentMenu.EMPTY_SLOT_LAPIS_LAZULI);
+ public ResourceLocation getNoItemIcon() {
+ return EnchantmentMenu.EMPTY_SLOT_LAPIS_LAZULI;
}
});
this.addStandardInventorySlots(playerInventory, 8, 84);
diff --git a/net/minecraft/world/inventory/HorseInventoryMenu.java b/net/minecraft/world/inventory/HorseInventoryMenu.java
index 7c51d42..94aa26f 100644
--- a/net/minecraft/world/inventory/HorseInventoryMenu.java
+++ b/net/minecraft/world/inventory/HorseInventoryMenu.java
@@ -1,14 +1,19 @@
package net.minecraft.world.inventory;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.animal.horse.AbstractHorse;
+import net.minecraft.world.entity.animal.horse.Llama;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
public class HorseInventoryMenu extends AbstractContainerMenu {
+ static final ResourceLocation SADDLE_SLOT_SPRITE = ResourceLocation.withDefaultNamespace("container/slot/saddle");
+ private static final ResourceLocation LLAMA_ARMOR_SLOT_SPRITE = ResourceLocation.withDefaultNamespace("container/slot/llama_armor");
+ private static final ResourceLocation ARMOR_SLOT_SPRITE = ResourceLocation.withDefaultNamespace("container/slot/horse_armor");
private final Container horseContainer;
private final Container armorContainer;
private final AbstractHorse horse;
@@ -31,8 +36,14 @@ public class HorseInventoryMenu extends AbstractContainerMenu {
public boolean isActive() {
return horse.isSaddleable();
}
+
+ @Override
+ public ResourceLocation getNoItemIcon() {
+ return HorseInventoryMenu.SADDLE_SLOT_SPRITE;
+ }
});
- this.addSlot(new ArmorSlot(this.armorContainer, horse, EquipmentSlot.BODY, 0, 8, 36, null) {
+ ResourceLocation resourceLocation = horse instanceof Llama ? LLAMA_ARMOR_SLOT_SPRITE : ARMOR_SLOT_SPRITE;
+ this.addSlot(new ArmorSlot(this.armorContainer, horse, EquipmentSlot.BODY, 0, 8, 36, resourceLocation) {
@Override
public boolean mayPlace(ItemStack stack) {
return horse.isEquippableInSlot(stack, EquipmentSlot.BODY);
diff --git a/net/minecraft/world/inventory/InventoryMenu.java b/net/minecraft/world/inventory/InventoryMenu.java
index e1e04b3..dff7b27 100644
--- a/net/minecraft/world/inventory/InventoryMenu.java
+++ b/net/minecraft/world/inventory/InventoryMenu.java
@@ -1,6 +1,5 @@
package net.minecraft.world.inventory;
-import com.mojang.datafixers.util.Pair;
import java.util.List;
import java.util.Map;
import net.minecraft.resources.ResourceLocation;
@@ -27,12 +26,11 @@ public class InventoryMenu extends AbstractCraftingMenu {
public static final int USE_ROW_SLOT_START = 36;
public static final int USE_ROW_SLOT_END = 45;
public static final int SHIELD_SLOT = 45;
- public static final ResourceLocation BLOCK_ATLAS = ResourceLocation.withDefaultNamespace("textures/atlas/blocks.png");
- public static final ResourceLocation EMPTY_ARMOR_SLOT_HELMET = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_helmet");
- public static final ResourceLocation EMPTY_ARMOR_SLOT_CHESTPLATE = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_chestplate");
- public static final ResourceLocation EMPTY_ARMOR_SLOT_LEGGINGS = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_leggings");
- public static final ResourceLocation EMPTY_ARMOR_SLOT_BOOTS = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_boots");
- public static final ResourceLocation EMPTY_ARMOR_SLOT_SHIELD = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_shield");
+ public static final ResourceLocation EMPTY_ARMOR_SLOT_HELMET = ResourceLocation.withDefaultNamespace("container/slot/helmet");
+ public static final ResourceLocation EMPTY_ARMOR_SLOT_CHESTPLATE = ResourceLocation.withDefaultNamespace("container/slot/chestplate");
+ public static final ResourceLocation EMPTY_ARMOR_SLOT_LEGGINGS = ResourceLocation.withDefaultNamespace("container/slot/leggings");
+ public static final ResourceLocation EMPTY_ARMOR_SLOT_BOOTS = ResourceLocation.withDefaultNamespace("container/slot/boots");
+ public static final ResourceLocation EMPTY_ARMOR_SLOT_SHIELD = ResourceLocation.withDefaultNamespace("container/slot/shield");
private static final Map<EquipmentSlot, ResourceLocation> TEXTURE_EMPTY_SLOTS = Map.of(
EquipmentSlot.FEET,
EMPTY_ARMOR_SLOT_BOOTS,
@@ -69,8 +67,8 @@ public class InventoryMenu extends AbstractCraftingMenu {
}
@Override
- public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
- return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD);
+ public ResourceLocation getNoItemIcon() {
+ return InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD;
}
});
}
diff --git a/net/minecraft/world/inventory/MerchantMenu.java b/net/minecraft/world/inventory/MerchantMenu.java
index 143d947..3dc0dd7 100644
--- a/net/minecraft/world/inventory/MerchantMenu.java
+++ b/net/minecraft/world/inventory/MerchantMenu.java
@@ -61,7 +61,7 @@ public class MerchantMenu extends AbstractContainerMenu {
@Override
public boolean stillValid(Player player) {
- return this.trader.getTradingPlayer() == player;
+ return this.trader.stillValid(player);
}
public int getTraderXp() {
diff --git a/net/minecraft/world/inventory/Slot.java b/net/minecraft/world/inventory/Slot.java
index 18ef299..d1283f3 100644
--- a/net/minecraft/world/inventory/Slot.java
+++ b/net/minecraft/world/inventory/Slot.java
@@ -1,6 +1,5 @@
package net.minecraft.world.inventory;
-import com.mojang.datafixers.util.Pair;
import java.util.Optional;
import javax.annotation.Nullable;
import net.minecraft.resources.ResourceLocation;
@@ -80,7 +79,7 @@ public class Slot {
}
@Nullable
- public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
+ public ResourceLocation getNoItemIcon() {
return null;
}
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
index 3340de3..ef5ddfb 100644
--- a/net/minecraft/world/item/BlockItem.java
+++ b/net/minecraft/world/item/BlockItem.java
@@ -3,12 +3,17 @@ package net.minecraft.world.item;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
+import net.minecraft.ChatFormatting;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.core.BlockPos;
+import net.minecraft.core.Holder;
+import net.minecraft.core.HolderLookup;
import net.minecraft.core.component.DataComponents;
+import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
-import net.minecraft.server.MinecraftServer;
+import net.minecraft.resources.ResourceKey;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
@@ -32,6 +37,10 @@ import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.shapes.CollisionContext;
public class BlockItem extends Item {
+ private static final Component OP_NBT_WARNING_LINE_1 = Component.translatable("item.op_block_warning.line1")
+ .withStyle(ChatFormatting.RED, ChatFormatting.BOLD);
+ private static final Component OP_NBT_WARNING_LINE_2 = Component.translatable("item.op_block_warning.line2").withStyle(ChatFormatting.RED);
+ private static final Component OP_NBT_WARNING_LINE_3 = Component.translatable("item.op_block_warning.line3").withStyle(ChatFormatting.RED);
@Deprecated
private final Block block;
@@ -153,15 +162,24 @@ public class BlockItem extends Item {
}
public static boolean updateCustomBlockEntityTag(Level level, @Nullable Player player, BlockPos pos, ItemStack stack) {
- MinecraftServer server = level.getServer();
- if (server == null) {
+ if (level.isClientSide) {
return false;
} else {
CustomData customData = stack.getOrDefault(DataComponents.BLOCK_ENTITY_DATA, CustomData.EMPTY);
if (!customData.isEmpty()) {
+ BlockEntityType<?> blockEntityType = getBlockEntityType(level.registryAccess(), customData);
+ if (blockEntityType == null) {
+ return false;
+ }
+
BlockEntity blockEntity = level.getBlockEntity(pos);
if (blockEntity != null) {
- if (level.isClientSide || !blockEntity.onlyOpCanSetNbt() || player != null && player.canUseGameMasterBlocks()) {
+ BlockEntityType<?> type = blockEntity.getType();
+ if (type != blockEntityType) {
+ return false;
+ }
+
+ if (!type.onlyOpCanSetNbt() || player != null && player.canUseGameMasterBlocks()) {
return customData.loadInto(blockEntity, level.registryAccess());
}
@@ -173,10 +191,30 @@ public class BlockItem extends Item {
}
}
+ @Nullable
+ private static BlockEntityType<?> getBlockEntityType(HolderLookup.Provider provider, CustomData customData) {
+ ResourceLocation resourceLocation = customData.parseEntityId();
+ return resourceLocation == null
+ ? null
+ : provider.lookup(Registries.BLOCK_ENTITY_TYPE)
+ .flatMap(registryLookup -> registryLookup.get(ResourceKey.create(Registries.BLOCK_ENTITY_TYPE, resourceLocation)))
+ .map(Holder::value)
+ .orElse(null);
+ }
+
@Override
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
this.getBlock().appendHoverText(stack, context, tooltipComponents, tooltipFlag);
+ CustomData customData = stack.get(DataComponents.BLOCK_ENTITY_DATA);
+ if (customData != null && context.permissionLevel() >= 2) {
+ BlockEntityType<?> blockEntityType = getBlockEntityType(context.registries(), customData);
+ if (blockEntityType != null && blockEntityType.onlyOpCanSetNbt()) {
+ tooltipComponents.add(OP_NBT_WARNING_LINE_1);
+ tooltipComponents.add(OP_NBT_WARNING_LINE_2);
+ tooltipComponents.add(OP_NBT_WARNING_LINE_3);
+ }
+ }
}
public Block getBlock() {
diff --git a/net/minecraft/world/item/CreativeModeTabs.java b/net/minecraft/world/item/CreativeModeTabs.java
index 0410fa6..bc181f1 100644
--- a/net/minecraft/world/item/CreativeModeTabs.java
+++ b/net/minecraft/world/item/CreativeModeTabs.java
@@ -323,6 +323,11 @@ public class CreativeModeTabs {
output.accept(Items.MUD_BRICK_STAIRS);
output.accept(Items.MUD_BRICK_SLAB);
output.accept(Items.MUD_BRICK_WALL);
+ output.accept(Items.RESIN_BRICKS);
+ output.accept(Items.RESIN_BRICK_STAIRS);
+ output.accept(Items.RESIN_BRICK_SLAB);
+ output.accept(Items.RESIN_BRICK_WALL);
+ output.accept(Items.CHISELED_RESIN_BRICKS);
output.accept(Items.SANDSTONE);
output.accept(Items.SANDSTONE_STAIRS);
output.accept(Items.SANDSTONE_SLAB);
@@ -835,6 +840,8 @@ public class CreativeModeTabs {
output.accept(Items.FERN);
output.accept(Items.DEAD_BUSH);
output.accept(Items.DANDELION);
+ output.accept(Items.OPEN_EYEBLOSSOM);
+ output.accept(Items.CLOSED_EYEBLOSSOM);
output.accept(Items.POPPY);
output.accept(Items.BLUE_ORCHID);
output.accept(Items.ALLIUM);
@@ -931,6 +938,7 @@ public class CreativeModeTabs {
output.accept(Items.HONEYCOMB_BLOCK);
output.accept(Items.SLIME_BLOCK);
output.accept(Items.HONEY_BLOCK);
+ output.accept(Items.RESIN_BLOCK);
output.accept(Items.OCHRE_FROGLIGHT);
output.accept(Items.VERDANT_FROGLIGHT);
output.accept(Items.PEARLESCENT_FROGLIGHT);
@@ -1578,6 +1586,7 @@ public class CreativeModeTabs {
output.accept(Items.ANCIENT_DEBRIS);
output.accept(Items.QUARTZ);
output.accept(Items.AMETHYST_SHARD);
+ output.accept(Items.RESIN_CLUMP);
output.accept(Items.IRON_NUGGET);
output.accept(Items.GOLD_NUGGET);
output.accept(Items.IRON_INGOT);
@@ -1637,6 +1646,7 @@ public class CreativeModeTabs {
output.accept(Items.BOWL);
output.accept(Items.BRICK);
output.accept(Items.NETHER_BRICK);
+ output.accept(Items.RESIN_BRICK);
output.accept(Items.PAPER);
output.accept(Items.BOOK);
output.accept(Items.FIREWORK_STAR);
diff --git a/net/minecraft/world/item/EggItem.java b/net/minecraft/world/item/EggItem.java
index 5cd1bc5..4386792 100644
--- a/net/minecraft/world/item/EggItem.java
+++ b/net/minecraft/world/item/EggItem.java
@@ -14,6 +14,8 @@ import net.minecraft.world.entity.projectile.ThrownEgg;
import net.minecraft.world.level.Level;
public class EggItem extends Item implements ProjectileItem {
+ public static float PROJECTILE_SHOOT_POWER = 1.5F;
+
public EggItem(Item.Properties properties) {
super(properties);
}
@@ -32,7 +34,7 @@ public class EggItem extends Item implements ProjectileItem {
0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)
);
if (level instanceof ServerLevel serverLevel) {
- Projectile.spawnProjectileFromRotation(ThrownEgg::new, serverLevel, itemInHand, player, 0.0F, 1.5F, 1.0F);
+ Projectile.spawnProjectileFromRotation(ThrownEgg::new, serverLevel, itemInHand, player, 0.0F, PROJECTILE_SHOOT_POWER, 1.0F);
}
player.awardStat(Stats.ITEM_USED.get(this));
diff --git a/net/minecraft/world/item/EnderpearlItem.java b/net/minecraft/world/item/EnderpearlItem.java
index 1951fea..13810fa 100644
--- a/net/minecraft/world/item/EnderpearlItem.java
+++ b/net/minecraft/world/item/EnderpearlItem.java
@@ -12,6 +12,8 @@ import net.minecraft.world.entity.projectile.ThrownEnderpearl;
import net.minecraft.world.level.Level;
public class EnderpearlItem extends Item {
+ public static float PROJECTILE_SHOOT_POWER = 1.5F;
+
public EnderpearlItem(Item.Properties properties) {
super(properties);
}
@@ -30,7 +32,7 @@ public class EnderpearlItem extends Item {
0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)
);
if (level instanceof ServerLevel serverLevel) {
- Projectile.spawnProjectileFromRotation(ThrownEnderpearl::new, serverLevel, itemInHand, player, 0.0F, 1.5F, 1.0F);
+ Projectile.spawnProjectileFromRotation(ThrownEnderpearl::new, serverLevel, itemInHand, player, 0.0F, PROJECTILE_SHOOT_POWER, 1.0F);
}
player.awardStat(Stats.ITEM_USED.get(this));
diff --git a/net/minecraft/world/item/Item.java b/net/minecraft/world/item/Item.java
index 780988a..bea7a1f 100644
--- a/net/minecraft/world/item/Item.java
+++ b/net/minecraft/world/item/Item.java
@@ -473,6 +473,11 @@ public class Item implements FeatureElement, ItemLike {
public MapItemSavedData mapData(MapId mapId) {
return null;
}
+
+ @Override
+ public int permissionLevel() {
+ return 0;
+ }
};
@Nullable
@@ -483,23 +488,35 @@ public class Item implements FeatureElement, ItemLike {
@Nullable
MapItemSavedData mapData(MapId mapId);
- static Item.TooltipContext of(@Nullable final Level level) {
- return level == null ? EMPTY : new Item.TooltipContext() {
- @Override
- public HolderLookup.Provider registries() {
- return level.registryAccess();
- }
-
- @Override
- public float tickRate() {
- return level.tickRateManager().tickrate();
- }
+ int permissionLevel();
- @Override
- public MapItemSavedData mapData(MapId mapId) {
- return level.getMapData(mapId);
- }
- };
+ static Item.TooltipContext of(@Nullable final Level level, @Nullable Player player) {
+ if (level == null) {
+ return EMPTY;
+ } else {
+ final int i = player != null ? player.getPermissionLevel() : 0;
+ return new Item.TooltipContext() {
+ @Override
+ public HolderLookup.Provider registries() {
+ return level.registryAccess();
+ }
+
+ @Override
+ public float tickRate() {
+ return level.tickRateManager().tickrate();
+ }
+
+ @Override
+ public MapItemSavedData mapData(MapId mapId) {
+ return level.getMapData(mapId);
+ }
+
+ @Override
+ public int permissionLevel() {
+ return i;
+ }
+ };
+ }
}
static Item.TooltipContext of(final HolderLookup.Provider registries) {
@@ -519,6 +536,11 @@ public class Item implements FeatureElement, ItemLike {
public MapItemSavedData mapData(MapId mapId) {
return null;
}
+
+ @Override
+ public int permissionLevel() {
+ return 0;
+ }
};
}
}
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
index 5e15188..075de83 100644
--- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java
@@ -750,6 +750,12 @@ public final class ItemStack implements DataComponentHolder {
}
public Component getHoverName() {
+ Component customName = this.getCustomName();
+ return customName != null ? customName : this.getItemName();
+ }
+
+ @Nullable
+ public Component getCustomName() {
Component component = this.get(DataComponents.CUSTOM_NAME);
if (component != null) {
return component;
@@ -762,7 +768,7 @@ public final class ItemStack implements DataComponentHolder {
}
}
- return this.getItemName();
+ return null;
}
}
diff --git a/net/minecraft/world/item/Items.java b/net/minecraft/world/item/Items.java
index 1f15ac2..6d32619 100644
--- a/net/minecraft/world/item/Items.java
+++ b/net/minecraft/world/item/Items.java
@@ -19,7 +19,6 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.util.Unit;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
-import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.food.Foods;
import net.minecraft.world.item.alchemy.PotionContents;
import net.minecraft.world.item.component.BundleContents;
@@ -274,6 +273,8 @@ public class Items {
public static final Item RED_WOOL = registerBlock(Blocks.RED_WOOL);
public static final Item BLACK_WOOL = registerBlock(Blocks.BLACK_WOOL);
public static final Item DANDELION = registerBlock(Blocks.DANDELION);
+ public static final Item OPEN_EYEBLOSSOM = registerBlock(Blocks.OPEN_EYEBLOSSOM);
+ public static final Item CLOSED_EYEBLOSSOM = registerBlock(Blocks.CLOSED_EYEBLOSSOM);
public static final Item POPPY = registerBlock(Blocks.POPPY);
public static final Item BLUE_ORCHID = registerBlock(Blocks.BLUE_ORCHID);
public static final Item ALLIUM = registerBlock(Blocks.ALLIUM);
@@ -350,7 +351,8 @@ public class Items {
Blocks.CHISELED_BOOKSHELF, properties -> properties.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)
);
public static final Item DECORATED_POT = registerBlock(
- Blocks.DECORATED_POT, new Item.Properties().component(DataComponents.POT_DECORATIONS, PotDecorations.EMPTY)
+ Blocks.DECORATED_POT,
+ new Item.Properties().component(DataComponents.POT_DECORATIONS, PotDecorations.EMPTY).component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)
);
public static final Item MOSSY_COBBLESTONE = registerBlock(Blocks.MOSSY_COBBLESTONE);
public static final Item OBSIDIAN = registerBlock(Blocks.OBSIDIAN);
@@ -436,6 +438,13 @@ public class Items {
public static final Item MELON = registerBlock(Blocks.MELON);
public static final Item VINE = registerBlock(Blocks.VINE);
public static final Item GLOW_LICHEN = registerBlock(Blocks.GLOW_LICHEN);
+ public static final Item RESIN_CLUMP = registerItem("resin_clump", createBlockItemWithCustomItemName(Blocks.RESIN_CLUMP));
+ public static final Item RESIN_BLOCK = registerBlock(Blocks.RESIN_BLOCK);
+ public static final Item RESIN_BRICKS = registerBlock(Blocks.RESIN_BRICKS);
+ public static final Item RESIN_BRICK_STAIRS = registerBlock(Blocks.RESIN_BRICK_STAIRS);
+ public static final Item RESIN_BRICK_SLAB = registerBlock(Blocks.RESIN_BRICK_SLAB);
+ public static final Item RESIN_BRICK_WALL = registerBlock(Blocks.RESIN_BRICK_WALL);
+ public static final Item CHISELED_RESIN_BRICKS = registerBlock(Blocks.CHISELED_RESIN_BRICKS);
public static final Item BRICK_STAIRS = registerBlock(Blocks.BRICK_STAIRS);
public static final Item STONE_BRICK_STAIRS = registerBlock(Blocks.STONE_BRICK_STAIRS);
public static final Item MUD_BRICK_STAIRS = registerBlock(Blocks.MUD_BRICK_STAIRS);
@@ -1022,14 +1031,10 @@ public class Items {
"dark_oak_chest_boat", properties -> new BoatItem(EntityType.DARK_OAK_CHEST_BOAT, properties), new Item.Properties().stacksTo(1)
);
public static final Item PALE_OAK_BOAT = registerItem(
- "pale_oak_boat",
- properties -> new BoatItem(EntityType.PALE_OAK_BOAT, properties),
- new Item.Properties().stacksTo(1).requiredFeatures(FeatureFlags.WINTER_DROP)
+ "pale_oak_boat", properties -> new BoatItem(EntityType.PALE_OAK_BOAT, properties), new Item.Properties().stacksTo(1)
);
public static final Item PALE_OAK_CHEST_BOAT = registerItem(
- "pale_oak_chest_boat",
- properties -> new BoatItem(EntityType.PALE_OAK_CHEST_BOAT, properties),
- new Item.Properties().stacksTo(1).requiredFeatures(FeatureFlags.WINTER_DROP)
+ "pale_oak_chest_boat", properties -> new BoatItem(EntityType.PALE_OAK_CHEST_BOAT, properties), new Item.Properties().stacksTo(1)
);
public static final Item MANGROVE_BOAT = registerItem(
"mangrove_boat", properties -> new BoatItem(EntityType.MANGROVE_BOAT, properties), new Item.Properties().stacksTo(1)
@@ -1839,6 +1844,7 @@ public class Items {
.component(DataComponents.ENCHANTMENT_GLINT_OVERRIDE, true)
);
public static final Item NETHER_BRICK = registerItem("nether_brick");
+ public static final Item RESIN_BRICK = registerItem("resin_brick");
public static final Item PRISMARINE_SHARD = registerItem("prismarine_shard");
public static final Item PRISMARINE_CRYSTALS = registerItem("prismarine_crystals");
public static final Item RABBIT = registerItem("rabbit", new Item.Properties().food(Foods.RABBIT));
diff --git a/net/minecraft/world/item/MapItem.java b/net/minecraft/world/item/MapItem.java
index 452471b..0668d84 100644
--- a/net/minecraft/world/item/MapItem.java
+++ b/net/minecraft/world/item/MapItem.java
@@ -119,7 +119,7 @@ public class MapItem extends Item {
mutableBlockPos.set(i9 + i12, 0, i10 + i13);
int i14 = chunk.getHeight(Heightmap.Types.WORLD_SURFACE, mutableBlockPos.getX(), mutableBlockPos.getZ()) + 1;
BlockState blockState;
- if (i14 <= level.getMinY() + 1) {
+ if (i14 <= level.getMinY()) {
blockState = Blocks.BEDROCK.defaultBlockState();
} else {
do {
diff --git a/net/minecraft/world/item/SmithingTemplateItem.java b/net/minecraft/world/item/SmithingTemplateItem.java
index 74675fd..e568701 100644
--- a/net/minecraft/world/item/SmithingTemplateItem.java
+++ b/net/minecraft/world/item/SmithingTemplateItem.java
@@ -50,22 +50,22 @@ public class SmithingTemplateItem extends Item {
private static final Component NETHERITE_UPGRADE_ADDITIONS_SLOT_DESCRIPTION = Component.translatable(
Util.makeDescriptionId("item", ResourceLocation.withDefaultNamespace("smithing_template.netherite_upgrade.additions_slot_description"))
);
- private static final ResourceLocation EMPTY_SLOT_HELMET = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_helmet");
- private static final ResourceLocation EMPTY_SLOT_CHESTPLATE = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_chestplate");
- private static final ResourceLocation EMPTY_SLOT_LEGGINGS = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_leggings");
- private static final ResourceLocation EMPTY_SLOT_BOOTS = ResourceLocation.withDefaultNamespace("item/empty_armor_slot_boots");
- private static final ResourceLocation EMPTY_SLOT_HOE = ResourceLocation.withDefaultNamespace("item/empty_slot_hoe");
- private static final ResourceLocation EMPTY_SLOT_AXE = ResourceLocation.withDefaultNamespace("item/empty_slot_axe");
- private static final ResourceLocation EMPTY_SLOT_SWORD = ResourceLocation.withDefaultNamespace("item/empty_slot_sword");
- private static final ResourceLocation EMPTY_SLOT_SHOVEL = ResourceLocation.withDefaultNamespace("item/empty_slot_shovel");
- private static final ResourceLocation EMPTY_SLOT_PICKAXE = ResourceLocation.withDefaultNamespace("item/empty_slot_pickaxe");
- private static final ResourceLocation EMPTY_SLOT_INGOT = ResourceLocation.withDefaultNamespace("item/empty_slot_ingot");
- private static final ResourceLocation EMPTY_SLOT_REDSTONE_DUST = ResourceLocation.withDefaultNamespace("item/empty_slot_redstone_dust");
- private static final ResourceLocation EMPTY_SLOT_QUARTZ = ResourceLocation.withDefaultNamespace("item/empty_slot_quartz");
- private static final ResourceLocation EMPTY_SLOT_EMERALD = ResourceLocation.withDefaultNamespace("item/empty_slot_emerald");
- private static final ResourceLocation EMPTY_SLOT_DIAMOND = ResourceLocation.withDefaultNamespace("item/empty_slot_diamond");
- private static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = ResourceLocation.withDefaultNamespace("item/empty_slot_lapis_lazuli");
- private static final ResourceLocation EMPTY_SLOT_AMETHYST_SHARD = ResourceLocation.withDefaultNamespace("item/empty_slot_amethyst_shard");
+ private static final ResourceLocation EMPTY_SLOT_HELMET = ResourceLocation.withDefaultNamespace("container/slot/helmet");
+ private static final ResourceLocation EMPTY_SLOT_CHESTPLATE = ResourceLocation.withDefaultNamespace("container/slot/chestplate");
+ private static final ResourceLocation EMPTY_SLOT_LEGGINGS = ResourceLocation.withDefaultNamespace("container/slot/leggings");
+ private static final ResourceLocation EMPTY_SLOT_BOOTS = ResourceLocation.withDefaultNamespace("container/slot/boots");
+ private static final ResourceLocation EMPTY_SLOT_HOE = ResourceLocation.withDefaultNamespace("container/slot/hoe");
+ private static final ResourceLocation EMPTY_SLOT_AXE = ResourceLocation.withDefaultNamespace("container/slot/axe");
+ private static final ResourceLocation EMPTY_SLOT_SWORD = ResourceLocation.withDefaultNamespace("container/slot/sword");
+ private static final ResourceLocation EMPTY_SLOT_SHOVEL = ResourceLocation.withDefaultNamespace("container/slot/shovel");
+ private static final ResourceLocation EMPTY_SLOT_PICKAXE = ResourceLocation.withDefaultNamespace("container/slot/pickaxe");
+ private static final ResourceLocation EMPTY_SLOT_INGOT = ResourceLocation.withDefaultNamespace("container/slot/ingot");
+ private static final ResourceLocation EMPTY_SLOT_REDSTONE_DUST = ResourceLocation.withDefaultNamespace("container/slot/redstone_dust");
+ private static final ResourceLocation EMPTY_SLOT_QUARTZ = ResourceLocation.withDefaultNamespace("container/slot/quartz");
+ private static final ResourceLocation EMPTY_SLOT_EMERALD = ResourceLocation.withDefaultNamespace("container/slot/emerald");
+ private static final ResourceLocation EMPTY_SLOT_DIAMOND = ResourceLocation.withDefaultNamespace("container/slot/diamond");
+ private static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = ResourceLocation.withDefaultNamespace("container/slot/lapis_lazuli");
+ private static final ResourceLocation EMPTY_SLOT_AMETHYST_SHARD = ResourceLocation.withDefaultNamespace("container/slot/amethyst_shard");
private final Component appliesTo;
private final Component ingredients;
private final Component baseSlotDescription;
diff --git a/net/minecraft/world/item/SnowballItem.java b/net/minecraft/world/item/SnowballItem.java
index af99eaf..2110186 100644
--- a/net/minecraft/world/item/SnowballItem.java
+++ b/net/minecraft/world/item/SnowballItem.java
@@ -14,6 +14,8 @@ import net.minecraft.world.entity.projectile.Snowball;
import net.minecraft.world.level.Level;
public class SnowballItem extends Item implements ProjectileItem {
+ public static float PROJECTILE_SHOOT_POWER = 1.5F;
+
public SnowballItem(Item.Properties properties) {
super(properties);
}
@@ -32,7 +34,7 @@ public class SnowballItem extends Item implements ProjectileItem {
0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)
);
if (level instanceof ServerLevel serverLevel) {
- Projectile.spawnProjectileFromRotation(Snowball::new, serverLevel, itemInHand, player, 0.0F, 1.5F, 1.0F);
+ Projectile.spawnProjectileFromRotation(Snowball::new, serverLevel, itemInHand, player, 0.0F, PROJECTILE_SHOOT_POWER, 1.0F);
}
player.awardStat(Stats.ITEM_USED.get(this));
diff --git a/net/minecraft/world/item/ThrowablePotionItem.java b/net/minecraft/world/item/ThrowablePotionItem.java
index 7e96ae9..cb46245 100644
--- a/net/minecraft/world/item/ThrowablePotionItem.java
+++ b/net/minecraft/world/item/ThrowablePotionItem.java
@@ -12,6 +12,8 @@ import net.minecraft.world.entity.projectile.ThrownPotion;
import net.minecraft.world.level.Level;
public class ThrowablePotionItem extends PotionItem implements ProjectileItem {
+ public static float PROJECTILE_SHOOT_POWER = 0.5F;
+
public ThrowablePotionItem(Item.Properties properties) {
super(properties);
}
@@ -20,7 +22,7 @@ public class ThrowablePotionItem extends PotionItem implements ProjectileItem {
public InteractionResult use(Level level, Player player, InteractionHand interactionHand) {
ItemStack itemInHand = player.getItemInHand(interactionHand);
if (level instanceof ServerLevel serverLevel) {
- Projectile.spawnProjectileFromRotation(ThrownPotion::new, serverLevel, itemInHand, player, -20.0F, 0.5F, 1.0F);
+ Projectile.spawnProjectileFromRotation(ThrownPotion::new, serverLevel, itemInHand, player, -20.0F, PROJECTILE_SHOOT_POWER, 1.0F);
}
player.awardStat(Stats.ITEM_USED.get(this));
diff --git a/net/minecraft/world/item/TridentItem.java b/net/minecraft/world/item/TridentItem.java
index d3802d7..553d7b3 100644
--- a/net/minecraft/world/item/TridentItem.java
+++ b/net/minecraft/world/item/TridentItem.java
@@ -34,7 +34,7 @@ import net.minecraft.world.phys.Vec3;
public class TridentItem extends Item implements ProjectileItem {
public static final int THROW_THRESHOLD_TIME = 10;
public static final float BASE_DAMAGE = 8.0F;
- public static final float SHOOT_POWER = 2.5F;
+ public static final float PROJECTILE_SHOOT_POWER = 2.5F;
public TridentItem(Item.Properties properties) {
super(properties);
diff --git a/net/minecraft/world/item/WindChargeItem.java b/net/minecraft/world/item/WindChargeItem.java
index 1742c16..989e91a 100644
--- a/net/minecraft/world/item/WindChargeItem.java
+++ b/net/minecraft/world/item/WindChargeItem.java
@@ -17,6 +17,8 @@ import net.minecraft.world.level.block.DispenserBlock;
import net.minecraft.world.phys.Vec3;
public class WindChargeItem extends Item implements ProjectileItem {
+ public static float PROJECTILE_SHOOT_POWER = 1.5F;
+
public WindChargeItem(Item.Properties properties) {
super(properties);
}
@@ -33,7 +35,7 @@ public class WindChargeItem extends Item implements ProjectileItem {
itemInHand,
player,
0.0F,
- 1.5F,
+ PROJECTILE_SHOOT_POWER,
1.0F
);
}
diff --git a/net/minecraft/world/item/component/CustomData.java b/net/minecraft/world/item/component/CustomData.java
index 93b2345..3f18894 100644
--- a/net/minecraft/world/item/component/CustomData.java
+++ b/net/minecraft/world/item/component/CustomData.java
@@ -11,6 +11,7 @@ import io.netty.buffer.ByteBuf;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.function.Predicate;
+import javax.annotation.Nullable;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.component.DataComponentType;
import net.minecraft.nbt.CompoundTag;
@@ -20,6 +21,7 @@ import net.minecraft.nbt.Tag;
import net.minecraft.nbt.TagParser;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
@@ -28,6 +30,7 @@ import org.slf4j.Logger;
public final class CustomData {
private static final Logger LOGGER = LogUtils.getLogger();
public static final CustomData EMPTY = new CustomData(new CompoundTag());
+ private static final String TYPE_TAG = "id";
public static final Codec<CustomData> CODEC = Codec.withAlternative(CompoundTag.CODEC, TagParser.AS_CODEC)
.xmap(CustomData::new, customData -> customData.tag);
public static final Codec<CustomData> CODEC_WITH_ID = CODEC.validate(
@@ -81,6 +84,11 @@ public final class CustomData {
return new CustomData(compoundTag);
}
+ @Nullable
+ public ResourceLocation parseEntityId() {
+ return !this.tag.contains("id", 8) ? null : ResourceLocation.tryParse(this.tag.getString("id"));
+ }
+
public void loadInto(Entity entity) {
CompoundTag compoundTag = entity.saveWithoutId(new CompoundTag());
UUID uuid = entity.getUUID();
diff --git a/net/minecraft/world/item/enchantment/Enchantments.java b/net/minecraft/world/item/enchantment/Enchantments.java
index 18c0dd8..b01e5a1 100644
--- a/net/minecraft/world/item/enchantment/Enchantments.java
+++ b/net/minecraft/world/item/enchantment/Enchantments.java
@@ -848,7 +848,7 @@ public class Enchantments {
)
.withEffect(
EnchantmentEffectComponents.DAMAGE,
- new AddValue(LevelBasedValue.perLevel(0.5F)),
+ new AddValue(LevelBasedValue.perLevel(1.0F, 0.5F)),
LootItemEntityPropertyCondition.hasProperties(
LootContext.EntityTarget.DIRECT_ATTACKER, EntityPredicate.Builder.entity().of(holderGetter4, EntityTypeTags.ARROWS).build()
)
diff --git a/net/minecraft/world/item/equipment/trim/TrimMaterials.java b/net/minecraft/world/item/equipment/trim/TrimMaterials.java
index ec5f526..dcd54f9 100644
--- a/net/minecraft/world/item/equipment/trim/TrimMaterials.java
+++ b/net/minecraft/world/item/equipment/trim/TrimMaterials.java
@@ -27,20 +27,22 @@ public class TrimMaterials {
public static final ResourceKey<TrimMaterial> DIAMOND = registryKey("diamond");
public static final ResourceKey<TrimMaterial> LAPIS = registryKey("lapis");
public static final ResourceKey<TrimMaterial> AMETHYST = registryKey("amethyst");
+ public static final ResourceKey<TrimMaterial> RESIN = registryKey("resin");
public static void bootstrap(BootstrapContext<TrimMaterial> bootstrapContext) {
- register(bootstrapContext, QUARTZ, Items.QUARTZ, Style.EMPTY.withColor(14931140), 0.1F);
- register(bootstrapContext, IRON, Items.IRON_INGOT, Style.EMPTY.withColor(15527148), 0.2F, Map.of(EquipmentModels.IRON, "iron_darker"));
+ register(bootstrapContext, QUARTZ, Items.QUARTZ, Style.EMPTY.withColor(14931140), 0.01F);
+ register(bootstrapContext, IRON, Items.IRON_INGOT, Style.EMPTY.withColor(15527148), 0.02F, Map.of(EquipmentModels.IRON, "iron_darker"));
register(
- bootstrapContext, NETHERITE, Items.NETHERITE_INGOT, Style.EMPTY.withColor(6445145), 0.3F, Map.of(EquipmentModels.NETHERITE, "netherite_darker")
+ bootstrapContext, NETHERITE, Items.NETHERITE_INGOT, Style.EMPTY.withColor(6445145), 0.03F, Map.of(EquipmentModels.NETHERITE, "netherite_darker")
);
- register(bootstrapContext, REDSTONE, Items.REDSTONE, Style.EMPTY.withColor(9901575), 0.4F);
- register(bootstrapContext, COPPER, Items.COPPER_INGOT, Style.EMPTY.withColor(11823181), 0.5F);
- register(bootstrapContext, GOLD, Items.GOLD_INGOT, Style.EMPTY.withColor(14594349), 0.6F, Map.of(EquipmentModels.GOLD, "gold_darker"));
- register(bootstrapContext, EMERALD, Items.EMERALD, Style.EMPTY.withColor(1155126), 0.7F);
- register(bootstrapContext, DIAMOND, Items.DIAMOND, Style.EMPTY.withColor(7269586), 0.8F, Map.of(EquipmentModels.DIAMOND, "diamond_darker"));
- register(bootstrapContext, LAPIS, Items.LAPIS_LAZULI, Style.EMPTY.withColor(4288151), 0.9F);
- register(bootstrapContext, AMETHYST, Items.AMETHYST_SHARD, Style.EMPTY.withColor(10116294), 1.0F);
+ register(bootstrapContext, REDSTONE, Items.REDSTONE, Style.EMPTY.withColor(9901575), 0.04F);
+ register(bootstrapContext, COPPER, Items.COPPER_INGOT, Style.EMPTY.withColor(11823181), 0.05F);
+ register(bootstrapContext, GOLD, Items.GOLD_INGOT, Style.EMPTY.withColor(14594349), 0.06F, Map.of(EquipmentModels.GOLD, "gold_darker"));
+ register(bootstrapContext, EMERALD, Items.EMERALD, Style.EMPTY.withColor(1155126), 0.07F);
+ register(bootstrapContext, DIAMOND, Items.DIAMOND, Style.EMPTY.withColor(7269586), 0.08F, Map.of(EquipmentModels.DIAMOND, "diamond_darker"));
+ register(bootstrapContext, LAPIS, Items.LAPIS_LAZULI, Style.EMPTY.withColor(4288151), 0.09F);
+ register(bootstrapContext, AMETHYST, Items.AMETHYST_SHARD, Style.EMPTY.withColor(10116294), 0.1F);
+ register(bootstrapContext, RESIN, Items.RESIN_CLUMP, Style.EMPTY.withColor(16545810), 0.11F);
}
public static Optional<Holder.Reference<TrimMaterial>> getFromIngredient(HolderLookup.Provider provider, ItemStack itemStack) {
diff --git a/net/minecraft/world/item/trading/Merchant.java b/net/minecraft/world/item/trading/Merchant.java
index 041af3c..4a5744f 100644
--- a/net/minecraft/world/item/trading/Merchant.java
+++ b/net/minecraft/world/item/trading/Merchant.java
@@ -48,4 +48,6 @@ public interface Merchant {
}
boolean isClientSide();
+
+ boolean stillValid(Player player);
}
diff --git a/net/minecraft/world/item/trading/MerchantOffers.java b/net/minecraft/world/item/trading/MerchantOffers.java
index 7422c47..a75e271 100644
--- a/net/minecraft/world/item/trading/MerchantOffers.java
+++ b/net/minecraft/world/item/trading/MerchantOffers.java
@@ -3,6 +3,7 @@ package net.minecraft.world.item.trading;
import com.mojang.serialization.Codec;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
import net.minecraft.network.RegistryFriendlyByteBuf;
@@ -11,7 +12,11 @@ import net.minecraft.network.codec.StreamCodec;
import net.minecraft.world.item.ItemStack;
public class MerchantOffers extends ArrayList<MerchantOffer> {
- public static final Codec<MerchantOffers> CODEC = MerchantOffer.CODEC.listOf().fieldOf("Recipes").xmap(MerchantOffers::new, Function.identity()).codec();
+ public static final Codec<MerchantOffers> CODEC = MerchantOffer.CODEC
+ .listOf()
+ .optionalFieldOf("Recipes", List.of())
+ .xmap(MerchantOffers::new, Function.identity())
+ .codec();
public static final StreamCodec<RegistryFriendlyByteBuf, MerchantOffers> STREAM_CODEC = MerchantOffer.STREAM_CODEC
.apply(ByteBufCodecs.collection(MerchantOffers::new));
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
index e5b728e..21e131b 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -3,6 +3,7 @@ package net.minecraft.world.level;
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.function.Consumer;
@@ -422,7 +423,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
}
- public void addParticle(ParticleOptions particleData, boolean forceAlwaysRender, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
+ public void addParticle(ParticleOptions particleOptions, boolean flag, boolean flag1, double d, double d1, double d2, double d3, double d4, double d5) {
}
public void addAlwaysVisibleParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
@@ -690,15 +691,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (entity1 != entity && predicate.test(entity1)) {
list.add(entity1);
}
+ });
- if (entity1 instanceof EnderDragon) {
- for (EnderDragonPart enderDragonPart : ((EnderDragon)entity1).getSubEntities()) {
- if (entity1 != entity && predicate.test(enderDragonPart)) {
- list.add(enderDragonPart);
- }
- }
+ for (EnderDragonPart enderDragonPart : this.dragonParts()) {
+ if (enderDragonPart != entity
+ && enderDragonPart.parentMob != entity
+ && predicate.test(enderDragonPart)
+ && boundingBox.intersects(enderDragonPart.getBoundingBox())) {
+ list.add(enderDragonPart);
}
- });
+ }
+
return list;
}
@@ -744,6 +747,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Nullable
public abstract Entity getEntity(int id);
+ public abstract Collection<EnderDragonPart> dragonParts();
+
public void blockEntityChanged(BlockPos pos) {
if (this.hasChunkAt(pos)) {
this.getChunkAt(pos).markUnsaved();
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
index 80a79a0..6efa14d 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -206,7 +206,7 @@ public class ServerExplosion implements Explosion {
d2 *= d5;
d3 *= d5;
Vec3 vec3 = new Vec3(d1, d2, d3);
- entity.setDeltaMovement(entity.getDeltaMovement().add(vec3));
+ entity.push(vec3);
if (entity instanceof Player) {
Player player = (Player)entity;
if (!player.isSpectator() && (!player.isCreative() || !player.getAbilities().flying)) {
@@ -296,6 +296,10 @@ public class ServerExplosion implements Explosion {
return this.source;
}
+ public DamageSource getDamageSource() {
+ return this.damageSource;
+ }
+
@Override
public Explosion.BlockInteraction getBlockInteraction() {
return this.blockInteraction;
diff --git a/net/minecraft/world/level/biome/Biome.java b/net/minecraft/world/level/biome/Biome.java
index 2ec86a7..0bfd03a 100644
--- a/net/minecraft/world/level/biome/Biome.java
+++ b/net/minecraft/world/level/biome/Biome.java
@@ -18,6 +18,7 @@ import net.minecraft.sounds.Music;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.Mth;
import net.minecraft.util.StringRepresentable;
+import net.minecraft.util.random.SimpleWeightedRandomList;
import net.minecraft.world.level.FoliageColor;
import net.minecraft.world.level.GrassColor;
import net.minecraft.world.level.LevelReader;
@@ -250,10 +251,14 @@ public final class Biome {
return this.specialEffects.getAmbientAdditionsSettings();
}
- public Optional<Music> getBackgroundMusic() {
+ public Optional<SimpleWeightedRandomList<Music>> getBackgroundMusic() {
return this.specialEffects.getBackgroundMusic();
}
+ public float getBackgroundMusicVolume() {
+ return this.specialEffects.getBackgroundMusicVolume();
+ }
+
public static class BiomeBuilder {
private boolean hasPrecipitation = true;
@Nullable
diff --git a/net/minecraft/world/level/biome/BiomeSpecialEffects.java b/net/minecraft/world/level/biome/BiomeSpecialEffects.java
index 67906f9..9077c7d 100644
--- a/net/minecraft/world/level/biome/BiomeSpecialEffects.java
+++ b/net/minecraft/world/level/biome/BiomeSpecialEffects.java
@@ -9,6 +9,7 @@ import net.minecraft.core.Holder;
import net.minecraft.sounds.Music;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.StringRepresentable;
+import net.minecraft.util.random.SimpleWeightedRandomList;
public class BiomeSpecialEffects {
public static final Codec<BiomeSpecialEffects> CODEC = RecordCodecBuilder.create(
@@ -26,7 +27,8 @@ public class BiomeSpecialEffects {
SoundEvent.CODEC.optionalFieldOf("ambient_sound").forGetter(effects -> effects.ambientLoopSoundEvent),
AmbientMoodSettings.CODEC.optionalFieldOf("mood_sound").forGetter(effects -> effects.ambientMoodSettings),
AmbientAdditionsSettings.CODEC.optionalFieldOf("additions_sound").forGetter(effects -> effects.ambientAdditionsSettings),
- Music.CODEC.optionalFieldOf("music").forGetter(effects -> effects.backgroundMusic)
+ SimpleWeightedRandomList.wrappedCodecAllowingEmpty(Music.CODEC).optionalFieldOf("music").forGetter(effects -> effects.backgroundMusic),
+ Codec.FLOAT.fieldOf("music_volume").orElse(1.0F).forGetter(biomeSpecialEffects -> biomeSpecialEffects.backgroundMusicVolume)
)
.apply(instance, BiomeSpecialEffects::new)
);
@@ -41,34 +43,37 @@ public class BiomeSpecialEffects {
private final Optional<Holder<SoundEvent>> ambientLoopSoundEvent;
private final Optional<AmbientMoodSettings> ambientMoodSettings;
private final Optional<AmbientAdditionsSettings> ambientAdditionsSettings;
- private final Optional<Music> backgroundMusic;
+ private final Optional<SimpleWeightedRandomList<Music>> backgroundMusic;
+ private final float backgroundMusicVolume;
BiomeSpecialEffects(
- int fogColor,
- int waterColor,
- int waterFogColor,
- int skyColor,
- Optional<Integer> foliageColorOverride,
- Optional<Integer> grassColorOverride,
+ int i,
+ int i1,
+ int i2,
+ int i3,
+ Optional<Integer> optional,
+ Optional<Integer> optional1,
BiomeSpecialEffects.GrassColorModifier grassColorModifier,
- Optional<AmbientParticleSettings> ambientParticleSettings,
- Optional<Holder<SoundEvent>> ambientLoopSoundEvent,
- Optional<AmbientMoodSettings> ambientMoodSettings,
- Optional<AmbientAdditionsSettings> ambientAdditionsSettings,
- Optional<Music> backgroundMusic
+ Optional<AmbientParticleSettings> optional2,
+ Optional<Holder<SoundEvent>> optional3,
+ Optional<AmbientMoodSettings> optional4,
+ Optional<AmbientAdditionsSettings> optional5,
+ Optional<SimpleWeightedRandomList<Music>> optional6,
+ float f
) {
- this.fogColor = fogColor;
- this.waterColor = waterColor;
- this.waterFogColor = waterFogColor;
- this.skyColor = skyColor;
- this.foliageColorOverride = foliageColorOverride;
- this.grassColorOverride = grassColorOverride;
+ this.fogColor = i;
+ this.waterColor = i1;
+ this.waterFogColor = i2;
+ this.skyColor = i3;
+ this.foliageColorOverride = optional;
+ this.grassColorOverride = optional1;
this.grassColorModifier = grassColorModifier;
- this.ambientParticleSettings = ambientParticleSettings;
- this.ambientLoopSoundEvent = ambientLoopSoundEvent;
- this.ambientMoodSettings = ambientMoodSettings;
- this.ambientAdditionsSettings = ambientAdditionsSettings;
- this.backgroundMusic = backgroundMusic;
+ this.ambientParticleSettings = optional2;
+ this.ambientLoopSoundEvent = optional3;
+ this.ambientMoodSettings = optional4;
+ this.ambientAdditionsSettings = optional5;
+ this.backgroundMusic = optional6;
+ this.backgroundMusicVolume = f;
}
public int getFogColor() {
@@ -115,10 +120,14 @@ public class BiomeSpecialEffects {
return this.ambientAdditionsSettings;
}
- public Optional<Music> getBackgroundMusic() {
+ public Optional<SimpleWeightedRandomList<Music>> getBackgroundMusic() {
return this.backgroundMusic;
}
+ public float getBackgroundMusicVolume() {
+ return this.backgroundMusicVolume;
+ }
+
public static class Builder {
private OptionalInt fogColor = OptionalInt.empty();
private OptionalInt waterColor = OptionalInt.empty();
@@ -131,7 +140,8 @@ public class BiomeSpecialEffects {
private Optional<Holder<SoundEvent>> ambientLoopSoundEvent = Optional.empty();
private Optional<AmbientMoodSettings> ambientMoodSettings = Optional.empty();
private Optional<AmbientAdditionsSettings> ambientAdditionsSettings = Optional.empty();
- private Optional<Music> backgroundMusic = Optional.empty();
+ private Optional<SimpleWeightedRandomList<Music>> backgroundMusic = Optional.empty();
+ private float backgroundMusicVolume = 1.0F;
public BiomeSpecialEffects.Builder fogColor(int fogColor) {
this.fogColor = OptionalInt.of(fogColor);
@@ -189,7 +199,26 @@ public class BiomeSpecialEffects {
}
public BiomeSpecialEffects.Builder backgroundMusic(@Nullable Music backgroundMusic) {
- this.backgroundMusic = Optional.ofNullable(backgroundMusic);
+ if (backgroundMusic == null) {
+ this.backgroundMusic = Optional.empty();
+ return this;
+ } else {
+ this.backgroundMusic = Optional.of(SimpleWeightedRandomList.single(backgroundMusic));
+ return this;
+ }
+ }
+
+ public BiomeSpecialEffects.Builder silenceAllBackgroundMusic() {
+ return this.backgroundMusic(SimpleWeightedRandomList.empty()).backgroundMusicVolume(0.0F);
+ }
+
+ public BiomeSpecialEffects.Builder backgroundMusic(SimpleWeightedRandomList<Music> simpleWeightedRandomList) {
+ this.backgroundMusic = Optional.of(simpleWeightedRandomList);
+ return this;
+ }
+
+ public BiomeSpecialEffects.Builder backgroundMusicVolume(float f) {
+ this.backgroundMusicVolume = f;
return this;
}
@@ -206,7 +235,8 @@ public class BiomeSpecialEffects {
this.ambientLoopSoundEvent,
this.ambientMoodSettings,
this.ambientAdditionsSettings,
- this.backgroundMusic
+ this.backgroundMusic,
+ this.backgroundMusicVolume
);
}
}
diff --git a/net/minecraft/world/level/biome/Biomes.java b/net/minecraft/world/level/biome/Biomes.java
index 7607591..eaef5a5 100644
--- a/net/minecraft/world/level/biome/Biomes.java
+++ b/net/minecraft/world/level/biome/Biomes.java
@@ -17,6 +17,7 @@ public abstract class Biomes {
public static final ResourceKey<Biome> FLOWER_FOREST = register("flower_forest");
public static final ResourceKey<Biome> BIRCH_FOREST = register("birch_forest");
public static final ResourceKey<Biome> DARK_FOREST = register("dark_forest");
+ public static final ResourceKey<Biome> PALE_GARDEN = register("pale_garden");
public static final ResourceKey<Biome> OLD_GROWTH_BIRCH_FOREST = register("old_growth_birch_forest");
public static final ResourceKey<Biome> OLD_GROWTH_PINE_TAIGA = register("old_growth_pine_taiga");
public static final ResourceKey<Biome> OLD_GROWTH_SPRUCE_TAIGA = register("old_growth_spruce_taiga");
diff --git a/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterList.java b/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterList.java
index f471369..29c382c 100644
--- a/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterList.java
+++ b/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterList.java
@@ -72,19 +72,11 @@ public class MultiNoiseBiomeSourceParameterList {
ResourceLocation.withDefaultNamespace("overworld"), new MultiNoiseBiomeSourceParameterList.Preset.SourceProvider() {
@Override
public <T> Climate.ParameterList<T> apply(Function<ResourceKey<Biome>, T> valueGetter) {
- return MultiNoiseBiomeSourceParameterList.Preset.generateOverworldBiomes(valueGetter, OverworldBiomeBuilder.Modifier.NONE);
+ return MultiNoiseBiomeSourceParameterList.Preset.generateOverworldBiomes(valueGetter);
}
}
);
- public static final MultiNoiseBiomeSourceParameterList.Preset OVERWORLD_WINTER_DROP = new MultiNoiseBiomeSourceParameterList.Preset(
- ResourceLocation.withDefaultNamespace("overworld_winter_drop"), new MultiNoiseBiomeSourceParameterList.Preset.SourceProvider() {
- @Override
- public <T> Climate.ParameterList<T> apply(Function<ResourceKey<Biome>, T> valueGetter) {
- return MultiNoiseBiomeSourceParameterList.Preset.generateOverworldBiomes(valueGetter, OverworldBiomeBuilder.Modifier.WINTER_DROP);
- }
- }
- );
- static final Map<ResourceLocation, MultiNoiseBiomeSourceParameterList.Preset> BY_NAME = Stream.of(NETHER, OVERWORLD, OVERWORLD_WINTER_DROP)
+ static final Map<ResourceLocation, MultiNoiseBiomeSourceParameterList.Preset> BY_NAME = Stream.of(NETHER, OVERWORLD)
.collect(Collectors.toMap(MultiNoiseBiomeSourceParameterList.Preset::id, preset -> (MultiNoiseBiomeSourceParameterList.Preset)preset));
public static final Codec<MultiNoiseBiomeSourceParameterList.Preset> CODEC = ResourceLocation.CODEC
.flatXmap(
@@ -94,9 +86,9 @@ public class MultiNoiseBiomeSourceParameterList {
preset -> DataResult.success(preset.id)
);
- static <T> Climate.ParameterList<T> generateOverworldBiomes(Function<ResourceKey<Biome>, T> function, OverworldBiomeBuilder.Modifier modifier) {
+ static <T> Climate.ParameterList<T> generateOverworldBiomes(Function<ResourceKey<Biome>, T> valueGetter) {
Builder<Pair<Climate.ParameterPoint, T>> builder = ImmutableList.builder();
- new OverworldBiomeBuilder(modifier).addBiomes(pair -> builder.add(pair.mapSecond(function)));
+ new OverworldBiomeBuilder().addBiomes(pair -> builder.add(pair.mapSecond(valueGetter)));
return new Climate.ParameterList<>(builder.build());
}
diff --git a/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterLists.java b/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterLists.java
index 166ef7e..f0b6b62 100644
--- a/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterLists.java
+++ b/net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterLists.java
@@ -16,13 +16,6 @@ public class MultiNoiseBiomeSourceParameterLists {
context.register(OVERWORLD, new MultiNoiseBiomeSourceParameterList(MultiNoiseBiomeSourceParameterList.Preset.OVERWORLD, holderGetter));
}
- public static void winterDrop(BootstrapContext<MultiNoiseBiomeSourceParameterList> bootstrapContext) {
- HolderGetter<Biome> holderGetter = bootstrapContext.lookup(Registries.BIOME);
- bootstrapContext.register(
- OVERWORLD, new MultiNoiseBiomeSourceParameterList(MultiNoiseBiomeSourceParameterList.Preset.OVERWORLD_WINTER_DROP, holderGetter)
- );
- }
-
private static ResourceKey<MultiNoiseBiomeSourceParameterList> register(String name) {
return ResourceKey.create(Registries.MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST, ResourceLocation.withDefaultNamespace(name));
}
diff --git a/net/minecraft/world/level/biome/OverworldBiomeBuilder.java b/net/minecraft/world/level/biome/OverworldBiomeBuilder.java
index bf6105a..fb0a76c 100644
--- a/net/minecraft/world/level/biome/OverworldBiomeBuilder.java
+++ b/net/minecraft/world/level/biome/OverworldBiomeBuilder.java
@@ -9,7 +9,6 @@ import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.registries.VanillaRegistries;
import net.minecraft.data.worldgen.TerrainProvider;
-import net.minecraft.data.worldgen.WinterDropBiomes;
import net.minecraft.resources.ResourceKey;
import net.minecraft.util.CubicSpline;
import net.minecraft.util.ToFloatFunction;
@@ -33,7 +32,6 @@ public final class OverworldBiomeBuilder {
public static final float EROSION_INDEX_2_START = -0.375F;
private static final float EROSION_DEEP_DARK_DRYNESS_THRESHOLD = -0.225F;
private static final float DEPTH_DEEP_DARK_DRYNESS_THRESHOLD = 0.9F;
- private final OverworldBiomeBuilder.Modifier modifier;
private final Climate.Parameter FULL_RANGE = Climate.Parameter.span(-1.0F, 1.0F);
private final Climate.Parameter[] temperatures = new Climate.Parameter[]{
Climate.Parameter.span(-1.0F, -0.45F),
@@ -96,14 +94,7 @@ public final class OverworldBiomeBuilder {
private final ResourceKey<Biome>[][] PLATEAU_BIOMES_VARIANT = new ResourceKey[][]{
{Biomes.ICE_SPIKES, null, null, null, null},
{Biomes.CHERRY_GROVE, null, Biomes.MEADOW, Biomes.MEADOW, Biomes.OLD_GROWTH_PINE_TAIGA},
- {Biomes.CHERRY_GROVE, Biomes.CHERRY_GROVE, Biomes.FOREST, Biomes.BIRCH_FOREST, null},
- {null, null, null, null, null},
- {Biomes.ERODED_BADLANDS, Biomes.ERODED_BADLANDS, null, null, null}
- };
- private final ResourceKey<Biome>[][] PLATEAU_BIOMES_VARIANT_WINTER_DROP = new ResourceKey[][]{
- {Biomes.ICE_SPIKES, null, null, null, null},
- {Biomes.CHERRY_GROVE, null, Biomes.MEADOW, Biomes.MEADOW, Biomes.OLD_GROWTH_PINE_TAIGA},
- {Biomes.CHERRY_GROVE, Biomes.CHERRY_GROVE, Biomes.FOREST, Biomes.BIRCH_FOREST, WinterDropBiomes.PALE_GARDEN},
+ {Biomes.CHERRY_GROVE, Biomes.CHERRY_GROVE, Biomes.FOREST, Biomes.BIRCH_FOREST, Biomes.PALE_GARDEN},
{null, null, null, null, null},
{Biomes.ERODED_BADLANDS, Biomes.ERODED_BADLANDS, null, null, null}
};
@@ -115,14 +106,6 @@ public final class OverworldBiomeBuilder {
{null, null, null, null, null}
};
- public OverworldBiomeBuilder() {
- this(OverworldBiomeBuilder.Modifier.NONE);
- }
-
- public OverworldBiomeBuilder(OverworldBiomeBuilder.Modifier modifier) {
- this.modifier = modifier;
- }
-
public List<Climate.ParameterPoint> spawnTarget() {
Climate.Parameter parameter = Climate.Parameter.point(0.0F);
float f = 0.16F;
@@ -911,9 +894,7 @@ public final class OverworldBiomeBuilder {
private ResourceKey<Biome> pickPlateauBiome(int temperature, int humidity, Climate.Parameter param) {
if (param.max() >= 0L) {
- ResourceKey<Biome> resourceKey = (this.modifier == OverworldBiomeBuilder.Modifier.WINTER_DROP
- ? this.PLATEAU_BIOMES_VARIANT_WINTER_DROP
- : this.PLATEAU_BIOMES_VARIANT)[temperature][humidity];
+ ResourceKey<Biome> resourceKey = this.PLATEAU_BIOMES_VARIANT[temperature][humidity];
if (resourceKey != null) {
return resourceKey;
}
@@ -1083,9 +1064,4 @@ public final class OverworldBiomeBuilder {
public Climate.Parameter[] getWeirdnessThresholds() {
return new Climate.Parameter[]{Climate.Parameter.span(-2.0F, 0.0F), Climate.Parameter.span(0.0F, 2.0F)};
}
-
- public static enum Modifier {
- NONE,
- WINTER_DROP;
- }
}
diff --git a/net/minecraft/world/level/block/AbstractBannerBlock.java b/net/minecraft/world/level/block/AbstractBannerBlock.java
index ed1e897..4b4a5ec 100644
--- a/net/minecraft/world/level/block/AbstractBannerBlock.java
+++ b/net/minecraft/world/level/block/AbstractBannerBlock.java
@@ -32,7 +32,7 @@ public abstract class AbstractBannerBlock extends BaseEntityBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return level.getBlockEntity(pos) instanceof BannerBlockEntity bannerBlockEntity
? bannerBlockEntity.getItem()
: super.getCloneItemStack(level, pos, state);
diff --git a/net/minecraft/world/level/block/AttachedStemBlock.java b/net/minecraft/world/level/block/AttachedStemBlock.java
index 89d5f03..bf560e5 100644
--- a/net/minecraft/world/level/block/AttachedStemBlock.java
+++ b/net/minecraft/world/level/block/AttachedStemBlock.java
@@ -97,7 +97,7 @@ public class AttachedStemBlock extends BushBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(DataFixUtils.orElse(level.registryAccess().lookupOrThrow(Registries.ITEM).getOptional(this.seed), this));
}
diff --git a/net/minecraft/world/level/block/BambooSaplingBlock.java b/net/minecraft/world/level/block/BambooSaplingBlock.java
index 2ff5fa4..a48c72d 100644
--- a/net/minecraft/world/level/block/BambooSaplingBlock.java
+++ b/net/minecraft/world/level/block/BambooSaplingBlock.java
@@ -74,7 +74,7 @@ public class BambooSaplingBlock extends Block implements BonemealableBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(Items.BAMBOO);
}
diff --git a/net/minecraft/world/level/block/BigDripleafStemBlock.java b/net/minecraft/world/level/block/BigDripleafStemBlock.java
index 0c0fb2f..f51563c 100644
--- a/net/minecraft/world/level/block/BigDripleafStemBlock.java
+++ b/net/minecraft/world/level/block/BigDripleafStemBlock.java
@@ -143,7 +143,7 @@ public class BigDripleafStemBlock extends HorizontalDirectionalBlock implements
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(Blocks.BIG_DRIPLEAF);
}
}
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
index 1939139..3cd8cb6 100644
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -370,10 +370,6 @@ public class Block extends BlockBehaviour implements ItemLike {
entity.setDeltaMovement(entity.getDeltaMovement().multiply(1.0, 0.0, 1.0));
}
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
- return new ItemStack(this);
- }
-
public float getFriction() {
return this.friction;
}
diff --git a/net/minecraft/world/level/block/BlockTypes.java b/net/minecraft/world/level/block/BlockTypes.java
index 349c1cb..f3591f0 100644
--- a/net/minecraft/world/level/block/BlockTypes.java
+++ b/net/minecraft/world/level/block/BlockTypes.java
@@ -54,7 +54,6 @@ public class BlockTypes {
Registry.register(registry, "cave_vines_plant", CaveVinesPlantBlock.CODEC);
Registry.register(registry, "ceiling_hanging_sign", CeilingHangingSignBlock.CODEC);
Registry.register(registry, "chain", ChainBlock.CODEC);
- Registry.register(registry, "cherry_leaves", CherryLeavesBlock.CODEC);
Registry.register(registry, "chest", ChestBlock.CODEC);
Registry.register(registry, "chiseled_book_shelf", ChiseledBookShelfBlock.CODEC);
Registry.register(registry, "chorus_flower", ChorusFlowerBlock.CODEC);
@@ -92,6 +91,7 @@ public class BlockTypes {
Registry.register(registry, "end_portal", EndPortalBlock.CODEC);
Registry.register(registry, "end_portal_frame", EndPortalFrameBlock.CODEC);
Registry.register(registry, "end_rod", EndRodBlock.CODEC);
+ Registry.register(registry, "eyeblossom", EyeblossomBlock.CODEC);
Registry.register(registry, "farm", FarmBlock.CODEC);
Registry.register(registry, "bonemealable_feature_placer", BonemealableFeaturePlacerBlock.CODEC);
Registry.register(registry, "fence", FenceBlock.CODEC);
@@ -143,6 +143,7 @@ public class BlockTypes {
Registry.register(registry, "mossy_carpet", MossyCarpetBlock.CODEC);
Registry.register(registry, "moving_piston", MovingPistonBlock.CODEC);
Registry.register(registry, "mud", MudBlock.CODEC);
+ Registry.register(registry, "multiface", MultifaceBlock.CODEC);
Registry.register(registry, "mushroom", MushroomBlock.CODEC);
Registry.register(registry, "mycelium", MyceliumBlock.CODEC);
Registry.register(registry, "nether_portal", NetherPortalBlock.CODEC);
@@ -153,6 +154,7 @@ public class BlockTypes {
Registry.register(registry, "nylium", NyliumBlock.CODEC);
Registry.register(registry, "observer", ObserverBlock.CODEC);
Registry.register(registry, "piglinwallskull", PiglinWallSkullBlock.CODEC);
+ Registry.register(registry, "particle_leaves", ParticleLeavesBlock.CODEC);
Registry.register(registry, "pink_petals", PinkPetalsBlock.CODEC);
Registry.register(registry, "piston_base", PistonBaseBlock.CODEC);
Registry.register(registry, "piston_head", PistonHeadBlock.CODEC);
diff --git a/net/minecraft/world/level/block/Blocks.java b/net/minecraft/world/level/block/Blocks.java
index 10e1fe8..35e5718 100644
--- a/net/minecraft/world/level/block/Blocks.java
+++ b/net/minecraft/world/level/block/Blocks.java
@@ -21,7 +21,6 @@ import net.minecraft.util.valueproviders.ConstantInt;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.biome.Biome;
@@ -143,13 +142,7 @@ public class Blocks {
public static final Block PALE_OAK_WOOD = register(
"pale_oak_wood",
RotatedPillarBlock::new,
- BlockBehaviour.Properties.of()
- .mapColor(MapColor.STONE)
- .instrument(NoteBlockInstrument.BASS)
- .strength(2.0F)
- .sound(SoundType.WOOD)
- .ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
+ BlockBehaviour.Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.BASS).strength(2.0F).sound(SoundType.WOOD).ignitedByLava()
);
public static final Block PALE_OAK_PLANKS = register(
"pale_oak_planks",
@@ -159,7 +152,6 @@ public class Blocks {
.strength(2.0F, 3.0F)
.sound(SoundType.WOOD)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_PLANKS = register(
"mangrove_planks",
@@ -275,7 +267,6 @@ public class Blocks {
.instabreak()
.sound(SoundType.GRASS)
.pushReaction(PushReaction.DESTROY)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_PROPAGULE = register(
"mangrove_propagule",
@@ -413,9 +404,7 @@ public class Blocks {
"dark_oak_log", RotatedPillarBlock::new, logProperties(MapColor.COLOR_BROWN, MapColor.COLOR_BROWN, SoundType.WOOD)
);
public static final Block PALE_OAK_LOG = register(
- "pale_oak_log",
- RotatedPillarBlock::new,
- logProperties(PALE_OAK_PLANKS.defaultMapColor(), PALE_OAK_WOOD.defaultMapColor(), SoundType.WOOD).requiredFeatures(FeatureFlags.WINTER_DROP)
+ "pale_oak_log", RotatedPillarBlock::new, logProperties(PALE_OAK_PLANKS.defaultMapColor(), PALE_OAK_WOOD.defaultMapColor(), SoundType.WOOD)
);
public static final Block MANGROVE_LOG = register(
"mangrove_log", RotatedPillarBlock::new, logProperties(MapColor.COLOR_RED, MapColor.PODZOL, SoundType.WOOD)
@@ -461,9 +450,7 @@ public class Blocks {
"stripped_dark_oak_log", RotatedPillarBlock::new, logProperties(MapColor.COLOR_BROWN, MapColor.COLOR_BROWN, SoundType.WOOD)
);
public static final Block STRIPPED_PALE_OAK_LOG = register(
- "stripped_pale_oak_log",
- RotatedPillarBlock::new,
- logProperties(PALE_OAK_PLANKS.defaultMapColor(), PALE_OAK_PLANKS.defaultMapColor(), SoundType.WOOD).requiredFeatures(FeatureFlags.WINTER_DROP)
+ "stripped_pale_oak_log", RotatedPillarBlock::new, logProperties(PALE_OAK_PLANKS.defaultMapColor(), PALE_OAK_PLANKS.defaultMapColor(), SoundType.WOOD)
);
public static final Block STRIPPED_OAK_LOG = register(
"stripped_oak_log", RotatedPillarBlock::new, logProperties(MapColor.WOOD, MapColor.WOOD, SoundType.WOOD)
@@ -573,7 +560,6 @@ public class Blocks {
.strength(2.0F)
.sound(SoundType.WOOD)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block STRIPPED_MANGROVE_WOOD = register(
"stripped_mangrove_wood", RotatedPillarBlock::new, logProperties(MapColor.COLOR_RED, MapColor.COLOR_RED, SoundType.WOOD)
@@ -585,7 +571,7 @@ public class Blocks {
public static final Block ACACIA_LEAVES = register("acacia_leaves", LeavesBlock::new, leavesProperties(SoundType.GRASS));
public static final Block CHERRY_LEAVES = register(
"cherry_leaves",
- CherryLeavesBlock::new,
+ properties -> new ParticleLeavesBlock(10, ParticleTypes.CHERRY_LEAVES, properties),
BlockBehaviour.Properties.of()
.mapColor(MapColor.COLOR_PINK)
.strength(0.2F)
@@ -602,7 +588,7 @@ public class Blocks {
public static final Block DARK_OAK_LEAVES = register("dark_oak_leaves", LeavesBlock::new, leavesProperties(SoundType.GRASS));
public static final Block PALE_OAK_LEAVES = register(
"pale_oak_leaves",
- LeavesBlock::new,
+ properties -> new ParticleLeavesBlock(50, ParticleTypes.PALE_OAK_LEAVES, properties),
BlockBehaviour.Properties.of()
.mapColor(MapColor.TERRACOTTA_GREEN)
.strength(0.2F)
@@ -615,7 +601,6 @@ public class Blocks {
.ignitedByLava()
.pushReaction(PushReaction.DESTROY)
.isRedstoneConductor(Blocks::never)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_LEAVES = register("mangrove_leaves", MangroveLeavesBlock::new, leavesProperties(SoundType.GRASS));
public static final Block AZALEA_LEAVES = register("azalea_leaves", LeavesBlock::new, leavesProperties(SoundType.AZALEA_LEAVES));
@@ -1205,12 +1190,7 @@ public class Blocks {
public static final Block CREAKING_HEART = register(
"creaking_heart",
CreakingHeartBlock::new,
- BlockBehaviour.Properties.of()
- .mapColor(MapColor.COLOR_ORANGE)
- .instrument(NoteBlockInstrument.BASEDRUM)
- .strength(5.0F)
- .sound(SoundType.CREAKING_HEART)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
+ BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_ORANGE).instrument(NoteBlockInstrument.BASEDRUM).strength(5.0F).sound(SoundType.CREAKING_HEART)
);
public static final Block OAK_STAIRS = registerLegacyStair("oak_stairs", OAK_PLANKS);
public static final Block CHEST = register(
@@ -1358,7 +1338,6 @@ public class Blocks {
.noCollission()
.strength(1.0F)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_SIGN = register(
"mangrove_sign",
@@ -1475,7 +1454,6 @@ public class Blocks {
.noCollission()
.strength(1.0F)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_WALL_SIGN = register(
"mangrove_wall_sign",
@@ -1586,7 +1564,6 @@ public class Blocks {
.noCollission()
.strength(1.0F)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block CRIMSON_HANGING_SIGN = register(
"crimson_hanging_sign",
@@ -1707,7 +1684,6 @@ public class Blocks {
.noCollission()
.strength(1.0F)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_WALL_HANGING_SIGN = register(
"mangrove_wall_hanging_sign",
@@ -1756,7 +1732,6 @@ public class Blocks {
.mapColor(MapColor.STONE)
.forceSolidOn()
.instrument(NoteBlockInstrument.BASEDRUM)
- .requiresCorrectToolForDrops()
.noCollission()
.strength(0.5F)
.pushReaction(PushReaction.DESTROY)
@@ -1764,7 +1739,7 @@ public class Blocks {
public static final Block IRON_DOOR = register(
"iron_door",
properties -> new DoorBlock(BlockSetType.IRON, properties),
- BlockBehaviour.Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().strength(5.0F).noOcclusion().pushReaction(PushReaction.DESTROY)
+ BlockBehaviour.Properties.of().mapColor(MapColor.METAL).strength(5.0F).noOcclusion().pushReaction(PushReaction.DESTROY)
);
public static final Block OAK_PRESSURE_PLATE = register(
"oak_pressure_plate",
@@ -1861,7 +1836,6 @@ public class Blocks {
.strength(0.5F)
.ignitedByLava()
.pushReaction(PushReaction.DESTROY)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_PRESSURE_PLATE = register(
"mangrove_pressure_plate",
@@ -2187,7 +2161,6 @@ public class Blocks {
.noOcclusion()
.isValidSpawn(Blocks::never)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_TRAPDOOR = register(
"mangrove_trapdoor",
@@ -2363,6 +2336,16 @@ public class Blocks {
.ignitedByLava()
.pushReaction(PushReaction.DESTROY)
);
+ public static final Block RESIN_CLUMP = register(
+ "resin_clump",
+ MultifaceBlock::new,
+ BlockBehaviour.Properties.of()
+ .mapColor(MapColor.TERRACOTTA_ORANGE)
+ .noCollission()
+ .sound(SoundType.RESIN)
+ .ignitedByLava()
+ .pushReaction(PushReaction.DESTROY)
+ );
public static final Block OAK_FENCE_GATE = register(
"oak_fence_gate",
properties -> new FenceGateBlock(WoodType.OAK, properties),
@@ -2384,6 +2367,48 @@ public class Blocks {
WaterlilyBlock::new,
BlockBehaviour.Properties.of().mapColor(MapColor.PLANT).instabreak().sound(SoundType.LILY_PAD).noOcclusion().pushReaction(PushReaction.DESTROY)
);
+ public static final Block RESIN_BLOCK = register(
+ "resin_block", BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_ORANGE).instrument(NoteBlockInstrument.BASEDRUM).sound(SoundType.RESIN)
+ );
+ public static final Block RESIN_BRICKS = register(
+ "resin_bricks",
+ BlockBehaviour.Properties.of()
+ .mapColor(MapColor.TERRACOTTA_ORANGE)
+ .instrument(NoteBlockInstrument.BASEDRUM)
+ .requiresCorrectToolForDrops()
+ .sound(SoundType.RESIN_BRICKS)
+ .strength(1.5F, 6.0F)
+ );
+ public static final Block RESIN_BRICK_STAIRS = registerLegacyStair("resin_brick_stairs", RESIN_BRICKS);
+ public static final Block RESIN_BRICK_SLAB = register(
+ "resin_brick_slab",
+ properties -> new SlabBlock(properties),
+ BlockBehaviour.Properties.of()
+ .mapColor(MapColor.TERRACOTTA_ORANGE)
+ .instrument(NoteBlockInstrument.BASEDRUM)
+ .requiresCorrectToolForDrops()
+ .sound(SoundType.RESIN_BRICKS)
+ .strength(1.5F, 6.0F)
+ );
+ public static final Block RESIN_BRICK_WALL = register(
+ "resin_brick_wall",
+ properties -> new WallBlock(properties),
+ BlockBehaviour.Properties.of()
+ .mapColor(MapColor.TERRACOTTA_ORANGE)
+ .instrument(NoteBlockInstrument.BASEDRUM)
+ .requiresCorrectToolForDrops()
+ .sound(SoundType.RESIN_BRICKS)
+ .strength(1.5F, 6.0F)
+ );
+ public static final Block CHISELED_RESIN_BRICKS = register(
+ "chiseled_resin_bricks",
+ BlockBehaviour.Properties.of()
+ .mapColor(MapColor.TERRACOTTA_ORANGE)
+ .instrument(NoteBlockInstrument.BASEDRUM)
+ .requiresCorrectToolForDrops()
+ .sound(SoundType.RESIN_BRICKS)
+ .strength(1.5F, 6.0F)
+ );
public static final Block NETHER_BRICKS = register(
"nether_bricks",
BlockBehaviour.Properties.of()
@@ -2427,7 +2452,7 @@ public class Blocks {
public static final Block BREWING_STAND = register(
"brewing_stand",
BrewingStandBlock::new,
- BlockBehaviour.Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().strength(0.5F).lightLevel(blockState1 -> 1).noOcclusion()
+ BlockBehaviour.Properties.of().mapColor(MapColor.METAL).strength(0.5F).lightLevel(blockState1 -> 1).noOcclusion()
);
public static final Block CAULDRON = register(
"cauldron", CauldronBlock::new, BlockBehaviour.Properties.of().mapColor(MapColor.STONE).requiresCorrectToolForDrops().strength(2.0F).noOcclusion()
@@ -2516,12 +2541,7 @@ public class Blocks {
public static final Block ENDER_CHEST = register(
"ender_chest",
EnderChestBlock::new,
- BlockBehaviour.Properties.of()
- .mapColor(MapColor.STONE)
- .instrument(NoteBlockInstrument.BASEDRUM)
- .requiresCorrectToolForDrops()
- .strength(22.5F, 600.0F)
- .lightLevel(blockState1 -> 7)
+ BlockBehaviour.Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.BASEDRUM).strength(22.5F, 600.0F).lightLevel(blockState1 -> 7)
);
public static final Block TRIPWIRE_HOOK = register(
"tripwire_hook", TripWireHookBlock::new, BlockBehaviour.Properties.of().noCollission().sound(SoundType.WOOD).pushReaction(PushReaction.DESTROY)
@@ -2591,9 +2611,7 @@ public class Blocks {
"potted_dark_oak_sapling", properties -> new FlowerPotBlock(DARK_OAK_SAPLING, properties), flowerPotProperties()
);
public static final Block POTTED_PALE_OAK_SAPLING = register(
- "potted_pale_oak_sapling",
- properties -> new FlowerPotBlock(PALE_OAK_SAPLING, properties),
- flowerPotProperties().requiredFeatures(FeatureFlags.WINTER_DROP)
+ "potted_pale_oak_sapling", properties -> new FlowerPotBlock(PALE_OAK_SAPLING, properties), flowerPotProperties()
);
public static final Block POTTED_MANGROVE_PROPAGULE = register(
"potted_mangrove_propagule", properties -> new FlowerPotBlock(MANGROVE_PROPAGULE, properties), flowerPotProperties()
@@ -2666,7 +2684,7 @@ public class Blocks {
"dark_oak_button", properties -> new ButtonBlock(BlockSetType.DARK_OAK, 30, properties), buttonProperties()
);
public static final Block PALE_OAK_BUTTON = register(
- "pale_oak_button", properties -> new ButtonBlock(BlockSetType.PALE_OAK, 30, properties), buttonProperties().requiredFeatures(FeatureFlags.WINTER_DROP)
+ "pale_oak_button", properties -> new ButtonBlock(BlockSetType.PALE_OAK, 30, properties), buttonProperties()
);
public static final Block MANGROVE_BUTTON = register(
"mangrove_button", properties -> new ButtonBlock(BlockSetType.MANGROVE, 30, properties), buttonProperties()
@@ -2774,24 +2792,12 @@ public class Blocks {
public static final Block LIGHT_WEIGHTED_PRESSURE_PLATE = register(
"light_weighted_pressure_plate",
properties -> new WeightedPressurePlateBlock(15, BlockSetType.GOLD, properties),
- BlockBehaviour.Properties.of()
- .mapColor(MapColor.GOLD)
- .forceSolidOn()
- .requiresCorrectToolForDrops()
- .noCollission()
- .strength(0.5F)
- .pushReaction(PushReaction.DESTROY)
+ BlockBehaviour.Properties.of().mapColor(MapColor.GOLD).forceSolidOn().noCollission().strength(0.5F).pushReaction(PushReaction.DESTROY)
);
public static final Block HEAVY_WEIGHTED_PRESSURE_PLATE = register(
"heavy_weighted_pressure_plate",
properties -> new WeightedPressurePlateBlock(150, BlockSetType.IRON, properties),
- BlockBehaviour.Properties.of()
- .mapColor(MapColor.METAL)
- .forceSolidOn()
- .requiresCorrectToolForDrops()
- .noCollission()
- .strength(0.5F)
- .pushReaction(PushReaction.DESTROY)
+ BlockBehaviour.Properties.of().mapColor(MapColor.METAL).forceSolidOn().noCollission().strength(0.5F).pushReaction(PushReaction.DESTROY)
);
public static final Block COMPARATOR = register(
"comparator", ComparatorBlock::new, BlockBehaviour.Properties.of().instabreak().sound(SoundType.STONE).pushReaction(PushReaction.DESTROY)
@@ -3782,7 +3788,6 @@ public class Blocks {
.strength(2.0F, 3.0F)
.sound(SoundType.WOOD)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_SLAB = register(
"mangrove_slab",
@@ -3995,7 +4000,6 @@ public class Blocks {
.instrument(NoteBlockInstrument.BASS)
.strength(2.0F, 3.0F)
.ignitedByLava()
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_FENCE_GATE = register(
"mangrove_fence_gate",
@@ -4086,7 +4090,6 @@ public class Blocks {
.strength(2.0F, 3.0F)
.ignitedByLava()
.sound(SoundType.WOOD)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_FENCE = register(
"mangrove_fence",
@@ -4184,7 +4187,6 @@ public class Blocks {
.noOcclusion()
.ignitedByLava()
.pushReaction(PushReaction.DESTROY)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block MANGROVE_DOOR = register(
"mangrove_door",
@@ -5386,13 +5388,7 @@ public class Blocks {
public static final Block BELL = register(
"bell",
BellBlock::new,
- BlockBehaviour.Properties.of()
- .mapColor(MapColor.GOLD)
- .forceSolidOn()
- .requiresCorrectToolForDrops()
- .strength(5.0F)
- .sound(SoundType.ANVIL)
- .pushReaction(PushReaction.DESTROY)
+ BlockBehaviour.Properties.of().mapColor(MapColor.GOLD).forceSolidOn().strength(5.0F).sound(SoundType.ANVIL).pushReaction(PushReaction.DESTROY)
);
public static final Block LANTERN = register(
"lantern",
@@ -5400,7 +5396,6 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.METAL)
.forceSolidOn()
- .requiresCorrectToolForDrops()
.strength(3.5F)
.sound(SoundType.LANTERN)
.lightLevel(blockState1 -> 15)
@@ -5413,7 +5408,6 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.METAL)
.forceSolidOn()
- .requiresCorrectToolForDrops()
.strength(3.5F)
.sound(SoundType.LANTERN)
.lightLevel(blockState1 -> 10)
@@ -5885,7 +5879,6 @@ public class Blocks {
.mapColor(MapColor.COLOR_BLACK)
.forceSolidOn()
.instrument(NoteBlockInstrument.BASEDRUM)
- .requiresCorrectToolForDrops()
.noCollission()
.strength(0.5F)
.pushReaction(PushReaction.DESTROY)
@@ -6271,12 +6264,7 @@ public class Blocks {
public static final Block COPPER_DOOR = register(
"copper_door",
properties -> new WeatheringCopperDoorBlock(BlockSetType.COPPER, WeatheringCopper.WeatherState.UNAFFECTED, properties),
- BlockBehaviour.Properties.of()
- .mapColor(COPPER_BLOCK.defaultMapColor())
- .strength(3.0F, 6.0F)
- .noOcclusion()
- .requiresCorrectToolForDrops()
- .pushReaction(PushReaction.DESTROY)
+ BlockBehaviour.Properties.of().mapColor(COPPER_BLOCK.defaultMapColor()).strength(3.0F, 6.0F).noOcclusion().pushReaction(PushReaction.DESTROY)
);
public static final Block EXPOSED_COPPER_DOOR = register(
"exposed_copper_door",
@@ -6730,32 +6718,61 @@ public class Blocks {
"pale_moss_block",
properties -> new BonemealableFeaturePlacerBlock(VegetationFeatures.PALE_MOSS_PATCH_BONEMEAL, properties),
BlockBehaviour.Properties.of()
+ .ignitedByLava()
.mapColor(MapColor.COLOR_LIGHT_GRAY)
.strength(0.1F)
.sound(SoundType.MOSS)
.pushReaction(PushReaction.DESTROY)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block PALE_MOSS_CARPET = register(
"pale_moss_carpet",
MossyCarpetBlock::new,
BlockBehaviour.Properties.of()
+ .ignitedByLava()
.mapColor(PALE_MOSS_BLOCK.defaultMapColor())
.strength(0.1F)
.sound(SoundType.MOSS_CARPET)
.pushReaction(PushReaction.DESTROY)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
);
public static final Block PALE_HANGING_MOSS = register(
"pale_hanging_moss",
HangingMossBlock::new,
BlockBehaviour.Properties.of()
+ .ignitedByLava()
.mapColor(PALE_MOSS_BLOCK.defaultMapColor())
- .strength(0.1F)
.noCollission()
.sound(SoundType.MOSS_CARPET)
.pushReaction(PushReaction.DESTROY)
- .requiredFeatures(FeatureFlags.WINTER_DROP)
+ );
+ public static final Block OPEN_EYEBLOSSOM = register(
+ "open_eyeblossom",
+ properties -> new EyeblossomBlock(EyeblossomBlock.Type.OPEN, properties),
+ BlockBehaviour.Properties.of()
+ .mapColor(PALE_OAK_LEAVES.defaultMapColor())
+ .noCollission()
+ .instabreak()
+ .sound(SoundType.GRASS)
+ .offsetType(BlockBehaviour.OffsetType.XZ)
+ .pushReaction(PushReaction.DESTROY)
+ .randomTicks()
+ );
+ public static final Block CLOSED_EYEBLOSSOM = register(
+ "closed_eyeblossom",
+ properties -> new EyeblossomBlock(EyeblossomBlock.Type.CLOSED, properties),
+ BlockBehaviour.Properties.of()
+ .mapColor(CREAKING_HEART.defaultMapColor())
+ .noCollission()
+ .instabreak()
+ .sound(SoundType.GRASS)
+ .offsetType(BlockBehaviour.OffsetType.XZ)
+ .pushReaction(PushReaction.DESTROY)
+ .randomTicks()
+ );
+ public static final Block POTTED_OPEN_EYEBLOSSOM = register(
+ "potted_open_eyeblossom", properties -> new FlowerPotBlock(OPEN_EYEBLOSSOM, properties), flowerPotProperties().randomTicks()
+ );
+ public static final Block POTTED_CLOSED_EYEBLOSSOM = register(
+ "potted_closed_eyeblossom", properties -> new FlowerPotBlock(CLOSED_EYEBLOSSOM, properties), flowerPotProperties().randomTicks()
);
private static ToIntFunction<BlockState> litBlockEmission(int lightValue) {
diff --git a/net/minecraft/world/level/block/CandleCakeBlock.java b/net/minecraft/world/level/block/CandleCakeBlock.java
index 1acf724..ded588a 100644
--- a/net/minecraft/world/level/block/CandleCakeBlock.java
+++ b/net/minecraft/world/level/block/CandleCakeBlock.java
@@ -112,7 +112,7 @@ public class CandleCakeBlock extends AbstractCandleBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(Blocks.CAKE);
}
diff --git a/net/minecraft/world/level/block/CaveVinesBlock.java b/net/minecraft/world/level/block/CaveVinesBlock.java
index ba9c927..39e28e0 100644
--- a/net/minecraft/world/level/block/CaveVinesBlock.java
+++ b/net/minecraft/world/level/block/CaveVinesBlock.java
@@ -56,7 +56,7 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements CaveVines {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos, BlockState blockState) {
return new ItemStack(Items.GLOW_BERRIES);
}
diff --git a/net/minecraft/world/level/block/CaveVinesPlantBlock.java b/net/minecraft/world/level/block/CaveVinesPlantBlock.java
index 822308b..289daad 100644
--- a/net/minecraft/world/level/block/CaveVinesPlantBlock.java
+++ b/net/minecraft/world/level/block/CaveVinesPlantBlock.java
@@ -40,7 +40,7 @@ public class CaveVinesPlantBlock extends GrowingPlantBodyBlock implements CaveVi
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(Items.GLOW_BERRIES);
}
diff --git a/net/minecraft/world/level/block/ComposterBlock.java b/net/minecraft/world/level/block/ComposterBlock.java
index dcb2f6e..3a6a099 100644
--- a/net/minecraft/world/level/block/ComposterBlock.java
+++ b/net/minecraft/world/level/block/ComposterBlock.java
@@ -152,6 +152,8 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
add(0.65F, Items.CORNFLOWER);
add(0.65F, Items.LILY_OF_THE_VALLEY);
add(0.65F, Items.WITHER_ROSE);
+ add(0.65F, Items.OPEN_EYEBLOSSOM);
+ add(0.65F, Items.CLOSED_EYEBLOSSOM);
add(0.65F, Items.FERN);
add(0.65F, Items.SUNFLOWER);
add(0.65F, Items.LILAC);
diff --git a/net/minecraft/world/level/block/CreakingHeartBlock.java b/net/minecraft/world/level/block/CreakingHeartBlock.java
index e867410..ee2b301 100644
--- a/net/minecraft/world/level/block/CreakingHeartBlock.java
+++ b/net/minecraft/world/level/block/CreakingHeartBlock.java
@@ -1,20 +1,24 @@
package net.minecraft.world.level.block;
import com.mojang.serialization.MapCodec;
+import java.util.function.BiConsumer;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
+import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
-import net.minecraft.util.StringRepresentable;
import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
+import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.ScheduledTickAccess;
+import net.minecraft.world.level.ServerExplosion;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
@@ -23,12 +27,14 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
+import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty;
public class CreakingHeartBlock extends BaseEntityBlock {
public static final MapCodec<CreakingHeartBlock> CODEC = simpleCodec(CreakingHeartBlock::new);
public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;
- public static final EnumProperty<CreakingHeartBlock.CreakingHeartState> CREAKING = BlockStateProperties.CREAKING;
+ public static final BooleanProperty ACTIVE = BlockStateProperties.ACTIVE;
+ public static final BooleanProperty NATURAL = BlockStateProperties.NATURAL;
@Override
public MapCodec<CreakingHeartBlock> codec() {
@@ -37,7 +43,9 @@ public class CreakingHeartBlock extends BaseEntityBlock {
protected CreakingHeartBlock(BlockBehaviour.Properties properties) {
super(properties);
- this.registerDefaultState(this.defaultBlockState().setValue(AXIS, Direction.Axis.Y).setValue(CREAKING, CreakingHeartBlock.CreakingHeartState.DISABLED));
+ this.registerDefaultState(
+ this.defaultBlockState().setValue(AXIS, Direction.Axis.Y).setValue(ACTIVE, Boolean.valueOf(false)).setValue(NATURAL, Boolean.valueOf(false))
+ );
}
@Override
@@ -51,20 +59,18 @@ public class CreakingHeartBlock extends BaseEntityBlock {
if (level.isClientSide) {
return null;
} else {
- return state.getValue(CREAKING) != CreakingHeartBlock.CreakingHeartState.DISABLED
- ? createTickerHelper(blockEntityType, BlockEntityType.CREAKING_HEART, CreakingHeartBlockEntity::serverTick)
- : null;
+ return state.getValue(ACTIVE) ? createTickerHelper(blockEntityType, BlockEntityType.CREAKING_HEART, CreakingHeartBlockEntity::serverTick) : null;
}
}
- public static boolean canSummonCreaking(Level level) {
+ public static boolean isNaturalNight(Level level) {
return level.dimensionType().natural() && level.isNight();
}
@Override
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
- if (canSummonCreaking(level)) {
- if (state.getValue(CREAKING) != CreakingHeartBlock.CreakingHeartState.DISABLED) {
+ if (isNaturalNight(level)) {
+ if (state.getValue(ACTIVE)) {
if (random.nextInt(16) == 0 && isSurroundedByLogs(level, pos)) {
level.playLocalSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.CREAKING_HEART_IDLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
}
@@ -89,10 +95,8 @@ public class CreakingHeartBlock extends BaseEntityBlock {
private static BlockState updateState(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
boolean hasRequiredLogs = hasRequiredLogs(blockState, levelReader, blockPos);
- CreakingHeartBlock.CreakingHeartState creakingHeartState = blockState.getValue(CREAKING);
- return hasRequiredLogs && creakingHeartState == CreakingHeartBlock.CreakingHeartState.DISABLED
- ? blockState.setValue(CREAKING, CreakingHeartBlock.CreakingHeartState.DORMANT)
- : blockState;
+ boolean flag = !blockState.getValue(ACTIVE);
+ return hasRequiredLogs && flag ? blockState.setValue(ACTIVE, Boolean.valueOf(true)) : blockState;
}
public static boolean hasRequiredLogs(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
@@ -138,7 +142,7 @@ public class CreakingHeartBlock extends BaseEntityBlock {
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
- builder.add(AXIS, CREAKING);
+ builder.add(AXIS, ACTIVE, NATURAL);
}
@Override
@@ -150,15 +154,37 @@ public class CreakingHeartBlock extends BaseEntityBlock {
super.onRemove(state, level, pos, newState, movedByPiston);
}
+ @Override
+ protected void onExplosionHit(
+ BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, Explosion explosion, BiConsumer<ItemStack, BlockPos> biConsumer
+ ) {
+ if (serverLevel.getBlockEntity(blockPos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
+ && explosion instanceof ServerExplosion serverExplosion) {
+ creakingHeartBlockEntity.removeProtector(serverExplosion.getDamageSource());
+ if (explosion.getIndirectSourceEntity() instanceof Player && explosion.getBlockInteraction().shouldAffectBlocklikeEntities()) {
+ this.tryAwardExperience(blockState, serverLevel, blockPos);
+ }
+ }
+
+ super.onExplosionHit(blockState, serverLevel, blockPos, explosion, biConsumer);
+ }
+
@Override
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
if (level.getBlockEntity(pos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity) {
creakingHeartBlockEntity.removeProtector(player.damageSources().playerAttack(player));
+ this.tryAwardExperience(state, level, pos);
}
return super.playerWillDestroy(level, pos, state, player);
}
+ private void tryAwardExperience(BlockState blockState, Level level, BlockPos blockPos) {
+ if (blockState.getValue(NATURAL) && level instanceof ServerLevel serverLevel) {
+ this.popExperience(serverLevel, blockPos, level.random.nextIntBetweenInclusive(20, 24));
+ }
+ }
+
@Override
protected boolean hasAnalogOutputSignal(BlockState state) {
return true;
@@ -166,7 +192,7 @@ public class CreakingHeartBlock extends BaseEntityBlock {
@Override
protected int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos) {
- if (state.getValue(CREAKING) != CreakingHeartBlock.CreakingHeartState.ACTIVE) {
+ if (!state.getValue(ACTIVE)) {
return 0;
} else {
return level.getBlockEntity(pos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
@@ -174,21 +200,4 @@ public class CreakingHeartBlock extends BaseEntityBlock {
: 0;
}
}
-
- public static enum CreakingHeartState implements StringRepresentable {
- DISABLED("disabled"),
- DORMANT("dormant"),
- ACTIVE("active");
-
- private final String name;
-
- private CreakingHeartState(final String string) {
- this.name = string;
- }
-
- @Override
- public String getSerializedName() {
- return this.name;
- }
- }
}
diff --git a/net/minecraft/world/level/block/CropBlock.java b/net/minecraft/world/level/block/CropBlock.java
index c01e6ea..155600a 100644
--- a/net/minecraft/world/level/block/CropBlock.java
+++ b/net/minecraft/world/level/block/CropBlock.java
@@ -176,7 +176,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(this.getBaseSeedId());
}
diff --git a/net/minecraft/world/level/block/DecoratedPotBlock.java b/net/minecraft/world/level/block/DecoratedPotBlock.java
index 14a1e35..8374dc6 100644
--- a/net/minecraft/world/level/block/DecoratedPotBlock.java
+++ b/net/minecraft/world/level/block/DecoratedPotBlock.java
@@ -251,10 +251,10 @@ public class DecoratedPotBlock extends BaseEntityBlock implements SimpleWaterlog
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
- return level.getBlockEntity(pos) instanceof DecoratedPotBlockEntity decoratedPotBlockEntity
+ protected ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos, BlockState blockState) {
+ return levelReader.getBlockEntity(blockPos) instanceof DecoratedPotBlockEntity decoratedPotBlockEntity
? decoratedPotBlockEntity.getPotAsItem()
- : super.getCloneItemStack(level, pos, state);
+ : super.getCloneItemStack(levelReader, blockPos, blockState);
}
@Override
diff --git a/net/minecraft/world/level/block/EndGatewayBlock.java b/net/minecraft/world/level/block/EndGatewayBlock.java
index 6e1d5b2..f375f3a 100644
--- a/net/minecraft/world/level/block/EndGatewayBlock.java
+++ b/net/minecraft/world/level/block/EndGatewayBlock.java
@@ -78,7 +78,7 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return ItemStack.EMPTY;
}
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
index 79b96b8..a9d9b89 100644
--- a/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
@@ -109,7 +109,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return ItemStack.EMPTY;
}
diff --git a/net/minecraft/world/level/block/EyeblossomBlock.java b/net/minecraft/world/level/block/EyeblossomBlock.java
new file mode 100644
index 0000000..07e9178
--- /dev/null
+++ b/net/minecraft/world/level/block/EyeblossomBlock.java
@@ -0,0 +1,155 @@
+package net.minecraft.world.level.block;
+
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.MapCodec;
+import com.mojang.serialization.codecs.RecordCodecBuilder;
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.Holder;
+import net.minecraft.core.particles.TrailParticleOption;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.sounds.SoundEvent;
+import net.minecraft.sounds.SoundEvents;
+import net.minecraft.sounds.SoundSource;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.Difficulty;
+import net.minecraft.world.effect.MobEffect;
+import net.minecraft.world.effect.MobEffectInstance;
+import net.minecraft.world.effect.MobEffects;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.animal.Bee;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.state.BlockBehaviour;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.phys.Vec3;
+
+public class EyeblossomBlock extends FlowerBlock {
+ public static final MapCodec<EyeblossomBlock> CODEC = RecordCodecBuilder.mapCodec(
+ instance -> instance.group(Codec.BOOL.fieldOf("open").forGetter(eyeblossomBlock -> eyeblossomBlock.type.open), propertiesCodec())
+ .apply(instance, EyeblossomBlock::new)
+ );
+ private static final int EYEBLOSSOM_XZ_RANGE = 3;
+ private static final int EYEBLOSSOM_Y_RANGE = 2;
+ private final EyeblossomBlock.Type type;
+
+ @Override
+ public MapCodec<? extends EyeblossomBlock> codec() {
+ return CODEC;
+ }
+
+ public EyeblossomBlock(EyeblossomBlock.Type type, BlockBehaviour.Properties properties) {
+ super(type.effect, type.effectDuration, properties);
+ this.type = type;
+ }
+
+ public EyeblossomBlock(boolean flag, BlockBehaviour.Properties properties) {
+ super(EyeblossomBlock.Type.fromBoolean(flag).effect, EyeblossomBlock.Type.fromBoolean(flag).effectDuration, properties);
+ this.type = EyeblossomBlock.Type.fromBoolean(flag);
+ }
+
+ @Override
+ public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
+ if (this.type.emitSounds() && random.nextInt(700) == 0) {
+ BlockState blockState = level.getBlockState(pos.below());
+ if (blockState.is(Blocks.PALE_MOSS_BLOCK)) {
+ level.playLocalSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.EYEBLOSSOM_IDLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
+ }
+ }
+ }
+
+ @Override
+ protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
+ if (this.tryChangingState(state, level, pos, random)) {
+ level.playSound(null, pos, this.type.longSwitchSound, SoundSource.BLOCKS, 1.0F, 1.0F);
+ }
+
+ super.randomTick(state, level, pos, random);
+ }
+
+ @Override
+ protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
+ if (this.tryChangingState(state, level, pos, random)) {
+ level.playSound(null, pos, this.type.shortSwitchSound, SoundSource.BLOCKS, 1.0F, 1.0F);
+ }
+
+ super.tick(state, level, pos, random);
+ }
+
+ private boolean tryChangingState(BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, RandomSource randomSource) {
+ if (!serverLevel.dimensionType().natural()) {
+ return false;
+ } else if (serverLevel.isDay() != this.type.open) {
+ return false;
+ } else {
+ BlockState blockState1 = this.type.oppositeState();
+ serverLevel.setBlock(blockPos, blockState1, 3);
+ this.type.spawnTransformParticle(serverLevel, blockPos, randomSource);
+ BlockPos.betweenClosed(blockPos.offset(-3, -2, -3), blockPos.offset(3, 2, 3)).forEach(blockPos1 -> {
+ BlockState blockState2 = serverLevel.getBlockState(blockPos1);
+ if (blockState2 == blockState) {
+ double squareRoot = Math.sqrt(blockPos.distSqr(blockPos1));
+ int randomInt = randomSource.nextIntBetweenInclusive((int)(squareRoot * 5.0), (int)(squareRoot * 10.0));
+ serverLevel.scheduleTick(blockPos1, blockState.getBlock(), randomInt);
+ }
+ });
+ return true;
+ }
+ }
+
+ @Override
+ protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
+ if (!level.isClientSide() && level.getDifficulty() != Difficulty.PEACEFUL && entity instanceof Bee bee && !bee.hasEffect(MobEffects.POISON)) {
+ bee.addEffect(this.getBeeInteractionEffect());
+ }
+ }
+
+ @Override
+ public MobEffectInstance getBeeInteractionEffect() {
+ return new MobEffectInstance(MobEffects.POISON, 25);
+ }
+
+ public static enum Type {
+ OPEN(true, MobEffects.BLINDNESS, 7.0F, SoundEvents.EYEBLOSSOM_OPEN_LONG, SoundEvents.EYEBLOSSOM_OPEN, 6250335),
+ CLOSED(false, MobEffects.CONFUSION, 7.0F, SoundEvents.EYEBLOSSOM_CLOSE_LONG, SoundEvents.EYEBLOSSOM_CLOSE, 16545810);
+
+ final boolean open;
+ final Holder<MobEffect> effect;
+ final float effectDuration;
+ final SoundEvent longSwitchSound;
+ final SoundEvent shortSwitchSound;
+ private final int particleColor;
+
+ private Type(final boolean flag, final Holder<MobEffect> holder, final float f, final SoundEvent soundEvent, final SoundEvent soundEvent1, final int i) {
+ this.open = flag;
+ this.effect = holder;
+ this.effectDuration = f;
+ this.longSwitchSound = soundEvent;
+ this.shortSwitchSound = soundEvent1;
+ this.particleColor = i;
+ }
+
+ public BlockState oppositeState() {
+ return this == OPEN ? Blocks.CLOSED_EYEBLOSSOM.defaultBlockState() : Blocks.OPEN_EYEBLOSSOM.defaultBlockState();
+ }
+
+ public boolean emitSounds() {
+ return this.open;
+ }
+
+ public static EyeblossomBlock.Type fromBoolean(boolean flag) {
+ return flag ? OPEN : CLOSED;
+ }
+
+ public void spawnTransformParticle(ServerLevel serverLevel, BlockPos blockPos, RandomSource randomSource) {
+ Vec3 center = blockPos.getCenter();
+ double d = 0.5 + randomSource.nextDouble();
+ Vec3 vec3 = new Vec3(randomSource.nextDouble() - 0.5, randomSource.nextDouble() + 1.0, randomSource.nextDouble() - 0.5);
+ Vec3 vec31 = center.add(vec3.scale(d));
+ TrailParticleOption trailParticleOption = new TrailParticleOption(vec31, this.particleColor, (int)(20.0 * d));
+ serverLevel.sendParticles(trailParticleOption, center.x, center.y, center.z, 1, 0.0, 0.0, 0.0, 0.0);
+ }
+
+ public SoundEvent longSwitchSound() {
+ return this.longSwitchSound;
+ }
+ }
+}
diff --git a/net/minecraft/world/level/block/FireBlock.java b/net/minecraft/world/level/block/FireBlock.java
index 5df65de..2585309 100644
--- a/net/minecraft/world/level/block/FireBlock.java
+++ b/net/minecraft/world/level/block/FireBlock.java
@@ -447,6 +447,8 @@ public class FireBlock extends BaseFireBlock {
fireBlock.setFlammable(Blocks.LARGE_FERN, 60, 100);
fireBlock.setFlammable(Blocks.DANDELION, 60, 100);
fireBlock.setFlammable(Blocks.POPPY, 60, 100);
+ fireBlock.setFlammable(Blocks.OPEN_EYEBLOSSOM, 60, 100);
+ fireBlock.setFlammable(Blocks.CLOSED_EYEBLOSSOM, 60, 100);
fireBlock.setFlammable(Blocks.BLUE_ORCHID, 60, 100);
fireBlock.setFlammable(Blocks.ALLIUM, 60, 100);
fireBlock.setFlammable(Blocks.AZURE_BLUET, 60, 100);
@@ -497,9 +499,9 @@ public class FireBlock extends BaseFireBlock {
fireBlock.setFlammable(Blocks.GREEN_CARPET, 60, 20);
fireBlock.setFlammable(Blocks.RED_CARPET, 60, 20);
fireBlock.setFlammable(Blocks.BLACK_CARPET, 60, 20);
- fireBlock.setFlammable(Blocks.PALE_MOSS_BLOCK, 60, 20);
- fireBlock.setFlammable(Blocks.PALE_MOSS_CARPET, 60, 20);
- fireBlock.setFlammable(Blocks.PALE_HANGING_MOSS, 60, 100);
+ fireBlock.setFlammable(Blocks.PALE_MOSS_BLOCK, 5, 100);
+ fireBlock.setFlammable(Blocks.PALE_MOSS_CARPET, 5, 100);
+ fireBlock.setFlammable(Blocks.PALE_HANGING_MOSS, 5, 100);
fireBlock.setFlammable(Blocks.DRIED_KELP_BLOCK, 30, 60);
fireBlock.setFlammable(Blocks.BAMBOO, 60, 60);
fireBlock.setFlammable(Blocks.SCAFFOLDING, 60, 60);
diff --git a/net/minecraft/world/level/block/FlowerBlock.java b/net/minecraft/world/level/block/FlowerBlock.java
index 5ff505f..078299f 100644
--- a/net/minecraft/world/level/block/FlowerBlock.java
+++ b/net/minecraft/world/level/block/FlowerBlock.java
@@ -3,10 +3,12 @@ package net.minecraft.world.level.block;
import com.mojang.serialization.MapCodec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import java.util.List;
+import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.util.Mth;
import net.minecraft.world.effect.MobEffect;
+import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.item.component.SuspiciousStewEffects;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.state.BlockBehaviour;
@@ -52,4 +54,9 @@ public class FlowerBlock extends BushBlock implements SuspiciousEffectHolder {
public SuspiciousStewEffects getSuspiciousEffects() {
return this.suspiciousStewEffects;
}
+
+ @Nullable
+ public MobEffectInstance getBeeInteractionEffect() {
+ return null;
+ }
}
diff --git a/net/minecraft/world/level/block/FlowerPotBlock.java b/net/minecraft/world/level/block/FlowerPotBlock.java
index 897dbf7..20871b2 100644
--- a/net/minecraft/world/level/block/FlowerPotBlock.java
+++ b/net/minecraft/world/level/block/FlowerPotBlock.java
@@ -7,6 +7,8 @@ import java.util.Map;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.BuiltInRegistries;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.sounds.SoundSource;
import net.minecraft.stats.Stats;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
@@ -98,7 +100,7 @@ public class FlowerPotBlock extends Block {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return this.isEmpty() ? super.getCloneItemStack(level, pos, state) : new ItemStack(this.potted);
}
@@ -130,4 +132,33 @@ public class FlowerPotBlock extends Block {
protected boolean isPathfindable(BlockState state, PathComputationType pathComputationType) {
return false;
}
+
+ @Override
+ protected boolean isRandomlyTicking(BlockState state) {
+ return state.is(Blocks.POTTED_OPEN_EYEBLOSSOM) || state.is(Blocks.POTTED_CLOSED_EYEBLOSSOM);
+ }
+
+ @Override
+ protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
+ if (this.isRandomlyTicking(state) && level.dimensionType().natural()) {
+ boolean flag = this.potted == Blocks.OPEN_EYEBLOSSOM;
+ boolean isNaturalNight = CreakingHeartBlock.isNaturalNight(level);
+ if (flag != isNaturalNight) {
+ level.setBlock(pos, this.opposite(state), 3);
+ EyeblossomBlock.Type type = EyeblossomBlock.Type.fromBoolean(flag);
+ type.spawnTransformParticle(level, pos, random);
+ level.playSound(null, pos, type.longSwitchSound(), SoundSource.BLOCKS, 1.0F, 1.0F);
+ }
+ }
+
+ super.randomTick(state, level, pos, random);
+ }
+
+ public BlockState opposite(BlockState blockState) {
+ if (blockState.is(Blocks.POTTED_OPEN_EYEBLOSSOM)) {
+ return Blocks.POTTED_CLOSED_EYEBLOSSOM.defaultBlockState();
+ } else {
+ return blockState.is(Blocks.POTTED_CLOSED_EYEBLOSSOM) ? Blocks.POTTED_OPEN_EYEBLOSSOM.defaultBlockState() : blockState;
+ }
+ }
}
diff --git a/net/minecraft/world/level/block/FrostedIceBlock.java b/net/minecraft/world/level/block/FrostedIceBlock.java
index 733eab0..22a0134 100644
--- a/net/minecraft/world/level/block/FrostedIceBlock.java
+++ b/net/minecraft/world/level/block/FrostedIceBlock.java
@@ -101,7 +101,7 @@ public class FrostedIceBlock extends IceBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return ItemStack.EMPTY;
}
}
diff --git a/net/minecraft/world/level/block/GlowLichenBlock.java b/net/minecraft/world/level/block/GlowLichenBlock.java
index 5dbce9f..7f5fb6f 100644
--- a/net/minecraft/world/level/block/GlowLichenBlock.java
+++ b/net/minecraft/world/level/block/GlowLichenBlock.java
@@ -19,7 +19,7 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
-public class GlowLichenBlock extends MultifaceBlock implements BonemealableBlock, SimpleWaterloggedBlock {
+public class GlowLichenBlock extends MultifaceSpreadeableBlock implements BonemealableBlock, SimpleWaterloggedBlock {
public static final MapCodec<GlowLichenBlock> CODEC = simpleCodec(GlowLichenBlock::new);
private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
private final MultifaceSpreader spreader = new MultifaceSpreader(this);
diff --git a/net/minecraft/world/level/block/GrowingPlantBodyBlock.java b/net/minecraft/world/level/block/GrowingPlantBodyBlock.java
index 072d008..47c04f5 100644
--- a/net/minecraft/world/level/block/GrowingPlantBodyBlock.java
+++ b/net/minecraft/world/level/block/GrowingPlantBodyBlock.java
@@ -58,7 +58,7 @@ public abstract class GrowingPlantBodyBlock extends GrowingPlantBlock implements
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(this.getHeadBlock());
}
diff --git a/net/minecraft/world/level/block/HangingMossBlock.java b/net/minecraft/world/level/block/HangingMossBlock.java
index 186fe09..dec2ac2 100644
--- a/net/minecraft/world/level/block/HangingMossBlock.java
+++ b/net/minecraft/world/level/block/HangingMossBlock.java
@@ -6,6 +6,7 @@ import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
+import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
@@ -45,7 +46,7 @@ public class HangingMossBlock extends Block implements BonemealableBlock {
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
if (random.nextInt(500) == 0) {
BlockState blockState = level.getBlockState(pos.above());
- if (blockState.is(Blocks.PALE_OAK_LOG) || blockState.is(Blocks.PALE_OAK_LEAVES)) {
+ if (blockState.is(BlockTags.PALE_OAK_LOGS) || blockState.is(Blocks.PALE_OAK_LEAVES)) {
level.playLocalSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.PALE_HANGING_MOSS_IDLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
}
}
diff --git a/net/minecraft/world/level/block/LightBlock.java b/net/minecraft/world/level/block/LightBlock.java
index e4a9a08..263f0d3 100644
--- a/net/minecraft/world/level/block/LightBlock.java
+++ b/net/minecraft/world/level/block/LightBlock.java
@@ -104,7 +104,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return setLightOnStack(super.getCloneItemStack(level, pos, state), state.getValue(LEVEL));
}
diff --git a/net/minecraft/world/level/block/MossyCarpetBlock.java b/net/minecraft/world/level/block/MossyCarpetBlock.java
index e0d6563..e284bb7 100644
--- a/net/minecraft/world/level/block/MossyCarpetBlock.java
+++ b/net/minecraft/world/level/block/MossyCarpetBlock.java
@@ -153,12 +153,7 @@ public class MossyCarpetBlock extends Block implements BonemealableBlock {
}
private static boolean canSupportAtFace(BlockGetter blockGetter, BlockPos blockPos, Direction direction) {
- if (direction == Direction.UP) {
- return false;
- } else {
- BlockPos blockPos1 = blockPos.relative(direction);
- return MultifaceBlock.canAttachTo(blockGetter, direction, blockPos1, blockGetter.getBlockState(blockPos1));
- }
+ return direction != Direction.UP && MultifaceBlock.canAttachTo(blockGetter, blockPos, direction);
}
private static BlockState getUpdatedState(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, boolean flag) {
@@ -304,12 +299,12 @@ public class MossyCarpetBlock extends Block implements BonemealableBlock {
@Override
public boolean isValidBonemealTarget(LevelReader level, BlockPos pos, BlockState state) {
- return state.getValue(BASE);
+ return state.getValue(BASE) && !createTopperWithSideChance(level, pos, () -> true).isAir();
}
@Override
public boolean isBonemealSuccess(Level level, RandomSource random, BlockPos pos, BlockState state) {
- return !createTopperWithSideChance(level, pos, () -> true).isAir();
+ return true;
}
@Override
diff --git a/net/minecraft/world/level/block/MultifaceBlock.java b/net/minecraft/world/level/block/MultifaceBlock.java
index e56b69b..956a2c5 100644
--- a/net/minecraft/world/level/block/MultifaceBlock.java
+++ b/net/minecraft/world/level/block/MultifaceBlock.java
@@ -30,7 +30,8 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
-public abstract class MultifaceBlock extends Block {
+public class MultifaceBlock extends Block {
+ public static final MapCodec<MultifaceBlock> CODEC = simpleCodec(MultifaceBlock::new);
private static final float AABB_OFFSET = 1.0F;
private static final VoxelShape UP_AABB = Block.box(0.0, 15.0, 0.0, 16.0, 16.0, 16.0);
private static final VoxelShape DOWN_AABB = Block.box(0.0, 0.0, 0.0, 16.0, 1.0, 16.0);
@@ -53,6 +54,11 @@ public abstract class MultifaceBlock extends Block {
private final boolean canMirrorX;
private final boolean canMirrorZ;
+ @Override
+ protected MapCodec<? extends MultifaceBlock> codec() {
+ return CODEC;
+ }
+
public MultifaceBlock(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(getDefaultMultifaceState(this.stateDefinition));
@@ -62,9 +68,6 @@ public abstract class MultifaceBlock extends Block {
this.canMirrorZ = Direction.Plane.HORIZONTAL.stream().filter(Direction.Axis.Z).filter(this::isFaceSupported).count() % 2L == 0L;
}
- @Override
- protected abstract MapCodec<? extends MultifaceBlock> codec();
-
public static Set<Direction> availableFaces(BlockState state) {
if (!(state.getBlock() instanceof MultifaceBlock)) {
return Set.of();
@@ -147,8 +150,7 @@ public abstract class MultifaceBlock extends Block {
for (Direction direction : DIRECTIONS) {
if (hasFace(state, direction)) {
- BlockPos blockPos = pos.relative(direction);
- if (!canAttachTo(level, direction, blockPos, level.getBlockState(blockPos))) {
+ if (!canAttachTo(level, pos, direction)) {
return false;
}
@@ -235,6 +237,12 @@ public abstract class MultifaceBlock extends Block {
return state.getValueOrElse(faceProperty, Boolean.valueOf(false));
}
+ public static boolean canAttachTo(BlockGetter blockGetter, BlockPos blockPos, Direction direction) {
+ BlockPos blockPos1 = blockPos.relative(direction);
+ BlockState blockState = blockGetter.getBlockState(blockPos1);
+ return canAttachTo(blockGetter, direction, blockPos1, blockState);
+ }
+
public static boolean canAttachTo(BlockGetter level, Direction direction, BlockPos pos, BlockState state) {
return Block.isFaceFull(state.getBlockSupportShape(level, pos), direction.getOpposite())
|| Block.isFaceFull(state.getCollisionShape(level, pos), direction.getOpposite());
@@ -294,6 +302,4 @@ public abstract class MultifaceBlock extends Block {
return false;
}
-
- public abstract MultifaceSpreader getSpreader();
}
diff --git a/net/minecraft/world/level/block/MultifaceSpreadeableBlock.java b/net/minecraft/world/level/block/MultifaceSpreadeableBlock.java
new file mode 100644
index 0000000..7a053d3
--- /dev/null
+++ b/net/minecraft/world/level/block/MultifaceSpreadeableBlock.java
@@ -0,0 +1,15 @@
+package net.minecraft.world.level.block;
+
+import com.mojang.serialization.MapCodec;
+import net.minecraft.world.level.block.state.BlockBehaviour;
+
+public abstract class MultifaceSpreadeableBlock extends MultifaceBlock {
+ public MultifaceSpreadeableBlock(BlockBehaviour.Properties properties) {
+ super(properties);
+ }
+
+ @Override
+ public abstract MapCodec<? extends MultifaceSpreadeableBlock> codec();
+
+ public abstract MultifaceSpreader getSpreader();
+}
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
index b0bc409..2dd86e8 100644
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
@@ -270,7 +270,7 @@ public class NetherPortalBlock extends Block implements Portal {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return ItemStack.EMPTY;
}
diff --git a/net/minecraft/world/level/block/NetherWartBlock.java b/net/minecraft/world/level/block/NetherWartBlock.java
index 8f33a2b..97803a0 100644
--- a/net/minecraft/world/level/block/NetherWartBlock.java
+++ b/net/minecraft/world/level/block/NetherWartBlock.java
@@ -62,7 +62,7 @@ public class NetherWartBlock extends BushBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(Items.NETHER_WART);
}
diff --git a/net/minecraft/world/level/block/ParticleLeavesBlock.java b/net/minecraft/world/level/block/ParticleLeavesBlock.java
new file mode 100644
index 0000000..16a2a79
--- /dev/null
+++ b/net/minecraft/world/level/block/ParticleLeavesBlock.java
@@ -0,0 +1,50 @@
+package net.minecraft.world.level.block;
+
+import com.mojang.serialization.MapCodec;
+import com.mojang.serialization.codecs.RecordCodecBuilder;
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.Direction;
+import net.minecraft.core.particles.ParticleOptions;
+import net.minecraft.core.particles.ParticleTypes;
+import net.minecraft.util.ExtraCodecs;
+import net.minecraft.util.ParticleUtils;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.state.BlockBehaviour;
+import net.minecraft.world.level.block.state.BlockState;
+
+public class ParticleLeavesBlock extends LeavesBlock {
+ public static final MapCodec<ParticleLeavesBlock> CODEC = RecordCodecBuilder.mapCodec(
+ instance -> instance.group(
+ ExtraCodecs.POSITIVE_INT.fieldOf("chance").forGetter(particleLeavesBlock -> particleLeavesBlock.chance),
+ ParticleTypes.CODEC.fieldOf("particle").forGetter(particleLeavesBlock -> particleLeavesBlock.particle),
+ propertiesCodec()
+ )
+ .apply(instance, ParticleLeavesBlock::new)
+ );
+ private final ParticleOptions particle;
+ private final int chance;
+
+ @Override
+ public MapCodec<ParticleLeavesBlock> codec() {
+ return CODEC;
+ }
+
+ public ParticleLeavesBlock(int i, ParticleOptions particleOptions, BlockBehaviour.Properties properties) {
+ super(properties);
+ this.chance = i;
+ this.particle = particleOptions;
+ }
+
+ @Override
+ public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
+ super.animateTick(state, level, pos, random);
+ if (random.nextInt(this.chance) == 0) {
+ BlockPos blockPos = pos.below();
+ BlockState blockState = level.getBlockState(blockPos);
+ if (!isFaceFull(blockState.getCollisionShape(level, blockPos), Direction.UP)) {
+ ParticleUtils.spawnParticleBelow(level, pos, random, this.particle);
+ }
+ }
+ }
+}
diff --git a/net/minecraft/world/level/block/SculkBehaviour.java b/net/minecraft/world/level/block/SculkBehaviour.java
index af84d3f..e35da66 100644
--- a/net/minecraft/world/level/block/SculkBehaviour.java
+++ b/net/minecraft/world/level/block/SculkBehaviour.java
@@ -51,7 +51,7 @@ public interface SculkBehaviour {
default boolean attemptSpreadVein(
LevelAccessor level, BlockPos pos, BlockState state, @Nullable Collection<Direction> directions, boolean markForPostprocessing
) {
- return ((MultifaceBlock)Blocks.SCULK_VEIN).getSpreader().spreadAll(state, level, pos, markForPostprocessing) > 0L;
+ return ((MultifaceSpreadeableBlock)Blocks.SCULK_VEIN).getSpreader().spreadAll(state, level, pos, markForPostprocessing) > 0L;
}
default boolean canChangeBlockStateOnSpread() {
diff --git a/net/minecraft/world/level/block/SculkVeinBlock.java b/net/minecraft/world/level/block/SculkVeinBlock.java
index 954fd19..2d845d8 100644
--- a/net/minecraft/world/level/block/SculkVeinBlock.java
+++ b/net/minecraft/world/level/block/SculkVeinBlock.java
@@ -24,7 +24,7 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
-public class SculkVeinBlock extends MultifaceBlock implements SculkBehaviour, SimpleWaterloggedBlock {
+public class SculkVeinBlock extends MultifaceSpreadeableBlock implements SculkBehaviour, SimpleWaterloggedBlock {
public static final MapCodec<SculkVeinBlock> CODEC = simpleCodec(SculkVeinBlock::new);
private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
private final MultifaceSpreader veinSpreader = new MultifaceSpreader(new SculkVeinBlock.SculkVeinSpreaderConfig(MultifaceSpreader.DEFAULT_SPREAD_ORDER));
@@ -56,8 +56,7 @@ public class SculkVeinBlock extends MultifaceBlock implements SculkBehaviour, Si
BlockState blockState = Blocks.SCULK_VEIN.defaultBlockState();
for (Direction direction : directions) {
- BlockPos blockPos = pos.relative(direction);
- if (canAttachTo(level, direction, blockPos, level.getBlockState(blockPos))) {
+ if (canAttachTo(level, pos, direction)) {
blockState = blockState.setValue(getFaceProperty(direction), Boolean.valueOf(true));
flag = true;
}
diff --git a/net/minecraft/world/level/block/ShulkerBoxBlock.java b/net/minecraft/world/level/block/ShulkerBoxBlock.java
index 461ff36..55ddfdb 100644
--- a/net/minecraft/world/level/block/ShulkerBoxBlock.java
+++ b/net/minecraft/world/level/block/ShulkerBoxBlock.java
@@ -229,7 +229,7 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
ItemStack itemStack = super.getCloneItemStack(level, pos, state);
level.getBlockEntity(pos, BlockEntityType.SHULKER_BOX)
.ifPresent(shulkerBoxBlockEntity -> shulkerBoxBlockEntity.saveToItem(itemStack, level.registryAccess()));
diff --git a/net/minecraft/world/level/block/SnowyDirtBlock.java b/net/minecraft/world/level/block/SnowyDirtBlock.java
index b36c1ca..36fe334 100644
--- a/net/minecraft/world/level/block/SnowyDirtBlock.java
+++ b/net/minecraft/world/level/block/SnowyDirtBlock.java
@@ -50,7 +50,7 @@ public class SnowyDirtBlock extends Block {
return this.defaultBlockState().setValue(SNOWY, Boolean.valueOf(isSnowySetting(blockState)));
}
- private static boolean isSnowySetting(BlockState state) {
+ protected static boolean isSnowySetting(BlockState state) {
return state.is(BlockTags.SNOW);
}
diff --git a/net/minecraft/world/level/block/SoundType.java b/net/minecraft/world/level/block/SoundType.java
index 4c2a973..38a5015 100644
--- a/net/minecraft/world/level/block/SoundType.java
+++ b/net/minecraft/world/level/block/SoundType.java
@@ -781,6 +781,18 @@ public class SoundType {
public static final SoundType SPAWNER = new SoundType(
1.0F, 1.0F, SoundEvents.SPAWNER_BREAK, SoundEvents.SPAWNER_STEP, SoundEvents.SPAWNER_PLACE, SoundEvents.SPAWNER_HIT, SoundEvents.SPAWNER_FALL
);
+ public static final SoundType RESIN = new SoundType(
+ 1.0F, 1.0F, SoundEvents.RESIN_BREAK, SoundEvents.RESIN_STEP, SoundEvents.RESIN_PLACE, SoundEvents.RESIN_HIT, SoundEvents.RESIN_FALL
+ );
+ public static final SoundType RESIN_BRICKS = new SoundType(
+ 1.0F,
+ 1.0F,
+ SoundEvents.RESIN_BRICKS_BREAK,
+ SoundEvents.RESIN_BRICKS_STEP,
+ SoundEvents.RESIN_BRICKS_PLACE,
+ SoundEvents.RESIN_BRICKS_HIT,
+ SoundEvents.RESIN_BRICKS_FALL
+ );
public final float volume;
public final float pitch;
private final SoundEvent breakSound;
diff --git a/net/minecraft/world/level/block/SpongeBlock.java b/net/minecraft/world/level/block/SpongeBlock.java
index b01f35a..4d1bbe5 100644
--- a/net/minecraft/world/level/block/SpongeBlock.java
+++ b/net/minecraft/world/level/block/SpongeBlock.java
@@ -59,34 +59,34 @@ public class SpongeBlock extends Block {
queueAdder.accept(validPos.relative(direction));
}
},
- currentPos -> {
- if (currentPos.equals(pos)) {
- return true;
+ blockPos -> {
+ if (blockPos.equals(pos)) {
+ return BlockPos.TraversalNodeStatus.ACCEPT;
} else {
- BlockState blockState = level.getBlockState(currentPos);
- FluidState fluidState = level.getFluidState(currentPos);
+ BlockState blockState = level.getBlockState(blockPos);
+ FluidState fluidState = level.getFluidState(blockPos);
if (!fluidState.is(FluidTags.WATER)) {
- return false;
+ return BlockPos.TraversalNodeStatus.SKIP;
} else if (blockState.getBlock() instanceof BucketPickup bucketPickup
- && !bucketPickup.pickupBlock(null, level, currentPos, blockState).isEmpty()) {
- return true;
+ && !bucketPickup.pickupBlock(null, level, blockPos, blockState).isEmpty()) {
+ return BlockPos.TraversalNodeStatus.ACCEPT;
} else {
if (blockState.getBlock() instanceof LiquidBlock) {
- level.setBlock(currentPos, Blocks.AIR.defaultBlockState(), 3);
+ level.setBlock(blockPos, Blocks.AIR.defaultBlockState(), 3);
} else {
if (!blockState.is(Blocks.KELP)
&& !blockState.is(Blocks.KELP_PLANT)
&& !blockState.is(Blocks.SEAGRASS)
&& !blockState.is(Blocks.TALL_SEAGRASS)) {
- return false;
+ return BlockPos.TraversalNodeStatus.SKIP;
}
- BlockEntity blockEntity = blockState.hasBlockEntity() ? level.getBlockEntity(currentPos) : null;
- dropResources(blockState, level, currentPos, blockEntity);
- level.setBlock(currentPos, Blocks.AIR.defaultBlockState(), 3);
+ BlockEntity blockEntity = blockState.hasBlockEntity() ? level.getBlockEntity(blockPos) : null;
+ dropResources(blockState, level, blockPos, blockEntity);
+ level.setBlock(blockPos, Blocks.AIR.defaultBlockState(), 3);
}
- return true;
+ return BlockPos.TraversalNodeStatus.ACCEPT;
}
}
}
diff --git a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
index 5aa5ab0..cbd1ac1 100644
--- a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+++ b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
@@ -48,7 +48,7 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock {
for (int i = 0; i < 4; i++) {
BlockPos blockPos = pos.offset(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
if (level.getBlockState(blockPos).is(Blocks.DIRT) && canPropagate(blockState, level, blockPos)) {
- level.setBlockAndUpdate(blockPos, blockState.setValue(SNOWY, Boolean.valueOf(level.getBlockState(blockPos.above()).is(Blocks.SNOW))));
+ level.setBlockAndUpdate(blockPos, blockState.setValue(SNOWY, Boolean.valueOf(isSnowySetting(level.getBlockState(blockPos.above())))));
}
}
}
diff --git a/net/minecraft/world/level/block/StemBlock.java b/net/minecraft/world/level/block/StemBlock.java
index 0c8e083..e8db4d6 100644
--- a/net/minecraft/world/level/block/StemBlock.java
+++ b/net/minecraft/world/level/block/StemBlock.java
@@ -104,7 +104,7 @@ public class StemBlock extends BushBlock implements BonemealableBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(DataFixUtils.orElse(level.registryAccess().lookupOrThrow(Registries.ITEM).getOptional(this.seed), this));
}
diff --git a/net/minecraft/world/level/block/SweetBerryBushBlock.java b/net/minecraft/world/level/block/SweetBerryBushBlock.java
index c49ac2b..da781e7 100644
--- a/net/minecraft/world/level/block/SweetBerryBushBlock.java
+++ b/net/minecraft/world/level/block/SweetBerryBushBlock.java
@@ -47,7 +47,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(Items.SWEET_BERRIES);
}
diff --git a/net/minecraft/world/level/block/TallSeagrassBlock.java b/net/minecraft/world/level/block/TallSeagrassBlock.java
index fbea1f6..3b6f427 100644
--- a/net/minecraft/world/level/block/TallSeagrassBlock.java
+++ b/net/minecraft/world/level/block/TallSeagrassBlock.java
@@ -47,7 +47,7 @@ public class TallSeagrassBlock extends DoublePlantBlock implements LiquidBlockCo
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos, BlockState blockState) {
return new ItemStack(Blocks.SEAGRASS);
}
diff --git a/net/minecraft/world/level/block/WitherRoseBlock.java b/net/minecraft/world/level/block/WitherRoseBlock.java
index 8aabeb6..8334941 100644
--- a/net/minecraft/world/level/block/WitherRoseBlock.java
+++ b/net/minecraft/world/level/block/WitherRoseBlock.java
@@ -67,7 +67,12 @@ public class WitherRoseBlock extends FlowerBlock {
&& level.getDifficulty() != Difficulty.PEACEFUL
&& entity instanceof LivingEntity livingEntity
&& !livingEntity.isInvulnerableTo(serverLevel, level.damageSources().wither())) {
- livingEntity.addEffect(new MobEffectInstance(MobEffects.WITHER, 40));
+ livingEntity.addEffect(this.getBeeInteractionEffect());
}
}
+
+ @Override
+ public MobEffectInstance getBeeInteractionEffect() {
+ return new MobEffectInstance(MobEffects.WITHER, 40);
+ }
}
diff --git a/net/minecraft/world/level/block/entity/BlockEntity.java b/net/minecraft/world/level/block/entity/BlockEntity.java
index dd8fe02..583ca48 100644
--- a/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -238,10 +238,6 @@ public abstract class BlockEntity {
return BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.getType()) + " // " + this.getClass().getCanonicalName();
}
- public boolean onlyOpCanSetNbt() {
- return false;
- }
-
public BlockEntityType<?> getType() {
return this.type;
}
diff --git a/net/minecraft/world/level/block/entity/BlockEntityType.java b/net/minecraft/world/level/block/entity/BlockEntityType.java
index 81da9d7..08b5dd4 100644
--- a/net/minecraft/world/level/block/entity/BlockEntityType.java
+++ b/net/minecraft/world/level/block/entity/BlockEntityType.java
@@ -228,6 +228,7 @@ public class BlockEntityType<T extends BlockEntity> {
public static final BlockEntityType<CrafterBlockEntity> CRAFTER = register("crafter", CrafterBlockEntity::new, Blocks.CRAFTER);
public static final BlockEntityType<TrialSpawnerBlockEntity> TRIAL_SPAWNER = register("trial_spawner", TrialSpawnerBlockEntity::new, Blocks.TRIAL_SPAWNER);
public static final BlockEntityType<VaultBlockEntity> VAULT = register("vault", VaultBlockEntity::new, Blocks.VAULT);
+ private static final Set<BlockEntityType<?>> OP_ONLY_CUSTOM_DATA = Set.of(COMMAND_BLOCK, LECTERN, SIGN, HANGING_SIGN, MOB_SPAWNER, TRIAL_SPAWNER);
private final BlockEntityType.BlockEntitySupplier<? extends T> factory;
private final Set<Block> validBlocks;
private final Holder.Reference<BlockEntityType<?>> builtInRegistryHolder = BuiltInRegistries.BLOCK_ENTITY_TYPE.createIntrusiveHolder(this);
@@ -273,6 +274,10 @@ public class BlockEntityType<T extends BlockEntity> {
return (T)(blockEntity != null && blockEntity.getType() == this ? blockEntity : null);
}
+ public boolean onlyOpCanSetNbt() {
+ return OP_ONLY_CUSTOM_DATA.contains(this);
+ }
+
@FunctionalInterface
interface BlockEntitySupplier<T extends BlockEntity> {
T create(BlockPos pos, BlockState state);
diff --git a/net/minecraft/world/level/block/entity/CommandBlockEntity.java b/net/minecraft/world/level/block/entity/CommandBlockEntity.java
index fbce99b..1eb67f6 100644
--- a/net/minecraft/world/level/block/entity/CommandBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/CommandBlockEntity.java
@@ -87,11 +87,6 @@ public class CommandBlockEntity extends BlockEntity {
this.setAutomatic(tag.getBoolean("auto"));
}
- @Override
- public boolean onlyOpCanSetNbt() {
- return true;
- }
-
public BaseCommandBlock getCommandBlock() {
return this.commandBlock;
}
diff --git a/net/minecraft/world/level/block/entity/CreakingHeartBlockEntity.java b/net/minecraft/world/level/block/entity/CreakingHeartBlockEntity.java
index 10f9175..6863a4f 100644
--- a/net/minecraft/world/level/block/entity/CreakingHeartBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/CreakingHeartBlockEntity.java
@@ -2,14 +2,17 @@ package net.minecraft.world.level.block.entity;
import java.util.Optional;
import javax.annotation.Nullable;
+import net.minecraft.Util;
import net.minecraft.core.BlockPos;
+import net.minecraft.core.Direction;
import net.minecraft.core.HolderLookup;
-import net.minecraft.core.particles.TargetColorParticleOption;
+import net.minecraft.core.particles.TrailParticleOption;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
+import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
import net.minecraft.util.SpawnUtil;
import net.minecraft.world.Difficulty;
@@ -23,9 +26,12 @@ import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CreakingHeartBlock;
+import net.minecraft.world.level.block.MultifaceBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.Vec3;
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.commons.lang3.mutable.MutableObject;
public class CreakingHeartBlockEntity extends BlockEntity {
private static final int PLAYER_DETECTION_RANGE = 32;
@@ -39,6 +45,8 @@ public class CreakingHeartBlockEntity extends BlockEntity {
private static final int NUMBER_OF_HURT_CALLS = 10;
private static final int HURT_CALL_INTERVAL = 10;
private static final int HURT_CALL_PARTICLE_TICKS = 50;
+ private static final int MAX_DEPTH = 2;
+ private static final int MAX_COUNT = 64;
@Nullable
private CreakingTransient creaking;
private int ticker;
@@ -83,31 +91,23 @@ public class CreakingHeartBlockEntity extends BlockEntity {
if (creakingHeartBlockEntity.ticker-- < 0) {
creakingHeartBlockEntity.ticker = 20;
if (creakingHeartBlockEntity.creaking != null) {
- if (CreakingHeartBlock.canSummonCreaking(level) && !(creakingHeartBlockEntity.distanceToCreaking() > 34.0)) {
+ if (CreakingHeartBlock.isNaturalNight(level)
+ && !(creakingHeartBlockEntity.distanceToCreaking() > 34.0)
+ && !creakingHeartBlockEntity.creaking.playerIsStuckInYou()) {
if (creakingHeartBlockEntity.creaking.isRemoved()) {
creakingHeartBlockEntity.creaking = null;
}
if (!CreakingHeartBlock.hasRequiredLogs(blockState, level, blockPos) && creakingHeartBlockEntity.creaking == null) {
- level.setBlock(blockPos, blockState.setValue(CreakingHeartBlock.CREAKING, CreakingHeartBlock.CreakingHeartState.DISABLED), 3);
+ level.setBlock(blockPos, blockState.setValue(CreakingHeartBlock.ACTIVE, Boolean.valueOf(false)), 3);
}
} else {
creakingHeartBlockEntity.removeProtector(null);
}
} else if (!CreakingHeartBlock.hasRequiredLogs(blockState, level, blockPos)) {
- level.setBlock(blockPos, blockState.setValue(CreakingHeartBlock.CREAKING, CreakingHeartBlock.CreakingHeartState.DISABLED), 3);
- } else {
- if (!CreakingHeartBlock.canSummonCreaking(level)) {
- if (blockState.getValue(CreakingHeartBlock.CREAKING) == CreakingHeartBlock.CreakingHeartState.ACTIVE) {
- level.setBlock(blockPos, blockState.setValue(CreakingHeartBlock.CREAKING, CreakingHeartBlock.CreakingHeartState.DORMANT), 3);
- return;
- }
- } else if (blockState.getValue(CreakingHeartBlock.CREAKING) == CreakingHeartBlock.CreakingHeartState.DORMANT) {
- level.setBlock(blockPos, blockState.setValue(CreakingHeartBlock.CREAKING, CreakingHeartBlock.CreakingHeartState.ACTIVE), 3);
- return;
- }
-
- if (blockState.getValue(CreakingHeartBlock.CREAKING) == CreakingHeartBlock.CreakingHeartState.ACTIVE) {
+ level.setBlock(blockPos, blockState.setValue(CreakingHeartBlock.ACTIVE, Boolean.valueOf(false)), 3);
+ } else if (blockState.getValue(CreakingHeartBlock.ACTIVE)) {
+ if (CreakingHeartBlock.isNaturalNight(level)) {
if (level.getDifficulty() != Difficulty.PEACEFUL) {
if (!(level instanceof ServerLevel serverLevel && !serverLevel.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING))) {
Player nearestPlayer = level.getNearestPlayer(blockPos.getX(), blockPos.getY(), blockPos.getZ(), 32.0, false);
@@ -135,7 +135,7 @@ public class CreakingHeartBlockEntity extends BlockEntity {
private static CreakingTransient spawnProtector(ServerLevel serverLevel, CreakingHeartBlockEntity creakingHeartBlockEntity) {
BlockPos blockPos = creakingHeartBlockEntity.getBlockPos();
Optional<CreakingTransient> optional = SpawnUtil.trySpawnMob(
- EntityType.CREAKING_TRANSIENT, EntitySpawnReason.SPAWNER, serverLevel, blockPos, 5, 16, 8, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER_NO_LEAVES
+ EntityType.CREAKING_TRANSIENT, EntitySpawnReason.SPAWNER, serverLevel, blockPos, 5, 16, 8, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER_NO_LEAVES, true
);
if (optional.isEmpty()) {
return null;
@@ -161,13 +161,57 @@ public class CreakingHeartBlockEntity extends BlockEntity {
public void creakingHurt() {
if (this.creaking != null) {
if (this.level instanceof ServerLevel serverLevel) {
- this.emitParticles(serverLevel, 20, false);
- this.emitter = 100;
- this.emitterTarget = this.creaking.getBoundingBox().getCenter();
+ if (this.emitter <= 0) {
+ this.emitParticles(serverLevel, 20, false);
+ int randomInt = this.level.getRandom().nextIntBetweenInclusive(2, 3);
+
+ for (int i = 0; i < randomInt; i++) {
+ this.spreadResin().ifPresent(blockPos -> this.level.playSound(null, blockPos, SoundEvents.RESIN_PLACE, SoundSource.BLOCKS, 1.0F, 1.0F));
+ }
+
+ this.emitter = 100;
+ this.emitterTarget = this.creaking.getBoundingBox().getCenter();
+ }
}
}
}
+ private Optional<BlockPos> spreadResin() {
+ BlockPos blockPos = this.worldPosition;
+ Mutable<BlockPos> mutable = new MutableObject<>(null);
+ BlockPos.breadthFirstTraversal(this.worldPosition, 2, 64, (blockPos1, consumer) -> {
+ for (Direction direction : Util.shuffledCopy(Direction.values(), this.level.random)) {
+ BlockPos blockPos2 = blockPos1.relative(direction);
+ BlockState blockState = this.level.getBlockState(blockPos2);
+ if (blockState.is(BlockTags.PALE_OAK_LOGS)) {
+ consumer.accept(blockPos2);
+ }
+ }
+ }, blockPos1 -> {
+ if (!this.level.getBlockState(blockPos1).is(BlockTags.PALE_OAK_LOGS)) {
+ return BlockPos.TraversalNodeStatus.ACCEPT;
+ } else {
+ for (Direction direction : Util.shuffledCopy(Direction.values(), this.level.random)) {
+ BlockPos blockPos2 = blockPos1.relative(direction);
+ BlockState blockState = this.level.getBlockState(blockPos2);
+ Direction opposite = direction.getOpposite();
+ if (blockState.isAir()) {
+ blockState = Blocks.RESIN_CLUMP.defaultBlockState();
+ }
+
+ if (blockState.is(Blocks.RESIN_CLUMP) && !MultifaceBlock.hasFace(blockState, opposite)) {
+ this.level.setBlock(blockPos2, blockState.setValue(MultifaceBlock.getFaceProperty(opposite), Boolean.valueOf(true)), 3);
+ mutable.setValue(blockPos2);
+ return BlockPos.TraversalNodeStatus.STOP;
+ }
+ }
+
+ return BlockPos.TraversalNodeStatus.ACCEPT;
+ }
+ });
+ return Optional.ofNullable(mutable.getValue());
+ }
+
private void emitParticles(ServerLevel serverLevel, int i, boolean flag) {
if (this.creaking != null) {
int i1 = flag ? 16545810 : 6250335;
@@ -189,15 +233,22 @@ public class CreakingHeartBlockEntity extends BlockEntity {
vec31 = vec32;
}
- TargetColorParticleOption targetColorParticleOption = new TargetColorParticleOption(vec31, i1);
- serverLevel.sendParticles(targetColorParticleOption, vec3.x, vec3.y, vec3.z, 1, 0.0, 0.0, 0.0, 0.0);
+ TrailParticleOption trailParticleOption = new TrailParticleOption(vec31, i1, randomSource.nextInt(40) + 10);
+ serverLevel.sendParticles(trailParticleOption, true, true, vec3.x, vec3.y, vec3.z, 1, 0.0, 0.0, 0.0, 0.0);
}
}
}
public void removeProtector(@Nullable DamageSource damageSource) {
if (this.creaking != null) {
- this.creaking.tearDown(damageSource);
+ if (damageSource == null) {
+ this.creaking.tearDown();
+ } else {
+ this.creaking.creakingDeathEffects(damageSource);
+ this.creaking.setTearingDown();
+ this.creaking.setHealth(0.0F);
+ }
+
this.creaking = null;
}
}
diff --git a/net/minecraft/world/level/block/entity/LecternBlockEntity.java b/net/minecraft/world/level/block/entity/LecternBlockEntity.java
index 83b01e8..98e36d9 100644
--- a/net/minecraft/world/level/block/entity/LecternBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/LecternBlockEntity.java
@@ -194,11 +194,6 @@ public class LecternBlockEntity extends BlockEntity implements Clearable, MenuPr
return new CommandSourceStack(CommandSource.NULL, vec3, Vec2.ZERO, serverLevel, 2, string, component, serverLevel.getServer(), player);
}
- @Override
- public boolean onlyOpCanSetNbt() {
- return true;
- }
-
@Override
protected void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) {
super.loadAdditional(tag, registries);
diff --git a/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java b/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
index 78e2fff..37d35c7 100644
--- a/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
@@ -189,7 +189,9 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi
private boolean trySummonWarden(ServerLevel level) {
return this.warningLevel >= 4
- && SpawnUtil.trySpawnMob(EntityType.WARDEN, EntitySpawnReason.TRIGGERED, level, this.getBlockPos(), 20, 5, 6, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER)
+ && SpawnUtil.trySpawnMob(
+ EntityType.WARDEN, EntitySpawnReason.TRIGGERED, level, this.getBlockPos(), 20, 5, 6, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER, false
+ )
.isPresent();
}
diff --git a/net/minecraft/world/level/block/entity/SignBlockEntity.java b/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 03bf5e5..8e97d56 100644
--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -231,11 +231,6 @@ public class SignBlockEntity extends BlockEntity {
return this.saveCustomOnly(registries);
}
- @Override
- public boolean onlyOpCanSetNbt() {
- return true;
- }
-
public void setAllowedPlayerEditor(@Nullable UUID playWhoMayEdit) {
this.playerWhoMayEdit = playWhoMayEdit;
}
diff --git a/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java b/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java
index e45339e..30b490b 100644
--- a/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java
@@ -73,11 +73,6 @@ public class SpawnerBlockEntity extends BlockEntity implements Spawner {
return this.spawner.onEventTriggered(this.level, id) || super.triggerEvent(id, type);
}
- @Override
- public boolean onlyOpCanSetNbt() {
- return true;
- }
-
@Override
public void setEntityId(EntityType<?> type, RandomSource random) {
this.spawner.setEntityId(type, this.level, random, this.worldPosition);
diff --git a/net/minecraft/world/level/block/entity/TrialSpawnerBlockEntity.java b/net/minecraft/world/level/block/entity/TrialSpawnerBlockEntity.java
index 9064011..316a936 100644
--- a/net/minecraft/world/level/block/entity/TrialSpawnerBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TrialSpawnerBlockEntity.java
@@ -62,11 +62,6 @@ public class TrialSpawnerBlockEntity extends BlockEntity implements Spawner, Tri
return this.trialSpawner.getData().getUpdateTag(this.getBlockState().getValue(TrialSpawnerBlock.STATE));
}
- @Override
- public boolean onlyOpCanSetNbt() {
- return true;
- }
-
@Override
public void setEntityId(EntityType<?> entityType, RandomSource random) {
this.trialSpawner.getData().setEntityId(this.trialSpawner, random, entityType);
diff --git a/net/minecraft/world/level/block/grower/TreeGrower.java b/net/minecraft/world/level/block/grower/TreeGrower.java
index 4fa4b3c..af10305 100644
--- a/net/minecraft/world/level/block/grower/TreeGrower.java
+++ b/net/minecraft/world/level/block/grower/TreeGrower.java
@@ -64,7 +64,7 @@ public final class TreeGrower {
"cherry", Optional.empty(), Optional.of(TreeFeatures.CHERRY), Optional.of(TreeFeatures.CHERRY_BEES_005)
);
public static final TreeGrower DARK_OAK = new TreeGrower("dark_oak", Optional.of(TreeFeatures.DARK_OAK), Optional.empty(), Optional.empty());
- public static final TreeGrower PALE_OAK = new TreeGrower("pale_oak", Optional.of(TreeFeatures.PALE_OAK), Optional.empty(), Optional.empty());
+ public static final TreeGrower PALE_OAK = new TreeGrower("pale_oak", Optional.of(TreeFeatures.PALE_OAK_BONEMEAL), Optional.empty(), Optional.empty());
private final String name;
private final float secondaryChance;
private final Optional<ResourceKey<ConfiguredFeature<?, ?>>> megaTree;
diff --git a/net/minecraft/world/level/block/piston/MovingPistonBlock.java b/net/minecraft/world/level/block/piston/MovingPistonBlock.java
index 1b5f22d..c991928 100644
--- a/net/minecraft/world/level/block/piston/MovingPistonBlock.java
+++ b/net/minecraft/world/level/block/piston/MovingPistonBlock.java
@@ -119,7 +119,7 @@ public class MovingPistonBlock extends BaseEntityBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return ItemStack.EMPTY;
}
diff --git a/net/minecraft/world/level/block/piston/PistonHeadBlock.java b/net/minecraft/world/level/block/piston/PistonHeadBlock.java
index ca8ae93..7e7ced3 100644
--- a/net/minecraft/world/level/block/piston/PistonHeadBlock.java
+++ b/net/minecraft/world/level/block/piston/PistonHeadBlock.java
@@ -166,7 +166,7 @@ public class PistonHeadBlock extends DirectionalBlock {
}
@Override
- public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
+ protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) {
return new ItemStack(state.getValue(TYPE) == PistonType.STICKY ? Blocks.STICKY_PISTON : Blocks.PISTON);
}
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
index bb111b6..0c5265f 100644
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -398,6 +398,10 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.soundType;
}
+ protected ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos, BlockState blockState) {
+ return new ItemStack(this.asItem());
+ }
+
public abstract Item asItem();
protected abstract Block asBlock();
@@ -896,6 +900,10 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.cache != null ? this.cache.isCollisionShapeFullBlock : this.getBlock().isCollisionShapeFullBlock(this.asState(), level, pos);
}
+ public ItemStack getCloneItemStack(LevelReader levelReader, BlockPos blockPos) {
+ return this.getBlock().getCloneItemStack(levelReader, blockPos, this.asState());
+ }
+
protected abstract BlockState asState();
public boolean requiresCorrectToolForDrops() {
diff --git a/net/minecraft/world/level/block/state/properties/BlockStateProperties.java b/net/minecraft/world/level/block/state/properties/BlockStateProperties.java
index 10f37cb..2351f70 100644
--- a/net/minecraft/world/level/block/state/properties/BlockStateProperties.java
+++ b/net/minecraft/world/level/block/state/properties/BlockStateProperties.java
@@ -2,13 +2,16 @@ package net.minecraft.world.level.block.state.properties;
import net.minecraft.core.Direction;
import net.minecraft.core.FrontAndTop;
-import net.minecraft.world.level.block.CreakingHeartBlock;
import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerState;
import net.minecraft.world.level.block.entity.vault.VaultState;
public class BlockStateProperties {
+ public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
public static final BooleanProperty ATTACHED = BooleanProperty.create("attached");
+ public static final BooleanProperty BERRIES = BooleanProperty.create("berries");
+ public static final BooleanProperty BLOOM = BooleanProperty.create("bloom");
public static final BooleanProperty BOTTOM = BooleanProperty.create("bottom");
+ public static final BooleanProperty CAN_SUMMON = BooleanProperty.create("can_summon");
public static final BooleanProperty CONDITIONAL = BooleanProperty.create("conditional");
public static final BooleanProperty DISARMED = BooleanProperty.create("disarmed");
public static final BooleanProperty DRAG = BooleanProperty.create("drag");
@@ -25,22 +28,20 @@ public class BlockStateProperties {
public static final BooleanProperty INVERTED = BooleanProperty.create("inverted");
public static final BooleanProperty IN_WALL = BooleanProperty.create("in_wall");
public static final BooleanProperty LIT = BooleanProperty.create("lit");
- public static final BooleanProperty TIP = BooleanProperty.create("tip");
public static final BooleanProperty LOCKED = BooleanProperty.create("locked");
+ public static final BooleanProperty NATURAL = BooleanProperty.create("natural");
public static final BooleanProperty OCCUPIED = BooleanProperty.create("occupied");
public static final BooleanProperty OPEN = BooleanProperty.create("open");
public static final BooleanProperty PERSISTENT = BooleanProperty.create("persistent");
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
public static final BooleanProperty SHORT = BooleanProperty.create("short");
+ public static final BooleanProperty SHRIEKING = BooleanProperty.create("shrieking");
public static final BooleanProperty SIGNAL_FIRE = BooleanProperty.create("signal_fire");
public static final BooleanProperty SNOWY = BooleanProperty.create("snowy");
+ public static final BooleanProperty TIP = BooleanProperty.create("tip");
public static final BooleanProperty TRIGGERED = BooleanProperty.create("triggered");
public static final BooleanProperty UNSTABLE = BooleanProperty.create("unstable");
public static final BooleanProperty WATERLOGGED = BooleanProperty.create("waterlogged");
- public static final BooleanProperty BERRIES = BooleanProperty.create("berries");
- public static final BooleanProperty BLOOM = BooleanProperty.create("bloom");
- public static final BooleanProperty SHRIEKING = BooleanProperty.create("shrieking");
- public static final BooleanProperty CAN_SUMMON = BooleanProperty.create("can_summon");
public static final EnumProperty<Direction.Axis> HORIZONTAL_AXIS = EnumProperty.create("axis", Direction.Axis.class, Direction.Axis.X, Direction.Axis.Z);
public static final EnumProperty<Direction.Axis> AXIS = EnumProperty.create("axis", Direction.Axis.class);
public static final BooleanProperty UP = BooleanProperty.create("up");
@@ -144,8 +145,5 @@ public class BlockStateProperties {
public static final BooleanProperty CRAFTING = BooleanProperty.create("crafting");
public static final EnumProperty<TrialSpawnerState> TRIAL_SPAWNER_STATE = EnumProperty.create("trial_spawner_state", TrialSpawnerState.class);
public static final EnumProperty<VaultState> VAULT_STATE = EnumProperty.create("vault_state", VaultState.class);
- public static final EnumProperty<CreakingHeartBlock.CreakingHeartState> CREAKING = EnumProperty.create(
- "creaking", CreakingHeartBlock.CreakingHeartState.class
- );
public static final BooleanProperty OMINOUS = BooleanProperty.create("ominous");
}
diff --git a/net/minecraft/world/level/chunk/ChunkGenerator.java b/net/minecraft/world/level/chunk/ChunkGenerator.java
index 92f7bfb..bbf4d0e 100644
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -44,6 +44,7 @@ import net.minecraft.server.level.WorldGenRegion;
import net.minecraft.util.random.WeightedRandomList;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.NoiseColumn;
@@ -460,28 +461,31 @@ public abstract class ChunkGenerator {
public void createStructures(
RegistryAccess registryAccess,
- ChunkGeneratorStructureState structureState,
+ ChunkGeneratorStructureState chunkGeneratorStructureState,
StructureManager structureManager,
- ChunkAccess chunk,
- StructureTemplateManager structureTemplateManager
+ ChunkAccess chunkAccess,
+ StructureTemplateManager structureTemplateManager,
+ ResourceKey<Level> resourceKey
) {
- ChunkPos pos = chunk.getPos();
- SectionPos sectionPos = SectionPos.bottomOf(chunk);
- RandomState randomState = structureState.randomState();
- structureState.possibleStructureSets()
+ ChunkPos pos = chunkAccess.getPos();
+ SectionPos sectionPos = SectionPos.bottomOf(chunkAccess);
+ RandomState randomState = chunkGeneratorStructureState.randomState();
+ chunkGeneratorStructureState.possibleStructureSets()
.forEach(
- structureSet -> {
- StructurePlacement structurePlacement = structureSet.value().placement();
- List<StructureSet.StructureSelectionEntry> list = structureSet.value().structures();
+ holder -> {
+ StructurePlacement structurePlacement = holder.value().placement();
+ List<StructureSet.StructureSelectionEntry> list = holder.value().structures();
for (StructureSet.StructureSelectionEntry structureSelectionEntry : list) {
- StructureStart startForStructure = structureManager.getStartForStructure(sectionPos, structureSelectionEntry.structure().value(), chunk);
+ StructureStart startForStructure = structureManager.getStartForStructure(
+ sectionPos, structureSelectionEntry.structure().value(), chunkAccess
+ );
if (startForStructure != null && startForStructure.isValid()) {
return;
}
}
- if (structurePlacement.isStructureChunk(structureState, pos.x, pos.z)) {
+ if (structurePlacement.isStructureChunk(chunkGeneratorStructureState, pos.x, pos.z)) {
if (list.size() == 1) {
this.tryGenerateStructure(
list.get(0),
@@ -489,16 +493,17 @@ public abstract class ChunkGenerator {
registryAccess,
randomState,
structureTemplateManager,
- structureState.getLevelSeed(),
- chunk,
+ chunkGeneratorStructureState.getLevelSeed(),
+ chunkAccess,
pos,
- sectionPos
+ sectionPos,
+ resourceKey
);
} else {
ArrayList<StructureSet.StructureSelectionEntry> list1 = new ArrayList<>(list.size());
list1.addAll(list);
WorldgenRandom worldgenRandom = new WorldgenRandom(new LegacyRandomSource(0L));
- worldgenRandom.setLargeFeatureSeed(structureState.getLevelSeed(), pos.x, pos.z);
+ worldgenRandom.setLargeFeatureSeed(chunkGeneratorStructureState.getLevelSeed(), pos.x, pos.z);
int i = 0;
for (StructureSet.StructureSelectionEntry structureSelectionEntry1 : list1) {
@@ -525,10 +530,11 @@ public abstract class ChunkGenerator {
registryAccess,
randomState,
structureTemplateManager,
- structureState.getLevelSeed(),
- chunk,
+ chunkGeneratorStructureState.getLevelSeed(),
+ chunkAccess,
pos,
- sectionPos
+ sectionPos,
+ resourceKey
)) {
return;
}
@@ -546,22 +552,34 @@ public abstract class ChunkGenerator {
StructureSet.StructureSelectionEntry structureSelectionEntry,
StructureManager structureManager,
RegistryAccess registryAccess,
- RandomState random,
+ RandomState randomState,
StructureTemplateManager structureTemplateManager,
- long seed,
- ChunkAccess chunk,
+ long l,
+ ChunkAccess chunkAccess,
ChunkPos chunkPos,
- SectionPos sectionPos
+ SectionPos sectionPos,
+ ResourceKey<Level> resourceKey
) {
Structure structure = structureSelectionEntry.structure().value();
- int i = fetchReferences(structureManager, chunk, sectionPos, structure);
+ int i = fetchReferences(structureManager, chunkAccess, sectionPos, structure);
HolderSet<Biome> holderSet = structure.biomes();
Predicate<Holder<Biome>> predicate = holderSet::contains;
StructureStart structureStart = structure.generate(
- registryAccess, this, this.biomeSource, random, structureTemplateManager, seed, chunkPos, i, chunk, predicate
+ structureSelectionEntry.structure(),
+ resourceKey,
+ registryAccess,
+ this,
+ this.biomeSource,
+ randomState,
+ structureTemplateManager,
+ l,
+ chunkPos,
+ i,
+ chunkAccess,
+ predicate
);
if (structureStart.isValid()) {
- structureManager.setStartForStructure(sectionPos, structure, structureStart, chunk);
+ structureManager.setStartForStructure(sectionPos, structure, structureStart, chunkAccess);
return true;
} else {
return false;
diff --git a/net/minecraft/world/level/chunk/status/ChunkStatusTasks.java b/net/minecraft/world/level/chunk/status/ChunkStatusTasks.java
index 958a109..7449be9 100644
--- a/net/minecraft/world/level/chunk/status/ChunkStatusTasks.java
+++ b/net/minecraft/world/level/chunk/status/ChunkStatusTasks.java
@@ -42,7 +42,8 @@ public class ChunkStatusTasks {
serverLevel.getChunkSource().getGeneratorState(),
serverLevel.structureManager(),
chunk,
- worldGenContext.structureManager()
+ worldGenContext.structureManager(),
+ serverLevel.dimension()
);
}
diff --git a/net/minecraft/world/level/chunk/status/ChunkStep.java b/net/minecraft/world/level/chunk/status/ChunkStep.java
index ab0acb9..7a4d299 100644
--- a/net/minecraft/world/level/chunk/status/ChunkStep.java
+++ b/net/minecraft/world/level/chunk/status/ChunkStep.java
@@ -34,7 +34,7 @@ public record ChunkStep(
}
if (duration != null) {
- duration.finish();
+ duration.finish(true);
}
return chunk;
diff --git a/net/minecraft/world/level/chunk/storage/SectionStorage.java b/net/minecraft/world/level/chunk/storage/SectionStorage.java
index 2c38df6..a3fd5fd 100644
--- a/net/minecraft/world/level/chunk/storage/SectionStorage.java
+++ b/net/minecraft/world/level/chunk/storage/SectionStorage.java
@@ -197,13 +197,17 @@ public class SectionStorage<R, P> implements AutoCloseable {
),
Util.backgroundExecutor().forName("parseSection")
)
- .exceptionally(throwable -> {
- if (throwable instanceof IOException ioException) {
+ .exceptionally(cause -> {
+ if (cause instanceof CompletionException) {
+ cause = cause.getCause();
+ }
+
+ if (cause instanceof IOException ioException) {
LOGGER.error("Error reading chunk {} data from disk", chunkPos, ioException);
this.errorReporter.reportChunkLoadFailure(ioException, this.simpleRegionStorage.storageInfo(), chunkPos);
return Optional.empty();
} else {
- throw new CompletionException(throwable);
+ throw new CompletionException(cause);
}
});
}
diff --git a/net/minecraft/world/level/levelgen/feature/SimpleBlockFeature.java b/net/minecraft/world/level/levelgen/feature/SimpleBlockFeature.java
index 930075a..5f1ed3a 100644
--- a/net/minecraft/world/level/levelgen/feature/SimpleBlockFeature.java
+++ b/net/minecraft/world/level/levelgen/feature/SimpleBlockFeature.java
@@ -32,6 +32,10 @@ public class SimpleBlockFeature extends Feature<SimpleBlockConfiguration> {
worldGenLevel.setBlock(blockPos, state, 2);
}
+ if (simpleBlockConfiguration.scheduleTick()) {
+ worldGenLevel.scheduleTick(blockPos, worldGenLevel.getBlockState(blockPos).getBlock(), 1);
+ }
+
return true;
} else {
return false;
diff --git a/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java b/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java
index 1f3e598..fc924ca 100644
--- a/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java
+++ b/net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration.java
@@ -14,7 +14,7 @@ import net.minecraft.core.registries.Registries;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
-import net.minecraft.world.level.block.MultifaceBlock;
+import net.minecraft.world.level.block.MultifaceSpreadeableBlock;
public class MultifaceGrowthConfiguration implements FeatureConfiguration {
public static final Codec<MultifaceGrowthConfiguration> CODEC = RecordCodecBuilder.create(
@@ -23,8 +23,8 @@ public class MultifaceGrowthConfiguration implements FeatureConfiguration {
.byNameCodec()
.fieldOf("block")
.flatXmap(MultifaceGrowthConfiguration::apply, DataResult::success)
- .orElse((MultifaceBlock)Blocks.GLOW_LICHEN)
- .forGetter(config -> config.placeBlock),
+ .orElse((MultifaceSpreadeableBlock)Blocks.GLOW_LICHEN)
+ .forGetter(multifaceGrowthConfiguration -> multifaceGrowthConfiguration.placeBlock),
Codec.intRange(1, 64).fieldOf("search_range").orElse(10).forGetter(config -> config.searchRange),
Codec.BOOL.fieldOf("can_place_on_floor").orElse(false).forGetter(config -> config.canPlaceOnFloor),
Codec.BOOL.fieldOf("can_place_on_ceiling").orElse(false).forGetter(config -> config.canPlaceOnCeiling),
@@ -34,7 +34,7 @@ public class MultifaceGrowthConfiguration implements FeatureConfiguration {
)
.apply(instance, MultifaceGrowthConfiguration::new)
);
- public final MultifaceBlock placeBlock;
+ public final MultifaceSpreadeableBlock placeBlock;
public final int searchRange;
public final boolean canPlaceOnFloor;
public final boolean canPlaceOnCeiling;
@@ -43,38 +43,32 @@ public class MultifaceGrowthConfiguration implements FeatureConfiguration {
public final HolderSet<Block> canBePlacedOn;
private final ObjectArrayList<Direction> validDirections;
- private static DataResult<MultifaceBlock> apply(Block block) {
- return block instanceof MultifaceBlock multifaceBlock
- ? DataResult.success(multifaceBlock)
- : DataResult.error(() -> "Growth block should be a multiface block");
+ private static DataResult<MultifaceSpreadeableBlock> apply(Block block) {
+ return block instanceof MultifaceSpreadeableBlock multifaceSpreadeableBlock
+ ? DataResult.success(multifaceSpreadeableBlock)
+ : DataResult.error(() -> "Growth block should be a multiface spreadeable block");
}
public MultifaceGrowthConfiguration(
- MultifaceBlock placeBlock,
- int searchRange,
- boolean canPlaceOnFloor,
- boolean canPlaceOnCeiling,
- boolean canPlaceOnWall,
- float chanceOfSpreading,
- HolderSet<Block> canBePlacedOn
+ MultifaceSpreadeableBlock multifaceSpreadeableBlock, int i, boolean flag, boolean flag1, boolean flag2, float f, HolderSet<Block> holderSet
) {
- this.placeBlock = placeBlock;
- this.searchRange = searchRange;
- this.canPlaceOnFloor = canPlaceOnFloor;
- this.canPlaceOnCeiling = canPlaceOnCeiling;
- this.canPlaceOnWall = canPlaceOnWall;
- this.chanceOfSpreading = chanceOfSpreading;
- this.canBePlacedOn = canBePlacedOn;
+ this.placeBlock = multifaceSpreadeableBlock;
+ this.searchRange = i;
+ this.canPlaceOnFloor = flag;
+ this.canPlaceOnCeiling = flag1;
+ this.canPlaceOnWall = flag2;
+ this.chanceOfSpreading = f;
+ this.canBePlacedOn = holderSet;
this.validDirections = new ObjectArrayList<>(6);
- if (canPlaceOnCeiling) {
+ if (flag1) {
this.validDirections.add(Direction.UP);
}
- if (canPlaceOnFloor) {
+ if (flag) {
this.validDirections.add(Direction.DOWN);
}
- if (canPlaceOnWall) {
+ if (flag2) {
Direction.Plane.HORIZONTAL.forEach(this.validDirections::add);
}
}
diff --git a/net/minecraft/world/level/levelgen/feature/configurations/SimpleBlockConfiguration.java b/net/minecraft/world/level/levelgen/feature/configurations/SimpleBlockConfiguration.java
index 07e62bd..a3b5a22 100644
--- a/net/minecraft/world/level/levelgen/feature/configurations/SimpleBlockConfiguration.java
+++ b/net/minecraft/world/level/levelgen/feature/configurations/SimpleBlockConfiguration.java
@@ -4,9 +4,18 @@ import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider;
-public record SimpleBlockConfiguration(BlockStateProvider toPlace) implements FeatureConfiguration {
+public record SimpleBlockConfiguration(BlockStateProvider toPlace, boolean scheduleTick) implements FeatureConfiguration {
public static final Codec<SimpleBlockConfiguration> CODEC = RecordCodecBuilder.create(
- instance -> instance.group(BlockStateProvider.CODEC.fieldOf("to_place").forGetter(config -> config.toPlace))
+ instance -> instance.group(
+ BlockStateProvider.CODEC.fieldOf("to_place").forGetter(config -> config.toPlace),
+ Codec.BOOL
+ .optionalFieldOf("schedule_tick", Boolean.valueOf(false))
+ .forGetter(simpleBlockConfiguration -> simpleBlockConfiguration.scheduleTick)
+ )
.apply(instance, SimpleBlockConfiguration::new)
);
+
+ public SimpleBlockConfiguration(BlockStateProvider toPlace) {
+ this(toPlace, false);
+ }
}
diff --git a/net/minecraft/world/level/levelgen/feature/treedecorators/CreakingHeartDecorator.java b/net/minecraft/world/level/levelgen/feature/treedecorators/CreakingHeartDecorator.java
index 8fba2a9..6694caf 100644
--- a/net/minecraft/world/level/levelgen/feature/treedecorators/CreakingHeartDecorator.java
+++ b/net/minecraft/world/level/levelgen/feature/treedecorators/CreakingHeartDecorator.java
@@ -48,7 +48,10 @@ public class CreakingHeartDecorator extends TreeDecorator {
if (!optional.isEmpty()) {
context.setBlock(
optional.get(),
- Blocks.CREAKING_HEART.defaultBlockState().setValue(CreakingHeartBlock.CREAKING, CreakingHeartBlock.CreakingHeartState.DORMANT)
+ Blocks.CREAKING_HEART
+ .defaultBlockState()
+ .setValue(CreakingHeartBlock.ACTIVE, Boolean.valueOf(true))
+ .setValue(CreakingHeartBlock.NATURAL, Boolean.valueOf(true))
);
}
}
diff --git a/net/minecraft/world/level/levelgen/feature/treedecorators/PaleMossDecorator.java b/net/minecraft/world/level/levelgen/feature/treedecorators/PaleMossDecorator.java
index 7bd0159..147f51b 100644
--- a/net/minecraft/world/level/levelgen/feature/treedecorators/PaleMossDecorator.java
+++ b/net/minecraft/world/level/levelgen/feature/treedecorators/PaleMossDecorator.java
@@ -12,7 +12,6 @@ import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.HangingMossBlock;
-import net.minecraft.world.level.block.MossyCarpetBlock;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.commons.lang3.mutable.MutableObject;
@@ -56,7 +55,7 @@ public class PaleMossDecorator extends TreeDecorator {
if (randomSource.nextFloat() < this.groundProbability) {
worldGenLevel.registryAccess()
.lookup(Registries.CONFIGURED_FEATURE)
- .flatMap(registry -> registry.get(VegetationFeatures.PALE_MOSS_PATCH_BONEMEAL))
+ .flatMap(registry -> registry.get(VegetationFeatures.PALE_MOSS_PATCH))
.ifPresent(
reference -> reference.value()
.place(worldGenLevel, worldGenLevel.getLevel().getChunkSource().getGenerator(), randomSource, blockPos.above())
@@ -70,13 +69,6 @@ public class PaleMossDecorator extends TreeDecorator {
addMossHanger(blockPos2, context);
}
}
-
- if (randomSource.nextFloat() < this.trunkProbability) {
- BlockPos blockPos2 = blockPos1.above();
- if (context.isAir(blockPos2)) {
- MossyCarpetBlock.placeAt((WorldGenLevel)context.level(), blockPos2, context.random(), 3);
- }
- }
});
context.leaves().forEach(blockPos1 -> {
if (randomSource.nextFloat() < this.leavesProbability) {
diff --git a/net/minecraft/world/level/levelgen/feature/trunkplacers/DarkOakTrunkPlacer.java b/net/minecraft/world/level/levelgen/feature/trunkplacers/DarkOakTrunkPlacer.java
index 2904fb3..d86f939 100644
--- a/net/minecraft/world/level/levelgen/feature/trunkplacers/DarkOakTrunkPlacer.java
+++ b/net/minecraft/world/level/levelgen/feature/trunkplacers/DarkOakTrunkPlacer.java
@@ -81,7 +81,7 @@ public class DarkOakTrunkPlacer extends TrunkPlacer {
this.placeLog(level, blockSetter, random, new BlockPos(x + i5, i4 - i8 - 1, z + i6), config);
}
- list.add(new FoliagePlacer.FoliageAttachment(new BlockPos(i2 + i5, i4, i3 + i6), 0, false));
+ list.add(new FoliagePlacer.FoliageAttachment(new BlockPos(x + i5, i4, z + i6), 0, false));
}
}
}
diff --git a/net/minecraft/world/level/levelgen/structure/Structure.java b/net/minecraft/world/level/levelgen/structure/Structure.java
index 604be24..584a103 100644
--- a/net/minecraft/world/level/levelgen/structure/Structure.java
+++ b/net/minecraft/world/level/levelgen/structure/Structure.java
@@ -19,10 +19,14 @@ import net.minecraft.core.RegistryCodecs;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.RegistryFileCodec;
+import net.minecraft.resources.ResourceKey;
import net.minecraft.util.RandomSource;
import net.minecraft.util.StringRepresentable;
+import net.minecraft.util.profiling.jfr.JvmProfiler;
+import net.minecraft.util.profiling.jfr.callback.ProfiledDuration;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.StructureManager;
import net.minecraft.world.level.WorldGenLevel;
@@ -77,29 +81,40 @@ public abstract class Structure {
}
public StructureStart generate(
+ Holder<Structure> holder,
+ ResourceKey<Level> resourceKey,
RegistryAccess registryAccess,
ChunkGenerator chunkGenerator,
BiomeSource biomeSource,
RandomState randomState,
StructureTemplateManager structureTemplateManager,
- long seed,
+ long l,
ChunkPos chunkPos,
- int references,
- LevelHeightAccessor heightAccessor,
- Predicate<Holder<Biome>> validBiome
+ int i,
+ LevelHeightAccessor levelHeightAccessor,
+ Predicate<Holder<Biome>> predicate
) {
+ ProfiledDuration profiledDuration = JvmProfiler.INSTANCE.onStructureGenerate(chunkPos, resourceKey, holder);
Structure.GenerationContext generationContext = new Structure.GenerationContext(
- registryAccess, chunkGenerator, biomeSource, randomState, structureTemplateManager, seed, chunkPos, heightAccessor, validBiome
+ registryAccess, chunkGenerator, biomeSource, randomState, structureTemplateManager, l, chunkPos, levelHeightAccessor, predicate
);
Optional<Structure.GenerationStub> optional = this.findValidGenerationPoint(generationContext);
if (optional.isPresent()) {
StructurePiecesBuilder piecesBuilder = optional.get().getPiecesBuilder();
- StructureStart structureStart = new StructureStart(this, chunkPos, references, piecesBuilder.build());
+ StructureStart structureStart = new StructureStart(this, chunkPos, i, piecesBuilder.build());
if (structureStart.isValid()) {
+ if (profiledDuration != null) {
+ profiledDuration.finish(true);
+ }
+
return structureStart;
}
}
+ if (profiledDuration != null) {
+ profiledDuration.finish(false);
+ }
+
return StructureStart.INVALID_START;
}
diff --git a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
index 9a7ad7f..b88e80e 100644
--- a/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
+++ b/net/minecraft/world/level/levelgen/structure/pools/JigsawPlacement.java
@@ -108,52 +108,70 @@ public class JigsawPlacement {
BoundingBox boundingBox = poolElementStructurePiece.getBoundingBox();
int i = (boundingBox.maxX() + boundingBox.minX()) / 2;
int i1 = (boundingBox.maxZ() + boundingBox.minZ()) / 2;
- int i2;
- if (projectStartToHeightmap.isPresent()) {
- i2 = pos.getY() + chunkGenerator.getFirstFreeHeight(i, i1, projectStartToHeightmap.get(), levelHeightAccessor, context.randomState());
- } else {
- i2 = blockPos1.getY();
- }
-
+ int i2 = projectStartToHeightmap.isEmpty()
+ ? blockPos1.getY()
+ : pos.getY() + chunkGenerator.getFirstFreeHeight(i, i1, projectStartToHeightmap.get(), levelHeightAccessor, context.randomState());
int i3 = boundingBox.minY() + poolElementStructurePiece.getGroundLevelDelta();
poolElementStructurePiece.move(0, i2 - i3, 0);
- int i4 = i2 + vec3i.getY();
- return Optional.of(
- new Structure.GenerationStub(
- new BlockPos(i, i4, i1),
- structurePiecesBuilder -> {
- List<PoolElementStructurePiece> list = Lists.newArrayList();
- list.add(poolElementStructurePiece);
- if (maxDepth > 0) {
- AABB aabb = new AABB(
- i - maxDistanceFromCenter,
- Math.max(i4 - maxDistanceFromCenter, levelHeightAccessor.getMinY() + dimensionPadding.bottom()),
- i1 - maxDistanceFromCenter,
- i + maxDistanceFromCenter + 1,
- Math.min(i4 + maxDistanceFromCenter + 1, levelHeightAccessor.getMaxY() + 1 - dimensionPadding.top()),
- i1 + maxDistanceFromCenter + 1
- );
- VoxelShape voxelShape = Shapes.join(Shapes.create(aabb), Shapes.create(AABB.of(boundingBox)), BooleanOp.ONLY_FIRST);
- addPieces(
- context.randomState(),
- maxDepth,
- useExpansionHack,
- chunkGenerator,
- structureTemplateManager,
- levelHeightAccessor,
- worldgenRandom,
- registry,
- poolElementStructurePiece,
- list,
- voxelShape,
- aliasLookup,
- liquidSettings
- );
- list.forEach(structurePiecesBuilder::addPiece);
+ if (isStartTooCloseToWorldHeightLimits(levelHeightAccessor, dimensionPadding, poolElementStructurePiece.getBoundingBox())) {
+ LOGGER.debug(
+ "Center piece {} with bounding box {} does not fit dimension padding {}",
+ randomTemplate,
+ poolElementStructurePiece.getBoundingBox(),
+ dimensionPadding
+ );
+ return Optional.empty();
+ } else {
+ int i4 = i2 + vec3i.getY();
+ return Optional.of(
+ new Structure.GenerationStub(
+ new BlockPos(i, i4, i1),
+ structurePiecesBuilder -> {
+ List<PoolElementStructurePiece> list = Lists.newArrayList();
+ list.add(poolElementStructurePiece);
+ if (maxDepth > 0) {
+ AABB aabb = new AABB(
+ i - maxDistanceFromCenter,
+ Math.max(i4 - maxDistanceFromCenter, levelHeightAccessor.getMinY() + dimensionPadding.bottom()),
+ i1 - maxDistanceFromCenter,
+ i + maxDistanceFromCenter + 1,
+ Math.min(i4 + maxDistanceFromCenter + 1, levelHeightAccessor.getMaxY() + 1 - dimensionPadding.top()),
+ i1 + maxDistanceFromCenter + 1
+ );
+ VoxelShape voxelShape = Shapes.join(Shapes.create(aabb), Shapes.create(AABB.of(boundingBox)), BooleanOp.ONLY_FIRST);
+ addPieces(
+ context.randomState(),
+ maxDepth,
+ useExpansionHack,
+ chunkGenerator,
+ structureTemplateManager,
+ levelHeightAccessor,
+ worldgenRandom,
+ registry,
+ poolElementStructurePiece,
+ list,
+ voxelShape,
+ aliasLookup,
+ liquidSettings
+ );
+ list.forEach(structurePiecesBuilder::addPiece);
+ }
}
- }
- )
- );
+ )
+ );
+ }
+ }
+ }
+
+ private static boolean isStartTooCloseToWorldHeightLimits(
+ LevelHeightAccessor levelHeightAccessor, DimensionPadding dimensionPadding, BoundingBox boundingBox
+ ) {
+ if (dimensionPadding == DimensionPadding.ZERO) {
+ return false;
+ } else {
+ int i = levelHeightAccessor.getMinY() + dimensionPadding.bottom();
+ int i1 = levelHeightAccessor.getMaxY() - dimensionPadding.top();
+ return boundingBox.minY() < i || boundingBox.maxY() > i1;
}
}
--
2.46.2