mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 04:32:15 +00:00
Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.
This commit is contained in:
1 parent
7e4d7077a5
commit
a9d23f5e78
133 files changed
+489
-623
No files matched your search
@@ -215,7 +215,7 @@ public class FMLCommonHandler
|
||||
{
|
||||
if (brandings == null)
|
||||
{
|
||||
Builder<String> brd = ImmutableList.<String>builder();
|
||||
Builder<String> brd = ImmutableList.builder();
|
||||
brd.add(Loader.instance().getMCVersionString());
|
||||
brd.add(Loader.instance().getMCPVersionString());
|
||||
brd.add("Powered by Forge " + ForgeVersion.getVersion());
|
||||
@@ -691,7 +691,7 @@ public class FMLCommonHandler
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a lang file, first searching for a marker to enable the 'extended' format {escape charaters}
|
||||
* Loads a lang file, first searching for a marker to enable the 'extended' format {escape characters}
|
||||
* If the marker is not found it simply returns and let the vanilla code load things.
|
||||
* The Marker is 'PARSE_ESCAPES' by itself on a line starting with '#' as such:
|
||||
* #PARSE_ESCAPES
|
||||
|
||||
@@ -35,7 +35,6 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkCheckHandler;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.common.registry.PersistentRegistryManager;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -167,7 +167,7 @@ public class FMLModContainer implements ModContainer
|
||||
|
||||
if (descriptor.containsKey("useMetadata"))
|
||||
{
|
||||
overridesMetadata = !((Boolean)descriptor.get("useMetadata")).booleanValue();
|
||||
overridesMetadata = !((Boolean)descriptor.get("useMetadata"));
|
||||
}
|
||||
|
||||
if (overridesMetadata || !modMetadata.useDependencyInformation)
|
||||
@@ -400,7 +400,7 @@ public class FMLModContainer implements ModContainer
|
||||
});
|
||||
}
|
||||
|
||||
private void parseSimpleFieldAnnotation(SetMultimap<String, ASMData> annotations, String annotationClassName, Function<ModContainer, Object> retreiver) throws IllegalAccessException
|
||||
private void parseSimpleFieldAnnotation(SetMultimap<String, ASMData> annotations, String annotationClassName, Function<ModContainer, Object> retriever) throws IllegalAccessException
|
||||
{
|
||||
String[] annName = annotationClassName.split("\\.");
|
||||
String annotationName = annName[annName.length - 1];
|
||||
@@ -431,7 +431,7 @@ public class FMLModContainer implements ModContainer
|
||||
f = clz.getDeclaredField(targets.getObjectName());
|
||||
f.setAccessible(true);
|
||||
isStatic = Modifier.isStatic(f.getModifiers());
|
||||
injectedMod = retreiver.apply(mc);
|
||||
injectedMod = retriever.apply(mc);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -473,7 +473,7 @@ public class FMLModContainer implements ModContainer
|
||||
{
|
||||
len = certificates.length;
|
||||
}
|
||||
Builder<String> certBuilder = ImmutableList.<String>builder();
|
||||
Builder<String> certBuilder = ImmutableList.builder();
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
certBuilder.add(CertificateHelper.getFingerprint(certificates[i]));
|
||||
@@ -508,7 +508,7 @@ public class FMLModContainer implements ModContainer
|
||||
List<Map<String, Object>> props = (List<Map<String, Object>>)descriptor.get("customProperties");
|
||||
if (props != null)
|
||||
{
|
||||
com.google.common.collect.ImmutableMap.Builder<String, String> builder = ImmutableMap.<String, String>builder();
|
||||
com.google.common.collect.ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
|
||||
for (Map<String, Object> p : props)
|
||||
{
|
||||
builder.put((String)p.get("k"), (String)p.get("v"));
|
||||
@@ -663,7 +663,7 @@ public class FMLModContainer implements ModContainer
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return value.booleanValue();
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,7 +55,7 @@ public interface ILanguageAdapter {
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
// Not a singleton, look for @Instance field as a fallback.
|
||||
FMLLog.log(Level.INFO, e, "An error occured trying to load a proxy into %s.%s. Did you declare your mod as 'class' instead of 'object'?", proxyTarget.getSimpleName(), target.getName());
|
||||
FMLLog.log(Level.INFO, e, "An error occurred trying to load a proxy into %s.%s. Did you declare your mod as 'class' instead of 'object'?", proxyTarget.getSimpleName(), target.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public interface ILanguageAdapter {
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
|
||||
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
|
||||
throw new LoaderException(e);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public interface ILanguageAdapter {
|
||||
setProxy(target, proxyTarget, proxy);
|
||||
}
|
||||
catch (Exception e) {
|
||||
FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
|
||||
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
|
||||
throw new LoaderException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ public class LoadController
|
||||
|
||||
public ImmutableBiMap<ModContainer, Object> buildModObjectList()
|
||||
{
|
||||
ImmutableBiMap.Builder<ModContainer, Object> builder = ImmutableBiMap.<ModContainer, Object>builder();
|
||||
ImmutableBiMap.Builder<ModContainer, Object> builder = ImmutableBiMap.builder();
|
||||
for (ModContainer mc : activeModList)
|
||||
{
|
||||
if (!mc.isImmutable() && mc.getMod()!=null)
|
||||
@@ -265,7 +265,7 @@ public class LoadController
|
||||
{
|
||||
if (exception instanceof InvocationTargetException)
|
||||
{
|
||||
errors.put(modContainer.getModId(), ((InvocationTargetException)exception).getCause());
|
||||
errors.put(modContainer.getModId(), exception.getCause());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -340,7 +340,7 @@ public class Loader
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.log(Level.ERROR, e, "A problem occured instantiating the injected mod container %s", cont);
|
||||
FMLLog.log(Level.ERROR, e, "A problem occurred instantiating the injected mod container %s", cont);
|
||||
throw new LoaderException(e);
|
||||
}
|
||||
mods.add(new InjectedModContainer(mc,mc.getSource()));
|
||||
|
||||
@@ -104,7 +104,7 @@ public @interface Mod
|
||||
/**
|
||||
* The acceptable range of minecraft versions that this mod will load and run in
|
||||
* The default ("empty string") indicates that the currently RUNNING minecraft version is acceptable.
|
||||
* This means ANY version that the end user adds the mod to. Modders PLEASS set this.
|
||||
* This means ANY version that the end user adds the mod to. Modders PLEASE set this.
|
||||
* FML will refuse to run with an error if the minecraft version is not in this range across all mods.
|
||||
* @return A version range as specified by the maven version range specification or the empty string
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ProxyInjector
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", targ.getAnnotationInfo(), targ.getClassName(), targ.getObjectName());
|
||||
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a proxy into %s.%s", targ.getAnnotationInfo(), targ.getClassName(), targ.getObjectName());
|
||||
throw new LoaderException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ public class AccessTransformer implements IClassTransformer
|
||||
}
|
||||
else
|
||||
{
|
||||
List<MethodNode> nowOverridable = Lists.newArrayList();
|
||||
List<MethodNode> nowOverrideable = Lists.newArrayList();
|
||||
for (MethodNode n : classNode.methods)
|
||||
{
|
||||
if ((n.name.equals(m.name) && n.desc.equals(m.desc)) || m.name.equals("*"))
|
||||
@@ -236,7 +236,7 @@ public class AccessTransformer implements IClassTransformer
|
||||
|
||||
if (wasPrivate && !isNowPrivate)
|
||||
{
|
||||
nowOverridable.add(n);
|
||||
nowOverrideable.add(n);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -253,7 +253,7 @@ public class AccessTransformer implements IClassTransformer
|
||||
}
|
||||
}
|
||||
|
||||
replaceInvokeSpecial(classNode, nowOverridable);
|
||||
replaceInvokeSpecial(classNode, nowOverrideable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ public class AccessTransformer implements IClassTransformer
|
||||
|
||||
if (!hasTransformer)
|
||||
{
|
||||
System.out.println("Culd not find a valid transformer to perform");
|
||||
System.out.println("Could not find a valid transformer to perform");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class DeobfuscationTransformer implements IClassTransformer, IClassNameTr
|
||||
private static final int WRITER_FLAGS = ClassWriter.COMPUTE_MAXS | (RECALC_FRAMES ? ClassWriter.COMPUTE_FRAMES : 0);
|
||||
private static final int READER_FLAGS = RECALC_FRAMES ? ClassReader.SKIP_FRAMES : ClassReader.EXPAND_FRAMES;
|
||||
// COMPUTE_FRAMES causes classes to be loaded, which could cause issues if the classes do not exist.
|
||||
// However in testing this has not happened. {As we run post SideTransfromer}
|
||||
// However in testing this has not happened. {As we run post SideTransformer}
|
||||
// If reported we need to add a custom implementation of ClassWriter.getCommonSuperClass
|
||||
// that does not cause class loading.
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class EventSubscriberTransformer implements IClassTransformer
|
||||
{
|
||||
if (Modifier.isPrivate(methodNode.access))
|
||||
{
|
||||
String msg = "Cannot apply @SubsribeEvent to private method %s/%s%s";
|
||||
String msg = "Cannot apply @SubscribeEvent to private method %s/%s%s";
|
||||
throw new RuntimeException(String.format(msg, classNode.name, methodNode.name, methodNode.desc));
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -105,7 +105,7 @@ public class EventSubscriptionTransformer implements IClassTransformer
|
||||
String listDesc = tList.getDescriptor();
|
||||
String listDescM = Type.getMethodDescriptor(tList);
|
||||
|
||||
for (MethodNode method : (List<MethodNode>)classNode.methods)
|
||||
for (MethodNode method : classNode.methods)
|
||||
{
|
||||
if (method.name.equals("setup") && method.desc.equals(voidDesc) && (method.access & ACC_PROTECTED) == ACC_PROTECTED) hasSetup = true;
|
||||
if ((method.access & ACC_PUBLIC) == ACC_PUBLIC)
|
||||
@@ -195,10 +195,10 @@ public class EventSubscriptionTransformer implements IClassTransformer
|
||||
method.instructions.add(new VarInsnNode(ALOAD, 0));
|
||||
method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "setup", voidDesc, false));
|
||||
method.instructions.add(new FieldInsnNode(GETSTATIC, classNode.name, "LISTENER_LIST", listDesc));
|
||||
LabelNode initLisitener = new LabelNode();
|
||||
method.instructions.add(new JumpInsnNode(IFNULL, initLisitener));
|
||||
LabelNode initListener = new LabelNode();
|
||||
method.instructions.add(new JumpInsnNode(IFNULL, initListener));
|
||||
method.instructions.add(new InsnNode(RETURN));
|
||||
method.instructions.add(initLisitener);
|
||||
method.instructions.add(initListener);
|
||||
method.instructions.add(new FrameNode(F_SAME, 0, null, 0, null));
|
||||
method.instructions.add(new TypeInsnNode(NEW, tList.getInternalName()));
|
||||
method.instructions.add(new InsnNode(DUP));
|
||||
|
||||
@@ -143,7 +143,7 @@ public class MarkerTransformer implements IClassTransformer
|
||||
|
||||
if (!hasTransformer)
|
||||
{
|
||||
System.out.println("Culd not find a valid transformer to perform");
|
||||
System.out.println("Could not find a valid transformer to perform");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ModAPITransformer implements IClassTransformer {
|
||||
}
|
||||
else
|
||||
{
|
||||
stripMethod(classNode, (String)optional.getObjectName());
|
||||
stripMethod(classNode, optional.getObjectName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SideTransformer implements IClassTransformer
|
||||
ClassReader classReader = new ClassReader(bytes);
|
||||
classReader.accept(classNode, 0);
|
||||
|
||||
if (remove((List<AnnotationNode>)classNode.visibleAnnotations, SIDE))
|
||||
if (remove(classNode.visibleAnnotations, SIDE))
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ public class SideTransformer implements IClassTransformer
|
||||
while(fields.hasNext())
|
||||
{
|
||||
FieldNode field = fields.next();
|
||||
if (remove((List<AnnotationNode>)field.visibleAnnotations, SIDE))
|
||||
if (remove(field.visibleAnnotations, SIDE))
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ public class SideTransformer implements IClassTransformer
|
||||
while(methods.hasNext())
|
||||
{
|
||||
MethodNode method = methods.next();
|
||||
if (remove((List<AnnotationNode>)method.visibleAnnotations, SIDE))
|
||||
if (remove(method.visibleAnnotations, SIDE))
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ public class TerminalTransformer implements IClassTransformer
|
||||
{
|
||||
FMLRelaunchLog.warning("=============================================================");
|
||||
FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML!");
|
||||
FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
|
||||
FMLRelaunchLog.warning("Offender: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
|
||||
FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead");
|
||||
FMLRelaunchLog.warning("=============================================================");
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class TerminalTransformer implements IClassTransformer
|
||||
{
|
||||
FMLRelaunchLog.warning("=============================================================");
|
||||
FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE Runtime.exit() THIS IS NOT ALLOWED REROUTING TO FML!");
|
||||
FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
|
||||
FMLRelaunchLog.warning("Offender: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
|
||||
FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead");
|
||||
FMLRelaunchLog.warning("=============================================================");
|
||||
}
|
||||
|
||||
+6
-6
@@ -80,7 +80,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
|
||||
List<String> srgList = srgSource.readLines();
|
||||
rawMethodMaps = Maps.newHashMap();
|
||||
rawFieldMaps = Maps.newHashMap();
|
||||
Builder<String, String> builder = ImmutableBiMap.<String,String>builder();
|
||||
Builder<String, String> builder = ImmutableBiMap.builder();
|
||||
Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults();
|
||||
for (String line : srgList)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
|
||||
|
||||
rawMethodMaps = Maps.newHashMap();
|
||||
rawFieldMaps = Maps.newHashMap();
|
||||
Builder<String, String> builder = ImmutableBiMap.<String,String>builder();
|
||||
Builder<String, String> builder = ImmutableBiMap.builder();
|
||||
Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults();
|
||||
for (String line : srgList)
|
||||
{
|
||||
@@ -216,7 +216,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
|
||||
ClassNode classNode = new ClassNode();
|
||||
cr.accept(classNode, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
|
||||
Map<String,String> resMap = Maps.newHashMap();
|
||||
for (FieldNode fieldNode : (List<FieldNode>) classNode.fields) {
|
||||
for (FieldNode fieldNode : classNode.fields) {
|
||||
resMap.put(fieldNode.name, fieldNode.desc);
|
||||
}
|
||||
fieldDescriptions.put(owner, resMap);
|
||||
@@ -224,7 +224,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.ERROR,e, "A critical exception occured reading a class file %s", owner);
|
||||
FMLRelaunchLog.log(Level.ERROR,e, "A critical exception occurred reading a class file %s", owner);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -403,8 +403,8 @@ public class FMLDeobfuscatingRemapper extends Remapper {
|
||||
findAndMergeSuperMaps(parentThing);
|
||||
}
|
||||
}
|
||||
Map<String, String> methodMap = Maps.<String,String>newHashMap();
|
||||
Map<String, String> fieldMap = Maps.<String,String>newHashMap();
|
||||
Map<String, String> methodMap = Maps.newHashMap();
|
||||
Map<String, String> fieldMap = Maps.newHashMap();
|
||||
for (String parentThing : allParents)
|
||||
{
|
||||
if (methodNameMaps.containsKey(parentThing))
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ASMDataTable
|
||||
{
|
||||
if (containerAnnotationData == null)
|
||||
{
|
||||
ImmutableMap.Builder<ModContainer, SetMultimap<String, ASMData>> mapBuilder = ImmutableMap.<ModContainer, SetMultimap<String,ASMData>>builder();
|
||||
ImmutableMap.Builder<ModContainer, SetMultimap<String, ASMData>> mapBuilder = ImmutableMap.builder();
|
||||
for (ModContainer cont : containers)
|
||||
{
|
||||
Multimap<String, ASMData> values = Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont));
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.apache.logging.log4j.Level;
|
||||
*
|
||||
*/
|
||||
public class FMLInterModComms {
|
||||
private static final ImmutableList<IMCMessage> emptyIMCList = ImmutableList.<IMCMessage>of();
|
||||
private static final ImmutableList<IMCMessage> emptyIMCList = ImmutableList.of();
|
||||
private static ArrayListMultimap<String, IMCMessage> modMessages = ArrayListMultimap.create();
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,7 @@ public class Event
|
||||
{
|
||||
if (!isCancelable())
|
||||
{
|
||||
throw new IllegalArgumentException("Attempted to cancel a uncancelable event");
|
||||
throw new IllegalArgumentException("Attempted to cancel a non cancellable event");
|
||||
}
|
||||
isCanceled = cancel;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class Event
|
||||
}
|
||||
/**
|
||||
* Called by the base constructor, this is used by ASM generated
|
||||
* event classes to setup various functionality such as the listenerlist.
|
||||
* event classes to setup various functionality such as the listener list.
|
||||
*/
|
||||
protected void setup()
|
||||
{
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public interface IEventExceptionHandler
|
||||
{
|
||||
/**
|
||||
* Fired when a EventListener throws an exception for the specified event on the event bus.
|
||||
* After this function returns, the original Throwable will be propogated upwards.
|
||||
* After this function returns, the original Throwable will be propagated upwards.
|
||||
*
|
||||
* @param bus The bus the event is being fired on
|
||||
* @param event The event that is being fired
|
||||
|
||||
@@ -7,9 +7,9 @@ import com.google.common.collect.Lists;
|
||||
|
||||
public class CollectionWrapperFactory {
|
||||
/**
|
||||
* Return a read only cast view of the supplied ungeneric collection, based on the element type given
|
||||
* Return a read only cast view of the supplied raw collection, based on the element type given
|
||||
* @param coll The collection to cast
|
||||
* @param elementType the supertype contained in the collection
|
||||
* @param elementType the super type contained in the collection
|
||||
* @return a collection asserting that type relationship
|
||||
*/
|
||||
public static <T> Collection<T> wrap(@SuppressWarnings("rawtypes") Collection coll, Class<T> elementType)
|
||||
@@ -19,9 +19,9 @@ public class CollectionWrapperFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a read only cast view of the supplied ungeneric list, based on the element type given
|
||||
* Return a read only cast view of the supplied raw list, based on the element type given
|
||||
* @param list The list to cast
|
||||
* @param elementType the supertype contained in the list
|
||||
* @param elementType the super type contained in the list
|
||||
* @return a list asserting that type relationship
|
||||
*/
|
||||
public static <T> List<T> wrap(@SuppressWarnings("rawtypes") List list, Class<T> elementType)
|
||||
|
||||
@@ -41,7 +41,7 @@ public class FMLDeobfTweaker implements ITweaker {
|
||||
catch (Exception e)
|
||||
{
|
||||
// Load in the Loader, make sure he's ready to roll - this will initialize most of the rest of minecraft here
|
||||
System.out.println("A CRITICAL PROBLEM OCCURED INITIALIZING MINECRAFT - LIKELY YOU HAVE AN INCORRECT VERSION FOR THIS FML");
|
||||
System.out.println("A CRITICAL PROBLEM OCCURRED INITIALIZING MINECRAFT - LIKELY YOU HAVE AN INCORRECT VERSION FOR THIS FML");
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Yggdrasil
|
||||
{
|
||||
LogManager.getLogger("FMLTWEAK").error("-- Login failed! " + e.getMessage());
|
||||
Throwables.propagate(e);
|
||||
return; // dont set other variables
|
||||
return; // don't set other variables
|
||||
}
|
||||
|
||||
args.put("--username", auth.getSelectedProfile().getName());
|
||||
|
||||
@@ -240,7 +240,7 @@ public class ByteBufUtils {
|
||||
// Add the tab for alignment
|
||||
returnString.append('\t');
|
||||
|
||||
// Add final chararacters at right, after padding
|
||||
// Add final characters at right, after padding
|
||||
|
||||
// If it was at the end of a line, print out the full line
|
||||
if (i > 0 && (i % 16) == 0)
|
||||
|
||||
+2
-3
@@ -44,13 +44,12 @@ public abstract class FMLIndexedMessageToMessageCodec<A> extends MessageToMessag
|
||||
}
|
||||
|
||||
public abstract void encodeInto(ChannelHandlerContext ctx, A msg, ByteBuf target) throws Exception;
|
||||
|
||||
@Override
|
||||
protected final void encode(ChannelHandlerContext ctx, A msg, List<Object> out) throws Exception
|
||||
{
|
||||
PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
|
||||
@SuppressWarnings("unchecked") // Stupid unnecessary cast I can't seem to kill
|
||||
Class<? extends A> clazz = (Class<? extends A>) msg.getClass();
|
||||
byte discriminator = types.get(clazz);
|
||||
byte discriminator = types.get(msg.getClass());
|
||||
buffer.writeByte(discriminator);
|
||||
encodeInto(ctx, msg, buffer);
|
||||
FMLProxyPacket proxy = new FMLProxyPacket(buffer/*.copy()*/, ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get());
|
||||
|
||||
@@ -127,8 +127,8 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
@Override
|
||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||
{
|
||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
||||
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
|
||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.builder();
|
||||
for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
|
||||
{
|
||||
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
||||
if (dispatcher != null) builder.add(dispatcher);
|
||||
@@ -155,8 +155,8 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||
{
|
||||
int dimension = (Integer)args;
|
||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
||||
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
|
||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.builder();
|
||||
for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
|
||||
{
|
||||
if (dimension == player.dimension)
|
||||
{
|
||||
@@ -189,8 +189,8 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||
{
|
||||
TargetPoint tp = (TargetPoint)args;
|
||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
||||
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
|
||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.builder();
|
||||
for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
|
||||
{
|
||||
if (player.dimension == tp.dimension)
|
||||
{
|
||||
|
||||
@@ -23,18 +23,17 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
public class PacketLoggingHandler
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static void register(NetworkManager manager)
|
||||
public static void register(NetworkManager manager)
|
||||
{
|
||||
ChannelPipeline pipeline = manager.channel().pipeline();
|
||||
final EnumPacketDirection direction = manager.getDirection();
|
||||
if (manager.isLocalChannel())
|
||||
{
|
||||
pipeline.addBefore("packet_handler", "splitter", new SimpleChannelInboundHandler<Packet>()
|
||||
pipeline.addBefore("packet_handler", "splitter", new SimpleChannelInboundHandler<Packet<?>>()
|
||||
{
|
||||
String prefix = (direction == EnumPacketDirection.SERVERBOUND ? "SERVER: C->S" : "CLIENT: S->C");
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
|
||||
protected void channelRead0(ChannelHandlerContext ctx, Packet<?> msg) throws Exception
|
||||
{
|
||||
PacketBuffer buf = new PacketBuffer(Unpooled.buffer());
|
||||
msg.writePacketData(buf);
|
||||
@@ -48,10 +47,10 @@ public class PacketLoggingHandler
|
||||
@Override
|
||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
|
||||
{
|
||||
if (msg instanceof Packet)
|
||||
if (msg instanceof Packet<?>)
|
||||
{
|
||||
PacketBuffer buf = new PacketBuffer(Unpooled.buffer());
|
||||
((Packet)msg).writePacketData(buf);
|
||||
((Packet<?>)msg).writePacketData(buf);
|
||||
FMLLog.log(Level.DEBUG, "%s %s:\n%s", prefix, msg.getClass().getSimpleName(), ByteBufUtils.getContentDump(buf));
|
||||
}
|
||||
ctx.write(msg, promise);
|
||||
|
||||
+9
-10
@@ -50,8 +50,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> implements ChannelOutboundHandler {
|
||||
public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet<?>> implements ChannelOutboundHandler {
|
||||
private static boolean DEBUG_HANDSHAKE = Boolean.parseBoolean(System.getProperty("fml.debugNetworkHandshake", "false"));
|
||||
private static enum ConnectionState {
|
||||
OPENING, AWAITING_HANDSHAKE, HANDSHAKING, HANDSHAKECOMPLETE, FINALIZING, CONNECTED;
|
||||
@@ -97,7 +96,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
|
||||
public NetworkDispatcher(NetworkManager manager)
|
||||
{
|
||||
super(Packet.class, false);
|
||||
super(false);
|
||||
this.manager = manager;
|
||||
this.scm = null;
|
||||
this.side = Side.CLIENT;
|
||||
@@ -112,7 +111,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
|
||||
public NetworkDispatcher(NetworkManager manager, PlayerList scm)
|
||||
{
|
||||
super(Packet.class, false);
|
||||
super(false);
|
||||
this.manager = manager;
|
||||
this.scm = scm;
|
||||
this.side = Side.SERVER;
|
||||
@@ -130,7 +129,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
this.player = player;
|
||||
insertIntoChannel();
|
||||
Boolean fml = this.manager.channel().attr(NetworkRegistry.FML_MARKER).get();
|
||||
if (fml != null && fml.booleanValue())
|
||||
if (fml != null && fml)
|
||||
{
|
||||
//FML on client, send server hello
|
||||
//TODO: Make this cleaner as it uses netty magic 0.o
|
||||
@@ -189,7 +188,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
{
|
||||
completeServerSideConnection(ConnectionType.MODDED);
|
||||
}
|
||||
// FORGE: sometimes the netqueue will tick while login is occuring, causing an NPE. We shouldn't tick until the connection is complete
|
||||
// FORGE: sometimes the netqueue will tick while login is occurring, causing an NPE. We shouldn't tick until the connection is complete
|
||||
if (this.playerEntity.playerNetServerHandler != this) return;
|
||||
super.update();
|
||||
}
|
||||
@@ -242,7 +241,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
|
||||
protected void channelRead0(ChannelHandlerContext ctx, Packet<?> msg) throws Exception
|
||||
{
|
||||
boolean handled = false;
|
||||
if (msg instanceof CPacketCustomPayload)
|
||||
@@ -305,7 +304,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
{
|
||||
kickWithMessage("This is modded. No modded response received. Bye!");
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
private void kickWithMessage(String message)
|
||||
{
|
||||
final TextComponentString TextComponentString = new TextComponentString(message);
|
||||
@@ -322,7 +321,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
{
|
||||
manager.closeChannel(TextComponentString);
|
||||
}
|
||||
}, new GenericFutureListener[0]);
|
||||
}, (GenericFutureListener<? extends Future<? super Void>>[])null);
|
||||
}
|
||||
manager.channel().config().setAutoRead(false);
|
||||
}
|
||||
@@ -613,7 +612,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
|
||||
public void processPart(PacketBuffer input) throws IOException
|
||||
{
|
||||
int part = (int)(input.readByte() & 0xFF);
|
||||
int part = input.readByte() & 0xFF;
|
||||
if (part != part_expected)
|
||||
{
|
||||
throw new IOException("Received FML MultiPart packet out of order, Expected " + part_expected + " Got " + part);
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public class EntitySpawnHandler extends SimpleChannelInboundHandler<FMLMessage.E
|
||||
entity = er.doCustomSpawning(spawnMsg);
|
||||
} else
|
||||
{
|
||||
entity = (Entity) (cls.getConstructor(World.class).newInstance(wc));
|
||||
entity = cls.getConstructor(World.class).newInstance(wc);
|
||||
|
||||
int offset = spawnMsg.entityId - entity.getEntityId();
|
||||
entity.setEntityId(spawnMsg.entityId);
|
||||
|
||||
@@ -7,23 +7,22 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry.EntityRegistration;
|
||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import net.minecraftforge.fml.common.registry.IThrowableEntity;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry.EntityRegistration;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
public abstract class FMLMessage {
|
||||
public static class CompleteHandshake extends FMLMessage {
|
||||
Side target;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class FMLNetworkHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.fine("Invalid attempt to open a local GUI on a dedicated server. This is likely a bug. GUIID: %s,%d", mc.getModId(), modGuiId);
|
||||
FMLLog.fine("Invalid attempt to open a local GUI on a dedicated server. This is likely a bug. GUI ID: %s,%d", mc.getModId(), modGuiId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class FMLProxyPacket implements Packet<INetHandler> {
|
||||
catch (Throwable t)
|
||||
{
|
||||
FMLLog.log(Level.ERROR, t, "There was a critical exception handling a packet on channel %s", channel);
|
||||
dispatcher.rejectHandshake("A fatal error has occured, this connection is terminated");
|
||||
dispatcher.rejectHandshake("A fatal error has occurred, this connection is terminated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
public class MessageContext {
|
||||
/**
|
||||
* The {@link INetHandler} for this message. It could be a client or server handler, depending
|
||||
* on the {@link #side} recieved.
|
||||
* on the {@link #side} received.
|
||||
*/
|
||||
public final INetHandler netHandler;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ClassPatchManager {
|
||||
int inputChecksum = Hashing.adler32().hashBytes(inputData).asInt();
|
||||
if (patch.inputChecksum != inputChecksum)
|
||||
{
|
||||
FMLRelaunchLog.severe("There is a binary discrepency between the expected input class %s (%s) and the actual class. Checksum on disk is %x, in patch %x. Things are probably about to go very wrong. Did you put something into the jar file?", mappedName, name, inputChecksum, patch.inputChecksum);
|
||||
FMLRelaunchLog.severe("There is a binary discrepancy between the expected input class %s (%s) and the actual class. Checksum on disk is %x, in patch %x. Things are probably about to go very wrong. Did you put something into the jar file?", mappedName, name, inputChecksum, patch.inputChecksum);
|
||||
if (!Boolean.parseBoolean(System.getProperty("fml.ignorePatchDiscrepancies","false")))
|
||||
{
|
||||
FMLRelaunchLog.severe("The game is going to exit, because this is a critical error, and it is very improbable that the modded game will work, please obtain clean jar files.");
|
||||
|
||||
@@ -13,13 +13,10 @@
|
||||
package net.minecraftforge.fml.common.registry;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@@ -33,6 +30,8 @@ import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLMessage.EntitySpawnMessage;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.BiMap;
|
||||
@@ -114,7 +113,7 @@ public class EntityRegistry
|
||||
|
||||
private static final EntityRegistry INSTANCE = new EntityRegistry();
|
||||
|
||||
private BitSet availableIndicies;
|
||||
private BitSet availableIndices;
|
||||
private ListMultimap<ModContainer, EntityRegistration> entityRegistrations = ArrayListMultimap.create();
|
||||
private Map<String,ModContainer> entityNames = Maps.newHashMap();
|
||||
private BiMap<Class<? extends Entity>, EntityRegistration> entityClassRegistrations = HashBiMap.create();
|
||||
@@ -126,11 +125,11 @@ public class EntityRegistry
|
||||
|
||||
private EntityRegistry()
|
||||
{
|
||||
availableIndicies = new BitSet(256);
|
||||
availableIndicies.set(1,255);
|
||||
availableIndices = new BitSet(256);
|
||||
availableIndices.set(1,255);
|
||||
for (Object id : EntityList.idToClassMapping.keySet())
|
||||
{
|
||||
availableIndicies.clear((Integer)id);
|
||||
availableIndices.clear((Integer)id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,11 +309,11 @@ public class EntityRegistry
|
||||
FMLLog.log(Level.ERROR, "The entity ID %d for mod %s is not an unsigned byte and may not work", id, Loader.instance().activeModContainer().getModId());
|
||||
}
|
||||
|
||||
if (!availableIndicies.get(realId))
|
||||
if (!availableIndices.get(realId))
|
||||
{
|
||||
FMLLog.severe("The mod %s has attempted to register an entity ID %d which is already reserved. This could cause severe problems", Loader.instance().activeModContainer().getModId(), id);
|
||||
}
|
||||
availableIndicies.clear(realId);
|
||||
availableIndices.clear(realId);
|
||||
return realId;
|
||||
}
|
||||
|
||||
@@ -418,10 +417,10 @@ public class EntityRegistry
|
||||
@Deprecated
|
||||
public static int findGlobalUniqueEntityId()
|
||||
{
|
||||
int res = instance().availableIndicies.nextSetBit(0);
|
||||
int res = instance().availableIndices.nextSetBit(0);
|
||||
if (res < 0)
|
||||
{
|
||||
throw new RuntimeException("No more entity indicies left");
|
||||
throw new RuntimeException("No more entity indices left");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
+9
-10
@@ -10,6 +10,15 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.functions.GenericIterableFactory;
|
||||
import net.minecraftforge.fml.common.registry.RegistryDelegate.Delegate;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.BiMap;
|
||||
@@ -17,16 +26,6 @@ import com.google.common.collect.HashBiMap;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.util.IntIdentityHashBiMap;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.functions.GenericIterableFactory;
|
||||
import net.minecraftforge.fml.common.registry.RegistryDelegate.Delegate;
|
||||
|
||||
public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaultedByKey<ResourceLocation, I>
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.RegistryNamespaced;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
@@ -91,6 +90,7 @@ public class GameData
|
||||
return getMain().iBlockRegistry.getObject(new ResourceLocation(modId, name));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
static GameRegistry.UniqueIdentifier getUniqueName(Block block)
|
||||
{
|
||||
if (block == null)
|
||||
@@ -101,6 +101,7 @@ public class GameData
|
||||
return new GameRegistry.UniqueIdentifier(name);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
static GameRegistry.UniqueIdentifier getUniqueName(Item item)
|
||||
{
|
||||
if (item == null)
|
||||
|
||||
+14
-16
@@ -1,7 +1,6 @@
|
||||
package net.minecraftforge.fml.common.registry;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -9,6 +8,20 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockAir;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.StartupQuery;
|
||||
import net.minecraftforge.fml.common.ZipperUtil;
|
||||
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
@@ -19,21 +32,6 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.collect.Sets.SetView;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockAir;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.StartupQuery;
|
||||
import net.minecraftforge.fml.common.ZipperUtil;
|
||||
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
|
||||
|
||||
/**
|
||||
* Persistent registry manager. Manages the registries loading from disk, and from network. Handles staging
|
||||
* registry data before loading uniformly into the active registry, and keeps a frozen registry instance
|
||||
|
||||
@@ -52,18 +52,18 @@ public interface RegistryDelegate<T> {
|
||||
*/
|
||||
final class Delegate<T> implements RegistryDelegate<T>
|
||||
{
|
||||
private T referant;
|
||||
private T referent;
|
||||
private ResourceLocation name;
|
||||
private final Class<T> type;
|
||||
|
||||
public Delegate(T referant, Class<T> type) {
|
||||
this.referant = referant;
|
||||
public Delegate(T referent, Class<T> type) {
|
||||
this.referent = referent;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return referant;
|
||||
return referent;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,7 +82,7 @@ public interface RegistryDelegate<T> {
|
||||
|
||||
void changeReference(T newTarget)
|
||||
{
|
||||
this.referant = newTarget;
|
||||
this.referent = newTarget;
|
||||
}
|
||||
|
||||
void setResourceName(ResourceLocation name) { this.name = name; }
|
||||
|
||||
@@ -14,12 +14,8 @@ package net.minecraftforge.fml.common.toposort;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.toposort.ModSortingException.SortingExceptionData;
|
||||
|
||||
public class ModSortingException extends EnhancedRuntimeException
|
||||
{
|
||||
|
||||
@@ -181,7 +181,7 @@ public class TopologicalSort
|
||||
}
|
||||
|
||||
FMLLog.severe("Mod Sorting failed.");
|
||||
FMLLog.severe("Visting node %s", node);
|
||||
FMLLog.severe("Visiting node %s", node);
|
||||
FMLLog.severe("Current sorted list : %s", sortedResult);
|
||||
FMLLog.severe("Visited set for this node : %s", visitedNodes);
|
||||
FMLLog.severe("Explored node set : %s", expandedNodes);
|
||||
|
||||
Reference in new issue
Block a user