Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to MC 1.21.2 #2560

Draft
wants to merge 19 commits into
base: api-12
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public final class Triggers {

public static final DefaultedRegistryReference<Trigger<?>> ITEM_USED_ON_BLOCK = Triggers.key(ResourceKey.minecraft("item_used_on_block"));

public static final DefaultedRegistryReference<Trigger<?>> KILLED_BY_CROSSBOW = Triggers.key(ResourceKey.minecraft("killed_by_crossbow"));
public static final DefaultedRegistryReference<Trigger<?>> KILLED_BY_ARROW = Triggers.key(ResourceKey.minecraft("killed_by_arrow"));

public static final DefaultedRegistryReference<Trigger<?>> KILL_MOB_NEAR_SCULK_CATALYST = Triggers.key(ResourceKey.minecraft("kill_mob_near_sculk_catalyst"));

Expand Down
98 changes: 98 additions & 0 deletions src/main/java/org/spongepowered/api/block/BlockTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
* <!-- This file is automatically generated. Any manual changes will be overwritten. -->
Expand Down Expand Up @@ -496,6 +498,10 @@ public final class BlockTypes {

public static final DefaultedRegistryReference<BlockType> CRAFTING_TABLE = BlockTypes.key(ResourceKey.minecraft("crafting_table"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> CREAKING_HEART = BlockTypes.key(ResourceKey.minecraft("creaking_heart"));

public static final DefaultedRegistryReference<BlockType> CREEPER_HEAD = BlockTypes.key(ResourceKey.minecraft("creeper_head"));

public static final DefaultedRegistryReference<BlockType> CREEPER_WALL_HEAD = BlockTypes.key(ResourceKey.minecraft("creeper_wall_head"));
Expand Down Expand Up @@ -1336,6 +1342,86 @@ public final class BlockTypes {

public static final DefaultedRegistryReference<BlockType> PACKED_MUD = BlockTypes.key(ResourceKey.minecraft("packed_mud"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_HANGING_MOSS = BlockTypes.key(ResourceKey.minecraft("pale_hanging_moss"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_MOSS_BLOCK = BlockTypes.key(ResourceKey.minecraft("pale_moss_block"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_MOSS_CARPET = BlockTypes.key(ResourceKey.minecraft("pale_moss_carpet"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_BUTTON = BlockTypes.key(ResourceKey.minecraft("pale_oak_button"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_DOOR = BlockTypes.key(ResourceKey.minecraft("pale_oak_door"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_FENCE = BlockTypes.key(ResourceKey.minecraft("pale_oak_fence"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_FENCE_GATE = BlockTypes.key(ResourceKey.minecraft("pale_oak_fence_gate"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_hanging_sign"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_LEAVES = BlockTypes.key(ResourceKey.minecraft("pale_oak_leaves"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_LOG = BlockTypes.key(ResourceKey.minecraft("pale_oak_log"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_PLANKS = BlockTypes.key(ResourceKey.minecraft("pale_oak_planks"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_PRESSURE_PLATE = BlockTypes.key(ResourceKey.minecraft("pale_oak_pressure_plate"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_SAPLING = BlockTypes.key(ResourceKey.minecraft("pale_oak_sapling"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_sign"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_SLAB = BlockTypes.key(ResourceKey.minecraft("pale_oak_slab"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_STAIRS = BlockTypes.key(ResourceKey.minecraft("pale_oak_stairs"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_TRAPDOOR = BlockTypes.key(ResourceKey.minecraft("pale_oak_trapdoor"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_WALL_HANGING_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_wall_hanging_sign"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_WALL_SIGN = BlockTypes.key(ResourceKey.minecraft("pale_oak_wall_sign"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> PALE_OAK_WOOD = BlockTypes.key(ResourceKey.minecraft("pale_oak_wood"));

public static final DefaultedRegistryReference<BlockType> PEARLESCENT_FROGLIGHT = BlockTypes.key(ResourceKey.minecraft("pearlescent_froglight"));

public static final DefaultedRegistryReference<BlockType> PEONY = BlockTypes.key(ResourceKey.minecraft("peony"));
Expand Down Expand Up @@ -1502,6 +1588,10 @@ public final class BlockTypes {

public static final DefaultedRegistryReference<BlockType> POTTED_OXEYE_DAISY = BlockTypes.key(ResourceKey.minecraft("potted_oxeye_daisy"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> POTTED_PALE_OAK_SAPLING = BlockTypes.key(ResourceKey.minecraft("potted_pale_oak_sapling"));

public static final DefaultedRegistryReference<BlockType> POTTED_PINK_TULIP = BlockTypes.key(ResourceKey.minecraft("potted_pink_tulip"));

public static final DefaultedRegistryReference<BlockType> POTTED_POPPY = BlockTypes.key(ResourceKey.minecraft("potted_poppy"));
Expand Down Expand Up @@ -1864,6 +1954,14 @@ public final class BlockTypes {

public static final DefaultedRegistryReference<BlockType> STRIPPED_OAK_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_oak_wood"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> STRIPPED_PALE_OAK_LOG = BlockTypes.key(ResourceKey.minecraft("stripped_pale_oak_log"));

@Experimental("winter_drop")
@ApiStatus.Experimental
public static final DefaultedRegistryReference<BlockType> STRIPPED_PALE_OAK_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_pale_oak_wood"));

public static final DefaultedRegistryReference<BlockType> STRIPPED_SPRUCE_LOG = BlockTypes.key(ResourceKey.minecraft("stripped_spruce_log"));

public static final DefaultedRegistryReference<BlockType> STRIPPED_SPRUCE_WOOD = BlockTypes.key(ResourceKey.minecraft("stripped_spruce_wood"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public final class BlockEntityTypes {

public static final DefaultedRegistryReference<BlockEntityType> CRAFTER = BlockEntityTypes.key(ResourceKey.minecraft("crafter"));

public static final DefaultedRegistryReference<BlockEntityType> CREAKING_HEART = BlockEntityTypes.key(ResourceKey.minecraft("creaking_heart"));

public static final DefaultedRegistryReference<BlockEntityType> DAYLIGHT_DETECTOR = BlockEntityTypes.key(ResourceKey.minecraft("daylight_detector"));

public static final DefaultedRegistryReference<BlockEntityType> DECORATED_POT = BlockEntityTypes.key(ResourceKey.minecraft("decorated_pot"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* 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 <a href="https://minecraft.wiki/Creaking_Heart">Creaking Heart</a>
*/
@Experimental("winter_drop")
@ApiStatus.Experimental
public interface CreakingHeart extends BlockEntity {

}
5 changes: 5 additions & 0 deletions src/main/java/org/spongepowered/api/data/BlockStateKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -116,6 +117,8 @@ public final class BlockStateKeys {

public static final Key<Value<Boolean>> CRAFTING = BlockStateKeys.key(ResourceKey.minecraft("property/crafting"), Boolean.class);

public static final Key<Value<CreakingHeart>> CREAKING = BlockStateKeys.key(ResourceKey.minecraft("property/creaking"), CreakingHeart.class);

public static final Key<Value<Integer>> DELAY = BlockStateKeys.key(ResourceKey.minecraft("property/delay"), Integer.class);

public static final Key<Value<Boolean>> DISARMED = BlockStateKeys.key(ResourceKey.minecraft("property/disarmed"), Boolean.class);
Expand Down Expand Up @@ -264,6 +267,8 @@ public final class BlockStateKeys {

public static final Key<Value<Tilt>> TILT = BlockStateKeys.key(ResourceKey.minecraft("property/tilt"), Tilt.class);

public static final Key<Value<Boolean>> TIP = BlockStateKeys.key(ResourceKey.minecraft("property/tip"), Boolean.class);

public static final Key<Value<TrialSpawnerState>> TRIAL_SPAWNER_STATE = BlockStateKeys.key(ResourceKey.minecraft("property/trial_spawner_state"), TrialSpawnerState.class);

public static final Key<Value<Boolean>> TRIGGERED = BlockStateKeys.key(ResourceKey.minecraft("property/triggered"), Boolean.class);
Expand Down
43 changes: 40 additions & 3 deletions src/main/java/org/spongepowered/api/data/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -656,7 +662,7 @@ public final class Keys {
* The carvers of a {@link Biome} used during world generation.
* Readonly
*/
public static final Key<MapValue<CarvingStep, List<Carver>>> CARVERS = Keys.mapKey(ResourceKey.sponge("carvers"), TypeToken.get(CarvingStep.class), new TypeToken<List<Carver>>() {});
public static final Key<ListValue<Carver>> CARVERS = Keys.listKey(ResourceKey.sponge("carvers"), Carver.class);

/**
* The current casting time of a {@link Spellcaster}.
Expand Down Expand Up @@ -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<Value<Ticks>> 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<Value<ResourceKey>> 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}.
Expand All @@ -764,6 +785,22 @@ public final class Keys {
*/
public static final Key<Value<Double>> 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<Value<Vector3i>> 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<Value<Boolean>> 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.
* <p>By default, the dragon only spawns in the {@link DefaultWorldKeys#THE_END} world with {@link WorldTypes#THE_END} world type.</p>
Expand Down Expand Up @@ -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.</p>
*/
public static final Key<Value<Integer>> EXPLOSION_RADIUS = Keys.key(ResourceKey.sponge("explosion_radius"), Integer.class);
public static final Key<Value<Float>> EXPLOSION_RADIUS = Keys.key(ResourceKey.sponge("explosion_radius"), Float.class);

/**
* The eye height of an {@link Entity}.
Expand Down
Loading