Merge pull request #3783 from JurgenKuyper/v3.0

updated deprecated interfaces where possible
This commit is contained in:
mikeprimm 2022-07-22 20:59:02 -05:00 committed by GitHub
commit 967c85705c
4 changed files with 27 additions and 36 deletions

View file

@ -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;

View file

@ -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());
}

View file

@ -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;

View file

@ -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 += ",";
}
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);