mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-03-12 14:39:05 +01:00
1.0.0-SNAPSHOT-U203a
+ Started working on implementing Legacy support
This commit is contained in:
parent
e73e11308e
commit
4e992e498d
@ -46,7 +46,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${parent.artifactId}-${plugin.version} (1.13.x)</finalName>
|
||||
<finalName>${parent.artifactId}-${plugin.version} (Legacy)</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -18,12 +18,10 @@ import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter;
|
||||
import com.songoda.epicbosses.utils.potion.PotionEffectConverter;
|
||||
import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.potion.PotionType;
|
||||
@ -108,11 +106,8 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
|
||||
|
||||
ItemStack itemStack = new ItemStack(Material.POTION);
|
||||
PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta();
|
||||
PotionType potionType = PotionType.getByEffect(PotionEffectType.BLINDNESS);
|
||||
|
||||
if(potionType == null) potionType = PotionType.WATER;
|
||||
|
||||
potionMeta.setBasePotionData(new PotionData(potionType));
|
||||
potionMeta.addCustomEffect(potionEffect, true);
|
||||
itemStack.setItemMeta(potionMeta);
|
||||
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
@ -1,25 +1,20 @@
|
||||
package com.songoda.epicbosses.panel.skills.custom.potions;
|
||||
|
||||
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.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.types.PotionSkillElement;
|
||||
import com.songoda.epicbosses.utils.*;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
import com.songoda.epicbosses.utils.potion.PotionEffectConverter;
|
||||
import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.potion.PotionType;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@ -34,6 +29,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill, PotionEffectHolder> {
|
||||
|
||||
private PotionEffectConverter potionEffectConverter = new PotionEffectConverter();
|
||||
private CustomBosses plugin;
|
||||
|
||||
public PotionEffectTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
|
||||
@ -81,11 +77,8 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill,
|
||||
PotionEffectType potionEffectType = potionEffectTypes.get(slot);
|
||||
ItemStack itemStack = new ItemStack(Material.POTION);
|
||||
PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta();
|
||||
PotionType potionType = PotionType.getByEffect(potionEffectType);
|
||||
|
||||
if(potionType == null) potionType = PotionType.WATER;
|
||||
|
||||
potionMeta.setBasePotionData(new PotionData(potionType));
|
||||
potionMeta.addCustomEffect(this.potionEffectConverter.from(potionEffectHolder), true);
|
||||
itemStack.setItemMeta(potionMeta);
|
||||
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
@ -18,9 +18,7 @@ public enum Versions {
|
||||
v1_9_R2(7, "1.9.4"),
|
||||
v1_10_R1(8, "1.10"),
|
||||
v1_11_R1(9, "1.11.2"),
|
||||
v1_12_R1(10, "1.12.1"),
|
||||
v1_13_R1(11, "1.13"),
|
||||
v1_13_R2(12, "1.13.2");
|
||||
v1_12_R1(10, "1.12.1");
|
||||
|
||||
@Getter private String displayVersion, bukkitVersion;
|
||||
private int weight;
|
||||
|
@ -1,27 +0,0 @@
|
||||
package com.songoda.epicbosses.utils.entity.handlers;
|
||||
|
||||
import com.songoda.epicbosses.utils.Versions;
|
||||
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
* @version 1.0.0
|
||||
* @since 01-Jul-18
|
||||
*/
|
||||
public class IllusionerHandler implements ICustomEntityHandler {
|
||||
|
||||
private VersionHandler versionHandler = new VersionHandler();
|
||||
|
||||
@Override
|
||||
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||
if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) {
|
||||
throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft.");
|
||||
}
|
||||
|
||||
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ILLUSIONER);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user