Skip to content

Commit a780300

Browse files
author
Michael Hillcox
committed
Initial 1.8.9 stable versions
1 parent fa1d6a7 commit a780300

9 files changed

Lines changed: 37 additions & 42 deletions

File tree

build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// For those who want the bleeding edge
12
buildscript {
23
repositories {
34
jcenter()
@@ -8,28 +9,27 @@ buildscript {
89
}
910
}
1011
apply plugin: 'net.minecraftforge.gradle.forge'
11-
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.
12-
1312

13+
/*
14+
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
15+
plugins {
16+
id "net.minecraftforge.gradle.forge" version "2.0.2"
17+
}
18+
*/
1419
version = "1.1.0.1"
1520
group= "com.fgtxray.fgtxray" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
16-
archivesBaseName = "fgtxray-1.10.2"
17-
18-
sourceCompatibility = targetCompatibility = "1.6" // Need this here so eclipse task generates correctly.
19-
compileJava {
20-
sourceCompatibility = targetCompatibility = "1.6"
21-
}
21+
archivesBaseName = "fgtxray-1.8.9"
2222

2323
minecraft {
24-
version = "1.10.2-12.18.3.2185"
24+
version = "1.8.9-11.15.1.1722"
2525
runDir = "run"
2626

2727
// the mappings can be changed at any time, and must be in the following format.
2828
// snapshot_YYYYMMDD snapshot are built nightly.
2929
// stable_# stables are built at the discretion of the MCP team.
3030
// Use non-default mappings at your own risk. they may not allways work.
3131
// simply re-run your setup task after changing the mappings to update your workspace.
32-
mappings = "snapshot_20161111"
32+
mappings = "stable_20"
3333
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
3434
}
3535

src/main/java/com/fgtXray/client/ClientTick.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import java.util.List;
55

66
import net.minecraft.block.state.IBlockState;
7-
import net.minecraft.util.math.BlockPos;
8-
import net.minecraft.util.math.MathHelper;
7+
import net.minecraft.util.BlockPos;
8+
import net.minecraft.util.MathHelper;
99
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
1010
import net.minecraftforge.fml.common.gameevent.TickEvent;
1111

src/main/java/com/fgtXray/client/OresSearch.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import net.minecraft.item.Item;
1111
import net.minecraft.item.ItemStack;
1212

13-
import net.minecraft.util.text.TextComponentString;
13+
import net.minecraft.util.ChatComponentText;
1414
import net.minecraftforge.oredict.OreDictionary;
1515

1616
import com.fgtXray.FgtXRay;
@@ -47,7 +47,7 @@ public static void add( String oreIdent, String name, int[] color ) // Takes a s
4747
{
4848
//System.out.println( String.format( "Can't add %s to searchList. Invalid format.", oreIdent ) );
4949
String notify = String.format( "[�aFgt XRay�r] %s is not a valid identifier. Try id:meta (example 1:0 for stone) or oreName (example oreDiamond or mossyStone)", oreIdent );
50-
mc.ingameGUI.getChatGUI().printChatMessage( new TextComponentString(notify));
50+
mc.ingameGUI.getChatGUI().printChatMessage( new ChatComponentText(notify));
5151
return;
5252
}
5353

@@ -60,7 +60,7 @@ public static void add( String oreIdent, String name, int[] color ) // Takes a s
6060
{ // TODO: Some oredict ores are mod:block for some reason...
6161
//System.out.println( String.format( "%s is not a valid id:meta format.", oreIdent ) );
6262
String notify = String.format( "[�aFgt XRay�r] %s contains data other than numbers and the colon. Failed to add.", oreIdent );
63-
mc.ingameGUI.getChatGUI().printChatMessage( new TextComponentString(notify) );
63+
mc.ingameGUI.getChatGUI().printChatMessage( new ChatComponentText(notify) );
6464
return;
6565
}
6666

@@ -75,15 +75,15 @@ public static void add( String oreIdent, String name, int[] color ) // Takes a s
7575
catch( NumberFormatException e )
7676
{
7777
String notify = String.format( "[�aFgt XRay�r] Doesn't support in-game additions to the ore dictionary yet.. Failed to add." );
78-
mc.ingameGUI.getChatGUI().printChatMessage( new TextComponentString(notify) );
78+
mc.ingameGUI.getChatGUI().printChatMessage( new ChatComponentText(notify) );
7979
return;
8080
}
8181

8282
}
8383
//System.out.println( String.format( "Adding ore: %s", oreIdent ) );
8484
OresSearch.searchList.add( new OreInfo( name, id, meta, color, true ) );
8585
String notify = String.format( "[�aFgt XRay�r] successfully added %s.", oreIdent );
86-
mc.ingameGUI.getChatGUI().printChatMessage(new TextComponentString(notify));
86+
mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(notify));
8787

