Compare commits

...

15 Commits

Author SHA1 Message Date
Jonas Herzig
13bb0bde13 Merge branch 1.11-staging into 1.11.2-staging
5257a41 Merge branch 1.10.2 into 1.11
689f897 Merge branch 1.9.4 into 1.10.2
0aed9c3 Merge branch 1.8.9 into 1.9.4
f36ebf1 Merge branch 1.8 into 1.8.9
08170b3 Downgrade FG to 2.1 because FG 2.2 is 1.9+ only
41d2547 Update translations
00e999f Fix replay not being closed when opened via URI scheme handler (fixes #92)
767ea29 Fix book gui not being suppressed during replay (fixes #90)
5b04edb Hide ReplayMod app entry from menus on Linux
6aff99d Fix livelock during netty write to embedded channel (fixes #85)
703805f Fix infinite loop in mc.scheduledTasks (fixes #86)
7a4440c Update ReplayStudio
0b9c56c Fix resource packs not working after first time jumping back in time
933ee5f [Compat] Fix camera entity with BetterSprinting prior to 2.0.0 (fixes #78)
83b1090 Fix hotbar being visible while spectating player (fixes #83)
5c73117 [Compat] Fix invisible entities with Orange's 1.7 Animations (fixes #78)
4704b29 Replace the RenderPlayer hook (used subclassing) with a mixin (fixes #79)
0c226b0 Fix path at end of replay resulting in constant reloading (fixes #56)
1b9b13e Rename render success sound to all lowercase (required for 1.11) (fixes #66)
c2000b3 Fix only front-facing chunks visible for ODS rendering (fixes #67)
aafeecc Fix initial login gui not closing on success (fixes #68)
9292add Use percent-encoding for replay file names (fixes #71)
8499c0f Fix name of invis armor stand with CustomNameVisible not rendering (fixes #72)
b9ea572 Try to handle invalid ffmpeg arguments more gracefully (fixes #77)
a2f8c88 Fix compression packets being recorded (fixes #80)
19629c3 Replace usages of System.out with logger
fe1d9b8 Stop Forge from allowing the mod to load on other MC versions (fixes #82)
d56fa9b Update ReplayStudio/MCProtocolLib (Fixes missing ARMOR_STAND MobType)
7c719e0 Update ReplayStudio/MCProtocolLib (Fixes missing ARMOR_STAND MobType)
1a1e96c Fix server with RM installed refusing clients without RM (fixes #76)
35eb9ca Replace usage of FMLLog with the mod logger
2017-08-26 14:37:33 +02:00
Jonas Herzig
5257a412a5 Merge branch 1.10.2 into 1.11
689f897 Merge branch 1.9.4 into 1.10.2
0aed9c3 Merge branch 1.8.9 into 1.9.4
f36ebf1 Merge branch 1.8 into 1.8.9
08170b3 Downgrade FG to 2.1 because FG 2.2 is 1.9+ only
41d2547 Update translations
00e999f Fix replay not being closed when opened via URI scheme handler (fixes #92)
767ea29 Fix book gui not being suppressed during replay (fixes #90)
5b04edb Hide ReplayMod app entry from menus on Linux
6aff99d Fix livelock during netty write to embedded channel (fixes #85)
703805f Fix infinite loop in mc.scheduledTasks (fixes #86)
7a4440c Update ReplayStudio
0b9c56c Fix resource packs not working after first time jumping back in time
933ee5f [Compat] Fix camera entity with BetterSprinting prior to 2.0.0 (fixes #78)
83b1090 Fix hotbar being visible while spectating player (fixes #83)
5c73117 [Compat] Fix invisible entities with Orange's 1.7 Animations (fixes #78)
4704b29 Replace the RenderPlayer hook (used subclassing) with a mixin (fixes #79)
0c226b0 Fix path at end of replay resulting in constant reloading (fixes #56)
1b9b13e Rename render success sound to all lowercase (required for 1.11) (fixes #66)
c2000b3 Fix only front-facing chunks visible for ODS rendering (fixes #67)
aafeecc Fix initial login gui not closing on success (fixes #68)
9292add Use percent-encoding for replay file names (fixes #71)
8499c0f Fix name of invis armor stand with CustomNameVisible not rendering (fixes #72)
b9ea572 Try to handle invalid ffmpeg arguments more gracefully (fixes #77)
a2f8c88 Fix compression packets being recorded (fixes #80)
19629c3 Replace usages of System.out with logger
fe1d9b8 Stop Forge from allowing the mod to load on other MC versions (fixes #82)
7c719e0 Update ReplayStudio/MCProtocolLib (Fixes missing ARMOR_STAND MobType)
1a1e96c Fix server with RM installed refusing clients without RM (fixes #76)
35eb9ca Replace usage of FMLLog with the mod logger
2017-08-26 14:28:30 +02:00
Jonas Herzig
d56fa9b88f Update ReplayStudio/MCProtocolLib (Fixes missing ARMOR_STAND MobType) 2017-08-01 21:25:55 +02:00
Jonas Herzig
5dd31f4cac Merge branch '1.11' into 1.11.2
2a47f57 Merge branch '1.10.2' into 1.11
96b2904 Merge branch '1.9.4' into 1.10.2
6c8c779 Merge branch '1.8.9' into 1.9.4
aa16e42 Add workaround for setupCIWorkspace not being sufficient
ed56673 Merge branch '1.8' into 1.8.9
91573d9 Update jGui, ReplayStudio and Translations
d71358b Add confirmation dialog before overwriting path presets (fixes #65)
1a55983 Move addCallback method from integration test Utils to main Utils
18c5bcd Be more cooperative with other mods on the ingame menu (fixes #42)
c054fe8 Register keys for simplepathing only once (fixes #63)
f13297c Fix default interpolator handling in keyframe gui and after loading (fixes #64)
391f304 Show error popup if entity tracker fails to load
0e0eaaa Fix entity tracker being set even if it failed loading (fixes #50)
a34bbbc Fix NPE when spectating a player without a camera entity
60879fb Change local class to be an inner class because Srg2Source breaks with it
dfafbec Load translations from github repo, only reload language not all resource packs
8a6ec51 Add missing tooltips to player overview and various missing chat messages
5677fc5 Re-add warning to replay editor
748a91e Fix missing tooltips on fav/like/dislike buttons in replay center
ee24866 Fix upload replay button not being updated when name/tags change
dba085c Move translations into separate repo
3f0e3e7 Fix NPE when receiving Replay|Restrict messages (fixes #16 GH)
40e1d85 Fix crash when saving the last keyframe in the edit gui (fixes #61)
03aada1 Update Mixin to 0.6.8 (fixes #9 GH)
0c1dc65 Fix interpolator being lost when moving keyframe to the end (fixes #62)
fcbbbc9 Add integration test. Run with ./gradlew runIntegrationTest
fe6ded0 Fix movement of keyframe via GuiEditKeyframe not updating selected keyframe
f58fa8f Fix Login GUI not respecting other GUIs opened on startup
4fc3a31 Fix OpenEye being installed into working dir instead of mcDataDir
2017-06-01 15:32:37 +02:00
Jonas Herzig
2a47f579a9 Merge branch '1.10.2' into 1.11
96b2904 Merge branch '1.9.4' into 1.10.2
6c8c779 Merge branch '1.8.9' into 1.9.4
aa16e42 Add workaround for setupCIWorkspace not being sufficient
ed56673 Merge branch '1.8' into 1.8.9
91573d9 Update jGui, ReplayStudio and Translations
d71358b Add confirmation dialog before overwriting path presets (fixes #65)
1a55983 Move addCallback method from integration test Utils to main Utils
18c5bcd Be more cooperative with other mods on the ingame menu (fixes #42)
c054fe8 Register keys for simplepathing only once (fixes #63)
f13297c Fix default interpolator handling in keyframe gui and after loading (fixes #64)
391f304 Show error popup if entity tracker fails to load
0e0eaaa Fix entity tracker being set even if it failed loading (fixes #50)
a34bbbc Fix NPE when spectating a player without a camera entity
60879fb Change local class to be an inner class because Srg2Source breaks with it
dfafbec Load translations from github repo, only reload language not all resource packs
8a6ec51 Add missing tooltips to player overview and various missing chat messages
5677fc5 Re-add warning to replay editor
748a91e Fix missing tooltips on fav/like/dislike buttons in replay center
ee24866 Fix upload replay button not being updated when name/tags change
dba085c Move translations into separate repo
3f0e3e7 Fix NPE when receiving Replay|Restrict messages (fixes #16 GH)
40e1d85 Fix crash when saving the last keyframe in the edit gui (fixes #61)
03aada1 Update Mixin to 0.6.8 (fixes #9 GH)
0c1dc65 Fix interpolator being lost when moving keyframe to the end (fixes #62)
fcbbbc9 Add integration test. Run with ./gradlew runIntegrationTest
fe6ded0 Fix movement of keyframe via GuiEditKeyframe not updating selected keyframe
f58fa8f Fix Login GUI not respecting other GUIs opened on startup
4fc3a31 Fix OpenEye being installed into working dir instead of mcDataDir
2017-05-31 21:18:22 +02:00
johni0702
cda8493df1 Merge branch '1.11' into 1.11.2
0c36022 Merge branch '1.10.2' into 1.11
325d041 Merge branch '1.9.4' into 1.10.2
d9d57e2 Merge branch '1.8.9' into 1.9.4
24c58cb Merge branch '1.8' into 1.8.9
1ffeb01 Update jGui
c122d30 Merge branch '1.8-path-segments' into 1.8
27fd25a Fix crash when server responds with garbage to language query (fixes #51)
db6b0ff Fix / by 0 when two spectator keyframes are closer than 50ms (fixes #60)
d61d0ac Fix hand of invisible spectated player being visible (fixes #59)
f7460f9 Re-enable time path after path playback (fixes #55)
bdbffd5 Add Catmull-Rom spline interpolator to simplepathing
5cbfd28 Generate interpolator settings from InterpolatorType enum
6095aef Fix loading and storing of default interpolator with settings
3f52336 Revert "Fix AbstractMethodError caused by FG2.0 not supporting lambdas (fixes #58)"
c6293bc Update to FG2.2
c8126ed Merge '1.8' into 1.8.9
64898ce Fix NPE when saving recorded resource pack
70e3e54 Fix AbstractMethodError caused by FG2.0 not supporting lambdas (fixes #58)
3f2b3d6 Fix replacing source file in Replay Editor (fixes #57)
d2def94 Fix duration of replays corrupted because of JVM/OS crash
2c64030 Refactor simple pathing timeline logic into dedicated class with unit tests Fix logic for user-set interpolators
4deb374 Enable validation on focus change for all number input fields
5302bca Fix id and text of Replay Editor button in docs
057edcc Manually inject root cert for cross-signed LetsEncrypt cert in requests
cd16211 Register new Property to imply that the path segment following a keyframe has a user-set interpolator instead of the default Modified Keyframe GUI to allow for custom Path interpolator
2017-01-29 13:46:06 +01:00
johni0702
0c36022b47 Merge branch '1.10.2' into 1.11
325d041 Merge branch '1.9.4' into 1.10.2
d9d57e2 Merge branch '1.8.9' into 1.9.4
24c58cb Merge branch '1.8' into 1.8.9
1ffeb01 Update jGui
c122d30 Merge branch '1.8-path-segments' into 1.8
27fd25a Fix crash when server responds with garbage to language query (fixes #51)
db6b0ff Fix / by 0 when two spectator keyframes are closer than 50ms (fixes #60)
d61d0ac Fix hand of invisible spectated player being visible (fixes #59)
f7460f9 Re-enable time path after path playback (fixes #55)
bdbffd5 Add Catmull-Rom spline interpolator to simplepathing
5cbfd28 Generate interpolator settings from InterpolatorType enum
6095aef Fix loading and storing of default interpolator with settings
3f52336 Revert "Fix AbstractMethodError caused by FG2.0 not supporting lambdas (fixes #58)"
c6293bc Update to FG2.2
c8126ed Merge '1.8' into 1.8.9
64898ce Fix NPE when saving recorded resource pack
70e3e54 Fix AbstractMethodError caused by FG2.0 not supporting lambdas (fixes #58)
3f2b3d6 Fix replacing source file in Replay Editor (fixes #57)
d2def94 Fix duration of replays corrupted because of JVM/OS crash
2c64030 Refactor simple pathing timeline logic into dedicated class with unit tests Fix logic for user-set interpolators
4deb374 Enable validation on focus change for all number input fields
5302bca Fix id and text of Replay Editor button in docs
057edcc Manually inject root cert for cross-signed LetsEncrypt cert in requests
cd16211 Register new Property to imply that the path segment following a keyframe has a user-set interpolator instead of the default Modified Keyframe GUI to allow for custom Path interpolator
2017-01-29 13:25:19 +01:00
johni0702
33cb1405d5 Update to 1.11.2 2017-01-15 01:23:44 +01:00
johni0702
b6cf42c3be Merge branch '1.10.2' into 1.11
c6dec95 Merge branch '1.9.4' into 1.10.2
4fdfa9e Merge branch '1.8.9' into 1.9.4
44d4a25 Merge branch '1.8' into 1.9.4
01acbc6 Update to 1.8.9
1c60687 Update ReplayStudio and jGui
d9b796d Mixin'd the Shader's mods ShadersRender class to only render hands if the Forge event isn't cancelled
6bbff3b Updated Mixin to 0.6.4-SNAPSHOT and set mixin target level
6f3ac71 Add CustomMainMenu compatibility info to docs
b0a1cdf Search for ffmpeg executable in common locations to simplify setup
d465891 Fixed GuiEditPositionKeyframe's width to fit on all screen sizes Centered all rows of GuiEditPositionKeyframe's VerticalLayout
1b099f9 Add render queue
03534c6 Update docs
4388d69 Only try to create the downloads folder if it does not yet exist
7ad19aa Add mod version and accepted MC version directly to the @Mod annotation
655bea0 Replace @Mod.Instance with direct static references
458dad6 Merge pull request #4 from ReplayMod/1.8-editor
eb5ccb2 Add Replay Editor (for now, trimming only)
6498d62 Fix server game data snapshot being restored in singleplayer (fixes #44)
2c898a8 Prevent rendering without sufficient keyframes (fixes #45)
5d520a5 Fix deserialization of chroma key color (fixes #43)
c681742 Use caching maven proxy for faster and more stable drone builds
fbf165e Added Anti-Aliasing to the Render Settings
2017-01-15 00:20:20 +01:00
johni0702
503b308043 Replace @Mod.Instance with direct static references
(cherry picked from commit 4b605cc)
2017-01-13 17:02:18 +01:00
CrushedPixel
7b491d188d Enabled recording on Realms Servers 2016-12-20 15:00:35 +01:00
johni0702
fb4140a123 Merge branch '1.10.2' into 1.11
905ae75 Merge branch '1.9.4' into 1.10.2
72e1fe0 Merge branch '1.8' into 1.9.4
6163585 Update ReplayStudio to fix dependencies
2016-12-16 22:09:16 +01:00
johni0702
2428c01c9c Merge branch '1.10.2' into 1.11
372206f Merge branch '1.9.4' into 1.10.2
4a1ccea Merge branch '1.8' into 1.9.4
fb39a06 Add drone ci config
030c71c Automatically disable and re-enable Optifine's Fast Render setting before rendering a video
1fef12d Include FML handshake in recording
e86c66d Move README.md, LICENSE.md and user docs from master branch to 1.8
2016-12-10 20:28:23 +01:00
johni0702
260720d5ba Update Forge to latest recommended build (2188) 2016-12-10 20:25:33 +01:00
johni0702
58b7c44a33 Update to 1.11 2016-12-03 21:12:08 +01:00
25 changed files with 94 additions and 87 deletions

View File

@@ -34,9 +34,9 @@ archivesBaseName = "replaymod"
minecraft { minecraft {
coreMod = 'com.replaymod.core.LoadingPlugin' coreMod = 'com.replaymod.core.LoadingPlugin'
version = '1.10.2-12.18.2.2099' version = '1.11.2-13.20.0.2216'
runDir = "eclipse" runDir = "eclipse"
mappings = "snapshot_20160518" mappings = "snapshot_20161220"
replace '@MOD_VERSION@', project.version replace '@MOD_VERSION@', project.version
// Includes intentional whitespace to stop Forge from declaring the mod to be compatible with // Includes intentional whitespace to stop Forge from declaring the mod to be compatible with
// a newer srg-compatible MC version (that may be using a different protocol version) // a newer srg-compatible MC version (that may be using a different protocol version)

2
jGui

Submodule jGui updated: e2bd90628e...bd3fa93d7d

View File

@@ -34,7 +34,7 @@ public class SpectatePlayer extends AbstractTask {
future.setException(new TimeoutException("Camera hasn't stopped spectating.")); future.setException(new TimeoutException("Camera hasn't stopped spectating."));
return; return;
} }
if (mc.getRenderViewEntity() == mc.thePlayer) { if (mc.getRenderViewEntity() == mc.player) {
future.set(null); future.set(null);
} }
} }

View File

@@ -52,17 +52,17 @@ public class DisableBetterSprinting {
@SubscribeEvent(priority = EventPriority.HIGH) @SubscribeEvent(priority = EventPriority.HIGH)
public void beforeGuiOpenEvent(GuiOpenEvent event) { public void beforeGuiOpenEvent(GuiOpenEvent event) {
if (ReplayModReplay.instance.getReplayHandler() != null && mc.theWorld != null) { if (ReplayModReplay.instance.getReplayHandler() != null && mc.world != null) {
// During replay, get ready to revert BetterSprinting's overwritten playerController // During replay, get ready to revert BetterSprinting's overwritten playerController
originalController = mc.playerController; originalController = mc.playerController;
mc.theWorld.addEventListener(worldAccessHook); mc.world.addEventListener(worldAccessHook);
} }
} }
@SubscribeEvent(priority = EventPriority.LOW) @SubscribeEvent(priority = EventPriority.LOW)
public void afterGuiOpenEvent(GuiOpenEvent event) { public void afterGuiOpenEvent(GuiOpenEvent event) {
if (ReplayModReplay.instance.getReplayHandler() != null && mc.theWorld != null) { if (ReplayModReplay.instance.getReplayHandler() != null && mc.world != null) {
mc.theWorld.addEventListener(worldAccessHook); mc.world.addEventListener(worldAccessHook);
} }
} }
@@ -93,6 +93,7 @@ public class DisableBetterSprinting {
@Override public void playSoundToAllNearExcept(@Nullable EntityPlayer player, SoundEvent soundIn, SoundCategory category, double x, double y, double z, float volume, float pitch) {} @Override public void playSoundToAllNearExcept(@Nullable EntityPlayer player, SoundEvent soundIn, SoundCategory category, double x, double y, double z, float volume, float pitch) {}
@Override public void playRecord(SoundEvent soundIn, BlockPos pos) {} @Override public void playRecord(SoundEvent soundIn, BlockPos pos) {}
@Override public void spawnParticle(int p_180442_1_, boolean p_180442_2_, double p_180442_3_, double p_180442_5_, double p_180442_7_, double p_180442_9_, double p_180442_11_, double p_180442_13_, int... p_180442_15_) {} @Override public void spawnParticle(int p_180442_1_, boolean p_180442_2_, double p_180442_3_, double p_180442_5_, double p_180442_7_, double p_180442_9_, double p_180442_11_, double p_180442_13_, int... p_180442_15_) {}
@Override public void spawnParticle(int p_190570_1_, boolean p_190570_2_, boolean p_190570_3_, double p_190570_4_, double p_190570_6_, double p_190570_8_, double p_190570_10_, double p_190570_12_, double p_190570_14_, int... p_190570_16_) {}
@Override public void onEntityAdded(Entity entityIn) {} @Override public void onEntityAdded(Entity entityIn) {}
@Override public void broadcastSound(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) {} @Override public void broadcastSound(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) {}
@Override public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) {} @Override public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) {}

View File

@@ -20,7 +20,7 @@ public class HideInvisibleEntities {
@SubscribeEvent(priority = EventPriority.HIGH) @SubscribeEvent(priority = EventPriority.HIGH)
public void preRenderLiving(RenderLivingEvent.Pre event) { public void preRenderLiving(RenderLivingEvent.Pre event) {
if (modLoaded) { if (modLoaded) {
if (mc.thePlayer instanceof CameraEntity && event.getEntity().isInvisible()) { if (mc.player instanceof CameraEntity && event.getEntity().isInvisible()) {
event.setCanceled(true); event.setCanceled(true);
} }
} }

View File

@@ -17,7 +17,7 @@ public class Restrictions {
public String handle(SPacketCustomPayload packet) { public String handle(SPacketCustomPayload packet) {
PacketBuffer buffer = packet.getBufferData(); PacketBuffer buffer = packet.getBufferData();
while (buffer.isReadable()) { while (buffer.isReadable()) {
String name = buffer.readStringFromBuffer(64); String name = buffer.readString(64);
boolean active = buffer.readBoolean(); boolean active = buffer.readBoolean();
// if ("no_xray".equals(name)) { // if ("no_xray".equals(name)) {
// noXray = active; // noXray = active;

View File

@@ -34,7 +34,7 @@ public class PlayerOverview implements Extra {
public void run() { public void run() {
if (module.getReplayHandler() != null) { if (module.getReplayHandler() != null) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<EntityPlayer> players = mod.getMinecraft().theWorld.getPlayers(EntityPlayer.class, new Predicate() { List<EntityPlayer> players = mod.getMinecraft().world.getPlayers(EntityPlayer.class, new Predicate() {
@Override @Override
public boolean apply(Object input) { public boolean apply(Object input) {
return !(input instanceof CameraEntity); // Exclude the camera entity return !(input instanceof CameraEntity); // Exclude the camera entity

View File

@@ -4,7 +4,9 @@ public enum MinecraftVersion {
MC_1_8("Minecraft 1.8", "1.8"), MC_1_8("Minecraft 1.8", "1.8"),
MC_1_9_4("Minecraft 1.9.4", "1.9.4"), MC_1_9_4("Minecraft 1.9.4", "1.9.4"),
MC_1_10_2("Minecraft 1.10.2", "1.10.2"); MC_1_10_2("Minecraft 1.10.2", "1.10.2"),
MC_1_11("Minecraft 1.11", "1.11"),
MC_1_11_2("Minecraft 1.11.2", "1.11.2");
private String niceName, apiName; private String niceName, apiName;

View File

@@ -67,6 +67,9 @@ public class ConnectionEventHandler {
worldName = mc.getIntegratedServer().getWorldName(); worldName = mc.getIntegratedServer().getWorldName();
} else if (Minecraft.getMinecraft().getCurrentServerData() != null) { } else if (Minecraft.getMinecraft().getCurrentServerData() != null) {
worldName = Minecraft.getMinecraft().getCurrentServerData().serverIP; worldName = Minecraft.getMinecraft().getCurrentServerData().serverIP;
} else if (Minecraft.getMinecraft().isConnectedToRealms()) {
// we can't access the server name without tapping too deep in the Realms Library
worldName = "A Realms Server";
} else { } else {
logger.info("Recording not started as the world is neither local nor remote (probably a replay)."); logger.info("Recording not started as the world is neither local nor remote (probably a replay).");
return; return;

View File

@@ -57,7 +57,7 @@ public class RecordingEventHandler {
public void onPlayerJoin() { public void onPlayerJoin() {
try { try {
packetListener.save(new SPacketSpawnPlayer(mc.thePlayer)); packetListener.save(new SPacketSpawnPlayer(mc.player));
} catch(Exception e1) { } catch(Exception e1) {
e1.printStackTrace(); e1.printStackTrace();
} }
@@ -65,7 +65,7 @@ public class RecordingEventHandler {
public void onPlayerRespawn() { public void onPlayerRespawn() {
try { try {
packetListener.save(new SPacketSpawnPlayer(mc.thePlayer)); packetListener.save(new SPacketSpawnPlayer(mc.player));
} catch(Exception e) { } catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -93,7 +93,7 @@ public class RecordingEventHandler {
@SubscribeEvent @SubscribeEvent
public void onPlayerTick(PlayerTickEvent e) { public void onPlayerTick(PlayerTickEvent e) {
try { try {
if(e.player != mc.thePlayer) return; if(e.player != mc.player) return;
boolean force = false; boolean force = false;
if(lastX == null || lastY == null || lastZ == null) { if(lastX == null || lastY == null || lastZ == null) {
@@ -168,62 +168,62 @@ public class RecordingEventHandler {
*/ */
//Inventory Handling //Inventory Handling
if (playerItems[0] != mc.thePlayer.getHeldItem(EnumHand.MAIN_HAND)) { if (playerItems[0] != mc.player.getHeldItem(EnumHand.MAIN_HAND)) {
playerItems[0] = mc.thePlayer.getHeldItem(EnumHand.MAIN_HAND); playerItems[0] = mc.player.getHeldItem(EnumHand.MAIN_HAND);
packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.MAINHAND, playerItems[0])); packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.MAINHAND, playerItems[0]));
} }
if (playerItems[1] != mc.thePlayer.getHeldItem(EnumHand.OFF_HAND)) { if (playerItems[1] != mc.player.getHeldItem(EnumHand.OFF_HAND)) {
playerItems[1] = mc.thePlayer.getHeldItem(EnumHand.OFF_HAND); playerItems[1] = mc.player.getHeldItem(EnumHand.OFF_HAND);
packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.OFFHAND, playerItems[1])); packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.OFFHAND, playerItems[1]));
} }
if (playerItems[2] != mc.thePlayer.inventory.armorInventory[0]) { if (playerItems[2] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.FEET)) {
playerItems[2] = mc.thePlayer.inventory.armorInventory[0]; playerItems[2] = mc.player.getItemStackFromSlot(EntityEquipmentSlot.FEET);
packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.FEET, playerItems[2])); packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.FEET, playerItems[2]));
} }
if (playerItems[3] != mc.thePlayer.inventory.armorInventory[1]) { if (playerItems[3] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.LEGS)) {
playerItems[3] = mc.thePlayer.inventory.armorInventory[1]; playerItems[3] = mc.player.getItemStackFromSlot(EntityEquipmentSlot.LEGS);
packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.LEGS, playerItems[3])); packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.LEGS, playerItems[3]));
} }
if (playerItems[4] != mc.thePlayer.inventory.armorInventory[2]) { if (playerItems[4] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.CHEST)) {
playerItems[4] = mc.thePlayer.inventory.armorInventory[2]; playerItems[4] = mc.player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.CHEST, playerItems[4])); packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.CHEST, playerItems[4]));
} }
if (playerItems[5] != mc.thePlayer.inventory.armorInventory[3]) { if (playerItems[5] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.HEAD)) {
playerItems[5] = mc.thePlayer.inventory.armorInventory[3]; playerItems[5] = mc.player.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.HEAD, playerItems[5])); packetListener.save(new SPacketEntityEquipment(e.player.getEntityId(), EntityEquipmentSlot.HEAD, playerItems[5]));
} }
//Leaving Ride //Leaving Ride
if((!mc.thePlayer.isRiding() && lastRiding != -1) || if((!mc.player.isRiding() && lastRiding != -1) ||
(mc.thePlayer.isRiding() && lastRiding != mc.thePlayer.getRidingEntity().getEntityId())) { (mc.player.isRiding() && lastRiding != mc.player.getRidingEntity().getEntityId())) {
if(!mc.thePlayer.isRiding()) { if(!mc.player.isRiding()) {
lastRiding = -1; lastRiding = -1;
} else { } else {
lastRiding = mc.thePlayer.getRidingEntity().getEntityId(); lastRiding = mc.player.getRidingEntity().getEntityId();
} }
packetListener.save(new SPacketEntityAttach(e.player, e.player.getRidingEntity())); packetListener.save(new SPacketEntityAttach(e.player, e.player.getRidingEntity()));
} }
//Sleeping //Sleeping
if(!mc.thePlayer.isPlayerSleeping() && wasSleeping) { if(!mc.player.isPlayerSleeping() && wasSleeping) {
packetListener.save(new SPacketAnimation(e.player, 2)); packetListener.save(new SPacketAnimation(e.player, 2));
wasSleeping = false; wasSleeping = false;
} }
// Active hand (e.g. eating, drinking, blocking) // Active hand (e.g. eating, drinking, blocking)
if (mc.thePlayer.isHandActive() ^ wasHandActive || mc.thePlayer.getActiveHand() != lastActiveHand) { if (mc.player.isHandActive() ^ wasHandActive || mc.player.getActiveHand() != lastActiveHand) {
wasHandActive = mc.thePlayer.isHandActive(); wasHandActive = mc.player.isHandActive();
lastActiveHand = mc.thePlayer.getActiveHand(); lastActiveHand = mc.player.getActiveHand();
EntityDataManager dataManager = new EntityDataManager(null); EntityDataManager dataManager = new EntityDataManager(null);
int state = (wasHandActive ? 1 : 0) | (lastActiveHand == EnumHand.OFF_HAND ? 2 : 0); int state = (wasHandActive ? 1 : 0) | (lastActiveHand == EnumHand.OFF_HAND ? 2 : 0);
dataManager.register(EntityLiving.HAND_STATES, (byte) state); dataManager.register(EntityLiving.HAND_STATES, (byte) state);
packetListener.save(new SPacketEntityMetadata(mc.thePlayer.getEntityId(), dataManager, true)); packetListener.save(new SPacketEntityMetadata(mc.player.getEntityId(), dataManager, true));
} }
} catch(Exception e1) { } catch(Exception e1) {
@@ -234,7 +234,8 @@ public class RecordingEventHandler {
@SubscribeEvent @SubscribeEvent
public void onPickupItem(ItemPickupEvent event) { public void onPickupItem(ItemPickupEvent event) {
try { try {
packetListener.save(new SPacketCollectItem(event.pickedUp.getEntityId(), event.player.getEntityId())); packetListener.save(new SPacketCollectItem(event.pickedUp.getEntityId(), event.player.getEntityId(),
event.pickedUp.getEntityItem().getMaxStackSize()));
} catch(Exception e) { } catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -243,7 +244,7 @@ public class RecordingEventHandler {
@SubscribeEvent @SubscribeEvent
public void onSleep(PlayerSleepInBedEvent event) { public void onSleep(PlayerSleepInBedEvent event) {
try { try {
if (event.getEntityPlayer() != mc.thePlayer) { if (event.getEntityPlayer() != mc.player) {
return; return;
} }
@@ -259,7 +260,7 @@ public class RecordingEventHandler {
@SubscribeEvent @SubscribeEvent
public void enterMinecart(MinecartInteractEvent event) { public void enterMinecart(MinecartInteractEvent event) {
try { try {
if(event.getEntity() != mc.thePlayer) { if(event.getEntity() != mc.player) {
return; return;
} }
@@ -272,7 +273,7 @@ public class RecordingEventHandler {
} }
public void onBlockBreakAnim(int breakerId, BlockPos pos, int progress) { public void onBlockBreakAnim(int breakerId, BlockPos pos, int progress) {
EntityPlayer thePlayer = mc.thePlayer; EntityPlayer thePlayer = mc.player;
if (thePlayer != null && breakerId == thePlayer.getEntityId()) { if (thePlayer != null && breakerId == thePlayer.getEntityId()) {
packetListener.save(new SPacketBlockBreakAnim(breakerId, pos, progress)); packetListener.save(new SPacketBlockBreakAnim(breakerId, pos, progress));
} }

View File

@@ -37,14 +37,14 @@ public abstract class MixinNetHandlerPlayClient {
*/ */
@Inject(method = "handlePlayerListItem", at=@At("HEAD")) @Inject(method = "handlePlayerListItem", at=@At("HEAD"))
public void recordOwnJoin(SPacketPlayerListItem packet, CallbackInfo ci) { public void recordOwnJoin(SPacketPlayerListItem packet, CallbackInfo ci) {
if (gameController.thePlayer == null) return; if (gameController.player == null) return;
RecordingEventHandler handler = getRecordingEventHandler(); RecordingEventHandler handler = getRecordingEventHandler();
if (handler != null && packet.getAction() == SPacketPlayerListItem.Action.ADD_PLAYER) { if (handler != null && packet.getAction() == SPacketPlayerListItem.Action.ADD_PLAYER) {
for (SPacketPlayerListItem.AddPlayerData data : packet.getEntries()) { for (SPacketPlayerListItem.AddPlayerData data : packet.getEntries()) {
if (data.getProfile() == null || data.getProfile().getId() == null) continue; if (data.getProfile() == null || data.getProfile().getId() == null) continue;
// Only add spawn packet for our own player and only if he isn't known yet // Only add spawn packet for our own player and only if he isn't known yet
if (data.getProfile().getId().equals(Minecraft.getMinecraft().thePlayer.getGameProfile().getId()) if (data.getProfile().getId().equals(Minecraft.getMinecraft().player.getGameProfile().getId())
&& !playerInfoMap.containsKey(data.getProfile().getId())) { && !playerInfoMap.containsKey(data.getProfile().getId())) {
handler.onPlayerJoin(); handler.onPlayerJoin();
} }

View File

@@ -23,6 +23,6 @@ public abstract class MixinPlayerControllerMP implements RecordingEventHandler.R
@Redirect(method = "onPlayerDestroyBlock", at = @At(value = "INVOKE", @Redirect(method = "onPlayerDestroyBlock", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/World;playEvent(ILnet/minecraft/util/math/BlockPos;I)V")) target = "Lnet/minecraft/world/World;playEvent(ILnet/minecraft/util/math/BlockPos;I)V"))
public void replayModRecording_playEvent_fixed(World world, int type, BlockPos pos, int data) { public void replayModRecording_playEvent_fixed(World world, int type, BlockPos pos, int data) {
world.playEvent(mc.thePlayer, type, pos, data); world.playEvent(mc.player, type, pos, data);
} }
} }

View File

@@ -38,7 +38,7 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
@Inject(method = "playSound", at = @At("HEAD")) @Inject(method = "playSound", at = @At("HEAD"))
public void replayModRecording_recordClientSound(EntityPlayer player, double x, double y, double z, SoundEvent sound, SoundCategory category, public void replayModRecording_recordClientSound(EntityPlayer player, double x, double y, double z, SoundEvent sound, SoundCategory category,
float volume, float pitch, CallbackInfo ci) { float volume, float pitch, CallbackInfo ci) {
if (player == mc.thePlayer) { if (player == mc.player) {
RecordingEventHandler handler = replayModRecording_getRecordingEventHandler(); RecordingEventHandler handler = replayModRecording_getRecordingEventHandler();
if (handler != null) { if (handler != null) {
handler.onClientSound(sound, category, x, y, z, volume, pitch); handler.onClientSound(sound, category, x, y, z, volume, pitch);
@@ -50,7 +50,7 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
// These are handled in the World class, so we override the method in WorldClient and add our special handling. // These are handled in the World class, so we override the method in WorldClient and add our special handling.
@Override @Override
public void playEvent(EntityPlayer player, int type, BlockPos pos, int data) { public void playEvent(EntityPlayer player, int type, BlockPos pos, int data) {
if (player == mc.thePlayer) { if (player == mc.player) {
// We caused this event, the server won't send it to us // We caused this event, the server won't send it to us
RecordingEventHandler handler = replayModRecording_getRecordingEventHandler(); RecordingEventHandler handler = replayModRecording_getRecordingEventHandler();
if (handler != null) { if (handler != null) {

View File

@@ -160,8 +160,8 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
Packet packet = (Packet) msg; Packet packet = (Packet) msg;
if(packet instanceof SPacketCollectItem) { if(packet instanceof SPacketCollectItem) {
if(mc.thePlayer != null || if(mc.player != null ||
((SPacketCollectItem) packet).getEntityID() == mc.thePlayer.getEntityId()) { ((SPacketCollectItem) packet).getEntityID() == mc.player.getEntityId()) {
super.channelRead(ctx, msg); super.channelRead(ctx, msg);
return; return;
} }
@@ -233,7 +233,7 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
} }
ByteBuf byteBuf = Unpooled.buffer(); ByteBuf byteBuf = Unpooled.buffer();
PacketBuffer packetBuffer = new PacketBuffer(byteBuf); PacketBuffer packetBuffer = new PacketBuffer(byteBuf);
packetBuffer.writeVarIntToBuffer(packetId); packetBuffer.writeVarInt(packetId);
packet.writePacketData(packetBuffer); packet.writePacketData(packetBuffer);
byteBuf.readerIndex(0); byteBuf.readerIndex(0);

View File

@@ -190,7 +190,7 @@ public class ResourcePackRecorder {
Futures.getUnchecked(mc.addScheduledTask(() -> mc.displayGuiScreen(guiScreen))); Futures.getUnchecked(mc.addScheduledTask(() -> mc.displayGuiScreen(guiScreen)));
Map<String, String> sessionInfo = ResourcePackRepository.func_190115_a(); Map<String, String> sessionInfo = ResourcePackRepository.getDownloadHeaders();
repo.downloadingPacks = HttpUtil.downloadResourcePack(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy()); repo.downloadingPacks = HttpUtil.downloadResourcePack(file, url, sessionInfo, 50 * 1024 * 1024, guiScreen, mc.getProxy());
Futures.addCallback(repo.downloadingPacks, new FutureCallback<Object>() { Futures.addCallback(repo.downloadingPacks, new FutureCallback<Object>() {
@Override @Override

View File

@@ -147,7 +147,7 @@ public class InputReplayTimer extends WrappedTimer {
// TODO: Translate magic values to Keyboard.KEY_ constants // TODO: Translate magic values to Keyboard.KEY_ constants
if (key == 32 && Keyboard.isKeyDown(61) && mc.ingameGUI != null) { if (key == 32 && Keyboard.isKeyDown(61) && mc.ingameGUI != null) {
mc.ingameGUI.getChatGUI().clearChatMessages(); mc.ingameGUI.getChatGUI().clearChatMessages(false);
} }
if (key == 31 && Keyboard.isKeyDown(61)) { if (key == 31 && Keyboard.isKeyDown(61)) {

View File

@@ -110,12 +110,12 @@ public class ReplayHandler {
channel.close().awaitUninterruptibly(); channel.close().awaitUninterruptibly();
if (mc.thePlayer instanceof CameraEntity) { if (mc.player instanceof CameraEntity) {
mc.thePlayer.setDead(); mc.player.setDead();
} }
if (mc.theWorld != null) { if (mc.world != null) {
mc.theWorld.sendQuittingDisconnectingPacket(); mc.world.sendQuittingDisconnectingPacket();
mc.loadWorld(null); mc.loadWorld(null);
} }
@@ -130,7 +130,7 @@ public class ReplayHandler {
} }
private void setup() { private void setup() {
mc.ingameGUI.getChatGUI().clearChatMessages(); mc.ingameGUI.getChatGUI().clearChatMessages(true);
NetworkManager networkManager = new NetworkManager(EnumPacketDirection.CLIENTBOUND) { NetworkManager networkManager = new NetworkManager(EnumPacketDirection.CLIENTBOUND) {
@Override @Override
@@ -246,7 +246,7 @@ public class ReplayHandler {
* @return {@code true} if the camera is the view entity, {@code false} otherwise * @return {@code true} if the camera is the view entity, {@code false} otherwise
*/ */
public boolean isCameraView() { public boolean isCameraView() {
return mc.thePlayer instanceof CameraEntity && mc.thePlayer == mc.getRenderViewEntity(); return mc.player instanceof CameraEntity && mc.player == mc.getRenderViewEntity();
} }
/** /**
@@ -254,7 +254,7 @@ public class ReplayHandler {
* @return The camera entity or {@code null} if it does not yet exist * @return The camera entity or {@code null} if it does not yet exist
*/ */
public CameraEntity getCameraEntity() { public CameraEntity getCameraEntity() {
return mc.thePlayer instanceof CameraEntity ? (CameraEntity) mc.thePlayer : null; return mc.player instanceof CameraEntity ? (CameraEntity) mc.player : null;
} }
public UUID getSpectatedUUID() { public UUID getSpectatedUUID() {
@@ -334,7 +334,7 @@ public class ReplayHandler {
replaySender.setReplaySpeed(0); replaySender.setReplaySpeed(0);
mc.getConnection().getNetworkManager().processReceivedPackets(); mc.getConnection().getNetworkManager().processReceivedPackets();
for (Entity entity : mc.theWorld.loadedEntityList) { for (Entity entity : mc.world.loadedEntityList) {
if (entity instanceof EntityOtherPlayerMP) { if (entity instanceof EntityOtherPlayerMP) {
EntityOtherPlayerMP e = (EntityOtherPlayerMP) entity; EntityOtherPlayerMP e = (EntityOtherPlayerMP) entity;
e.setPosition(e.otherPlayerMPX, e.otherPlayerMPY, e.otherPlayerMPZ); e.setPosition(e.otherPlayerMPX, e.otherPlayerMPY, e.otherPlayerMPZ);

View File

@@ -258,8 +258,8 @@ public class ReplaySender extends ChannelDuplexHandler {
// Entity#addedToChunk is not set and it is therefore not updated every tick. // Entity#addedToChunk is not set and it is therefore not updated every tick.
// To counteract this, we need to manually update it's position if it hasn't been added // To counteract this, we need to manually update it's position if it hasn't been added
// to any chunk yet. // to any chunk yet.
if (mc.theWorld != null) { if (mc.world != null) {
for (EntityPlayer playerEntity : mc.theWorld.playerEntities) { for (EntityPlayer playerEntity : mc.world.playerEntities) {
if (!playerEntity.addedToChunk && playerEntity instanceof EntityOtherPlayerMP) { if (!playerEntity.addedToChunk && playerEntity instanceof EntityOtherPlayerMP) {
playerEntity.onLivingUpdate(); playerEntity.onLivingUpdate();
} }
@@ -293,7 +293,7 @@ public class ReplaySender extends ChannelDuplexHandler {
// If we do not give minecraft time to tick, there will be dead entity artifacts left in the world // If we do not give minecraft time to tick, there will be dead entity artifacts left in the world
// Therefore we have to remove all loaded, dead entities manually if we are in sync mode. // Therefore we have to remove all loaded, dead entities manually if we are in sync mode.
// We do this after every SpawnX packet and after the destroy entities packet. // We do this after every SpawnX packet and after the destroy entities packet.
if (!asyncMode && mc.theWorld != null) { if (!asyncMode && mc.world != null) {
if (p instanceof SPacketSpawnPlayer if (p instanceof SPacketSpawnPlayer
|| p instanceof SPacketSpawnObject || p instanceof SPacketSpawnObject
|| p instanceof SPacketSpawnMob || p instanceof SPacketSpawnMob
@@ -301,7 +301,7 @@ public class ReplaySender extends ChannelDuplexHandler {
|| p instanceof SPacketSpawnPainting || p instanceof SPacketSpawnPainting
|| p instanceof SPacketSpawnExperienceOrb || p instanceof SPacketSpawnExperienceOrb
|| p instanceof SPacketDestroyEntities) { || p instanceof SPacketDestroyEntities) {
World world = mc.theWorld; World world = mc.world;
for (int i = 0; i < world.loadedEntityList.size(); ++i) { for (int i = 0; i < world.loadedEntityList.size(); ++i) {
Entity entity = world.loadedEntityList.get(i); Entity entity = world.loadedEntityList.get(i);
if (entity.isDead) { if (entity.isDead) {
@@ -332,7 +332,7 @@ public class ReplaySender extends ChannelDuplexHandler {
ByteBuf bb = Unpooled.wrappedBuffer(bytes); ByteBuf bb = Unpooled.wrappedBuffer(bytes);
PacketBuffer pb = new PacketBuffer(bb); PacketBuffer pb = new PacketBuffer(bb);
int i = pb.readVarIntFromBuffer(); int i = pb.readVarInt();
Packet p = EnumConnectionState.PLAY.getPacket(EnumPacketDirection.CLIENTBOUND, i); Packet p = EnumConnectionState.PLAY.getPacket(EnumPacketDirection.CLIENTBOUND, i);
p.readPacketData(pb); p.readPacketData(pb);
@@ -468,7 +468,7 @@ public class ReplaySender extends ChannelDuplexHandler {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void run() { public void run() {
if (mc.theWorld == null || !mc.isCallingFromMinecraftThread()) { if (mc.world == null || !mc.isCallingFromMinecraftThread()) {
ReplayMod.instance.runLater(this); ReplayMod.instance.runLater(this);
return; return;
} }

View File

@@ -41,7 +41,7 @@ import java.util.function.Function;
/** /**
* The camera entity used as the main player entity during replay viewing. * The camera entity used as the main player entity during replay viewing.
* During a replay {@link Minecraft#thePlayer} should be an instance of this class. * During a replay {@link Minecraft#player} should be an instance of this class.
* Camera movement is controlled by a separate {@link CameraController}. * Camera movement is controlled by a separate {@link CameraController}.
*/ */
public class CameraEntity extends EntityPlayerSP { public class CameraEntity extends EntityPlayerSP {
@@ -158,9 +158,9 @@ public class CameraEntity extends EntityPlayerSP {
// entity is recreated and we have to spectate a new entity // entity is recreated and we have to spectate a new entity
UUID spectating = ReplayModReplay.instance.getReplayHandler().getSpectatedUUID(); UUID spectating = ReplayModReplay.instance.getReplayHandler().getSpectatedUUID();
if (spectating != null && (view.getUniqueID() != spectating if (spectating != null && (view.getUniqueID() != spectating
|| view.worldObj != worldObj) || view.world != world)
|| worldObj.getEntityByID(view.getEntityId()) != view) { || world.getEntityByID(view.getEntityId()) != view) {
view = worldObj.getPlayerEntityByUUID(spectating); view = world.getPlayerEntityByUUID(spectating);
if (view != null) { if (view != null) {
mc.setRenderViewEntity(view); mc.setRenderViewEntity(view);
} else { } else {
@@ -179,17 +179,17 @@ public class CameraEntity extends EntityPlayerSP {
@Override @Override
public void preparePlayerToSpawn() { public void preparePlayerToSpawn() {
// Make sure our world is up-to-date in case of world changes // Make sure our world is up-to-date in case of world changes
if (mc.theWorld != null) { if (mc.world != null) {
worldObj = mc.theWorld; world = mc.world;
} }
super.preparePlayerToSpawn(); super.preparePlayerToSpawn();
} }
@Override @Override
public void setAngles(float yaw, float pitch) { public void setRotation(float yaw, float pitch) {
if (mc.getRenderViewEntity() == this) { if (mc.getRenderViewEntity() == this) {
// Only update camera rotation when the camera is the view // Only update camera rotation when the camera is the view
super.setAngles(yaw, pitch); super.setRotation(yaw, pitch);
} }
} }
@@ -387,9 +387,9 @@ public class CameraEntity extends EntityPlayerSP {
} }
@Override @Override
public void addChatMessage(ITextComponent message) { public void sendMessage(ITextComponent message) {
if (MinecraftForge.EVENT_BUS.post(new ReplayChatMessageEvent(this))) return; if (MinecraftForge.EVENT_BUS.post(new ReplayChatMessageEvent(this))) return;
super.addChatMessage(message); super.sendMessage(message);
} }
private class EventHandler { private class EventHandler {
@@ -456,8 +456,8 @@ public class CameraEntity extends EntityPlayerSP {
mc.entityRenderer.itemRenderer.itemStackOffHand = player.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND); mc.entityRenderer.itemRenderer.itemStackOffHand = player.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
mc.thePlayer.renderArmYaw = mc.thePlayer.prevRenderArmYaw = player.rotationYaw; mc.player.renderArmYaw = mc.player.prevRenderArmYaw = player.rotationYaw;
mc.thePlayer.renderArmPitch = mc.thePlayer.prevRenderArmPitch = player.rotationPitch; mc.player.renderArmPitch = mc.player.prevRenderArmPitch = player.rotationPitch;
} }
} }
} }

View File

@@ -58,7 +58,7 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
protected void drawMarker(GuiRenderer renderer, ReadableDimension size, Marker marker) { protected void drawMarker(GuiRenderer renderer, ReadableDimension size, Marker marker) {
int visibleLength = (int) (getLength() * getZoom()); int visibleLength = (int) (getLength() * getZoom());
int markerPos = MathHelper.clamp_int(marker.getTime(), getOffset(), getOffset() + visibleLength); int markerPos = MathHelper.clamp(marker.getTime(), getOffset(), getOffset() + visibleLength);
double positionInVisible = markerPos - getOffset(); double positionInVisible = markerPos - getOffset();
double fractionOfVisible = positionInVisible / visibleLength; double fractionOfVisible = positionInVisible / visibleLength;
int markerX = (int) (BORDER_LEFT + fractionOfVisible * (size.getWidth() - BORDER_LEFT - BORDER_RIGHT)); int markerX = (int) (BORDER_LEFT + fractionOfVisible * (size.getWidth() - BORDER_LEFT - BORDER_RIGHT));
@@ -99,7 +99,7 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
int visibleLength = (int) (getLength() * getZoom()); int visibleLength = (int) (getLength() * getZoom());
int contentWidth = lastSize.getWidth() - BORDER_LEFT - BORDER_RIGHT; int contentWidth = lastSize.getWidth() - BORDER_LEFT - BORDER_RIGHT;
for (Marker marker : replayHandler.getMarkers()) { for (Marker marker : replayHandler.getMarkers()) {
int markerPos = MathHelper.clamp_int(marker.getTime(), getOffset(), getOffset() + visibleLength); int markerPos = MathHelper.clamp(marker.getTime(), getOffset(), getOffset() + visibleLength);
double positionInVisible = markerPos - getOffset(); double positionInVisible = markerPos - getOffset();
double fractionOfVisible = positionInVisible / visibleLength; double fractionOfVisible = positionInVisible / visibleLength;
int markerX = (int) (BORDER_LEFT + fractionOfVisible * contentWidth); int markerX = (int) (BORDER_LEFT + fractionOfVisible * contentWidth);

View File

@@ -17,7 +17,7 @@ public abstract class MixinGuiSpectator {
@Inject(method = "onHotbarSelected", at = @At("HEAD"), cancellable = true) @Inject(method = "onHotbarSelected", at = @At("HEAD"), cancellable = true)
public void isInReplay(int i, CallbackInfo ci) { public void isInReplay(int i, CallbackInfo ci) {
// Prevent spectator gui from opening while in a replay // Prevent spectator gui from opening while in a replay
if (mc.thePlayer instanceof CameraEntity) { if (mc.player instanceof CameraEntity) {
ci.cancel(); ci.cancel();
} }
} }

View File

@@ -33,8 +33,8 @@ public abstract class MixinPlayerControllerMP {
@Inject(method = "isSpectator", at=@At("HEAD"), cancellable = true) @Inject(method = "isSpectator", at=@At("HEAD"), cancellable = true)
private void replayModReplay_isSpectator(CallbackInfoReturnable<Boolean> ci) { private void replayModReplay_isSpectator(CallbackInfoReturnable<Boolean> ci) {
if (mc.thePlayer instanceof CameraEntity) { // this check should in theory not be required if (mc.player instanceof CameraEntity) { // this check should in theory not be required
ci.setReturnValue(mc.thePlayer.isSpectator()); ci.setReturnValue(mc.player.isSpectator());
} }
} }
} }

View File

@@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public abstract class MixinRenderLivingBase { public abstract class MixinRenderLivingBase {
@Inject(method = "canRenderName", at = @At("HEAD"), cancellable = true) @Inject(method = "canRenderName", at = @At("HEAD"), cancellable = true)
private void replayModReplay_canRenderInvisibleName(EntityLivingBase entity, CallbackInfoReturnable<Boolean> ci) { private void replayModReplay_canRenderInvisibleName(EntityLivingBase entity, CallbackInfoReturnable<Boolean> ci) {
EntityPlayer thePlayer = Minecraft.getMinecraft().thePlayer; EntityPlayer thePlayer = Minecraft.getMinecraft().player;
if (thePlayer instanceof CameraEntity && entity.isInvisible()) { if (thePlayer instanceof CameraEntity && entity.isInvisible()) {
ci.setReturnValue(false); ci.setReturnValue(false);
} }

View File

@@ -31,7 +31,7 @@ public abstract class MixinViewFrustum {
} }
/** /**
* Instead of calling {@link RenderChunk#setOrigin(int, int, int)} we recreate the render chunk * Instead of calling {@link RenderChunk#setPosition(int, int, int)} we recreate the render chunk
* which seems to solve the problem that chunks are invisible when you leave an area and return * which seems to solve the problem that chunks are invisible when you leave an area and return
* to it. * to it.
* Any better fixes are welcome. * Any better fixes are welcome.
@@ -43,8 +43,8 @@ public abstract class MixinViewFrustum {
return; return;
} }
int i = MathHelper.floor_double(viewEntityX) - 8; int i = MathHelper.floor(viewEntityX) - 8;
int j = MathHelper.floor_double(viewEntityZ) - 8; int j = MathHelper.floor(viewEntityZ) - 8;
int k = this.countChunksX * 16; int k = this.countChunksX * 16;
for (int l = 0; l < this.countChunksX; ++l) { for (int l = 0; l < this.countChunksX; ++l) {
@@ -59,7 +59,7 @@ public abstract class MixinViewFrustum {
// Recreate render chunk instead of setting its position // Recreate render chunk instead of setting its position
(renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l] = (renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l] =
renderChunkFactory.create(world, renderGlobal, 0) renderChunkFactory.create(world, renderGlobal, 0)
).setOrigin(blockpos.getX(), blockpos.getY(), blockpos.getZ()); ).setPosition(blockpos.getX(), blockpos.getY(), blockpos.getZ());
} }
} }
} }