mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
Made some more public fields either private or final.
This commit is contained in:
1 parent
756c58d5cb
commit
75032ebf9c
32 files changed
+355
-331
No files matched your search
@@ -25,10 +25,10 @@ import net.minecraftforge.fml.common.Mod;
|
||||
*/
|
||||
public class FMLFingerprintViolationEvent extends FMLEvent {
|
||||
|
||||
public final boolean isDirectory;
|
||||
public final Set<String> fingerprints;
|
||||
public final File source;
|
||||
public final String expectedFingerprint;
|
||||
private final boolean isDirectory;
|
||||
private final Set<String> fingerprints;
|
||||
private final File source;
|
||||
private final String expectedFingerprint;
|
||||
|
||||
public FMLFingerprintViolationEvent(boolean isDirectory, File source, ImmutableSet<String> fingerprints, String expectedFingerprint)
|
||||
{
|
||||
@@ -38,4 +38,9 @@ public class FMLFingerprintViolationEvent extends FMLEvent {
|
||||
this.fingerprints = fingerprints;
|
||||
this.expectedFingerprint = expectedFingerprint;
|
||||
}
|
||||
|
||||
public boolean isDirectory() { return isDirectory; }
|
||||
public Set<String> getFingerprints() { return fingerprints; }
|
||||
public File getSource() { return source; }
|
||||
public String getExpectedFingerprint() { return expectedFingerprint; }
|
||||
}
|
||||
@@ -125,6 +125,7 @@ public class FMLProxyPacket implements Packet<INetHandler> {
|
||||
}
|
||||
|
||||
static final int PART_SIZE = 0x1000000 - 0x50; // Make it a constant so that it gets inlined below.
|
||||
// FIXME int overflow
|
||||
public static final int MAX_LENGTH = PART_SIZE * 255;
|
||||
public List<Packet<INetHandlerPlayClient>> toS3FPackets() throws IOException
|
||||
{
|
||||
|
||||
@@ -90,28 +90,6 @@ public class GameData
|
||||
return getMain().iBlockRegistry.getObject(new ResourceLocation(modId, name));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
static GameRegistry.UniqueIdentifier getUniqueName(Block block)
|
||||
{
|
||||
if (block == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Object name = getMain().iBlockRegistry.getNameForObject(block);
|
||||
return new GameRegistry.UniqueIdentifier(name);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
static GameRegistry.UniqueIdentifier getUniqueName(Item item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Object name = getMain().iItemRegistry.getNameForObject(item);
|
||||
return new GameRegistry.UniqueIdentifier(name);
|
||||
}
|
||||
|
||||
protected static GameData getMain()
|
||||
{
|
||||
return mainData;
|
||||
|
||||
@@ -388,112 +388,12 @@ public class GameRegistry
|
||||
return GameData.findItem(modId, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will be switching to using ResourceLocation, since it's used widely elsewhere
|
||||
*/
|
||||
@Deprecated
|
||||
public static final class UniqueIdentifier
|
||||
{
|
||||
public final String modId;
|
||||
public final String name;
|
||||
|
||||
UniqueIdentifier(String modId, String name)
|
||||
{
|
||||
this.modId = modId;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public UniqueIdentifier(String string)
|
||||
{
|
||||
String[] parts = string.split(":");
|
||||
this.modId = parts[0];
|
||||
this.name = parts[1];
|
||||
}
|
||||
|
||||
public UniqueIdentifier(Object obj)
|
||||
{
|
||||
if (obj instanceof String)
|
||||
{
|
||||
String[] parts = ((String)obj).split(":");
|
||||
this.modId = parts[0];
|
||||
this.name = parts[1];
|
||||
}
|
||||
else if (obj instanceof ResourceLocation)
|
||||
{
|
||||
this.modId = ((ResourceLocation)obj).getResourceDomain();
|
||||
this.name = ((ResourceLocation)obj).getResourcePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("UniqueIdentifier must be a String or ResourceLocation, was " + obj.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (obj.getClass() != this.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final UniqueIdentifier other = (UniqueIdentifier)obj;
|
||||
return Objects.equal(modId, other.modId) && Objects.equal(name, other.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hashCode(modId, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s:%s", modId, name);
|
||||
}
|
||||
}
|
||||
|
||||
public enum Type
|
||||
{
|
||||
BLOCK,
|
||||
ITEM;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up the mod identifier data for a block.
|
||||
* <p/>
|
||||
* Note: uniqueness and persistence is only guaranteed by mods using the game registry
|
||||
* correctly.
|
||||
*
|
||||
* @param block to lookup
|
||||
* @return a {@link UniqueIdentifier} for the block or null
|
||||
*/
|
||||
@Deprecated
|
||||
public static UniqueIdentifier findUniqueIdentifierFor(Block block)
|
||||
{
|
||||
return GameData.getUniqueName(block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up the mod identifier data for an item.
|
||||
* <p/>
|
||||
* Note: uniqueness and persistence is only guaranteed by mods using the game registry
|
||||
* correctly.
|
||||
*
|
||||
* @param item to lookup
|
||||
* @return a {@link UniqueIdentifier} for the item or null
|
||||
*/
|
||||
@Deprecated
|
||||
public static UniqueIdentifier findUniqueIdentifierFor(Item item)
|
||||
{
|
||||
return GameData.getUniqueName(item);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ObjectHolder can be used to automatically populate public static final fields with entries
|
||||
* from the registry. These values can then be referred within mod code directly.
|
||||
|
||||
Reference in new issue
Block a user