8888
ConfigHandler.add(name, oreIdent, color);
8989
}

src/main/java/com/fgtXray/client/RenderTick.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
import java.util.List;
1010

1111
import net.minecraft.client.Minecraft;
12-
import net.minecraft.client.renderer.BlockRendererDispatcher;
1312
import net.minecraft.client.renderer.Tessellator;
14-
import net.minecraft.client.renderer.VertexBuffer;
13+
import net.minecraft.client.renderer.WorldRenderer;
1514
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
16-
import net.minecraft.world.World;
1715
import net.minecraftforge.client.event.RenderWorldLastEvent;
1816
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
1917
import com.fgtXray.reference.BlockInfo;
@@ -31,7 +29,7 @@ public void onWorldRenderLast( RenderWorldLastEvent event ) // Called when drawi
3129
{
3230
if ( mc.theWorld != null && FgtXRay.drawOres )
3331
{
34-
float f = event.getPartialTicks();
32+
float f = event.partialTicks;
3533
float px = (float)mc.thePlayer.posX;
3634
float py = (float)mc.thePlayer.posY;
3735
float pz = (float)mc.thePlayer.posZ;
@@ -41,7 +39,8 @@ public void onWorldRenderLast( RenderWorldLastEvent event ) // Called when drawi
4139
float dx = mx + ( px - mx ) * f;
4240
float dy = my + ( py - my ) * f;
4341
float dz = mz + ( pz - mz ) * f;
44-
drawOres( dx, dy, dz ); // this is a world pos of the player
42+
43+
drawOres( dx, dy, dz );
4544
}
4645
}
4746

@@ -57,10 +56,9 @@ private void drawOres( float px, float py, float pz )
5756
GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
5857
GL11.glLineWidth( 1f );
5958

60-
Tessellator tessellator = Tessellator.getInstance();
61-
VertexBuffer vertexBuffer = tessellator.getBuffer();
62-
63-
List<BlockInfo> temp = new ArrayList();
59+
Tessellator tes = Tessellator.getInstance();
60+
WorldRenderer vertexBuffer = Tessellator.getInstance().getWorldRenderer();
61+
List<BlockInfo> temp = new ArrayList<BlockInfo>();
6462
temp.addAll(this.ores); // If we dont make a copy then the thread in ClientTick will ConcurrentModificationException.
6563

6664
for ( BlockInfo b : temp )
@@ -101,7 +99,7 @@ private void drawOres( float px, float py, float pz )
10199
vertexBuffer.pos(bx-px + f, by-py + f, bz-pz + f).color(red, green, blue, 255).endVertex();
102100
vertexBuffer.pos(bx-px + f, by-py + f1, bz-pz + f).color(red, green, blue, 255).endVertex();
103101

104-
tessellator.draw();
102+
tes.draw();
105103
}
106104

107105
GL11.glDepthMask(true);

src/main/java/com/fgtXray/client/gui/GuiNewOre.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
import net.minecraft.client.gui.*;
55
import net.minecraft.client.renderer.GlStateManager;
66
import net.minecraft.client.renderer.Tessellator;
7-
import net.minecraft.client.renderer.VertexBuffer;
7+
import net.minecraft.client.renderer.WorldRenderer;
88
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
99
import net.minecraft.util.ResourceLocation;
10-
import org.lwjgl.opengl.GL11;
11-
1210
import java.io.IOException;
1311

