Merge branch 'project-cosmetics' of

ssh://git@github.com/Mineplex-LLC/Minecraft-PC.git into
project-cosmetics

Conflicts:
	Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/Animator.java
	Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimatorEntity.java
	Plugins/Mineplex.Core.Common/src/mineplex/core/common/shape/ICosmeticShape.java
	Plugins/Mineplex.Core.Common/src/mineplex/core/common/shape/ShapeWings.java
This commit is contained in:
xGamingDudex 2016-05-15 16:03:36 +02:00
commit 97f82e422d
20 changed files with 78 additions and 234 deletions

View File

@ -1,145 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="Mineplex.Core">
<property environment="env"/>
<property name="REPO_DIR" value="../../"/>
<property name="Mineplex.BungeeRotator.location" value="../Mineplex.BungeeRotator"/>
<property name="Mineplex.Hub.location" value="../Mineplex.Hub"/>
<property name="Mineplex.Minecraft.Game.ClassCombat.location" value="../Mineplex.Minecraft.Game.ClassCombat"/>
<property name="Mineplex.Minecraft.Game.Core.location" value="../Mineplex.Minecraft.Game.Core"/>
<property name="Mineplex.StaffServer.location" value="../Mineplex.StaffServer"/>
<property name="Nautilus.Game.Arcade.location" value="../Nautilus.Game.Arcade"/>
<property name="ECLIPSE_HOME" value="../../../../../Filer/eclipse/"/>
<property name="Mineplex.Core.Common.location" value="../Mineplex.Core.Common"/>
<property name="Mineplex.Database.location" value="../Mineplex.Database"/>
<property name="Mineplex.ServerData.location" value="../Mineplex.ServerData"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="Mineplex.ServerData.classpath">
<pathelement location="${Mineplex.ServerData.location}/bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jedis-2.4.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/gson-2.2.1.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/commons-pool2-2.2.jar"/>
</path>
<path id="Mineplex.Database.classpath">
<pathelement location="${Mineplex.Database.location}/bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jooq-meta-3.5.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jooq-codegen-3.5.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jooq-3.5.2.jar"/>
</path>
<path id="Mineplex.Core.Common.classpath">
<pathelement location="${Mineplex.Core.Common.location}/bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/craftbukkit.jar"/>
</path>
<path id="Mineplex.Core.classpath">
<pathelement location="bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/httpcore-4.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/httpclient-4.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/commons-codec-1.6.jar"/>
<path refid="Mineplex.ServerData.classpath"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jedis-2.4.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/commons-pool2-2.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/commons-dbcp2-2.0.1.jar"/>
<path refid="Mineplex.Database.classpath"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jooq-3.5.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/craftbukkit.jar"/>
<path refid="Mineplex.Core.Common.classpath"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/NoCheatPlus.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall">
<ant antfile="build.xml" dir="${Mineplex.Core.Common.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.Database.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.ServerData.location}" inheritAll="false" target="clean"/>
</target>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects">
<ant antfile="build.xml" dir="${Mineplex.Core.Common.location}" inheritAll="false" target="build-project">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Mineplex.Database.location}" inheritAll="false" target="build-project">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Mineplex.ServerData.location}" inheritAll="false" target="build-project">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
</target>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="Mineplex.Core.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects">
<ant antfile="build.xml" dir="${Mineplex.BungeeRotator.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.BungeeRotator.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Mineplex.Hub.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.Hub.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Mineplex.Minecraft.Game.ClassCombat.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.Minecraft.Game.ClassCombat.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Mineplex.Minecraft.Game.Core.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.Minecraft.Game.Core.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Mineplex.StaffServer.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Mineplex.StaffServer.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${Nautilus.Game.Arcade.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${Nautilus.Game.Arcade.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
</target>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>

View File

@ -2,6 +2,8 @@ package mineplex.core.common.animation;
import org.bukkit.util.Vector;
import java.util.Objects;
public class AnimationPoint
{
@ -41,16 +43,10 @@ public class AnimationPoint
return false;
}
@Override
public String toString()
{
return "[Tick: " + _tick + "," + _move.toString() + "]";
}
@Override
public int hashCode()
{
return toString().hashCode();
return Objects.hash(_tick, _move);
}
}

View File

@ -149,6 +149,7 @@ public abstract class Animator
protected abstract void tick(Location loc);
protected abstract void finish(Location loc);
}

View File

@ -34,8 +34,6 @@ public class AnimatorEntity extends Animator
}
@Override
protected void finish(Location loc)
{
}
protected void finish(Location loc) {}
}

View File

