Skip to content

Commit

Permalink
Finish porting patches
Browse files Browse the repository at this point in the history
  • Loading branch information
SoSeDiK committed Feb 4, 2025
1 parent affdbfe commit e07ae6c
Show file tree
Hide file tree
Showing 48 changed files with 2,812 additions and 2,405 deletions.
54 changes: 29 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
name: Build
on: [workflow_dispatch, push, pull_request]
on:
workflow_dispatch:
pull_request:
push:
branches:
- "ver/**"

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: 'gradle'
- uses: gradle/wrapper-validation-action@v2
- uses: gradle/actions/setup-gradle@v3
- name: Configure Git
run: git config --global user.email "[email protected]" && git config --global user.name "Github Actions"
- name: Apply Patches
run: ./gradlew applyPatches --no-daemon --stacktrace
- name: Build
run: ./gradlew build --no-daemon --stacktrace
- name: Rebuild on Failure
if: ${{ failure() }}
run: |
./gradlew clean cleanCache
./gradlew applyPatches --no-daemon --stacktrace
./gradlew build --no-daemon --stacktrace
build:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: 'gradle'
- uses: gradle/actions/setup-gradle@v4
- name: Configure Git
run: git config --global user.email "[email protected]" && git config --global user.name "Github Actions"
- name: Apply Patches
run: ./gradlew applyAllPatches --no-daemon --stacktrace
- name: Build
run: ./gradlew build --no-daemon --stacktrace
- name: Rebuild on Failure
if: ${{ failure() }}
run: |
./gradlew clean cleanCache --refresh-dependencies
./gradlew applyAllPatches --no-daemon --stacktrace
./gradlew build --no-daemon --stacktrace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ build
/purpur-api
*.jar
test-plugin.settings.gradle.kts

ignored/
2 changes: 2 additions & 0 deletions PATCH-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
- Do not appear in /effect
- Allow riders to control horses without a saddle
- Requires a saddle on the client's side to actually control the entity. Handled by a plugin on SoSeDiK's Universe.
- Add EntityLoadsProjectileEvent
- Does not trigger when aiming the block without a projectile. Can be worked around by listening to interact event and forcing item use in there.
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,11 @@
</div>

> [!WARNING]
> Highly experimental branch, not ready for production.
> Experimental branch, likely not ready for production.
## Building and setting up

Run the following commands in the root directory:

```
./gradlew applyPatches
./gradlew createMojmapPaperclipJar
```

Publishing the dev bundle:

```
./gradlew publishToMavenLocal -PpublishDevBundle
```

