Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old version support (<1.13) #78

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions 1_12/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions missilewars-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
</repositories>

<dependencies>
<dependency>
<groupId>de.butzlabben</groupId>
<artifactId>1_12</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.butzlabben</groupId>
<artifactId>1_13</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ private void sendPluginInfo() {

Logger.BOOT.log("This server is running MissileWars v" + version + " by Butzlabben");

if (VersionUtil.getVersion() < 8) {
if (VersionUtil.getVersion() < 13) {
daniel-naegele marked this conversation as resolved.
Show resolved Hide resolved
Logger.WARN.log("====================================================");
Logger.WARN.log("It seems that you are using version older than 1.8");
Logger.WARN.log("It seems that you are using version older than 1.13");
Logger.WARN.log("There is no guarantee for this to work");
Logger.WARN.log("Proceed with extreme caution");
Logger.WARN.log("====================================================");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,7 @@ public void spawnMissile(Player player, ItemStack itemStack) {
public void spawnFireball(Player player, ItemStack itemStack) {
int amount = itemStack.getAmount();
itemStack.setAmount(amount - 1);

if (amount == 1 && VersionUtil.getVersion() == 8) {
player.getInventory().remove(VersionUtil.getFireball());
}


Fireball fb = player.launchProjectile(Fireball.class);
fb.setVelocity(player.getLocation().getDirection().multiply(2.5D));
VersionUtil.playFireball(player, fb.getLocation());
Expand Down Expand Up @@ -810,8 +806,8 @@ public void sendNeutralGameResultTitle(Player player) {
subTitle = Messages.getNativeMessage("game_result.subtitle_draw");

}

VersionUtil.sendTitle(player, title, subTitle);
player.sendTitle(title, subTitle);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ public void sendGameResultTitle(MWPlayer mwPlayer) {
subTitle = null;
break;
}

VersionUtil.sendTitle(mwPlayer.getPlayer(), title, subTitle);
mwPlayer.getPlayer().sendTitle(title, subTitle);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.enums.GameState;
import de.butzlabben.missilewars.util.version.BlockSetterProvider;
import de.butzlabben.missilewars.util.version.VersionUtil;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
Expand All @@ -38,6 +34,10 @@
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerToggleSneakEvent;

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

/**
* @author Butzlabben
* @since 14.01.2018
Expand Down Expand Up @@ -112,9 +112,7 @@ private void activate() {

private void setBlock(Block b) {
if ((b.getType() != Material.GOLD_BLOCK) && (b.getType() == Material.AIR)) {
Object data = b.getData();
if (VersionUtil.getVersion() >= 13)
data = b.getBlockData();
Object data = b.getBlockData();
map.put(b.getLocation(), new AbstractMap.SimpleEntry<>(b.getType(), data));
b.setType(Material.GOLD_BLOCK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
import org.bukkit.material.SpawnEgg;
import org.bukkit.util.Vector;

/**
Expand Down Expand Up @@ -110,17 +109,9 @@ public String getDisplayName() {
*/
public ItemStack getItem() {
ItemStack is = new ItemStack(VersionUtil.getMonsterEgg(egg));
if (VersionUtil.getVersion() > 10) {
SpawnEggMeta sm = (SpawnEggMeta) is.getItemMeta();
if (VersionUtil.getVersion() < 13)
sm.setSpawnedType(egg);
is.setItemMeta(sm);
} else {
SpawnEgg se = new SpawnEgg(egg);
se.setSpawnedType(egg);
is = se.toItemStack();
is.setAmount(1);
}
SpawnEggMeta sm = (SpawnEggMeta) is.getItemMeta();
is.setItemMeta(sm);

ItemMeta im = is.getItemMeta();
im.setDisplayName(getDisplayName());
is.setItemMeta(im);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,17 @@ public class PasteProvider {
private static final Paster paster;

static {
if (VersionUtil.getVersion() < 13) {
paster = new R1_12PasteProvider();
Logger.DEBUG.log("Chose 1.12 normal paster");
} else {
if (MissileWars.getInstance().foundFAWE()) {
if (VersionUtil.getVersion() < 16) {
paster = new R1_13FawePasteProvider();
Logger.DEBUG.log("Chose 1.13 FAWE paster");
} else {
paster = new R1_16FawePasteProvider();
Logger.DEBUG.log("Chose 1.16 FAWE paster");
}
if (MissileWars.getInstance().foundFAWE()) {
if (VersionUtil.getVersion() < 16) {
paster = new R1_13FawePasteProvider();
Logger.DEBUG.log("Chose 1.13 FAWE paster");
} else {
paster = new R1_13WEPasteProvider();
Logger.DEBUG.log("Chose 1.13 WE paster");
paster = new R1_16FawePasteProvider();
Logger.DEBUG.log("Chose 1.16 FAWE paster");
}
} else {
paster = new R1_13WEPasteProvider();
Logger.DEBUG.log("Chose 1.13 WE paster");
}
}

Expand Down
Loading