1.0.0-SNAPSHOT-U78

+ Fixed up some issues with Targeting Selection Manager
+ Tweaked some of the GUI layout in editor.yml
This commit is contained in:
Charles 2018-11-23 18:27:18 +08:00
parent 0134c679ca
commit 68c3a51fff
7 changed files with 13 additions and 57 deletions

View File

@ -648,11 +648,11 @@ TargetingPanel:
type: WHITE_STAINED_GLASS_PANE
name: '&7'
Buttons:
BackButton: 27
backButton: 27
Items:
'5':
type: REDSTONE_BLOCK
name: '&b&lHidden Nearby Entity'
name: '&e&lNot Damaged Nearby'
lore:
- '&7This target system will target'
- '&7anyone who is nearby and hasn''t'
@ -661,25 +661,25 @@ TargetingPanel:
- '&7the boss then it will choose a random'
- '&7entity/player.'
TargetingSystem: NotDamagedNearby
'12':
'13':
type: REDSTONE_BLOCK
name: '&b&lClosest to the Boss'
name: '&e&lClosest'
lore:
- '&7This target system will'
- '&7target the closest player'
- '&7to the boss.'
TargetingSystem: Closest
'13':
'14':
type: REDSTONE_BLOCK
name: '&b&lRandom Nearby Entity'
name: '&e&lRandom Nearby'
lore:
- '&7This target system will'
- '&7target a random target who is'
- '&7within reach of the boss.'
TargetingSystem: RandomNearby
'14':
'15':
type: REDSTONE_BLOCK
name: '&e&lTop Damage'
name: '&e&lTop Damager'
lore:
- '&7This target system will'
- '&7target the player who has'

View File

@ -46,7 +46,7 @@ public class BossEntity {
if(getTargeting() == null || getTargeting().isEmpty() || getTargeting().equalsIgnoreCase("")) {
return "N/A";
} else {
return StringUtils.get().formatString(getTargeting());
return getTargeting();
}
}

View File

@ -10,7 +10,6 @@ import com.songoda.epicbosses.panel.bosses.equipment.BootsEditorPanel;
import com.songoda.epicbosses.panel.bosses.equipment.ChestplateEditorPanel;
import com.songoda.epicbosses.panel.bosses.equipment.HelmetEditorPanel;
import com.songoda.epicbosses.panel.bosses.equipment.LeggingsEditorPanel;
import com.songoda.epicbosses.panel.bosses.list.BossListTargetingEditorPanel;
import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler;
import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler;
import lombok.Getter;
@ -40,7 +39,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
@Getter private ISubVariablePanelHandler<BossEntity, EntityStatsElement> equipmentEditMenu, helmetEditorMenu, chestplateEditorMenu, leggingsEditorMenu, bootsEditorMenu;
@Getter private IVariablePanelHandler<BossEntity> mainBossEditMenu, dropsEditMenu, targetingEditMenu;
@Getter private BossListEditorPanel equipmentListEditMenu, targetingListEditMenu;
@Getter private BossListEditorPanel equipmentListEditMenu;
private final CustomBosses customBosses;
@ -153,14 +152,12 @@ public class BossPanelManager implements ILoadable, IReloadable {
PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("BossListEditorPanel"));
this.equipmentListEditMenu = new BossListEquipmentEditorPanel(this, panelBuilder, this.customBosses);
this.targetingListEditMenu = new BossListTargetingEditorPanel(this, panelBuilder, this.customBosses);
}
private void reloadEditorListMenus() {
PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("BossListEditorPanel"));
this.equipmentListEditMenu.initializePanel(panelBuilder);
this.targetingListEditMenu.initializePanel(panelBuilder);
}
//---------------------------------------------

View File

@ -77,6 +77,7 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> {
counter.getSlotsWith("Editing").forEach(slot -> panel.setOnClick(slot, getEditingAction(bossEntity)));
counter.getSlotsWith("Drops").forEach(slot -> panel.setOnClick(slot, e -> this.bossPanelManager.getDropsEditMenu().openFor((Player) e.getWhoClicked(), bossEntity)));
counter.getSlotsWith("Targeting").forEach(slot -> panel.setOnClick(slot, e -> this.bossPanelManager.getTargetingEditMenu().openFor((Player) e.getWhoClicked(), bossEntity)));
counter.getSlotsWith("Equipment").forEach(slot -> panel.setOnClick(slot, e -> this.bossPanelManager.getEquipmentListEditMenu().openFor((Player) e.getWhoClicked(), bossEntity)));
panel.openFor(player);

View File

@ -49,7 +49,7 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> {
.setDestroyWhenDone(true)
.setCancelLowerClick(true)
.setCancelClick(true)
.setParentPanelHandler(this.bossPanelManager.getTargetingListEditMenu(), bossEntity);
.setParentPanelHandler(this.bossPanelManager.getMainBossEditMenu(), bossEntity);
PanelBuilderCounter panelBuilderCounter = panel.getPanelBuilderCounter();
panelBuilderCounter.getSpecialSlotsWith("TargetingSystem").forEach((slot, returnValue) -> panel.setOnClick(slot, event -> {

View File

@ -1,42 +0,0 @@
package com.songoda.epicbosses.panel.bosses.list;
import com.songoda.epicbosses.CustomBosses;
import com.songoda.epicbosses.entity.BossEntity;
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
import com.songoda.epicbosses.managers.BossPanelManager;
import com.songoda.epicbosses.panel.bosses.BossListEditorPanel;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
/**
* @author Charles Cullen
* @version 1.0.0
* @since 22-Nov-18
*/
public class BossListTargetingEditorPanel extends BossListEditorPanel {
public BossListTargetingEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
super(bossPanelManager, panelBuilder, plugin, "Targeting");
}
@Override
public ClickAction getAction(BossEntity bossEntity, EntityStatsElement entityStatsElement) {
return event -> {
ClickType click = event.getClick();
Player player = (Player) event.getWhoClicked();
if (click == ClickType.LEFT || click == ClickType.SHIFT_LEFT) {
this.bossPanelManager.getTargetingEditMenu().openFor(player, bossEntity);
} else {
if(entityStatsElement.getMainStats().getPosition() > 1) {
bossEntity.getEntityStats().remove(entityStatsElement);
this.bossesFileManager.save();
openFor(player, bossEntity);
}
}
};
}
}

View File

@ -19,7 +19,7 @@
</modules>
<properties>
<plugin.version>maven-version-number-SNAPSHOT-U77</plugin.version>
<plugin.version>maven-version-number-SNAPSHOT-U78</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>