forked from Traincraft/Traincraft
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Added a getPlayerScale and setPlayerScale method to EntityRollingStock. Now, when initializing an entity, you can call setPlayerScale to adjust how big the player is in the engine.
- Loading branch information
1 parent
a9e54cf
commit 2ced200
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package ebf.tim.utility; | ||
|
||
|
||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.client.event.RenderLivingEvent; | ||
import org.lwjgl.opengl.GL11; | ||
import train.common.api.EntityRollingStock; | ||
|
||
public class EventManager { | ||
|
||
@SubscribeEvent | ||
@SuppressWarnings("unused") | ||
public void onPreRenderEvent(RenderLivingEvent.Pre event) { | ||
if (event.entity.ridingEntity instanceof EntityRollingStock) { | ||
GL11.glPushMatrix(); | ||
EntityRollingStock t = (EntityRollingStock) event.entity.ridingEntity; | ||
if (t != null) { | ||
GL11.glScalef(t.getPlayerScale(), t.getPlayerScale(), t.getPlayerScale()); | ||
} | ||
|
||
} | ||
} | ||
|
||
@SubscribeEvent | ||
@SuppressWarnings("unused") | ||
public void onPostRenderEvent(RenderLivingEvent.Post event) { | ||
if (event.entity.ridingEntity instanceof EntityRollingStock) { | ||
GL11.glPopMatrix(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters