diff --git a/gradle.properties b/gradle.properties index b12f90482a..7517a26242 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=org.spongepowered -version=12.1.0-SNAPSHOT +version=13.0.0-SNAPSHOT organization=SpongePowered projectUrl=https://www.spongepowered.org projectDescription=A plugin API for Minecraft: Java Edition diff --git a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java index 17f5bd3989..5ab296e371 100644 --- a/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java +++ b/src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java @@ -94,7 +94,7 @@ public final class Triggers { public static final DefaultedRegistryReference> ITEM_USED_ON_BLOCK = Triggers.key(ResourceKey.minecraft("item_used_on_block")); - public static final DefaultedRegistryReference> KILLED_BY_CROSSBOW = Triggers.key(ResourceKey.minecraft("killed_by_crossbow")); + public static final DefaultedRegistryReference> KILLED_BY_ARROW = Triggers.key(ResourceKey.minecraft("killed_by_arrow")); public static final DefaultedRegistryReference> KILL_MOB_NEAR_SCULK_CATALYST = Triggers.key(ResourceKey.minecraft("kill_mob_near_sculk_catalyst")); diff --git a/src/main/java/org/spongepowered/api/block/BlockTypes.java b/src/main/java/org/spongepowered/api/block/BlockTypes.java index e41e0b38be..37e5b2b470 100644 --- a/src/main/java/org/spongepowered/api/block/BlockTypes.java +++ b/src/main/java/org/spongepowered/api/block/BlockTypes.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.block; +import org.jetbrains.annotations.ApiStatus; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.registry.DefaultedRegistryReference; @@ -32,6 +33,7 @@ import org.spongepowered.api.registry.RegistryScope; import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; +import org.spongepowered.api.util.annotation.Experimental; /** * @@ -496,6 +498,10 @@ public final class BlockTypes { public static final DefaultedRegistryReference CRAFTING_TABLE = BlockTypes.key(ResourceKey.minecraft("crafting_table")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference CREAKING_HEART = BlockTypes.key(ResourceKey.minecraft("creaking_heart")); + public static final DefaultedRegistryReference CREEPER_HEAD = BlockTypes.key(ResourceKey.minecraft("creeper_head")); public static final DefaultedRegistryReference CREEPER_WALL_HEAD = BlockTypes.key(ResourceKey.minecraft("creeper_wall_head")); @@ -1336,6 +1342,86 @@ public final class BlockTypes { public static final DefaultedRegistryReference PACKED_MUD = BlockTypes.key(ResourceKey.minecraft("packed_mud")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_HANGING_MOSS = BlockTypes.key(ResourceKey.minecraft("pale_hanging_moss")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_MOSS_BLOCK = BlockTypes.key(ResourceKey.minecraft("pale_moss_block")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_MOSS_CARPET = BlockTypes.key(ResourceKey.minecraft("pale_moss_carpet")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_BUTTON = BlockTypes.key(ResourceKey.minecraft("pale_oak_button")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_DOOR = BlockTypes.key(ResourceKey.minecraft("pale_oak_door")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_FENCE = BlockTypes.key(ResourceKey.minecraft("pale_oak_fence")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("pale_oak_fence_gate")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_hanging_sign")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_LEAVES = BlockTypes.key(ResourceKey.minecraft("pale_oak_leaves")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_LOG = BlockTypes.key(ResourceKey.minecraft("pale_oak_log")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_PLANKS = BlockTypes.key(ResourceKey.minecraft("pale_oak_planks")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_PRESSURE_PLATE = BlockTypes.key(ResourceKey.minecraft("pale_oak_pressure_plate")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_SAPLING = BlockTypes.key(ResourceKey.minecraft("pale_oak_sapling")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_sign")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_SLAB = BlockTypes.key(ResourceKey.minecraft("pale_oak_slab")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_STAIRS = BlockTypes.key(ResourceKey.minecraft("pale_oak_stairs")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("pale_oak_trapdoor")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_wall_hanging_sign")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_wall_sign")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_WOOD = BlockTypes.key(ResourceKey.minecraft("pale_oak_wood")); + public static final DefaultedRegistryReference PEARLESCENT_FROGLIGHT = BlockTypes.key(ResourceKey.minecraft("pearlescent_froglight")); public static final DefaultedRegistryReference PEONY = BlockTypes.key(ResourceKey.minecraft("peony")); @@ -1502,6 +1588,10 @@ public final class BlockTypes { public static final DefaultedRegistryReference POTTED_OXEYE_DAISY = BlockTypes.key(ResourceKey.minecraft("potted_oxeye_daisy")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference POTTED_PALE_OAK_SAPLING = BlockTypes.key(ResourceKey.minecraft("potted_pale_oak_sapling")); + public static final DefaultedRegistryReference POTTED_PINK_TULIP = BlockTypes.key(ResourceKey.minecraft("potted_pink_tulip")); public static final DefaultedRegistryReference POTTED_POPPY = BlockTypes.key(ResourceKey.minecraft("potted_poppy")); @@ -1864,6 +1954,14 @@ public final class BlockTypes { public static final DefaultedRegistryReference STRIPPED_OAK_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_oak_wood")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference STRIPPED_PALE_OAK_LOG = BlockTypes.key(ResourceKey.minecraft("stripped_pale_oak_log")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference STRIPPED_PALE_OAK_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_pale_oak_wood")); + public static final DefaultedRegistryReference STRIPPED_SPRUCE_LOG = BlockTypes.key(ResourceKey.minecraft("stripped_spruce_log")); public static final DefaultedRegistryReference STRIPPED_SPRUCE_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_spruce_wood")); diff --git a/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java b/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java index 610f4eef81..073f16c7de 100644 --- a/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java +++ b/src/main/java/org/spongepowered/api/block/entity/BlockEntityTypes.java @@ -74,6 +74,8 @@ public final class BlockEntityTypes { public static final DefaultedRegistryReference CRAFTER = BlockEntityTypes.key(ResourceKey.minecraft("crafter")); + public static final DefaultedRegistryReference CREAKING_HEART = BlockEntityTypes.key(ResourceKey.minecraft("creaking_heart")); + public static final DefaultedRegistryReference DAYLIGHT_DETECTOR = BlockEntityTypes.key(ResourceKey.minecraft("daylight_detector")); public static final DefaultedRegistryReference DECORATED_POT = BlockEntityTypes.key(ResourceKey.minecraft("decorated_pot")); diff --git a/src/main/java/org/spongepowered/api/block/entity/CreakingHeart.java b/src/main/java/org/spongepowered/api/block/entity/CreakingHeart.java new file mode 100644 index 0000000000..98a981ddde --- /dev/null +++ b/src/main/java/org/spongepowered/api/block/entity/CreakingHeart.java @@ -0,0 +1,39 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.block.entity; + +import org.jetbrains.annotations.ApiStatus; +import org.spongepowered.api.util.annotation.Experimental; + +/** + * Represents a CreakingHeart block entity. + * + * @see Creaking Heart + */ +@Experimental("winter_drop") +@ApiStatus.Experimental +public interface CreakingHeart extends BlockEntity { + +} diff --git a/src/main/java/org/spongepowered/api/data/BlockStateKeys.java b/src/main/java/org/spongepowered/api/data/BlockStateKeys.java index 32c50669fa..b0a396239c 100644 --- a/src/main/java/org/spongepowered/api/data/BlockStateKeys.java +++ b/src/main/java/org/spongepowered/api/data/BlockStateKeys.java @@ -30,6 +30,7 @@ import org.spongepowered.api.data.type.BellAttachmentType; import org.spongepowered.api.data.type.ChestAttachmentType; import org.spongepowered.api.data.type.ComparatorMode; +import org.spongepowered.api.data.type.CreakingHeart; import org.spongepowered.api.data.type.DoorHinge; import org.spongepowered.api.data.type.DripstoneSegment; import org.spongepowered.api.data.type.InstrumentType; @@ -116,6 +117,8 @@ public final class BlockStateKeys { public static final Key> CRAFTING = BlockStateKeys.key(ResourceKey.minecraft("property/crafting"), Boolean.class); + public static final Key> CREAKING = BlockStateKeys.key(ResourceKey.minecraft("property/creaking"), CreakingHeart.class); + public static final Key> DELAY = BlockStateKeys.key(ResourceKey.minecraft("property/delay"), Integer.class); public static final Key> DISARMED = BlockStateKeys.key(ResourceKey.minecraft("property/disarmed"), Boolean.class); @@ -264,6 +267,8 @@ public final class BlockStateKeys { public static final Key> TILT = BlockStateKeys.key(ResourceKey.minecraft("property/tilt"), Tilt.class); + public static final Key> TIP = BlockStateKeys.key(ResourceKey.minecraft("property/tip"), Boolean.class); + public static final Key> TRIAL_SPAWNER_STATE = BlockStateKeys.key(ResourceKey.minecraft("property/trial_spawner_state"), TrialSpawnerState.class); public static final Key> TRIGGERED = BlockStateKeys.key(ResourceKey.minecraft("property/triggered"), Boolean.class); diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index cc9a70bc0a..9a8e751fc0 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -34,6 +34,7 @@ import org.spongepowered.api.block.entity.Banner; import org.spongepowered.api.block.entity.BlockEntity; import org.spongepowered.api.block.entity.CommandBlock; +import org.spongepowered.api.block.entity.CreakingHeart; import org.spongepowered.api.block.entity.EndGateway; import org.spongepowered.api.block.entity.Jukebox; import org.spongepowered.api.block.entity.Lectern; @@ -99,6 +100,7 @@ import org.spongepowered.api.data.value.MapValue; import org.spongepowered.api.data.value.SetValue; import org.spongepowered.api.data.value.Value; +import org.spongepowered.api.data.value.ValueContainer; import org.spongepowered.api.data.value.WeightedCollectionValue; import org.spongepowered.api.effect.VanishState; import org.spongepowered.api.effect.particle.ParticleEffect; @@ -163,6 +165,7 @@ import org.spongepowered.api.entity.living.golem.IronGolem; import org.spongepowered.api.entity.living.golem.Shulker; import org.spongepowered.api.entity.living.monster.Blaze; +import org.spongepowered.api.entity.living.monster.Creaking; import org.spongepowered.api.entity.living.monster.Creeper; import org.spongepowered.api.entity.living.monster.Enderman; import org.spongepowered.api.entity.living.monster.Endermite; @@ -183,6 +186,7 @@ import org.spongepowered.api.entity.living.monster.spider.Spider; import org.spongepowered.api.entity.living.monster.zombie.ZombieVillager; import org.spongepowered.api.entity.living.monster.zombie.ZombifiedPiglin; +import org.spongepowered.api.entity.living.player.CooldownTracker; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.entity.living.player.User; import org.spongepowered.api.entity.living.player.chat.ChatVisibility; @@ -208,6 +212,7 @@ import org.spongepowered.api.entity.vehicle.minecart.Minecart; import org.spongepowered.api.entity.vehicle.minecart.MinecartLike; import org.spongepowered.api.entity.weather.LightningBolt; +import org.spongepowered.api.event.cause.entity.damage.source.DamageSource; import org.spongepowered.api.event.cause.entity.damage.source.DamageSources; import org.spongepowered.api.fluid.FluidStackSnapshot; import org.spongepowered.api.fluid.FluidTypes; @@ -220,6 +225,7 @@ import org.spongepowered.api.item.enchantment.EnchantmentTypes; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.api.item.inventory.ItemStack; +import org.spongepowered.api.item.inventory.ItemStackLike; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.Slot; import org.spongepowered.api.item.inventory.equipment.EquipmentType; @@ -236,6 +242,7 @@ import org.spongepowered.api.projectile.source.ProjectileSource; import org.spongepowered.api.raid.Raid; import org.spongepowered.api.raid.RaidWave; +import org.spongepowered.api.registry.DefaultedRegistryType; import org.spongepowered.api.statistic.Statistic; import org.spongepowered.api.tag.Tag; import org.spongepowered.api.util.Axis; @@ -265,7 +272,6 @@ import org.spongepowered.api.world.explosion.Explosion; import org.spongepowered.api.world.generation.ChunkGenerator; import org.spongepowered.api.world.generation.carver.Carver; -import org.spongepowered.api.world.generation.carver.CarvingStep; import org.spongepowered.api.world.generation.config.WorldGenerationConfig; import org.spongepowered.api.world.generation.feature.DecorationStep; import org.spongepowered.api.world.generation.feature.PlacedFeature; @@ -656,7 +662,7 @@ public final class Keys { * The carvers of a {@link Biome} used during world generation. * Readonly */ - public static final Key>> CARVERS = Keys.mapKey(ResourceKey.sponge("carvers"), TypeToken.get(CarvingStep.class), new TypeToken>() {}); + public static final Key> CARVERS = Keys.listKey(ResourceKey.sponge("carvers"), Carver.class); /** * The current casting time of a {@link Spellcaster}. @@ -750,9 +756,24 @@ public final class Keys { * The amount of ticks a {@link EndGateway} has to wait for the next teleportation. * or * The amount of ticks a {@link Crafter} has to wait for the next craft. + * or + * The amount of ticks an {@link ItemStack} has to wait before being used again, primarily in conjunction + * with {@link #COOLDOWN_GROUP} in a joined {@link ValueContainer} to be offered as a custom cooldown. Using + * a {@link DataManipulator#mutableOf( Iterable)} to set this value using {@link Value#mutableOf( Key, Object)} + * to join together a group is ideal. */ public static final Key> COOLDOWN = Keys.key(ResourceKey.sponge("cooldown"), Ticks.class); + /** + * The {@link ResourceKey group} of an {@link ItemStackLike ItemStack} that would apply a + * cooldown to the item when used. Note that this affects the {@link CooldownTracker} when + * a {@link Player} uses the item. Can be used in tandem with the {@link #COOLDOWN} key + * to apply a cooldown to said group. A group will differentiate a cooldown from the default + * {@link ItemStackLike ItemStack} cooldown based on the + * {@link ItemType#key(DefaultedRegistryType) ResourceKey}. + */ + public static final Key> COOLDOWN_GROUP = Keys.key(ResourceKey.sponge("cooldown_group"), ResourceKey.class); + /** * The coordinate scale of a {@link WorldType} applied to the coordinates of a {@link ServerPlayer player} * when traveling in between {@link ServerWorld worlds}. @@ -764,6 +785,22 @@ public final class Keys { */ public static final Key> COORDINATE_MULTIPLIER = Keys.key(ResourceKey.sponge("coordinate_multiplier"), Double.class); + /** + * The coordinates of where a {@link Creaking} has + * it's bonded {@link CreakingHeart home} set to. Can be + * overridden. + * + * When a {@link Creaking} is spawned, it can + * be considered linked to a heart or not. + */ + public static final Key> CREAKING_HOME_POSITION = Keys.key(ResourceKey.sponge("creaking_home_position"), Vector3i.class); + + /** + * Marks whether a {@link Creaking} is considered transient. When transient, it may be + * invulnerable to most all {@link DamageSource}s. Note that this is not mutable. + */ + public static final Key> CREAKING_IS_LINKED = Keys.key(ResourceKey.sponge("creaking_transient"), Boolean.class); + /** * Overrides whether a {@link WorldType} allows the {@link EnderDragon dragon} fight mechanic to spawn. *

