Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign update #5797

Open
wants to merge 24 commits into
base: dev/feature
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2f87ec8
Add side, multiple lines, chat formats and more to signs
TheLimeGlass Jul 7, 2023
22e30f8
Add sign side classinfo
TheLimeGlass Jul 7, 2023
9e22b00
Attempt to fix error
TheLimeGlass Jul 7, 2023
6301ef2
Remove debug message
TheLimeGlass Jul 7, 2023
0345a3f
Attempt to fix error
TheLimeGlass Jul 7, 2023
60d4fd6
Fix error
TheLimeGlass Jul 7, 2023
6ca69d7
Merge branch 'master' into feature/line-signs
TheLimeGlass Aug 30, 2023
7cd5193
Merge branch 'master' into feature/line-signs
Moderocky Sep 8, 2023
2252c7b
Update BukkitClasses.java
TheLimeGlass Feb 14, 2024
67dea3b
Merge branch 'dev/feature' into feature/line-signs
TheLimeGlass Feb 14, 2024
8385d03
Update src/main/java/ch/njol/skript/expressions/ExprSignText.java
TheLimeGlass Feb 14, 2024
9141b49
Make a functional interface
TheLimeGlass Feb 14, 2024
2776bd1
Re-add broken compile
TheLimeGlass Feb 14, 2024
922fb2a
Remove debug
TheLimeGlass Feb 14, 2024
3098055
Merge branch 'dev/feature' into feature/line-signs
sovdeeth Feb 14, 2024
da44ef6
Remove deprecated method
TheLimeGlass Feb 15, 2024
19e570c
Merge branch 'feature/line-signs' of https://github.com/SkriptLang/Sk…
TheLimeGlass Feb 15, 2024
ead4234
Merge branch 'dev/feature' into feature/line-signs
Moderocky Apr 7, 2024
e27a78f
Merge branch 'dev/feature' into feature/line-signs
Moderocky May 3, 2024
fccdbec
Merge branch 'dev/feature' into feature/line-signs
TheLimeGlass May 10, 2024
3c1a20c
Merge branch 'dev/feature' into feature/line-signs
sovdeeth Jun 28, 2024
69c9e6e
Apply changes
TheLimeGlass Aug 31, 2024
62fbeb7
Merge branch 'feature/line-signs' of https://github.com/SkriptLang/Sk…
TheLimeGlass Aug 31, 2024
c54ff14
Resolve conflicts
TheLimeGlass Aug 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/ch/njol/skript/classes/data/BukkitClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.bukkit.block.BlockState;
import org.bukkit.block.DoubleChest;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.sign.Side;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentOffer;
Expand Down Expand Up @@ -1519,6 +1520,14 @@ public String toVariableNameString(EnchantmentOffer eo) {
.description("The inventory close reason in an <a href='/events.html#inventory_close'>inventory close event</a>.")
.requiredPlugins("Paper")
.since("INSERT VERSION"));

if (Skript.isRunningMinecraft(1, 20))
TheLimeGlass marked this conversation as resolved.
Show resolved Hide resolved
Classes.registerClass(new EnumClassInfo<>(Side.class, "signside", "sign sides")
.user("sign ?sides?")
.name("Sign Sides")
.description("Represents a side of a sign.")
.requiredPlugins("Spigot 1.20+")
TheLimeGlass marked this conversation as resolved.
Show resolved Hide resolved

}

}
12 changes: 11 additions & 1 deletion src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.sign.Side;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.AbstractVillager;
import org.bukkit.entity.Egg;
Expand Down Expand Up @@ -442,21 +443,30 @@ public Player get(final BlockCanBuildEvent e) {
}
}, 0);
}

// SignChangeEvent
EventValues.registerEventValue(SignChangeEvent.class, Player.class, new Getter<Player, SignChangeEvent>() {
@Override
@Nullable
public Player get(final SignChangeEvent e) {
return e.getPlayer();
}
}, 0);
}, EventValues.TIME_NOW);
EventValues.registerEventValue(SignChangeEvent.class, String[].class, new Getter<String[], SignChangeEvent>() {
@Override
@Nullable
public String[] get(SignChangeEvent event) {
return event.getLines();
}
}, EventValues.TIME_NOW);
if (Skript.isRunningMinecraft(1, 20))
EventValues.registerEventValue(SignChangeEvent.class, Side.class, new Getter<Side, SignChangeEvent>() {
@Override
@Nullable
TheLimeGlass marked this conversation as resolved.
Show resolved Hide resolved
public Side get(SignChangeEvent event) {
return event.getSide();
}
}, EventValues.TIME_NOW);

// === EntityEvents ===
EventValues.registerEventValue(EntityEvent.class, Entity.class, new Getter<Entity, EntityEvent>() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/expressions/ExprLore.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void change(final Event e, final @Nullable Object[] delta, final ChangeMo
}
}

private String handleRemove(String input, String toRemove, boolean all) {
public static String handleRemove(String input, String toRemove, boolean all) {
if (SkriptConfig.caseSensitive.value()) {
if (all) {
return input.replace(toRemove, "");
Expand Down
Loading
Loading