Merge 3.3.3 from magnusulf-master
This commit is contained in:
parent
6df07dc9d6
commit
32f0337b3d
208
pom.xml
208
pom.xml
@ -1,104 +1,104 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<!-- Parent -->
|
||||
<parent>
|
||||
<groupId>com.massivecraft.massivesuper</groupId>
|
||||
<artifactId>MassiveSuper</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<relativePath>../MassiveSuper</relativePath>
|
||||
</parent>
|
||||
|
||||
<!-- Basics -->
|
||||
<groupId>com.massivecraft.factions</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- Info -->
|
||||
<name>${project.artifactId}</name>
|
||||
<description>${massiveColorInfo}${project.name} allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. ${massiveDescriptionSuffix}</description>
|
||||
<url>${massiveBaseUrl}/factions</url>
|
||||
|
||||
<!-- Dependencies -->
|
||||
<dependencies>
|
||||
<!-- Spigot -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
</dependency>
|
||||
<!-- MassiveCore -->
|
||||
<dependency>
|
||||
<groupId>com.massivecraft.massivecore</groupId>
|
||||
<artifactId>MassiveCore</artifactId>
|
||||
</dependency>
|
||||
<!-- WorldEdit -->
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
</dependency>
|
||||
<!-- WorldGuard -->
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
</dependency>
|
||||
<!-- WorldGuardExtraFlags -->
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers</groupId>
|
||||
<artifactId>worldguardextraflags</artifactId>
|
||||
</dependency>
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
</dependency>
|
||||
<!-- LWC -->
|
||||
<dependency>
|
||||
<groupId>com.griefcraft</groupId>
|
||||
<artifactId>lwc</artifactId>
|
||||
</dependency>
|
||||
<!-- PlaceholderAPI -->
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
</dependency>
|
||||
<!-- MineverseChat/VentureChat -->
|
||||
<dependency>
|
||||
<groupId>mineverse.Aust1n46.chat</groupId>
|
||||
<artifactId>MineverseChat</artifactId>
|
||||
</dependency>
|
||||
<!-- Dynmap -->
|
||||
<dependency>
|
||||
<groupId>us.dynmap</groupId>
|
||||
<artifactId>dynmap</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- Build -->
|
||||
<build>
|
||||
<!-- Resources -->
|
||||
<resources>
|
||||
<!-- Standard -->
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<!-- OpenSource -->
|
||||
<resource>
|
||||
<directory>${project.build.sourceDirectory}</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<!-- Parent -->
|
||||
<parent>
|
||||
<groupId>com.massivecraft.massivesuper</groupId>
|
||||
<artifactId>MassiveSuper</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<relativePath>../MassiveSuper</relativePath>
|
||||
</parent>
|
||||
|
||||
<!-- Basics -->
|
||||
<groupId>com.massivecraft.factions</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- Info -->
|
||||
<name>${project.artifactId}</name>
|
||||
<description>${massiveColorInfo}${project.name} allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. ${massiveDescriptionSuffix}</description>
|
||||
<url>${massiveBaseUrl}/factions</url>
|
||||
|
||||
<!-- Dependencies -->
|
||||
<dependencies>
|
||||
<!-- Spigot -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
</dependency>
|
||||
<!-- MassiveCore -->
|
||||
<dependency>
|
||||
<groupId>com.massivecraft.massivecore</groupId>
|
||||
<artifactId>MassiveCore</artifactId>
|
||||
</dependency>
|
||||
<!-- WorldEdit -->
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
</dependency>
|
||||
<!-- WorldGuard -->
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
</dependency>
|
||||
<!-- WorldGuardExtraFlags -->
|
||||
<dependency>
|
||||
<groupId>net.goldtreeservers</groupId>
|
||||
<artifactId>worldguardextraflags</artifactId>
|
||||
</dependency>
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
</dependency>
|
||||
<!-- LWC -->
|
||||
<dependency>
|
||||
<groupId>com.griefcraft</groupId>
|
||||
<artifactId>lwc</artifactId>
|
||||
</dependency>
|
||||
<!-- PlaceholderAPI -->
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
</dependency>
|
||||
<!-- MineverseChat/VentureChat -->
|
||||
<dependency>
|
||||
<groupId>mineverse.Aust1n46.chat</groupId>
|
||||
<artifactId>MineverseChat</artifactId>
|
||||
</dependency>
|
||||
<!-- Dynmap -->
|
||||
<dependency>
|
||||
<groupId>us.dynmap</groupId>
|
||||
<artifactId>dynmap</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- Build -->
|
||||
<build>
|
||||
<!-- Resources -->
|
||||
<resources>
|
||||
<!-- Standard -->
|
||||
<resource>
|
||||
<directory>${project.basedir}</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<!-- OpenSource -->
|
||||
<resource>
|
||||
<directory>${project.build.sourceDirectory}</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
@ -19,6 +20,10 @@ public class CmdFactionsHome extends FactionsCommandWarp
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
|
||||
// Visibility
|
||||
this.setVisibility(Visibility.INVISIBLE);
|
||||
}
|
||||
@ -30,7 +35,7 @@ public class CmdFactionsHome extends FactionsCommandWarp
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName);
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
@ -19,6 +20,9 @@ public class CmdFactionsSethome extends FactionsCommandWarp
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Visibility
|
||||
this.setVisibility(Visibility.INVISIBLE);
|
||||
}
|
||||
@ -30,7 +34,7 @@ public class CmdFactionsSethome extends FactionsCommandWarp
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName);
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpAdd.execute(me, args);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.massivecore.MassiveException;
|
||||
import com.massivecraft.massivecore.command.Visibility;
|
||||
@ -19,6 +20,9 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp
|
||||
// Requirements
|
||||
this.addRequirements(RequirementIsPlayer.get());
|
||||
|
||||
// Parameters
|
||||
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||
|
||||
// Visibility
|
||||
this.setVisibility(Visibility.INVISIBLE);
|
||||
}
|
||||
@ -30,7 +34,7 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp
|
||||
@Override
|
||||
public void perform() throws MassiveException
|
||||
{
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName);
|
||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpRemove.execute(me, args);
|
||||
}
|
||||
|
||||
|
@ -26,12 +26,12 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
@ -139,9 +139,6 @@ public class EnginePermBuild extends Engine
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void build(BlockBreakEvent event) { build(event.getPlayer(), event.getBlock(), event); }
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void build(BlockDamageEvent event) { build(event.getPlayer(), event.getBlock(), event); }
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void build(SignChangeEvent event) { build(event.getPlayer(), event.getBlock(), event); }
|
||||
|
||||
@ -151,6 +148,18 @@ public class EnginePermBuild extends Engine
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void build(HangingBreakByEntityEvent event) { build(event.getRemover(), event.getEntity().getLocation().getBlock(), event); }
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void build(EntityChangeBlockEvent event)
|
||||
{
|
||||
// Handling lilypads being broken by boats
|
||||
Entity entity = event.getEntity();
|
||||
if (entity.getType() != EntityType.BOAT || entity.getPassengers().size() <= 0) return;
|
||||
Entity player = entity.getPassengers().stream().filter(MUtil::isPlayer).findAny().orElse(entity);
|
||||
|
||||
build(player, event.getBlock(), event);
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------- //
|
||||
// USE > ITEM
|
||||
// -------------------------------------------- //
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.integration.dynmap;
|
||||
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
import org.dynmap.markers.AreaMarker;
|
||||
import org.dynmap.markers.MarkerAPI;
|
||||
@ -13,68 +14,67 @@ public class AreaMarkerValues
|
||||
|
||||
private final String label;
|
||||
public String getLabel() { return label; }
|
||||
public AreaMarkerValues withLabel(String label) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withLabel(String label) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final String world;
|
||||
public String getWorld() { return world; }
|
||||
public AreaMarkerValues withWorld(String world) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withWorld(String world) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final double[] x;
|
||||
public double[] getX() { return x; }
|
||||
public AreaMarkerValues withX(double[] x) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final double[] z;
|
||||
public double[] getZ() { return z; }
|
||||
public AreaMarkerValues withZ(double[] z) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
private final PS[] corners;
|
||||
public PS[] getCorners() { return this.corners; }
|
||||
public AreaMarkerValues withCorners() { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final String description;
|
||||
public String getDescription() { return description; }
|
||||
public AreaMarkerValues withDescription(String description) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withDescription(String description) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final int lineColor;
|
||||
public int getLineColor() { return lineColor; }
|
||||
public AreaMarkerValues withLineColor(int lineColor) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withLineColor(int lineColor) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final double lineOpacity;
|
||||
public double getLineOpacity() { return lineOpacity; }
|
||||
public AreaMarkerValues withLineOpacity(double lineOpacity) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withLineOpacity(double lineOpacity) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final int lineWeight;
|
||||
public int getLineWeight() { return lineWeight; }
|
||||
public AreaMarkerValues withLineWright(int lineWeight) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withLineWright(int lineWeight) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final int fillColor;
|
||||
public int getFillColor() { return fillColor; }
|
||||
public AreaMarkerValues withFillColor(int fillColor) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withFillColor(int fillColor) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final double fillOpacity;
|
||||
public double getFillOpacity() { return fillOpacity; }
|
||||
public AreaMarkerValues withFillOpacity(double fillOpacity) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withFillOpacity(double fillOpacity) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
private final boolean boost;
|
||||
public boolean isBoost() { return boost; }
|
||||
public AreaMarkerValues withBoost(boolean boost) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
public AreaMarkerValues withBoost(boolean boost) { return new AreaMarkerValues(label, world, corners, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
||||
|
||||
public AreaMarkerValues withStyle(DynmapStyle style)
|
||||
{
|
||||
return new AreaMarkerValues(label, world, x, z, description, style);
|
||||
return new AreaMarkerValues(label, world, corners, description, style);
|
||||
}
|
||||
|
||||
// Caches
|
||||
private final double[] x;
|
||||
private final double[] z;
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCTOR
|
||||
// -------------------------------------------- //
|
||||
|
||||
public AreaMarkerValues(String label, String world, double[] x, double[] z, String description, DynmapStyle style)
|
||||
public AreaMarkerValues(String label, String world, PS[] corners, String description, DynmapStyle style)
|
||||
{
|
||||
this(label, world, x, z, description, style.getLineColor(), style.getLineOpacity(), style.getLineWeight(), style.getFillColor(), style.getFillOpacity(), style.getBoost());
|
||||
this(label, world, corners, description, style.getLineColor(), style.getLineOpacity(), style.getLineWeight(), style.getFillColor(), style.getFillOpacity(), style.getBoost());
|
||||
}
|
||||
|
||||
public AreaMarkerValues(String label, String world, double[] x, double[] z, String description, int lineColor, double lineOpacity, int lineWeight, int fillColor, double fillOpacity, boolean boost)
|
||||
public AreaMarkerValues(String label, String world, PS[] corners, String description, int lineColor, double lineOpacity, int lineWeight, int fillColor, double fillOpacity, boolean boost)
|
||||
{
|
||||
this.label = label;
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
this.corners = corners;
|
||||
this.description = description;
|
||||
this.lineColor = lineColor;
|
||||
this.lineOpacity = lineOpacity;
|
||||
@ -82,6 +82,17 @@ public class AreaMarkerValues
|
||||
this.fillColor = fillColor;
|
||||
this.fillOpacity = fillOpacity;
|
||||
this.boost = boost;
|
||||
|
||||
int sz = corners.length;
|
||||
x = new double[sz];
|
||||
z = new double[sz];
|
||||
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
PS ps = corners[i];
|
||||
x[i] = ps.getLocationX(true);
|
||||
z[i] = ps.getLocationZ(true);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
@ -120,8 +131,8 @@ public class AreaMarkerValues
|
||||
this.getLabel(),
|
||||
false,
|
||||
this.getWorld(),
|
||||
this.getX(),
|
||||
this.getZ(),
|
||||
this.x,
|
||||
this.z,
|
||||
false // not persistent
|
||||
);
|
||||
|
||||
|
@ -30,6 +30,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@ -246,35 +247,103 @@ public class EngineDynmap extends Engine
|
||||
|
||||
while (!allChunksSource.isEmpty())
|
||||
{
|
||||
PS somePs = allChunksSource.iterator().next();
|
||||
Iterator<PS> it = allChunksSource.iterator();
|
||||
PS somePs = it.next();
|
||||
|
||||
List<PS> linelist = new MassiveList<>();
|
||||
// Create the polygon
|
||||
Set<PS> polygonChunks = new MassiveSet<>();
|
||||
floodFillTarget(allChunksSource, polygonChunks, somePs);
|
||||
List<PS> linelist = getLineList(polygonChunks);
|
||||
|
||||
// Calc the x and y arrays
|
||||
int sz = linelist.size();
|
||||
double[] x = new double[sz];
|
||||
double[] z = new double[sz];
|
||||
|
||||
int i = 0;
|
||||
for (PS ps : linelist)
|
||||
List<PS> polygonCorners = new MassiveList<>();
|
||||
for (PS chunk : polygonChunks)
|
||||
{
|
||||
x[i] = ps.getLocationX(true);
|
||||
z[i] = ps.getLocationZ(true);
|
||||
i++;
|
||||
for (Direction d : Direction.values())
|
||||
{
|
||||
polygonCorners.add(d.getCorner(chunk));
|
||||
}
|
||||
}
|
||||
|
||||
Set<PS> points = new MassiveSet<>();
|
||||
for (PS corner : polygonCorners)
|
||||
{
|
||||
if (points.contains(corner))
|
||||
points.remove(corner);
|
||||
else
|
||||
points.add(corner);
|
||||
}
|
||||
|
||||
Map<PS, PS> edges_h = new MassiveMap<>();
|
||||
Map<PS, PS> edges_v = new MassiveMap<>();
|
||||
|
||||
List<PS> sorted_x = new MassiveList<>(points);
|
||||
Collections.sort(sorted_x, this::xThenZ);
|
||||
List<PS> sorted_z = new MassiveList<>(points);
|
||||
Collections.sort(sorted_z, this::zThenX);
|
||||
|
||||
// Create horizontal edges
|
||||
for (int i = 0; i < points.size();)
|
||||
{
|
||||
int curr_z = sorted_z.get(i).getChunkZ();
|
||||
while (i < points.size() && curr_z == sorted_z.get(i+1).getChunkZ())
|
||||
{
|
||||
edges_h.put(sorted_z.get(i), sorted_z.get(i+1));
|
||||
edges_h.put(sorted_z.get(i+1), sorted_z.get(i));
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
||||
// Create vertical edges
|
||||
for (int i = 0; i < points.size();)
|
||||
{
|
||||
int curr_x = sorted_x.get(i).getChunkX();
|
||||
while (i < points.size() && curr_x == sorted_x.get(i+1).getChunkX())
|
||||
{
|
||||
edges_v.put(sorted_x.get(i), sorted_x.get(i+1));
|
||||
edges_v.put(sorted_x.get(i+1), sorted_x.get(i));
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
||||
//List<PS> linelist = getLineList(polygonChunks);
|
||||
|
||||
|
||||
linelist = new MassiveList<>(new LinkedHashSet<>(linelist));
|
||||
|
||||
for (Direction d : Direction.values())
|
||||
{
|
||||
linelist.add(d.getCorner(somePs));
|
||||
}
|
||||
|
||||
// Build information for specific area
|
||||
String markerId = calcMarkerId(world, faction);
|
||||
AreaMarkerValues values = new AreaMarkerValues(faction.getName(), world, x, z, description, style);
|
||||
AreaMarkerValues values = new AreaMarkerValues(faction.getName(), world, linelist.toArray(new PS[]{}), description, style);
|
||||
ret.put(markerId, values);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private int zThenX(PS a, PS b)
|
||||
{
|
||||
if (a.getChunkZ() < b.getChunkZ() || (a.getChunkZ().equals(b.getChunkZ()) && a.getChunkX() < b.getChunkX()))
|
||||
return -1;
|
||||
else if (a.equals(b))
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
private int xThenZ(PS a, PS b)
|
||||
{
|
||||
if (a.getChunkX() < b.getChunkX() || (a.getChunkX().equals(b.getChunkX()) && a.getChunkZ() < b.getChunkZ()))
|
||||
return -1;
|
||||
else if (a.equals(b))
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static PS getMinimum(Collection<PS> pss)
|
||||
{
|
||||
int minimumX = Integer.MAX_VALUE;
|
||||
|
@ -22,7 +22,39 @@ public class EnumerationUtil
|
||||
"LECTERN", // Minecraft 1.14
|
||||
"BEEHIVE", // Minecraft 1.15
|
||||
"BEE_NEST", // Minecraft 1.5
|
||||
"FLOWER_POT" // Minecraft 1.?
|
||||
"FLOWER_POT", // Minecraft 1.?
|
||||
|
||||
// The various flower pots, they had to make each one a different material -.-
|
||||
"POTTED_ACACIA_SAPLING", // Minecraft 1.13
|
||||
"POTTED_ALLIUM", // Minecraft 1.13
|
||||
"POTTED_AZURE_BLUET", // Minecraft 1.13
|
||||
"POTTED_BAMBOO", // Minecraft 1.13
|
||||
"POTTED_BIRCH_SAPLING", // Minecraft 1.13
|
||||
"POTTED_BLUE_ORCHID", // Minecraft 1.13
|
||||
"POTTED_BROWN_MUSHROOM", // Minecraft 1.13
|
||||
"POTTED_CACTUS", // Minecraft 1.13
|
||||
"POTTED_CACTUS", // Minecraft 1.13
|
||||
"POTTED_CORNFLOWER", // Minecraft 1.13
|
||||
"POTTED_DANDELION", // Minecraft 1.13
|
||||
"POTTED_DARK_OAK_SAPLING", // Minecraft 1.13
|
||||
"POTTED_DEAD_BUSH", // Minecraft 1.13
|
||||
"POTTED_FERN", // Minecraft 1.13
|
||||
"POTTED_JUNGLE_SAPLING", // Minecraft 1.13
|
||||
"POTTED_LILY_OF_THE_VALLEY", // Minecraft 1.13
|
||||
"POTTED_OAK_SAPLING", // Minecraft 1.13
|
||||
"POTTED_ORANGE_TULIP", // Minecraft 1.13
|
||||
"POTTED_OXEYE_DAISY", // Minecraft 1.13
|
||||
"POTTED_PINK_TULIP", // Minecraft 1.13
|
||||
"POTTED_POPPY", // Minecraft 1.13
|
||||
"POTTED_RED_MUSHROOM", // Minecraft 1.13
|
||||
"POTTED_RED_TULIP", // Minecraft 1.13
|
||||
"POTTED_SPRUCE_SAPLING", // Minecraft 1.13
|
||||
"POTTED_WHITE_TULIP", // Minecraft 1.13
|
||||
"POTTED_WITHER_ROSE", // Minecraft 1.13
|
||||
"POTTED_CRIMSON_FUNGUS", // Minecraft 1.16
|
||||
"POTTED_CRIMSON_ROOTS", // Minecraft 1.16
|
||||
"POTTED_WARPED_FUNGUS", // Minecraft 1.16
|
||||
"POTTED_WARPED_ROOTS" // Minecraft 1.16
|
||||
);
|
||||
|
||||
public static boolean isMaterialEditOnInteract(Material material)
|
||||
@ -54,7 +86,8 @@ public class EnumerationUtil
|
||||
"TRAPPED_CHEST", // Minecraft 1.?
|
||||
"SIGN", // Minecraft 1.?
|
||||
"WOOD_DOOR", // Minecraft 1.?
|
||||
"IRON_DOOR" // Minecraft 1.?
|
||||
"IRON_DOOR", // Minecraft 1.?
|
||||
"BONE_MEAL" // Minecraft 1.?
|
||||
);
|
||||
|
||||
public static boolean isMaterialEditTool(Material material)
|
||||
@ -73,7 +106,7 @@ public class EnumerationUtil
|
||||
"OAK_FENCE_GATE",
|
||||
"ACACIA_DOOR",
|
||||
"ACACIA_TRAPDOOR",
|
||||
"AKACIA_FENCE_GATE",
|
||||
"ACACIA_FENCE_GATE",
|
||||
"BIRCH_DOOR",
|
||||
"BIRCH_TRAPDOOR",
|
||||
"BIRCH_FENCE_GATE",
|
||||
@ -85,7 +118,15 @@ public class EnumerationUtil
|
||||
"JUNGLE_FENCE_GATE",
|
||||
"SPRUCE_DOOR",
|
||||
"SPRUCE_TRAPDOOR",
|
||||
"SPRUCE_FENCE_GATE"
|
||||
"SPRUCE_FENCE_GATE",
|
||||
|
||||
// Minecraft 1.16
|
||||
"CRIMSON_DOOR",
|
||||
"CRIMSON_TRAPDOOR",
|
||||
"CRIMSON_FENCE_GATE",
|
||||
"WARPED_DOOR",
|
||||
"WARPED_TRAPDOOR",
|
||||
"WARPED_FENCE_GATE"
|
||||
);
|
||||
|
||||
public static boolean isMaterialDoor(Material material)
|
||||
@ -113,6 +154,8 @@ public class EnumerationUtil
|
||||
"DROPPER",
|
||||
"BARREL", // Minecraft 1.14
|
||||
"BLAST_FURNACE", // Minecraft 1.14
|
||||
"SMOKER", // 1.14
|
||||
"RESPAWN_ANCHOR", // 1.16
|
||||
|
||||
// The various shulker boxes, they had to make each one a different material -.-
|
||||
"SHULKER_BOX",
|
||||
@ -225,7 +268,9 @@ public class EnumerationUtil
|
||||
"DROWNED", // Minecraft 1.13
|
||||
"PILLAGER", // Minecraft 1.14
|
||||
"RAVAGER", // Minercraft 1.14
|
||||
"ZOMBIFIED_PIGLIN" // Minecraft 1.16 (rename of PIG_ZOMBIE)
|
||||
"ZOMBIFIED_PIGLIN", // Minecraft 1.16 (rename of PIG_ZOMBIE)
|
||||
"HOGLIN", // Minecraft 1.16
|
||||
"ZOGLIN" // 1.16
|
||||
);
|
||||
|
||||
public static boolean isEntityTypeMonster(EntityType entityType)
|
||||
@ -264,7 +309,8 @@ public class EnumerationUtil
|
||||
"FOX", // Minecraft 1.14
|
||||
"PANDA", // Minecraft 1.14
|
||||
"LLAMA", // Minecraft 1.14
|
||||
"LLAMA_SPIT" // Minecraft 1.14
|
||||
"LLAMA_SPIT", // Minecraft 1.14
|
||||
"STRIDER" // Minecraft 1.16
|
||||
);
|
||||
|
||||
public static boolean isEntityTypeAnimal(EntityType entityType)
|
||||
|
Loading…
Reference in New Issue
Block a user