This commit is contained in:
Olof Larsson 2016-10-09 10:36:36 +02:00
parent 16eb5a8743
commit 863f76d2ae
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
30 changed files with 397 additions and 104 deletions

273
.gitignore vendored
View File

@ -1,31 +1,260 @@
# Eclipse #################### Misc ####################
/.classpath # Home made stuff not present in the gitignore project.
/.project # Manually forged MassiveCraft stuff.
/.settings
/*.jardesc
# IntelliJ # Eclipse jar description files
*.jardesc
# IntelliJ missing files
*.iml *.iml
*.ipr *.ipr
# Just because we had it in our old gitignore.
manifest.mf
#################### Language ####################
# Language general ignores.
### Maven
# https://github.com/github/gitignore/blob/master/Maven.gitignore
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
#################### IDE ####################
# IDE general ignores.
### Eclipse
# https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
### JetBrains
# https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws *.iws
.idea/
# NetBeans ## Plugin-specific files:
/nbproject
# vim # IntelliJ
.*.sw[a-p] /out/
# Maven # mpeltonen/sbt-idea plugin
/build.xml .idea_modules/
/target
/dependency-reduced-pom.xml
# various other potential build files # JIRA plugin
/build atlassian-ide-plugin.xml
/bin
/dist
/manifest.mf
# Mac filesystem dust # Crashlytics plugin (for Android Studio and IntelliJ)
.DS_Store com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### NetBeans
# https://github.com/github/gitignore/blob/master/Global/NetBeans.gitignore
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
### SublimeText
# https://github.com/github/gitignore/blob/master/Global/SublimeText.gitignore
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
bh_unicode_properties.cache
# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings
### Vim
# https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
#################### OS ####################
# Operating system general ignores.
### https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
### https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
#################### OTHER ####################
# Other general ignores.
### Dropbox
# https://github.com/github/gitignore/blob/master/Global/Dropbox.gitignore
# Dropbox settings and caches
.dropbox
.dropbox.attr
.dropbox.cache

View File

@ -1,3 +1,3 @@
<a href="https://www.massivecraft.com/massivecore"> <a href="https://www.massivecraft.com/massivecore">
![MassiveCore Logotype](https://raw.github.com/MassiveCraft/MassiveCore/master/media/logo300.png)<br> ![MassiveCore Logotype](https://www.massivecraft.com/wp-content/uploads/2012/11/massivecraft-logotype-plugin-massivecore-2000.jpg)<br>
<b>https://www.massivecraft.com/massivecore</b></a> <b>https://www.massivecraft.com/massivecore</b></a>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -1,9 +1,9 @@
main: com.massivecraft.massivecore.MassiveCore main: ${project.groupId}.${project.name}
name: MassiveCore name: ${project.name}
version: 2.8.21 version: ${project.version}
website: https://www.massivecraft.com/massivecore website: ${project.url}
description: ${project.description}
authors: [Cayorion] authors: [Cayorion]
description: §eMassiveCore is a plugin that contains libraries and features that other plugins make use of. §aCayorion §efrom the minecraft server §aMassiveCraft §eis the lead programmer. Feel free to visit us at §bhttps://www.massivecraft.com
load: startup load: startup
permissions: permissions:
# -------------------------------------------- # # -------------------------------------------- #

56
pom.xml Normal file
View File

@ -0,0 +1,56 @@
<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>2.8.22-SNAPSHOT</version>
<relativePath>../MassiveSuper</relativePath>
</parent>
<!-- Basics -->
<groupId>com.massivecraft.massivecore</groupId>
<artifactId>MassiveCore</artifactId>
<packaging>jar</packaging>
<!-- Info -->
<name>${project.artifactId}</name>
<description>${massiveColorInfo}${project.name} is a plugin that contains libraries and features that other plugins make use of. ${massiveDescriptionSuffix}</description>
<url>${massiveBaseUrl}/massivecore</url>
<!-- Dependencies -->
<dependencies>
<!-- Spigot -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
</dependency>
<!-- Vault -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</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>

View File

@ -25,8 +25,8 @@ public class ConfServer extends SimpleConfig
public static Map<String, String> alias2uri = MUtil.map( public static Map<String, String> alias2uri = MUtil.map(
"default", "flatfile", "default", "flatfile",
"flatfile", "flatfile://mstore", "flatfile", "flatfile://mstore",
"mongodb", "mongodb://localhost:27017/mstore" "mongodb", "mongodb://localhost:27017/mstore"
); );
} }

View File

@ -7,6 +7,7 @@ import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import com.massivecraft.massivecore.mixin.*;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
@ -66,22 +67,6 @@ import com.massivecraft.massivecore.engine.EngineMassiveCoreWorldNameSet;
import com.massivecraft.massivecore.integration.vault.IntegrationVault; import com.massivecraft.massivecore.integration.vault.IntegrationVault;
import com.massivecraft.massivecore.item.DataBannerPattern; import com.massivecraft.massivecore.item.DataBannerPattern;
import com.massivecraft.massivecore.item.WriterItemStack; import com.massivecraft.massivecore.item.WriterItemStack;
import com.massivecraft.massivecore.mixin.MixinActionbar;
import com.massivecraft.massivecore.mixin.MixinActual;
import com.massivecraft.massivecore.mixin.MixinCommand;
import com.massivecraft.massivecore.mixin.MixinDisplayName;
import com.massivecraft.massivecore.mixin.MixinEvent;
import com.massivecraft.massivecore.mixin.MixinGamemode;
import com.massivecraft.massivecore.mixin.MixinInventory;
import com.massivecraft.massivecore.mixin.MixinKick;
import com.massivecraft.massivecore.mixin.MixinMessage;
import com.massivecraft.massivecore.mixin.MixinModification;
import com.massivecraft.massivecore.mixin.MixinPlayed;
import com.massivecraft.massivecore.mixin.MixinSenderPs;
import com.massivecraft.massivecore.mixin.MixinTeleport;
import com.massivecraft.massivecore.mixin.MixinTitle;
import com.massivecraft.massivecore.mixin.MixinVisibility;
import com.massivecraft.massivecore.mixin.MixinWorld;
import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.mson.Mson;
import com.massivecraft.massivecore.mson.MsonEvent; import com.massivecraft.massivecore.mson.MsonEvent;
import com.massivecraft.massivecore.nms.NmsBasics; import com.massivecraft.massivecore.nms.NmsBasics;
@ -315,6 +300,7 @@ public class MassiveCore extends MassivePlugin
MixinGamemode.class, MixinGamemode.class,
MixinInventory.class, MixinInventory.class,
MixinKick.class, MixinKick.class,
MixinMassiveCraftPremium.class,
MixinMessage.class, MixinMessage.class,
MixinModification.class, MixinModification.class,
MixinPlayed.class, MixinPlayed.class,

View File

@ -23,17 +23,17 @@ public class MassiveMap<K, V> extends LinkedHashMap<K, V>
public MassiveMap(int initialCapacity, float loadFactor) public MassiveMap(int initialCapacity, float loadFactor)
{ {
super(initialCapacity, loadFactor); super(initialCapacity, loadFactor);
} }
public MassiveMap(int initialCapacity) public MassiveMap(int initialCapacity)
{ {
super(initialCapacity); super(initialCapacity);
} }
public MassiveMap() public MassiveMap()
{ {
super(); super();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -45,7 +45,7 @@ public class MassiveMap<K, V> extends LinkedHashMap<K, V>
public MassiveMap(int initialCapacity, float loadFactor, boolean accessOrder) public MassiveMap(int initialCapacity, float loadFactor, boolean accessOrder)
{ {
super(initialCapacity, loadFactor, accessOrder); super(initialCapacity, loadFactor, accessOrder);
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -20,17 +20,17 @@ public class MassiveMapDef<K, V> extends MassiveMap<K, V> implements Def
public MassiveMapDef(int initialCapacity, float loadFactor) public MassiveMapDef(int initialCapacity, float loadFactor)
{ {
super(initialCapacity, loadFactor); super(initialCapacity, loadFactor);
} }
public MassiveMapDef(int initialCapacity) public MassiveMapDef(int initialCapacity)
{ {
super(initialCapacity); super(initialCapacity);
} }
public MassiveMapDef() public MassiveMapDef()
{ {
super(); super();
} }
public MassiveMapDef(Map<? extends K, ? extends V> m) public MassiveMapDef(Map<? extends K, ? extends V> m)
@ -40,7 +40,7 @@ public class MassiveMapDef<K, V> extends MassiveMap<K, V> implements Def
public MassiveMapDef(int initialCapacity, float loadFactor, boolean accessOrder) public MassiveMapDef(int initialCapacity, float loadFactor, boolean accessOrder)
{ {
super(initialCapacity, loadFactor, accessOrder); super(initialCapacity, loadFactor, accessOrder);
} }
public MassiveMapDef(K key1, V value1, Object... objects) public MassiveMapDef(K key1, V value1, Object... objects)

View File

@ -92,8 +92,8 @@ public class EngineMassiveCoreGank extends Engine
// -------------------------------------------- // // -------------------------------------------- //
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onEntityDamage(EntityDamageByEntityEvent event) public void onEntityDamage(EntityDamageByEntityEvent event)
{ {
// If an entity ... // If an entity ...
Entity entity = event.getEntity(); Entity entity = event.getEntity();
@ -123,6 +123,6 @@ public class EngineMassiveCoreGank extends Engine
// ... and set. // ... and set.
playerDamages.put(player, playerDamage); playerDamages.put(player, playerDamage);
} }
} }

View File

@ -159,10 +159,10 @@ public class EngineMassiveCoreSponsor extends Engine
// -------------------------------------------- // // -------------------------------------------- //
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerJoin(PlayerJoinEvent event) public void onPlayerJoin(PlayerJoinEvent event)
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
this.inform(player); this.inform(player);
} }
} }

View File

@ -0,0 +1,22 @@
package com.massivecraft.massivecore.mixin;
public class MixinMassiveCraftPremium extends Mixin
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static MixinMassiveCraftPremium d = new MixinMassiveCraftPremium();
private static MixinMassiveCraftPremium i = d;
public static MixinMassiveCraftPremium get() { return i; }
// -------------------------------------------- //
// METHODS
// -------------------------------------------- //
public boolean isPremium(Object senderObject)
{
return false;
}
}

View File

@ -5,8 +5,8 @@ import java.util.regex.Pattern;
public class PredicateElementGarbage extends PredicateElementRegexes public class PredicateElementGarbage extends PredicateElementRegexes
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
private static PredicateElementGarbage i = new PredicateElementGarbage(); private static PredicateElementGarbage i = new PredicateElementGarbage();
public static PredicateElementGarbage get() { return i; } public static PredicateElementGarbage get() { return i; }

View File

@ -11,8 +11,8 @@ import com.massivecraft.massivecore.collections.MassiveList;
public class PredicateElementRegexes implements Predicate<StackTraceElement> public class PredicateElementRegexes implements Predicate<StackTraceElement>
{ {
// -------------------------------------------- // // -------------------------------------------- //
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
private List<Pattern> patterns = Collections.emptyList(); private List<Pattern> patterns = Collections.emptyList();
public List<Pattern> getPatterns() { return this.patterns; } public List<Pattern> getPatterns() { return this.patterns; }
@ -20,8 +20,8 @@ public class PredicateElementRegexes implements Predicate<StackTraceElement>
public void setPatterns(Iterable<String> regexes) { this.setPatterns(asPatterns(regexes));} public void setPatterns(Iterable<String> regexes) { this.setPatterns(asPatterns(regexes));}
// -------------------------------------------- // // -------------------------------------------- //
// CONSTRUCT // CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
public PredicateElementRegexes(String... regexes) public PredicateElementRegexes(String... regexes)
{ {
@ -29,8 +29,8 @@ public class PredicateElementRegexes implements Predicate<StackTraceElement>
} }
// -------------------------------------------- // // -------------------------------------------- //
// OVERRIDE // OVERRIDE
// -------------------------------------------- // // -------------------------------------------- //
@Override @Override
public boolean apply(StackTraceElement element) public boolean apply(StackTraceElement element)
@ -45,8 +45,8 @@ public class PredicateElementRegexes implements Predicate<StackTraceElement>
} }
// -------------------------------------------- // // -------------------------------------------- //
// UTIL // UTIL
// -------------------------------------------- // // -------------------------------------------- //
protected List<Pattern> asPatterns(Iterable<String> regexes) protected List<Pattern> asPatterns(Iterable<String> regexes)
{ {

View File

@ -5,8 +5,8 @@ import java.util.regex.Pattern;
public class PredicateElementSignificant extends PredicateElementRegexes public class PredicateElementSignificant extends PredicateElementRegexes
{ {
// -------------------------------------------- // // -------------------------------------------- //
// INSTANCE & CONSTRUCT // INSTANCE & CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
private static PredicateElementSignificant i = new PredicateElementSignificant(); private static PredicateElementSignificant i = new PredicateElementSignificant();
public static PredicateElementSignificant get() { return i; } public static PredicateElementSignificant get() { return i; }

View File

@ -348,10 +348,10 @@ public class MUtil
String ret = address.toString(); String ret = address.toString();
String[] parts = ret.split("/"); String[] parts = ret.split("/");
ret = parts[1]; ret = parts[1];
parts = ret.split(":"); parts = ret.split(":");
ret = parts[0]; ret = parts[0];
return ret; return ret;
} }
@ -368,7 +368,7 @@ public class MUtil
String ret = address.toString(); String ret = address.toString();
String[] parts = ret.split("/"); String[] parts = ret.split("/");
ret = parts[1]; ret = parts[1];
return ret; return ret;
} }
@ -1882,11 +1882,11 @@ public class MUtil
public static double round(double value, int places) public static double round(double value, int places)
{ {
if (places < 0) throw new IllegalArgumentException(); if (places < 0) throw new IllegalArgumentException();
BigDecimal bd = new BigDecimal(value); BigDecimal bd = new BigDecimal(value);
bd = bd.setScale(places, RoundingMode.HALF_UP); bd = bd.setScale(places, RoundingMode.HALF_UP);
return bd.doubleValue(); return bd.doubleValue();
} }
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -110,7 +110,7 @@ public class SignUtil
// Returns true if the result is a special sign of with the specified title. // Returns true if the result is a special sign of with the specified title.
public static boolean handleSpecialPermissionFix(SignChangeEvent event, String title, String permissionId) public static boolean handleSpecialPermissionFix(SignChangeEvent event, String title, String permissionId)
{ {
if (event == null) throw new NullPointerException("event"); if (event == null) throw new NullPointerException("event");
if (title == null) throw new NullPointerException("title"); if (title == null) throw new NullPointerException("title");
if (permissionId == null) throw new NullPointerException("permissionId"); if (permissionId == null) throw new NullPointerException("permissionId");
@ -135,7 +135,7 @@ public class SignUtil
// ... and fix the first line. // ... and fix the first line.
event.setLine(0, getSpecialLine(title)); event.setLine(0, getSpecialLine(title));
return true; return true;
} }
// -------------------------------------------- // // -------------------------------------------- //
// SPECIAL PILLAR // SPECIAL PILLAR

View File

@ -169,7 +169,7 @@ public class TimeUnit implements Comparable<TimeUnit>
@Override @Override
public final int hashCode() public final int hashCode()
{ {
return (int)(this.millis^(this.millis>>>32)); return (int)(this.millis^(this.millis>>>32));
} }
} }

View File

@ -186,8 +186,8 @@ public class WebUtil
{ {
if ( ! (connection instanceof HttpsURLConnection)) return; if ( ! (connection instanceof HttpsURLConnection)) return;
HttpsURLConnection httpsConnection = (HttpsURLConnection) connection; HttpsURLConnection httpsConnection = (HttpsURLConnection) connection;
httpsConnection.setSSLSocketFactory(TRUSTING_SOCKET_FACTORY); httpsConnection.setSSLSocketFactory(TRUSTING_SOCKET_FACTORY);
httpsConnection.setHostnameVerifier(TRUSTING_HOSTNAME_VERIFIER); httpsConnection.setHostnameVerifier(TRUSTING_HOSTNAME_VERIFIER);
} }
} }