mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix uses of uppercase "Forge" where it fails Loader.isModLoaded(modID) (#3513)
This commit is contained in:
1 parent
4530967009
commit
6a125ae0d4
15 files changed
+43
-33
No files matched your search
@@ -116,7 +116,7 @@ public class ForgeGuiFactory implements IModGuiFactory
|
||||
{
|
||||
public ForgeConfigGui(GuiScreen parentScreen)
|
||||
{
|
||||
super(parentScreen, getConfigElements(), "Forge", false, false, I18n.format("forge.configgui.forgeConfigTitle"));
|
||||
super(parentScreen, getConfigElements(), ForgeVersion.MOD_ID, false, false, I18n.format("forge.configgui.forgeConfigTitle"));
|
||||
}
|
||||
|
||||
private static List<IConfigElement> getConfigElements()
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
public class NotificationModUpdateScreen extends GuiScreen
|
||||
{
|
||||
|
||||
private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation("forge", "textures/gui/version_check_icons.png");
|
||||
private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation(ForgeVersion.MOD_ID, "textures/gui/version_check_icons.png");
|
||||
|
||||
private final GuiButton modButton;
|
||||
private Status showNotification = null;
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.util.List;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector4f;
|
||||
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -425,7 +426,7 @@ public final class ItemLayerModel implements IRetexturableModel
|
||||
|
||||
public boolean accepts(ResourceLocation modelLocation)
|
||||
{
|
||||
return modelLocation.getResourceDomain().equals("forge") && (
|
||||
return modelLocation.getResourceDomain().equals(ForgeVersion.MOD_ID) && (
|
||||
modelLocation.getResourcePath().equals("item-layer") ||
|
||||
modelLocation.getResourcePath().equals("models/block/item-layer") ||
|
||||
modelLocation.getResourcePath().equals("models/item/item-layer"));
|
||||
|
||||
@@ -45,6 +45,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.model.IModelPart;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
@@ -64,7 +65,7 @@ import com.google.common.collect.Maps;
|
||||
|
||||
public final class ModelDynBucket implements IModel, IModelCustomData, IRetexturableModel
|
||||
{
|
||||
public static final ModelResourceLocation LOCATION = new ModelResourceLocation(new ResourceLocation("forge", "dynbucket"), "inventory");
|
||||
public static final ModelResourceLocation LOCATION = new ModelResourceLocation(new ResourceLocation(ForgeVersion.MOD_ID, "dynbucket"), "inventory");
|
||||
|
||||
// minimal Z offset to prevent depth-fighting
|
||||
private static final float NORTH_Z_BASE = 7.496f / 16f;
|
||||
@@ -230,7 +231,7 @@ public final class ModelDynBucket implements IModel, IModelCustomData, IRetextur
|
||||
@Override
|
||||
public boolean accepts(ResourceLocation modelLocation)
|
||||
{
|
||||
return modelLocation.getResourceDomain().equals("forge") && modelLocation.getResourcePath().contains("forgebucket");
|
||||
return modelLocation.getResourceDomain().equals(ForgeVersion.MOD_ID) && modelLocation.getResourcePath().contains("forgebucket");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,6 +41,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.model.IModelPart;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
@@ -104,7 +105,7 @@ public final class ModelFluid implements IModelCustomData
|
||||
|
||||
public boolean accepts(ResourceLocation modelLocation)
|
||||
{
|
||||
return modelLocation.getResourceDomain().equals("forge") && (
|
||||
return modelLocation.getResourceDomain().equals(ForgeVersion.MOD_ID) && (
|
||||
modelLocation.getResourcePath().equals("fluid") ||
|
||||
modelLocation.getResourcePath().equals("models/block/fluid") ||
|
||||
modelLocation.getResourcePath().equals("models/item/fluid"));
|
||||
|
||||
@@ -80,6 +80,7 @@ import net.minecraftforge.client.model.animation.AnimationItemOverrideList;
|
||||
import net.minecraftforge.client.model.animation.IAnimatedModel;
|
||||
import net.minecraftforge.client.model.animation.ModelBlockAnimation;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.model.IModelPart;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.Models;
|
||||
@@ -360,7 +361,7 @@ public final class ModelLoader extends ModelBakery
|
||||
for(String s : getVariantNames(Items.BUCKET))
|
||||
{
|
||||
ModelResourceLocation memory = getInventoryVariant(s);
|
||||
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation("forge", "item/bucket"));
|
||||
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation(ForgeVersion.MOD_ID, "item/bucket"));
|
||||
// only on successful load, otherwise continue using the old model
|
||||
if(model != getMissingModel())
|
||||
{
|
||||
@@ -388,7 +389,7 @@ public final class ModelLoader extends ModelBakery
|
||||
for(String s : getVariantNames(Items.MILK_BUCKET))
|
||||
{
|
||||
ModelResourceLocation memory = getInventoryVariant(s);
|
||||
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation("forge", "item/bucket_milk"));
|
||||
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation(ForgeVersion.MOD_ID, "item/bucket_milk"));
|
||||
// only on successful load, otherwise continue using the old model
|
||||
if(model != getMissingModel())
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@ import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
@@ -248,7 +249,7 @@ public final class MultiLayerModel implements IModelCustomData
|
||||
|
||||
public boolean accepts(ResourceLocation modelLocation)
|
||||
{
|
||||
return modelLocation.getResourceDomain().equals("forge") && (
|
||||
return modelLocation.getResourceDomain().equals(ForgeVersion.MOD_ID) && (
|
||||
modelLocation.getResourcePath().equals("multi-layer") ||
|
||||
modelLocation.getResourcePath().equals("models/block/multi-layer") ||
|
||||
modelLocation.getResourcePath().equals("models/item/multi-layer"));
|
||||
|
||||
@@ -494,7 +494,7 @@ public class ForgeChunkManager
|
||||
{
|
||||
NBTTagCompound ticketHolder = ticketList.getCompoundTagAt(i);
|
||||
String modId = ticketHolder.getString("Owner");
|
||||
boolean isPlayer = "Forge".equals(modId);
|
||||
boolean isPlayer = ForgeVersion.MOD_ID.equals(modId);
|
||||
|
||||
if (!isPlayer && !Loader.isModLoaded(modId))
|
||||
{
|
||||
@@ -600,7 +600,7 @@ public class ForgeChunkManager
|
||||
tickets = orderedLoadingCallback.playerTicketsLoaded(ImmutableListMultimap.copyOf(tickets), world);
|
||||
playerTickets.putAll(tickets);
|
||||
}
|
||||
ForgeChunkManager.tickets.get(world).putAll("Forge", tickets.values());
|
||||
ForgeChunkManager.tickets.get(world).putAll(ForgeVersion.MOD_ID, tickets.values());
|
||||
loadingCallback.ticketsLoaded(ImmutableList.copyOf(tickets.values()), world);
|
||||
}
|
||||
}
|
||||
@@ -702,7 +702,7 @@ public class ForgeChunkManager
|
||||
}
|
||||
Ticket ticket = new Ticket(mc.getModId(),type,world,player);
|
||||
playerTickets.put(player, ticket);
|
||||
tickets.get(world).put("Forge", ticket);
|
||||
tickets.get(world).put(ForgeVersion.MOD_ID, ticket);
|
||||
return ticket;
|
||||
}
|
||||
/**
|
||||
@@ -770,7 +770,7 @@ public class ForgeChunkManager
|
||||
if (ticket.isPlayerTicket())
|
||||
{
|
||||
playerTickets.remove(ticket.player, ticket);
|
||||
tickets.get(ticket.world).remove("Forge",ticket);
|
||||
tickets.get(ticket.world).remove(ForgeVersion.MOD_ID, ticket);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -856,7 +856,7 @@ public class ForgeChunkManager
|
||||
chunkConstraints.clear();
|
||||
for (String mod : config.getCategoryNames())
|
||||
{
|
||||
if (mod.equals("Forge") || mod.equals("defaults"))
|
||||
if (mod.equals(ForgeVersion.MOD_ID) || mod.equals("defaults"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1061,18 +1061,18 @@ public class ForgeChunkManager
|
||||
|
||||
config.setCategoryPropertyOrder("defaults", propOrder);
|
||||
|
||||
config.addCustomCategoryComment("Forge", "Sample mod specific control section.\n" +
|
||||
config.addCustomCategoryComment(ForgeVersion.MOD_ID, "Sample mod specific control section.\n" +
|
||||
"Copy this section and rename the with the modid for the mod you wish to override.\n" +
|
||||
"A value of zero in either entry effectively disables any chunkloading capabilities\n" +
|
||||
"for that mod");
|
||||
|
||||
temp = config.get("Forge", "maximumTicketCount", 200);
|
||||
temp = config.get(ForgeVersion.MOD_ID, "maximumTicketCount", 200);
|
||||
temp.setComment("Maximum ticket count for the mod. Zero disables chunkloading capabilities.");
|
||||
temp = config.get("Forge", "maximumChunksPerTicket", 25);
|
||||
temp = config.get(ForgeVersion.MOD_ID, "maximumChunksPerTicket", 25);
|
||||
temp.setComment("Maximum chunks per ticket for the mod.");
|
||||
for (String mod : config.getCategoryNames())
|
||||
{
|
||||
if (mod.equals("Forge") || mod.equals("defaults"))
|
||||
if (mod.equals(ForgeVersion.MOD_ID) || mod.equals("defaults"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1101,7 +1101,7 @@ public class ForgeChunkManager
|
||||
List<ConfigCategory> list = new ArrayList<ConfigCategory>();
|
||||
for (String mod : config.getCategoryNames())
|
||||
{
|
||||
if (mod.equals("Forge") || mod.equals("defaults"))
|
||||
if (mod.equals(ForgeVersion.MOD_ID) || mod.equals("defaults"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
{
|
||||
super(new ModMetadata());
|
||||
ModMetadata meta = getMetadata();
|
||||
meta.modId = "forge";
|
||||
meta.modId = ForgeVersion.MOD_ID;
|
||||
meta.name = "Minecraft Forge";
|
||||
meta.version = ForgeVersion.getVersion();
|
||||
meta.credits = "Made possible with help from many people";
|
||||
@@ -379,11 +379,11 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
itr.remove();
|
||||
}
|
||||
|
||||
FMLLog.log("Forge", Level.DEBUG, "Preloading CrashReport Classes");
|
||||
FMLLog.log(ForgeVersion.MOD_ID, Level.DEBUG, "Preloading CrashReport Classes");
|
||||
Collections.sort(all); //Sort it because I like pretty output ;)
|
||||
for (String name : all)
|
||||
{
|
||||
FMLLog.log("Forge", Level.DEBUG, "\t" + name);
|
||||
FMLLog.log(ForgeVersion.MOD_ID, Level.DEBUG, "\t" + name);
|
||||
try
|
||||
{
|
||||
Class.forName(name.replace('/', '.'), false, MinecraftForge.class.getClassLoader());
|
||||
@@ -420,7 +420,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
{
|
||||
universalBucket = new UniversalBucket();
|
||||
universalBucket.setUnlocalizedName("forge.bucketFilled");
|
||||
GameRegistry.register(universalBucket.setRegistryName("forge", "bucketFilled"));
|
||||
GameRegistry.register(universalBucket.setRegistryName(ForgeVersion.MOD_ID, "bucketFilled"));
|
||||
MinecraftForge.EVENT_BUS.register(universalBucket);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ import net.minecraftforge.fml.common.versioning.ComparableVersion;
|
||||
|
||||
public class ForgeVersion
|
||||
{
|
||||
// This is Forge's Mod Id, used for the ForgeModContainer and resource locations
|
||||
public static final String MOD_ID = "forge";
|
||||
//This number is incremented every time we remove deprecated code/major API changes, never reset
|
||||
public static final int majorVersion = 13;
|
||||
//This number is incremented every minecraft release, never reset
|
||||
|
||||
@@ -41,7 +41,7 @@ import net.minecraftforge.fml.common.ModContainer;
|
||||
public class GuiSlotModList extends GuiScrollingList
|
||||
{
|
||||
|
||||
private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation("forge", "textures/gui/version_check_icons.png");
|
||||
private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation(ForgeVersion.MOD_ID, "textures/gui/version_check_icons.png");
|
||||
|
||||
private GuiModList parent;
|
||||
private ArrayList<ModContainer> mods;
|
||||
|
||||
@@ -516,7 +516,7 @@ public class FMLCommonHandler
|
||||
modNames.add("fml");
|
||||
if (!noForge)
|
||||
{
|
||||
modNames.add("forge");
|
||||
modNames.add(ForgeVersion.MOD_ID);
|
||||
}
|
||||
|
||||
if (Loader.instance().getFMLBrandingProperties().containsKey("snooperbranding"))
|
||||
|
||||
Reference in new issue
Block a user