Skip to content

Commit

Permalink
1.17 Support Added
Browse files Browse the repository at this point in the history
Updated Vault
Updated XSeries
Updated CoreX Integration
  • Loading branch information
Driftay committed Jun 16, 2021
1 parent 667a0e1 commit 5891e59
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 238 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>7.6.0.0.1</version>
<version>8.1.0</version>
</dependency>
<dependency>
<groupId>me.lucko</groupId>
<artifactId>helper</artifactId>
<version>5.6.2</version>
<version>5.6.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -151,7 +151,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -179,7 +179,7 @@
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.6</version>
<version>1.7</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/massivecraft/factions/Conf.java
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,13 @@ public class Conf {
safeZoneNerfedCreatureTypes.add(EntityType.ENDERMAN);
safeZoneNerfedCreatureTypes.add(EntityType.GHAST);
safeZoneNerfedCreatureTypes.add(EntityType.MAGMA_CUBE);
EntityType type;
try {
type = EntityType.valueOf("PIG_ZOMBIE");
safeZoneNerfedCreatureTypes.add(EntityType.valueOf("PIG_ZOMBIE"));
} catch (IllegalArgumentException ex) {
type = EntityType.ZOMBIFIED_PIGLIN;
safeZoneNerfedCreatureTypes.add(EntityType.ZOMBIFIED_PIGLIN);
safeZoneNerfedCreatureTypes.add(EntityType.GLOW_SQUID);
safeZoneNerfedCreatureTypes.add(EntityType.AXOLOTL);
}
safeZoneNerfedCreatureTypes.add(type);
safeZoneNerfedCreatureTypes.add(EntityType.SILVERFISH);
safeZoneNerfedCreatureTypes.add(EntityType.SKELETON);
safeZoneNerfedCreatureTypes.add(EntityType.SPIDER);
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/massivecraft/factions/FactionsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class FactionsPlugin extends MPlugin {
public boolean mc114 = false;
public boolean mc115 = false;
public boolean mc116 = false;
public boolean mc117 = false;

public boolean useNonPacketParticles = false;
public List<String> itemList = getConfig().getStringList("fchest.Items-Not-Allowed");
Expand Down Expand Up @@ -178,6 +179,10 @@ public void onEnable() {
FactionsPlugin.instance.log("Minecraft Version 1.16 found.");
mc116 = true;
break;
case 17:
FactionsPlugin.instance.log("Minecraft Version 1.17 found.");
mc117 = true;
break;
}
migrateFPlayerLeaders();
log("==== End Setup ====");
Expand Down
91 changes: 0 additions & 91 deletions src/main/java/com/massivecraft/factions/cloak/CloakManager.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void showPillar(Player player, World world, int blockX, int blockZ) {
if (FactionsPlugin.getInstance().useNonPacketParticles) {
// Dust options only exists in the 1.13 API, so we use an
// alternative method to achieve this in lower versions.
if (FactionsPlugin.getInstance().mc113 || FactionsPlugin.getInstance().mc114 || FactionsPlugin.getInstance().mc115 || FactionsPlugin.getInstance().mc116) {
if (FactionsPlugin.getInstance().mc113 || FactionsPlugin.getInstance().mc114 || FactionsPlugin.getInstance().mc115 || FactionsPlugin.getInstance().mc116 || FactionsPlugin.getInstance().mc117) {
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
} else {
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ public void onBlockBreak(BlockBreakEvent event) {
public void FrameRemove(HangingBreakByEntityEvent event) {
if (event.getRemover() == null) return;
if ((event.getRemover() instanceof Player)) {
if (event.getEntity().getType().equals(EntityType.ITEM_FRAME)) {
if (event.getEntity().getType().getName().contains("ITEM_FRAME")) {
Player p = (Player) event.getRemover();
if (!playerCanBuildDestroyBlock(p, event.getEntity().getLocation(), "destroy", true)) {
event.setCancelled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void onEntityDamage(EntityDamageEvent event) {
}
} else {
// Protect armor stands/item frames from being damaged in protected territories
if (damageee.getType() == EntityType.ITEM_FRAME || damageee.getType() == EntityType.ARMOR_STAND) {
if (damageee.getType().getName().contains("ITEM_FRAME") || damageee.getType() == EntityType.ARMOR_STAND) {
// Manage projectiles launched by players
if (damager instanceof Projectile && ((Projectile) damager).getShooter() instanceof Entity) {
damager = (Entity) ((Projectile) damager).getShooter();
Expand Down Expand Up @@ -550,7 +550,7 @@ public void onHangerBreak(HangingBreakByEntityEvent e) {
if (!(e.getRemover() instanceof Player)) return;
Player p = (Player) e.getRemover();

if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType() == EntityType.ITEM_FRAME) {
if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType().getName().contains("ITEM_FRAME")) {
if (!FactionsBlockListener.playerCanBuildDestroyBlock(p, e.getEntity().getLocation(), "destroy", false)) {
e.setCancelled(true);
}
Expand All @@ -561,7 +561,7 @@ public void onHangerBreak(HangingBreakByEntityEvent e) {
public void onPaintingPlace(HangingPlaceEvent e) {
if (e.getPlayer() == null) return;

if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType() == EntityType.ITEM_FRAME) {
if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType().getName().contains("ITEM_FRAME")) {
if (!FactionsBlockListener.playerCanBuildDestroyBlock(e.getPlayer(), e.getBlock().getLocation(), "build", false)) {
e.setCancelled(true);
e.getPlayer().updateInventory();
Expand Down Expand Up @@ -667,7 +667,7 @@ public void onBowHit(EntityDamageByEntityEvent e) {
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
// only need to check for item frames
if (event.getRightClicked() == null) return;
if (!event.getRightClicked().getType().equals(EntityType.ITEM_FRAME)) return;
if (!event.getRightClicked().getType().getName().contains("ITEM_FRAME")) return;

if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), event.getRightClicked().getLocation(), "build", false)) {
event.setCancelled(true);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/pw/saber/corex/CoreX.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pw.saber.corex.listeners.*;
import pw.saber.corex.listeners.mob.*;

import javax.swing.border.Border;
import java.util.logging.Level;

public class CoreX {
Expand Down

0 comments on commit 5891e59

Please sign in to comment.