mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-15 07:05:52 +01:00
Merge branch 'master' into acquirable
This commit is contained in:
commit
129f720295
@ -60,7 +60,7 @@ public class ArgumentWord extends Argument<String> {
|
||||
// Check restrictions (acting as literal)
|
||||
if (hasRestrictions()) {
|
||||
for (String r : restrictions) {
|
||||
if (input.equalsIgnoreCase(r))
|
||||
if (input.equals(r))
|
||||
return input;
|
||||
}
|
||||
throw new ArgumentSyntaxException("Word needs to be in the restriction list", input, RESTRICTION_ERROR);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.minestom.server.extensions;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.extras.selfmodification.MinestomExtensionClassLoader;
|
||||
import net.minestom.server.extras.selfmodification.MinestomRootClassLoader;
|
||||
@ -56,6 +57,15 @@ public final class DiscoveredExtension {
|
||||
/** If this extension couldn't load its mixin configuration. */
|
||||
private boolean failedToLoadMixin = false;
|
||||
|
||||
/**
|
||||
* Extra meta on the object.
|
||||
* Do NOT use as configuration:
|
||||
*
|
||||
* Meta is meant to handle properties that will
|
||||
* be accessed by other extensions, not accessed by itself
|
||||
*/
|
||||
private JsonObject meta;
|
||||
|
||||
/** All files of this extension */
|
||||
transient List<URL> files = new LinkedList<>();
|
||||
|
||||
@ -205,6 +215,16 @@ public final class DiscoveredExtension {
|
||||
extension.externalDependencies = new ExternalDependencies();
|
||||
}
|
||||
|
||||
// No meta was provided
|
||||
if (extension.meta == null) {
|
||||
extension.meta = new JsonObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JsonObject getMeta() {
|
||||
return meta;
|
||||
}
|
||||
|
||||
public void addMissingCodeModifier(String codeModifierClass) {
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minestom.server.item;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jglrxavpok.hephaistos.nbt.NBT;
|
||||
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
||||
import org.jglrxavpok.hephaistos.nbt.NBTList;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
@ -80,7 +82,11 @@ public class ItemTag<T> {
|
||||
(nbtCompound, value) -> nbtCompound.setString(key, value));
|
||||
}
|
||||
|
||||
// TODO List/Compound
|
||||
public static @NotNull ItemTag<NBT> NBT(@NotNull String key) {
|
||||
return new ItemTag<>(key,
|
||||
nbt -> nbt.get(key).deepClone(),
|
||||
((nbt, value) -> nbt.set(key, value.deepClone())));
|
||||
}
|
||||
|
||||
public static @NotNull ItemTag<int[]> IntArray(@NotNull String key) {
|
||||
return new ItemTag<>(key,
|
||||
|
@ -30,7 +30,7 @@ public class ParticleCreator {
|
||||
particlePacket.particleData = particleData;
|
||||
particlePacket.particleCount = count;
|
||||
|
||||
if(dataWriter != null) {
|
||||
if (dataWriter != null) {
|
||||
BinaryWriter writer = new BinaryWriter();
|
||||
dataWriter.accept(writer);
|
||||
particlePacket.data = writer.toByteArray();
|
||||
@ -45,7 +45,7 @@ public class ParticleCreator {
|
||||
double x, double y, double z,
|
||||
float offsetX, float offsetY, float offsetZ,
|
||||
int count) {
|
||||
return createParticlePacket(particleType, false,
|
||||
return createParticlePacket(particleType, true,
|
||||
x, y, z,
|
||||
offsetX, offsetY, offsetZ,
|
||||
0, count, null);
|
||||
|
Loading…
Reference in New Issue
Block a user