Merge 3.3.3 from magnusulf-master
This commit is contained in:
parent
6df07dc9d6
commit
32f0337b3d
@ -1,5 +1,6 @@
|
|||||||
package com.massivecraft.factions.cmd;
|
package com.massivecraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
@ -19,6 +20,10 @@ public class CmdFactionsHome extends FactionsCommandWarp
|
|||||||
// Requirements
|
// Requirements
|
||||||
this.addRequirements(RequirementIsPlayer.get());
|
this.addRequirements(RequirementIsPlayer.get());
|
||||||
|
|
||||||
|
// Parameters
|
||||||
|
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||||
|
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
this.setVisibility(Visibility.INVISIBLE);
|
this.setVisibility(Visibility.INVISIBLE);
|
||||||
}
|
}
|
||||||
@ -30,7 +35,7 @@ public class CmdFactionsHome extends FactionsCommandWarp
|
|||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException
|
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);
|
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.massivecraft.factions.cmd;
|
package com.massivecraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
@ -19,6 +20,9 @@ public class CmdFactionsSethome extends FactionsCommandWarp
|
|||||||
// Requirements
|
// Requirements
|
||||||
this.addRequirements(RequirementIsPlayer.get());
|
this.addRequirements(RequirementIsPlayer.get());
|
||||||
|
|
||||||
|
// Parameters
|
||||||
|
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
this.setVisibility(Visibility.INVISIBLE);
|
this.setVisibility(Visibility.INVISIBLE);
|
||||||
}
|
}
|
||||||
@ -30,7 +34,7 @@ public class CmdFactionsSethome extends FactionsCommandWarp
|
|||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException
|
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);
|
CmdFactions.get().cmdFactionsWarp.cmdFactionWarpAdd.execute(me, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.massivecraft.factions.cmd;
|
package com.massivecraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.cmd.type.TypeFaction;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
@ -19,6 +20,9 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp
|
|||||||
// Requirements
|
// Requirements
|
||||||
this.addRequirements(RequirementIsPlayer.get());
|
this.addRequirements(RequirementIsPlayer.get());
|
||||||
|
|
||||||
|
// Parameters
|
||||||
|
this.addParameter(TypeFaction.get(), "faction", "you");
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
this.setVisibility(Visibility.INVISIBLE);
|
this.setVisibility(Visibility.INVISIBLE);
|
||||||
}
|
}
|
||||||
@ -30,7 +34,7 @@ public class CmdFactionsUnsethome extends FactionsCommandWarp
|
|||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException
|
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);
|
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.EventPriority;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockDamageEvent;
|
|
||||||
import org.bukkit.event.block.BlockFromToEvent;
|
import org.bukkit.event.block.BlockFromToEvent;
|
||||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.block.SignChangeEvent;
|
import org.bukkit.event.block.SignChangeEvent;
|
||||||
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||||
@ -139,9 +139,6 @@ public class EnginePermBuild extends Engine
|
|||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void build(BlockBreakEvent event) { build(event.getPlayer(), event.getBlock(), event); }
|
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)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void build(SignChangeEvent event) { build(event.getPlayer(), event.getBlock(), event); }
|
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)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void build(HangingBreakByEntityEvent event) { build(event.getRemover(), event.getEntity().getLocation().getBlock(), event); }
|
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
|
// USE > ITEM
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.massivecraft.factions.integration.dynmap;
|
package com.massivecraft.factions.integration.dynmap;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
import org.dynmap.markers.AreaMarker;
|
import org.dynmap.markers.AreaMarker;
|
||||||
import org.dynmap.markers.MarkerAPI;
|
import org.dynmap.markers.MarkerAPI;
|
||||||
@ -13,68 +14,67 @@ public class AreaMarkerValues
|
|||||||
|
|
||||||
private final String label;
|
private final String label;
|
||||||
public String getLabel() { return 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;
|
private final String world;
|
||||||
public String getWorld() { return 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;
|
private final PS[] corners;
|
||||||
public double[] getX() { return x; }
|
public PS[] getCorners() { return this.corners; }
|
||||||
public AreaMarkerValues withX(double[] x) { return new AreaMarkerValues(label, world, x, z, description, lineColor, lineOpacity, lineWeight, fillColor, fillOpacity, boost); }
|
public AreaMarkerValues withCorners() { return new AreaMarkerValues(label, world, corners, 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 String description;
|
private final String description;
|
||||||
public String getDescription() { return 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;
|
private final int lineColor;
|
||||||
public int getLineColor() { return 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;
|
private final double lineOpacity;
|
||||||
public double getLineOpacity() { return 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;
|
private final int lineWeight;
|
||||||
public int getLineWeight() { return 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;
|
private final int fillColor;
|
||||||
public int getFillColor() { return 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;
|
private final double fillOpacity;
|
||||||
public double getFillOpacity() { return 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;
|
private final boolean boost;
|
||||||
public boolean isBoost() { return 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)
|
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
|
// 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.label = label;
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.x = x;
|
this.corners = corners;
|
||||||
this.z = z;
|
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.lineColor = lineColor;
|
this.lineColor = lineColor;
|
||||||
this.lineOpacity = lineOpacity;
|
this.lineOpacity = lineOpacity;
|
||||||
@ -82,6 +82,17 @@ public class AreaMarkerValues
|
|||||||
this.fillColor = fillColor;
|
this.fillColor = fillColor;
|
||||||
this.fillOpacity = fillOpacity;
|
this.fillOpacity = fillOpacity;
|
||||||
this.boost = boost;
|
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(),
|
this.getLabel(),
|
||||||
false,
|
false,
|
||||||
this.getWorld(),
|
this.getWorld(),
|
||||||
this.getX(),
|
this.x,
|
||||||
this.getZ(),
|
this.z,
|
||||||
false // not persistent
|
false // not persistent
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
@ -246,35 +247,103 @@ public class EngineDynmap extends Engine
|
|||||||
|
|
||||||
while (!allChunksSource.isEmpty())
|
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
|
// Create the polygon
|
||||||
Set<PS> polygonChunks = new MassiveSet<>();
|
Set<PS> polygonChunks = new MassiveSet<>();
|
||||||
floodFillTarget(allChunksSource, polygonChunks, somePs);
|
floodFillTarget(allChunksSource, polygonChunks, somePs);
|
||||||
List<PS> linelist = getLineList(polygonChunks);
|
|
||||||
|
|
||||||
// Calc the x and y arrays
|
List<PS> polygonCorners = new MassiveList<>();
|
||||||
int sz = linelist.size();
|
for (PS chunk : polygonChunks)
|
||||||
double[] x = new double[sz];
|
|
||||||
double[] z = new double[sz];
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
for (PS ps : linelist)
|
|
||||||
{
|
{
|
||||||
x[i] = ps.getLocationX(true);
|
for (Direction d : Direction.values())
|
||||||
z[i] = ps.getLocationZ(true);
|
{
|
||||||
i++;
|
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
|
// Build information for specific area
|
||||||
String markerId = calcMarkerId(world, faction);
|
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);
|
ret.put(markerId, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
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)
|
private static PS getMinimum(Collection<PS> pss)
|
||||||
{
|
{
|
||||||
int minimumX = Integer.MAX_VALUE;
|
int minimumX = Integer.MAX_VALUE;
|
||||||
|
@ -22,7 +22,39 @@ public class EnumerationUtil
|
|||||||
"LECTERN", // Minecraft 1.14
|
"LECTERN", // Minecraft 1.14
|
||||||
"BEEHIVE", // Minecraft 1.15
|
"BEEHIVE", // Minecraft 1.15
|
||||||
"BEE_NEST", // Minecraft 1.5
|
"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)
|
public static boolean isMaterialEditOnInteract(Material material)
|
||||||
@ -54,7 +86,8 @@ public class EnumerationUtil
|
|||||||
"TRAPPED_CHEST", // Minecraft 1.?
|
"TRAPPED_CHEST", // Minecraft 1.?
|
||||||
"SIGN", // Minecraft 1.?
|
"SIGN", // Minecraft 1.?
|
||||||
"WOOD_DOOR", // Minecraft 1.?
|
"WOOD_DOOR", // Minecraft 1.?
|
||||||
"IRON_DOOR" // Minecraft 1.?
|
"IRON_DOOR", // Minecraft 1.?
|
||||||
|
"BONE_MEAL" // Minecraft 1.?
|
||||||
);
|
);
|
||||||
|
|
||||||
public static boolean isMaterialEditTool(Material material)
|
public static boolean isMaterialEditTool(Material material)
|
||||||
@ -73,7 +106,7 @@ public class EnumerationUtil
|
|||||||
"OAK_FENCE_GATE",
|
"OAK_FENCE_GATE",
|
||||||
"ACACIA_DOOR",
|
"ACACIA_DOOR",
|
||||||
"ACACIA_TRAPDOOR",
|
"ACACIA_TRAPDOOR",
|
||||||
"AKACIA_FENCE_GATE",
|
"ACACIA_FENCE_GATE",
|
||||||
"BIRCH_DOOR",
|
"BIRCH_DOOR",
|
||||||
"BIRCH_TRAPDOOR",
|
"BIRCH_TRAPDOOR",
|
||||||
"BIRCH_FENCE_GATE",
|
"BIRCH_FENCE_GATE",
|
||||||
@ -85,7 +118,15 @@ public class EnumerationUtil
|
|||||||
"JUNGLE_FENCE_GATE",
|
"JUNGLE_FENCE_GATE",
|
||||||
"SPRUCE_DOOR",
|
"SPRUCE_DOOR",
|
||||||
"SPRUCE_TRAPDOOR",
|
"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)
|
public static boolean isMaterialDoor(Material material)
|
||||||
@ -113,6 +154,8 @@ public class EnumerationUtil
|
|||||||
"DROPPER",
|
"DROPPER",
|
||||||
"BARREL", // Minecraft 1.14
|
"BARREL", // Minecraft 1.14
|
||||||
"BLAST_FURNACE", // 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 -.-
|
// The various shulker boxes, they had to make each one a different material -.-
|
||||||
"SHULKER_BOX",
|
"SHULKER_BOX",
|
||||||
@ -225,7 +268,9 @@ public class EnumerationUtil
|
|||||||
"DROWNED", // Minecraft 1.13
|
"DROWNED", // Minecraft 1.13
|
||||||
"PILLAGER", // Minecraft 1.14
|
"PILLAGER", // Minecraft 1.14
|
||||||
"RAVAGER", // Minercraft 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)
|
public static boolean isEntityTypeMonster(EntityType entityType)
|
||||||
@ -264,7 +309,8 @@ public class EnumerationUtil
|
|||||||
"FOX", // Minecraft 1.14
|
"FOX", // Minecraft 1.14
|
||||||
"PANDA", // Minecraft 1.14
|
"PANDA", // Minecraft 1.14
|
||||||
"LLAMA", // 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)
|
public static boolean isEntityTypeAnimal(EntityType entityType)
|
||||||
|
Loading…
Reference in New Issue
Block a user