mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +01:00
Minor cleanup
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
85c66fd6f3
commit
33f366c08d
@ -4,7 +4,6 @@ import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@ -29,8 +28,6 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
|
||||
@Override
|
||||
public String saveToString() {
|
||||
Map<String, Object> output = new LinkedHashMap<String, Object>();
|
||||
|
||||
yamlOptions.setIndent(options().indent());
|
||||
yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
@ -45,6 +42,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
return header + dump;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadFromString(String contents) throws InvalidConfigurationException {
|
||||
if (contents == null) {
|
||||
@ -70,6 +68,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void convertMapsToSections(Map<Object, Object> input, ConfigurationSection section) {
|
||||
for (Map.Entry<Object, Object> entry : input.entrySet()) {
|
||||
String key = entry.getKey().toString();
|
||||
|
@ -23,6 +23,7 @@ public class YamlConstructor extends SafeConstructor {
|
||||
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<Object, Object> raw = (Map<Object, Object>) super.construct(node);
|
||||
|
||||
if (raw.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) {
|
||||
|
@ -19,7 +19,6 @@ public class YamlRepresenter extends Representer {
|
||||
|
||||
private class RepresentConfigurationSection extends RepresentMap {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Node representData(Object data) {
|
||||
return super.representData(((ConfigurationSection) data).getValues(false));
|
||||
}
|
||||
@ -27,7 +26,6 @@ public class YamlRepresenter extends Representer {
|
||||
|
||||
private class RepresentConfigurationSerializable extends RepresentMap {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Node representData(Object data) {
|
||||
ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
||||
Map<String, Object> values = new LinkedHashMap<String, Object>();
|
||||
|
@ -12,6 +12,7 @@ import org.bukkit.entity.Entity;
|
||||
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
|
||||
* </ul>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class EntityBlockFormEvent extends BlockFormEvent {
|
||||
private Entity entity;
|
||||
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.event.HandlerList;
|
||||
/**
|
||||
* Thrown when a Living Entity creates a portal in a world.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class EntityCreatePortalEvent extends EntityEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private List<BlockState> blocks;
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ItemDespawnEvent extends EntityEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean canceled;
|
||||
|
@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
|
||||
/**
|
||||
* Thrown if a Plugin Channel is too long.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ChannelNameTooLongException extends RuntimeException {
|
||||
public ChannelNameTooLongException() {
|
||||
super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars.");
|
||||
|
@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
|
||||
/**
|
||||
* Thrown if a Plugin attempts to send a message on an unregistered channel.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ChannelNotRegisteredException extends RuntimeException {
|
||||
public ChannelNotRegisteredException() {
|
||||
this("Attempted to send a plugin message through an unregistered channel.");
|
||||
|
@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
|
||||
/**
|
||||
* Thrown if a Plugin Message is sent that is too large to be sent.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MessageTooLargeException extends RuntimeException {
|
||||
public MessageTooLargeException() {
|
||||
this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes.");
|
||||
|
@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
|
||||
/**
|
||||
* Thrown if a plugin attempts to register for a reserved channel (such as "REGISTER")
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ReservedChannelException extends RuntimeException {
|
||||
public ReservedChannelException() {
|
||||
this("Attempted to register for a reserved channel name.");
|
||||
|
Loading…
Reference in New Issue
Block a user