Skip to content

Commit

Permalink
👽 Make addon compatible with Skript 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Romitou committed Feb 6, 2024
1 parent 863159b commit 093738b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ repositories {
}

dependencies {
implementation group: 'org.mongodb', name: 'mongodb-driver-reactivestreams', version: '4.8.2'
shadow group: 'io.papermc.paper', name: 'paper-api', version: '1.19.2-R0.1-SNAPSHOT'
shadow group: 'com.github.SkriptLang', name: 'Skript', version: '2.6.2', { // Well, the 2.6 build failed...
implementation group: 'org.mongodb', name: 'mongodb-driver-reactivestreams', version: '4.11.1'
shadow group: 'io.papermc.paper', name: 'paper-api', version: '1.20.4-R0.1-SNAPSHOT'
shadow group: 'com.github.SkriptLang', name: 'Skript', version: '2.8.0', {
exclude module: 'Vault'
exclude module: 'worldguard'
exclude module: 'worldguard-legacy'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/romitou/mongosk/MongoSection.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class MongoSection<T> extends LegacyEffectSection {
@Override
protected void execute(Event e) {
runSection(e);
Variables.setVariable(variable.getName().getDefaultVariableName(), provideValue(), e, variable.isLocal());
Variables.setVariable(variable.getName().toString(e), provideValue(), e, variable.isLocal());
endSection();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public MongoTriggerItem(Variable<?> variable) {

@Override
protected boolean run(Event e) {
Variables.setVariable(variable.getName().getDefaultVariableName(), SectMongoDocument.mongoSKDocument, e, variable.isLocal());
Variables.setVariable(variable.getName().toString(e), SectMongoDocument.mongoSKDocument, e, variable.isLocal());
SectMongoDocument.mongoSKDocument = new MongoSKDocument();
return true;
}
Expand Down Expand Up @@ -80,6 +80,9 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
currentSections.add(this);
try {
ArrayList<TriggerItem> items = ScriptLoader.loadItems(sectionNode);
if (items.size() != sectionNode.size()) { // Some items didn't parse
return false;
}
MongoTriggerItem mongoTriggerItem = new MongoTriggerItem(localVariable);
TriggerItem last = items.get(items.size() - 1).setNext(mongoTriggerItem);
items.set(items.size() - 1, last);
Expand Down

0 comments on commit 093738b

Please sign in to comment.