1412
public class GuiNewOre extends GuiScreen {
@@ -168,11 +166,12 @@ public void drawScreen( int x, int y, float f )
168166
oreName.drawTextBox();
169167
oreIdent.drawTextBox();
170168

169+
171170
Tessellator tessellator = Tessellator.getInstance();
172-
VertexBuffer vertexbuffer = tessellator.getBuffer();
171+
WorldRenderer vertexbuffer = tessellator.getWorldRenderer();
173172
GlStateManager.enableBlend();
174173
GlStateManager.disableTexture2D();
175-
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
174+
//GlStateManager.tryBlendFuncSeparate(GlStateManager., GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
176175
GlStateManager.color(redSlider.sliderValue, greenSlider.sliderValue, blueSlider.sliderValue, 1);
177176
vertexbuffer.begin(7, DefaultVertexFormats.POSITION);
178177
vertexbuffer.pos(width / 2 + 46, height / 2 - 63, 0.0D).endVertex();

src/main/java/com/fgtXray/client/gui/GuiSettings.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
import com.fgtXray.config.ConfigHandler;
99
import com.fgtXray.reference.OreInfo;
1010
import net.minecraft.client.renderer.Tessellator;
11-
import net.minecraft.client.renderer.VertexBuffer;
11+
import net.minecraft.client.renderer.WorldRenderer;
1212
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
1313
import net.minecraft.client.gui.GuiButton;
1414
import net.minecraft.client.gui.GuiScreen;
15-
import net.minecraft.init.SoundEvents;
1615
import net.minecraft.item.Item;
1716
import net.minecraft.item.ItemStack;
18-
1917
import net.minecraft.util.ResourceLocation;
2018
import net.minecraftforge.oredict.OreDictionary;
2119

@@ -246,7 +244,7 @@ public boolean doesGuiPauseGame()
246244
// this removes the stupid power of 2 rule that comes with minecraft.
247245
private static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel)
248246
{
249-
VertexBuffer tessellate = Tessellator.getInstance().getBuffer();
247+
WorldRenderer tessellate = Tessellator.getInstance().getWorldRenderer();
250248
tessellate.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
251249
tessellate.pos(x + 0, y + height, zLevel).tex( 0,1).endVertex();
252250
tessellate.pos(x + width, y + height, zLevel).tex( 1, 1).endVertex();

src/main/java/com/fgtXray/config/ConfigHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.fgtXray.config;
22

33
import net.minecraft.client.Minecraft;
4-
import net.minecraft.util.text.TextComponentString;
4+
import net.minecraft.util.ChatComponentText;
55
import net.minecraftforge.common.config.ConfigCategory;
66
import net.minecraftforge.common.config.Configuration;
77
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@@ -62,7 +62,7 @@ public static void add( String oreName, String ore, int[] color )
6262
if( config.get("customores."+formattedname, "name", "").getString() == formattedname )
6363
{
6464
String notify = String.format( "[Fgt XRay] %s already exists. Please enter a different name. ", oreName );
65-
mc.ingameGUI.getChatGUI().printChatMessage( new TextComponentString(notify));
65+
mc.ingameGUI.getChatGUI().printChatMessage( new ChatComponentText(notify));
6666
return;
6767
}
6868
}

src/main/java/com/fgtXray/config/DefaultConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public class DefaultConfig {
3939
// Default block to add. Mostly just so people can add custom blocks manually through the config until I setup a gui for it.
4040
final static List<OreInfo> custom = new ArrayList<OreInfo>()
4141
{{
42-
add( new OreInfo("Redstone Wire", Block.getIdFromBlock( Blocks.REDSTONE_WIRE ), 0, new int[]{255, 0, 0}, false) );
43-
add( new OreInfo("Chest", Block.getIdFromBlock( Blocks.CHEST ), 0, new int[]{255, 0, 255}, true) );
42+
add( new OreInfo("Redstone Wire", Block.getIdFromBlock( Blocks.redstone_wire ), 0, new int[]{255, 0, 0}, false) );
43+
add( new OreInfo("Chest", Block.getIdFromBlock( Blocks.chest ), 0, new int[]{255, 0, 255}, true) );
4444
}};
4545

4646

src/main/resources/mcmod.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"name": "Fgt X-Ray",
55
"description": "An advanced XRay mod for Minecraft.",
66
"version": "1.1.0",
7-
"mcversion": "1.10.2",
7+
"mcversion": "1.8.9",
88
"url": "https://github.com/michaelhillcox/XRay-Mod",
99
"updateJSON": "https://raw.githubusercontent.com/MichaelHillcox/XRay-Mod/master/versions.json",
1010
"authorList": ["mcd1992, AoKMiKeY"],
11-
"credits": "Contributors: AoKMiKeY, uaBArt",
11+
"credits": "Contributors: AoKMiKeY",
1212
"logoFile": "",
1313
"screenshots": [],
1414
"dependencies": []

0 commit comments

Comments
 (0)