mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-02-23 06:01:51 +01:00
1.0.0-SNAPSHOT-U76
+ Fixed issues with commands not saving correctly + Fixed issues with second bosses not spawning
This commit is contained in:
parent
8fcf37d169
commit
6edbfc1359
@ -82,24 +82,24 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!--<plugin>-->
|
||||
<!--<groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!--<artifactId>maven-antrun-plugin</artifactId>-->
|
||||
<!--<version>1.8</version>-->
|
||||
<!--<executions>-->
|
||||
<!--<execution>-->
|
||||
<!--<phase>install</phase>-->
|
||||
<!--<configuration>-->
|
||||
<!--<target>-->
|
||||
<!--<copy file="target/${build.finalName}.jar" tofile="D:/Servers/1.13.2/plugins/${build.finalName}.jar"/>-->
|
||||
<!--</target>-->
|
||||
<!--</configuration>-->
|
||||
<!--<goals>-->
|
||||
<!--<goal>run</goal>-->
|
||||
<!--</goals>-->
|
||||
<!--</execution>-->
|
||||
<!--</executions>-->
|
||||
<!--</plugin>-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>install</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy file="target/${build.finalName}.jar" tofile="D:/Servers/1.13.2/plugins/${build.finalName}.jar"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -30,6 +30,8 @@ public class EntityTypeMechanic implements IBossMechanic {
|
||||
if(position == null) position = 1;
|
||||
if(entityFinder == null) return false;
|
||||
|
||||
System.out.println("SPAWNING BOSS #" + position);
|
||||
|
||||
LivingEntity livingEntity = entityFinder.spawnNewLivingEntity(bossEntityType, activeBossHolder.getLocation());
|
||||
|
||||
if(livingEntity == null) return false;
|
||||
|
@ -80,7 +80,7 @@ public class BootsEditorPanel extends SubVariablePanelHandler<BossEntity, Entity
|
||||
|
||||
panelBuilderCounter.getSlotsWith("AddNew").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAddItemsMenu().openFor(player)));
|
||||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, event -> {
|
||||
entityStatsElement.getEquipment().setHelmet("");
|
||||
entityStatsElement.getEquipment().setBoots("");
|
||||
this.bossesFileManager.save();
|
||||
|
||||
openFor((Player) event.getWhoClicked(), bossEntity, entityStatsElement);
|
||||
@ -101,7 +101,7 @@ public class BootsEditorPanel extends SubVariablePanelHandler<BossEntity, Entity
|
||||
}
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<String, ItemStackHolder> itemStackHolderMap, List<String> entryList, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
String helmet = entityStatsElement.getEquipment().getHelmet();
|
||||
String boots = entityStatsElement.getEquipment().getBoots();
|
||||
|
||||
panel.loadPage(requestedPage, (slot, realisticSlot) -> {
|
||||
if(slot >= itemStackHolderMap.size()) {
|
||||
@ -115,7 +115,7 @@ public class BootsEditorPanel extends SubVariablePanelHandler<BossEntity, Entity
|
||||
itemStack = new ItemStack(Material.BARRIER);
|
||||
}
|
||||
|
||||
if(name.equalsIgnoreCase(helmet)) {
|
||||
if(name.equalsIgnoreCase(boots)) {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", ItemStackUtils.getName(itemStack));
|
||||
@ -124,7 +124,7 @@ public class BootsEditorPanel extends SubVariablePanelHandler<BossEntity, Entity
|
||||
}
|
||||
|
||||
panel.setItem(realisticSlot, itemStack, e -> {
|
||||
entityStatsElement.getEquipment().setHelmet(name);
|
||||
entityStatsElement.getEquipment().setBoots(name);
|
||||
this.bossesFileManager.save();
|
||||
|
||||
openFor((Player) e.getWhoClicked(), bossEntity, entityStatsElement);
|
||||
|
@ -80,7 +80,7 @@ public class ChestplateEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
||||
|
||||
panelBuilderCounter.getSlotsWith("AddNew").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAddItemsMenu().openFor(player)));
|
||||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, event -> {
|
||||
entityStatsElement.getEquipment().setHelmet("");
|
||||
entityStatsElement.getEquipment().setChestplate("");
|
||||
this.bossesFileManager.save();
|
||||
|
||||
openFor((Player) event.getWhoClicked(), bossEntity, entityStatsElement);
|
||||
@ -101,7 +101,7 @@ public class ChestplateEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
||||
}
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<String, ItemStackHolder> itemStackHolderMap, List<String> entryList, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
String helmet = entityStatsElement.getEquipment().getHelmet();
|
||||
String chestplate = entityStatsElement.getEquipment().getChestplate();
|
||||
|
||||
panel.loadPage(requestedPage, (slot, realisticSlot) -> {
|
||||
if(slot >= itemStackHolderMap.size()) {
|
||||
@ -115,7 +115,7 @@ public class ChestplateEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
||||
itemStack = new ItemStack(Material.BARRIER);
|
||||
}
|
||||
|
||||
if(name.equalsIgnoreCase(helmet)) {
|
||||
if(name.equalsIgnoreCase(chestplate)) {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", ItemStackUtils.getName(itemStack));
|
||||
@ -124,7 +124,7 @@ public class ChestplateEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
||||
}
|
||||
|
||||
panel.setItem(realisticSlot, itemStack, e -> {
|
||||
entityStatsElement.getEquipment().setHelmet(name);
|
||||
entityStatsElement.getEquipment().setChestplate(name);
|
||||
this.bossesFileManager.save();
|
||||
|
||||
openFor((Player) e.getWhoClicked(), bossEntity, entityStatsElement);
|
||||
|
@ -80,7 +80,7 @@ public class LeggingsEditorPanel extends SubVariablePanelHandler<BossEntity, Ent
|
||||
|
||||
panelBuilderCounter.getSlotsWith("AddNew").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAddItemsMenu().openFor(player)));
|
||||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, event -> {
|
||||
entityStatsElement.getEquipment().setHelmet("");
|
||||
entityStatsElement.getEquipment().setLeggings("");
|
||||
this.bossesFileManager.save();
|
||||
|
||||
openFor((Player) event.getWhoClicked(), bossEntity, entityStatsElement);
|
||||
@ -101,7 +101,7 @@ public class LeggingsEditorPanel extends SubVariablePanelHandler<BossEntity, Ent
|
||||
}
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<String, ItemStackHolder> itemStackHolderMap, List<String> entryList, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
String helmet = entityStatsElement.getEquipment().getHelmet();
|
||||
String leggings = entityStatsElement.getEquipment().getLeggings();
|
||||
|
||||
panel.loadPage(requestedPage, (slot, realisticSlot) -> {
|
||||
if(slot >= itemStackHolderMap.size()) {
|
||||
@ -115,7 +115,7 @@ public class LeggingsEditorPanel extends SubVariablePanelHandler<BossEntity, Ent
|
||||
itemStack = new ItemStack(Material.BARRIER);
|
||||
}
|
||||
|
||||
if(name.equalsIgnoreCase(helmet)) {
|
||||
if(name.equalsIgnoreCase(leggings)) {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", ItemStackUtils.getName(itemStack));
|
||||
@ -124,7 +124,7 @@ public class LeggingsEditorPanel extends SubVariablePanelHandler<BossEntity, Ent
|
||||
}
|
||||
|
||||
panel.setItem(realisticSlot, itemStack, e -> {
|
||||
entityStatsElement.getEquipment().setHelmet(name);
|
||||
entityStatsElement.getEquipment().setLeggings(name);
|
||||
this.bossesFileManager.save();
|
||||
|
||||
openFor((Player) e.getWhoClicked(), bossEntity, entityStatsElement);
|
||||
|
@ -51,8 +51,11 @@ public abstract class TargetHandler<Holder extends IActiveHolder> implements ITa
|
||||
if(boss == null) return;
|
||||
|
||||
List<LivingEntity> nearbyEntities = new ArrayList<>();
|
||||
List<Entity> nearbyBossEntities = boss.getNearbyEntities(radius, radius, radius);
|
||||
|
||||
for(Entity entity : boss.getNearbyEntities(radius, radius, radius)) {
|
||||
if(nearbyBossEntities == null) return;
|
||||
|
||||
for(Entity entity : nearbyBossEntities) {
|
||||
if(!(entity instanceof Player)) continue;
|
||||
|
||||
LivingEntity livingEntity = (LivingEntity) entity;
|
||||
|
2
pom.xml
2
pom.xml
@ -19,7 +19,7 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<plugin.version>maven-version-number-SNAPSHOT-U75</plugin.version>
|
||||
<plugin.version>maven-version-number-SNAPSHOT-U76</plugin.version>
|
||||
<plugin.name>EpicBosses</plugin.name>
|
||||
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
||||
<plugin.author>AMinecraftDev</plugin.author>
|
||||
|
Loading…
Reference in New Issue
Block a user