Skip to content

Commit 50dc6e4

Browse files
author
Michael Hillcox
committed
Merged branch 1.11.x into master
2 parents 599ae63 + 5a7e160 commit 50dc6e4

17 files changed

Lines changed: 81 additions & 82 deletions
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package com.fgtXray;
1+
package com.fgtxray;
22

33
import java.util.ArrayList;
44
import java.util.HashMap;
55
import java.util.List;
66
import java.util.Map;
77

8-
import com.fgtXray.proxy.ServerProxy;
8+
import com.fgtxray.proxy.ServerProxy;
9+
import com.fgtxray.reference.Ref;
910
import org.lwjgl.input.Keyboard;
1011

1112
import net.minecraft.client.settings.KeyBinding;
@@ -20,11 +21,11 @@
2021
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
2122
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
2223

23-
import com.fgtXray.reference.OreInfo;
24-
import com.fgtXray.config.DefaultConfig;
25-
import com.fgtXray.config.ConfigHandler;
24+
import com.fgtxray.reference.OreInfo;
25+
import com.fgtxray.config.DefaultConfig;
26+
import com.fgtxray.config.ConfigHandler;
2627

27-
@Mod(modid="fgtxray", name="Fgt X-Ray", version="1.1.0")
28+
@Mod(modid= Ref.MOD_ID, name="Fgt X-Ray", version="1.1.0")
2829
public class FgtXRay
2930
{
3031
public static int localPlyX, localPlyY, localPlyZ, localPlyXPrev, localPlyZPrev; // For internal use in the ClientTick thread.
@@ -58,7 +59,7 @@ public class FgtXRay
5859

5960
public static Configuration config = null;
6061

61-
public static Map<String, OreInfo> oredictOres = new HashMap<String, OreInfo>();
62+
public static Map<String, OreInfo> oredictOres = new HashMap<>();
6263
/* Ores to check through the ore dictionary and add each instance found to the searchList.
6364
* put( "oreType", new OreInfo(...) ) oreType is the ore dictionary string id. Press Print OreDict and check console to see list.
6465
* OreInfo( String "Gui Name", // The name to be displayed in the GUI.
@@ -68,7 +69,7 @@ public class FgtXRay
6869
* Open DefaultConfig.java for more info.
6970
*/
7071

71-
public static List<OreInfo> customOres = new ArrayList<OreInfo>();
72+
public static List<OreInfo> customOres = new ArrayList<>();
7273
/* List of custom id:meta to add.
7374
* OreInfo( String "Gui Name", // Displayed in the GUI.
7475
* int id, int meta, // Set these to whatever the id:meta is for your block.
@@ -77,11 +78,11 @@ public class FgtXRay
7778
*/
7879

7980
// The instance of your mod that Forge uses.
80-
@Instance(value = "FgtXray")
81+
@Instance(Ref.MOD_ID)
8182
public static FgtXRay instance;
8283

8384
// Says where the client and server 'proxy' code is loaded.
84-
@SidedProxy(clientSide="com.fgtXray.proxy.ClientProxy", serverSide="com.fgtXray.proxy.ServerProxy")
85+
@SidedProxy(clientSide="com.fgtxray.proxy.ClientProxy", serverSide="com.fgtxray.proxy.ServerProxy")
8586
public static ServerProxy proxy;
8687

8788
@EventHandler
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Use by GuiSettings. There is a hashmap of the "OreName" and this
22

3-
package com.fgtXray;
3+
package com.fgtxray;
44

5-
import com.fgtXray.reference.OreInfo;
5+
import com.fgtxray.reference.OreInfo;
66

77
import java.util.ArrayList;
88

src/main/java/com/fgtXray/client/ClientTick.java renamed to src/main/java/com/fgtxray/client/ClientTick.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fgtXray.client;
1+
package com.fgtxray.client;
22

33
import java.util.ArrayList;
44
import java.util.List;
@@ -11,9 +11,9 @@
1111

1212
import net.minecraft.block.Block;
1313
import net.minecraft.client.Minecraft;
14-
import com.fgtXray.reference.BlockInfo;
15-
import com.fgtXray.FgtXRay;
16-
import com.fgtXray.reference.OreInfo;
14+
import com.fgtxray.reference.BlockInfo;
15+
import com.fgtxray.FgtXRay;
16+
import com.fgtxray.reference.OreInfo;
1717

1818
public class ClientTick implements Runnable
1919
{
@@ -25,16 +25,16 @@ public class ClientTick implements Runnable
2525
@SubscribeEvent
2626
public void tickEnd( TickEvent.ClientTickEvent event )
2727
{
28-
if ( (event.phase == TickEvent.Phase.END) && (mc.thePlayer != null) )
28+
if ( (event.phase == TickEvent.Phase.END) && (mc.player != null) )
2929
{
30-
FgtXRay.localPlyX = MathHelper.floor_double( mc.thePlayer.posX );
31-
FgtXRay.localPlyY = MathHelper.floor_double( mc.thePlayer.posY );
32-
FgtXRay.localPlyZ = MathHelper.floor_double( mc.thePlayer.posZ );
33-
FgtXRay.localPlyXPrev = MathHelper.floor_double( mc.thePlayer.prevPosX );
34-
FgtXRay.localPlyZPrev = MathHelper.floor_double( mc.thePlayer.prevPosZ );
30+
FgtXRay.localPlyX = MathHelper.floor( mc.player.posX );
31+
FgtXRay.localPlyY = MathHelper.floor( mc.player.posY );
32+
FgtXRay.localPlyZ = MathHelper.floor( mc.player.posZ );
33+
FgtXRay.localPlyXPrev = MathHelper.floor( mc.player.prevPosX );
34+
FgtXRay.localPlyZPrev = MathHelper.floor( mc.player.prevPosZ );
3535

3636
if( FgtXRay.drawOres && ((this.thread == null) || !this.thread.isAlive()) &&
37-
( (mc.theWorld != null) && (mc.thePlayer != null) ) ) // If we're in a world and want to start drawing create the thread.
37+
( (mc.world != null) && (mc.player != null) ) ) // If we're in a world and want to start drawing create the thread.
3838
{
3939
this.thread = new Thread( this );
4040
this.thread.setDaemon( false );
@@ -52,7 +52,7 @@ public void run() // Our thread code for finding ores near the player.
5252
{
5353
while( !this.thread.isInterrupted() ) // Check the internal interrupt flag. Exit thread if set.
5454
{
55-
if ( FgtXRay.drawOres && !OresSearch.searchList.isEmpty() && (mc != null) && (mc.theWorld != null) && (mc.thePlayer != null) )
55+
if ( FgtXRay.drawOres && !OresSearch.searchList.isEmpty() && (mc != null) && (mc.world != null) && (mc.player != null) )
5656
{
5757
if ( nextTimeMs > System.currentTimeMillis() ) // Delay to avoid spamming ore updates.
5858
continue;
@@ -73,7 +73,7 @@ public void run() // Our thread code for finding ores near the player.
7373
for (int z = pz - radius; z < pz + radius; z++) // z axis.
7474
{
7575
BlockPos xyz = new BlockPos(x, y, z);
76-
IBlockState state = mc.theWorld.getBlockState( xyz );
76+
IBlockState state = mc.world.getBlockState( xyz );
7777

7878
int id = Block.getIdFromBlock( state.getBlock() );
7979
int meta = state.getBlock().getMetaFromState(state);

src/main/java/com/fgtXray/client/KeyBindingHandler.java renamed to src/main/java/com/fgtxray/client/KeyBindingHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package com.fgtXray.client;
1+
package com.fgtxray.client;
22

33
import net.minecraftforge.fml.client.FMLClientHandler;
44
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
55
import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;
66

77
import net.minecraft.client.Minecraft;
88
import net.minecraft.client.gui.GuiChat;
9-
import com.fgtXray.FgtXRay;
10-
import com.fgtXray.client.gui.GuiSettings;
9+
import com.fgtxray.FgtXRay;
10+
import com.fgtxray.client.gui.GuiSettings;
1111

1212
public class KeyBindingHandler
1313
{
@@ -16,7 +16,7 @@ public class KeyBindingHandler
1616
@SubscribeEvent
1717
public void onKeyInput( KeyInputEvent event )
1818
{
19-
if( (!FMLClientHandler.instance().isGUIOpen( GuiChat.class )) && (mc.currentScreen == null) && (mc.theWorld != null) )
19+
if( (!FMLClientHandler.instance().isGUIOpen( GuiChat.class )) && (mc.currentScreen == null) && (mc.world != null) )
2020
{
2121
if (OresSearch.searchList.isEmpty()) // Populate the OresSearch.searchList
2222
{

src/main/java/com/fgtXray/client/OresSearch.java renamed to src/main/java/com/fgtxray/client/OresSearch.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
package com.fgtXray.client;
1+
package com.fgtxray.client;
22

33
import java.util.ArrayList;
44
import java.util.HashMap;
55
import java.util.List;
66
import java.util.Map;
77

8-
import com.fgtXray.config.ConfigHandler;
8+
import com.fgtxray.config.ConfigHandler;
99
import net.minecraft.client.Minecraft;
1010
import net.minecraft.item.Item;
1111
import net.minecraft.item.ItemStack;
1212

1313
import net.minecraft.util.text.TextComponentString;
1414
import net.minecraftforge.oredict.OreDictionary;
1515

16-
import com.fgtXray.FgtXRay;
17-
import com.fgtXray.reference.OreInfo;
16+
import com.fgtxray.FgtXRay;
17+
import com.fgtxray.reference.OreInfo;
1818

1919
public class OresSearch
2020
{

src/main/java/com/fgtXray/client/RenderTick.java renamed to src/main/java/com/fgtxray/client/RenderTick.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fgtXray.client;
1+
package com.fgtxray.client;
22

33
/* Props goto CJB for the render functions and maths.
44
* http://twitter.com/CJBMods
@@ -9,15 +9,13 @@
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;
1413
import net.minecraft.client.renderer.VertexBuffer;
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;
19-
import com.fgtXray.reference.BlockInfo;
20-
import com.fgtXray.FgtXRay;
17+
import com.fgtxray.reference.BlockInfo;
18+
import com.fgtxray.FgtXRay;
2119

2220
import org.lwjgl.opengl.GL11;
2321

@@ -29,15 +27,15 @@ public class RenderTick
2927
@SubscribeEvent
3028
public void onWorldRenderLast( RenderWorldLastEvent event ) // Called when drawing the world.
3129
{
32-
if ( mc.theWorld != null && FgtXRay.drawOres )
30+
if ( mc.world != null && FgtXRay.drawOres )
3331
{
3432
float f = event.getPartialTicks();
35-
float px = (float)mc.thePlayer.posX;
36-
float py = (float)mc.thePlayer.posY;
37-
float pz = (float)mc.thePlayer.posZ;
38-
float mx = (float)mc.thePlayer.prevPosX;
39-
float my = (float)mc.thePlayer.prevPosY;
40-
float mz = (float)mc.thePlayer.prevPosZ;
33+
float px = (float)mc.player.posX;
34+
float py = (float)mc.player.posY;
35+
float pz = (float)mc.player.posZ;
36+
float mx = (float)mc.player.prevPosX;
37+
float my = (float)mc.player.prevPosY;
38+
float mz = (float)mc.player.prevPosZ;
4139
float dx = mx + ( px - mx ) * f;
4240
float dy = my + ( py - my ) * f;
4341
float dz = mz + ( pz - mz ) * f;

src/main/java/com/fgtXray/client/gui/GuiEditOre.java renamed to src/main/java/com/fgtxray/client/gui/GuiEditOre.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fgtXray.client.gui;
1+
package com.fgtxray.client.gui;
22

33
import net.minecraft.client.gui.GuiButton;
44
import net.minecraft.client.gui.GuiScreen;
@@ -29,7 +29,7 @@ public void actionPerformed( GuiButton button ) // Called on left click of GuiBu
2929
break;
3030

3131
case 99: // Cancel
32-
mc.thePlayer.closeScreen();
32+
mc.player.closeScreen();
3333
break;
3434

3535
default:
@@ -52,7 +52,7 @@ protected void keyTyped( char par1, int par2 )
5252
}
5353
else if( par2 == 1 ) // Close on esc
5454
{
55-
mc.thePlayer.closeScreen();
55+
mc.player.closeScreen();
5656
}
5757
}
5858

src/main/java/com/fgtXray/client/gui/GuiNewOre.java renamed to src/main/java/com/fgtxray/client/gui/GuiNewOre.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package com.fgtXray.client.gui;
1+
package com.fgtxray.client.gui;
22

3-
import com.fgtXray.client.OresSearch;
3+
import com.fgtxray.client.OresSearch;
4+
import com.fgtxray.reference.Ref;
45
import net.minecraft.client.gui.*;
56
import net.minecraft.client.renderer.GlStateManager;
67
import net.minecraft.client.renderer.Tessellator;
78
import net.minecraft.client.renderer.VertexBuffer;
89
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
910
import net.minecraft.util.ResourceLocation;
10-
import org.lwjgl.opengl.GL11;
1111

1212
import java.io.IOException;
1313

@@ -76,12 +76,12 @@ public void actionPerformed( GuiButton button ) // Called on left click of GuiBu
7676

7777
OresSearch.add(oreIdent.getText(), oreName.getText(), rgb);
7878

79-
mc.thePlayer.closeScreen();
79+
mc.player.closeScreen();
8080
mc.displayGuiScreen( new GuiSettings() );
8181
break;
8282

8383
case 99: // Cancel
84-
mc.thePlayer.closeScreen();
84+
mc.player.closeScreen();
8585
mc.displayGuiScreen( new GuiSettings() );
8686
break;
8787

@@ -135,7 +135,7 @@ else if( oreIdent.isFocused() )
135135
break;
136136
case 1: // Exit on escape
137137
mc.displayGuiScreen( new GuiSettings() );
138-
mc.thePlayer.closeScreen();
138+
mc.player.closeScreen();
139139
default:
140140
break;
141141
}
@@ -159,7 +159,7 @@ public void updateScreen()
159159
public void drawScreen( int x, int y, float f )
160160
{
161161
drawDefaultBackground();
162-
mc.renderEngine.bindTexture( new ResourceLocation("fgtxray:textures/gui/oreAddBackground.png") );
162+
mc.renderEngine.bindTexture( new ResourceLocation(Ref.PREFIX_GUI+"addorebg.png") );
163163
drawTexturedModalRect(width / 2 - 125, height / 2 - 95, 0, 0, 256, 205);
164164

165165
FontRenderer fr = this.mc.fontRendererObj;

src/main/java/com/fgtXray/client/gui/GuiPage.java renamed to src/main/java/com/fgtxray/client/gui/GuiPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fgtXray.client.gui;
1+
package com.fgtxray.client.gui;
22

33
import net.minecraft.client.gui.GuiButton;
44

src/main/java/com/fgtXray/client/gui/GuiSettings.java renamed to src/main/java/com/fgtxray/client/gui/GuiSettings.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
package com.fgtXray.client.gui;
1+
package com.fgtxray.client.gui;
22

33
import java.io.IOException;
44
import java.util.*;
5-
import com.fgtXray.FgtXRay;
6-
import com.fgtXray.OreButtons;
7-
import com.fgtXray.client.OresSearch;
8-
import com.fgtXray.config.ConfigHandler;
9-
import com.fgtXray.reference.OreInfo;
5+
import com.fgtxray.FgtXRay;
6+
import com.fgtxray.OreButtons;
7+
import com.fgtxray.client.OresSearch;
8+
import com.fgtxray.config.ConfigHandler;
9+
import com.fgtxray.reference.OreInfo;
10+
import com.fgtxray.reference.Ref;
1011
import net.minecraft.client.renderer.Tessellator;
1112
import net.minecraft.client.renderer.VertexBuffer;
1213
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
1314
import net.minecraft.client.gui.GuiButton;
1415
import net.minecraft.client.gui.GuiScreen;
15-
import net.minecraft.init.SoundEvents;
1616
import net.minecraft.item.Item;
1717
import net.minecraft.item.ItemStack;
1818

@@ -172,7 +172,7 @@ public void actionPerformed( GuiButton button )
172172
break;
173173

174174
case 97: // New Ore button
175-
mc.thePlayer.closeScreen();
175+
mc.player.closeScreen();
176176
mc.displayGuiScreen( new GuiNewOre() );
177177
break;
178178

@@ -232,7 +232,7 @@ protected void keyTyped( char par1, int par2 )
232232
if( (par2 == 1) || (par2 == mc.gameSettings.keyBindInventory.getKeyCode()) || par2 == FgtXRay.keyBind_keys[ FgtXRay.keyIndex_showXrayMenu ].getKeyCode() )
233233
{
234234
// Close on esc, inventory key or keybind
235-
mc.thePlayer.closeScreen();
235+
mc.player.closeScreen();
236236
}
237237
}
238238

@@ -259,7 +259,7 @@ private static void drawTexturedQuadFit(double x, double y, double width, double
259259
public void drawScreen( int x, int y, float f )
260260
{
261261
drawDefaultBackground();
262-
mc.renderEngine.bindTexture( new ResourceLocation("fgtxray:textures/gui/Background.png") );
262+
mc.renderEngine.bindTexture( new ResourceLocation(Ref.PREFIX_GUI+"bg.png") );
263263
drawTexturedQuadFit(width / 2 - 110, height / 2 - 110, 229, 193, 0);
264264

265265
super.drawScreen(x, y, f);

0 commit comments

Comments
 (0)