mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Well, it works, for a game, now.
This commit is contained in:
1 parent
06b16aaa19
commit
d0ab0e166c
208 files changed
+2328
-5883
No files matched your search
@@ -270,7 +270,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
|
||||
public void checkSettings()
|
||||
{
|
||||
boolean newEnabled = ForgeModContainer.forgeCloudsEnabled
|
||||
boolean newEnabled = ForgeMod.forgeCloudsEnabled
|
||||
&& mc.gameSettings.shouldRenderClouds() != 0
|
||||
&& mc.world != null
|
||||
&& mc.world.provider.isSurfaceWorld();
|
||||
@@ -489,4 +489,29 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
reloadTextures();
|
||||
}
|
||||
}
|
||||
|
||||
private static CloudRenderer cloudRenderer;
|
||||
private static CloudRenderer getCloudRenderer()
|
||||
{
|
||||
if (cloudRenderer == null)
|
||||
cloudRenderer = new CloudRenderer();
|
||||
return cloudRenderer;
|
||||
}
|
||||
|
||||
public static void updateCloudSettings()
|
||||
{
|
||||
getCloudRenderer().checkSettings();
|
||||
}
|
||||
|
||||
public static boolean renderClouds(int cloudTicks, float partialTicks, WorldClient world, Minecraft client)
|
||||
{
|
||||
IRenderHandler renderer = world.provider.getCloudRenderer();
|
||||
if (renderer != null)
|
||||
{
|
||||
renderer.render(partialTicks, world, client);
|
||||
return true;
|
||||
}
|
||||
return getCloudRenderer().render(cloudTicks, partialTicks);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -125,7 +125,7 @@ import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.client.resource.IResourceType;
|
||||
import net.minecraftforge.client.resource.SelectiveReloadStateHandler;
|
||||
import net.minecraftforge.client.resource.VanillaResourceType;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.model.IModelPart;
|
||||
@@ -284,7 +284,7 @@ public class ForgeHooksClient
|
||||
skyInit = true;
|
||||
|
||||
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
||||
int[] ranges = ForgeModContainer.blendRanges;
|
||||
int[] ranges = ForgeMod.blendRanges;
|
||||
int distance = 0;
|
||||
if (settings.fancyGraphics && ranges.length > 0)
|
||||
{
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
|
||||
package net.minecraftforge.client;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public abstract class IRenderHandler
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public abstract void render(float partialTicks, WorldClient world, Minecraft mc);
|
||||
}
|
||||
@@ -24,6 +24,8 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.InventoryEffectRenderer;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -32,15 +34,13 @@ import net.minecraft.client.gui.ScaledResolution;
|
||||
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Event classes for GuiScreen events.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiScreenEvent extends Event
|
||||
{
|
||||
private final GuiScreen gui;
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
@@ -50,7 +50,7 @@ import net.minecraftforge.fml.client.config.GuiConfigEntries.BooleanEntry;
|
||||
import net.minecraftforge.fml.client.config.IConfigElement;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.ModContainer;
|
||||
import static net.minecraftforge.common.ForgeModContainer.VERSION_CHECK_CAT;
|
||||
import static net.minecraftforge.common.ForgeMod.VERSION_CHECK_CAT;
|
||||
|
||||
/**
|
||||
* This is the base GuiConfig screen class that all the other Forge-specific config screens will be called from.
|
||||
@@ -87,8 +87,8 @@ import static net.minecraftforge.common.ForgeModContainer.VERSION_CHECK_CAT;
|
||||
* - etc.
|
||||
*
|
||||
* Other things to check out:
|
||||
* ForgeModContainer.syncConfig()
|
||||
* ForgeModContainer.onConfigChanged()
|
||||
* ForgeMod.syncConfig()
|
||||
* ForgeMod.onConfigChanged()
|
||||
* ForgeChunkManager.syncConfigDefaults()
|
||||
* ForgeChunkManager.loadConfiguration()
|
||||
*/
|
||||
@@ -141,10 +141,10 @@ public class ForgeGuiFactory implements IModGuiFactory
|
||||
// This GuiConfig object specifies the configID of the object and as such will force-save when it is closed. The parent
|
||||
// GuiConfig object's entryList will also be refreshed to reflect the changes.
|
||||
return new GuiConfig(this.owningScreen,
|
||||
(new ConfigElement(ForgeModContainer.getConfig().getCategory(Configuration.CATEGORY_GENERAL))).getChildElements(),
|
||||
(new ConfigElement(ForgeMod.getConfig().getCategory(Configuration.CATEGORY_GENERAL))).getChildElements(),
|
||||
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
|
||||
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
|
||||
GuiConfig.getAbridgedConfigPath(ForgeModContainer.getConfig().toString()));
|
||||
GuiConfig.getAbridgedConfigPath(ForgeMod.getConfig().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,10 +165,10 @@ public class ForgeGuiFactory implements IModGuiFactory
|
||||
// This GuiConfig object specifies the configID of the object and as such will force-save when it is closed. The parent
|
||||
// GuiConfig object's entryList will also be refreshed to reflect the changes.
|
||||
return new GuiConfig(this.owningScreen,
|
||||
(new ConfigElement(ForgeModContainer.getConfig().getCategory(Configuration.CATEGORY_CLIENT))).getChildElements(),
|
||||
(new ConfigElement(ForgeMod.getConfig().getCategory(Configuration.CATEGORY_CLIENT))).getChildElements(),
|
||||
this.owningScreen.modID, Configuration.CATEGORY_CLIENT, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
|
||||
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
|
||||
GuiConfig.getAbridgedConfigPath(ForgeModContainer.getConfig().toString()));
|
||||
GuiConfig.getAbridgedConfigPath(ForgeMod.getConfig().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,18 +216,18 @@ public class ForgeGuiFactory implements IModGuiFactory
|
||||
@Override
|
||||
protected GuiScreen buildChildScreen()
|
||||
{
|
||||
ConfigCategory cfg = ForgeModContainer.getConfig().getCategory(VERSION_CHECK_CAT);
|
||||
ConfigCategory cfg = ForgeMod.getConfig().getCategory(VERSION_CHECK_CAT);
|
||||
Map<String, Property> values = new HashMap<String, Property>(cfg.getValues());
|
||||
values.remove("Global");
|
||||
|
||||
Property global = ForgeModContainer.getConfig().get(VERSION_CHECK_CAT, "Global", true);
|
||||
Property global = ForgeMod.getConfig().get(VERSION_CHECK_CAT, "Global", true);
|
||||
|
||||
List<Property> props = new ArrayList<Property>();
|
||||
|
||||
for (ModContainer mod : ForgeVersion.gatherMods().keySet())
|
||||
{
|
||||
values.remove(mod.getModId());
|
||||
props.add(ForgeModContainer.getConfig().get(VERSION_CHECK_CAT, mod.getModId(), true)); //Get or make the value in the config
|
||||
props.add(ForgeMod.getConfig().get(VERSION_CHECK_CAT, mod.getModId(), true)); //Get or make the value in the config
|
||||
}
|
||||
props.addAll(values.values()); // Add any left overs from the config
|
||||
props.sort(Comparator.comparing(Property::getName));
|
||||
@@ -244,7 +244,7 @@ public class ForgeGuiFactory implements IModGuiFactory
|
||||
return new GuiConfig(this.owningScreen,
|
||||
list,
|
||||
this.owningScreen.modID, VERSION_CHECK_CAT, true, true,
|
||||
GuiConfig.getAbridgedConfigPath(ForgeModContainer.getConfig().toString()));
|
||||
GuiConfig.getAbridgedConfigPath(ForgeMod.getConfig().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,15 +25,15 @@ import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.ForgeVersion.Status;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import net.minecraftforge.fml.client.ClientModLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class NotificationModUpdateScreen extends GuiScreen
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ public class NotificationModUpdateScreen extends GuiScreen
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
if (showNotification == null || !showNotification.shouldDraw() || ForgeModContainer.disableVersionCheck)
|
||||
if (showNotification == null || !showNotification.shouldDraw() || ForgeMod.disableVersionCheck)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package net.minecraftforge.client.model;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -201,7 +201,7 @@ final class FancyMissingModel implements IModel
|
||||
case HEAD:
|
||||
break;
|
||||
case GUI:
|
||||
if (ForgeModContainer.zoomInMissingModelTextInGui)
|
||||
if (ForgeMod.zoomInMissingModelTextInGui)
|
||||
{
|
||||
transform = new TRSRTransformation(null, new Quat4f(1, 1, 1, 1), new Vector3f(4, 4, 4), null);
|
||||
big = false;
|
||||
|
||||
@@ -72,7 +72,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
import net.minecraftforge.client.model.animation.AnimationItemOverrideList;
|
||||
import net.minecraftforge.client.model.animation.ModelBlockAnimation;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.Models;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
@@ -81,7 +81,6 @@ import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.Properties;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.client.ClientModLoader;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.ProgressManager;
|
||||
import net.minecraftforge.fml.common.ProgressManager.ProgressBar;
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.client.renderer.color.BlockColors;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
|
||||
public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||
{
|
||||
@@ -51,7 +51,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||
@Override
|
||||
public boolean renderModelFlat(IBlockAccess world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, long rand)
|
||||
{
|
||||
if(ForgeModContainer.forgeLightPipelineEnabled)
|
||||
if(ForgeMod.forgeLightPipelineEnabled)
|
||||
{
|
||||
if(buffer != lastRendererFlat.get())
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||
@Override
|
||||
public boolean renderModelSmooth(IBlockAccess world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, long rand)
|
||||
{
|
||||
if(ForgeModContainer.forgeLightPipelineEnabled)
|
||||
if(ForgeMod.forgeLightPipelineEnabled)
|
||||
{
|
||||
if(buffer != lastRendererSmooth.get())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user