Skip to content
Merged
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=16.0.0-SNAPSHOT
version=17.0.0-SNAPSHOT
organization=SpongePowered
projectUrl=https://www.spongepowered.org
projectDescription=A plugin API for Minecraft: Java Edition
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ junit-launcher = { module = "org.junit.platform:junit-platform-launcher" }
mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }

[plugins]
errorprone = { id = "net.ltgt.errorprone", version = "3.1.0" }
errorprone = { id = "net.ltgt.errorprone", version = "4.3.0" }
eventImplGen = { id = "org.spongepowered.gradle.event-impl-gen", version = "7.1.0" }
ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExt" }
indra-checkstyle = { id = "net.kyori.indra.checkstyle", version.ref = "indra" }
Expand Down
13 changes: 13 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,11 @@
<sha256 value="8776a213deaa1cbbadb77820225211e1b9adead2341b55cc35bc92c9076620a3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.ltgt.errorprone" name="net.ltgt.errorprone.gradle.plugin" version="4.3.0">
<artifact name="net.ltgt.errorprone.gradle.plugin-4.3.0.pom">
<sha256 value="3370e20ef3213ffce47f7fda31266c33e9cca3b1b7f4d54169b482277042654b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.ltgt.gradle" name="gradle-errorprone-plugin" version="3.1.0">
<artifact name="gradle-errorprone-plugin-3.1.0.jar">
<sha256 value="10fb66b55747ced1db9c89c8c3d0adb5dbd3f8f12f2a183bee2b5ff818d1fd6c" origin="Generated by Gradle"/>
Expand All @@ -1396,6 +1401,14 @@
<sha256 value="d393a0d3337193cb21b64a98714a1da8a966349be214cbb16171a9925a7985ee" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.ltgt.gradle" name="gradle-errorprone-plugin" version="4.3.0">
<artifact name="gradle-errorprone-plugin-4.3.0.jar">
<sha256 value="42f89c1f582ecd09459586d3d19c0fa92a332035e4a70b5699a8ec6a81aec32c" origin="Generated by Gradle"/>
</artifact>
<artifact name="gradle-errorprone-plugin-4.3.0.module">
<sha256 value="6d2b0a7809ffde227ec15a4cf28e68929be22a1a12a0f56ad5e795d5058f2f6e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sf.saxon" name="Saxon-HE" version="12.4">
<artifact name="Saxon-HE-12.4.jar">
<sha256 value="575f8b696e3b6f9aa7a3bf01611b8bf1b84576b55ce29bc16656a53a147ef441" origin="Generated by Gradle"/>
Expand Down
126 changes: 124 additions & 2 deletions src/main/java/org/spongepowered/api/block/BlockTypes.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public final class BlockEntityTypes {

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

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

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

public static final DefaultedRegistryReference<BlockEntityType> CREAKING_HEART = BlockEntityTypes.key(ResourceKey.minecraft("creaking_heart"));
Expand Down Expand Up @@ -114,6 +116,8 @@ public final class BlockEntityTypes {

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

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

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

public static final DefaultedRegistryReference<BlockEntityType> SIGN = BlockEntityTypes.key(ResourceKey.minecraft("sign"));
Expand Down
30 changes: 18 additions & 12 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.CopperGolemPose;
import org.spongepowered.api.data.type.CreakingHeartState;
import org.spongepowered.api.data.type.DoorHinge;
import org.spongepowered.api.data.type.DripstoneSegment;
Expand All @@ -39,6 +40,7 @@
import org.spongepowered.api.data.type.PortionType;
import org.spongepowered.api.data.type.RailDirection;
import org.spongepowered.api.data.type.SculkSensorState;
import org.spongepowered.api.data.type.SideChain;
import org.spongepowered.api.data.type.SlabPortion;
import org.spongepowered.api.data.type.StairShape;
import org.spongepowered.api.data.type.StructureMode;
Expand Down Expand Up @@ -100,20 +102,10 @@ public final class BlockStateKeys {

public static final Key<Value<ChestAttachmentType>> CHEST_TYPE = BlockStateKeys.key(ResourceKey.minecraft("property/type"), ChestAttachmentType.class);

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

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

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

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

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

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

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

public static final Key<Value<CopperGolemPose>> COPPER_GOLEM_POSE = BlockStateKeys.key(ResourceKey.minecraft("property/copper_golem_pose"), CopperGolemPose.class);

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

public static final Key<Value<Boolean>> CRAFTING = BlockStateKeys.key(ResourceKey.minecraft("property/crafting"), Boolean.class);
Expand Down Expand Up @@ -254,10 +246,24 @@ public final class BlockStateKeys {

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

public static final Key<Value<SideChain>> SIDE_CHAIN_PART = BlockStateKeys.key(ResourceKey.minecraft("property/side_chain"), SideChain.class);

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

public static final Key<Value<SlabPortion>> SLAB_TYPE = BlockStateKeys.key(ResourceKey.minecraft("property/type"), SlabPortion.class);

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

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

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

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

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

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

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

public static final Key<Value<Boolean>> SOUTH = BlockStateKeys.key(ResourceKey.minecraft("property/south"), Boolean.class);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spongepowered/api/data/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public interface DataManager {
* be read by a plugin-data datastore.
*
* @param legacyId The legacy id
* @param dataStoreKey The dataStore key set in {@link org.spongepowered.api.data.persistence.DataStore.Builder.HolderStep#pluginData(ResourceKey)}
* @param dataStoreKey The dataStore key set in {@link org.spongepowered.api.data.persistence.DataStore.Builder#pluginData(ResourceKey)}
*/
void registerLegacyManipulatorIds(String legacyId, ResourceKey dataStoreKey);

Expand Down
65 changes: 65 additions & 0 deletions src/main/java/org/spongepowered/api/data/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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.CopperOxidation;
import org.spongepowered.api.data.type.DoorHinge;
import org.spongepowered.api.data.type.DripstoneSegment;
import org.spongepowered.api.data.type.DyeColor;
Expand Down Expand Up @@ -90,6 +91,8 @@
import org.spongepowered.api.data.type.RailDirection;
import org.spongepowered.api.data.type.SalmonSize;
import org.spongepowered.api.data.type.SculkSensorState;
import org.spongepowered.api.data.type.ShieldDamageReduction;
import org.spongepowered.api.data.type.ShieldItemDamageFunction;
import org.spongepowered.api.data.type.SkinPart;
import org.spongepowered.api.data.type.SlabPortion;
import org.spongepowered.api.data.type.SpellType;
Expand Down Expand Up @@ -174,6 +177,7 @@
import org.spongepowered.api.entity.living.aquatic.fish.Pufferfish;
import org.spongepowered.api.entity.living.aquatic.fish.school.Salmon;
import org.spongepowered.api.entity.living.aquatic.fish.school.TropicalFish;
import org.spongepowered.api.entity.living.golem.CopperGolem;
import org.spongepowered.api.entity.living.golem.IronGolem;
import org.spongepowered.api.entity.living.golem.Shulker;
import org.spongepowered.api.entity.living.monster.Blaze;
Expand Down Expand Up @@ -224,6 +228,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.DamageType;
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;
Expand Down Expand Up @@ -257,6 +262,7 @@
import org.spongepowered.api.raid.RaidWave;
import org.spongepowered.api.registry.DefaultedRegistryType;
import org.spongepowered.api.statistic.Statistic;
import org.spongepowered.api.tag.BlockTypeTags;
import org.spongepowered.api.tag.Tag;
import org.spongepowered.api.util.Axis;
import org.spongepowered.api.util.Color;
Expand Down Expand Up @@ -639,6 +645,11 @@ public final class Keys {
*/
public static final Key<Value<Integer>> BURN_TIME = Keys.key(ResourceKey.sponge("burn_time"), Integer.class);

/**
* The {@link DamageType} tag that bypasses a shield-like {@link ItemStack}.
*/
public static final Key<Value<Tag<DamageType>>> BYPASS_DAMAGE_TAG = Keys.key(ResourceKey.sponge("bypass_damage_tag"), new TypeToken<>() {});

/**
* Whether an {@link ItemStack} can always be eaten.
*/
Expand Down Expand Up @@ -794,6 +805,13 @@ public final class Keys {
*/
public static final Key<Value<ItemType>> CONTAINER_ITEM = Keys.key(ResourceKey.sponge("container_item"), ItemType.class);

/**
* The {@link CopperOxidation} state of a {@link BlockState block}
* (given that it applies to the {@link BlockTypeTags#COPPER} tag) or
* a {@link CopperGolem}
*/
public static final Key<Value<CopperOxidation>> COPPER_OXIDATION = Keys.key(ResourceKey.sponge("copper_oxidation"), CopperOxidation.class);

/**
* The {@link ItemStack} a food {@link ItemStack} converts to when eaten.
*/
Expand Down Expand Up @@ -976,6 +994,17 @@ public final class Keys {
*/
public static final Key<Value<Direction>> DIRECTION = Keys.key(ResourceKey.sponge("direction"), Direction.class);

/**
* The amount of {@link Ticks} this {@link ItemStack} disables blocking with a shield-like {@link ItemStack} on a successful attack.
*/
public static final Key<Value<Ticks>> DISABLE_SHIELD_TICKS = Keys.key(ResourceKey.sponge("disable_shield_ticks"), Ticks.class);

/**
* The multiplier applied to the cooldown time during which blocking using this shield-like {@link ItemStack} is disabled.
* If set to 0, this item can never be disabled by attacks.
*/
public static final Key<Value<Double>> DISABLE_SHIELD_TICKS_SCALE = Keys.key(ResourceKey.sponge("disable_shield_ticks_scale"), Double.class);

/**
* The display name of an {@link Entity}, {@link ItemStack} or {@link BlockEntity}.
*
Expand Down Expand Up @@ -3046,6 +3075,31 @@ public final class Keys {
*/
public static final Key<Value<Double>> SHADOW_STRENGTH = Keys.key(ResourceKey.sponge("shadow_strength"), Double.class);

/**
* The sound played when blocking an attack with a shield-like {@link ItemStack}.
*/
public static final Key<Value<SoundType>> SHIELD_BLOCK_SOUND = Keys.key(ResourceKey.sponge("shield_block_sound"), SoundType.class);

/**
* The amount of attack damage a shield-like {@link ItemStack} reduces for certain {@link DamageType}s
*/
public static final Key<ListValue<ShieldDamageReduction<?>>> SHIELD_DAMAGE_REDUCTIONS = Keys.listKey(ResourceKey.sponge("shield_damage_reductions"), new TypeToken<>() {});

/**
* The amount of {@link Ticks} player must use this shield-like {@link ItemStack} for to block attacks successfully.
*/
public static final Key<Value<Ticks>> SHIELD_DEPLOY_TICKS = Keys.key(ResourceKey.sponge("shield_deploy_ticks"), Ticks.class);

/**
* The sound played when a shield-like {@link ItemStack} is disabled.
*/
public static final Key<Value<SoundType>> SHIELD_DISABLE_SOUND = Keys.key(ResourceKey.sponge("shield_disable_sound"), SoundType.class);

/**
* Function for the amount of {@link Keys#ITEM_DURABILITY} damage a shield-like {@link ItemStack} takes when blocking an attack.
*/
public static final Key<Value<ShieldItemDamageFunction<?>>> SHIELD_ITEM_DAMAGE_FUNCTION = Keys.key(ResourceKey.sponge("shield_item_damage_function"), new TypeToken<>() {});

/**
* The shooter of a {@link Projectile}.
*/
Expand Down Expand Up @@ -3534,6 +3588,17 @@ public final class Keys {
*/
public static final Key<Value<Color>> WATER_FOG_COLOR = Keys.key(ResourceKey.sponge("water_fog_color"), Color.class);

/**
* The state of whether a {@link BlockState} that is a copper block is waxed, or if a {@link CopperGolem}
* is waxed.
*/
public static final Key<Value<Boolean>> WAXED = Keys.key(ResourceKey.sponge("waxed"), Boolean.class);

/**
* The {@link #ITEM_DURABILITY} damage an {@link ItemStack} takes per attack.
*/
public static final Key<Value<Integer>> WEAPON_DAMAGE_PER_ATTACK = Keys.key(ResourceKey.sponge("weapon_damage_per_attack"), Integer.class);

/**
* The weather of a {@link ServerWorldProperties}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public final class ArmorMaterials {

public static final DefaultedRegistryReference<ArmorMaterial> CHAINMAIL = ArmorMaterials.key(ResourceKey.minecraft("chainmail"));

public static final DefaultedRegistryReference<ArmorMaterial> COPPER = ArmorMaterials.key(ResourceKey.minecraft("copper"));

public static final DefaultedRegistryReference<ArmorMaterial> DIAMOND = ArmorMaterials.key(ResourceKey.minecraft("diamond"));

public static final DefaultedRegistryReference<ArmorMaterial> GOLD = ArmorMaterials.key(ResourceKey.minecraft("gold"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
import org.spongepowered.api.util.annotation.CatalogedBy;

@CatalogedBy(ChickenVariants.class)
public interface ChickenVariant extends DefaultedRegistryValue {
public interface ChickenVariant extends DefaultedRegistryValue<ChickenVariant> {
}
32 changes: 32 additions & 0 deletions src/main/java/org/spongepowered/api/data/type/CopperGolemPose.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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.data.type;

import org.spongepowered.api.registry.DefaultedRegistryValue;
import org.spongepowered.api.util.annotation.CatalogedBy;

@CatalogedBy(CopperGolemPoses.class)
public interface CopperGolemPose extends DefaultedRegistryValue<CopperGolemPose>, StringRepresentable, Comparable<CopperGolemPose> {
}
Loading