Skip to content

Commit

Permalink
Remove VersionHandler for 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jyhsu2000 committed Dec 1, 2018
1 parent 22bc7e0 commit a5948cf
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 42 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Logs
## Unreleased Version
- Fix sorting of materials
- Cleanup code

## v2.0.0 (for 1.13.x)
- Update to 1.13.2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-tw.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 更新紀錄
## 未釋出版本
- 修正材料的排序
- 清理程式碼

## v2.0.0 (for 1.13.x)
- 升級至1.13.2
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/club/kid7/bannermaker/BannerMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import club.kid7.bannermaker.command.BannerMakerCommand;
import club.kid7.bannermaker.configuration.DefaultConfig;
import club.kid7.bannermaker.configuration.Language;
import club.kid7.bannermaker.version.VersionHandler;
import club.kid7.bannermaker.version.VersionHandler_1_8;
import club.kid7.pluginutilities.command.CommandComponent;
import club.kid7.pluginutilities.configuration.KConfigManager;
import club.kid7.pluginutilities.gui.CustomGUI;
Expand All @@ -21,28 +19,11 @@ public class BannerMaker extends JavaPlugin {
private static BannerMaker instance = null;
public Economy econ = null;
public boolean enableAlphabetAndNumber = true;
private VersionHandler versionHandler = null;
public PlayerDataMap playerDataMap = null;

public VersionHandler getVersionHandler() {
return versionHandler;
}

@Override
public void onEnable() {
instance = this;
//根據不同版本選擇Handler
String version = getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
switch (version) {
case "v1_8_R1":
case "v1_8_R2":
case "v1_8_R3":
versionHandler = new VersionHandler_1_8();
break;
default:
versionHandler = new VersionHandler();
break;
}

//Commands
registerCommands();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public HandCommand(BannerMaker bm) {
public boolean executeCommand(CommandSender sender, Command cmd, String label, String[] args) {
BannerMaker bm = (BannerMaker) plugin;
Player player = (Player) sender;
ItemStack itemStack = bm.getVersionHandler().getItemInMainHand(player);
ItemStack itemStack = player.getInventory().getItemInMainHand();
if (!BannerUtil.isBanner(itemStack)) {
player.sendMessage(MessageUtil.format(true, "&c" + Language.tl("command.not-banner-hand")));
return true;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/club/kid7/bannermaker/version/VersionHandler.java

This file was deleted.

This file was deleted.

0 comments on commit a5948cf

Please sign in to comment.