For anything else, refer to [Paper](https://github.com/PaperMC/Paper/blob/master/CONTRIBUTING.md)'s/[Purpur](https://github.com/PurpurMC/Purpur/blob/HEAD/CONTRIBUTING.md)'s documentation on how to contribute.
Refer to [Paper](https://github.com/PaperMC/Paper/blob/master/CONTRIBUTING.md)'s/[Purpur](https://github.com/PurpurMC/Purpur/blob/HEAD/CONTRIBUTING.md)'s documentation on how to build/contribute.

License
---
Expand Down
5 changes: 5 additions & 0 deletions build-data/kiterino.at
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is auto generated, any changes may be overridden!
# See CONTRIBUTING.md on how to add access transformers.
public net.minecraft.world.damagesource.CombatTracker getMostSignificantFall()Lnet/minecraft/world/damagesource/CombatEntry;
public net.minecraft.world.entity.Entity rider
public net.minecraft.world.entity.Entity vehicle
public net.minecraft.world.entity.projectile.AbstractArrow startFalling()V
Expand All @@ -24,4 +25,8 @@ public-f net.minecraft.network.protocol.game.ClientboundMerchantOffersPacket off
public-f net.minecraft.network.protocol.game.ClientboundUpdateAdvancementsPacket added
public-f net.minecraft.server.dedicated.DedicatedServerProperties getServerPackInfo(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)Ljava/util/Optional;
public-f net.minecraft.server.dedicated.DedicatedServerProperties serverResourcePackInfo
public-f net.minecraft.world.damagesource.CombatTracker entries
public-f net.minecraft.world.damagesource.CombatTracker inCombat
public-f net.minecraft.world.damagesource.CombatTracker mob
public-f net.minecraft.world.damagesource.CombatTracker takingDamage
public-f net.minecraft.world.item.trading.MerchantOffer result
25 changes: 0 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,6 @@ subprojects {
}
}

//tasks.generateDevelopmentBundle {
// apiCoordinates = "me.sosedik.kiterino:kiterino-api"
// libraryRepositories.set(
// listOf(
// "https://repo.maven.apache.org/maven2/",
// paperMavenPublicUrl,
// "https://repo.purpurmc.org/snapshots",
// )
// )
//}
//
//publishing {
// if (project.providers.gradleProperty("publishDevBundle").isPresent) {
// publications.create<MavenPublication>("devBundle") {
// artifact(tasks.generateDevelopmentBundle) {
// artifactId = "dev-bundle"
// }
// }
// }
//}

tasks.register("printMinecraftVersion") {
doLast {
println(providers.gradleProperty("mcVersion").get().trim())
Expand All @@ -107,7 +86,3 @@ tasks.register("printKiterinoVersion") {
println(project.version)
}
}

//tasks.createMojmapPaperclipJar {
// outputZip.set(rootProject.layout.projectDirectory.file("kiterino.jar"))
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <[email protected]>
Date: Sat, 26 Feb 2022 16:43:33 -0800
Subject: [PATCH] Paper PR - Add FillBottleEvents for player and dispenser

https://github.com/PaperMC/Paper/pull/7513

Adds 2 events, PlayerFillBottleEvent and BlockFillBottleEvent. These
events do not have a common superclass due to needing to extend
PlayerEvent and BlockEvent respectively.

TODO: Add a common interface between Block and AreaEffectCloud,
something like BottleSource to add a "source" field to each event to get
the source of the bottle fill, water block, cauldron, beehive, or
AreaEffectCloud.

Co-authored-by: Dmitry Sidorov <[email protected]>

diff --git a/src/main/java/io/papermc/paper/event/block/BlockFillBottleEvent.java b/src/main/java/io/papermc/paper/event/block/BlockFillBottleEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..77e34fb5115aa039f10176f815ba3a0f2094e909
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/BlockFillBottleEvent.java
@@ -0,0 +1,80 @@
+package io.papermc.paper.event.block;
+
+import org.bukkit.block.Block;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
+import org.bukkit.inventory.ItemStack;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when a {@link org.bukkit.block.Dispenser} fills up a bottle.
+ */
+@NullMarked
+public class BlockFillBottleEvent extends BlockEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final ItemStack bottle;
+ private ItemStack resultItem;
+ private boolean cancelled;
+
+
+ public BlockFillBottleEvent(Block block, ItemStack bottle, ItemStack resultItem) {
+ super(block);
+ this.bottle = bottle;
+ this.resultItem = resultItem;
+ }
+
+ /**
+ * Gets the bottle item that's being filled.
+ *
+ * @return the bottle item
+ */
+ public ItemStack getBottle() {
+ return this.bottle;
+ }
+
+ /**
+ * Gets the result of the glass bottle that's being filled.
+ *
+ * @return the result of the filling
+ */
+ public ItemStack getResultItem() {
+ return this.resultItem;
+ }
+
+ /**
+ * Sets the result of the glass bottle being filled.
+ *
+ * @param resultItem the result of the filling
+ */
+ public void setResultItem(ItemStack resultItem) {
+ this.resultItem = resultItem;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return this.cancelled;
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p>
+ * Cancelling this event will prevent {@link #getBottle()} from being
+ * replaced/consumed.
+ */
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerFillBottleEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerFillBottleEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c7e6e1b2e699f6c49921ef25ebd31e39fc6646b1
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/PlayerFillBottleEvent.java
@@ -0,0 +1,88 @@
+package io.papermc.paper.event.player;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.inventory.ItemStack;
+import org.jspecify.annotations.NullMarked;
+
+@NullMarked
+public class PlayerFillBottleEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final EquipmentSlot hand;
+ private final ItemStack bottle;
+ private ItemStack resultItem;
+ private boolean cancelled;
+
+ public PlayerFillBottleEvent(Player player, EquipmentSlot hand, ItemStack bottle, ItemStack resultItem) {
+ super(player);
+ this.hand = hand;
+ this.bottle = bottle;
+ this.resultItem = resultItem;
+ }
+
+ /**
+ * The hand used to fill the bottle.
+ *
+ * @return the hand
+ */
+ public EquipmentSlot getHand() {
+ return this.hand;
+ }
+
+ /**
+ * Gets the bottle item that's being filled.
+ *
+ * @return the bottle item
+ */
+ public ItemStack getBottle() {
+ return this.bottle;
+ }
+
+ /**
+ * Gets the result of the bottle that's being filled.
+ *
+ * @return the result of the filling
+ */
+ public ItemStack getResultItem() {
+ return this.resultItem;
+ }
+
+ /**
+ * Sets the result of the bottle being filled.
+ *
+ * @param resultItem the result of the filling
+ */
+ public void setResultItem(ItemStack resultItem) {
+ this.resultItem = resultItem;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return this.cancelled;
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p>
+ * Cancelling this event will prevent {@link #getBottle()} from being
+ * replaced/consumed.
+ */
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
Loading

0 comments on commit e07ae6c

Please sign in to comment.