Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit fb04763

Browse files
committed
Update to 1.7.2
Add language file for the key description
1 parent 15df452 commit fb04763

File tree

156 files changed

+242
-7822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+242
-7822
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ ShoulderSurfing
33

44
Mod for Minecraft that changes the F5 third-person camera into an over-the-shoulder view
55

6-
This source code is provided _as-is_ and is _no longer maintained by me_.
7-
86
Nearly all the source is dependent on the Forge API.
97

8+
Change
9+
========
10+
11+
*Update to 1.7.2 by LaysDragon
12+
*Add language file for the key description
13+
14+
1015
Features
1116
========
1217

@@ -20,7 +25,7 @@ Download
2025
========
2126
Required: Forge universal files for your minecraft version (http://files.minecraftforge.net/)
2227
The Forge files go into your minecraft jar.
23-
Tested with Forge 9.10.0.828
28+
Tested with Forge 10.12.2.1121
2429

2530
Compatibility
2631
=============
@@ -36,6 +41,3 @@ Open the zip file
3641

3742
The JAR file needs to go into the MODS folder under Minecraft. Make sure to remove any previous versions from the COREMODS and MODS folder. This mod will not work if placed anywhere but the MODS folder!
3843

39-
Issues
40-
======
41-
* Prevent camera from clipping into walls in tight spaces (fix behind-head raytrace)

src/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
buildscript {
2+
repositories
3+
{
4+
mavenCentral()
5+
maven {
6+
name = "forge"
7+
url = "http://files.minecraftforge.net/maven"
8+
}
9+
maven {
10+
name = "sonatype"
11+
url = "https://oss.sonatype.org/content/repositories/snapshots/"
12+
}
13+
}
14+
dependencies
15+
{
16+
classpath "net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT"
17+
}
18+
}
19+
20+
apply plugin: "forge"
21+
jar {
22+
manifest {
23+
attributes 'FMLCorePlugin': 'com.teamderpy.shouldersurfing.asm.ShoulderPlugin'
24+
attributes 'FMLCorePluginContainsFMLMod': 'true'
25+
26+
}
27+
}
28+
sourceSets
29+
{
30+
main
31+
{
32+
java { srcDirs = ["$projectDir/java"] }
33+
resources { srcDirs = ["$projectDir/resources"] }
34+
}
35+
}
36+
37+
archivesBaseName = "shouldersurfing"
38+
version = "1.7.2"
39+
minecraft.version = "1.7.2-10.12.2.1121"
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
import net.minecraftforge.client.GuiIngameForge;
1111
import net.minecraftforge.client.event.RenderGameOverlayEvent;
1212
import net.minecraftforge.client.event.RenderPlayerEvent;
13-
import net.minecraftforge.event.ForgeSubscribe;
1413
import net.minecraftforge.event.entity.item.ItemTossEvent;
1514

1615
import com.google.common.eventbus.Subscribe;
1716
import com.teamderpy.shouldersurfing.asm.InjectionDelegation;
1817
import com.teamderpy.shouldersurfing.renderer.ShoulderRenderBin;
1918

19+
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
20+
2021
/**
2122
* @author Joshua Powers <[email protected]>
2223
* @version 1.2
@@ -29,14 +30,14 @@ public class ShoulderEvents {
2930
private static float lastX = 0.0F;
3031
private static float lastY = 0.0F;
3132

32-
@ForgeSubscribe
33+
@SubscribeEvent
3334
public void postRenderCrosshairs(RenderGameOverlayEvent.Post event){
3435
if(event.type == RenderGameOverlayEvent.ElementType.CROSSHAIRS){
3536

3637
}
3738
}
3839

39-
@ForgeSubscribe
40+
@SubscribeEvent
4041
public void preRenderPlayer(RenderPlayerEvent.Pre event){
4142
if(ShoulderRenderBin.skipPlayerRender){
4243
if(event.isCancelable()){
@@ -45,7 +46,7 @@ public void preRenderPlayer(RenderPlayerEvent.Pre event){
4546
}
4647
}
4748

48-
@ForgeSubscribe
49+
@SubscribeEvent
4950
public void preRenderCrosshairs(RenderGameOverlayEvent.Pre event){
5051
if(event.type == RenderGameOverlayEvent.ElementType.CROSSHAIRS){
5152
if(!ShoulderSettings.IS_DYNAMIC_CROSSHAIR_ENABLED){
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.teamderpy.shouldersurfing;
2+
3+
import java.util.EnumSet;
4+
5+
import org.lwjgl.input.Keyboard;
6+
7+
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
8+
import cpw.mods.fml.common.gameevent.InputEvent;
9+
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
10+
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
11+
import cpw.mods.fml.relauncher.Side;
12+
13+
import com.teamderpy.shouldersurfing.ShoulderKeybindings;
14+
15+
/**
16+
* @author Joshua Powers <[email protected]>
17+
* @version 1.1
18+
* @since 2013-01-14
19+
*/
20+
public class ShoulderKeyHandler {
21+
22+
ShoulderKeyHandler(){}
23+
24+
@SubscribeEvent
25+
public void tickStart(ClientTickEvent event) {
26+
/* minecraft ought to be running and with no gui up */
27+
if((event.side==Side.CLIENT)&&(event.phase==Phase.START)){
28+
if(ShoulderLoader.mc != null && ShoulderLoader.mc.currentScreen == null){
29+
if (ShoulderLoader.mc.gameSettings.thirdPersonView == 1){
30+
if(ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_LEFT.getIsKeyPressed()){
31+
ShoulderCamera.adjustCameraLeft();
32+
}
33+
else if(ShoulderKeybindings.KEYBIND_ROTATE_CAMERA_RIGHT.getIsKeyPressed()){
34+
ShoulderCamera.adjustCameraRight();
35+
}
36+
else if(ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_IN.getIsKeyPressed()){
37+
ShoulderCamera.adjustCameraIn();
38+
}
39+
else if(ShoulderKeybindings.KEYBIND_ZOOM_CAMERA_OUT.getIsKeyPressed()){
40+
ShoulderCamera.adjustCameraOut();
41+
}
42+
43+
ShoulderSurfing.writeConfig();
44+
}
45+
}
46+
}
47+
}
48+
49+
}
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import org.lwjgl.input.Keyboard;
66
import org.lwjgl.util.vector.Vector2f;
7-
8-
import cpw.mods.fml.client.registry.KeyBindingRegistry;
7+
import cpw.mods.fml.client.registry.ClientRegistry;
8+
//import cpw.mods.fml.client.registry.KeyBindingRegistry;
99

1010
/**
1111
* @author Joshua Powers <[email protected]>
@@ -16,35 +16,28 @@ public class ShoulderKeybindings {
1616
/**
1717
* Minecraft keybindings for camera functions
1818
*/
19-
public static final KeyBinding KEYBIND_ROTATE_CAMERA_LEFT = new KeyBinding("Camera adj left" , Keyboard.KEY_J);
20-
public static final KeyBinding KEYBIND_ROTATE_CAMERA_RIGHT = new KeyBinding("Camera adj right" , Keyboard.KEY_L);
21-
public static final KeyBinding KEYBIND_ZOOM_CAMERA_OUT = new KeyBinding("Camera adj closer" , Keyboard.KEY_I);
22-
public static final KeyBinding KEYBIND_ZOOM_CAMERA_IN = new KeyBinding("Camera adj farther" , Keyboard.KEY_K);
19+
public static final KeyBinding KEYBIND_ROTATE_CAMERA_LEFT = new KeyBinding("ShoulderSurfing.key.cameraMoveLeft" , Keyboard.KEY_J, "ShoulderSurfing.keyCategory");
20+
public static final KeyBinding KEYBIND_ROTATE_CAMERA_RIGHT = new KeyBinding("ShoulderSurfing.key.cameraMoveRight" , Keyboard.KEY_L, "ShoulderSurfing.keyCategory");
21+
public static final KeyBinding KEYBIND_ZOOM_CAMERA_OUT = new KeyBinding("ShoulderSurfing.key.cameraMoveCloser" , Keyboard.KEY_I, "ShoulderSurfing.keyCategory");
22+
public static final KeyBinding KEYBIND_ZOOM_CAMERA_IN = new KeyBinding("ShoulderSurfing.key.cameraMoveFarther", Keyboard.KEY_K, "ShoulderSurfing.keyCategory");
2323

2424
private static KeyBinding[] keyBindings = {
2525
KEYBIND_ROTATE_CAMERA_LEFT,
2626
KEYBIND_ROTATE_CAMERA_RIGHT,
2727
KEYBIND_ZOOM_CAMERA_OUT,
2828
KEYBIND_ZOOM_CAMERA_IN};
2929

30-
/**
31-
* Whether or not each keybinding repeats
32-
*/
33-
private static boolean[] isKeyBindingRepeat = {
34-
true,
35-
true,
36-
true,
37-
true};
38-
3930
/**
4031
* Registers the ShoulderSurfing keybindings with minecraft.
4132
* Should only be called once!
4233
*
4334
* @return Returns a {@link ShoulderKeyHandler}
4435
*/
4536
public static ShoulderKeyHandler registerKeybindings(){
46-
ShoulderKeyHandler skh = new ShoulderKeyHandler(keyBindings, isKeyBindingRepeat);
47-
KeyBindingRegistry.registerKeyBinding(skh);
37+
ShoulderKeyHandler skh = new ShoulderKeyHandler();
38+
for(KeyBinding keybinding:keyBindings){
39+
ClientRegistry.registerKeyBinding(keybinding);
40+
}
4841
return skh;
4942
}
5043
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.teamderpy.shouldersurfing;
22

33
import net.minecraft.client.Minecraft;
4-
import net.minecraft.src.ModLoader;
54

65
public class ShoulderLoader {
76
/**
@@ -10,6 +9,6 @@ public class ShoulderLoader {
109
public static Minecraft mc;
1110

1211
public void load(){
13-
ShoulderLoader.mc = ModLoader.getMinecraftInstance();
12+
ShoulderLoader.mc = Minecraft.getMinecraft();
1413
}
1514
}

0 commit comments

Comments
 (0)