Skip to content

Commit

Permalink
Changed ServerVersion as 1.20.6+ removed package nms
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigerpanzer02 committed Jul 12, 2024
1 parent b6eb4d0 commit 260cbfa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
}

dependencies {
implementation("plugily.projects:MiniGamesBox-Classic:1.3.12") { isTransitive = false }
implementation("plugily.projects:MiniGamesBox-Classic:1.3.13") { isTransitive = false }
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:24.0.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void onMurdererDamage(EntityDamageByEntityEvent e) {
}

//check if sword has cooldown
if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_11_R1)) {
if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_11)) {
if(plugin.getUserManager().getUser(attacker).getCooldown("sword_attack") > 0) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void onSpecialBlockClick(PlayerInteractEvent event) {
if(event.getClickedBlock() == null)
return;

if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_11_R1) && event.getHand() == org.bukkit.inventory.EquipmentSlot.OFF_HAND) {
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_11) && event.getHand() == org.bukkit.inventory.EquipmentSlot.OFF_HAND) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void onSwordThrow(PlayerInteractEvent event) {
return;
}
attackerUser.setCooldown("sword_shoot", swordFlyCooldown);
if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_11_R1)) {
if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_11)) {
attackerUser.setCooldown("sword_attack", (plugin.getConfig().getInt("Sword.Cooldown.Attack", 1)));
} else {
VersionUtils.setMaterialCooldown(attacker ,plugin.getSwordSkinManager().getMurdererSword(attacker).getType(), 20 * (plugin.getConfig().getInt("Sword.Cooldown.Attack", 1)));
Expand All @@ -107,7 +107,7 @@ private void createFlyingSword(Player attacker, IUser attackerUser) {
standStart.setYaw(loc.getYaw());
ArmorStand stand = (ArmorStand) attacker.getWorld().spawnEntity(standStart, EntityType.ARMOR_STAND);
stand.setVisible(false);
if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_8_R3)) {
if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_8_8)) {
stand.setInvulnerable(true);
stand.setSilent(true);
}
Expand All @@ -120,7 +120,7 @@ private void createFlyingSword(Player attacker, IUser attackerUser) {
stand.setGravity(false);
stand.setRemoveWhenFarAway(true);

if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_8_R3)) {
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_8_8)) {
stand.setMarker(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void spawnCorpse(Player player, Arena arena) {
head.setItemMeta(meta);

stand.setVisible(false);
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16_R1)) {
if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16)) {
stand.getEquipment().setHelmet(head);
} else {
stand.setHelmet(head);
Expand Down

0 comments on commit 260cbfa

Please sign in to comment.