@ -28,7 +28,7 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutMultiBlockChange.MultiBlockChan
public class MultiBlockUpdaterAgent
{
private Map<Chunk, List<BlockVector>> _chunks = new HashMap<Chunk, List<BlockVector>>();
private Map<Chunk, List<BlockVector>> _chunks = new HashMap<>();
/**
* Add a block to the list of blocks to send to the player. The agent supports blocks across different chunks and
@ -40,13 +40,7 @@ public class MultiBlockUpdaterAgent
public void addBlock(Block block)
{
Chunk c = ((CraftChunk)block.getChunk()).getHandle();
List<BlockVector> list = _chunks.get(c);
if(list == null)
{
list = new ArrayList<BlockVector>();
_chunks.put(c, list);
}
List<BlockVector> list = _chunks.computeIfAbsent(c,chunk -> new ArrayList<>());
if(list.size() >= 64) return;

View File

@ -0,0 +1,10 @@
package mineplex.core.common.shape;
import org.bukkit.Location;
public interface CosmeticShape
{
void display(Location loc);
}

View File

@ -1,17 +0,0 @@
package mineplex.core.common.shape;
import org.bukkit.Location;
/**
* Interface used by classes which can display visuals at provided locations.
*/
public interface ICosmeticShape
{
/**
* Display a visual at the given location
* @param loc The location to display the visual at
*/
public void display(Location loc);
}

View File

@ -15,7 +15,7 @@ import org.bukkit.util.Vector;
public class Shape
{
protected final static double DefaultDensity = 1;
protected final static double DEFAULT_DENSITY = 1;
protected HashSet<Vector> _points = new HashSet<>();
@ -25,11 +25,6 @@ public class Shape
this._points.addAll(points);
}
public Shape(Vector...points)
{
for(Vector v : points) this._points.add(v);
}
/**
* Rotate this shape along the X-axis
* @param radians Radians to rotate the shape

View File

@ -18,7 +18,7 @@ public class ShapeBox extends Shape
public ShapeBox(Vector localx, Vector localy, Vector localz)
{
this(localx, localy, localz, false, DefaultDensity);
this(localx, localy, localz, false, DEFAULT_DENSITY);
}
/**
@ -31,7 +31,7 @@ public class ShapeBox extends Shape
public ShapeBox(Vector localx, Vector localy, Vector localz, boolean hollow)
{
this(localx, localy, localz, hollow, DefaultDensity);
this(localx, localy, localz, hollow, DEFAULT_DENSITY);
}
/**

View File

@ -17,7 +17,7 @@ public class ShapeGrid extends Shape
*/
public ShapeGrid(String... input)
{
this(DefaultDensity, '#', input);
this(DEFAULT_DENSITY, '#', input);
}
/**
@ -28,7 +28,7 @@ public class ShapeGrid extends Shape
*/
public ShapeGrid(char read, String...input)
{
this(DefaultDensity, read, input);
this(DEFAULT_DENSITY, read, input);
}
/**

View File

@ -26,7 +26,7 @@ public class ShapeSphere extends Shape
*/
public ShapeSphere(double x, double y, double z)
{
this(x, y, z, false, DefaultDensity);
this(x, y, z, false, DEFAULT_DENSITY);
}
/**
@ -38,7 +38,7 @@ public class ShapeSphere extends Shape
*/
public ShapeSphere(double x, double y, double z, boolean hollow)
{
this(x, y, z, hollow, DefaultDensity);
this(x, y, z, hollow, DEFAULT_DENSITY);
}
/**

View File

@ -11,7 +11,7 @@ import mineplex.core.common.util.UtilParticle.ViewDist;
* Some simple wing shapes implementing {@link ICosmeticShape} storing additional particle information
*/
public class ShapeWings extends ShapeGrid implements ICosmeticShape
public class ShapeWings extends ShapeGrid implements CosmeticShape
{
public static final String[] ANGEL_WING_PATTERN = new String[]
{

View File

@ -16,8 +16,10 @@ import mineplex.core.common.CurrencyType;
public class UtilText
{
private static HashMap<Character, Integer> _characters = new HashMap<Character, Integer>();
private static HashMap<Character, BufferedImage> _characterImages = new HashMap<Character, BufferedImage>();
private static HashMap<Character, Integer> _characters = new HashMap<>();
private static HashMap<Character, BufferedImage> _characterImages = new HashMap<>();
private final static char[] VOWELS = new char[]{'a', 'e', 'i', 'o', 'u'};
static
{
@ -626,7 +628,7 @@ public class UtilText
if(!plural(amount)) return word;
String sufix = "s";
if(word.endsWith("s") || word.endsWith("x") || word.endsWith("z") || word.endsWith("ch")) sufix = "es";
if(word.endsWith("y"))
else if(word.endsWith("y"))
{
word.substring(0, word.length()-2);
sufix = "ies";
@ -712,9 +714,7 @@ public class UtilText
char v = word.toLowerCase().charAt(0);
char[] vowels = new char[]{'a', 'e', 'i', 'o', 'u', 'y'};
for(char c : vowels)
for(char c : VOWELS)
{
if(c == v) return true;
}

File diff suppressed because one or more lines are too long

View File

@ -191,26 +191,26 @@ import mineplex.core.projectile.ProjectileManager;
public class GadgetManager extends MiniPlugin
{
private CoreClientManager _clientManager;
private DonationManager _donationManager;
private InventoryManager _inventoryManager;
private PetManager _petManager;
private PreferencesManager _preferencesManager;
private DisguiseManager _disguiseManager;
private BlockRestore _blockRestore;
private ProjectileManager _projectileManager;
private AchievementManager _achievementManager;
private MountManager _mountManager;
private PacketHandler _packetManager;
private HologramManager _hologramManager;
private OutfitWindUpSuitBoosterManager _boosterManager;
private final CoreClientManager _clientManager;
private final DonationManager _donationManager;
private final InventoryManager _inventoryManager;
private final PetManager _petManager;
private final PreferencesManager _preferencesManager;
private final DisguiseManager _disguiseManager;
private final BlockRestore _blockRestore;
private final ProjectileManager _projectileManager;
private final AchievementManager _achievementManager;
private final MountManager _mountManager;
private final PacketHandler _packetManager;
private final HologramManager _hologramManager;
private final OutfitWindUpSuitBoosterManager _boosterManager;
private NautHashMap<GadgetType, List<Gadget>> _gadgets;
private NautHashMap<Player, Long> _lastMove = new NautHashMap<Player, Long>();
private NautHashMap<Player, NautHashMap<GadgetType, Gadget>> _playerActiveGadgetMap = new NautHashMap<Player, NautHashMap<GadgetType, Gadget>>();
private final NautHashMap<Player, Long> _lastMove = new NautHashMap<>();
private final NautHashMap<Player, NautHashMap<GadgetType, Gadget>> _playerActiveGadgetMap = new NautHashMap<>();
private HashSet<GadgetSet> _sets = new HashSet<>();
private final HashSet<GadgetSet> _sets = new HashSet<>();
private boolean _hideParticles = false;
private int _activeItemSlot = 3;

View File

@ -1,6 +1,5 @@
package mineplex.core.gadget.gadgets.gamemodifiers.kits;
import com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
import mineplex.core.gadget.types.GadgetGameModifier;
@ -10,6 +9,11 @@ import org.bukkit.entity.Player;
import java.util.function.Predicate;
/**
* This class creates a Kit modifier, to be implemented in game kits, such as Survival Games or Bridges
*
* @author LCastr0
*/
public class KitGameModifier extends GadgetGameModifier
{
@ -49,6 +53,11 @@ public class KitGameModifier extends GadgetGameModifier
super.EnableCustom(player);
}
/**
* Filters kit based on name
* @param kitName
* @return
*/
public static Predicate<GadgetGameModifier> getKitFilter(String kitName)
{
return new Predicate<GadgetGameModifier>() {

View File

@ -12,6 +12,11 @@ import org.bukkit.inventory.ItemStack;
import java.util.List;
/**
* Lists types of KitGameModifier's
*
* @author LCastr0
*/
public enum KitModifierType
{
@ -20,12 +25,20 @@ public enum KitModifierType
SurvivalGames_HorsemanKit(GameModifierType.SurvivalGames, "Horseman", new String[]{"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.HORSE)),
SurvivalGames_NecromancerKit(GameModifierType.SurvivalGames, "Necromancer", new String[]{"Placeholder"}, Material.SKULL_ITEM, (byte) 0);
private GameModifierType _type;
private String _kitName;
private List<String> _desc;
private Material _mat;
private byte _data;
private final GameModifierType _type;
private final String _kitName;
private final List<String> _desc;
private final Material _mat;
private final byte _data;
/**
*
* @param type
* @param kitName
* @param desc
* @param mat
* @param data
*/
KitModifierType(GameModifierType type, String kitName, String[] desc, Material mat, byte data)
{
_type = type;

View File

@ -14,8 +14,7 @@ public class HatLovestruck extends HatGadget
{
super(manager, "Love Struck",
UtilText.splitLineToArray(C.cGray + "I think I'm in love... Wait a minute, did someone use a love potion on me?!", LineFormat.LORE),
-6,
SkinData.LOVESTRUCK.getSkull());
-6, SkinData.LOVESTRUCK.getSkull());
}
}

View File

@ -14,8 +14,7 @@ public class HatSecretPackage extends HatGadget
{
super(manager, "Secret Package",
UtilText.splitLineToArray(C.cGray + "I hope Chiss is inside!", LineFormat.LORE),
-6,
SkinData.SECRET_PACKAGE.getSkull());
-6, SkinData.SECRET_PACKAGE.getSkull());
}
}

View File

@ -15,11 +15,6 @@ public class SetLove extends GadgetSet
* Timestamp: February 4, 2016
*/
/* Note by LCastr0, at May 3rd, 2016:
* Seems to be a dupe of Cupid's Love set, will be commenting
* out the addition of this set to the GadgetManager.
* */
public SetLove(GadgetManager manager)
{
super(manager, "Lovely!", "Coming soon...",