Skip to content

Commit

Permalink
Merge pull request #410 from okocraft/dev/1.21.2
Browse files Browse the repository at this point in the history
Minecraft 1.21.2/1.21.3
  • Loading branch information
Siroshun09 authored Oct 31, 2024
2 parents d76d0cf + a281088 commit 2ccfd0b
Show file tree
Hide file tree
Showing 56 changed files with 1,887 additions and 108 deletions.
5 changes: 0 additions & 5 deletions annotation-processor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
plugins {
id("box.common-conventions")
}

dependencies {
implementation(projects.boxApi)
implementation(projects.boxVersionCommon)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.okocraft.box.api.model.customdata;

import com.github.siroshun09.configapi.core.node.MapNode;
import dev.siroshun.configapi.core.node.MapNode;
import net.kyori.adventure.key.Key;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ record WithdrawalImpl(@NotNull StockHolder stockHolder, @NotNull BoxItem boxItem
var item = contents[i];

if (item == null) {
if (view != null && !checkClickEvent(view, i)) {
if (view != null && fireClickEventAndCheckCancelled(view, i)) {
continue;
}

Expand All @@ -53,7 +53,7 @@ record WithdrawalImpl(@NotNull StockHolder stockHolder, @NotNull BoxItem boxItem
withdrawnAmount += withdrawn;
contents[i] = this.boxItem.getOriginal().asQuantity(withdrawn);
} else if (item.isSimilar(this.boxItem.getOriginal())) {
if (view != null && !checkClickEvent(view, i)) {
if (view != null && fireClickEventAndCheckCancelled(view, i)) {
continue;
}

Expand All @@ -79,7 +79,7 @@ record WithdrawalImpl(@NotNull StockHolder stockHolder, @NotNull BoxItem boxItem
return TransactionResult.create(this.boxItem, withdrawnAmount);
}

private static boolean checkClickEvent(@NotNull InventoryView view, int slot) {
return new InventoryClickEvent(view, InventoryType.SlotType.CONTAINER, slot, ClickType.LEFT, InventoryAction.PLACE_ALL).callEvent();
private static boolean fireClickEventAndCheckCancelled(@NotNull InventoryView view, int slot) {
return !new InventoryClickEvent(view, InventoryType.SlotType.CONTAINER, slot, ClickType.LEFT, InventoryAction.PLACE_ALL).callEvent();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.okocraft.box.api.transaction;

import com.github.siroshun09.configapi.core.serialization.annotation.CollectionType;
import com.github.siroshun09.configapi.core.serialization.annotation.MapType;
import dev.siroshun.configapi.core.serialization.annotation.CollectionType;
import dev.siroshun.configapi.core.serialization.annotation.MapType;
import net.okocraft.box.api.model.item.BoxItem;
import net.okocraft.box.api.model.manager.ItemManager;
import net.okocraft.box.api.util.ItemNameGenerator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.okocraft.box.api.transaction;

import com.github.siroshun09.configapi.core.serialization.annotation.Inline;
import dev.siroshun.configapi.core.serialization.annotation.Inline;
import net.okocraft.box.test.shared.event.StockEventCollector;
import net.okocraft.box.test.shared.mock.bukkit.inventory.InventoryInfo;
import net.okocraft.box.test.shared.model.item.ItemType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.okocraft.box.api.transaction;

import com.github.siroshun09.configapi.core.serialization.annotation.Inline;
import dev.siroshun.configapi.core.serialization.annotation.Inline;
import net.okocraft.box.api.model.stock.StockData;
import net.okocraft.box.test.shared.event.StockEventCollector;
import net.okocraft.box.test.shared.mock.bukkit.inventory.InventoryInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.okocraft.box.api.util;

import com.github.siroshun09.configapi.core.serialization.annotation.Inline;
import dev.siroshun.configapi.core.serialization.annotation.Inline;
import net.okocraft.box.test.shared.mock.bukkit.inventory.InventoryInfo;
import net.okocraft.box.test.shared.model.item.ItemType;
import net.okocraft.box.test.shared.util.TestCaseLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies {
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
testImplementation(libs.annotations)
testImplementation(libs.configapi.test.shared.classes)
testImplementation(libs.fastutil)
testImplementation(libs.mockito)

Expand Down
2 changes: 1 addition & 1 deletion bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tasks {
}

runServer {
minecraftVersion("1.21.1")
minecraftVersion("1.21.3")
systemProperty("com.mojang.eula.agree", "true")
systemProperty("paper.disablePluginRemapping", "true")
}
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/net/okocraft/box/core/config/Config.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package net.okocraft.box.core.config;

import com.github.siroshun09.configapi.core.comment.SimpleComment;
import com.github.siroshun09.configapi.core.node.CommentableNode;
import com.github.siroshun09.configapi.core.node.MapNode;
import com.github.siroshun09.configapi.core.node.StringValue;
import com.github.siroshun09.configapi.core.serialization.key.KeyGenerator;
import com.github.siroshun09.configapi.core.serialization.record.RecordDeserializer;
import com.github.siroshun09.configapi.core.serialization.record.RecordSerializer;
import com.github.siroshun09.configapi.format.yaml.YamlFormat;
import dev.siroshun.configapi.core.comment.SimpleComment;
import dev.siroshun.configapi.core.node.CommentableNode;
import dev.siroshun.configapi.core.node.MapNode;
import dev.siroshun.configapi.core.node.StringValue;
import dev.siroshun.configapi.core.serialization.key.KeyGenerator;
import dev.siroshun.configapi.core.serialization.record.RecordDeserializer;
import dev.siroshun.configapi.core.serialization.record.RecordSerializer;
import dev.siroshun.configapi.format.yaml.YamlFormat;
import net.okocraft.box.api.util.BoxLogger;
import net.okocraft.box.storage.api.model.Storage;
import net.okocraft.box.storage.api.registry.StorageRegistry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.okocraft.box.core.config;

import com.github.siroshun09.configapi.core.serialization.annotation.CollectionType;
import com.github.siroshun09.configapi.core.serialization.annotation.Comment;
import dev.siroshun.configapi.core.serialization.annotation.CollectionType;
import dev.siroshun.configapi.core.serialization.annotation.Comment;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.okocraft.box.core.config;

import com.github.siroshun09.configapi.core.serialization.annotation.Comment;
import com.github.siroshun09.configapi.core.serialization.annotation.DefaultLong;
import dev.siroshun.configapi.core.serialization.annotation.Comment;
import dev.siroshun.configapi.core.serialization.annotation.DefaultLong;
import net.okocraft.box.api.util.BoxLogger;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.okocraft.box.core.model.manager.customdata;

import com.github.siroshun09.configapi.core.node.MapNode;
import dev.siroshun.configapi.core.node.MapNode;
import net.kyori.adventure.key.Key;
import net.okocraft.box.api.model.customdata.CustomDataManager;
import net.okocraft.box.storage.api.model.data.CustomDataStorage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.okocraft.box.api.event.BoxEvent;
import net.okocraft.box.api.event.item.ItemImportEvent;
import net.okocraft.box.api.model.item.BoxItem;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -60,10 +59,6 @@ boolean isRegistered(@NotNull ItemStack itemStack) {
@Nullable BoxItem getByItemStack(@NotNull ItemStack item) {
Objects.requireNonNull(item);

if (!item.hasItemMeta() && item.getType() != Material.FIREWORK_ROCKET) {
return this.getByItemName(item.getType().name());
}

var one = item.getAmount() == 1 ? item : item.asOne();

{
Expand Down
4 changes: 2 additions & 2 deletions data-generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
group = "net.okocraft.box.datagenerator"
version = "1.0"

val previousMinecraftVersion = "1.20.6"
val minecraftVersion = "1.21.1"
val previousMinecraftVersion = "1.21"
val minecraftVersion = "1.21.3"
val javaVersion = JavaVersion.VERSION_21

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public void newDefaultItems(@NotNull Path dir, @NotNull String prev) throws IOEx
}
}

@SuppressWarnings("deprecation")
public void uncategorizedItems(@NotNull Path dir) throws IOException {
var categorizedItems =
DefaultCategories.loadDefaultCategories(MCDataVersion.current())
Expand All @@ -93,7 +92,7 @@ public void uncategorizedItems(@NotNull Path dir) throws IOException {
.forEach(name -> {
try {
writer.write(" - ");
writer.write(String.valueOf(Bukkit.getUnsafe().getDataVersion()));
writer.write(String.valueOf(MCDataVersion.current().dataVersion()));
writer.write(":");
writer.write(name);
writer.newLine();
Expand Down
Loading

0 comments on commit 2ccfd0b

Please sign in to comment.