mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-12 13:44:28 +01:00
Cleanup
This commit is contained in:
parent
2a9adfc751
commit
5620e9a8cf
@ -8,7 +8,7 @@ import java.util.List;
|
||||
*/
|
||||
public class EnumGenerator implements CodeGenerator {
|
||||
|
||||
private static final String COMMENT = "//==============================\n// AUTOGENERATED BY "+EnumGenerator.class.getSimpleName()+"\n//==============================";
|
||||
private static final String COMMENT = "//==============================\n// AUTOGENERATED BY " + EnumGenerator.class.getSimpleName() + "\n//==============================";
|
||||
|
||||
private final String enumName;
|
||||
private String[] parameters;
|
||||
@ -47,7 +47,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(COMMENT);
|
||||
builder.append("\npackage ").append(enumPackage).append(";\n");
|
||||
for(String imp : imports) {
|
||||
for (String imp : imports) {
|
||||
builder.append("import ").append(imp).append(";\n");
|
||||
}
|
||||
for (String annotation : annotations) {
|
||||
@ -56,13 +56,13 @@ public class EnumGenerator implements CodeGenerator {
|
||||
builder.append("\npublic enum ").append(enumName).append(" {\n");
|
||||
|
||||
// generate instances
|
||||
for(Instance instance : instances) {
|
||||
for (Instance instance : instances) {
|
||||
builder.append("\t");
|
||||
builder.append(instance.name).append("(");
|
||||
Object[] objects = instance.parameters;
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
Object param = objects[i];
|
||||
if(i != 0) {
|
||||
if (i != 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(param.toString());
|
||||
@ -71,23 +71,23 @@ public class EnumGenerator implements CodeGenerator {
|
||||
}
|
||||
builder.append(";\n");
|
||||
|
||||
if(staticBlock != null) {
|
||||
if (staticBlock != null) {
|
||||
builder.append("\n\tstatic {\n");
|
||||
builder.append(staticBlock);
|
||||
builder.append("\t}\n\n");
|
||||
}
|
||||
|
||||
// generate properties & constructor
|
||||
if(parameters.length != 0) {
|
||||
if (parameters.length != 0) {
|
||||
// properties
|
||||
for(String property : parameters) {
|
||||
for (String property : parameters) {
|
||||
builder.append("\t");
|
||||
builder.append("private ").append(property).append(";\n");
|
||||
}
|
||||
builder.append("\n");
|
||||
|
||||
// hard coded fields
|
||||
for(Field hardcoded : hardcodedFields) {
|
||||
for (Field hardcoded : hardcodedFields) {
|
||||
builder.append("\tprivate ").append(hardcoded.type).append(" ").append(hardcoded.name).append(" = ").append(hardcoded.value).append(";");
|
||||
builder.append("\n");
|
||||
}
|
||||
@ -96,7 +96,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
builder.append("\t");
|
||||
builder.append(enumName).append("(");
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
if(i != 0) {
|
||||
if (i != 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(parameters[i]);
|
||||
@ -104,7 +104,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
builder.append(") {\n");
|
||||
|
||||
// property assignment
|
||||
for(String property : parameters) {
|
||||
for (String property : parameters) {
|
||||
String[] parts = property.split(" ");
|
||||
String type = parts[0];
|
||||
String name = parts[1];
|
||||
@ -118,15 +118,15 @@ public class EnumGenerator implements CodeGenerator {
|
||||
}
|
||||
|
||||
// generate methods
|
||||
for(Method m : methods) {
|
||||
for (Method m : methods) {
|
||||
builder.append("\n");
|
||||
builder.append("\t");
|
||||
if(m.isPublic) {
|
||||
if (m.isPublic) {
|
||||
builder.append("public ");
|
||||
}
|
||||
builder.append(m.returnType).append(" ").append(m.name).append(m.signature).append(" {\n");
|
||||
|
||||
for(String line : m.lines) {
|
||||
for (String line : m.lines) {
|
||||
builder.append("\t\t").append(line).append("\n");
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
}
|
||||
|
||||
public void appendToConstructor(String... lines) {
|
||||
for(String line : lines) {
|
||||
for (String line : lines) {
|
||||
constructorEnd.append("\t\t").append(line).append("\n");
|
||||
}
|
||||
}
|
||||
@ -171,7 +171,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
return enumName;
|
||||
}
|
||||
|
||||
private class Method {
|
||||
private static class Method {
|
||||
private final boolean isPublic;
|
||||
private String name;
|
||||
private String signature;
|
||||
@ -187,7 +187,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
private class Field {
|
||||
private static class Field {
|
||||
private String type;
|
||||
private String name;
|
||||
private String value;
|
||||
@ -199,7 +199,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
private class Instance {
|
||||
private static class Instance {
|
||||
private String name;
|
||||
private Object[] parameters;
|
||||
|
||||
|
@ -66,8 +66,6 @@ public class ColoredText {
|
||||
for (int i = 0; i < message.length(); i++) {
|
||||
final char c = message.charAt(i);
|
||||
if (c == colorChar) {
|
||||
final boolean hasNextChar = i < message.length();
|
||||
if (hasNextChar) {
|
||||
final char nextChar = message.charAt(i + 1);
|
||||
final ChatColor color = ChatColor.fromLegacyColorCodes(nextChar);
|
||||
if (color != ChatColor.NO_COLOR) {
|
||||
@ -77,7 +75,6 @@ public class ColoredText {
|
||||
} else {
|
||||
result.append(c);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.append(c);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class TranslatableText {
|
||||
|
||||
if (arguments != null && arguments.length > 0) {
|
||||
for (String arg : arguments) {
|
||||
content.append("," + arg);
|
||||
content.append(",").append(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,15 +31,12 @@ public class ArgumentWord extends Argument<String> {
|
||||
|
||||
@Override
|
||||
public int getConditionResult(String value) {
|
||||
|
||||
// Check restrictions
|
||||
boolean findRestriction = false;
|
||||
if (restrictions != null && restrictions.length > 0) {
|
||||
for (String r : restrictions) {
|
||||
if (value.equalsIgnoreCase(r))
|
||||
return SUCCESS;
|
||||
}
|
||||
if (!findRestriction)
|
||||
return RESTRICTION_ERROR;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,6 @@ public class SerializableDataImpl extends DataImpl implements SerializableData {
|
||||
*
|
||||
* @param data the object to append the data
|
||||
* @param reader the reader
|
||||
* @return the deserialized {@link SerializableData}
|
||||
*/
|
||||
private static void readData(SerializableData data, BinaryReader reader) {
|
||||
final Object2ShortMap<String> typeToIndexMap = SerializableData.readDataIndexes(reader);
|
||||
|
@ -31,7 +31,7 @@ import java.util.function.Supplier;
|
||||
|
||||
public abstract class EntityCreature extends LivingEntity {
|
||||
|
||||
private PFPathingEntity pathingEntity = new PFPathingEntity(this);
|
||||
private final PFPathingEntity pathingEntity = new PFPathingEntity(this);
|
||||
private HydrazinePathFinder pathFinder;
|
||||
private IPath path;
|
||||
private Position pathPosition;
|
||||
@ -51,7 +51,7 @@ public abstract class EntityCreature extends LivingEntity {
|
||||
private ItemStack leggings;
|
||||
private ItemStack boots;
|
||||
|
||||
private ReentrantLock pathLock = new ReentrantLock();
|
||||
private final ReentrantLock pathLock = new ReentrantLock();
|
||||
|
||||
|
||||
public EntityCreature(EntityType entityType, Position spawnPosition) {
|
||||
|
@ -12,7 +12,7 @@ import java.util.function.Consumer;
|
||||
|
||||
public final class EntityManager {
|
||||
|
||||
private ConcurrentLinkedQueue<Player> waitingPlayers = new ConcurrentLinkedQueue<>();
|
||||
private final ConcurrentLinkedQueue<Player> waitingPlayers = new ConcurrentLinkedQueue<>();
|
||||
|
||||
/**
|
||||
* Connect waiting players
|
||||
|
@ -40,7 +40,7 @@ public class ExperienceOrb extends Entity {
|
||||
playerConnection.sendPacket(experienceOrbPacket);
|
||||
playerConnection.sendPacket(getVelocityPacket());
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,10 +59,10 @@ public class ExperienceOrb extends Entity {
|
||||
*/
|
||||
public void setExperienceCount(short experienceCount) {
|
||||
// Remove the entity in order to respawn it with the correct experience count
|
||||
getViewers().forEach(player -> removeViewer(player));
|
||||
getViewers().forEach(this::removeViewer);
|
||||
|
||||
this.experienceCount = experienceCount;
|
||||
|
||||
getViewers().forEach(player -> addViewer(player));
|
||||
getViewers().forEach(this::addViewer);
|
||||
}
|
||||
}
|
||||
|
@ -4,9 +4,9 @@ public enum GameMode {
|
||||
|
||||
SURVIVAL((byte) 0, true), CREATIVE((byte) 1, false), ADVENTURE((byte) 2, true), SPECTATOR((byte) 3, false);
|
||||
|
||||
private byte id;
|
||||
private final byte id;
|
||||
private boolean hardcore;
|
||||
private boolean canTakeDamage;
|
||||
private final boolean canTakeDamage;
|
||||
|
||||
GameMode(byte id, boolean canTakeDamage) {
|
||||
this.id = id;
|
||||
|
@ -207,7 +207,7 @@ public abstract class LivingEntity extends Entity implements EquipmentHandler {
|
||||
|
||||
// Remove passengers if any
|
||||
if (hasPassenger()) {
|
||||
getPassengers().forEach(entity -> removePassenger(entity));
|
||||
getPassengers().forEach(this::removePassenger);
|
||||
}
|
||||
|
||||
EntityDeathEvent entityDeathEvent = new EntityDeathEvent(this);
|
||||
|
@ -51,7 +51,7 @@ public abstract class ObjectEntity extends Entity {
|
||||
playerConnection.sendPacket(getPassengersPacket());
|
||||
}
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1363,7 +1363,7 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
*/
|
||||
protected void sendDimension(DimensionType dimensionType) {
|
||||
Check.notNull(dimensionType, "Dimension cannot be null!");
|
||||
Check.argCondition(dimensionType.equals(getDimensionType()), "The dimension need to be different than the current one!");
|
||||
Check.argCondition(dimensionType.equals(getDimensionType()), "The dimension needs to be different than the current one!");
|
||||
|
||||
this.dimensionType = dimensionType;
|
||||
RespawnPacket respawnPacket = new RespawnPacket();
|
||||
@ -1941,8 +1941,7 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
// Get the stage from the custom block object if it is, otherwise use the local fieldl
|
||||
final byte stage = multiPlayerBreaking ? targetCustomBlock.getBreakStage(instance, targetBlockPosition) : targetStage;
|
||||
// Retrieve the break delay for the current stage
|
||||
final int breakDelay = targetCustomBlock.getBreakDelay(this, targetBlockPosition, stage, breakers);
|
||||
this.targetBreakDelay = breakDelay;
|
||||
this.targetBreakDelay = targetCustomBlock.getBreakDelay(this, targetBlockPosition, stage, breakers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,6 @@ import com.google.gson.JsonParser;
|
||||
import net.minestom.server.utils.url.URLUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* Contains all the data required to store a skin
|
||||
@ -44,7 +43,7 @@ public class PlayerSkin {
|
||||
* Get a skin from a Mojang UUID
|
||||
*
|
||||
* @param uuid Mojang UUID
|
||||
* @return a player skin based on the UUID
|
||||
* @return a player skin based on the UUID, null if not found
|
||||
*/
|
||||
public static PlayerSkin fromUuid(String uuid) {
|
||||
final String url = "https://sessionserver.mojang.com/session/minecraft/profile/" + uuid + "?unsigned=false";
|
||||
@ -54,9 +53,8 @@ public class PlayerSkin {
|
||||
final JsonObject jsonObject = JsonParser.parseString(response).getAsJsonObject();
|
||||
final JsonArray propertiesArray = jsonObject.get("properties").getAsJsonArray();
|
||||
|
||||
final Iterator<JsonElement> iterator = propertiesArray.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
final JsonObject propertyObject = iterator.next().getAsJsonObject();
|
||||
for (JsonElement jsonElement : propertiesArray) {
|
||||
final JsonObject propertyObject = jsonElement.getAsJsonObject();
|
||||
final String name = propertyObject.get("name").getAsString();
|
||||
if (!name.equals("textures"))
|
||||
continue;
|
||||
@ -75,7 +73,7 @@ public class PlayerSkin {
|
||||
* Get a skin from a Minecraft username
|
||||
*
|
||||
* @param username the Minecraft username
|
||||
* @return a skin based on a Minecraft username
|
||||
* @return a skin based on a Minecraft username, null if not found
|
||||
*/
|
||||
public static PlayerSkin fromUsername(String username) {
|
||||
final String url = "https://api.mojang.com/users/profiles/minecraft/" + username;
|
||||
|
@ -6,7 +6,7 @@ import net.minestom.server.utils.time.TimeUnit;
|
||||
|
||||
public class EntityFireEvent extends CancellableEvent {
|
||||
|
||||
private Entity entity;
|
||||
private final Entity entity;
|
||||
private int duration;
|
||||
private TimeUnit timeUnit;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
// TODO: that's an example, please don't modify standard library classes. And this classloader should not let you do it because it first asks the platform classloader
|
||||
|
||||
// TODO: priorities?
|
||||
private List<CodeModifier> modifiers = new LinkedList<>();
|
||||
private final List<CodeModifier> modifiers = new LinkedList<>();
|
||||
|
||||
private MinestomOverwriteClassLoader(ClassLoader parent) {
|
||||
super("Minestom ClassLoader", extractURLsFromClasspath(), parent);
|
||||
@ -65,9 +65,9 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
}
|
||||
|
||||
public static MinestomOverwriteClassLoader getInstance() {
|
||||
if(INSTANCE == null) {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (MinestomOverwriteClassLoader.class) {
|
||||
if(INSTANCE == null) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new MinestomOverwriteClassLoader(MinestomOverwriteClassLoader.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
@ -83,12 +83,12 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
try {
|
||||
String part = parts[i];
|
||||
String protocol;
|
||||
if(part.contains("!")) {
|
||||
if (part.contains("!")) {
|
||||
protocol = "jar://";
|
||||
} else {
|
||||
protocol = "file://";
|
||||
}
|
||||
urls[i] = new URL(protocol+part);
|
||||
urls[i] = new URL(protocol + part);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
@ -99,24 +99,24 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
@Override
|
||||
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
|
||||
Class<?> loadedClass = findLoadedClass(name);
|
||||
if(loadedClass != null)
|
||||
if (loadedClass != null)
|
||||
return loadedClass;
|
||||
|
||||
try {
|
||||
// we do not load system classes by ourselves
|
||||
Class<?> systemClass = ClassLoader.getPlatformClassLoader().loadClass(name);
|
||||
log.trace("System class: "+systemClass);
|
||||
log.trace("System class: " + systemClass);
|
||||
return systemClass;
|
||||
} catch (ClassNotFoundException e) {
|
||||
try {
|
||||
if(isProtected(name)) {
|
||||
log.trace("Protected: "+name);
|
||||
if (isProtected(name)) {
|
||||
log.trace("Protected: " + name);
|
||||
return super.loadClass(name, resolve);
|
||||
}
|
||||
|
||||
return define(name, loadBytes(name, true), resolve);
|
||||
} catch (Exception ex) {
|
||||
log.trace("Fail to load class, resorting to parent loader: "+name, ex);
|
||||
log.trace("Fail to load class, resorting to parent loader: " + name, ex);
|
||||
// fail to load class, let parent load
|
||||
// this forbids code modification, but at least it will load
|
||||
return super.loadClass(name, resolve);
|
||||
@ -125,9 +125,9 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
}
|
||||
|
||||
private boolean isProtected(String name) {
|
||||
if(!protectedClasses.contains(name)) {
|
||||
for(String start : protectedPackages) {
|
||||
if(name.startsWith(start))
|
||||
if (!protectedClasses.contains(name)) {
|
||||
for (String start : protectedPackages) {
|
||||
if (name.startsWith(start))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -137,8 +137,8 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
|
||||
private Class<?> define(String name, byte[] bytes, boolean resolve) throws ClassNotFoundException {
|
||||
Class<?> defined = defineClass(name, bytes, 0, bytes.length);
|
||||
log.trace("Loaded with code modifiers: "+name);
|
||||
if(resolve) {
|
||||
log.trace("Loaded with code modifiers: " + name);
|
||||
if (resolve) {
|
||||
resolveClass(defined);
|
||||
}
|
||||
return defined;
|
||||
@ -146,6 +146,7 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
|
||||
/**
|
||||
* Loads and possibly transforms class bytecode corresponding to the given binary name.
|
||||
*
|
||||
* @param name
|
||||
* @param transform
|
||||
* @return
|
||||
@ -153,24 +154,24 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
public byte[] loadBytes(String name, boolean transform) throws IOException, ClassNotFoundException {
|
||||
if(name == null)
|
||||
if (name == null)
|
||||
throw new ClassNotFoundException();
|
||||
String path = name.replace(".", "/") + ".class";
|
||||
byte[] bytes = getResourceAsStream(path).readAllBytes();
|
||||
if(transform && !isProtected(name)) {
|
||||
if (transform && !isProtected(name)) {
|
||||
ClassReader reader = new ClassReader(bytes);
|
||||
ClassNode node = new ClassNode();
|
||||
reader.accept(node, 0);
|
||||
boolean modified = false;
|
||||
synchronized (modifiers) {
|
||||
for(CodeModifier modifier : modifiers) {
|
||||
for (CodeModifier modifier : modifiers) {
|
||||
boolean shouldModify = modifier.getNamespace() == null || name.startsWith(modifier.getNamespace());
|
||||
if(shouldModify) {
|
||||
if (shouldModify) {
|
||||
modified |= modifier.transform(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(modified) {
|
||||
if (modified) {
|
||||
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES) {
|
||||
@Override
|
||||
protected ClassLoader getClassLoader() {
|
||||
@ -179,7 +180,7 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
};
|
||||
node.accept(writer);
|
||||
bytes = writer.toByteArray();
|
||||
log.trace("Modified "+name);
|
||||
log.trace("Modified " + name);
|
||||
}
|
||||
}
|
||||
return bytes;
|
||||
@ -204,10 +205,10 @@ public class MinestomOverwriteClassLoader extends URLClassLoader {
|
||||
}
|
||||
URLClassLoader loader = newChild(urls);
|
||||
Class<?> modifierClass = loader.loadClass(codeModifierClass);
|
||||
if(CodeModifier.class.isAssignableFrom(modifierClass)) {
|
||||
if (CodeModifier.class.isAssignableFrom(modifierClass)) {
|
||||
CodeModifier modifier = (CodeModifier) modifierClass.getDeclaredConstructor().newInstance();
|
||||
synchronized (modifiers) {
|
||||
log.warn("Added Code modifier: "+modifier);
|
||||
log.warn("Added Code modifier: " + modifier);
|
||||
addCodeModifier(modifier);
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class GlobalPropertyServiceMinestom implements IGlobalPropertyService {
|
||||
|
||||
private class BasicProperty implements IPropertyKey {
|
||||
private static class BasicProperty implements IPropertyKey {
|
||||
|
||||
private final String name;
|
||||
|
||||
|
@ -95,7 +95,7 @@ class LootTableContainer {
|
||||
}
|
||||
}
|
||||
|
||||
private class FunctionContainer {
|
||||
private static class FunctionContainer {
|
||||
private String function;
|
||||
private ConditionContainer[] conditions;
|
||||
|
||||
|
@ -590,7 +590,7 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta
|
||||
/**
|
||||
* Send a {@link BlockActionPacket} for all the viewers of the specific position
|
||||
*
|
||||
* @param blockPosition
|
||||
* @param blockPosition the block position
|
||||
* @param actionId
|
||||
* @param actionParam
|
||||
* @see <a href="https://wiki.vg/Protocol#Block_Action">Packet information</a> for the action id & param
|
||||
|
@ -16,7 +16,7 @@ public class BlockBatch implements InstanceBatch {
|
||||
|
||||
private InstanceContainer instance;
|
||||
|
||||
private Map<Chunk, List<BlockData>> data = new HashMap<>();
|
||||
private final Map<Chunk, List<BlockData>> data = new HashMap<>();
|
||||
|
||||
public BlockBatch(InstanceContainer instance) {
|
||||
this.instance = instance;
|
||||
|
@ -459,7 +459,7 @@ public abstract class CustomBlock {
|
||||
* Class used to store block break stage
|
||||
* Only used if multi player breaking is enabled
|
||||
*/
|
||||
private class InstanceBreakData {
|
||||
private static class InstanceBreakData {
|
||||
// Contains all the breakers of a block
|
||||
private final Map<BlockPosition, Set<Player>> breakersMap = new HashMap<>();
|
||||
// Contains the current break stage of a block
|
||||
|
@ -60,7 +60,6 @@ public class ItemStack implements DataContainer {
|
||||
{
|
||||
if (defaultStackingRule == null)
|
||||
defaultStackingRule = DEFAULT_STACKING_RULE;
|
||||
if (this.stackingRule == null)
|
||||
this.stackingRule = defaultStackingRule;
|
||||
}
|
||||
|
||||
|
@ -115,9 +115,9 @@ public class CrossbowMeta implements ItemMeta {
|
||||
if (!checkCount)
|
||||
return false;
|
||||
|
||||
if (triple && (projectile1.isSimilar(crossbowMeta.projectile1)) &&
|
||||
(projectile2.isSimilar(crossbowMeta.projectile2)) &&
|
||||
(projectile3.isSimilar(crossbowMeta.projectile3))) {
|
||||
if (projectile1.isSimilar(crossbowMeta.projectile1) &&
|
||||
projectile2.isSimilar(crossbowMeta.projectile2) &&
|
||||
projectile3.isSimilar(crossbowMeta.projectile3)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ public class SpawnEggMeta implements ItemMeta {
|
||||
@Override
|
||||
public void read(NBTCompound compound) {
|
||||
if (compound.containsKey("EntityTag")) {
|
||||
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,19 +13,23 @@ public interface Permission {
|
||||
|
||||
/**
|
||||
* Does the given commandSender have the permission represented by this object?
|
||||
* @param commandSender
|
||||
*
|
||||
* @param commandSender the command sender
|
||||
* @return true if the commandSender possesses this permission
|
||||
*/
|
||||
boolean isValidFor(CommandSender commandSender);
|
||||
|
||||
/**
|
||||
* Writes any required data for this permission inside the given destination
|
||||
*
|
||||
* @param destination Data to write to
|
||||
*/
|
||||
default void write(@NotNull Data destination) {}
|
||||
default void write(@NotNull Data destination) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads any required data for this permission from the given destination
|
||||
*
|
||||
* @param source Data to read from
|
||||
* @return this for chaining
|
||||
*/
|
||||
|
@ -19,7 +19,7 @@ class VersionInfo {
|
||||
return downloads;
|
||||
}
|
||||
|
||||
class DownloadObject {
|
||||
static class DownloadObject {
|
||||
private String url;
|
||||
private String sha1;
|
||||
private long size;
|
||||
|
@ -28,7 +28,7 @@ public class BinaryWriter extends OutputStream {
|
||||
/**
|
||||
* Create a {@link BinaryWriter} with a custom initial capacity
|
||||
*
|
||||
* @param initialCapacity
|
||||
* @param initialCapacity the initial capacity of the binary writer
|
||||
*/
|
||||
public BinaryWriter(int initialCapacity) {
|
||||
this.buffer = Unpooled.buffer(initialCapacity);
|
||||
|
Loading…
Reference in New Issue
Block a user