Compare commits

..

6 Commits

Author SHA1 Message Date
Helvetica Volubi 28ce6ae7b1 Update Luminol & fix up CI 2025-09-19 15:10:55 +08:00
Helvetica Volubi af4a8a8731 Update Luminol 2025-09-13 22:17:35 +08:00
Helvetica Volubi 7059c6a062 Update Luminol & Leaves Redstone Shears Wrench 2025-09-13 04:03:53 +08:00
Helvetica Volubi 98a8b65665 Update Luminol 2025-09-13 02:39:56 +08:00
Helvetica Volubi ac6b1e2377 Update Luminol 2025-09-12 05:09:04 +08:00
Helvetica Volubi 0e964ae71c fixes #58 2025-09-11 17:24:13 +08:00
9 changed files with 103 additions and 52 deletions
+71 -5
View File
@@ -7,6 +7,20 @@ on:
pull_request:
branches:
- "**"
workflow_dispatch:
inputs:
force-release:
description: "Force release if you enter 1, default release if not released else skip release"
required: false
default: "0"
force-push:
description: "Push to repo if you enter 1, default push if not released else skip push repo"
required: false
default: "0"
comments:
description: "Add comments to release"
required: false
default: ""
permissions: write-all
@@ -18,7 +32,7 @@ jobs:
- name: Checkout Git Repository
uses: actions/checkout@v5
- name: Set up JDK
- name: Set Up JDK
uses: actions/setup-java@v5
with:
distribution: zulu
@@ -49,20 +63,51 @@ jobs:
if: github.event_name != 'pull_request'
run: sh scripts/SetENV.sh
- name: Check If Release Exists
if: github.event_name != 'pull_request' && env.flag_release == 'true'
run: |
git fetch --tags
if [ -n "$(git tag -l "${{ env.tag }}")" ]; then
echo "Release already exists"
release_exists=true
else
echo "Release does not exist"
release_exists=false
fi
if [ "$release_exists" == "true" ]; then
counter=1
while [ -n "$(git tag -l "${{ env.tag }}-${counter}")" ]; do
counter=$((counter + 1))
done
echo "tag=${{ env.tag }}-${counter}" >> $GITHUB_ENV
echo "release_count= - ${counter}" >> $GITHUB_ENV
fi
echo "release_exists=${release_exists}" >> $GITHUB_ENV
- name: Publish to repo
if: github.event_name != 'pull_request' && env.flag_release == 'true' && false # do not push to any repo
if: (( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' ) || ( env.release_exists == 'true' && inputs.force-push == '1' )) && false # do not push to any repo
continue-on-error: true
run: ./gradlew --refresh-dependencies generateDevelopmentBundle publish -PpublishDevBundle=true
env:
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
- name: Create Release
if: github.event_name != 'pull_request' && env.flag_release == 'true'
- name: Create Release - Pre Process
if: ( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' ) || ( env.release_exists == 'true' && inputs.force-release == '1' )
run: |
if [ ${{ inputs.comments }} == "" ]; then
echo "No comments provided"
echo "flag_comment=true" >> $GITHUB_ENV
else
echo "flag_comment=false" >> $GITHUB_ENV
fi
- name: Create Release - No Comment
if: env.flag_comment == 'false'
uses: ncipollo/release-action@v1
with:
tag: ${{ env.tag }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}${{ env.release_count }}
body: |
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [![download](https://img.shields.io/github/downloads/LuminolMC/${{ env.project_id }}/${{ env.tag }}/total?color=red&style=flat-square)](https://github.com/LuminolMC/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
This release is automatically compiled by GitHub Actions
@@ -75,3 +120,24 @@ jobs:
prerelease: ${{ env.pre }}
makeLatest: ${{ env.make_latest }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release - With Comment
if: env.flag_comment == 'true'
uses: ncipollo/release-action@v1
with:
tag: ${{ env.tag }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}${{ env.release_count }}
body: |
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [![download](https://img.shields.io/github/downloads/LuminolMC/${{ env.project_id }}/${{ env.tag }}/total?color=red&style=flat-square)](https://github.com/LuminolMC/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
This release is automatically compiled by GitHub Actions
### Comments
> ${{ inputs.comments }}
### Branch Info
> ${{ github.ref_name }}
### Commit Message
${{ env.commit_msg }}
artifacts: ${{ env.jar_dir }}
generateReleaseNotes: true
prerelease: ${{ env.pre }}
makeLatest: ${{ env.make_latest }}
token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -4,7 +4,7 @@ mcVersion=1.21.8
release=2
# 0 for skip release, 1 for pre-release, 2 for release
luminolRef=0bf42dcc8d6c09fab78d1bdc5335cb38d7a1f5dc
luminolRef=ab525054c73906ef8120333387b1602dd3376229
org.gradle.configuration-cache=true
org.gradle.caching=true
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
@@ -446,10 +446,10 @@ index 10b2cc20bbf3b70e4e09dbbe14b90506e6366158..1535bb8cec8692e8d26eaff090288f1b
}
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index 4b634dbb45dfb0823e7b21cf2354f89e5a6331e9..ef32bf1351aa28953bfc625d7a7d5175181a7acc 100644
index d353b15401e629c5f367786111d5227236968d4a..e660eef2508023eef87eb6cb8f2ef0d0110f5449 100644
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -145,7 +145,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -163,7 +163,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
public void setItem(int index, ItemStack stack) {
this.unpackLootTable(null);
this.getItems().set(index, stack);
@@ -458,7 +458,7 @@ index 4b634dbb45dfb0823e7b21cf2354f89e5a6331e9..ef32bf1351aa28953bfc625d7a7d5175
}
@Override
@@ -770,9 +770,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -788,9 +788,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
if (item.isEmpty()) {
// Spigot start - SPIGOT-6693, SimpleContainer#setItem
ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
@@ -7,25 +7,6 @@ Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/79d9ef74c2684eb49060f07e1ab31c827326c9a5/leaves-server/minecraft-patches/features/0009-Redstone-Shears-Wrench.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
index 6db566adf2d0df1d26221eda04aa01738df6d3d2..24ebfdf98e343a7892af621d032c35819156deec 100644
--- a/net/minecraft/world/item/BlockItem.java
+++ b/net/minecraft/world/item/BlockItem.java
@@ -56,6 +56,14 @@ public class BlockItem extends Item {
if (blockPlaceContext == null) {
return InteractionResult.FAIL;
} else {
+ // Leaves start - shears wrench
+ if (org.leavesmc.leaves.util.ShearsWrenchUtil.shouldSkipPlace(context)) {
+ if (context.getPlayer() != null) {
+ context.getPlayer().containerMenu.forceHeldSlot(blockPlaceContext.getHand());
+ }
+ return InteractionResult.FAIL;
+ }
+ // Leaves end - shears wrench
BlockState placementState = this.getPlacementState(blockPlaceContext);
// CraftBukkit start - special case for handling block placement with water lilies and snow buckets
org.bukkit.block.BlockState bukkitState = null;
diff --git a/net/minecraft/world/item/ShearsItem.java b/net/minecraft/world/item/ShearsItem.java
index 8cf3e51e12f9cf98836657e722edb23943f9e866..5fd5e9fd4e1a79dd1a9d62a5cf0c308805979420 100644
--- a/net/minecraft/world/item/ShearsItem.java
@@ -1,6 +1,7 @@
package fun.bm.lophine.config.modules.function;
import me.earthme.luminol.config.IConfigModule;
import me.earthme.luminol.config.flags.CommandSuggestions;
import me.earthme.luminol.config.flags.ConfigClassInfo;
import me.earthme.luminol.config.flags.ConfigInfo;
import me.earthme.luminol.config.flags.TransformedConfig;
@@ -9,18 +10,21 @@ import me.earthme.luminol.enums.EnumConfigCategory;
@ConfigClassInfo(configAttribution = EnumConfigCategory.FUNCTION, mainName = "container_expansion")
public class ContainerExpansionConfig implements IConfigModule {
@TransformedConfig(name = "barrel_rows", category = {"misc", "container_expansion"})
@CommandSuggestions(suggest = {"1", "2", "3", "4", "5", "6"})
@ConfigInfo(baseName = "barrel_rows", comments =
"""
range: 1~6""")
public static int barrelRows = 3;
@TransformedConfig(name = "enderchest_rows", category = {"misc", "container_expansion"})
@CommandSuggestions(suggest = {"1", "2", "3", "4", "5", "6"})
@ConfigInfo(baseName = "enderchest_rows", comments =
"""
range: 1~6""")
public static int enderchestRows = 3;
@TransformedConfig(name = "shulker_stackable_count", category = {"misc", "container_expansion"})
@CommandSuggestions(suggest = {"1", "2", "32", "64"})
@ConfigInfo(baseName = "shulker_stackable_count", comments =
"""
range: 1~64""")
@@ -1,6 +1,7 @@
package fun.bm.lophine.config.modules.function;
import me.earthme.luminol.config.IConfigModule;
import me.earthme.luminol.config.flags.CommandSuggestions;
import me.earthme.luminol.config.flags.ConfigClassInfo;
import me.earthme.luminol.config.flags.ConfigInfo;
import me.earthme.luminol.config.flags.TransformedConfig;
@@ -43,6 +44,7 @@ public class SurvuxProtocolConfig implements IConfigModule {
public static boolean litematicsEnabled = false;
@TransformedConfig(name = "litematics-max-nbt-size", category = {"misc", "survux-protocol"})
@CommandSuggestions(suggest = {"-1", "2097152"})
@ConfigInfo(baseName = "litematics-max-nbt-size")
public static int litematicsMaxNbtSize = 2097152;
}
@@ -20,6 +20,7 @@ package org.leavesmc.leaves.command.bot.subcommands;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import io.papermc.paper.adventure.PaperAdventure;
import net.minecraft.world.entity.LivingEntity;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
@@ -50,6 +51,21 @@ public class RemoveCommand extends BotSubcommand {
}
private static boolean removeBot(@NotNull ServerBot bot, @Nullable CommandSender sender) {
return removeBot(bot, sender, true);
}
private static boolean removeBot(@NotNull ServerBot bot, @Nullable CommandSender sender, boolean taskQueue) {
if (taskQueue) {
bot.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
removeBotOrigin(bot, sender);
}, null, 1L);
} else {
return removeBotOrigin(bot, sender);
}
return true;
}
private static boolean removeBotOrigin(@NotNull ServerBot bot, @Nullable CommandSender sender) {
boolean success = BotList.INSTANCE.removeBot(bot, BotRemoveEvent.RemoveReason.COMMAND, sender, false);
if (!success) {
sender = sender == null ? Bukkit.getConsoleSender() : sender;
@@ -1,20 +1,3 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.util;
import fun.bm.lophine.config.modules.function.RedStoneConfig;
@@ -25,8 +8,6 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.*;
@@ -47,6 +28,9 @@ public class ShearsWrenchUtil {
if (!RedStoneConfig.shears || !(block instanceof ObserverBlock || block instanceof DispenserBlock || block instanceof PistonBaseBlock || block instanceof HopperBlock || block instanceof RepeaterBlock || block instanceof ComparatorBlock || block instanceof CrafterBlock || block instanceof LeverBlock || block instanceof CocoaBlock || block instanceof TrapDoorBlock || block instanceof FenceGateBlock || block instanceof LightningRodBlock || block instanceof CalibratedSculkSensorBlock || block instanceof BaseRailBlock)) {
return null;
}
if (context.getPlayer() == null || !context.getPlayer().getItemInHand(invert(context.getHand())).isEmpty()) {
return null;
}
StateDefinition<Block, BlockState> blockstatelist = block.getStateDefinition();
Property<?> iblockstate;
if (block instanceof CrafterBlock) {
@@ -106,10 +90,8 @@ public class ShearsWrenchUtil {
return InteractionResult.CONSUME;
}
public static boolean shouldSkipPlace(BlockPlaceContext context) {
return RedStoneConfig.shears &&
context.getPlayer() != null &&
context.getPlayer().getItemInHand(InteractionHand.MAIN_HAND).is(Items.SHEARS);
private static InteractionHand invert(InteractionHand original) {
return original == InteractionHand.MAIN_HAND ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
}
private static <T extends Comparable<T>> BlockState cycleState(BlockState state, Property<T> property, boolean inverse) {