mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-16 07:25:10 +01:00
Reformat and cleanup code
This commit is contained in:
parent
46b4fd6bd7
commit
860d586750
26
.github/issue-close-app.yml
vendored
26
.github/issue-close-app.yml
vendored
@ -11,21 +11,21 @@ comment: >-
|
||||
|
||||
issueConfigs:
|
||||
|
||||
# Bug
|
||||
- content:
|
||||
- "# Description"
|
||||
- "# How to reproduce"
|
||||
- "# Platform"
|
||||
# Bug
|
||||
- content:
|
||||
- "# Description"
|
||||
- "# How to reproduce"
|
||||
- "# Platform"
|
||||
|
||||
# Feature / Documentation
|
||||
- content:
|
||||
- "# Description"
|
||||
# Feature / Documentation
|
||||
- content:
|
||||
- "# Description"
|
||||
|
||||
# Help
|
||||
- content:
|
||||
- "# What are you trying to do"
|
||||
- "# What have you tried so far"
|
||||
- "# Platform"
|
||||
# Help
|
||||
- content:
|
||||
- "# What are you trying to do"
|
||||
- "# What have you tried so far"
|
||||
- "# Platform"
|
||||
|
||||
caseInsensitive: true
|
||||
label: "Closed by bot"
|
||||
|
@ -44,4 +44,5 @@ public class DeathHolograms extends JavaPlugin implements Listener {
|
||||
hologram.appendTextLine(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!");
|
||||
hologram.appendTextLine(ChatColor.GRAY + "Time of death: " + TIME_FORMATTER.format(Instant.now()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,4 +64,5 @@ public class PowerUps extends JavaPlugin implements Listener {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -71,4 +71,5 @@ public interface FloatingItem {
|
||||
|
||||
@Deprecated
|
||||
boolean isDeleted();
|
||||
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<Class<?>, String>> ENTITY_NAMES_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>(){}, EntityTypes.class, "d");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>() {}, EntityTypes.class, "d");
|
||||
private static final ReflectField<Map<Class<?>, Integer>> ENTITY_IDS_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>(){}, EntityTypes.class, "f");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>() {}, EntityTypes.class, "f");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "b", Entity.class);
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<Class<? extends Entity>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<Class<? extends Entity>>>(){}, RegistryMaterials.class, "a");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<Class<? extends Entity>>>() {}, RegistryMaterials.class, "a");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<Class<? extends Entity>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<Class<? extends Entity>>>(){}, RegistryMaterials.class, "a");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<Class<? extends Entity>>>() {}, RegistryMaterials.class, "a");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
|
||||
|
@ -35,11 +35,11 @@ import java.util.List;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<EntityTypes<?>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>(){}, RegistryMaterials.class, "a");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>() {}, RegistryMaterials.class, "a");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
private static final ReflectField<List<Entity>> ENTITY_LIST_FIELD
|
||||
= ReflectField.lookup(new ClassToken<List<Entity>>(){}, World.class, "entityList");
|
||||
= ReflectField.lookup(new ClassToken<List<Entity>>() {}, World.class, "entityList");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "b", Entity.class);
|
||||
|
||||
|
@ -36,11 +36,11 @@ import java.util.List;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<EntityTypes<?>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>(){}, RegistryMaterials.class, "b");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>() {}, RegistryMaterials.class, "b");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
private static final ReflectField<List<Entity>> ENTITY_LIST_FIELD
|
||||
= ReflectField.lookup(new ClassToken<List<Entity>>(){}, World.class, "entityList");
|
||||
= ReflectField.lookup(new ClassToken<List<Entity>>() {}, World.class, "entityList");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "b", Entity.class);
|
||||
|
||||
|
@ -34,7 +34,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<EntityTypes<?>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>(){}, RegistryMaterials.class, "b");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>() {}, RegistryMaterials.class, "b");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
private static final ReflectMethod<Void> REGISTER_ENTITY_METHOD
|
||||
|
@ -34,7 +34,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<EntityTypes<?>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>(){}, RegistryMaterials.class, "b");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>() {}, RegistryMaterials.class, "b");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
private static final ReflectMethod<Void> REGISTER_ENTITY_METHOD
|
||||
|
@ -34,7 +34,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<RegistryID<EntityTypes<?>>> REGISTRY_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>(){}, RegistryMaterials.class, "b");
|
||||
= ReflectField.lookup(new ClassToken<RegistryID<EntityTypes<?>>>() {}, RegistryMaterials.class, "b");
|
||||
private static final ReflectField<Object[]> ID_TO_CLASS_MAP_FIELD
|
||||
= ReflectField.lookup(Object[].class, RegistryID.class, "d");
|
||||
private static final ReflectMethod<Void> REGISTER_ENTITY_METHOD
|
||||
|
@ -35,7 +35,7 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<EntityTypes<?>, Integer>> REGISTRY_TO_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<EntityTypes<?>, Integer>>(){}, RegistryMaterials.class, "bg");
|
||||
= ReflectField.lookup(new ClassToken<Map<EntityTypes<?>, Integer>>() {}, RegistryMaterials.class, "bg");
|
||||
private static final ReflectMethod<Void> REGISTER_ENTITY_METHOD
|
||||
= ReflectMethod.lookup(void.class, WorldServer.class, "registerEntity", Entity.class);
|
||||
|
||||
|
@ -35,7 +35,7 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<EntityTypes<?>, Integer>> REGISTRY_TO_ID_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<EntityTypes<?>, Integer>>(){}, RegistryMaterials.class, "bg");
|
||||
= ReflectField.lookup(new ClassToken<Map<EntityTypes<?>, Integer>>() {}, RegistryMaterials.class, "bg");
|
||||
private static final ReflectMethod<Void> REGISTER_ENTITY_METHOD
|
||||
= ReflectMethod.lookup(void.class, WorldServer.class, "registerEntity", Entity.class);
|
||||
|
||||
|
@ -33,9 +33,9 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<Class<?>, String>> ENTITY_NAMES_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>(){}, EntityTypes.class, "d");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>() {}, EntityTypes.class, "d");
|
||||
private static final ReflectField<Map<Class<?>, Integer>> ENTITY_IDS_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>(){}, EntityTypes.class, "f");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>() {}, EntityTypes.class, "f");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "a", Entity.class);
|
||||
|
||||
|
@ -33,9 +33,9 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<Class<?>, String>> ENTITY_NAMES_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>(){}, EntityTypes.class, "d");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>() {}, EntityTypes.class, "d");
|
||||
private static final ReflectField<Map<Class<?>, Integer>> ENTITY_IDS_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>(){}, EntityTypes.class, "f");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>() {}, EntityTypes.class, "f");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "a", Entity.class);
|
||||
|
||||
|
@ -32,9 +32,9 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<Class<?>, String>> ENTITY_NAMES_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>(){}, EntityTypes.class, "d");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>() {}, EntityTypes.class, "d");
|
||||
private static final ReflectField<Map<Class<?>, Integer>> ENTITY_IDS_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>(){}, EntityTypes.class, "f");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>() {}, EntityTypes.class, "f");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "b", Entity.class);
|
||||
|
||||
|
@ -32,9 +32,9 @@ import java.util.Map;
|
||||
public class VersionNMSManager implements NMSManager {
|
||||
|
||||
private static final ReflectField<Map<Class<?>, String>> ENTITY_NAMES_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>(){}, EntityTypes.class, "d");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, String>>() {}, EntityTypes.class, "d");
|
||||
private static final ReflectField<Map<Class<?>, Integer>> ENTITY_IDS_BY_CLASS_FIELD
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>(){}, EntityTypes.class, "f");
|
||||
= ReflectField.lookup(new ClassToken<Map<Class<?>, Integer>>() {}, EntityTypes.class, "f");
|
||||
|
||||
private static final ReflectMethod<?> REGISTER_ENTITY_METHOD = ReflectMethod.lookup(Object.class, World.class, "b", Entity.class);
|
||||
|
||||
|
@ -26,7 +26,8 @@ public class SetlineCommand extends LineEditingCommand implements QuickEditComma
|
||||
private final InternalHologramManager internalHologramManager;
|
||||
private final ConfigManager configManager;
|
||||
|
||||
public SetlineCommand(HologramCommandManager commandManager,
|
||||
public SetlineCommand(
|
||||
HologramCommandManager commandManager,
|
||||
InternalHologramManager internalHologramManager,
|
||||
ConfigManager configManager) {
|
||||
super("setline");
|
||||
|
@ -8,7 +8,9 @@ package me.filoghost.holographicdisplays.plugin.image;
|
||||
import me.filoghost.holographicdisplays.plugin.disk.Configuration;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -302,7 +302,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Returns whether this compound tag contains the given key and its value is of a given type.
|
||||
*
|
||||
* @param key the given key
|
||||
* @param key the given key
|
||||
* @param type the type of the value
|
||||
* @return true if the tag contains an entry with given key and of given type
|
||||
*/
|
||||
@ -317,7 +317,7 @@ public final class NBTCompound extends NBTTag {
|
||||
* Put the given name and its corresponding tag into the compound tag.
|
||||
*
|
||||
* @param name the tag name
|
||||
* @param tag the tag value
|
||||
* @param tag the tag value
|
||||
*/
|
||||
public void put(String name, NBTTag tag) {
|
||||
this.value.put(name, tag);
|
||||
@ -326,7 +326,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putByteArray(String key, byte[] value) {
|
||||
@ -336,7 +336,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putByte(String key, byte value) {
|
||||
@ -346,7 +346,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putDouble(String key, double value) {
|
||||
@ -356,7 +356,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putFloat(String key, float value) {
|
||||
@ -366,7 +366,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putIntArray(String key, int[] value) {
|
||||
@ -376,7 +376,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putLongArray(String key, long[] value) {
|
||||
@ -386,7 +386,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putInt(String key, int value) {
|
||||
@ -396,7 +396,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putLong(String key, long value) {
|
||||
@ -406,7 +406,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putShort(String key, short value) {
|
||||
@ -416,7 +416,7 @@ public final class NBTCompound extends NBTTag {
|
||||
/**
|
||||
* Put the given key and value into the compound tag.
|
||||
*
|
||||
* @param key they key
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
*/
|
||||
public void putString(String key, String value) {
|
||||
|
@ -24,7 +24,7 @@ public final class NBTList extends NBTTag implements Iterable<NBTTag>, Cloneable
|
||||
/**
|
||||
* Creates the list with a type and a series of elements.
|
||||
*
|
||||
* @param type the type of tag
|
||||
* @param type the type of tag
|
||||
* @param value the value of the tag
|
||||
*/
|
||||
public NBTList(NBTType type, List<? extends NBTTag> value) {
|
||||
@ -37,7 +37,7 @@ public final class NBTList extends NBTTag implements Iterable<NBTTag>, Cloneable
|
||||
/**
|
||||
* Creates the list with a type and a series of elements.
|
||||
*
|
||||
* @param type the type of tag
|
||||
* @param type the type of tag
|
||||
* @param value the value of the tag
|
||||
*/
|
||||
public NBTList(NBTType type, NBTTag... value) {
|
||||
|
@ -342,7 +342,7 @@ public final class MojangsonParser {
|
||||
*
|
||||
* @param c the expected character
|
||||
* @throws MojangsonParseException if {@link #currentChar()} does not equal {@code c} or if {@link #hasNext()}
|
||||
* returns false
|
||||
* returns false
|
||||
*/
|
||||
private void expectChar(char c) throws MojangsonParseException {
|
||||
skipWhitespace();
|
||||
|
@ -25,6 +25,7 @@ import org.bukkit.entity.Player;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public abstract class AbstractPacket {
|
||||
|
||||
// The packet we will be modifying
|
||||
protected PacketContainer handle;
|
||||
|
||||
@ -75,4 +76,5 @@ public abstract class AbstractPacket {
|
||||
throw new RuntimeException("Cannot receive packet.", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
|
||||
public static final PacketType TYPE = PacketType.Play.Server.ATTACH_ENTITY;
|
||||
|
||||
public WrapperPlayServerAttachEntity() {
|
||||
@ -38,7 +39,7 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
* Retrieve whether or not the entity is leached onto the vehicle.
|
||||
*
|
||||
* @return TRUE if it is, FALSE otherwise.
|
||||
*/
|
||||
*/
|
||||
public boolean getLeached() {
|
||||
return handle.getIntegers().read(0) != 0;
|
||||
}
|
||||
@ -47,7 +48,7 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
* Set whether or not the entity is leached onto the vehicle.
|
||||
*
|
||||
* @param value - TRUE if it is leached, FALSE otherwise.
|
||||
*/
|
||||
*/
|
||||
public void setLeached(boolean value) {
|
||||
handle.getIntegers().write(0, value ? 1 : 0);
|
||||
}
|
||||
@ -56,7 +57,7 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
* Retrieve the player entity ID being attached.
|
||||
*
|
||||
* @return The current Entity ID
|
||||
*/
|
||||
*/
|
||||
public int getEntityId() {
|
||||
return handle.getIntegers().read(1);
|
||||
}
|
||||
@ -65,7 +66,7 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
* Set the player entity ID being attached.
|
||||
*
|
||||
* @param value - new value.
|
||||
*/
|
||||
*/
|
||||
public void setEntityId(int value) {
|
||||
handle.getIntegers().write(1, value);
|
||||
}
|
||||
@ -94,7 +95,7 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
* Retrieve the vehicle entity ID attached to (-1 for unattaching).
|
||||
*
|
||||
* @return The current Vehicle ID
|
||||
*/
|
||||
*/
|
||||
public int getVehicleId() {
|
||||
return handle.getIntegers().read(2);
|
||||
}
|
||||
@ -103,7 +104,7 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
* Set the vehicle entity ID attached to (-1 for unattaching).
|
||||
*
|
||||
* @param value - new value.
|
||||
*/
|
||||
*/
|
||||
public void setVehicleId(int value) {
|
||||
handle.getIntegers().write(2, value);
|
||||
}
|
||||
@ -127,4 +128,5 @@ public class WrapperPlayServerAttachEntity extends AbstractPacket {
|
||||
public Entity getVehicle(PacketEvent event) {
|
||||
return getVehicle(event.getPlayer().getWorld());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import com.google.common.primitives.Ints;
|
||||
import java.util.List;
|
||||
|
||||
public class WrapperPlayServerEntityDestroy extends AbstractPacket {
|
||||
|
||||
public static final PacketType TYPE = PacketType.Play.Server.ENTITY_DESTROY;
|
||||
|
||||
public WrapperPlayServerEntityDestroy() {
|
||||
@ -36,22 +37,23 @@ public class WrapperPlayServerEntityDestroy extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Retrieve the IDs of the entities that will be destroyed.
|
||||
*/
|
||||
*/
|
||||
public List<Integer> getEntities() {
|
||||
return Ints.asList(handle.getIntegerArrays().read(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the entities that will be destroyed.
|
||||
*/
|
||||
*/
|
||||
public void setEntities(int[] entities) {
|
||||
handle.getIntegerArrays().write(0, entities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the entities that will be destroyed.
|
||||
*/
|
||||
*/
|
||||
public void setEntities(List<Integer> entities) {
|
||||
setEntities(Ints.toArray(entities));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import org.bukkit.entity.Entity;
|
||||
import java.util.List;
|
||||
|
||||
public class WrapperPlayServerEntityMetadata extends AbstractPacket {
|
||||
|
||||
public static final PacketType TYPE = PacketType.Play.Server.ENTITY_METADATA;
|
||||
|
||||
public WrapperPlayServerEntityMetadata() {
|
||||
@ -40,14 +41,14 @@ public class WrapperPlayServerEntityMetadata extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Retrieve unique entity ID to update.
|
||||
*/
|
||||
*/
|
||||
public int getEntityID() {
|
||||
return handle.getIntegers().read(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set unique entity ID to update.
|
||||
*/
|
||||
*/
|
||||
public void setEntityID(int value) {
|
||||
handle.getIntegers().write(0, value);
|
||||
}
|
||||
@ -78,8 +79,9 @@ public class WrapperPlayServerEntityMetadata extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Set the list of the watchable objects (meta data).
|
||||
*/
|
||||
*/
|
||||
public void setEntityMetadata(List<WrappedWatchableObject> value) {
|
||||
handle.getWatchableCollectionModifier().write(0, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,36 +37,37 @@ public class WrapperPlayServerMount extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Retrieve the entity ID being attached.
|
||||
*/
|
||||
*/
|
||||
public int getVehicleId() {
|
||||
return handle.getIntegers().read(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the entity ID being attached.
|
||||
*/
|
||||
*/
|
||||
public void setVehicleId(int value) {
|
||||
handle.getIntegers().write(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the IDs of the passenger entities.
|
||||
*/
|
||||
*/
|
||||
public List<Integer> getPassengers() {
|
||||
return Ints.asList(handle.getIntegerArrays().read(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the passenger entities.
|
||||
*/
|
||||
*/
|
||||
public void setPassengers(int[] entities) {
|
||||
handle.getIntegerArrays().write(0, entities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the passenger entities.
|
||||
*/
|
||||
*/
|
||||
public void setPassengers(List<Integer> entities) {
|
||||
setPassengers(Ints.toArray(entities));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public class WrapperPlayServerSpawnEntity extends AbstractPacket {
|
||||
|
||||
public static final PacketType TYPE = PacketType.Play.Server.SPAWN_ENTITY;
|
||||
|
||||
private static PacketConstructor entityConstructor;
|
||||
@ -37,6 +38,7 @@ public class WrapperPlayServerSpawnEntity extends AbstractPacket {
|
||||
* @author Kristian
|
||||
*/
|
||||
public static class ObjectTypes extends IntEnum {
|
||||
|
||||
public static final int BOAT = 1;
|
||||
public static final int ITEM_STACK = 2;
|
||||
public static final int MINECART = 10;
|
||||
@ -72,6 +74,7 @@ public class WrapperPlayServerSpawnEntity extends AbstractPacket {
|
||||
public static ObjectTypes getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public WrapperPlayServerSpawnEntity() {
|
||||
@ -106,7 +109,7 @@ public class WrapperPlayServerSpawnEntity extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Retrieve entity ID of the Object.
|
||||
*/
|
||||
*/
|
||||
public int getEntityID() {
|
||||
return handle.getIntegers().read(0);
|
||||
}
|
||||
@ -127,21 +130,21 @@ public class WrapperPlayServerSpawnEntity extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Set entity ID of the Object.
|
||||
*/
|
||||
*/
|
||||
public void setEntityID(int value) {
|
||||
handle.getIntegers().write(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the type of object. See {@link ObjectTypes}
|
||||
*/
|
||||
*/
|
||||
public int getType() {
|
||||
return handle.getIntegers().read(6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the type of object. See {@link ObjectTypes}.
|
||||
*/
|
||||
*/
|
||||
public void setType(int value) {
|
||||
handle.getIntegers().write(6, value);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public class WrapperPlayServerSpawnEntityLiving extends AbstractPacket {
|
||||
|
||||
public static final PacketType TYPE = PacketType.Play.Server.SPAWN_ENTITY_LIVING;
|
||||
|
||||
private static PacketConstructor entityConstructor;
|
||||
@ -54,7 +55,7 @@ public class WrapperPlayServerSpawnEntityLiving extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Retrieve entity ID.
|
||||
*/
|
||||
*/
|
||||
public int getEntityID() {
|
||||
return handle.getIntegers().read(0);
|
||||
}
|
||||
@ -75,14 +76,14 @@ public class WrapperPlayServerSpawnEntityLiving extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Set entity ID.
|
||||
*/
|
||||
*/
|
||||
public void setEntityID(int value) {
|
||||
handle.getIntegers().write(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the type of mob.
|
||||
*/
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public EntityType getType() {
|
||||
return EntityType.fromId(handle.getIntegers().read(1));
|
||||
@ -90,7 +91,7 @@ public class WrapperPlayServerSpawnEntityLiving extends AbstractPacket {
|
||||
|
||||
/**
|
||||
* Set the type of mob.
|
||||
*/
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void setType(EntityType value) {
|
||||
handle.getIntegers().write(1, (int) value.getTypeId());
|
||||
@ -100,15 +101,16 @@ public class WrapperPlayServerSpawnEntityLiving extends AbstractPacket {
|
||||
* Retrieve the data watcher.
|
||||
* <p>
|
||||
* Content varies by mob, see Entities.
|
||||
*/
|
||||
*/
|
||||
public WrappedDataWatcher getMetadata() {
|
||||
return handle.getDataWatcherModifier().read(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data watcher.
|
||||
*/
|
||||
*/
|
||||
public void setMetadata(WrappedDataWatcher value) {
|
||||
handle.getDataWatcherModifier().write(0, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ChunkListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler (priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onChunkLoad(ChunkLoadEvent event) {
|
||||
Chunk chunk = event.getChunk();
|
||||
|
||||
|
@ -22,8 +22,8 @@ public class PrintableErrorCollector extends ErrorCollector {
|
||||
private static final String ERROR_PREFIX = ChatColor.RED + "[HolographicDisplays] ";
|
||||
|
||||
public void logErrorCount() {
|
||||
Bukkit.getConsoleSender().sendMessage(
|
||||
ERROR_PREFIX + "Encountered " + getErrorsCount() + " error(s) on load. "
|
||||
Bukkit.getConsoleSender().sendMessage(ERROR_PREFIX
|
||||
+ "Encountered " + getErrorsCount() + " error(s) on load. "
|
||||
+ "Check previous console logs for more information.");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user