Skip to content

Commit

Permalink
Merge branch 'api-11' into api-11-container
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHell228 committed Sep 13, 2024
2 parents 21270d3 + fcfb921 commit 0ba43af
Show file tree
Hide file tree
Showing 111 changed files with 2,111 additions and 877 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-spotless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
call-check:
uses: SpongePowered/.github/.github/workflows/shared-check-spotless.yaml@master
with:
runtime_version: 17
runtime_version: 21
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/check-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
call-check:
uses: SpongePowered/.github/.github/workflows/shared-check-style.yaml@master
with:
runtime_version: 17
runtime_version: 21
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
call-build:
uses: SpongePowered/.github/.github/workflows/shared-ci.yaml@master
with:
runtime_version: 17
runtime_version: 21
publish_snapshot_javadoc: true
publishing_branch_regex: 'api-\d+'
secrets: inherit
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SpongeAPI ![Build Status](https://github.com/SpongePowered/SpongeAPI/actions/workflows/ci.yaml/badge.svg?branch=api-10)
SpongeAPI ![Build Status](https://github.com/SpongePowered/SpongeAPI/actions/workflows/ci.yaml/badge.svg?branch=api-11)
=============
A mature Minecraft plugin API (not including an implementation), licensed under the [MIT License].

Expand All @@ -11,7 +11,7 @@ A mature Minecraft plugin API (not including an implementation), licensed under
* [Discord] `#plugins`

## Prerequisites
* [Java] 17
* [Java] 21

## Clone
The following steps will ensure your project is cloned properly.
Expand All @@ -24,7 +24,7 @@ __Note:__ If you do not have [Gradle] installed then use ./gradlew for Unix syst

In order to build SpongeAPI you simply need to run the `gradle` command. You can find the compiled JAR file in `./build/libs` labeled similarly to 'spongeapi-x.x.x-SNAPSHOT.jar'.

Sponge will use a javac version of *at least* 17. If an older JDK is used to launch Gradle, JDK 17 will be downloaded automatically.
Sponge will use a javac version of *at least* 21. If an older JDK is used to launch Gradle, JDK 21 will be downloaded automatically.

## Contributing
Are you a talented programmer looking to contribute some code? We'd love the help!
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ dependencies {

tasks {
genEventImpl {
sourceCompatibility = javaTarget
sourceCompatibility = "17" // TODO use javaTarget here
destinationDirectory = project.layout.buildDirectory.dir("generated/event-factory")

outputFactory = "org.spongepowered.api.event.SpongeEventFactory"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
group=org.spongepowered
version=11.0.0-SNAPSHOT
version=11.1.0-SNAPSHOT
organization=SpongePowered
projectUrl=https://www.spongepowered.org
projectDescription=A plugin API for Minecraft: Java Edition
javaTarget=17
javaTarget=21

javadocPublishRoot=https://jd.spongepowered.org/

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format = { version = "1.1" }

[versions]
adventure = "4.16.0"
adventure = "4.17.0"
caffeine = "3.1.8"
checker = "3.42.0"
checkstyle = "10.12.7"
Expand All @@ -13,7 +13,7 @@ guice = "5.0.1"
ideaExt = "1.1.8"
indra = "3.1.3"
junit = "5.10.2"
log4j = "2.19.0"
log4j = "2.22.1"
math = "2.0.1"
mockito = "5.11.0"
pluginSpi = "0.3.0"
Expand Down
187 changes: 187 additions & 0 deletions gradle/verification-metadata.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import javax.tools.Diagnostic;

@SupportedAnnotationTypes(ListenerProcessor.LISTENER_ANNOTATION_CLASS)
@SupportedSourceVersion(SourceVersion.RELEASE_17)
@SupportedSourceVersion(SourceVersion.RELEASE_21)
public class ListenerProcessor extends AbstractProcessor {

static final String LISTENER_ANNOTATION_CLASS = "org.spongepowered.api.event.Listener";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/spongepowered/api/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.audience.ForwardingAudience;
import net.kyori.adventure.resource.ResourcePackRequest;
import net.kyori.adventure.text.Component;
import org.spongepowered.api.block.entity.CommandBlock;
import org.spongepowered.api.command.manager.CommandManager;
Expand All @@ -38,7 +39,6 @@
import org.spongepowered.api.map.MapStorage;
import org.spongepowered.api.network.ServerSideConnection;
import org.spongepowered.api.profile.GameProfileManager;
import org.spongepowered.api.resourcepack.ResourcePack;
import org.spongepowered.api.scoreboard.Scoreboard;
import org.spongepowered.api.service.ServiceProvider;
import org.spongepowered.api.user.UserManager;
Expand Down Expand Up @@ -131,11 +131,11 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
Component motd();

/**
* Gets the {@link ResourcePack pack} sent to clients when they join.
* Gets the {@link ResourcePackRequest pack} sent to clients when they join.
*
* @return The resource pack
*/
Optional<ResourcePack> resourcePack();
Optional<ResourcePackRequest> resourcePack();

/**
* Gets the player idle timeout, in minutes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public final class Triggers {

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

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

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

public static final DefaultedRegistryReference<Trigger<?>> BEE_NEST_DESTROYED = Triggers.key(ResourceKey.minecraft("bee_nest_destroyed"));
Expand All @@ -58,8 +60,12 @@ public final class Triggers {

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

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

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

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

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

public static final DefaultedRegistryReference<Trigger<?>> ENCHANTED_ITEM = Triggers.key(ResourceKey.minecraft("enchanted_item"));
Expand All @@ -70,6 +76,8 @@ public final class Triggers {

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

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

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

public static final DefaultedRegistryReference<Trigger<?>> FILLED_BUCKET = Triggers.key(ResourceKey.minecraft("filled_bucket"));
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/spongepowered/api/block/BlockTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,8 @@ public final class BlockTypes {

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

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

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

public static final DefaultedRegistryReference<BlockType> HONEY_BLOCK = BlockTypes.key(ResourceKey.minecraft("honey_block"));
Expand Down Expand Up @@ -1940,6 +1942,8 @@ public final class BlockTypes {

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

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

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

public static final DefaultedRegistryReference<BlockType> VINE = BlockTypes.key(ResourceKey.minecraft("vine"));
Expand Down
25 changes: 5 additions & 20 deletions src/main/java/org/spongepowered/api/block/entity/BlockEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,16 @@
public interface BlockEntity extends SerializableDataHolder.Mutable, Locatable {

/**
* Checks for whether the block entity is currently valid or not.
* Returns whether this block entity has been removed.
*
* <p>Use this method to check if processing should be run on this
* {@link BlockEntity}. If it is valid, then processing can be run on it.
* If not, then processing should wait until it becomes valid or is
* destroyed.</p>
*
* @return True if the block entity is valid, false if not
* @return True if this block entity has been removed
*/
boolean isValid();
boolean isRemoved();

/**
* Changes the validation of this block entity.
*
* <p>If the block entity is invalid, no processing will be done on this
* {@link BlockEntity} until it either becomes valid or is reset on the next
* tick.</p>
*
* <p>If the block entity is valid, then processing can continue and this
* {@link BlockEntity} will not be reset on the next tick.</p>
*
* @param valid True if the block entity should be validated, or false if
* it should be invalidated
* Removes this block entity from the world and its corresponding block.
*/
void setValid(boolean valid);
void remove();

/**
* Gets the type of {@link BlockEntity} this is.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public final class BlockEntityTypes {

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

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

private BlockEntityTypes() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.spongepowered.api.command.exception.CommandException;
import org.spongepowered.api.command.parameter.CommandContext;


/**
* Interface containing the method directing how a certain command will
* be executed.
Expand Down
Loading

0 comments on commit 0ba43af

Please sign in to comment.