mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Update mappings, move mod initialization to the async loader.
Signed-off-by: cpw <[email protected]>
This commit is contained in:
35 files changed
+166
-214
No files matched your search
@@ -81,7 +81,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
public CloudRenderer()
|
||||
{
|
||||
// Resource manager should always be reloadable.
|
||||
((IReloadableResourceManager) mc.getResourceManager()).func_219534_a(this);
|
||||
((IReloadableResourceManager) mc.getResourceManager()).addReloadListener(this);
|
||||
}
|
||||
|
||||
private int getScale()
|
||||
@@ -273,19 +273,19 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
public void checkSettings()
|
||||
{
|
||||
boolean newEnabled = ForgeConfig.CLIENT.forgeCloudsEnabled.get()
|
||||
&& mc.gameSettings.func_216842_e() != CloudOption.OFF
|
||||
&& mc.gameSettings.getCloudOption() != CloudOption.OFF
|
||||
&& mc.world != null
|
||||
&& mc.world.dimension.isSurfaceWorld();
|
||||
|
||||
if (isBuilt()
|
||||
&& (!newEnabled
|
||||
|| mc.gameSettings.func_216842_e() != cloudMode
|
||||
|| mc.gameSettings.getCloudOption() != cloudMode
|
||||
|| mc.gameSettings.renderDistanceChunks != renderDistance))
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
|
||||
cloudMode = mc.gameSettings.func_216842_e();
|
||||
cloudMode = mc.gameSettings.getCloudOption();
|
||||
renderDistance = mc.gameSettings.renderDistanceChunks;
|
||||
|
||||
if (newEnabled && !isBuilt())
|
||||
|
||||
@@ -130,14 +130,14 @@ public class ForgeIngameGui extends IngameGui
|
||||
|
||||
if (renderHelmet) renderHelmet(partialTicks);
|
||||
|
||||
if (renderPortal && !mc.player.isPotionActive(Effects.field_76431_k))
|
||||
if (renderPortal && !mc.player.isPotionActive(Effects.NAUSEA))
|
||||
{
|
||||
renderPortal(partialTicks);
|
||||
}
|
||||
|
||||
if (this.mc.field_71442_b.getCurrentGameType() == GameType.SPECTATOR)
|
||||
if (this.mc.playerController.getCurrentGameType() == GameType.SPECTATOR)
|
||||
{
|
||||
if (renderSpectatorTooltip) field_175197_u.renderTooltip(partialTicks);
|
||||
if (renderSpectatorTooltip) spectatorGui.renderTooltip(partialTicks);
|
||||
}
|
||||
else if (!this.mc.gameSettings.hideGUI)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
if (renderBossHealth) renderBossHealth();
|
||||
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
if (this.mc.field_71442_b.shouldDrawHUD() && this.mc.getRenderViewEntity() instanceof PlayerEntity)
|
||||
if (this.mc.playerController.shouldDrawHUD() && this.mc.getRenderViewEntity() instanceof PlayerEntity)
|
||||
{
|
||||
if (renderHealth) renderHealth(this.scaledWidth, this.scaledHeight);
|
||||
if (renderArmor) renderArmor(this.scaledWidth, this.scaledHeight);
|
||||
@@ -170,10 +170,10 @@ public class ForgeIngameGui extends IngameGui
|
||||
{
|
||||
renderExperience(this.scaledWidth / 2 - 91);
|
||||
}
|
||||
if (this.mc.gameSettings.heldItemTooltips && this.mc.field_71442_b.getCurrentGameType() != GameType.SPECTATOR) {
|
||||
if (this.mc.gameSettings.heldItemTooltips && this.mc.playerController.getCurrentGameType() != GameType.SPECTATOR) {
|
||||
this.renderSelectedItem();
|
||||
} else if (this.mc.player.isSpectator()) {
|
||||
this.field_175197_u.renderSelectedItem();
|
||||
this.spectatorGui.renderSelectedItem();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
protected void renderSubtitles()
|
||||
{
|
||||
if (pre(SUBTITLES)) return;
|
||||
this.field_184049_t.render();
|
||||
this.overlaySubtitle.render();
|
||||
post(SUBTITLES);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
mc.getProfiler().startSection("bossHealth");
|
||||
GlStateManager.enableBlend();
|
||||
this.field_184050_w.render();
|
||||
this.overlayBoss.render();
|
||||
GlStateManager.disableBlend();
|
||||
mc.getProfiler().endSection();
|
||||
post(BOSSHEALTH);
|
||||
@@ -346,9 +346,9 @@ public class ForgeIngameGui extends IngameGui
|
||||
{
|
||||
if (pre(HOTBAR)) return;
|
||||
|
||||
if (mc.field_71442_b.getCurrentGameType() == GameType.SPECTATOR)
|
||||
if (mc.playerController.getCurrentGameType() == GameType.SPECTATOR)
|
||||
{
|
||||
this.field_175197_u.renderTooltip(partialTicks);
|
||||
this.spectatorGui.renderTooltip(partialTicks);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -438,7 +438,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
if (rowHeight != 10) left_height += 10 - rowHeight;
|
||||
|
||||
int regen = -1;
|
||||
if (player.isPotionActive(Effects.field_76428_l))
|
||||
if (player.isPotionActive(Effects.REGENERATION))
|
||||
{
|
||||
regen = ticks % 25;
|
||||
}
|
||||
@@ -446,8 +446,8 @@ public class ForgeIngameGui extends IngameGui
|
||||
final int TOP = 9 * (mc.world.getWorldInfo().isHardcore() ? 5 : 0);
|
||||
final int BACKGROUND = (highlight ? 25 : 16);
|
||||
int MARGIN = 16;
|
||||
if (player.isPotionActive(Effects.field_76436_u)) MARGIN += 36;
|
||||
else if (player.isPotionActive(Effects.field_82731_v)) MARGIN += 72;
|
||||
if (player.isPotionActive(Effects.POISON)) MARGIN += 36;
|
||||
else if (player.isPotionActive(Effects.WITHER)) MARGIN += 72;
|
||||
float absorbRemaining = absorb;
|
||||
|
||||
for (int i = MathHelper.ceil((healthMax + absorb) / 2.0F) - 1; i >= 0; --i)
|
||||
@@ -520,7 +520,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
int icon = 16;
|
||||
byte background = 0;
|
||||
|
||||
if (mc.player.isPotionActive(Effects.field_76438_s))
|
||||
if (mc.player.isPotionActive(Effects.HUNGER))
|
||||
{
|
||||
icon += 36;
|
||||
background = 13;
|
||||
@@ -574,7 +574,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.disableBlend();
|
||||
|
||||
if (mc.field_71442_b.gameIsSurvivalOrAdventure())
|
||||
if (mc.playerController.gameIsSurvivalOrAdventure())
|
||||
{
|
||||
super.renderExpBar(x);
|
||||
}
|
||||
@@ -740,7 +740,7 @@ public class ForgeIngameGui extends IngameGui
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef((float) event.getPosX(), (float) event.getPosY(), 0.0F);
|
||||
field_73840_e.render(ticks);
|
||||
persistantChatGUI.render(ticks);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
post(CHAT);
|
||||
@@ -751,18 +751,18 @@ public class ForgeIngameGui extends IngameGui
|
||||
protected void renderPlayerList(int width, int height)
|
||||
{
|
||||
ScoreObjective scoreobjective = this.mc.world.getScoreboard().getObjectiveInDisplaySlot(0);
|
||||
ClientPlayNetHandler handler = mc.player.field_71174_a;
|
||||
ClientPlayNetHandler handler = mc.player.connection;
|
||||
|
||||
if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null))
|
||||
{
|
||||
this.field_175196_v.setVisible(true);
|
||||
this.overlayPlayerList.setVisible(true);
|
||||
if (pre(PLAYER_LIST)) return;
|
||||
this.field_175196_v.render(width, this.mc.world.getScoreboard(), scoreobjective);
|
||||
this.overlayPlayerList.render(width, this.mc.world.getScoreboard(), scoreobjective);
|
||||
post(PLAYER_LIST);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_175196_v.setVisible(false);
|
||||
this.overlayPlayerList.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -394,14 +394,14 @@ public final class ModelLoader extends ModelBakery
|
||||
{
|
||||
if(model.getParentLocation().getPath().equals("builtin/generated"))
|
||||
{
|
||||
model.field_178315_d = field_177606_o;
|
||||
model.parent = MODEL_GENERATED;
|
||||
}
|
||||
else
|
||||
{
|
||||
IUnbakedModel parent = ModelLoaderRegistry.getModelOrLogError(model.getParentLocation(), "Could not load vanilla model parent '" + model.getParentLocation() + "' for '" + model);
|
||||
if(parent instanceof VanillaModelWrapper)
|
||||
{
|
||||
model.field_178315_d = ((VanillaModelWrapper) parent).model;
|
||||
model.parent = ((VanillaModelWrapper) parent).model;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -412,7 +412,7 @@ public final class ModelLoader extends ModelBakery
|
||||
|
||||
ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();
|
||||
|
||||
if(model == ModelBakery.field_177606_o)
|
||||
if(model == ModelBakery.MODEL_GENERATED)
|
||||
{
|
||||
for(String s : ItemModelGenerator.LAYERS)
|
||||
{
|
||||
@@ -463,12 +463,12 @@ public final class ModelLoader extends ModelBakery
|
||||
tMap.putAll(PerspectiveMapWrapper.getTransforms(state));
|
||||
IModelState perState = new SimpleModelState(ImmutableMap.copyOf(tMap), state.apply(Optional.empty()));
|
||||
|
||||
if(model == ModelBakery.field_177606_o)
|
||||
if(model == ModelBakery.MODEL_GENERATED)
|
||||
{
|
||||
return new ItemLayerModel(bakery, model, format).bake(bakery, bakedTextureGetter, new BasicState(perState, uvlock), format);
|
||||
}
|
||||
TextureAtlasSprite textureatlassprite = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName("particle")));
|
||||
if(model == ModelBakery.field_177616_r) return new BuiltInModel(transforms, model.getOverrides(bakery, model, bakedTextureGetter, format), textureatlassprite);
|
||||
if(model == ModelBakery.MODEL_ENTITY) return new BuiltInModel(transforms, model.getOverrides(bakery, model, bakedTextureGetter, format), textureatlassprite);
|
||||
return bakeNormal(bakery, model, perState, state, newTransforms, format, bakedTextureGetter, uvlock);
|
||||
}
|
||||
|
||||
@@ -496,13 +496,13 @@ public final class ModelLoader extends ModelBakery
|
||||
{
|
||||
TextureAtlasSprite textureatlassprite1 = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName(e.getValue().texture)));
|
||||
|
||||
if (e.getValue().field_178244_b == null || !TRSRTransformation.isInteger(transformation.getMatrixVec()))
|
||||
if (e.getValue().cullFace == null || !TRSRTransformation.isInteger(transformation.getMatrixVec()))
|
||||
{
|
||||
builder.addGeneralQuad(BlockModel.makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), new BasicState(transformation, uvLocked)));
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.addFaceQuad(baseState.rotate(e.getValue().field_178244_b), BlockModel.makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), new BasicState(transformation, uvLocked)));
|
||||
builder.addFaceQuad(baseState.rotate(e.getValue().cullFace), BlockModel.makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), new BasicState(transformation, uvLocked)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -546,7 +546,7 @@ public final class ModelLoader extends ModelBakery
|
||||
Maps.newHashMap(this.model.textures), this.model.isAmbientOcclusion(), this.model.isGui3d(), //New Textures man VERY IMPORTANT
|
||||
model.getAllTransforms(), Lists.newArrayList(model.getOverrides()));
|
||||
newModel.name = this.model.name;
|
||||
newModel.field_178315_d = this.model.field_178315_d;
|
||||
newModel.parent = this.model.parent;
|
||||
|
||||
Set<String> removed = Sets.newHashSet();
|
||||
|
||||
@@ -603,7 +603,7 @@ public final class ModelLoader extends ModelBakery
|
||||
return this;
|
||||
}
|
||||
BlockModel newModel = new BlockModel(model.getParentLocation(), model.getElements(), model.textures, value, model.isGui3d(), model.getAllTransforms(), Lists.newArrayList(model.getOverrides()));
|
||||
newModel.field_178315_d = model.field_178315_d;
|
||||
newModel.parent = model.parent;
|
||||
newModel.name = model.name;
|
||||
return new VanillaModelWrapper(location, newModel, uvlock, animation);
|
||||
}
|
||||
@@ -616,7 +616,7 @@ public final class ModelLoader extends ModelBakery
|
||||
return this;
|
||||
}
|
||||
BlockModel newModel = new BlockModel(model.getParentLocation(), model.getElements(), model.textures, model.ambientOcclusion, value, model.getAllTransforms(), Lists.newArrayList(model.getOverrides()));
|
||||
newModel.field_178315_d = model.field_178315_d;
|
||||
newModel.parent = model.parent;
|
||||
newModel.name = model.name;
|
||||
return new VanillaModelWrapper(location, newModel, uvlock, animation);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ModelLoaderRegistry
|
||||
public static void registerLoader(ICustomModelLoader loader)
|
||||
{
|
||||
loaders.add(loader);
|
||||
((IReloadableResourceManager) Minecraft.getInstance().getResourceManager()).func_219534_a(loader);
|
||||
((IReloadableResourceManager) Minecraft.getInstance().getResourceManager()).addReloadListener(loader);
|
||||
}
|
||||
|
||||
public static boolean loaded(ResourceLocation location)
|
||||
|
||||
@@ -61,7 +61,7 @@ public class BlockInfo
|
||||
{
|
||||
if(cachedTint == tint) return cachedMultiplier;
|
||||
cachedTint = tint;
|
||||
cachedMultiplier = colors.func_216860_a(state, world, blockPos, tint);
|
||||
cachedMultiplier = colors.getColor(state, world, blockPos, tint);
|
||||
return cachedMultiplier;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public enum KeyConflictContext implements IKeyConflictContext
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
return Minecraft.getInstance().field_71462_r != null;
|
||||
return Minecraft.getInstance().currentScreen != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user