mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-02-25 00:02:03 +01:00
updated deprecated interfaces where possible, there are still many left, like ForgeRegistry.BIOME, ForgeRegistry.BLOCK_STATE_IDS, and many more I couln't find a fix for.
This commit is contained in:
parent
9c80489ec6
commit
b3169a6442
@ -16,7 +16,7 @@ public class CustomBlockModel extends HDBlockModel {
|
||||
super(bstate, databits, blockset);
|
||||
try {
|
||||
Class<?> cls = Class.forName(classname); /* Get class */
|
||||
render = (CustomRenderer) cls.newInstance();
|
||||
render = (CustomRenderer) cls.getDeclaredConstructor().newInstance();
|
||||
if(render.initializeRenderer(HDBlockModels.pdf, bstate.blockName, databits, classparm) == false) {
|
||||
Log.severe("Error loading custom renderer - " + classname);
|
||||
render = null;
|
||||
|
@ -2097,7 +2097,7 @@ public class TexturePack {
|
||||
else if(av[0].equals("custColorMult")) {
|
||||
try {
|
||||
Class<?> cls = Class.forName(av[1]);
|
||||
custColorMult = (CustomColorMultiplier)cls.newInstance();
|
||||
custColorMult = (CustomColorMultiplier)cls.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception x) {
|
||||
Log.severe("Error loading custom color multiplier - " + av[1] + ": " + x.getMessage());
|
||||
}
|
||||
@ -2263,7 +2263,7 @@ public class TexturePack {
|
||||
else if(av[0].equals("custColorMult")) {
|
||||
try {
|
||||
Class<?> cls = Class.forName(av[1]);
|
||||
custColorMult = (CustomColorMultiplier)cls.newInstance();
|
||||
custColorMult = (CustomColorMultiplier)cls.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception x) {
|
||||
Log.severe("Error loading custom color multiplier - " + av[1] + ": " + x.getMessage());
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
/**
|
||||
* Get inhabited ticks count from chunk
|
||||
*/
|
||||
private static final Long zero = new Long(0);
|
||||
private static final Long zero = Long.valueOf(0);
|
||||
public long getInhabitedTicks(Chunk c) {
|
||||
if (nmsc_inhabitedticks == null) {
|
||||
return 0;
|
||||
@ -557,25 +557,25 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
||||
if (profile != null) {
|
||||
Object propmap = callMethod(profile, cmaprofile_getproperties, nullargs, null);
|
||||
if ((propmap != null) && (propmap instanceof ForwardingMultimap)) {
|
||||
ForwardingMultimap<String, Object> fmm = (ForwardingMultimap<String, Object>) propmap;
|
||||
Collection<Object> txt = fmm.get("textures");
|
||||
Object textureProperty = Iterables.getFirst(fmm.get("textures"), null);
|
||||
if (textureProperty != null) {
|
||||
String val = (String) callMethod(textureProperty, cmaproperty_getvalue, nullargs, null);
|
||||
if (val != null) {
|
||||
TexturesPayload result = null;
|
||||
try {
|
||||
ForwardingMultimap<String, Object> fmm = (ForwardingMultimap<String, Object>) propmap;
|
||||
Collection<Object> txt = fmm.get("textures");
|
||||
Object textureProperty = Iterables.getFirst(fmm.get("textures"), null);
|
||||
if (textureProperty != null) {
|
||||
String val = (String) callMethod(textureProperty, cmaproperty_getvalue, nullargs, null);
|
||||
if (val != null) {
|
||||
TexturesPayload result = null;
|
||||
try {
|
||||
String json = new String(Base64.getDecoder().decode(val), StandardCharsets.UTF_8);
|
||||
result = gson.fromJson(json, TexturesPayload.class);
|
||||
} catch (JsonParseException e) {
|
||||
} catch (IllegalArgumentException x) {
|
||||
Log.warning("Malformed response from skin URL check: " + val);
|
||||
}
|
||||
if ((result != null) && (result.textures != null) && (result.textures.containsKey("SKIN"))) {
|
||||
url = result.textures.get("SKIN").url;
|
||||
}
|
||||
}
|
||||
}
|
||||
result = gson.fromJson(json, TexturesPayload.class);
|
||||
} catch (JsonParseException e) {
|
||||
} catch (IllegalArgumentException x) {
|
||||
Log.warning("Malformed response from skin URL check: " + val);
|
||||
}
|
||||
if ((result != null) && (result.textures != null) && (result.textures.containsKey("SKIN"))) {
|
||||
url = result.textures.get("SKIN").url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,20 +6,8 @@ import java.lang.reflect.Field;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
@ -253,7 +241,10 @@ public class DynmapPlugin
|
||||
if (statename.length() > 0) {
|
||||
statename += ",";
|
||||
}
|
||||
statename += p.getName() + "=" + bs.get(p).toString();
|
||||
try {
|
||||
statename += p.getName() + "=" + bs.get(p).toString();
|
||||
} catch (IllegalFormatConversionException e){
|
||||
}
|
||||
}
|
||||
int lightAtten = bs.isOpaqueCube(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 0 : 1);
|
||||
//Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten);
|
||||
|
Loading…
Reference in New Issue
Block a user