Deprecate most static fields in ReplayMod class
Fix replay restarting
This commit is contained in:
@@ -33,7 +33,7 @@ import net.minecraft.client.resources.IResourcePack;
|
|||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.*;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
@@ -85,32 +85,55 @@ public class ReplayMod {
|
|||||||
public static final int TEXTURE_SIZE = 128;
|
public static final int TEXTURE_SIZE = 128;
|
||||||
|
|
||||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static GuiEventHandler guiEventHandler;
|
public static GuiEventHandler guiEventHandler;
|
||||||
|
@Deprecated
|
||||||
public static ReplaySettings replaySettings;
|
public static ReplaySettings replaySettings;
|
||||||
|
@Deprecated
|
||||||
public static Configuration config;
|
public static Configuration config;
|
||||||
|
@Deprecated
|
||||||
public static boolean firstMainMenu = true;
|
public static boolean firstMainMenu = true;
|
||||||
|
@Deprecated
|
||||||
public static ChatMessageHandler chatMessageHandler = new ChatMessageHandler();
|
public static ChatMessageHandler chatMessageHandler = new ChatMessageHandler();
|
||||||
|
@Deprecated
|
||||||
public static KeyInputHandler keyInputHandler = new KeyInputHandler();
|
public static KeyInputHandler keyInputHandler = new KeyInputHandler();
|
||||||
|
@Deprecated
|
||||||
public static MouseInputHandler mouseInputHandler = new MouseInputHandler();
|
public static MouseInputHandler mouseInputHandler = new MouseInputHandler();
|
||||||
|
@Deprecated
|
||||||
public static ReplaySender replaySender;
|
public static ReplaySender replaySender;
|
||||||
|
@Deprecated
|
||||||
public static int TP_DISTANCE_LIMIT = 128;
|
public static int TP_DISTANCE_LIMIT = 128;
|
||||||
|
@Deprecated
|
||||||
public static ReplayFileAppender replayFileAppender;
|
public static ReplayFileAppender replayFileAppender;
|
||||||
|
@Deprecated
|
||||||
public static UploadedFileHandler uploadedFileHandler;
|
public static UploadedFileHandler uploadedFileHandler;
|
||||||
|
@Deprecated
|
||||||
public static DownloadedFileHandler downloadedFileHandler;
|
public static DownloadedFileHandler downloadedFileHandler;
|
||||||
|
@Deprecated
|
||||||
public static FavoritedFileHandler favoritedFileHandler;
|
public static FavoritedFileHandler favoritedFileHandler;
|
||||||
|
@Deprecated
|
||||||
public static RatedFileHandler ratedFileHandler;
|
public static RatedFileHandler ratedFileHandler;
|
||||||
|
@Deprecated
|
||||||
public static SpectatorRenderer spectatorRenderer;
|
public static SpectatorRenderer spectatorRenderer;
|
||||||
|
@Deprecated
|
||||||
public static TooltipRenderer tooltipRenderer;
|
public static TooltipRenderer tooltipRenderer;
|
||||||
|
@Deprecated
|
||||||
public static PathPreviewRenderer pathPreviewRenderer;
|
public static PathPreviewRenderer pathPreviewRenderer;
|
||||||
|
@Deprecated
|
||||||
public static CustomObjectRenderer customObjectRenderer;
|
public static CustomObjectRenderer customObjectRenderer;
|
||||||
|
@Deprecated
|
||||||
public static SoundHandler soundHandler = new SoundHandler();
|
public static SoundHandler soundHandler = new SoundHandler();
|
||||||
|
@Deprecated
|
||||||
public static CrosshairRenderHandler crosshairRenderHandler;
|
public static CrosshairRenderHandler crosshairRenderHandler;
|
||||||
|
@Deprecated
|
||||||
public static ApiClient apiClient;
|
public static ApiClient apiClient;
|
||||||
|
|
||||||
private final KeyBindingRegistry keyBindingRegistry = new KeyBindingRegistry();
|
private final KeyBindingRegistry keyBindingRegistry = new KeyBindingRegistry();
|
||||||
private final SettingsRegistry settingsRegistry = new SettingsRegistry();
|
private final SettingsRegistry settingsRegistry = new SettingsRegistry();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@Deprecated
|
||||||
private static boolean latestModVersion = true;
|
private static boolean latestModVersion = true;
|
||||||
|
|
||||||
// The instance of your mod that Forge uses.
|
// The instance of your mod that Forge uses.
|
||||||
@@ -448,4 +471,26 @@ public class ReplayMod {
|
|||||||
public Minecraft getMinecraft() {
|
public Minecraft getMinecraft() {
|
||||||
return mc;
|
return mc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void printInfoToChat(String message, Object... args) {
|
||||||
|
printToChat(false, message, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printWarningToChat(String message, Object... args) {
|
||||||
|
printToChat(true, message, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printToChat(boolean warning, String message, Object... args) {
|
||||||
|
if (ReplayMod.replaySettings.isShowNotifications()) {
|
||||||
|
// Some nostalgia: "§8[§6Replay Mod§8]§r Your message goes here"
|
||||||
|
ChatStyle coloredDarkGray = new ChatStyle().setColor(EnumChatFormatting.DARK_GRAY);
|
||||||
|
ChatStyle coloredGold = new ChatStyle().setColor(EnumChatFormatting.GOLD);
|
||||||
|
IChatComponent text = new ChatComponentText("[").setChatStyle(coloredDarkGray)
|
||||||
|
.appendSibling(new ChatComponentTranslation("replaymod.title").setChatStyle(coloredGold))
|
||||||
|
.appendSibling(new ChatComponentText("] "))
|
||||||
|
.appendSibling(new ChatComponentTranslation(message, args).setChatStyle(new ChatStyle()
|
||||||
|
.setColor(warning ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GREEN)));
|
||||||
|
mc.thePlayer.addChatMessage(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.replaymod.recording;
|
package com.replaymod.recording;
|
||||||
|
|
||||||
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.recording.handler.ConnectionEventHandler;
|
import com.replaymod.recording.handler.ConnectionEventHandler;
|
||||||
import com.replaymod.recording.packet.PacketListener;
|
import com.replaymod.recording.packet.PacketListener;
|
||||||
import com.replaymod.core.ReplayMod;
|
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
@@ -34,6 +34,7 @@ public class ReplayModRecording {
|
|||||||
PacketListener packetListener = connectionEventHandler.getPacketListener();
|
PacketListener packetListener = connectionEventHandler.getPacketListener();
|
||||||
if (packetListener != null) {
|
if (packetListener != null) {
|
||||||
packetListener.addMarker();
|
packetListener.addMarker();
|
||||||
|
core.printInfoToChat("replaymod.chat.addedmarker");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.replaymod.recording.gui;
|
package com.replaymod.recording.gui;
|
||||||
|
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.SettingsRegistry;
|
||||||
|
import com.replaymod.recording.Setting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.Gui;
|
||||||
@@ -18,9 +19,11 @@ import static com.replaymod.core.ReplayMod.TEXTURE_SIZE;
|
|||||||
*/
|
*/
|
||||||
public class GuiRecordingOverlay {
|
public class GuiRecordingOverlay {
|
||||||
private final Minecraft mc;
|
private final Minecraft mc;
|
||||||
|
private final SettingsRegistry settingsRegistry;
|
||||||
|
|
||||||
public GuiRecordingOverlay(Minecraft mc) {
|
public GuiRecordingOverlay(Minecraft mc, SettingsRegistry settingsRegistry) {
|
||||||
this.mc = mc;
|
this.mc = mc;
|
||||||
|
this.settingsRegistry = settingsRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register() {
|
public void register() {
|
||||||
@@ -38,7 +41,7 @@ public class GuiRecordingOverlay {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void renderRecordingIndicator(RenderGameOverlayEvent.Post event) {
|
public void renderRecordingIndicator(RenderGameOverlayEvent.Post event) {
|
||||||
if (event.type != RenderGameOverlayEvent.ElementType.ALL) return;
|
if (event.type != RenderGameOverlayEvent.ElementType.ALL) return;
|
||||||
if(ReplayMod.replaySettings.showRecordingIndicator()) {
|
if (settingsRegistry.get(Setting.INDICATOR)) {
|
||||||
FontRenderer fontRenderer = mc.fontRendererObj;
|
FontRenderer fontRenderer = mc.fontRendererObj;
|
||||||
fontRenderer.drawString(I18n.format("replaymod.gui.recording").toUpperCase(), 30, 18 - (fontRenderer.FONT_HEIGHT / 2), 0xffffffff);
|
fontRenderer.drawString(I18n.format("replaymod.gui.recording").toUpperCase(), 30, 18 - (fontRenderer.FONT_HEIGHT / 2), 0xffffffff);
|
||||||
mc.renderEngine.bindTexture(TEXTURE);
|
mc.renderEngine.bindTexture(TEXTURE);
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.replaymod.recording.handler;
|
package com.replaymod.recording.handler;
|
||||||
|
|
||||||
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.recording.Setting;
|
import com.replaymod.recording.Setting;
|
||||||
import com.replaymod.recording.gui.GuiRecordingOverlay;
|
import com.replaymod.recording.gui.GuiRecordingOverlay;
|
||||||
import com.replaymod.recording.packet.PacketListener;
|
import com.replaymod.recording.packet.PacketListener;
|
||||||
import de.johni0702.replaystudio.replay.ReplayFile;
|
import de.johni0702.replaystudio.replay.ReplayFile;
|
||||||
import de.johni0702.replaystudio.replay.ZipReplayFile;
|
import de.johni0702.replaystudio.replay.ZipReplayFile;
|
||||||
import de.johni0702.replaystudio.studio.ReplayStudio;
|
import de.johni0702.replaystudio.studio.ReplayStudio;
|
||||||
import com.replaymod.core.ReplayMod;
|
|
||||||
import eu.crushedpixel.replaymod.chat.ChatMessageHandler.ChatMessageType;
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelPipeline;
|
import io.netty.channel.ChannelPipeline;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@@ -47,8 +46,6 @@ public class ConnectionEventHandler {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onConnectedToServerEvent(ClientConnectedToServerEvent event) {
|
public void onConnectedToServerEvent(ClientConnectedToServerEvent event) {
|
||||||
ReplayMod.chatMessageHandler.initialize();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(event.isLocal) {
|
if(event.isLocal) {
|
||||||
if (MinecraftServer.getServer().getEntityWorld().getWorldType() == WorldType.DEBUG_WORLD) {
|
if (MinecraftServer.getServer().getEntityWorld().getWorldType() == WorldType.DEBUG_WORLD) {
|
||||||
@@ -88,12 +85,12 @@ public class ConnectionEventHandler {
|
|||||||
recordingEventHandler = new RecordingEventHandler(packetListener);
|
recordingEventHandler = new RecordingEventHandler(packetListener);
|
||||||
recordingEventHandler.register();
|
recordingEventHandler.register();
|
||||||
|
|
||||||
guiOverlay = new GuiRecordingOverlay(mc);
|
guiOverlay = new GuiRecordingOverlay(mc, core.getSettingsRegistry());
|
||||||
guiOverlay.register();
|
guiOverlay.register();
|
||||||
|
|
||||||
ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.recordingstarted", ChatMessageType.INFORMATION);
|
core.printInfoToChat("replaymod.chat.recordingstarted");
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.recordingfailed", ChatMessageType.WARNING);
|
core.printWarningToChat("replaymod.chat.recordingfailed");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,8 +103,6 @@ public class ConnectionEventHandler {
|
|||||||
recordingEventHandler.unregister();
|
recordingEventHandler.unregister();
|
||||||
recordingEventHandler = null;
|
recordingEventHandler = null;
|
||||||
packetListener = null;
|
packetListener = null;
|
||||||
|
|
||||||
ReplayMod.chatMessageHandler.stop();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ package com.replaymod.recording.packet;
|
|||||||
|
|
||||||
import com.google.common.hash.Hashing;
|
import com.google.common.hash.Hashing;
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
|
import com.replaymod.core.ReplayMod;
|
||||||
import de.johni0702.replaystudio.data.Marker;
|
import de.johni0702.replaystudio.data.Marker;
|
||||||
import de.johni0702.replaystudio.replay.ReplayFile;
|
import de.johni0702.replaystudio.replay.ReplayFile;
|
||||||
import de.johni0702.replaystudio.replay.ReplayMetaData;
|
import de.johni0702.replaystudio.replay.ReplayMetaData;
|
||||||
import com.replaymod.core.ReplayMod;
|
|
||||||
import eu.crushedpixel.replaymod.chat.ChatMessageHandler;
|
|
||||||
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
|
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
@@ -90,8 +89,6 @@ public abstract class DataListener extends ChannelInboundHandlerAdapter {
|
|||||||
marker.setPitch((float) pos.getPitch());
|
marker.setPitch((float) pos.getPitch());
|
||||||
marker.setRoll((float) pos.getRoll());
|
marker.setRoll((float) pos.getRoll());
|
||||||
markers.add(marker);
|
markers.add(marker);
|
||||||
|
|
||||||
ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.addedmarker", ChatMessageHandler.ChatMessageType.INFORMATION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DataWriter {
|
public class DataWriter {
|
||||||
@@ -142,15 +139,13 @@ public abstract class DataListener extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
public synchronized void requestFinish() {
|
public synchronized void requestFinish() {
|
||||||
if (saveService.isShutdown()) return;
|
if (saveService.isShutdown()) return;
|
||||||
|
// TODO: Add some GUI showing saving status
|
||||||
try {
|
try {
|
||||||
Runtime.getRuntime().removeShutdownHook(shutdownHook);
|
Runtime.getRuntime().removeShutdownHook(shutdownHook);
|
||||||
saveService.shutdown();
|
saveService.shutdown();
|
||||||
saveService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
|
saveService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
|
||||||
stream.close();
|
stream.close();
|
||||||
|
|
||||||
// TODO: Get rid of replay file appender
|
|
||||||
ReplayMod.replayFileAppender.startNewReplayFileWriting();
|
|
||||||
|
|
||||||
String mcversion = ReplayMod.getMinecraftVersion();
|
String mcversion = ReplayMod.getMinecraftVersion();
|
||||||
|
|
||||||
String[] pl = players.toArray(new String[players.size()]);
|
String[] pl = players.toArray(new String[players.size()]);
|
||||||
@@ -173,7 +168,7 @@ public abstract class DataListener extends ChannelInboundHandlerAdapter {
|
|||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
ReplayMod.replayFileAppender.replayFileWritingFinished();
|
// TODO: Always close GUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.replaymod.replay;
|
|||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.replaymod.core.ReplayMod;
|
|
||||||
import com.replaymod.replay.events.ReplayCloseEvent;
|
import com.replaymod.replay.events.ReplayCloseEvent;
|
||||||
import com.replaymod.replay.events.ReplayOpenEvent;
|
import com.replaymod.replay.events.ReplayOpenEvent;
|
||||||
import com.replaymod.replay.gui.overlay.GuiReplayOverlay;
|
import com.replaymod.replay.gui.overlay.GuiReplayOverlay;
|
||||||
@@ -83,9 +82,6 @@ public class ReplayHandler {
|
|||||||
|
|
||||||
markers = replayFile.getMarkers().or(Collections.<Marker>emptySet());
|
markers = replayFile.getMarkers().or(Collections.<Marker>emptySet());
|
||||||
|
|
||||||
// TODO: get rid of chat message handler
|
|
||||||
ReplayMod.chatMessageHandler.initialize();
|
|
||||||
|
|
||||||
replaySender = new ReplaySender(this, replayFile, asyncMode);
|
replaySender = new ReplaySender(this, replayFile, asyncMode);
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
@@ -312,9 +308,9 @@ public class ReplayHandler {
|
|||||||
Display.update();
|
Display.update();
|
||||||
|
|
||||||
// Send the packets
|
// Send the packets
|
||||||
ReplayMod.replaySender.sendPacketsTill(targetTime);
|
replaySender.sendPacketsTill(targetTime);
|
||||||
ReplayMod.replaySender.setAsyncMode(true);
|
replaySender.setAsyncMode(true);
|
||||||
ReplayMod.replaySender.setReplaySpeed(0);
|
replaySender.setReplaySpeed(0);
|
||||||
|
|
||||||
mc.getNetHandler().getNetworkManager().processReceivedPackets();
|
mc.getNetHandler().getNetworkManager().processReceivedPackets();
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.replaymod.replay.handler.GuiHandler;
|
|||||||
import de.johni0702.replaystudio.replay.ReplayFile;
|
import de.johni0702.replaystudio.replay.ReplayFile;
|
||||||
import de.johni0702.replaystudio.replay.ZipReplayFile;
|
import de.johni0702.replaystudio.replay.ZipReplayFile;
|
||||||
import de.johni0702.replaystudio.studio.ReplayStudio;
|
import de.johni0702.replaystudio.studio.ReplayStudio;
|
||||||
import eu.crushedpixel.replaymod.chat.ChatMessageHandler;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
@@ -61,8 +60,7 @@ public class ReplayModReplay {
|
|||||||
public void onSuccess(NoGuiScreenshot result) {
|
public void onSuccess(NoGuiScreenshot result) {
|
||||||
try {
|
try {
|
||||||
replayHandler.getReplayFile().writeThumb(result.getImage());
|
replayHandler.getReplayFile().writeThumb(result.getImage());
|
||||||
ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.savedthumb",
|
core.printInfoToChat("replaymod.chat.savedthumb");
|
||||||
ChatMessageHandler.ChatMessageType.INFORMATION);
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.google.common.base.Preconditions;
|
|||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import com.google.common.util.concurrent.ListenableFutureTask;
|
import com.google.common.util.concurrent.ListenableFutureTask;
|
||||||
import de.johni0702.replaystudio.replay.ReplayFile;
|
import de.johni0702.replaystudio.replay.ReplayFile;
|
||||||
import com.replaymod.core.ReplayMod;
|
|
||||||
import eu.crushedpixel.replaymod.holders.PacketData;
|
import eu.crushedpixel.replaymod.holders.PacketData;
|
||||||
import eu.crushedpixel.replaymod.replay.Restrictions;
|
import eu.crushedpixel.replaymod.replay.Restrictions;
|
||||||
import eu.crushedpixel.replaymod.settings.ReplaySettings;
|
import eu.crushedpixel.replaymod.settings.ReplaySettings;
|
||||||
@@ -67,6 +66,8 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
|||||||
S39PacketPlayerAbilities.class,
|
S39PacketPlayerAbilities.class,
|
||||||
S45PacketTitle.class);
|
S45PacketTitle.class);
|
||||||
|
|
||||||
|
private static int TP_DISTANCE_LIMIT = 128;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The replay handler responsible for the current replay.
|
* The replay handler responsible for the current replay.
|
||||||
*/
|
*/
|
||||||
@@ -404,8 +405,8 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(cent != null) {
|
if(cent != null) {
|
||||||
if(!allowMovement && !((Math.abs(cent.posX - ppl.func_148932_c()) > ReplayMod.TP_DISTANCE_LIMIT) ||
|
if(!allowMovement && !((Math.abs(cent.posX - ppl.func_148932_c()) > TP_DISTANCE_LIMIT) ||
|
||||||
(Math.abs(cent.posZ - ppl.func_148933_e()) > ReplayMod.TP_DISTANCE_LIMIT))) {
|
(Math.abs(cent.posZ - ppl.func_148933_e()) > TP_DISTANCE_LIMIT))) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
allowMovement = false;
|
allowMovement = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user