diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 297dbb362..5a66ee22a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -34,8 +34,8 @@ jobs: if: "!contains(github.event.head_commit.message, '--skip') && !contains(github.event.head_commit.commit.message, '--skip')" uses: softprops/action-gh-release@v1 with: - name: Latest v1.1.2 dev - tag_name: mc1.21/0-v1.1.2 + name: Latest v1.1.3 dev + tag_name: mc1.21/0-v1.1.3 body: \"changes\"=${{ github.event.head_commit.message }} token: ${{ secrets.GIT_TOKEN }} files: build/libs/*.jar diff --git a/API-DOCS.md b/API-DOCS.md index 571cd64d5..893884cd0 100644 --- a/API-DOCS.md +++ b/API-DOCS.md @@ -20,7 +20,7 @@ repositories { } dependencies { - implementation("io.github.Dueris:OriginsPaper:mc1.21~0-v1.1.2") + implementation("io.github.Dueris:OriginsPaper:mc1.21~0-v1.1.3") } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 403ee435a..13adcfb57 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ val paperweightVersion: String = "1.21-R0.1-SNAPSHOT" extra["mcMajorVer"] = "21" extra["mcMinorVer"] = "0" -extra["pluginVer"] = "v1.1.2" +extra["pluginVer"] = "v1.1.3" val mcMajorVer = extra["mcMajorVer"] as String val mcMinorVer = extra["mcMinorVer"] as String diff --git a/origins/src/main/java/me/dueris/originspaper/factory/actions/types/EntityActions.java b/origins/src/main/java/me/dueris/originspaper/factory/actions/types/EntityActions.java index 403f82a90..683014a22 100644 --- a/origins/src/main/java/me/dueris/originspaper/factory/actions/types/EntityActions.java +++ b/origins/src/main/java/me/dueris/originspaper/factory/actions/types/EntityActions.java @@ -420,9 +420,9 @@ public void run() { entity.getHandle()); String cmd = data.getString("command"); // Fix the command to support our pehuki implementation - if (cmd.replace("/", "").startsWith("scale")) { + if (cmd.contains("scale")) { if (cmd.contains("@s")) { - cmd.replace(" @s", ""); + cmd = cmd.replace(" @s", ""); } } server.getCommands().performPrefixedCommand(source, cmd); diff --git a/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/EntityConditions.java b/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/EntityConditions.java index 786ad5776..1e6a47f75 100644 --- a/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/EntityConditions.java +++ b/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/EntityConditions.java @@ -536,6 +536,11 @@ public void registerConditions() { return entity.getHandle() instanceof OwnableEntity tameable && tameable.getOwnerUUID() != null; })); + register(new ConditionFactory(OriginsPaper.apoliIdentifier("equipped_item"), (data, entity) -> { + if (!(entity.getHandle() instanceof LivingEntity livingEntity)) return false; + return ConditionExecutor.testItem(data.getJsonObject("item_condition"), + livingEntity.getItemBySlot(data.getEnumValueOrDefault("equipment_slot", EquipmentSlot.class, EquipmentSlot.MAINHAND)).getBukkitStack()); + })); register(new ConditionFactory(OriginsPaper.apoliIdentifier("using_item"), (data, entity) -> { if (!(entity.getHandle() instanceof LivingEntity livingEntity) || !livingEntity.isUsingItem()) { return false; diff --git a/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/ItemConditions.java b/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/ItemConditions.java index da917b741..48b64d6e0 100644 --- a/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/ItemConditions.java +++ b/origins/src/main/java/me/dueris/originspaper/factory/conditions/types/ItemConditions.java @@ -4,6 +4,7 @@ import me.dueris.calio.data.factory.FactoryJsonObject; import me.dueris.calio.registry.Registrable; import me.dueris.originspaper.OriginsPaper; +import me.dueris.originspaper.content.OrbOfOrigins; import me.dueris.originspaper.factory.data.types.Comparison; import me.dueris.originspaper.registry.Registries; import net.minecraft.core.Holder; @@ -12,8 +13,10 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.tags.ItemTags; +import net.minecraft.tags.TagKey; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.Equipable; +import net.minecraft.world.item.Item; import net.minecraft.world.item.component.CustomData; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeType; @@ -22,10 +25,14 @@ import net.minecraft.world.item.enchantment.ItemEnchantments; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; +import org.bukkit.NamespacedKey; +import org.bukkit.craftbukkit.CraftRegistry; import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.ItemStack; import java.util.function.BiPredicate; +import java.util.function.Predicate; public class ItemConditions {