Skip to content

Commit ea6d77f

Browse files
committed
Revert "Merge branch 'dev/feature' into dev/AdditionalJUnitMethods"
This reverts commit 42f0a5e, reversing changes made to dbfddaf.
1 parent 22c914f commit ea6d77f

File tree

22 files changed

+94
-394
lines changed

22 files changed

+94
-394
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.parallel=true
55

66
groupid=ch.njol
77
name=skript
8-
version=2.11.0
8+
version=2.11.0-pre1
99
jarName=Skript.jar
1010
testEnv=java21/paper-1.21.5
1111
testEnvJavaVersion=21

skript-aliases

src/main/java/ch/njol/skript/ScriptLoader.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,15 +1002,14 @@ public static ArrayList<TriggerItem> loadItems(SectionNode node) {
10021002
break find_section;
10031003
Collection<LogEntry> errors = handler.getErrors();
10041004

1005-
// restore the failure log if:
1006-
// 1. there are no errors from the statement parse
1007-
// 2. the error message is the default one from the statement parse
1008-
// 3. the backup log contains a message about the section being claimed
1009-
if (errors.isEmpty()
1010-
|| errors.iterator().next().getMessage().contains("Can't understand this condition/effect:")
1011-
|| backup.getErrors().iterator().next().getMessage().contains("tried to claim the current section, but it was already claimed by")
1012-
) {
1005+
// restore the failure log
1006+
if (errors.isEmpty()) {
10131007
handler.restore(backup);
1008+
} else { // We specifically want these two errors in preference to the section error!
1009+
String firstError = errors.iterator().next().getMessage();
1010+
if (!firstError.contains("is a valid statement but cannot function as a section (:)")
1011+
&& !firstError.contains("You cannot have two section-starters in the same line"))
1012+
handler.restore(backup);
10141013
}
10151014
continue;
10161015
} finally {

src/main/java/ch/njol/skript/aliases/ItemData.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public boolean matchPlain(ItemData other) {
564564
@Override
565565
public Fields serialize() throws NotSerializableException {
566566
Fields fields = new Fields(this); // ItemStack is transient, will be ignored
567-
fields.putObject("key", type.getKey().toString());
567+
fields.putPrimitive("id", type.ordinal());
568568
fields.putObject("meta", stack != null ? stack.getItemMeta() : null);
569569
return fields;
570570
}
@@ -573,16 +573,7 @@ public Fields serialize() throws NotSerializableException {
573573

574574
@Override
575575
public void deserialize(Fields fields) throws StreamCorruptedException, NotSerializableException {
576-
if (fields.hasField("key")) {
577-
String key = fields.getAndRemoveObject("key", String.class);
578-
if (key == null)
579-
throw new StreamCorruptedException("Material key is null");
580-
this.type = Material.matchMaterial(key);
581-
} else {
582-
// attempt back compat deserialization, though using ordinals is not reliable
583-
this.type = materials[fields.getAndRemovePrimitive("id", int.class)];
584-
}
585-
576+
this.type = materials[fields.getAndRemovePrimitive("id", int.class)];
586577
ItemMeta meta = fields.getAndRemoveObject("meta", ItemMeta.class);
587578

588579
// Initialize ItemStack
Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package ch.njol.skript.bukkitutil;
22

33
import ch.njol.skript.Skript;
4-
import com.google.common.collect.BiMap;
5-
import com.google.common.collect.HashBiMap;
64
import org.bukkit.Registry;
7-
import org.bukkit.inventory.EquipmentSlot;
85
import org.bukkit.potion.PotionEffectType;
96
import org.jetbrains.annotations.Nullable;
107

@@ -13,16 +10,6 @@
1310
*/
1411
public class BukkitUtils {
1512

16-
private static final BiMap<EquipmentSlot, Integer> BUKKIT_EQUIPMENT_SLOT_INDICES = HashBiMap.create();
17-
18-
static {
19-
BUKKIT_EQUIPMENT_SLOT_INDICES.put(EquipmentSlot.FEET, 36);
20-
BUKKIT_EQUIPMENT_SLOT_INDICES.put(EquipmentSlot.LEGS, 37);
21-
BUKKIT_EQUIPMENT_SLOT_INDICES.put(EquipmentSlot.CHEST, 38);
22-
BUKKIT_EQUIPMENT_SLOT_INDICES.put(EquipmentSlot.HEAD, 39);
23-
BUKKIT_EQUIPMENT_SLOT_INDICES.put(EquipmentSlot.OFF_HAND, 40);
24-
}
25-
2613
/**
2714
* Check if a registry exists
2815
*
@@ -49,22 +36,4 @@ public static boolean registryExists(String registry) {
4936
return null;
5037
}
5138

52-
/**
53-
* Get the inventory slot index of the {@link EquipmentSlot}
54-
* @param equipmentSlot The equipment slot to get the index of
55-
* @return The equipment slot index of the provided slot, otherwise null if invalid
56-
*/
57-
public static Integer getEquipmentSlotIndex(EquipmentSlot equipmentSlot) {
58-
return BUKKIT_EQUIPMENT_SLOT_INDICES.get(equipmentSlot);
59-
}
60-
61-
/**
62-
* Get the {@link EquipmentSlot} represented by the inventory slot index
63-
* @param slotIndex The index of the equipment slot
64-
* @return The equipment slot the provided slot index, otherwise null if invalid
65-
*/
66-
public static EquipmentSlot getEquipmentSlotFromIndex(int slotIndex) {
67-
return BUKKIT_EQUIPMENT_SLOT_INDICES.inverse().get(slotIndex);
68-
}
69-
7039
}

src/main/java/ch/njol/skript/classes/data/BukkitClasses.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ public String toVariableNameString(EnchantmentOffer eo) {
14241424
.name("Wolf Variant")
14251425
.description("Represents the variant of a wolf entity.",
14261426
"NOTE: Minecraft namespaces are supported, ex: 'minecraft:ashen'.")
1427-
.since("2.10")
1427+
.since("@VERSION")
14281428
.requiredPlugins("Minecraft 1.21+")
14291429
.documentationId("WolfVariant"));
14301430

src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -764,21 +764,6 @@ else if (hand == EquipmentSlot.OFF_HAND)
764764
EventValues.registerEventValue(WorldBorderCenterChangeEvent.class, Location.class, WorldBorderCenterChangeEvent::getNewCenter);
765765
EventValues.registerEventValue(WorldBorderCenterChangeEvent.class, Location.class, WorldBorderCenterChangeEvent::getOldCenter, EventValues.TIME_PAST);
766766
}
767-
768-
if (Skript.classExists("org.bukkit.event.block.VaultDisplayItemEvent")) {
769-
EventValues.registerEventValue(VaultDisplayItemEvent.class, ItemStack.class, new EventConverter<>() {
770-
@Override
771-
public void set(VaultDisplayItemEvent event, @Nullable ItemStack itemStack) {
772-
event.setDisplayItem(itemStack);
773-
}
774-
775-
@Override
776-
public @Nullable ItemStack convert(VaultDisplayItemEvent event) {
777-
return event.getDisplayItem();
778-
}
779-
});
780-
}
781-
782767
}
783768

784769
}

src/main/java/ch/njol/skript/events/SimpleEvents.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -772,20 +772,6 @@ public class SimpleEvents {
772772
)
773773
.since("2.11");
774774
}
775-
776-
if (Skript.classExists("org.bukkit.event.block.VaultDisplayItemEvent")) {
777-
Skript.registerEvent("Vault Display Item", SimpleEvent.class, VaultDisplayItemEvent.class,
778-
"vault display[ing] item")
779-
.description("Called when a vault in a trial chamber is about to display an item.")
780-
.examples(
781-
"""
782-
on vault display item:
783-
set event-item to a netherite ingot
784-
"""
785-
)
786-
.since("INSERT VERSION")
787-
.requiredPlugins("Minecraft 1.21.1+");
788-
}
789775
}
790776

791777
}

src/main/java/ch/njol/skript/expressions/ExprExactItem.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/main/java/ch/njol/skript/expressions/ExprItemWithTooltip.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"set {_item without entire tooltip} to diamond without entire tooltip"
2525
})
2626
@RequiredPlugins("Minecraft 1.20.5+")
27-
@Since("2.11")
27+
@Since("INSERT VERSION")
2828
public class ExprItemWithTooltip extends PropertyExpression<ItemType, ItemType> {
2929

3030
static {

0 commit comments

Comments
 (0)