By default, the dragon only spawns in the {@link DefaultWorldKeys#THE_END} world with {@link WorldTypes#THE_END} world type.

@@ -1021,7 +1058,7 @@ public final class Keys { * determined randomly at the time of the explosion or computed from the * context in which the {@link Explosive} explodes.

*/ - public static final Key> EXPLOSION_RADIUS = Keys.key(ResourceKey.sponge("explosion_radius"), Integer.class); + public static final Key> EXPLOSION_RADIUS = Keys.key(ResourceKey.sponge("explosion_radius"), Float.class); /** * The eye height of an {@link Entity}. diff --git a/src/main/java/org/spongepowered/api/data/type/ArmorMaterial.java b/src/main/java/org/spongepowered/api/data/type/ArmorMaterial.java index cdcc6cfa1a..c59de8bfcc 100644 --- a/src/main/java/org/spongepowered/api/data/type/ArmorMaterial.java +++ b/src/main/java/org/spongepowered/api/data/type/ArmorMaterial.java @@ -26,11 +26,11 @@ import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.ItemTypes; -import org.spongepowered.api.item.recipe.crafting.Ingredient; +import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.registry.DefaultedRegistryValue; import org.spongepowered.api.util.annotation.CatalogedBy; -import java.util.Optional; +import java.util.function.Predicate; /** * Represents a type of "armor", usually applicable to any @@ -40,11 +40,10 @@ public interface ArmorMaterial extends DefaultedRegistryValue { /** - * Gets the {@link ItemType} that can be used to - * "repair" the armor type. + * Gets the {@link ItemType} that can be used to "repair" the armor type. * * @return The item type considered to be used for repairing */ - Optional repairIngredient(); + Predicate repairIngredient(); } diff --git a/src/main/java/org/spongepowered/api/data/type/BoatType.java b/src/main/java/org/spongepowered/api/data/type/BoatType.java index bece42a412..4ad6140ffa 100644 --- a/src/main/java/org/spongepowered/api/data/type/BoatType.java +++ b/src/main/java/org/spongepowered/api/data/type/BoatType.java @@ -24,12 +24,10 @@ */ package org.spongepowered.api.data.type; -import org.spongepowered.api.block.BlockType; import org.spongepowered.api.registry.DefaultedRegistryValue; import org.spongepowered.api.util.annotation.CatalogedBy; @CatalogedBy(BoatTypes.class) public interface BoatType extends DefaultedRegistryValue { - BlockType representedBlock(); } diff --git a/src/main/java/org/spongepowered/api/data/type/CreakingHeart.java b/src/main/java/org/spongepowered/api/data/type/CreakingHeart.java new file mode 100644 index 0000000000..2bd3daa8f2 --- /dev/null +++ b/src/main/java/org/spongepowered/api/data/type/CreakingHeart.java @@ -0,0 +1,35 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.data.type; + +import org.spongepowered.api.registry.DefaultedRegistryValue; +import org.spongepowered.api.registry.RegistryScope; +import org.spongepowered.api.registry.RegistryScopes; +import org.spongepowered.api.util.annotation.CatalogedBy; + +@RegistryScopes(scopes = RegistryScope.GAME) +@CatalogedBy(CreakingHearts.class) +public interface CreakingHeart extends Comparable, StringRepresentable, DefaultedRegistryValue { +} diff --git a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java b/src/main/java/org/spongepowered/api/data/type/CreakingHearts.java similarity index 61% rename from src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java rename to src/main/java/org/spongepowered/api/data/type/CreakingHearts.java index e2707fe9d2..88eeb4cc33 100644 --- a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java +++ b/src/main/java/org/spongepowered/api/data/type/CreakingHearts.java @@ -22,36 +22,23 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.world.generation.carver; +package org.spongepowered.api.data.type; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.registry.DefaultedRegistryReference; -import org.spongepowered.api.registry.Registry; import org.spongepowered.api.registry.RegistryKey; -import org.spongepowered.api.registry.RegistryScope; -import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; -@SuppressWarnings("unused") -@RegistryScopes(scopes = RegistryScope.GAME) -public final class CarvingSteps { - // @formatter:off +public final class CreakingHearts { - public static final DefaultedRegistryReference AIR = CarvingSteps.key(ResourceKey.sponge("air")); + public static final DefaultedRegistryReference ACTIVE = CreakingHearts.key(ResourceKey.sponge("active")); - public static final DefaultedRegistryReference LIQUID = CarvingSteps.key(ResourceKey.sponge("liquid")); + public static final DefaultedRegistryReference DISABLED = CreakingHearts.key(ResourceKey.sponge("disabled")); - // @formatter:on + public static final DefaultedRegistryReference DORMANT = CreakingHearts.key(ResourceKey.sponge("dormant")); - private CarvingSteps() { - } - - public static Registry registry() { - return Sponge.game().registry(RegistryTypes.CARVING_STEP); - } - - private static DefaultedRegistryReference key(final ResourceKey location) { - return RegistryKey.of(RegistryTypes.CARVING_STEP, location).asDefaultedReference(Sponge::game); + private static DefaultedRegistryReference key(final ResourceKey location) { + return RegistryKey.of(RegistryTypes.CREAKING_HEART, location).asDefaultedReference(Sponge::game); } } diff --git a/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java b/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java index 06fa3d1930..524ea27a09 100644 --- a/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java +++ b/src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java @@ -46,6 +46,8 @@ public final class ParticleTypes { public static final DefaultedRegistryReference BLOCK = ParticleTypes.key(ResourceKey.minecraft("block")); + public static final DefaultedRegistryReference BLOCK_CRUMBLE = ParticleTypes.key(ResourceKey.minecraft("block_crumble")); + public static final DefaultedRegistryReference BLOCK_MARKER = ParticleTypes.key(ResourceKey.minecraft("block_marker")); public static final DefaultedRegistryReference BUBBLE = ParticleTypes.key(ResourceKey.minecraft("bubble")); @@ -234,6 +236,8 @@ public final class ParticleTypes { public static final DefaultedRegistryReference TOTEM_OF_UNDYING = ParticleTypes.key(ResourceKey.minecraft("totem_of_undying")); + public static final DefaultedRegistryReference TRAIL = ParticleTypes.key(ResourceKey.minecraft("trail")); + public static final DefaultedRegistryReference TRIAL_OMEN = ParticleTypes.key(ResourceKey.minecraft("trial_omen")); public static final DefaultedRegistryReference TRIAL_SPAWNER_DETECTION = ParticleTypes.key(ResourceKey.minecraft("trial_spawner_detection")); diff --git a/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java b/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java index b9576c0054..e25a68d898 100644 --- a/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java +++ b/src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java @@ -508,6 +508,22 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_CRAFTER_FAIL = SoundTypes.key(ResourceKey.minecraft("block.crafter.fail")); + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_BREAK = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.break")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_FALL = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.fall")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_HIT = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.hit")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_HURT = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.hurt")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_IDLE = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.idle")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_PLACE = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.place")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_SPAWN = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.spawn")); + + public static final DefaultedRegistryReference BLOCK_CREAKING_HEART_STEP = SoundTypes.key(ResourceKey.minecraft("block.creaking_heart.step")); + public static final DefaultedRegistryReference BLOCK_CROP_BREAK = SoundTypes.key(ResourceKey.minecraft("block.crop.break")); public static final DefaultedRegistryReference BLOCK_DECORATED_POT_BREAK = SoundTypes.key(ResourceKey.minecraft("block.decorated_pot.break")); @@ -1020,6 +1036,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_PACKED_MUD_STEP = SoundTypes.key(ResourceKey.minecraft("block.packed_mud.step")); + public static final DefaultedRegistryReference BLOCK_PALE_HANGING_MOSS_IDLE = SoundTypes.key(ResourceKey.minecraft("block.pale_hanging_moss.idle")); + public static final DefaultedRegistryReference BLOCK_PINK_PETALS_BREAK = SoundTypes.key(ResourceKey.minecraft("block.pink_petals.break")); public static final DefaultedRegistryReference BLOCK_PINK_PETALS_FALL = SoundTypes.key(ResourceKey.minecraft("block.pink_petals.fall")); @@ -1284,6 +1302,16 @@ public final class SoundTypes { public static final DefaultedRegistryReference BLOCK_SOUL_SOIL_STEP = SoundTypes.key(ResourceKey.minecraft("block.soul_soil.step")); + public static final DefaultedRegistryReference BLOCK_SPAWNER_BREAK = SoundTypes.key(ResourceKey.minecraft("block.spawner.break")); + + public static final DefaultedRegistryReference BLOCK_SPAWNER_FALL = SoundTypes.key(ResourceKey.minecraft("block.spawner.fall")); + + public static final DefaultedRegistryReference BLOCK_SPAWNER_HIT = SoundTypes.key(ResourceKey.minecraft("block.spawner.hit")); + + public static final DefaultedRegistryReference BLOCK_SPAWNER_PLACE = SoundTypes.key(ResourceKey.minecraft("block.spawner.place")); + + public static final DefaultedRegistryReference BLOCK_SPAWNER_STEP = SoundTypes.key(ResourceKey.minecraft("block.spawner.step")); + public static final DefaultedRegistryReference BLOCK_SPONGE_ABSORB = SoundTypes.key(ResourceKey.minecraft("block.sponge.absorb")); public static final DefaultedRegistryReference BLOCK_SPONGE_BREAK = SoundTypes.key(ResourceKey.minecraft("block.sponge.break")); @@ -1748,6 +1776,26 @@ public final class SoundTypes { public static final DefaultedRegistryReference ENTITY_COW_STEP = SoundTypes.key(ResourceKey.minecraft("entity.cow.step")); + public static final DefaultedRegistryReference ENTITY_CREAKING_ACTIVATE = SoundTypes.key(ResourceKey.minecraft("entity.creaking.activate")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_AMBIENT = SoundTypes.key(ResourceKey.minecraft("entity.creaking.ambient")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_ATTACK = SoundTypes.key(ResourceKey.minecraft("entity.creaking.attack")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_DEACTIVATE = SoundTypes.key(ResourceKey.minecraft("entity.creaking.deactivate")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_DEATH = SoundTypes.key(ResourceKey.minecraft("entity.creaking.death")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_FREEZE = SoundTypes.key(ResourceKey.minecraft("entity.creaking.freeze")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_SPAWN = SoundTypes.key(ResourceKey.minecraft("entity.creaking.spawn")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_STEP = SoundTypes.key(ResourceKey.minecraft("entity.creaking.step")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_SWAY = SoundTypes.key(ResourceKey.minecraft("entity.creaking.sway")); + + public static final DefaultedRegistryReference ENTITY_CREAKING_UNFREEZE = SoundTypes.key(ResourceKey.minecraft("entity.creaking.unfreeze")); + public static final DefaultedRegistryReference ENTITY_CREEPER_DEATH = SoundTypes.key(ResourceKey.minecraft("entity.creeper.death")); public static final DefaultedRegistryReference ENTITY_CREEPER_HURT = SoundTypes.key(ResourceKey.minecraft("entity.creeper.hurt")); @@ -2024,8 +2072,6 @@ public final class SoundTypes { public static final DefaultedRegistryReference ENTITY_GOAT_SCREAMING_EAT = SoundTypes.key(ResourceKey.minecraft("entity.goat.screaming.eat")); - public static final DefaultedRegistryReference ENTITY_GOAT_SCREAMING_HORN_BREAK = SoundTypes.key(ResourceKey.minecraft("entity.goat.screaming.horn_break")); - public static final DefaultedRegistryReference ENTITY_GOAT_SCREAMING_HURT = SoundTypes.key(ResourceKey.minecraft("entity.goat.screaming.hurt")); public static final DefaultedRegistryReference ENTITY_GOAT_SCREAMING_LONG_JUMP = SoundTypes.key(ResourceKey.minecraft("entity.goat.screaming.long_jump")); @@ -2278,6 +2324,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference ENTITY_PARROT_IMITATE_BREEZE = SoundTypes.key(ResourceKey.minecraft("entity.parrot.imitate.breeze")); + public static final DefaultedRegistryReference ENTITY_PARROT_IMITATE_CREAKING = SoundTypes.key(ResourceKey.minecraft("entity.parrot.imitate.creaking")); + public static final DefaultedRegistryReference ENTITY_PARROT_IMITATE_CREEPER = SoundTypes.key(ResourceKey.minecraft("entity.parrot.imitate.creeper")); public static final DefaultedRegistryReference ENTITY_PARROT_IMITATE_DROWNED = SoundTypes.key(ResourceKey.minecraft("entity.parrot.imitate.drowned")); @@ -3032,6 +3080,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference ITEM_BUNDLE_INSERT = SoundTypes.key(ResourceKey.minecraft("item.bundle.insert")); + public static final DefaultedRegistryReference ITEM_BUNDLE_INSERT_FAIL = SoundTypes.key(ResourceKey.minecraft("item.bundle.insert_fail")); + public static final DefaultedRegistryReference ITEM_BUNDLE_REMOVE_ONE = SoundTypes.key(ResourceKey.minecraft("item.bundle.remove_one")); public static final DefaultedRegistryReference ITEM_CHORUS_FRUIT_TELEPORT = SoundTypes.key(ResourceKey.minecraft("item.chorus_fruit.teleport")); @@ -3064,8 +3114,6 @@ public final class SoundTypes { public static final DefaultedRegistryReference ITEM_GLOW_INK_SAC_USE = SoundTypes.key(ResourceKey.minecraft("item.glow_ink_sac.use")); - public static final DefaultedRegistryReference ITEM_GOAT_HORN_PLAY = SoundTypes.key(ResourceKey.minecraft("item.goat_horn.play")); - public static final DefaultedRegistryReference ITEM_GOAT_HORN_SOUND_0 = SoundTypes.key(ResourceKey.minecraft("item.goat_horn.sound.0")); public static final DefaultedRegistryReference ITEM_GOAT_HORN_SOUND_1 = SoundTypes.key(ResourceKey.minecraft("item.goat_horn.sound.1")); @@ -3244,6 +3292,8 @@ public final class SoundTypes { public static final DefaultedRegistryReference UI_CARTOGRAPHY_TABLE_TAKE_RESULT = SoundTypes.key(ResourceKey.minecraft("ui.cartography_table.take_result")); + public static final DefaultedRegistryReference UI_HUD_BUBBLE_POP = SoundTypes.key(ResourceKey.minecraft("ui.hud.bubble_pop")); + public static final DefaultedRegistryReference UI_LOOM_SELECT_PATTERN = SoundTypes.key(ResourceKey.minecraft("ui.loom.select_pattern")); public static final DefaultedRegistryReference UI_LOOM_TAKE_RESULT = SoundTypes.key(ResourceKey.minecraft("ui.loom.take_result")); diff --git a/src/main/java/org/spongepowered/api/entity/Entity.java b/src/main/java/org/spongepowered/api/entity/Entity.java index 2f39680f34..10f3250a41 100644 --- a/src/main/java/org/spongepowered/api/entity/Entity.java +++ b/src/main/java/org/spongepowered/api/entity/Entity.java @@ -292,6 +292,10 @@ default boolean damage(final double damage, final Supplier> ACACIA_BOAT = EntityTypes.key(ResourceKey.minecraft("acacia_boat")); + + public static final DefaultedRegistryReference> ACACIA_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("acacia_chest_boat")); + public static final DefaultedRegistryReference> ALLAY = EntityTypes.key(ResourceKey.minecraft("allay")); public static final DefaultedRegistryReference> AREA_EFFECT_CLOUD = EntityTypes.key(ResourceKey.minecraft("area_effect_cloud")); @@ -176,16 +182,22 @@ public final class EntityTypes { public static final DefaultedRegistryReference> AXOLOTL = EntityTypes.key(ResourceKey.minecraft("axolotl")); + public static final DefaultedRegistryReference> BAMBOO_CHEST_RAFT = EntityTypes.key(ResourceKey.minecraft("bamboo_chest_raft")); + + public static final DefaultedRegistryReference> BAMBOO_RAFT = EntityTypes.key(ResourceKey.minecraft("bamboo_raft")); + public static final DefaultedRegistryReference> BAT = EntityTypes.key(ResourceKey.minecraft("bat")); public static final DefaultedRegistryReference> BEE = EntityTypes.key(ResourceKey.minecraft("bee")); + public static final DefaultedRegistryReference> BIRCH_BOAT = EntityTypes.key(ResourceKey.minecraft("birch_boat")); + + public static final DefaultedRegistryReference> BIRCH_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("birch_chest_boat")); + public static final DefaultedRegistryReference> BLAZE = EntityTypes.key(ResourceKey.minecraft("blaze")); public static final DefaultedRegistryReference> BLOCK_DISPLAY = EntityTypes.key(ResourceKey.minecraft("block_display")); - public static final DefaultedRegistryReference> BOAT = EntityTypes.key(ResourceKey.minecraft("boat")); - public static final DefaultedRegistryReference> BOGGED = EntityTypes.key(ResourceKey.minecraft("bogged")); public static final DefaultedRegistryReference> BREEZE = EntityTypes.key(ResourceKey.minecraft("breeze")); @@ -198,7 +210,9 @@ public final class EntityTypes { public static final DefaultedRegistryReference> CAVE_SPIDER = EntityTypes.key(ResourceKey.minecraft("cave_spider")); - public static final DefaultedRegistryReference> CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("chest_boat")); + public static final DefaultedRegistryReference> CHERRY_BOAT = EntityTypes.key(ResourceKey.minecraft("cherry_boat")); + + public static final DefaultedRegistryReference> CHERRY_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("cherry_chest_boat")); public static final DefaultedRegistryReference> CHEST_MINECART = EntityTypes.key(ResourceKey.minecraft("chest_minecart")); @@ -210,8 +224,16 @@ public final class EntityTypes { public static final DefaultedRegistryReference> COW = EntityTypes.key(ResourceKey.minecraft("cow")); + public static final DefaultedRegistryReference> CREAKING = EntityTypes.key(ResourceKey.minecraft("creaking")); + + public static final DefaultedRegistryReference> CREAKING_TRANSIENT = EntityTypes.key(ResourceKey.minecraft("creaking_transient")); + public static final DefaultedRegistryReference> CREEPER = EntityTypes.key(ResourceKey.minecraft("creeper")); + public static final DefaultedRegistryReference> DARK_OAK_BOAT = EntityTypes.key(ResourceKey.minecraft("dark_oak_boat")); + + public static final DefaultedRegistryReference> DARK_OAK_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("dark_oak_chest_boat")); + public static final DefaultedRegistryReference> DOLPHIN = EntityTypes.key(ResourceKey.minecraft("dolphin")); public static final DefaultedRegistryReference> DONKEY = EntityTypes.key(ResourceKey.minecraft("donkey")); @@ -292,6 +314,10 @@ public final class EntityTypes { public static final DefaultedRegistryReference> ITEM_FRAME = EntityTypes.key(ResourceKey.minecraft("item_frame")); + public static final DefaultedRegistryReference> JUNGLE_BOAT = EntityTypes.key(ResourceKey.minecraft("jungle_boat")); + + public static final DefaultedRegistryReference> JUNGLE_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("jungle_chest_boat")); + public static final DefaultedRegistryReference> LEASH_KNOT = EntityTypes.key(ResourceKey.minecraft("leash_knot")); public static final DefaultedRegistryReference> LIGHTNING_BOLT = EntityTypes.key(ResourceKey.minecraft("lightning_bolt")); @@ -302,6 +328,10 @@ public final class EntityTypes { public static final DefaultedRegistryReference> MAGMA_CUBE = EntityTypes.key(ResourceKey.minecraft("magma_cube")); + public static final DefaultedRegistryReference> MANGROVE_BOAT = EntityTypes.key(ResourceKey.minecraft("mangrove_boat")); + + public static final DefaultedRegistryReference> MANGROVE_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("mangrove_chest_boat")); + public static final DefaultedRegistryReference> MARKER = EntityTypes.key(ResourceKey.minecraft("marker")); public static final DefaultedRegistryReference> MINECART = EntityTypes.key(ResourceKey.minecraft("minecart")); @@ -310,12 +340,20 @@ public final class EntityTypes { public static final DefaultedRegistryReference> MULE = EntityTypes.key(ResourceKey.minecraft("mule")); + public static final DefaultedRegistryReference> OAK_BOAT = EntityTypes.key(ResourceKey.minecraft("oak_boat")); + + public static final DefaultedRegistryReference> OAK_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("oak_chest_boat")); + public static final DefaultedRegistryReference> OCELOT = EntityTypes.key(ResourceKey.minecraft("ocelot")); public static final DefaultedRegistryReference> OMINOUS_ITEM_SPAWNER = EntityTypes.key(ResourceKey.minecraft("ominous_item_spawner")); public static final DefaultedRegistryReference> PAINTING = EntityTypes.key(ResourceKey.minecraft("painting")); + public static final DefaultedRegistryReference> PALE_OAK_BOAT = EntityTypes.key(ResourceKey.minecraft("pale_oak_boat")); + + public static final DefaultedRegistryReference> PALE_OAK_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("pale_oak_chest_boat")); + public static final DefaultedRegistryReference> PANDA = EntityTypes.key(ResourceKey.minecraft("panda")); public static final DefaultedRegistryReference> PARROT = EntityTypes.key(ResourceKey.minecraft("parrot")); @@ -372,6 +410,10 @@ public final class EntityTypes { public static final DefaultedRegistryReference> SPIDER = EntityTypes.key(ResourceKey.minecraft("spider")); + public static final DefaultedRegistryReference> SPRUCE_BOAT = EntityTypes.key(ResourceKey.minecraft("spruce_boat")); + + public static final DefaultedRegistryReference> SPRUCE_CHEST_BOAT = EntityTypes.key(ResourceKey.minecraft("spruce_chest_boat")); + public static final DefaultedRegistryReference> SQUID = EntityTypes.key(ResourceKey.minecraft("squid")); public static final DefaultedRegistryReference> STRAY = EntityTypes.key(ResourceKey.minecraft("stray")); diff --git a/src/main/java/org/spongepowered/api/entity/ai/goal/builtin/creature/AvoidLivingGoal.java b/src/main/java/org/spongepowered/api/entity/ai/goal/builtin/creature/AvoidLivingGoal.java index fee7413384..d3ed6ace73 100644 --- a/src/main/java/org/spongepowered/api/entity/ai/goal/builtin/creature/AvoidLivingGoal.java +++ b/src/main/java/org/spongepowered/api/entity/ai/goal/builtin/creature/AvoidLivingGoal.java @@ -30,7 +30,9 @@ import org.spongepowered.api.entity.living.Agent; import org.spongepowered.api.entity.living.Living; import org.spongepowered.api.entity.living.PathfinderAgent; +import org.spongepowered.api.world.server.ServerWorld; +import java.util.function.BiPredicate; import java.util.function.Predicate; public interface AvoidLivingGoal extends Goal { @@ -52,7 +54,7 @@ static Builder builder() { * * @return The predicate used to filter which entities to avoid */ - Predicate targetSelector(); + BiPredicate targetSelector(); /** * Sets the {@link Predicate} for filtering which {@link Living} instances @@ -61,7 +63,11 @@ static Builder builder() { * @param predicate The predicate * @return This task, for chaining */ - AvoidLivingGoal setTargetSelector(Predicate predicate); + default AvoidLivingGoal setTargetSelector(Predicate predicate) { + return this.setTargetSelector((entity, world) -> predicate.test(entity)); + } + + AvoidLivingGoal setTargetSelector(BiPredicate predicate); /** * Gets the search distance at which any {@link Living} instances in a diff --git a/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java b/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java index 328602a464..182ac2f1ec 100644 --- a/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java +++ b/src/main/java/org/spongepowered/api/entity/attribute/type/AttributeTypes.java @@ -40,67 +40,69 @@ @RegistryScopes(scopes = RegistryScope.GAME) public final class AttributeTypes { - public static final DefaultedRegistryReference GENERIC_ARMOR = AttributeTypes.key(ResourceKey.minecraft("generic.armor")); + public static final DefaultedRegistryReference ARMOR = AttributeTypes.key(ResourceKey.minecraft("armor")); - public static final DefaultedRegistryReference GENERIC_ARMOR_TOUGHNESS = AttributeTypes.key(ResourceKey.minecraft("generic.armor_toughness")); + public static final DefaultedRegistryReference ARMOR_TOUGHNESS = AttributeTypes.key(ResourceKey.minecraft("armor_toughness")); - public static final DefaultedRegistryReference GENERIC_ATTACK_DAMAGE = AttributeTypes.key(ResourceKey.minecraft("generic.attack_damage")); + public static final DefaultedRegistryReference ATTACK_DAMAGE = AttributeTypes.key(ResourceKey.minecraft("attack_damage")); - public static final DefaultedRegistryReference GENERIC_ATTACK_KNOCKBACK = AttributeTypes.key(ResourceKey.minecraft("generic.attack_knockback")); + public static final DefaultedRegistryReference ATTACK_KNOCKBACK = AttributeTypes.key(ResourceKey.minecraft("attack_knockback")); - public static final DefaultedRegistryReference GENERIC_ATTACK_SPEED = AttributeTypes.key(ResourceKey.minecraft("generic.attack_speed")); + public static final DefaultedRegistryReference ATTACK_SPEED = AttributeTypes.key(ResourceKey.minecraft("attack_speed")); - public static final DefaultedRegistryReference GENERIC_BURNING_TIME = AttributeTypes.key(ResourceKey.minecraft("generic.burning_time")); + public static final DefaultedRegistryReference BLOCK_BREAK_SPEED = AttributeTypes.key(ResourceKey.minecraft("block_break_speed")); - public static final DefaultedRegistryReference GENERIC_EXPLOSION_KNOCKBACK_RESISTANCE = AttributeTypes.key(ResourceKey.minecraft("generic.explosion_knockback_resistance")); + public static final DefaultedRegistryReference BLOCK_INTERACTION_RANGE = AttributeTypes.key(ResourceKey.minecraft("block_interaction_range")); - public static final DefaultedRegistryReference GENERIC_FALL_DAMAGE_MULTIPLIER = AttributeTypes.key(ResourceKey.minecraft("generic.fall_damage_multiplier")); + public static final DefaultedRegistryReference BURNING_TIME = AttributeTypes.key(ResourceKey.minecraft("burning_time")); - public static final DefaultedRegistryReference GENERIC_FLYING_SPEED = AttributeTypes.key(ResourceKey.minecraft("generic.flying_speed")); + public static final DefaultedRegistryReference ENTITY_INTERACTION_RANGE = AttributeTypes.key(ResourceKey.minecraft("entity_interaction_range")); - public static final DefaultedRegistryReference GENERIC_FOLLOW_RANGE = AttributeTypes.key(ResourceKey.minecraft("generic.follow_range")); + public static final DefaultedRegistryReference EXPLOSION_KNOCKBACK_RESISTANCE = AttributeTypes.key(ResourceKey.minecraft("explosion_knockback_resistance")); - public static final DefaultedRegistryReference GENERIC_GRAVITY = AttributeTypes.key(ResourceKey.minecraft("generic.gravity")); + public static final DefaultedRegistryReference FALL_DAMAGE_MULTIPLIER = AttributeTypes.key(ResourceKey.minecraft("fall_damage_multiplier")); - public static final DefaultedRegistryReference GENERIC_JUMP_STRENGTH = AttributeTypes.key(ResourceKey.minecraft("generic.jump_strength")); + public static final DefaultedRegistryReference FLYING_SPEED = AttributeTypes.key(ResourceKey.minecraft("flying_speed")); - public static final DefaultedRegistryReference GENERIC_KNOCKBACK_RESISTANCE = AttributeTypes.key(ResourceKey.minecraft("generic.knockback_resistance")); + public static final DefaultedRegistryReference FOLLOW_RANGE = AttributeTypes.key(ResourceKey.minecraft("follow_range")); - public static final DefaultedRegistryReference GENERIC_LUCK = AttributeTypes.key(ResourceKey.minecraft("generic.luck")); + public static final DefaultedRegistryReference GRAVITY = AttributeTypes.key(ResourceKey.minecraft("gravity")); - public static final DefaultedRegistryReference GENERIC_MAX_ABSORPTION = AttributeTypes.key(ResourceKey.minecraft("generic.max_absorption")); + public static final DefaultedRegistryReference JUMP_STRENGTH = AttributeTypes.key(ResourceKey.minecraft("jump_strength")); - public static final DefaultedRegistryReference GENERIC_MAX_HEALTH = AttributeTypes.key(ResourceKey.minecraft("generic.max_health")); + public static final DefaultedRegistryReference KNOCKBACK_RESISTANCE = AttributeTypes.key(ResourceKey.minecraft("knockback_resistance")); - public static final DefaultedRegistryReference GENERIC_MOVEMENT_EFFICIENCY = AttributeTypes.key(ResourceKey.minecraft("generic.movement_efficiency")); + public static final DefaultedRegistryReference LUCK = AttributeTypes.key(ResourceKey.minecraft("luck")); - public static final DefaultedRegistryReference GENERIC_MOVEMENT_SPEED = AttributeTypes.key(ResourceKey.minecraft("generic.movement_speed")); + public static final DefaultedRegistryReference MAX_ABSORPTION = AttributeTypes.key(ResourceKey.minecraft("max_absorption")); - public static final DefaultedRegistryReference GENERIC_OXYGEN_BONUS = AttributeTypes.key(ResourceKey.minecraft("generic.oxygen_bonus")); + public static final DefaultedRegistryReference MAX_HEALTH = AttributeTypes.key(ResourceKey.minecraft("max_health")); - public static final DefaultedRegistryReference GENERIC_SAFE_FALL_DISTANCE = AttributeTypes.key(ResourceKey.minecraft("generic.safe_fall_distance")); + public static final DefaultedRegistryReference MINING_EFFICIENCY = AttributeTypes.key(ResourceKey.minecraft("mining_efficiency")); - public static final DefaultedRegistryReference GENERIC_SCALE = AttributeTypes.key(ResourceKey.minecraft("generic.scale")); + public static final DefaultedRegistryReference MOVEMENT_EFFICIENCY = AttributeTypes.key(ResourceKey.minecraft("movement_efficiency")); - public static final DefaultedRegistryReference GENERIC_STEP_HEIGHT = AttributeTypes.key(ResourceKey.minecraft("generic.step_height")); + public static final DefaultedRegistryReference MOVEMENT_SPEED = AttributeTypes.key(ResourceKey.minecraft("movement_speed")); - public static final DefaultedRegistryReference GENERIC_WATER_MOVEMENT_EFFICIENCY = AttributeTypes.key(ResourceKey.minecraft("generic.water_movement_efficiency")); + public static final DefaultedRegistryReference OXYGEN_BONUS = AttributeTypes.key(ResourceKey.minecraft("oxygen_bonus")); - public static final DefaultedRegistryReference PLAYER_BLOCK_BREAK_SPEED = AttributeTypes.key(ResourceKey.minecraft("player.block_break_speed")); + public static final DefaultedRegistryReference SAFE_FALL_DISTANCE = AttributeTypes.key(ResourceKey.minecraft("safe_fall_distance")); - public static final DefaultedRegistryReference PLAYER_BLOCK_INTERACTION_RANGE = AttributeTypes.key(ResourceKey.minecraft("player.block_interaction_range")); + public static final DefaultedRegistryReference SCALE = AttributeTypes.key(ResourceKey.minecraft("scale")); - public static final DefaultedRegistryReference PLAYER_ENTITY_INTERACTION_RANGE = AttributeTypes.key(ResourceKey.minecraft("player.entity_interaction_range")); + public static final DefaultedRegistryReference SNEAKING_SPEED = AttributeTypes.key(ResourceKey.minecraft("sneaking_speed")); - public static final DefaultedRegistryReference PLAYER_MINING_EFFICIENCY = AttributeTypes.key(ResourceKey.minecraft("player.mining_efficiency")); + public static final DefaultedRegistryReference SPAWN_REINFORCEMENTS = AttributeTypes.key(ResourceKey.minecraft("spawn_reinforcements")); - public static final DefaultedRegistryReference PLAYER_SNEAKING_SPEED = AttributeTypes.key(ResourceKey.minecraft("player.sneaking_speed")); + public static final DefaultedRegistryReference STEP_HEIGHT = AttributeTypes.key(ResourceKey.minecraft("step_height")); - public static final DefaultedRegistryReference PLAYER_SUBMERGED_MINING_SPEED = AttributeTypes.key(ResourceKey.minecraft("player.submerged_mining_speed")); + public static final DefaultedRegistryReference SUBMERGED_MINING_SPEED = AttributeTypes.key(ResourceKey.minecraft("submerged_mining_speed")); - public static final DefaultedRegistryReference PLAYER_SWEEPING_DAMAGE_RATIO = AttributeTypes.key(ResourceKey.minecraft("player.sweeping_damage_ratio")); + public static final DefaultedRegistryReference SWEEPING_DAMAGE_RATIO = AttributeTypes.key(ResourceKey.minecraft("sweeping_damage_ratio")); - public static final DefaultedRegistryReference ZOMBIE_SPAWN_REINFORCEMENTS = AttributeTypes.key(ResourceKey.minecraft("zombie.spawn_reinforcements")); + public static final DefaultedRegistryReference TEMPT_RANGE = AttributeTypes.key(ResourceKey.minecraft("tempt_range")); + + public static final DefaultedRegistryReference WATER_MOVEMENT_EFFICIENCY = AttributeTypes.key(ResourceKey.minecraft("water_movement_efficiency")); private AttributeTypes() { } diff --git a/src/main/java/org/spongepowered/api/entity/explosive/Explosive.java b/src/main/java/org/spongepowered/api/entity/explosive/Explosive.java index ab0cff20ac..23e3a18a65 100644 --- a/src/main/java/org/spongepowered/api/entity/explosive/Explosive.java +++ b/src/main/java/org/spongepowered/api/entity/explosive/Explosive.java @@ -40,7 +40,7 @@ public interface Explosive extends Entity { * * @return The explosion radius */ - default Optional> explosionRadius() { + default Optional> explosionRadius() { return this.getValue(Keys.EXPLOSION_RADIUS).map(Value::asMutable); } diff --git a/src/main/java/org/spongepowered/api/entity/living/aquatic/Dolphin.java b/src/main/java/org/spongepowered/api/entity/living/aquatic/Dolphin.java index c0f7399565..4f63568e25 100644 --- a/src/main/java/org/spongepowered/api/entity/living/aquatic/Dolphin.java +++ b/src/main/java/org/spongepowered/api/entity/living/aquatic/Dolphin.java @@ -26,11 +26,12 @@ import org.spongepowered.api.data.Keys; import org.spongepowered.api.data.value.Value; +import org.spongepowered.api.entity.Ageable; /** * Represents a Dolphin */ -public interface Dolphin extends Aquatic { +public interface Dolphin extends Aquatic, Ageable { /** * {@link Keys#SKIN_MOISTURE} diff --git a/src/main/java/org/spongepowered/api/entity/living/aquatic/Squid.java b/src/main/java/org/spongepowered/api/entity/living/aquatic/Squid.java index 3d85e1e914..39cc635e77 100644 --- a/src/main/java/org/spongepowered/api/entity/living/aquatic/Squid.java +++ b/src/main/java/org/spongepowered/api/entity/living/aquatic/Squid.java @@ -24,9 +24,11 @@ */ package org.spongepowered.api.entity.living.aquatic; +import org.spongepowered.api.entity.Ageable; + /** * Represents a Squid. */ -public interface Squid extends Aquatic { +public interface Squid extends Aquatic, Ageable { } diff --git a/src/main/java/org/spongepowered/api/entity/living/monster/Creaking.java b/src/main/java/org/spongepowered/api/entity/living/monster/Creaking.java new file mode 100644 index 0000000000..59b7c798a3 --- /dev/null +++ b/src/main/java/org/spongepowered/api/entity/living/monster/Creaking.java @@ -0,0 +1,48 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.entity.living.monster; + +import org.spongepowered.api.data.Keys; +import org.spongepowered.api.data.value.Value; +import org.spongepowered.api.entity.living.Monster; +import org.spongepowered.api.util.annotation.Experimental; +import org.spongepowered.math.vector.Vector3i; + +import java.util.Optional; + +/** + * A Creaking is a type of monster that originates from the {@link org.spongepowered.api.world.biome.Biomes#PALE_GARDEN} + */ +@Experimental("winter_drop") +public interface Creaking extends Monster { + + default Optional> homePosition() { + return this.getValue(Keys.CREAKING_HOME_POSITION).map(Value::asMutable); + } + + default Value.Immutable isLinked() { + return this.requireValue(Keys.CREAKING_IS_LINKED).asImmutable(); + } +} diff --git a/src/main/java/org/spongepowered/api/entity/living/monster/zombie/Zombie.java b/src/main/java/org/spongepowered/api/entity/living/monster/zombie/Zombie.java index 12a8bf17bd..17aaa51335 100644 --- a/src/main/java/org/spongepowered/api/entity/living/monster/zombie/Zombie.java +++ b/src/main/java/org/spongepowered/api/entity/living/monster/zombie/Zombie.java @@ -38,6 +38,7 @@ public interface Zombie extends Monster { * * @return Whether this zombie is an adult or not */ + @Override default Value.Mutable adult() { return this.requireValue(Keys.IS_ADULT).asMutable(); } diff --git a/src/main/java/org/spongepowered/api/entity/living/player/CooldownTracker.java b/src/main/java/org/spongepowered/api/entity/living/player/CooldownTracker.java index 9a0c181506..d6e2448688 100644 --- a/src/main/java/org/spongepowered/api/entity/living/player/CooldownTracker.java +++ b/src/main/java/org/spongepowered/api/entity/living/player/CooldownTracker.java @@ -24,7 +24,9 @@ */ package org.spongepowered.api.entity.living.player; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.item.ItemType; +import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.util.Ticks; import java.util.Optional; @@ -39,41 +41,56 @@ public interface CooldownTracker { * Checks if the specified {@link ItemType} is currently on cooldown * for the player. * - * @param type The item type to check is on cooldown + * @param stack The item type to check is on cooldown * @return Whether or not the specified item type is cooldown */ - boolean hasCooldown(ItemType type); + boolean hasCooldown(ItemStack stack); + + boolean hasCooldown(ResourceKey group); /** * Gets the cooldown of the specified {@link ItemType} in ticks for the * player, or empty if the the item type is currently not on cooldown. * - * @param type The item type to get the cooldown for + * @param stack The item type to get the cooldown for * @return The cooldown remaining for this item type in ticks, if not * on cooldown */ - Optional cooldown(ItemType type); + Optional cooldown(ItemStack stack); + + /** + * Gets the cooldown for the specified {@link ResourceKey group} in ticks + * for the player, or empty if the group is not on cooldown. + * + * @param group The group to get the cooldown for + * @return The cooldown remaining for this group in ticks, if not on cooldown + */ + Optional cooldown(ResourceKey group); /** * Sets the cooldown for the specified {@link ItemType} for the * specified amount of ticks. * - * @param type The item type to set the cooldown for + * @param stack The item type to set the cooldown for * @param ticks The amount of ticks to set the item type on cooldown for * @return False if setting the cooldown failed, possibly due to the event * being cancelled */ - boolean setCooldown(ItemType type, Ticks ticks); + boolean setCooldown(ItemStack stack, Ticks ticks); + + boolean setCooldown(ResourceKey group, Ticks ticks); /** * Resets the cooldown of the specified {@link ItemType} for the * player. * - * @param type The item type to reset the cooldown for + * @param stack The item type to reset the cooldown for * @return False if setting the cooldown failed, possibly due to the event * being cancelled */ - boolean resetCooldown(ItemType type); + boolean resetCooldown(ItemStack stack); + + boolean resetCooldown(ResourceKey group); /** * Gets the fraction of the specified {@link ItemType}'s cooldown that @@ -82,9 +99,11 @@ public interface CooldownTracker { * *

If present, this value will be between 0.0 and 1.0.

* - * @param type The item type to get the cooldown fraction remaining + * @param stack The item type to get the cooldown fraction remaining * @return The fraction of cooldown remaining for the specified item type */ - OptionalDouble fractionRemaining(ItemType type); + OptionalDouble fractionRemaining(ItemStack stack); + + OptionalDouble fractionRemaining(ResourceKey group); } diff --git a/src/main/java/org/spongepowered/api/entity/vehicle/Raft.java b/src/main/java/org/spongepowered/api/entity/vehicle/Raft.java new file mode 100644 index 0000000000..b5c77f49d8 --- /dev/null +++ b/src/main/java/org/spongepowered/api/entity/vehicle/Raft.java @@ -0,0 +1,32 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.entity.vehicle; + +/** + * Represents a Raft kind of boat. + */ +public interface Raft extends Boat { + +} diff --git a/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java b/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java index 1c47212b67..0f8ee6bd00 100644 --- a/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java +++ b/src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java @@ -56,6 +56,8 @@ public final class DamageTypes { public static final DefaultedRegistryReference DRY_OUT = DamageTypes.key(ResourceKey.minecraft("dry_out")); + public static final DefaultedRegistryReference ENDER_PEARL = DamageTypes.key(ResourceKey.minecraft("ender_pearl")); + public static final DefaultedRegistryReference EXPLOSION = DamageTypes.key(ResourceKey.minecraft("explosion")); public static final DefaultedRegistryReference FALL = DamageTypes.key(ResourceKey.minecraft("fall")); @@ -90,6 +92,8 @@ public final class DamageTypes { public static final DefaultedRegistryReference LIGHTNING_BOLT = DamageTypes.key(ResourceKey.minecraft("lightning_bolt")); + public static final DefaultedRegistryReference MACE_SMASH = DamageTypes.key(ResourceKey.minecraft("mace_smash")); + public static final DefaultedRegistryReference MAGIC = DamageTypes.key(ResourceKey.minecraft("magic")); public static final DefaultedRegistryReference MOB_ATTACK = DamageTypes.key(ResourceKey.minecraft("mob_attack")); diff --git a/src/main/java/org/spongepowered/api/event/entity/living/player/CooldownEvent.java b/src/main/java/org/spongepowered/api/event/entity/living/player/CooldownEvent.java index 65555c1227..2fdb6f8f99 100644 --- a/src/main/java/org/spongepowered/api/event/entity/living/player/CooldownEvent.java +++ b/src/main/java/org/spongepowered/api/event/entity/living/player/CooldownEvent.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.event.entity.living.player; +import org.spongepowered.api.ResourceKey; import org.spongepowered.api.entity.living.player.CooldownTracker; import org.spongepowered.api.entity.living.player.server.ServerPlayer; import org.spongepowered.api.event.Cancellable; @@ -47,11 +48,11 @@ public interface CooldownEvent extends Event { ServerPlayer player(); /** - * Gets the associated item type whose cooldown is being set or removed. + * Gets the associated item group whose cooldown is being set or removed. * * @return The associated item type */ - ItemType itemType(); + ResourceKey group(); /** * Handles an {@link ItemType} being given a cooldown for a {@link ServerPlayer player}. diff --git a/src/main/java/org/spongepowered/api/item/ItemTypes.java b/src/main/java/org/spongepowered/api/item/ItemTypes.java index f3512467ea..3985b89dab 100644 --- a/src/main/java/org/spongepowered/api/item/ItemTypes.java +++ b/src/main/java/org/spongepowered/api/item/ItemTypes.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.item; +import org.jetbrains.annotations.ApiStatus; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.registry.DefaultedRegistryReference; @@ -32,6 +33,7 @@ import org.spongepowered.api.registry.RegistryScope; import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; +import org.spongepowered.api.util.annotation.Experimental; /** * @@ -240,6 +242,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference BLACK_BED = ItemTypes.key(ResourceKey.minecraft("black_bed")); + public static final DefaultedRegistryReference BLACK_BUNDLE = ItemTypes.key(ResourceKey.minecraft("black_bundle")); + public static final DefaultedRegistryReference BLACK_CANDLE = ItemTypes.key(ResourceKey.minecraft("black_candle")); public static final DefaultedRegistryReference BLACK_CARPET = ItemTypes.key(ResourceKey.minecraft("black_carpet")); @@ -276,6 +280,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference BLUE_BED = ItemTypes.key(ResourceKey.minecraft("blue_bed")); + public static final DefaultedRegistryReference BLUE_BUNDLE = ItemTypes.key(ResourceKey.minecraft("blue_bundle")); + public static final DefaultedRegistryReference BLUE_CANDLE = ItemTypes.key(ResourceKey.minecraft("blue_candle")); public static final DefaultedRegistryReference BLUE_CARPET = ItemTypes.key(ResourceKey.minecraft("blue_carpet")); @@ -316,6 +322,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference BOOKSHELF = ItemTypes.key(ResourceKey.minecraft("bookshelf")); + public static final DefaultedRegistryReference BORDURE_INDENTED_BANNER_PATTERN = ItemTypes.key(ResourceKey.minecraft("bordure_indented_banner_pattern")); + public static final DefaultedRegistryReference BOW = ItemTypes.key(ResourceKey.minecraft("bow")); public static final DefaultedRegistryReference BOWL = ItemTypes.key(ResourceKey.minecraft("bowl")); @@ -350,6 +358,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference BROWN_BED = ItemTypes.key(ResourceKey.minecraft("brown_bed")); + public static final DefaultedRegistryReference BROWN_BUNDLE = ItemTypes.key(ResourceKey.minecraft("brown_bundle")); + public static final DefaultedRegistryReference BROWN_CANDLE = ItemTypes.key(ResourceKey.minecraft("brown_candle")); public static final DefaultedRegistryReference BROWN_CARPET = ItemTypes.key(ResourceKey.minecraft("brown_carpet")); @@ -608,6 +618,14 @@ public final class ItemTypes { public static final DefaultedRegistryReference CRAFTING_TABLE = ItemTypes.key(ResourceKey.minecraft("crafting_table")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference CREAKING_HEART = ItemTypes.key(ResourceKey.minecraft("creaking_heart")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference CREAKING_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("creaking_spawn_egg")); + public static final DefaultedRegistryReference CREEPER_BANNER_PATTERN = ItemTypes.key(ResourceKey.minecraft("creeper_banner_pattern")); public static final DefaultedRegistryReference CREEPER_HEAD = ItemTypes.key(ResourceKey.minecraft("creeper_head")); @@ -668,6 +686,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference CYAN_BED = ItemTypes.key(ResourceKey.minecraft("cyan_bed")); + public static final DefaultedRegistryReference CYAN_BUNDLE = ItemTypes.key(ResourceKey.minecraft("cyan_bundle")); + public static final DefaultedRegistryReference CYAN_CANDLE = ItemTypes.key(ResourceKey.minecraft("cyan_candle")); public static final DefaultedRegistryReference CYAN_CARPET = ItemTypes.key(ResourceKey.minecraft("cyan_carpet")); @@ -956,6 +976,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference FERN = ItemTypes.key(ResourceKey.minecraft("fern")); + public static final DefaultedRegistryReference FIELD_MASONED_BANNER_PATTERN = ItemTypes.key(ResourceKey.minecraft("field_masoned_banner_pattern")); + public static final DefaultedRegistryReference FILLED_MAP = ItemTypes.key(ResourceKey.minecraft("filled_map")); public static final DefaultedRegistryReference FIREWORK_ROCKET = ItemTypes.key(ResourceKey.minecraft("firework_rocket")); @@ -1086,6 +1108,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference GRAY_BED = ItemTypes.key(ResourceKey.minecraft("gray_bed")); + public static final DefaultedRegistryReference GRAY_BUNDLE = ItemTypes.key(ResourceKey.minecraft("gray_bundle")); + public static final DefaultedRegistryReference GRAY_CANDLE = ItemTypes.key(ResourceKey.minecraft("gray_candle")); public static final DefaultedRegistryReference GRAY_CARPET = ItemTypes.key(ResourceKey.minecraft("gray_carpet")); @@ -1112,6 +1136,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference GREEN_BED = ItemTypes.key(ResourceKey.minecraft("green_bed")); + public static final DefaultedRegistryReference GREEN_BUNDLE = ItemTypes.key(ResourceKey.minecraft("green_bundle")); + public static final DefaultedRegistryReference GREEN_CANDLE = ItemTypes.key(ResourceKey.minecraft("green_candle")); public static final DefaultedRegistryReference GREEN_CARPET = ItemTypes.key(ResourceKey.minecraft("green_carpet")); @@ -1328,6 +1354,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference LIGHT_BLUE_BED = ItemTypes.key(ResourceKey.minecraft("light_blue_bed")); + public static final DefaultedRegistryReference LIGHT_BLUE_BUNDLE = ItemTypes.key(ResourceKey.minecraft("light_blue_bundle")); + public static final DefaultedRegistryReference LIGHT_BLUE_CANDLE = ItemTypes.key(ResourceKey.minecraft("light_blue_candle")); public static final DefaultedRegistryReference LIGHT_BLUE_CARPET = ItemTypes.key(ResourceKey.minecraft("light_blue_carpet")); @@ -1354,6 +1382,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference LIGHT_GRAY_BED = ItemTypes.key(ResourceKey.minecraft("light_gray_bed")); + public static final DefaultedRegistryReference LIGHT_GRAY_BUNDLE = ItemTypes.key(ResourceKey.minecraft("light_gray_bundle")); + public static final DefaultedRegistryReference LIGHT_GRAY_CANDLE = ItemTypes.key(ResourceKey.minecraft("light_gray_candle")); public static final DefaultedRegistryReference LIGHT_GRAY_CARPET = ItemTypes.key(ResourceKey.minecraft("light_gray_carpet")); @@ -1388,6 +1418,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference LIME_BED = ItemTypes.key(ResourceKey.minecraft("lime_bed")); + public static final DefaultedRegistryReference LIME_BUNDLE = ItemTypes.key(ResourceKey.minecraft("lime_bundle")); + public static final DefaultedRegistryReference LIME_CANDLE = ItemTypes.key(ResourceKey.minecraft("lime_candle")); public static final DefaultedRegistryReference LIME_CARPET = ItemTypes.key(ResourceKey.minecraft("lime_carpet")); @@ -1424,6 +1456,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference MAGENTA_BED = ItemTypes.key(ResourceKey.minecraft("magenta_bed")); + public static final DefaultedRegistryReference MAGENTA_BUNDLE = ItemTypes.key(ResourceKey.minecraft("magenta_bundle")); + public static final DefaultedRegistryReference MAGENTA_CANDLE = ItemTypes.key(ResourceKey.minecraft("magenta_candle")); public static final DefaultedRegistryReference MAGENTA_CARPET = ItemTypes.key(ResourceKey.minecraft("magenta_carpet")); @@ -1698,6 +1732,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference ORANGE_BED = ItemTypes.key(ResourceKey.minecraft("orange_bed")); + public static final DefaultedRegistryReference ORANGE_BUNDLE = ItemTypes.key(ResourceKey.minecraft("orange_bundle")); + public static final DefaultedRegistryReference ORANGE_CANDLE = ItemTypes.key(ResourceKey.minecraft("orange_candle")); public static final DefaultedRegistryReference ORANGE_CARPET = ItemTypes.key(ResourceKey.minecraft("orange_carpet")); @@ -1748,6 +1784,86 @@ public final class ItemTypes { public static final DefaultedRegistryReference PAINTING = ItemTypes.key(ResourceKey.minecraft("painting")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_HANGING_MOSS = ItemTypes.key(ResourceKey.minecraft("pale_hanging_moss")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_MOSS_BLOCK = ItemTypes.key(ResourceKey.minecraft("pale_moss_block")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_MOSS_CARPET = ItemTypes.key(ResourceKey.minecraft("pale_moss_carpet")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_BOAT = ItemTypes.key(ResourceKey.minecraft("pale_oak_boat")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_BUTTON = ItemTypes.key(ResourceKey.minecraft("pale_oak_button")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_CHEST_BOAT = ItemTypes.key(ResourceKey.minecraft("pale_oak_chest_boat")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_DOOR = ItemTypes.key(ResourceKey.minecraft("pale_oak_door")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_FENCE = ItemTypes.key(ResourceKey.minecraft("pale_oak_fence")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_FENCE_GATE = ItemTypes.key(ResourceKey.minecraft("pale_oak_fence_gate")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_HANGING_SIGN = ItemTypes.key(ResourceKey.minecraft("pale_oak_hanging_sign")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_LEAVES = ItemTypes.key(ResourceKey.minecraft("pale_oak_leaves")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_LOG = ItemTypes.key(ResourceKey.minecraft("pale_oak_log")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_PLANKS = ItemTypes.key(ResourceKey.minecraft("pale_oak_planks")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_PRESSURE_PLATE = ItemTypes.key(ResourceKey.minecraft("pale_oak_pressure_plate")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_SAPLING = ItemTypes.key(ResourceKey.minecraft("pale_oak_sapling")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_SIGN = ItemTypes.key(ResourceKey.minecraft("pale_oak_sign")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_SLAB = ItemTypes.key(ResourceKey.minecraft("pale_oak_slab")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_STAIRS = ItemTypes.key(ResourceKey.minecraft("pale_oak_stairs")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_TRAPDOOR = ItemTypes.key(ResourceKey.minecraft("pale_oak_trapdoor")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference PALE_OAK_WOOD = ItemTypes.key(ResourceKey.minecraft("pale_oak_wood")); + public static final DefaultedRegistryReference PANDA_SPAWN_EGG = ItemTypes.key(ResourceKey.minecraft("panda_spawn_egg")); public static final DefaultedRegistryReference PAPER = ItemTypes.key(ResourceKey.minecraft("paper")); @@ -1780,6 +1896,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference PINK_BED = ItemTypes.key(ResourceKey.minecraft("pink_bed")); + public static final DefaultedRegistryReference PINK_BUNDLE = ItemTypes.key(ResourceKey.minecraft("pink_bundle")); + public static final DefaultedRegistryReference PINK_CANDLE = ItemTypes.key(ResourceKey.minecraft("pink_candle")); public static final DefaultedRegistryReference PINK_CARPET = ItemTypes.key(ResourceKey.minecraft("pink_carpet")); @@ -1930,6 +2048,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference PURPLE_BED = ItemTypes.key(ResourceKey.minecraft("purple_bed")); + public static final DefaultedRegistryReference PURPLE_BUNDLE = ItemTypes.key(ResourceKey.minecraft("purple_bundle")); + public static final DefaultedRegistryReference PURPLE_CANDLE = ItemTypes.key(ResourceKey.minecraft("purple_candle")); public static final DefaultedRegistryReference PURPLE_CARPET = ItemTypes.key(ResourceKey.minecraft("purple_carpet")); @@ -2016,6 +2136,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference RED_BED = ItemTypes.key(ResourceKey.minecraft("red_bed")); + public static final DefaultedRegistryReference RED_BUNDLE = ItemTypes.key(ResourceKey.minecraft("red_bundle")); + public static final DefaultedRegistryReference RED_CANDLE = ItemTypes.key(ResourceKey.minecraft("red_candle")); public static final DefaultedRegistryReference RED_CARPET = ItemTypes.key(ResourceKey.minecraft("red_carpet")); @@ -2346,6 +2468,14 @@ public final class ItemTypes { public static final DefaultedRegistryReference STRIPPED_OAK_WOOD = ItemTypes.key(ResourceKey.minecraft("stripped_oak_wood")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference STRIPPED_PALE_OAK_LOG = ItemTypes.key(ResourceKey.minecraft("stripped_pale_oak_log")); + + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final DefaultedRegistryReference STRIPPED_PALE_OAK_WOOD = ItemTypes.key(ResourceKey.minecraft("stripped_pale_oak_wood")); + public static final DefaultedRegistryReference STRIPPED_SPRUCE_LOG = ItemTypes.key(ResourceKey.minecraft("stripped_spruce_log")); public static final DefaultedRegistryReference STRIPPED_SPRUCE_WOOD = ItemTypes.key(ResourceKey.minecraft("stripped_spruce_wood")); @@ -2612,6 +2742,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference WHITE_BED = ItemTypes.key(ResourceKey.minecraft("white_bed")); + public static final DefaultedRegistryReference WHITE_BUNDLE = ItemTypes.key(ResourceKey.minecraft("white_bundle")); + public static final DefaultedRegistryReference WHITE_CANDLE = ItemTypes.key(ResourceKey.minecraft("white_candle")); public static final DefaultedRegistryReference WHITE_CARPET = ItemTypes.key(ResourceKey.minecraft("white_carpet")); @@ -2672,6 +2804,8 @@ public final class ItemTypes { public static final DefaultedRegistryReference YELLOW_BED = ItemTypes.key(ResourceKey.minecraft("yellow_bed")); + public static final DefaultedRegistryReference YELLOW_BUNDLE = ItemTypes.key(ResourceKey.minecraft("yellow_bundle")); + public static final DefaultedRegistryReference YELLOW_CANDLE = ItemTypes.key(ResourceKey.minecraft("yellow_candle")); public static final DefaultedRegistryReference YELLOW_CARPET = ItemTypes.key(ResourceKey.minecraft("yellow_carpet")); diff --git a/src/main/java/org/spongepowered/api/item/inventory/ItemStack.java b/src/main/java/org/spongepowered/api/item/inventory/ItemStack.java index 5732149556..991261f164 100644 --- a/src/main/java/org/spongepowered/api/item/inventory/ItemStack.java +++ b/src/main/java/org/spongepowered/api/item/inventory/ItemStack.java @@ -121,14 +121,6 @@ static ItemStack of(ItemType itemType) { */ void setQuantity(int quantity) throws IllegalArgumentException; - /** - * @deprecated Use {@link #asImmutable()} instead. - */ - @Deprecated(forRemoval = true) - default ItemStackSnapshot createSnapshot() { - return this.asImmutable(); - } - /** * Returns true if the specified {@link ItemStack} has the same stack * size, {@link ItemType}, and data. Note that this method is not an diff --git a/src/main/java/org/spongepowered/api/item/inventory/ItemStackSnapshot.java b/src/main/java/org/spongepowered/api/item/inventory/ItemStackSnapshot.java index e6fa6e98f9..35314f96e9 100644 --- a/src/main/java/org/spongepowered/api/item/inventory/ItemStackSnapshot.java +++ b/src/main/java/org/spongepowered/api/item/inventory/ItemStackSnapshot.java @@ -45,14 +45,6 @@ static ItemStackSnapshot empty() { return Sponge.game().factoryProvider().provide(Factory.class).empty(); } - /** - * @deprecated Use {@link #asMutable()} or {@link #asMutableCopy()} instead. - */ - @Deprecated(forRemoval = true) - default ItemStack createStack() { - return this.asMutable(); - } - interface Factory { ItemStackSnapshot empty(); diff --git a/src/main/java/org/spongepowered/api/item/recipe/Recipe.java b/src/main/java/org/spongepowered/api/item/recipe/Recipe.java index cb06bb9f0d..ac58e59485 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/Recipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/Recipe.java @@ -34,7 +34,6 @@ import org.spongepowered.api.item.inventory.crafting.CraftingInventory; import org.spongepowered.api.item.recipe.cooking.CookingRecipe; import org.spongepowered.api.item.recipe.crafting.CraftingRecipe; -import org.spongepowered.api.item.recipe.crafting.Ingredient; import org.spongepowered.api.item.recipe.crafting.RecipeInput; import org.spongepowered.api.item.recipe.crafting.RecipeResult; import org.spongepowered.api.item.recipe.crafting.ShapedCraftingRecipe; @@ -124,13 +123,6 @@ default Optional result(T inventory, ServerWorld world) { return Optional.empty(); } - /** - * Gets the ingredients for this recipe. - * - * @return An unmodifiable list of the ingredients. - */ - List ingredients(); - /** * Returns true if the recipe is dynamic. *

Dynamic recipes are not displayed in the recipe book.

diff --git a/src/main/java/org/spongepowered/api/item/recipe/cooking/CookingResult.java b/src/main/java/org/spongepowered/api/item/recipe/cooking/CookingResult.java index 8cb100ba48..447a67cd89 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/cooking/CookingResult.java +++ b/src/main/java/org/spongepowered/api/item/recipe/cooking/CookingResult.java @@ -28,22 +28,22 @@ import org.spongepowered.api.item.inventory.ItemStackSnapshot; import java.util.Objects; -import java.util.StringJoiner; /** * The result of fulfilling a {@link CookingRecipe}. */ -public final class CookingResult { - - private final ItemStackSnapshot result; - private final double experience; +public record CookingResult(ItemStackSnapshot result, double experience) { /** - * @deprecated Use {@link #CookingResult(ItemStackLike, double)} instead. + * Creates a new {@link CookingResult}. + * + *

Note that this may be replaced with a static of method in the future.

+ * + * @param result The result of the cooking recipe + * @param experience The experience that should be created from this result */ - @Deprecated(forRemoval = true) - public CookingResult(final ItemStackSnapshot result, final double experience) { - this((ItemStackLike) result, experience); + public CookingResult(final ItemStackLike result, final double experience) { + this(Objects.requireNonNull(result, "result").asImmutable(), experience); } /** @@ -54,7 +54,7 @@ public CookingResult(final ItemStackSnapshot result, final double experience) { * @param result The result of the cooking recipe * @param experience The experience that should be created from this result */ - public CookingResult(final ItemStackLike result, final double experience) { + public CookingResult { Objects.requireNonNull(result, "result"); if (result.isEmpty()) { throw new IllegalArgumentException("The result must not be empty"); @@ -62,9 +62,6 @@ public CookingResult(final ItemStackLike result, final double experience) { if (experience < 0) { throw new IllegalArgumentException("The experience must be non-negative."); } - - this.result = result.asImmutable(); - this.experience = experience; } /** @@ -92,28 +89,4 @@ public double experience() { return this.experience; } - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (!(o instanceof CookingResult)) { - return false; - } - final CookingResult that = (CookingResult) o; - return Double.compare(that.experience, this.experience) == 0 && Objects.equals(this.result, that.result); - } - - @Override - public int hashCode() { - return Objects.hash(this.result, this.experience); - } - - @Override - public String toString() { - return new StringJoiner(", ", CookingResult.class.getSimpleName() + "[", "]") - .add("result=" + this.result) - .add("experience=" + this.experience) - .toString(); - } } diff --git a/src/main/java/org/spongepowered/api/item/recipe/crafting/Ingredient.java b/src/main/java/org/spongepowered/api/item/recipe/crafting/Ingredient.java index 0c862cfb50..ac32a09903 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/crafting/Ingredient.java +++ b/src/main/java/org/spongepowered/api/item/recipe/crafting/Ingredient.java @@ -86,35 +86,6 @@ static Ingredient of(ItemType @Nullable ... itemTypes) { return Ingredient.builder().with(itemTypes).build(); } - /** - * @deprecated Use {@link #of(ItemStackLike...)} instead. - */ - @Deprecated(forRemoval = true) - static Ingredient of(ItemStack @Nullable ... items) { - return Ingredient.of((ItemStackLike[]) items); - } - - /** - * @deprecated Use {@link #of(ItemStackLike...)} instead. - */ - @Deprecated(forRemoval = true) - static Ingredient of(ItemStackSnapshot @Nullable ... items) { - return Ingredient.of((ItemStackLike[]) items); - } - - /** - * Creates a new {@link Ingredient} for the provided {@link ItemStackLike}s. - * - * @param items The item - * @return The new ingredient - */ - static Ingredient of(ItemStackLike @Nullable ... items) { - if (items == null) { - return Ingredient.empty(); - } - return Ingredient.builder().with(items).build(); - } - /** * Creates a new {@link Ingredient} for the provided {@link ItemType}s. * @@ -130,11 +101,16 @@ static Ingredient of(DefaultedRegistryReference @Nullable .. } /** - * @deprecated Use {@link #of(ResourceKey, Predicate, ItemStackLike...)} instead. + * Creates a new {@link Ingredient} for the provided {@link ItemStackLike}s. + * + * @param items The item + * @return The new ingredient */ - @Deprecated(forRemoval = true) - static Ingredient of(ResourceKey key, Predicate predicate, ItemStack... exemplaryStacks) { - return Ingredient.of(key, itemStack -> predicate.test(itemStack.asMutable()), (ItemStackLike[]) exemplaryStacks); + static Ingredient of(ItemStackLike @Nullable ... items) { + if (items == null) { + return Ingredient.empty(); + } + return Ingredient.builder().with(items).build(); } /** diff --git a/src/main/java/org/spongepowered/api/item/recipe/crafting/RecipeResult.java b/src/main/java/org/spongepowered/api/item/recipe/crafting/RecipeResult.java index 489eadcbf0..99690df799 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/crafting/RecipeResult.java +++ b/src/main/java/org/spongepowered/api/item/recipe/crafting/RecipeResult.java @@ -40,14 +40,6 @@ public final class RecipeResult { private final ItemStackSnapshot result; private final List remainingItems; - /** - * @deprecated Use {@link #RecipeResult(ItemStackLike, List)} instead. - */ - @Deprecated(forRemoval = true) - public RecipeResult(ItemStackSnapshot result, List remainingItems) { - this((ItemStackLike) result, (List) remainingItems); - } - /** * Creates a new {@link RecipeResult}. * diff --git a/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapedCraftingRecipe.java b/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapedCraftingRecipe.java index 51c66981a7..cf0328973d 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapedCraftingRecipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapedCraftingRecipe.java @@ -42,6 +42,13 @@ */ public interface ShapedCraftingRecipe extends CraftingRecipe { + /** + * Gets the ingredients for this recipe. + * + * @return An unmodifiable list of the ingredients. + */ + List ingredients(); + /** * Creates a new {@link ShapedCraftingRecipe.Builder} to build a {@link ShapedCraftingRecipe}. * diff --git a/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapelessCraftingRecipe.java b/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapelessCraftingRecipe.java index a14e4f9382..9eeac6ba06 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapelessCraftingRecipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/crafting/ShapelessCraftingRecipe.java @@ -43,6 +43,13 @@ */ public interface ShapelessCraftingRecipe extends CraftingRecipe { + /** + * Gets the ingredients for this recipe. + * + * @return An unmodifiable list of the ingredients. + */ + List ingredients(); + /** * Creates a new {@link Builder} to build a {@link ShapelessCraftingRecipe}. * diff --git a/src/main/java/org/spongepowered/api/item/recipe/single/StoneCutterRecipe.java b/src/main/java/org/spongepowered/api/item/recipe/single/StoneCutterRecipe.java index 33e30fd3d3..ca7eae9bf3 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/single/StoneCutterRecipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/single/StoneCutterRecipe.java @@ -49,6 +49,13 @@ static StoneCutterRecipe.Builder builder() { return Sponge.game().builderProvider().provide(StoneCutterRecipe.Builder.class); } + /** + * Returns the {@link Ingredient} for this {@link StoneCutterRecipe}. + * + * @return The {@link Ingredient} for this {@link StoneCutterRecipe}. + */ + Ingredient ingredient(); + @Override RecipeType type(); diff --git a/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java b/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java index dc344d53f3..b3c8034885 100644 --- a/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java +++ b/src/main/java/org/spongepowered/api/item/recipe/smithing/SmithingRecipe.java @@ -37,6 +37,7 @@ import org.spongepowered.api.item.recipe.crafting.RecipeInput; import org.spongepowered.api.util.ResourceKeyedBuilder; +import java.util.Optional; import java.util.function.Function; import java.util.function.Supplier; @@ -49,6 +50,27 @@ static SmithingRecipe.Builder builder() { return Sponge.game().builderProvider().provide(SmithingRecipe.Builder.class); } + /** + * Returns the smithing template {@link Ingredient} for this {@link SmithingRecipe}. + * + * @return The smithing template {@link Ingredient} for this {@link SmithingRecipe}. + */ + Optional templateIngredient(); + + /** + * Returns the base {@link Ingredient} for this {@link SmithingRecipe}. + * + * @return The base {@link Ingredient} for this {@link SmithingRecipe}. + */ + Optional baseIngredient(); + + /** + * Returns the additional {@link Ingredient} for this {@link SmithingRecipe}. + * + * @return The additional {@link Ingredient} for this {@link SmithingRecipe}. + */ + Optional additionalIngredient(); + @Override RecipeType type(); diff --git a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java index 4b1c9a8767..7f13c67319 100644 --- a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java +++ b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java @@ -54,6 +54,7 @@ import org.spongepowered.api.data.type.CatType; import org.spongepowered.api.data.type.ChestAttachmentType; import org.spongepowered.api.data.type.ComparatorMode; +import org.spongepowered.api.data.type.CreakingHeart; import org.spongepowered.api.data.type.DoorHinge; import org.spongepowered.api.data.type.DripstoneSegment; import org.spongepowered.api.data.type.DyeColor; @@ -162,10 +163,10 @@ import org.spongepowered.api.world.biome.climate.TemperatureModifier; import org.spongepowered.api.world.chunk.ChunkState; import org.spongepowered.api.world.difficulty.Difficulty; +import org.spongepowered.api.world.explosion.ExplosionBlockInteraction; import org.spongepowered.api.world.gamerule.GameRule; import org.spongepowered.api.world.generation.carver.Carver; import org.spongepowered.api.world.generation.carver.CarverType; -import org.spongepowered.api.world.generation.carver.CarvingStep; import org.spongepowered.api.world.generation.config.flat.FlatGeneratorConfig; import org.spongepowered.api.world.generation.config.noise.DensityFunction; import org.spongepowered.api.world.generation.config.noise.Noise; @@ -217,6 +218,8 @@ public final class RegistryTypes { public static final DefaultedRegistryType CONTAINER_TYPE = RegistryTypes.minecraftKeyInGame("menu"); + public static final DefaultedRegistryType CREAKING_HEART = RegistryTypes.minecraftKeyInGame("creaking_heart"); + public static final DefaultedRegistryType DENSITY_FUNCTION = RegistryTypes.minecraftKeyInServer("worldgen/density_function"); public static final DefaultedRegistryType ENCHANTMENT_TYPE = RegistryTypes.minecraftKeyInServer("enchantment"); @@ -306,8 +309,6 @@ public final class RegistryTypes { public static final DefaultedRegistryType CAT_TYPE = RegistryTypes.minecraftKeyInGame("cat_variant"); - public static final DefaultedRegistryType CARVING_STEP = RegistryTypes.spongeKeyInGame("carving_step"); - public static final DefaultedRegistryType CHAT_VISIBILITY = RegistryTypes.spongeKeyInGame("chat_visibility"); public static final DefaultedRegistryType CHEST_ATTACHMENT_TYPE = RegistryTypes.spongeKeyInGame("chest_attachment_type"); @@ -360,6 +361,8 @@ public final class RegistryTypes { public static final DefaultedRegistryType EQUIPMENT_TYPE = RegistryTypes.spongeKeyInGame("equipment_type"); + public static final RegistryType EXPLOSION_BLOCK_INTERACTION = RegistryTypes.spongeKeyInGame("explosion_block_interaction"); + public static final DefaultedRegistryType FIREWORK_SHAPE = RegistryTypes.spongeKeyInGame("firework_shape"); public static final DefaultedRegistryType FLAT_GENERATOR_CONFIG = RegistryTypes.spongeKeyInGame("flat_generator_config"); diff --git a/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java b/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java index 266edcd50f..e5ac253376 100644 --- a/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java +++ b/src/main/java/org/spongepowered/api/state/BooleanStateProperties.java @@ -201,6 +201,10 @@ public static BooleanStateProperty property_SOUTH() { return BooleanStateProperty.of("SOUTH"); } + public static BooleanStateProperty property_TIP() { + return BooleanStateProperty.of("TIP"); + } + public static BooleanStateProperty property_TRIGGERED() { return BooleanStateProperty.of("TRIGGERED"); } diff --git a/src/main/java/org/spongepowered/api/state/EnumStateProperties.java b/src/main/java/org/spongepowered/api/state/EnumStateProperties.java index 8cdaa8c716..ad63c52cf9 100644 --- a/src/main/java/org/spongepowered/api/state/EnumStateProperties.java +++ b/src/main/java/org/spongepowered/api/state/EnumStateProperties.java @@ -29,6 +29,7 @@ import org.spongepowered.api.data.type.BellAttachmentType; import org.spongepowered.api.data.type.ChestAttachmentType; import org.spongepowered.api.data.type.ComparatorMode; +import org.spongepowered.api.data.type.CreakingHeart; import org.spongepowered.api.data.type.DoorHinge; import org.spongepowered.api.data.type.DripstoneSegment; import org.spongepowered.api.data.type.InstrumentType; @@ -81,6 +82,10 @@ public static EnumStateProperty property_CHEST_TYPE() { return EnumStateProperty.of("CHEST_TYPE"); } + public static EnumStateProperty property_CREAKING() { + return EnumStateProperty.of("CREAKING"); + } + public static EnumStateProperty property_DOOR_HINGE() { return EnumStateProperty.of("DOOR_HINGE"); } diff --git a/src/main/java/org/spongepowered/api/statistic/StatisticCategories.java b/src/main/java/org/spongepowered/api/statistic/StatisticCategories.java index 417704dd9f..2b338f823c 100644 --- a/src/main/java/org/spongepowered/api/statistic/StatisticCategories.java +++ b/src/main/java/org/spongepowered/api/statistic/StatisticCategories.java @@ -50,8 +50,10 @@ public final class StatisticCategories { public static final DefaultedRegistryReference> DROPPED = StatisticCategories.typedKey(ResourceKey.minecraft("dropped")); + @SuppressWarnings("rawtypes") public static final DefaultedRegistryReference> KILLED = StatisticCategories.typedKey(ResourceKey.minecraft("killed")); + @SuppressWarnings("rawtypes") public static final DefaultedRegistryReference> KILLED_BY = StatisticCategories.typedKey(ResourceKey.minecraft("killed_by")); public static final DefaultedRegistryReference> MINED = StatisticCategories.typedKey(ResourceKey.minecraft("mined")); diff --git a/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java b/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java index 3092ea4f44..60cd2b085f 100644 --- a/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/BlockTypeTags.java @@ -71,6 +71,8 @@ public final class BlockTypeTags { public static final Tag BASE_STONE_OVERWORLD = BlockTypeTags.key(ResourceKey.minecraft("base_stone_overworld")); + public static final Tag BATS_SPAWNABLE_ON = BlockTypeTags.key(ResourceKey.minecraft("bats_spawnable_on")); + public static final Tag BEACON_BASE_BLOCKS = BlockTypeTags.key(ResourceKey.minecraft("beacon_base_blocks")); public static final Tag BEDS = BlockTypeTags.key(ResourceKey.minecraft("beds")); diff --git a/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java b/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java index 60759cb524..223a04dc6a 100644 --- a/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/DamageTypeTags.java @@ -87,6 +87,8 @@ public final class DamageTypeTags { public static final Tag IS_PROJECTILE = DamageTypeTags.key(ResourceKey.minecraft("is_projectile")); + public static final Tag MACE_SMASH = DamageTypeTags.key(ResourceKey.minecraft("mace_smash")); + public static final Tag NO_ANGER = DamageTypeTags.key(ResourceKey.minecraft("no_anger")); public static final Tag NO_IMPACT = DamageTypeTags.key(ResourceKey.minecraft("no_impact")); diff --git a/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java b/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java index ae6ce29463..11667a8654 100644 --- a/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/EntityTypeTags.java @@ -49,6 +49,8 @@ public final class EntityTypeTags { public static final Tag> BEEHIVE_INHABITORS = EntityTypeTags.key(ResourceKey.minecraft("beehive_inhabitors")); + public static final Tag> BOAT = EntityTypeTags.key(ResourceKey.minecraft("boat")); + public static final Tag> CAN_BREATHE_UNDER_WATER = EntityTypeTags.key(ResourceKey.minecraft("can_breathe_under_water")); public static final Tag> CAN_TURN_IN_BOATS = EntityTypeTags.key(ResourceKey.minecraft("can_turn_in_boats")); diff --git a/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java b/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java index 0e6b7e6722..500d291656 100644 --- a/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java +++ b/src/main/java/org/spongepowered/api/tag/ItemTypeTags.java @@ -67,6 +67,10 @@ public final class ItemTypeTags { public static final Tag BREAKS_DECORATED_POTS = ItemTypeTags.key(ResourceKey.minecraft("breaks_decorated_pots")); + public static final Tag BREWING_FUEL = ItemTypeTags.key(ResourceKey.minecraft("brewing_fuel")); + + public static final Tag BUNDLES = ItemTypeTags.key(ResourceKey.minecraft("bundles")); + public static final Tag BUTTONS = ItemTypeTags.key(ResourceKey.minecraft("buttons")); public static final Tag CAMEL_FOOD = ItemTypeTags.key(ResourceKey.minecraft("camel_food")); @@ -113,10 +117,14 @@ public final class ItemTypeTags { public static final Tag DIAMOND_ORES = ItemTypeTags.key(ResourceKey.minecraft("diamond_ores")); + public static final Tag DIAMOND_TOOL_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("diamond_tool_materials")); + public static final Tag DIRT = ItemTypeTags.key(ResourceKey.minecraft("dirt")); public static final Tag DOORS = ItemTypeTags.key(ResourceKey.minecraft("doors")); + public static final Tag DUPLICATES_ALLAYS = ItemTypeTags.key(ResourceKey.minecraft("duplicates_allays")); + public static final Tag DYEABLE = ItemTypeTags.key(ResourceKey.minecraft("dyeable")); public static final Tag EMERALD_ORES = ItemTypeTags.key(ResourceKey.minecraft("emerald_ores")); @@ -175,10 +183,16 @@ public final class ItemTypeTags { public static final Tag FROG_FOOD = ItemTypeTags.key(ResourceKey.minecraft("frog_food")); + public static final Tag FURNACE_MINECART_FUEL = ItemTypeTags.key(ResourceKey.minecraft("furnace_minecart_fuel")); + + public static final Tag GAZE_DISGUISE_EQUIPMENT = ItemTypeTags.key(ResourceKey.minecraft("gaze_disguise_equipment")); + public static final Tag GOAT_FOOD = ItemTypeTags.key(ResourceKey.minecraft("goat_food")); public static final Tag GOLD_ORES = ItemTypeTags.key(ResourceKey.minecraft("gold_ores")); + public static final Tag GOLD_TOOL_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("gold_tool_materials")); + public static final Tag HANGING_SIGNS = ItemTypeTags.key(ResourceKey.minecraft("hanging_signs")); public static final Tag HEAD_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("head_armor")); @@ -195,6 +209,8 @@ public final class ItemTypeTags { public static final Tag IRON_ORES = ItemTypeTags.key(ResourceKey.minecraft("iron_ores")); + public static final Tag IRON_TOOL_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("iron_tool_materials")); + public static final Tag JUNGLE_LOGS = ItemTypeTags.key(ResourceKey.minecraft("jungle_logs")); public static final Tag LAPIS_ORES = ItemTypeTags.key(ResourceKey.minecraft("lapis_ores")); @@ -215,8 +231,12 @@ public final class ItemTypeTags { public static final Tag MANGROVE_LOGS = ItemTypeTags.key(ResourceKey.minecraft("mangrove_logs")); + public static final Tag MAP_INVISIBILITY_EQUIPMENT = ItemTypeTags.key(ResourceKey.minecraft("map_invisibility_equipment")); + public static final Tag MEAT = ItemTypeTags.key(ResourceKey.minecraft("meat")); + public static final Tag NETHERITE_TOOL_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("netherite_tool_materials")); + public static final Tag NON_FLAMMABLE_WOOD = ItemTypeTags.key(ResourceKey.minecraft("non_flammable_wood")); public static final Tag NOTEBLOCK_TOP_INSTRUMENTS = ItemTypeTags.key(ResourceKey.minecraft("noteblock_top_instruments")); @@ -225,6 +245,8 @@ public final class ItemTypeTags { public static final Tag OCELOT_FOOD = ItemTypeTags.key(ResourceKey.minecraft("ocelot_food")); + public static final Tag PANDA_EATS_FROM_GROUND = ItemTypeTags.key(ResourceKey.minecraft("panda_eats_from_ground")); + public static final Tag PANDA_FOOD = ItemTypeTags.key(ResourceKey.minecraft("panda_food")); public static final Tag PARROT_FOOD = ItemTypeTags.key(ResourceKey.minecraft("parrot_food")); @@ -241,6 +263,8 @@ public final class ItemTypeTags { public static final Tag PIGLIN_REPELLENTS = ItemTypeTags.key(ResourceKey.minecraft("piglin_repellents")); + public static final Tag PIGLIN_SAFE_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("piglin_safe_armor")); + public static final Tag PLANKS = ItemTypeTags.key(ResourceKey.minecraft("planks")); public static final Tag RABBIT_FOOD = ItemTypeTags.key(ResourceKey.minecraft("rabbit_food")); @@ -249,6 +273,22 @@ public final class ItemTypeTags { public static final Tag REDSTONE_ORES = ItemTypeTags.key(ResourceKey.minecraft("redstone_ores")); + public static final Tag REPAIRS_CHAIN_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_chain_armor")); + + public static final Tag REPAIRS_DIAMOND_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_diamond_armor")); + + public static final Tag REPAIRS_GOLD_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_gold_armor")); + + public static final Tag REPAIRS_IRON_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_iron_armor")); + + public static final Tag REPAIRS_LEATHER_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_leather_armor")); + + public static final Tag REPAIRS_NETHERITE_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_netherite_armor")); + + public static final Tag REPAIRS_TURTLE_HELMET = ItemTypeTags.key(ResourceKey.minecraft("repairs_turtle_helmet")); + + public static final Tag REPAIRS_WOLF_ARMOR = ItemTypeTags.key(ResourceKey.minecraft("repairs_wolf_armor")); + public static final Tag SAND = ItemTypeTags.key(ResourceKey.minecraft("sand")); public static final Tag SAPLINGS = ItemTypeTags.key(ResourceKey.minecraft("saplings")); @@ -257,6 +297,8 @@ public final class ItemTypeTags { public static final Tag SHOVELS = ItemTypeTags.key(ResourceKey.minecraft("shovels")); + public static final Tag SHULKER_BOXES = ItemTypeTags.key(ResourceKey.minecraft("shulker_boxes")); + public static final Tag SIGNS = ItemTypeTags.key(ResourceKey.minecraft("signs")); public static final Tag SKULLS = ItemTypeTags.key(ResourceKey.minecraft("skulls")); @@ -303,6 +345,8 @@ public final class ItemTypeTags { public static final Tag TURTLE_FOOD = ItemTypeTags.key(ResourceKey.minecraft("turtle_food")); + public static final Tag VILLAGER_PICKS_UP = ItemTypeTags.key(ResourceKey.minecraft("villager_picks_up")); + public static final Tag VILLAGER_PLANTABLE_SEEDS = ItemTypeTags.key(ResourceKey.minecraft("villager_plantable_seeds")); public static final Tag WALLS = ItemTypeTags.key(ResourceKey.minecraft("walls")); @@ -325,6 +369,8 @@ public final class ItemTypeTags { public static final Tag WOODEN_STAIRS = ItemTypeTags.key(ResourceKey.minecraft("wooden_stairs")); + public static final Tag WOODEN_TOOL_MATERIALS = ItemTypeTags.key(ResourceKey.minecraft("wooden_tool_materials")); + public static final Tag WOODEN_TRAPDOORS = ItemTypeTags.key(ResourceKey.minecraft("wooden_trapdoors")); public static final Tag WOOL = ItemTypeTags.key(ResourceKey.minecraft("wool")); diff --git a/src/main/java/org/spongepowered/api/world/WorldTypeTemplate.java b/src/main/java/org/spongepowered/api/world/WorldTypeTemplate.java index dbf335ea1b..ed35998388 100644 --- a/src/main/java/org/spongepowered/api/world/WorldTypeTemplate.java +++ b/src/main/java/org/spongepowered/api/world/WorldTypeTemplate.java @@ -70,10 +70,12 @@ interface Builder extends DataPackEntryBuilder pack); } diff --git a/src/main/java/org/spongepowered/api/world/biome/Biome.java b/src/main/java/org/spongepowered/api/world/biome/Biome.java index 15051bf235..afd1c20497 100644 --- a/src/main/java/org/spongepowered/api/world/biome/Biome.java +++ b/src/main/java/org/spongepowered/api/world/biome/Biome.java @@ -42,7 +42,6 @@ import org.spongepowered.api.world.biome.spawner.NaturalSpawnCost; import org.spongepowered.api.world.biome.spawner.NaturalSpawner; import org.spongepowered.api.world.generation.carver.Carver; -import org.spongepowered.api.world.generation.carver.CarvingStep; import org.spongepowered.api.world.generation.feature.DecorationStep; import org.spongepowered.api.world.generation.feature.PlacedFeature; @@ -116,7 +115,7 @@ default TemperatureModifier temperatureModifier() { * * @return The carvers */ - default Map> carvers() { + default List carvers() { return this.require(Keys.CARVERS); } diff --git a/src/main/java/org/spongepowered/api/world/biome/Biomes.java b/src/main/java/org/spongepowered/api/world/biome/Biomes.java index 046c61934e..b9837ff747 100644 --- a/src/main/java/org/spongepowered/api/world/biome/Biomes.java +++ b/src/main/java/org/spongepowered/api/world/biome/Biomes.java @@ -24,6 +24,7 @@ */ package org.spongepowered.api.world.biome; +import org.jetbrains.annotations.ApiStatus; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.registry.Registry; import org.spongepowered.api.registry.RegistryKey; @@ -31,6 +32,7 @@ import org.spongepowered.api.registry.RegistryScope; import org.spongepowered.api.registry.RegistryScopes; import org.spongepowered.api.registry.RegistryTypes; +import org.spongepowered.api.util.annotation.Experimental; import org.spongepowered.api.world.server.ServerWorld; /** @@ -118,6 +120,10 @@ public final class Biomes { public static final RegistryReference OLD_GROWTH_SPRUCE_TAIGA = Biomes.key(ResourceKey.minecraft("old_growth_spruce_taiga")); + @Experimental("winter_drop") + @ApiStatus.Experimental + public static final RegistryReference PALE_GARDEN = Biomes.key(ResourceKey.minecraft("pale_garden")); + public static final RegistryReference PLAINS = Biomes.key(ResourceKey.minecraft("plains")); public static final RegistryReference RIVER = Biomes.key(ResourceKey.minecraft("river")); diff --git a/src/main/java/org/spongepowered/api/world/explosion/Explosion.java b/src/main/java/org/spongepowered/api/world/explosion/Explosion.java index 0701c0c2d1..4f157b8b7a 100644 --- a/src/main/java/org/spongepowered/api/world/explosion/Explosion.java +++ b/src/main/java/org/spongepowered/api/world/explosion/Explosion.java @@ -184,12 +184,12 @@ interface Builder extends org.spongepowered.api.util.Builder Builder shouldPlaySmoke(boolean smoke); /** - * Sets whether the affected blocks should be destroyed on explosion. + * Sets the desired block interaction. * - * @param destroy Whether the affected blocks should be destroyed + * @param interaction the desired block interaction * @return The builder, for chaining */ - Builder shouldBreakBlocks(boolean destroy); + Builder blockInteraction(ExplosionBlockInteraction interaction); /** * Sets the resolution of the explosion. @@ -244,4 +244,5 @@ default Builder knockback(double knockback) { Explosion build() throws IllegalArgumentException; } + } diff --git a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java b/src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteraction.java similarity index 88% rename from src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java rename to src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteraction.java index f83e599d45..ac030daaae 100644 --- a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java +++ b/src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteraction.java @@ -22,14 +22,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.world.generation.carver; +package org.spongepowered.api.world.explosion; import org.spongepowered.api.util.annotation.CatalogedBy; -/** - * A carving step for {@link Carver carvers} - */ -@CatalogedBy(CarvingSteps.class) -public interface CarvingStep { +@CatalogedBy(ExplosionBlockInteractions.class) +public interface ExplosionBlockInteraction { + // TODO mixin } diff --git a/src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteractions.java b/src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteractions.java new file mode 100644 index 0000000000..cf3473b730 --- /dev/null +++ b/src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteractions.java @@ -0,0 +1,54 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.world.explosion; + +import org.spongepowered.api.ResourceKey; +import org.spongepowered.api.Sponge; +import org.spongepowered.api.registry.DefaultedRegistryReference; +import org.spongepowered.api.registry.Registry; +import org.spongepowered.api.registry.RegistryKey; +import org.spongepowered.api.registry.RegistryTypes; + +public final class ExplosionBlockInteractions { + + public static final DefaultedRegistryReference DESTROY = ExplosionBlockInteractions.key(ResourceKey.sponge("destroy")); + + public static final DefaultedRegistryReference DESTROY_WITH_DECAY = ExplosionBlockInteractions.key(ResourceKey.sponge("destroy_with_decay")); + + public static final DefaultedRegistryReference KEEP = ExplosionBlockInteractions.key(ResourceKey.sponge("keep")); + + public static final DefaultedRegistryReference TRIGGER_BLOCK = ExplosionBlockInteractions.key(ResourceKey.sponge("trigger_block")); + + private ExplosionBlockInteractions() { + } + + public static Registry registry() { + return Sponge.game().registry(RegistryTypes.EXPLOSION_BLOCK_INTERACTION); + } + + private static DefaultedRegistryReference key(final ResourceKey location) { + return RegistryKey.of(RegistryTypes.EXPLOSION_BLOCK_INTERACTION, location).asDefaultedReference(Sponge::game); + } +} diff --git a/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java b/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java index d3cfe5cb42..d598cf4e2b 100644 --- a/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java +++ b/src/main/java/org/spongepowered/api/world/gamerule/GameRules.java @@ -50,6 +50,8 @@ public final class GameRules { public static final DefaultedRegistryReference> DISABLE_ELYTRA_MOVEMENT_CHECK = GameRules.key(ResourceKey.sponge("disable_elytra_movement_check")); + public static final DefaultedRegistryReference> DISABLE_PLAYER_MOVEMENT_CHECK = GameRules.key(ResourceKey.sponge("disable_player_movement_check")); + public static final DefaultedRegistryReference> DISABLE_RAIDS = GameRules.key(ResourceKey.sponge("disable_raids")); public static final DefaultedRegistryReference> DO_DAYLIGHT_CYCLE = GameRules.key(ResourceKey.sponge("do_daylight_cycle")); @@ -106,6 +108,8 @@ public final class GameRules { public static final DefaultedRegistryReference> MAX_ENTITY_CRAMMING = GameRules.key(ResourceKey.sponge("max_entity_cramming")); + public static final DefaultedRegistryReference> MINECART_MAX_SPEED = GameRules.key(ResourceKey.sponge("minecart_max_speed")); + public static final DefaultedRegistryReference> MOB_EXPLOSION_DROP_DECAY = GameRules.key(ResourceKey.sponge("mob_explosion_drop_decay")); public static final DefaultedRegistryReference> MOB_GRIEFING = GameRules.key(ResourceKey.sponge("mob_griefing")); diff --git a/src/main/java/org/spongepowered/api/world/generation/feature/Features.java b/src/main/java/org/spongepowered/api/world/generation/feature/Features.java index f3bbaf8ec8..68f20b0cf0 100644 --- a/src/main/java/org/spongepowered/api/world/generation/feature/Features.java +++ b/src/main/java/org/spongepowered/api/world/generation/feature/Features.java @@ -288,6 +288,16 @@ public final class Features { public static final DefaultedRegistryReference ORE_TUFF = Features.key(ResourceKey.minecraft("ore_tuff")); + public static final DefaultedRegistryReference PALE_GARDEN_VEGETATION = Features.key(ResourceKey.minecraft("pale_garden_vegetation")); + + public static final DefaultedRegistryReference PALE_MOSS_PATCH_BONEMEAL = Features.key(ResourceKey.minecraft("pale_moss_patch_bonemeal")); + + public static final DefaultedRegistryReference PALE_MOSS_VEGETATION = Features.key(ResourceKey.minecraft("pale_moss_vegetation")); + + public static final DefaultedRegistryReference PALE_OAK = Features.key(ResourceKey.minecraft("pale_oak")); + + public static final DefaultedRegistryReference PALE_OAK_CREAKING = Features.key(ResourceKey.minecraft("pale_oak_creaking")); + public static final DefaultedRegistryReference PATCH_BERRY_BUSH = Features.key(ResourceKey.minecraft("patch_berry_bush")); public static final DefaultedRegistryReference PATCH_BROWN_MUSHROOM = Features.key(ResourceKey.minecraft("patch_brown_mushroom")); @@ -350,8 +360,6 @@ public final class Features { public static final DefaultedRegistryReference SEAGRASS_SHORT = Features.key(ResourceKey.minecraft("seagrass_short")); - public static final DefaultedRegistryReference SEAGRASS_SIMPLE = Features.key(ResourceKey.minecraft("seagrass_simple")); - public static final DefaultedRegistryReference SEAGRASS_SLIGHTLY_LESS_SHORT = Features.key(ResourceKey.minecraft("seagrass_slightly_less_short")); public static final DefaultedRegistryReference SEAGRASS_TALL = Features.key(ResourceKey.minecraft("seagrass_tall")); diff --git a/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java b/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java index 4e7ff7baa9..a5cbce7a7b 100644 --- a/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java +++ b/src/main/java/org/spongepowered/api/world/generation/feature/PlacedFeatures.java @@ -296,6 +296,12 @@ public final class PlacedFeatures { public static final DefaultedRegistryReference ORE_TUFF = PlacedFeatures.key(ResourceKey.minecraft("ore_tuff")); + public static final DefaultedRegistryReference PALE_GARDEN_VEGETATION = PlacedFeatures.key(ResourceKey.minecraft("pale_garden_vegetation")); + + public static final DefaultedRegistryReference PALE_OAK_CHECKED = PlacedFeatures.key(ResourceKey.minecraft("pale_oak_checked")); + + public static final DefaultedRegistryReference PALE_OAK_CREAKING_CHECKED = PlacedFeatures.key(ResourceKey.minecraft("pale_oak_creaking_checked")); + public static final DefaultedRegistryReference PATCH_BERRY_BUSH = PlacedFeatures.key(ResourceKey.minecraft("patch_berry_bush")); public static final DefaultedRegistryReference PATCH_BERRY_COMMON = PlacedFeatures.key(ResourceKey.minecraft("patch_berry_common")); @@ -410,8 +416,6 @@ public final class PlacedFeatures { public static final DefaultedRegistryReference SEAGRASS_RIVER = PlacedFeatures.key(ResourceKey.minecraft("seagrass_river")); - public static final DefaultedRegistryReference SEAGRASS_SIMPLE = PlacedFeatures.key(ResourceKey.minecraft("seagrass_simple")); - public static final DefaultedRegistryReference SEAGRASS_SWAMP = PlacedFeatures.key(ResourceKey.minecraft("seagrass_swamp")); public static final DefaultedRegistryReference SEAGRASS_WARM = PlacedFeatures.key(ResourceKey.minecraft("seagrass_warm")); diff --git a/src/main/java/org/spongepowered/api/world/generation/feature/PlacementModifierTypes.java b/src/main/java/org/spongepowered/api/world/generation/feature/PlacementModifierTypes.java index f8b2ec1cdc..ea966b472b 100644 --- a/src/main/java/org/spongepowered/api/world/generation/feature/PlacementModifierTypes.java +++ b/src/main/java/org/spongepowered/api/world/generation/feature/PlacementModifierTypes.java @@ -44,8 +44,6 @@ public final class PlacementModifierTypes { public static final DefaultedRegistryReference BLOCK_PREDICATE_FILTER = PlacementModifierTypes.key(ResourceKey.minecraft("block_predicate_filter")); - public static final DefaultedRegistryReference CARVING_MASK = PlacementModifierTypes.key(ResourceKey.minecraft("carving_mask")); - public static final DefaultedRegistryReference COUNT = PlacementModifierTypes.key(ResourceKey.minecraft("count")); public static final DefaultedRegistryReference COUNT_ON_EVERY_LAYER = PlacementModifierTypes.key(ResourceKey.minecraft("count_on_every_layer")); diff --git a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java index 0a1b234579..56802cb278 100644 --- a/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java +++ b/src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/JigsawPools.java @@ -232,8 +232,12 @@ public final class JigsawPools { public static final DefaultedRegistryReference TRIAL_CHAMBERS_DECOR = JigsawPools.key(ResourceKey.minecraft("trial_chambers/decor")); + public static final DefaultedRegistryReference TRIAL_CHAMBERS_DECOR_BED = JigsawPools.key(ResourceKey.minecraft("trial_chambers/decor/bed")); + public static final DefaultedRegistryReference TRIAL_CHAMBERS_DECOR_CHAMBER = JigsawPools.key(ResourceKey.minecraft("trial_chambers/decor/chamber")); + public static final DefaultedRegistryReference TRIAL_CHAMBERS_DECOR_DISPOSAL = JigsawPools.key(ResourceKey.minecraft("trial_chambers/decor/disposal")); + public static final DefaultedRegistryReference TRIAL_CHAMBERS_DISPENSERS_CHAMBER = JigsawPools.key(ResourceKey.minecraft("trial_chambers/dispensers/chamber")); public static final DefaultedRegistryReference TRIAL_CHAMBERS_ENTRANCE = JigsawPools.key(ResourceKey.minecraft("trial_chambers/entrance")); diff --git a/src/main/java/org/spongepowered/api/world/schematic/Schematic.java b/src/main/java/org/spongepowered/api/world/schematic/Schematic.java index 5ce9b7d028..6843f01628 100644 --- a/src/main/java/org/spongepowered/api/world/schematic/Schematic.java +++ b/src/main/java/org/spongepowered/api/world/schematic/Schematic.java @@ -67,6 +67,7 @@ static Builder builder() { * * @return The block palette */ + @Override Palette blockPalette(); /** diff --git a/src/main/java/org/spongepowered/api/world/server/storage/ServerWorldProperties.java b/src/main/java/org/spongepowered/api/world/server/storage/ServerWorldProperties.java index 93efda5ece..0b1ffaf810 100644 --- a/src/main/java/org/spongepowered/api/world/server/storage/ServerWorldProperties.java +++ b/src/main/java/org/spongepowered/api/world/server/storage/ServerWorldProperties.java @@ -40,6 +40,7 @@ import org.spongepowered.api.world.WorldType; import org.spongepowered.api.world.border.WorldBorder; import org.spongepowered.api.world.difficulty.Difficulty; +import org.spongepowered.api.world.gamerule.GameRuleHolder; import org.spongepowered.api.world.generation.config.WorldGenerationConfig; import org.spongepowered.api.world.server.ServerWorld; import org.spongepowered.api.world.storage.WorldProperties; @@ -50,7 +51,7 @@ import java.util.Optional; import java.util.UUID; -public interface ServerWorldProperties extends WorldProperties, Nameable, Identifiable, ResourceKeyed, WeatherUniverse.Mutable { +public interface ServerWorldProperties extends WorldProperties, GameRuleHolder, Nameable, Identifiable, ResourceKeyed, WeatherUniverse.Mutable { /** * Gets the {@link ServerWorld} that correlates to this properties, if available. diff --git a/src/main/java/org/spongepowered/api/world/storage/WorldProperties.java b/src/main/java/org/spongepowered/api/world/storage/WorldProperties.java index 801ca3ded1..0296213793 100644 --- a/src/main/java/org/spongepowered/api/world/storage/WorldProperties.java +++ b/src/main/java/org/spongepowered/api/world/storage/WorldProperties.java @@ -29,14 +29,13 @@ import org.spongepowered.api.util.MinecraftDayTime; import org.spongepowered.api.world.World; import org.spongepowered.api.world.difficulty.Difficulty; -import org.spongepowered.api.world.gamerule.GameRuleHolder; import org.spongepowered.api.world.weather.WeatherUniverse; import org.spongepowered.math.vector.Vector3i; /** * Represents the properties of a {@link World} which are persisted across runtime instances. */ -public interface WorldProperties extends WeatherUniverse, GameRuleHolder, DataHolder.Mutable { +public interface WorldProperties extends WeatherUniverse, DataHolder.Mutable { /** * Gets the default spawn position. diff --git a/src/test/java/org/spongepowered/api/util/ColorTest.java b/src/test/java/org/spongepowered/api/util/ColorTest.java new file mode 100644 index 0000000000..da00ee6758 --- /dev/null +++ b/src/test/java/org/spongepowered/api/util/ColorTest.java @@ -0,0 +1,146 @@ +/* + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.util; + + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import org.junit.jupiter.api.Test; +import org.spongepowered.math.vector.Vector3d; +import org.spongepowered.math.vector.Vector3f; +import org.spongepowered.math.vector.Vector3i; + +public class ColorTest { + + @Test + public void testOfRgbHex() { + final Color colorGray = Color.ofRgb(0x808080); + assertEquals(Color.GRAY, colorGray); + } + + @Test + public void testOfRgbForRedGreenBlue() { + final Color colorGray = Color.ofRgb(128, 128, 128); + assertEquals(Color.GRAY, colorGray); + } + + @Test + public void testOfColor() { + final Color blueColor = Color.of(java.awt.Color.BLUE); + assertEquals(blueColor, Color.BLUE); + } + + @Test + public void testOfVector3i() { + final Vector3i vecGray = new Vector3i(128, 128, 384); + final Color colorGray = Color.of(vecGray); + assertEquals(Color.GRAY, colorGray); + } + + @Test + public void testOfVector3f() { + final Vector3f vecGray = new Vector3f(128.0, 128.459, 127.5); + final Color colorGray = Color.of(vecGray); + assertEquals(Color.GRAY, colorGray); + } + + @Test + public void testOfVector3d() { + final Vector3d vecGray = new Vector3d(128.0, 128.459, 127.5); + final Color colorGray = Color.of(vecGray); + assertEquals(Color.GRAY, colorGray); + } + + @Test + public void testMixColors() { + final Color grey = Color.GRAY; + final Color test = Color.WHITE.mixWithColors(Color.BLACK); + assertEquals(grey, test); + } + + @Test + public void testGetRed() { + assertEquals(0xFF, Color.RED.red()); + } + + @Test + public void testWithRed() { + final Color cyan = Color.CYAN; + final Color merged = cyan.withRed(0xFF); + final int rgb = merged.rgb(); + assertEquals(0xFFFFFF, rgb); + } + + @Test + public void testGetGreen() { + assertEquals(0x80, Color.GREEN.green()); + } + + @Test + public void testWithGreen() { + final Color magenta = Color.MAGENTA; + final Color merged = magenta.withGreen(0xFF); + final int rgb = merged.rgb(); + assertEquals(0xFFFFFF, rgb); + } + + @Test + public void testGetBlue() { + assertEquals(0x0000FF, Color.BLUE.blue()); + } + + @Test + public void testWithBlue() { + final Color yellow = Color.YELLOW; + final Color merged = yellow.withBlue(0xFF); + final int rgb = merged.rgb(); + assertEquals(0xFFFFFF, rgb); + } + + @Test + public void testAsJavaColor() { + final int color = 0xFF00FF; + final Color apiColor = Color.ofRgb(color); + final java.awt.Color javaColor = apiColor.asJavaColor(); + final java.awt.Color testColor = new java.awt.Color(color); + assertEquals(javaColor, testColor); + } + + @Test + public void testGetRgb() { + final int color = 0x808080; + final Color color1 = Color.ofRgb(color); + final int rgb = color1.rgb(); + assertEquals(color, rgb); + } + + @Test + public void testEquals() { + assertEquals(Color.GREEN, Color.ofRgb(0x008000)); + assertNotEquals(Color.GREEN, Color.GRAY); + } + +}