Skip to content

Commit

Permalink
1.17.1 support
Browse files Browse the repository at this point in the history
Took 22 minutes
  • Loading branch information
Ankoki committed Jul 19, 2021
1 parent 5342df8 commit 9e10958
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ankoki</groupId>
<artifactId>SkJade</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/ankoki/skjade/SkJade.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ch.njol.util.coll.CollectionUtils;
import com.ankoki.pastebinapi.api.PasteBuilder;
import com.ankoki.skjade.commands.SkJadeCmd;
import com.ankoki.skjade.elements.lasers.Laser;
import com.ankoki.skjade.elements.pastebinapi.PasteManager;
import com.ankoki.skjade.listeners.PlayerJoin;
import com.ankoki.skjade.utils.*;
Expand All @@ -24,7 +25,6 @@
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
import java.util.logging.Logger;

/**
* IMPORTANT
Expand Down Expand Up @@ -244,6 +244,10 @@ public void change(PasteBuilder[] what, @Nullable Object[] delta, ChangeMode mod
.since("1.3.1"));
}

private void startRealTime() {
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> Bukkit.getPluginManager().callEvent(new RealTimeEvent(new Date())), 0L, 20 * 60L);
}

public boolean isBeta() {
return beta;
}
Expand All @@ -267,8 +271,4 @@ public boolean isLatest() {
public Config getOwnConfig() {
return config;
}

private void startRealTime() {
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> Bukkit.getPluginManager().callEvent(new RealTimeEvent(new Date())), 0L, 20 * 60L);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ankoki.skjade.utils;
package com.ankoki.skjade.elements.lasers;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
Expand Down Expand Up @@ -350,8 +350,8 @@ static int generateEID() {
watcherSet = getMethod(dataWatcherClass, "set");
watcherRegister = getMethod(dataWatcherClass, "register");
if (version >= 15) watcherDirty = getMethod(dataWatcherClass, "markDirty");
packetSpawn = getNMSClass("network.protocol.game", "PacketPlayOutSpawnEntityLiving").getDeclaredConstructor(version < 17 ? new Class<?>[0] : new Class<?>[]{getNMSClass("world.entity", "EntityLiving")});
packetRemove = getNMSClass("network.protocol.game", "PacketPlayOutEntityDestroy").getDeclaredConstructor(version < 17 ? int[].class : int.class);
packetSpawn = getNMSClass("network.protocol.game", "PacketPlayOutSpawnEntityLiving").getDeclaredConstructor(version < 17 ? new Class<?>[0] : new Class<?>[]{getNMSClass("world.entity", "EntityLiving")}); packetRemove = getNMSClass("network.protocol.game", "PacketPlayOutEntityDestroy").getDeclaredConstructor(version == 17 && versionMinor == 0 ? int.class : int[].class);
packetRemove = getNMSClass("network.protocol.game", "PacketPlayOutEntityDestroy").getDeclaredConstructor(version == 17 && versionMinor == 0 ? int.class : int[].class);
packetMetadata = getNMSClass("network.protocol.game", "PacketPlayOutEntityMetadata").getDeclaredConstructor(int.class, dataWatcherClass, boolean.class);
packetTeleport = getNMSClass("network.protocol.game", "PacketPlayOutEntityTeleport").getDeclaredConstructor(version < 17 ? new Class<?>[0] : new Class<?>[]{entityClass});
packetTeam = getNMSClass("network.protocol.game", "PacketPlayOutScoreboardTeam");
Expand Down Expand Up @@ -457,7 +457,7 @@ public static Object createPacketGuardianSpawn(Location location, Object watcher

public static Object[] createPacketsRemoveEntities(int... entitiesId) throws ReflectiveOperationException {
Object[] packets;
if (version < 17) {
if (version < 17 || (version == 17 && versionMinor != 0)) {
packets = new Object[]{packetRemove.newInstance(entitiesId)};
} else {
packets = new Object[entitiesId.length];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.ankoki.skjade.elements.lasers;

import com.ankoki.skjade.utils.Laser;

import java.util.HashMap;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ch.njol.skript.util.Timespan;
import ch.njol.util.Kleenean;
import com.ankoki.skjade.elements.lasers.LaserManager;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.Location;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ch.njol.skript.util.Timespan;
import ch.njol.util.Kleenean;
import com.ankoki.skjade.SkJade;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import com.ankoki.skjade.SkJade;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import com.ankoki.skjade.elements.lasers.LaserManager;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
import com.ankoki.skjade.utils.Laser;
import com.ankoki.skjade.elements.lasers.Laser;
import org.bukkit.Location;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
Expand Down

0 comments on commit 9e10958

Please sign in to comment.