Make use of the source remapping feature of The Preprocessor plugin
This commit is contained in:
2
jGui
2
jGui
Submodule jGui updated: af54ecf972...74d407b82a
@@ -6,35 +6,22 @@ import com.replaymod.core.versions.MCVer;
|
|||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
//#else
|
//#else
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
//$$ import org.lwjgl.input.Keyboard;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.client.registry.ClientRegistry;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.InputEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
|
|
||||||
public class KeyBindingRegistry {
|
public class KeyBindingRegistry {
|
||||||
private Map<String, KeyBinding> keyBindings = new HashMap<String, KeyBinding>();
|
private Map<String, KeyBinding> keyBindings = new HashMap<String, KeyBinding>();
|
||||||
private Multimap<KeyBinding, Runnable> keyBindingHandlers = ArrayListMultimap.create();
|
private Multimap<KeyBinding, Runnable> keyBindingHandlers = ArrayListMultimap.create();
|
||||||
@@ -81,7 +68,7 @@ public class KeyBindingRegistry {
|
|||||||
|
|
||||||
public void handleRepeatedKeyBindings() {
|
public void handleRepeatedKeyBindings() {
|
||||||
for (Map.Entry<KeyBinding, Collection<Runnable>> entry : repeatedKeyBindingHandlers.asMap().entrySet()) {
|
for (Map.Entry<KeyBinding, Collection<Runnable>> entry : repeatedKeyBindingHandlers.asMap().entrySet()) {
|
||||||
if (isKeyDown(entry.getKey())) {
|
if (entry.getKey().isKeyDown()) {
|
||||||
invokeKeyBindingHandlers(entry.getKey(), entry.getValue());
|
invokeKeyBindingHandlers(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,11 @@ package com.replaymod.core;
|
|||||||
//$$ import org.spongepowered.asm.launch.MixinBootstrap;
|
//$$ import org.spongepowered.asm.launch.MixinBootstrap;
|
||||||
//$$ import org.spongepowered.asm.mixin.Mixins;
|
//$$ import org.spongepowered.asm.mixin.Mixins;
|
||||||
//$$
|
//$$
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.relauncher.CoreModManager;
|
//$$ import net.minecraftforge.fml.relauncher.CoreModManager;
|
||||||
//$$ import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
//$$ import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
||||||
//#else
|
//#if MC<10800
|
||||||
//$$ import com.replaymod.core.asm.GLErrorTransformer;
|
//$$ import com.replaymod.core.asm.GLErrorTransformer;
|
||||||
//$$ import com.replaymod.core.asm.GLStateTrackerTransformer;
|
//$$ import com.replaymod.core.asm.GLStateTrackerTransformer;
|
||||||
//$$ import cpw.mods.fml.relauncher.CoreModManager;
|
|
||||||
//$$ import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
|
||||||
//$$
|
//$$
|
||||||
//$$ import java.util.ArrayList;
|
//$$ import java.util.ArrayList;
|
||||||
//$$ import java.util.List;
|
//$$ import java.util.List;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import de.johni0702.minecraft.gui.container.GuiScreen;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import org.apache.commons.io.Charsets;
|
import org.apache.commons.io.Charsets;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
@@ -49,38 +50,29 @@ import net.minecraft.util.text.*;
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraft.client.GameSettings;
|
import net.minecraft.client.GameSettings;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
//#endif
|
||||||
|
|
||||||
|
//#if MC>=11300
|
||||||
import net.minecraftforge.fml.ModContainer;
|
import net.minecraftforge.fml.ModContainer;
|
||||||
import net.minecraftforge.fml.ModList;
|
import net.minecraftforge.fml.ModList;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.settings.GameSettings;
|
|
||||||
//$$ import net.minecraftforge.fml.client.FMLClientHandler;
|
|
||||||
//$$ import net.minecraftforge.fml.common.Loader;
|
//$$ import net.minecraftforge.fml.common.Loader;
|
||||||
//$$ import net.minecraftforge.fml.common.Mod.EventHandler;
|
//$$ import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||||
//$$ import net.minecraftforge.fml.common.Mod.Instance;
|
//$$ import net.minecraftforge.fml.common.Mod.Instance;
|
||||||
//$$ import net.minecraftforge.fml.common.ModContainer;
|
//$$ import net.minecraftforge.fml.common.ModContainer;
|
||||||
//$$ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
//$$ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
//$$ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
//$$ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
//#if MC>=10800
|
||||||
//#endif
|
//$$ import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.Loader;
|
|
||||||
//$$ import cpw.mods.fml.common.Mod;
|
|
||||||
//$$ import cpw.mods.fml.common.Mod.EventHandler;
|
|
||||||
//$$ import cpw.mods.fml.common.Mod.Instance;
|
|
||||||
//$$ import cpw.mods.fml.common.ModContainer;
|
|
||||||
//$$ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
|
||||||
//$$ import com.replaymod.replay.InputReplayTimer;
|
//$$ import com.replaymod.replay.InputReplayTimer;
|
||||||
//$$
|
//$$
|
||||||
//$$ import java.util.ArrayDeque;
|
//$$ import java.util.ArrayDeque;
|
||||||
//#endif
|
//#endif
|
||||||
|
//#endif
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -198,7 +190,7 @@ public class ReplayMod implements Module {
|
|||||||
|
|
||||||
public File getReplayFolder() throws IOException {
|
public File getReplayFolder() throws IOException {
|
||||||
String path = getSettingsRegistry().get(Setting.RECORDING_PATH);
|
String path = getSettingsRegistry().get(Setting.RECORDING_PATH);
|
||||||
File folder = new File(path.startsWith("./") ? mcDataDir(getMinecraft()) : null, path);
|
File folder = new File(path.startsWith("./") ? getMinecraft().gameDir : null, path);
|
||||||
FileUtils.forceMkdir(folder);
|
FileUtils.forceMkdir(folder);
|
||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,17 +7,8 @@ import net.minecraft.client.gui.GuiScreen;
|
|||||||
import net.minecraft.client.gui.GuiScreenRealmsProxy;
|
import net.minecraft.client.gui.GuiScreenRealmsProxy;
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
import org.lwjgl.opengl.GL11;
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
|
||||||
@@ -37,13 +28,13 @@ public class MainMenuHandler {
|
|||||||
int realmsOffset = 0;
|
int realmsOffset = 0;
|
||||||
for (GuiButton button : getButtonList(event)) {
|
for (GuiButton button : getButtonList(event)) {
|
||||||
// Buttons that aren't in a rectangle directly above our space don't need moving
|
// Buttons that aren't in a rectangle directly above our space don't need moving
|
||||||
if (x(button) + button.width < gui.width / 2 - 100
|
if (button.x + button.width < gui.width / 2 - 100
|
||||||
|| x(button) > gui.width / 2 + 100
|
|| button.x > gui.width / 2 + 100
|
||||||
|| y(button) > gui.height / 4 + 10 + 4 * 24) continue;
|
|| button.y > gui.height / 4 + 10 + 4 * 24) continue;
|
||||||
// Move button up to make space for one rows of buttons
|
// Move button up to make space for one rows of buttons
|
||||||
// and then move back down by 10 to compensate for the space to the exit button that was already there
|
// and then move back down by 10 to compensate for the space to the exit button that was already there
|
||||||
int offset = -1 * 24 + 10;
|
int offset = -1 * 24 + 10;
|
||||||
y(button, y(button) + offset);
|
button.y += offset;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
if (button.id == 14) {
|
if (button.id == 14) {
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import org.apache.logging.log4j.Logger;
|
|||||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.getConnection;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.Minecraft;
|
//$$ import net.minecraft.client.Minecraft;
|
||||||
//$$ import net.minecraft.client.entity.AbstractClientPlayer;
|
//$$ import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
@@ -69,7 +68,6 @@ import java.util.Date;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.Minecraft_mcDataDir;
|
|
||||||
import static com.replaymod.core.versions.MCVer.getMinecraft;
|
import static com.replaymod.core.versions.MCVer.getMinecraft;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
@@ -190,7 +188,7 @@ public class Utils {
|
|||||||
|
|
||||||
public static ResourceLocation getResourceLocationForPlayerUUID(UUID uuid) {
|
public static ResourceLocation getResourceLocationForPlayerUUID(UUID uuid) {
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
NetworkPlayerInfo info = getConnection(getMinecraft()).getPlayerInfo(uuid);
|
NetworkPlayerInfo info = getMinecraft().getConnection().getPlayerInfo(uuid);
|
||||||
ResourceLocation skinLocation;
|
ResourceLocation skinLocation;
|
||||||
if (info != null && info.hasLocationSkin()) {
|
if (info != null && info.hasLocationSkin()) {
|
||||||
skinLocation = info.getLocationSkin();
|
skinLocation = info.getLocationSkin();
|
||||||
@@ -239,7 +237,7 @@ public class Utils {
|
|||||||
// Try to save the crash report
|
// Try to save the crash report
|
||||||
if (crashReport.getFile() == null) {
|
if (crashReport.getFile() == null) {
|
||||||
try {
|
try {
|
||||||
File folder = new File(Minecraft_mcDataDir(getMinecraft()), "crash-reports");
|
File folder = new File(getMinecraft().gameDir, "crash-reports");
|
||||||
File file = new File(folder, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
File file = new File(folder, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
||||||
logger.debug("Saving crash report to file: {}", file);
|
logger.debug("Saving crash report to file: {}", file);
|
||||||
crashReport.saveToFile(file);
|
crashReport.saveToFile(file);
|
||||||
|
|||||||
@@ -2,94 +2,59 @@ package com.replaymod.core.versions;
|
|||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
|
||||||
import net.minecraft.client.multiplayer.ServerList;
|
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
|
||||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
|
import net.minecraft.client.renderer.entity.model.ModelBox;
|
||||||
|
import net.minecraft.client.renderer.entity.model.ModelRenderer;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
|
||||||
import net.minecraft.crash.CrashReport;
|
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraft.client.MainWindow;
|
import net.minecraft.client.MainWindow;
|
||||||
import net.minecraft.client.renderer.entity.model.ModelBox;
|
|
||||||
import net.minecraft.client.renderer.entity.model.ModelRenderer;
|
|
||||||
import net.minecraft.client.util.InputMappings;
|
import net.minecraft.client.util.InputMappings;
|
||||||
import net.minecraft.crash.ReportedException;
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.gui.ScaledResolution;
|
//$$ import net.minecraft.client.gui.ScaledResolution;
|
||||||
//$$ import net.minecraft.client.model.ModelBox;
|
|
||||||
//$$ import net.minecraft.client.model.ModelRenderer;
|
|
||||||
//$$ import net.minecraft.client.resources.ResourcePackRepository;
|
//$$ import net.minecraft.client.resources.ResourcePackRepository;
|
||||||
//$$ import net.minecraft.util.ReportedException;
|
|
||||||
//$$ import org.apache.logging.log4j.LogManager;
|
//$$ import org.apache.logging.log4j.LogManager;
|
||||||
//$$ import org.lwjgl.Sys;
|
//$$ import org.lwjgl.Sys;
|
||||||
//$$ import java.awt.Desktop;
|
//$$ import java.awt.Desktop;
|
||||||
|
//$$ import java.io.IOException;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
//#if MC>=11200
|
|
||||||
import net.minecraft.client.renderer.BufferBuilder;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
//#endif
|
|
||||||
import net.minecraft.client.particle.Particle;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.particle.EntityFX;
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraft.client.renderer.WorldRenderer;
|
|
||||||
//#endif
|
|
||||||
//$$ import net.minecraft.util.MathHelper;
|
|
||||||
//#endif
|
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.GlStateManager.BooleanState;
|
import net.minecraft.client.renderer.GlStateManager.BooleanState;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||||
import net.minecraft.world.WorldType;
|
import net.minecraft.world.WorldType;
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.EventBus;
|
|
||||||
//#endif
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import com.google.common.util.concurrent.Futures;
|
//$$ import com.google.common.util.concurrent.Futures;
|
||||||
//$$ import com.replaymod.render.hooks.GLStateTracker;
|
//$$ import com.replaymod.render.hooks.GLStateTracker;
|
||||||
//$$ import com.replaymod.render.hooks.GLStateTracker.BooleanState;
|
//$$ import com.replaymod.render.hooks.GLStateTracker.BooleanState;
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.EventBus;
|
|
||||||
//$$ import io.netty.handler.codec.DecoderException;
|
//$$ import io.netty.handler.codec.DecoderException;
|
||||||
//$$ import net.minecraft.client.resources.FileResourcePack;
|
//$$ import net.minecraft.client.resources.FileResourcePack;
|
||||||
//$$
|
//$$
|
||||||
@@ -97,7 +62,6 @@ import net.minecraftforge.eventbus.api.IEventBus;
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@@ -106,17 +70,12 @@ import java.util.concurrent.Callable;
|
|||||||
* Abstraction over things that have changed between different MC versions.
|
* Abstraction over things that have changed between different MC versions.
|
||||||
*/
|
*/
|
||||||
public class MCVer {
|
public class MCVer {
|
||||||
//#if MC>=11300
|
|
||||||
public static IEventBus FORGE_BUS = MinecraftForge.EVENT_BUS;
|
public static IEventBus FORGE_BUS = MinecraftForge.EVENT_BUS;
|
||||||
|
//#if MC>=10809
|
||||||
public static IEventBus FML_BUS = FORGE_BUS;
|
public static IEventBus FML_BUS = FORGE_BUS;
|
||||||
//#else
|
//#else
|
||||||
//$$ public static EventBus FORGE_BUS = MinecraftForge.EVENT_BUS;
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ public static EventBus FML_BUS = FORGE_BUS;
|
|
||||||
//#else
|
|
||||||
//$$ public static EventBus FML_BUS = FMLCommonHandler.instance().bus();
|
//$$ public static EventBus FML_BUS = FMLCommonHandler.instance().bus();
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
|
|
||||||
public static void addDetail(CrashReportCategory category, String name, Callable<String> callable) {
|
public static void addDetail(CrashReportCategory category, String name, Callable<String> callable) {
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
@@ -171,30 +130,6 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int x(GuiButton button) {
|
|
||||||
//#if MC>=11200
|
|
||||||
return button.x;
|
|
||||||
//#else
|
|
||||||
//$$ return button.xPosition;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int y(GuiButton button) {
|
|
||||||
//#if MC>=11200
|
|
||||||
return button.y;
|
|
||||||
//#else
|
|
||||||
//$$ return button.yPosition;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void y(GuiButton button, int val) {
|
|
||||||
//#if MC>=11200
|
|
||||||
button.y = val;
|
|
||||||
//#else
|
|
||||||
//$$ button.yPosition = val;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EntityLivingBase getEntity(RenderLivingEvent event) {
|
public static EntityLivingBase getEntity(RenderLivingEvent event) {
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
return event.getEntity();
|
return event.getEntity();
|
||||||
@@ -203,14 +138,6 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NetHandlerPlayClient getConnection(Minecraft mc) {
|
|
||||||
//#if MC>=10904
|
|
||||||
return mc.getConnection();
|
|
||||||
//#else
|
|
||||||
//$$ return mc.getNetHandler();
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String readString(PacketBuffer buffer, int max) {
|
public static String readString(PacketBuffer buffer, int max) {
|
||||||
//#if MC>=11102
|
//#if MC>=11102
|
||||||
return buffer.readString(max);
|
return buffer.readString(max);
|
||||||
@@ -227,30 +154,6 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int readVarInt(PacketBuffer buffer) {
|
|
||||||
//#if MC>=11102
|
|
||||||
return buffer.readVarInt();
|
|
||||||
//#else
|
|
||||||
//$$ return buffer.readVarIntFromBuffer();
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void writeVarInt(PacketBuffer buffer, int val) {
|
|
||||||
//#if MC>=11102
|
|
||||||
buffer.writeVarInt(val);
|
|
||||||
//#else
|
|
||||||
//$$ buffer.writeVarIntToBuffer(val);
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FontRenderer getFontRenderer(Minecraft mc) {
|
|
||||||
//#if MC>=11200
|
|
||||||
return mc.fontRenderer;
|
|
||||||
//#else
|
|
||||||
//$$ return mc.fontRendererObj;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RenderGameOverlayEvent.ElementType getType(RenderGameOverlayEvent event) {
|
public static RenderGameOverlayEvent.ElementType getType(RenderGameOverlayEvent event) {
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
return event.getType();
|
return event.getType();
|
||||||
@@ -268,14 +171,6 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
public static File mcDataDir(Minecraft mc) {
|
|
||||||
//#if MC>=11300
|
|
||||||
return mc.gameDir;
|
|
||||||
//#else
|
|
||||||
//$$ return mc.mcDataDir;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
public static Entity getRenderViewEntity(Minecraft mc) {
|
public static Entity getRenderViewEntity(Minecraft mc) {
|
||||||
return mc.getRenderViewEntity();
|
return mc.getRenderViewEntity();
|
||||||
@@ -303,38 +198,6 @@ public class MCVer {
|
|||||||
//$$ = TextureMap.locationBlocksTexture;
|
//$$ = TextureMap.locationBlocksTexture;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
public static EntityPlayerSP player(Minecraft mc) {
|
|
||||||
//#if MC>=11102
|
|
||||||
return mc.player;
|
|
||||||
//#else
|
|
||||||
//$$ return mc.thePlayer;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static WorldClient world(Minecraft mc) {
|
|
||||||
//#if MC>=11102
|
|
||||||
return mc.world;
|
|
||||||
//#else
|
|
||||||
//$$ return mc.theWorld;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static World world(Entity entity) {
|
|
||||||
//#if MC>=11102
|
|
||||||
return entity.world;
|
|
||||||
//#else
|
|
||||||
//$$ return entity.worldObj;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void world(Entity entity, World world) {
|
|
||||||
//#if MC>=11102
|
|
||||||
entity.world = world;
|
|
||||||
//#else
|
|
||||||
//$$ entity.worldObj = world;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Entity getRidingEntity(Entity ridden) {
|
public static Entity getRidingEntity(Entity ridden) {
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
return ridden.getRidingEntity();
|
return ridden.getRidingEntity();
|
||||||
@@ -423,22 +286,6 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ServerList_saveSingleServer(ServerData serverData) {
|
|
||||||
//#if MC>=10904
|
|
||||||
ServerList.saveSingleServer(serverData);
|
|
||||||
//#else
|
|
||||||
//$$ ServerList.func_147414_b(serverData);
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendPacket(NetHandlerPlayClient netHandler, Packet packet) {
|
|
||||||
//#if MC>=10904
|
|
||||||
netHandler.sendPacket(packet);
|
|
||||||
//#else
|
|
||||||
//$$ netHandler.addToSendQueue(packet);
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
public static MainWindow newScaledResolution(Minecraft mc) {
|
public static MainWindow newScaledResolution(Minecraft mc) {
|
||||||
@@ -478,56 +325,33 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isKeyDown(KeyBinding keyBinding) {
|
|
||||||
//#if MC>=10800
|
|
||||||
return keyBinding.isKeyDown();
|
|
||||||
//#else
|
|
||||||
//$$ return keyBinding.getIsKeyPressed();
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void BufferBuilder_setTranslation(double x, double y, double z) {
|
public static void BufferBuilder_setTranslation(double x, double y, double z) {
|
||||||
//#if MC>=10904
|
//#if MC>=10800
|
||||||
Tessellator.getInstance().getBuffer().setTranslation(x, y, z);
|
Tessellator.getInstance().getBuffer().setTranslation(x, y, z);
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10800
|
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().setTranslation(x, y, z);
|
|
||||||
//#else
|
|
||||||
//$$ Tessellator.instance.setTranslation(x, y, z);
|
//$$ Tessellator.instance.setTranslation(x, y, z);
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BufferBuilder_beginPosCol(int mode) {
|
public static void BufferBuilder_beginPosCol(int mode) {
|
||||||
//#if MC>=10904
|
|
||||||
Tessellator.getInstance().getBuffer().begin(mode, DefaultVertexFormats.POSITION_COLOR);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().begin(mode, DefaultVertexFormats.POSITION_COLOR);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().startDrawing(mode);
|
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||||
|
//#if MC>=10809
|
||||||
|
bufferBuilder.begin(mode, DefaultVertexFormats.POSITION_COLOR);
|
||||||
|
//#else
|
||||||
|
//$$ bufferBuilder.startDrawing(mode);
|
||||||
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ Tessellator.instance.startDrawing(mode);
|
//$$ Tessellator.instance.startDrawing(mode);
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BufferBuilder_addPosCol(double x, double y, double z, int r, int g, int b, int a) {
|
public static void BufferBuilder_addPosCol(double x, double y, double z, int r, int g, int b, int a) {
|
||||||
//#if MC>=10904
|
//#if MC>=10800
|
||||||
//#if MC>=11200
|
|
||||||
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
||||||
//#else
|
//#else
|
||||||
//$$ VertexBuffer worldRenderer = Tessellator.getInstance().getBuffer();
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
|
|
||||||
//#else
|
|
||||||
//$$ Tessellator worldRenderer = Tessellator.instance;
|
//$$ Tessellator worldRenderer = Tessellator.instance;
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
worldRenderer.pos(x, y, z).color(r, g, b, a).endVertex();
|
worldRenderer.pos(x, y, z).color(r, g, b, a).endVertex();
|
||||||
//#else
|
//#else
|
||||||
@@ -537,35 +361,24 @@ public class MCVer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void BufferBuilder_beginPosTex(int mode) {
|
public static void BufferBuilder_beginPosTex(int mode) {
|
||||||
//#if MC>=10904
|
|
||||||
Tessellator.getInstance().getBuffer().begin(mode, DefaultVertexFormats.POSITION_TEX);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().begin(mode, DefaultVertexFormats.POSITION_TEX);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().startDrawing(mode);
|
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||||
|
//#if MC>=10809
|
||||||
|
bufferBuilder.begin(mode, DefaultVertexFormats.POSITION_TEX);
|
||||||
|
//#else
|
||||||
|
//$$ bufferBuilder.startDrawing(mode);
|
||||||
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ Tessellator.instance.startDrawing(mode);
|
//$$ Tessellator.instance.startDrawing(mode);
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BufferBuilder_addPosTex(double x, double y, double z, double u, double v) {
|
public static void BufferBuilder_addPosTex(double x, double y, double z, double u, double v) {
|
||||||
//#if MC>=10904
|
//#if MC>=10800
|
||||||
//#if MC>=11200
|
|
||||||
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
||||||
//#else
|
//#else
|
||||||
//$$ VertexBuffer worldRenderer = Tessellator.getInstance().getBuffer();
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
|
|
||||||
//#else
|
|
||||||
//$$ Tessellator worldRenderer = Tessellator.instance;
|
//$$ Tessellator worldRenderer = Tessellator.instance;
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
worldRenderer.pos(x, y, z).tex(u, v).endVertex();
|
worldRenderer.pos(x, y, z).tex(u, v).endVertex();
|
||||||
//#else
|
//#else
|
||||||
@@ -574,35 +387,24 @@ public class MCVer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void BufferBuilder_beginPosTexCol(int mode) {
|
public static void BufferBuilder_beginPosTexCol(int mode) {
|
||||||
//#if MC>=10904
|
|
||||||
Tessellator.getInstance().getBuffer().begin(mode, DefaultVertexFormats.POSITION_TEX_COLOR);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().begin(mode, DefaultVertexFormats.POSITION_TEX_COLOR);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//$$ Tessellator.getInstance().getWorldRenderer().startDrawing(mode);
|
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||||
|
//#if MC>=10809
|
||||||
|
bufferBuilder.begin(mode, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||||
|
//#else
|
||||||
|
//$$ bufferBuilder.startDrawing(mode);
|
||||||
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//$$ Tessellator.instance.startDrawing(mode);
|
//$$ Tessellator.instance.startDrawing(mode);
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BufferBuilder_addPosTexCol(double x, double y, double z, double u, double v, int r, int g, int b, int a) {
|
public static void BufferBuilder_addPosTexCol(double x, double y, double z, double u, double v, int r, int g, int b, int a) {
|
||||||
//#if MC>=10904
|
//#if MC>=10800
|
||||||
//#if MC>=11200
|
|
||||||
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
||||||
//#else
|
//#else
|
||||||
//$$ VertexBuffer worldRenderer = Tessellator.getInstance().getBuffer();
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
|
|
||||||
//#else
|
|
||||||
//$$ Tessellator worldRenderer = Tessellator.instance;
|
//$$ Tessellator worldRenderer = Tessellator.instance;
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
worldRenderer.pos(x, y, z).tex(u, v).color(r, g, b, a).endVertex();
|
worldRenderer.pos(x, y, z).tex(u, v).color(r, g, b, a).endVertex();
|
||||||
//#else
|
//#else
|
||||||
@@ -612,22 +414,6 @@ public class MCVer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=10904
|
|
||||||
//#if MC>=11200
|
|
||||||
public static BufferBuilder getBuffer(Tessellator tessellator) {
|
|
||||||
//#else
|
|
||||||
//$$ public static VertexBuffer getBuffer(Tessellator tessellator) {
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ public static WorldRenderer getBuffer(Tessellator tessellator) {
|
|
||||||
//#endif
|
|
||||||
//#if MC>=10904
|
|
||||||
return Tessellator.getInstance().getBuffer();
|
|
||||||
//#else
|
|
||||||
//$$ return Tessellator.getInstance().getWorldRenderer();
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static List<VertexFormatElement> getElements(VertexFormat vertexFormat) {
|
public static List<VertexFormatElement> getElements(VertexFormat vertexFormat) {
|
||||||
return vertexFormat.getElements();
|
return vertexFormat.getElements();
|
||||||
@@ -651,11 +437,7 @@ public class MCVer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Minecraft getMinecraft() {
|
public static Minecraft getMinecraft() {
|
||||||
//#if MC>=11300
|
|
||||||
return Minecraft.getInstance();
|
return Minecraft.getInstance();
|
||||||
//#else
|
|
||||||
//$$ return Minecraft.getMinecraft();
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long milliTime() {
|
public static long milliTime() {
|
||||||
@@ -666,22 +448,6 @@ public class MCVer {
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File Minecraft_mcDataDir(Minecraft mc) {
|
|
||||||
//#if MC>=11300
|
|
||||||
return mc.gameDir;
|
|
||||||
//#else
|
|
||||||
//$$ return mc.mcDataDir;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int floor(double val) {
|
|
||||||
//#if MC>=11102
|
|
||||||
return MathHelper.floor(val);
|
|
||||||
//#else
|
|
||||||
//$$ return MathHelper.floor_double(val);
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void bindTexture(ResourceLocation texture) {
|
public static void bindTexture(ResourceLocation texture) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
getMinecraft().getTextureManager().bindTexture(texture);
|
getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
@@ -698,34 +464,6 @@ public class MCVer {
|
|||||||
return MathHelper.sin(val);
|
return MathHelper.sin(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double interpPosX() {
|
|
||||||
//#if MC>=10904
|
|
||||||
return Particle.interpPosX;
|
|
||||||
//#else
|
|
||||||
//$$ return EntityFX.interpPosX;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double interpPosY() {
|
|
||||||
//#if MC>=10904
|
|
||||||
return Particle.interpPosY;
|
|
||||||
//#else
|
|
||||||
//$$ return EntityFX.interpPosY;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double interpPosZ() {
|
|
||||||
//#if MC>=10904
|
|
||||||
return Particle.interpPosZ;
|
|
||||||
//#else
|
|
||||||
//$$ return EntityFX.interpPosZ;
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ReportedException newReportedException(CrashReport crashReport) {
|
|
||||||
return new ReportedException(crashReport);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void openFile(File file) {
|
public static void openFile(File file) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
Util.getOSType().openFile(file);
|
Util.getOSType().openFile(file);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.replaymod.extras;
|
package com.replaymod.extras;
|
||||||
|
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.versions.MCVer;
|
|
||||||
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
|
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
|
||||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||||
import de.johni0702.minecraft.gui.container.GuiPanel;
|
import de.johni0702.minecraft.gui.container.GuiPanel;
|
||||||
@@ -100,7 +99,7 @@ public class OpenEyeExtra implements Extra {
|
|||||||
GuiPopup popup = new GuiPopup(OfferGui.this);
|
GuiPopup popup = new GuiPopup(OfferGui.this);
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
File targetFile = new File(MCVer.mcDataDir(mod.getMinecraft()), "mods/" + ReplayMod.getMinecraftVersion() + "/OpenEye.jar");
|
File targetFile = new File(mod.getMinecraft().gameDir, "mods/" + ReplayMod.getMinecraftVersion() + "/OpenEye.jar");
|
||||||
FileUtils.forceMkdir(targetFile.getParentFile());
|
FileUtils.forceMkdir(targetFile.getParentFile());
|
||||||
|
|
||||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(DOWNLOAD_URL).openConnection();
|
HttpsURLConnection connection = (HttpsURLConnection) new URL(DOWNLOAD_URL).openConnection();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.replaymod.extras.advancedscreenshots;
|
package com.replaymod.extras.advancedscreenshots;
|
||||||
|
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.versions.MCVer;
|
|
||||||
import com.replaymod.render.RenderSettings;
|
import com.replaymod.render.RenderSettings;
|
||||||
import com.replaymod.render.gui.GuiRenderSettings;
|
import com.replaymod.render.gui.GuiRenderSettings;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
@@ -82,12 +81,12 @@ public class GuiCreateScreenshot extends GuiRenderSettings implements Loadable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected File generateOutputFile(RenderSettings.EncodingPreset encodingPreset) {
|
protected File generateOutputFile(RenderSettings.EncodingPreset encodingPreset) {
|
||||||
File screenshotFolder = new File(MCVer.mcDataDir(getMinecraft()), "screenshots");
|
File screenshotFolder = new File(getMinecraft().gameDir, "screenshots");
|
||||||
return ScreenShotHelper.getTimestampedPNGFileForDirectory(screenshotFolder);
|
return ScreenShotHelper.getTimestampedPNGFileForDirectory(screenshotFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Path getSettingsPath() {
|
protected Path getSettingsPath() {
|
||||||
return MCVer.mcDataDir(getMinecraft()).toPath().resolve("config/replaymod-screenshotsettings.json");
|
return getMinecraft().gameDir.toPath().resolve("config/replaymod-screenshotsettings.json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ public class PlayerOverview implements Extra {
|
|||||||
if (module.getReplayHandler() != null) {
|
if (module.getReplayHandler() != null) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
List<EntityPlayer> players = world(mod.getMinecraft()).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
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.google.common.base.Suppliers;
|
|||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
import com.replaymod.core.versions.MCVer;
|
|
||||||
import com.replaymod.render.RenderSettings;
|
import com.replaymod.render.RenderSettings;
|
||||||
import com.replaymod.render.metadata.MetadataInjector;
|
import com.replaymod.render.metadata.MetadataInjector;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -79,7 +78,7 @@ public class YoutubeUploader {
|
|||||||
this.videoVisibility = videoVisibility;
|
this.videoVisibility = videoVisibility;
|
||||||
this.videoSnippet = videoSnippet;
|
this.videoSnippet = videoSnippet;
|
||||||
this.httpTransport = GoogleNetHttpTransport.newTrustedTransport();
|
this.httpTransport = GoogleNetHttpTransport.newTrustedTransport();
|
||||||
this.dataStoreFactory = new FileDataStoreFactory(MCVer.mcDataDir(minecraft));
|
this.dataStoreFactory = new FileDataStoreFactory(minecraft.gameDir);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class ReplayModOnline implements Module {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initClient() {
|
public void initClient() {
|
||||||
Path path = MCVer.mcDataDir(MCVer.getMinecraft()).toPath().resolve("config/replaymod-online.token");
|
Path path = MCVer.getMinecraft().gameDir.toPath().resolve("config/replaymod-online.token");
|
||||||
PlainFileAuthData authData = new PlainFileAuthData(path);
|
PlainFileAuthData authData = new PlainFileAuthData(path);
|
||||||
apiClient = new ApiClient(authData);
|
apiClient = new ApiClient(authData);
|
||||||
if (Files.notExists(path)) {
|
if (Files.notExists(path)) {
|
||||||
@@ -106,7 +106,7 @@ public class ReplayModOnline implements Module {
|
|||||||
*/
|
*/
|
||||||
private AuthData loadOldAuthData() {
|
private AuthData loadOldAuthData() {
|
||||||
//#if MC<11300
|
//#if MC<11300
|
||||||
//$$ Path path = MCVer.mcDataDir(MCVer.getMinecraft()).toPath().resolve("config/replaymod-online.cfg");
|
//$$ Path path = MCVer.getMinecraft().mcDataDir.toPath().resolve("config/replaymod-online.cfg");
|
||||||
//$$ Configuration config = new Configuration(path.toFile());
|
//$$ Configuration config = new Configuration(path.toFile());
|
||||||
//$$ ConfigurationAuthData authData = new ConfigurationAuthData(config);
|
//$$ ConfigurationAuthData authData = new ConfigurationAuthData(config);
|
||||||
//$$ authData.load(new ApiClient(authData));
|
//$$ authData.load(new ApiClient(authData));
|
||||||
@@ -139,7 +139,7 @@ public class ReplayModOnline implements Module {
|
|||||||
|
|
||||||
public File getDownloadsFolder() {
|
public File getDownloadsFolder() {
|
||||||
String path = core.getSettingsRegistry().get(Setting.DOWNLOAD_PATH);
|
String path = core.getSettingsRegistry().get(Setting.DOWNLOAD_PATH);
|
||||||
return new File(path.startsWith("./") ? mcDataDir(getMinecraft()) : null, path);
|
return new File(path.startsWith("./") ? getMinecraft().gameDir : null, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getDownloadedFile(int id) {
|
public File getDownloadedFile(int id) {
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
|
|
||||||
public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
|
public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
|
||||||
public static final int MIN_PW_LENGTH = 5;
|
public static final int MIN_PW_LENGTH = 5;
|
||||||
public static final int MAX_PW_LENGTH = 1024;
|
public static final int MAX_PW_LENGTH = 1024;
|
||||||
@@ -57,7 +55,7 @@ public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
|
|||||||
pos(cancelButton, width / 2 + 2, 170);
|
pos(cancelButton, width / 2 + 2, 170);
|
||||||
pos(statusLabel, width / 2 - statusLabel.getMinSize().getWidth() / 2, 152);
|
pos(statusLabel, width / 2 - statusLabel.getMinSize().getWidth() / 2, 152);
|
||||||
|
|
||||||
FontRenderer font = getFontRenderer(getMinecraft());
|
FontRenderer font = getMinecraft().fontRenderer;
|
||||||
int lineCount = font.listFormattedStringToWidth(disclaimerLabel.getText(), width - 10).size();
|
int lineCount = font.listFormattedStringToWidth(disclaimerLabel.getText(), width - 10).size();
|
||||||
Dimension dim = new Dimension(width - 10, font.FONT_HEIGHT * lineCount);
|
Dimension dim = new Dimension(width - 10, font.FONT_HEIGHT * lineCount);
|
||||||
disclaimerLabel.setSize(dim);
|
disclaimerLabel.setSize(dim);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import de.johni0702.minecraft.gui.utils.Colors;
|
|||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@@ -50,7 +51,6 @@ import java.io.IOException;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.newReportedException;
|
|
||||||
import static java.util.Arrays.stream;
|
import static java.util.Arrays.stream;
|
||||||
|
|
||||||
public class GuiUploadReplay extends GuiScreen {
|
public class GuiUploadReplay extends GuiScreen {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.replaymod.core.KeyBindingRegistry;
|
|||||||
import com.replaymod.core.Module;
|
import com.replaymod.core.Module;
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.utils.Restrictions;
|
import com.replaymod.core.utils.Restrictions;
|
||||||
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.recording.handler.ConnectionEventHandler;
|
import com.replaymod.recording.handler.ConnectionEventHandler;
|
||||||
import com.replaymod.recording.handler.GuiHandler;
|
import com.replaymod.recording.handler.GuiHandler;
|
||||||
import com.replaymod.recording.packet.PacketListener;
|
import com.replaymod.recording.packet.PacketListener;
|
||||||
@@ -12,25 +13,10 @@ import io.netty.channel.ChannelDuplexHandler;
|
|||||||
import io.netty.channel.ChannelHandler;
|
import io.netty.channel.ChannelHandler;
|
||||||
import io.netty.util.AttributeKey;
|
import io.netty.util.AttributeKey;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
|
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
|
||||||
//#else
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.fml.network.NetworkRegistry;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.network.NetworkRegistry;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.network.NetworkRegistry;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
|
||||||
public class ReplayModRecording implements Module {
|
public class ReplayModRecording implements Module {
|
||||||
|
|||||||
@@ -13,16 +13,7 @@ import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
|||||||
import net.minecraft.client.gui.GuiIngameMenu;
|
import net.minecraft.client.gui.GuiIngameMenu;
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.getGui;
|
import static com.replaymod.core.versions.MCVer.getGui;
|
||||||
|
|
||||||
|
|||||||
@@ -8,22 +8,12 @@ import net.minecraft.client.gui.Gui;
|
|||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//$$ import static com.replaymod.core.versions.MCVer.GlStateManager.*;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import static com.replaymod.core.ReplayMod.TEXTURE;
|
import static com.replaymod.core.ReplayMod.TEXTURE;
|
||||||
import static com.replaymod.core.ReplayMod.TEXTURE_SIZE;
|
import static com.replaymod.core.ReplayMod.TEXTURE_SIZE;
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders overlay during recording.
|
* Renders overlay during recording.
|
||||||
@@ -56,7 +46,7 @@ public class GuiRecordingOverlay {
|
|||||||
if (getType(event) != RenderGameOverlayEvent.ElementType.ALL) return;
|
if (getType(event) != RenderGameOverlayEvent.ElementType.ALL) return;
|
||||||
if (guiControls.isStopped()) return;
|
if (guiControls.isStopped()) return;
|
||||||
if (settingsRegistry.get(Setting.INDICATOR)) {
|
if (settingsRegistry.get(Setting.INDICATOR)) {
|
||||||
FontRenderer fontRenderer = getFontRenderer(mc);
|
FontRenderer fontRenderer = mc.fontRenderer;
|
||||||
String text = guiControls.isPaused() ? I18n.format("replaymod.gui.paused") : I18n.format("replaymod.gui.recording");
|
String text = guiControls.isPaused() ? I18n.format("replaymod.gui.paused") : I18n.format("replaymod.gui.recording");
|
||||||
fontRenderer.drawString(text.toUpperCase(), 30, 18 - (fontRenderer.FONT_HEIGHT / 2), 0xffffffff);
|
fontRenderer.drawString(text.toUpperCase(), 30, 18 - (fontRenderer.FONT_HEIGHT / 2), 0xffffffff);
|
||||||
bindTexture(TEXTURE);
|
bindTexture(TEXTURE);
|
||||||
|
|||||||
@@ -3,12 +3,7 @@
|
|||||||
//$$
|
//$$
|
||||||
//$$ import io.netty.channel.ChannelHandlerContext;
|
//$$ import io.netty.channel.ChannelHandlerContext;
|
||||||
//$$ import io.netty.channel.SimpleChannelInboundHandler;
|
//$$ import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
//$$
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage;
|
//$$ import net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage;
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.network.handshake.FMLHandshakeMessage;
|
|
||||||
//#endif
|
|
||||||
//$$
|
//$$
|
||||||
//$$ /**
|
//$$ /**
|
||||||
//$$ * Filters out all handshake packets that were sent for recording but must
|
//$$ * Filters out all handshake packets that were sent for recording but must
|
||||||
@@ -23,11 +18,7 @@
|
|||||||
//$$ public class FMLHandshakeFilter extends SimpleChannelInboundHandler<FMLHandshakeMessage> {
|
//$$ public class FMLHandshakeFilter extends SimpleChannelInboundHandler<FMLHandshakeMessage> {
|
||||||
//$$ @Override
|
//$$ @Override
|
||||||
//$$ protected void channelRead0(ChannelHandlerContext ctx, FMLHandshakeMessage msg) throws Exception {
|
//$$ protected void channelRead0(ChannelHandlerContext ctx, FMLHandshakeMessage msg) throws Exception {
|
||||||
//#if MC>=10800
|
|
||||||
//$$ if (!(msg instanceof FMLHandshakeMessage.RegistryData)) {
|
//$$ if (!(msg instanceof FMLHandshakeMessage.RegistryData)) {
|
||||||
//#else
|
|
||||||
//$$ if (!(msg instanceof FMLHandshakeMessage.ModIdData)) {
|
|
||||||
//#endif
|
|
||||||
//$$ // Pass on everything but RegistryData messages
|
//$$ // Pass on everything but RegistryData messages
|
||||||
//$$ ctx.fireChannelRead(msg);
|
//$$ ctx.fireChannelRead(msg);
|
||||||
//$$ }
|
//$$ }
|
||||||
|
|||||||
@@ -8,23 +8,10 @@ import de.johni0702.minecraft.gui.container.VanillaGuiScreen;
|
|||||||
import de.johni0702.minecraft.gui.element.GuiCheckbox;
|
import de.johni0702.minecraft.gui.element.GuiCheckbox;
|
||||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||||
import net.minecraft.client.gui.GuiMultiplayer;
|
import net.minecraft.client.gui.GuiMultiplayer;
|
||||||
//#if MC>=10904
|
|
||||||
import net.minecraft.client.gui.GuiWorldSelection;
|
import net.minecraft.client.gui.GuiWorldSelection;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.gui.GuiSelectWorld;
|
|
||||||
//#endif
|
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.getGui;
|
import static com.replaymod.core.versions.MCVer.getGui;
|
||||||
|
|
||||||
@@ -42,13 +29,8 @@ public class GuiHandler {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onGuiInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
public void onGuiInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||||
//#if MC>=10904
|
if (getGui(event) instanceof GuiWorldSelection || getGui(event) instanceof GuiMultiplayer) {
|
||||||
if (event.getGui() instanceof GuiWorldSelection || event.getGui() instanceof GuiMultiplayer) {
|
boolean sp = getGui(event) instanceof GuiWorldSelection;
|
||||||
boolean sp = event.getGui() instanceof GuiWorldSelection;
|
|
||||||
//#else
|
|
||||||
//$$ if (event.gui instanceof GuiSelectWorld || event.gui instanceof GuiMultiplayer) {
|
|
||||||
//$$ boolean sp = event.gui instanceof GuiSelectWorld;
|
|
||||||
//#endif
|
|
||||||
SettingsRegistry settingsRegistry = mod.getSettingsRegistry();
|
SettingsRegistry settingsRegistry = mod.getSettingsRegistry();
|
||||||
Setting<Boolean> setting = sp ? Setting.RECORD_SINGLEPLAYER : Setting.RECORD_SERVER;
|
Setting<Boolean> setting = sp ? Setting.RECORD_SINGLEPLAYER : Setting.RECORD_SERVER;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import net.minecraft.network.play.server.*;
|
|||||||
import net.minecraft.server.integrated.IntegratedServer;
|
import net.minecraft.server.integrated.IntegratedServer;
|
||||||
// FIXME not (yet?) 1.13 import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
|
// FIXME not (yet?) 1.13 import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
|
import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@@ -21,27 +24,12 @@ import net.minecraft.network.datasync.EntityDataManager;
|
|||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.SoundEvent;
|
import net.minecraft.util.SoundEvent;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraft.util.BlockPos;
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=11300
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
//$$ import net.minecraft.util.math.MathHelper;
|
||||||
//#endif
|
|
||||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -91,11 +79,7 @@ public class RecordingEventHandler {
|
|||||||
|
|
||||||
public void onPlayerJoin() {
|
public void onPlayerJoin() {
|
||||||
try {
|
try {
|
||||||
//#if MC>=10904
|
packetListener.save(new SPacketSpawnPlayer(mc.player));
|
||||||
packetListener.save(new SPacketSpawnPlayer(player(mc)));
|
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S0CPacketSpawnPlayer(player(mc)));
|
|
||||||
//#endif
|
|
||||||
} catch(Exception e1) {
|
} catch(Exception e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -103,11 +87,7 @@ public class RecordingEventHandler {
|
|||||||
|
|
||||||
public void onPlayerRespawn() {
|
public void onPlayerRespawn() {
|
||||||
try {
|
try {
|
||||||
//#if MC>=10904
|
packetListener.save(new SPacketSpawnPlayer(mc.player));
|
||||||
packetListener.save(new SPacketSpawnPlayer(player(mc)));
|
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S0CPacketSpawnPlayer(player(mc)));
|
|
||||||
//#endif
|
|
||||||
lastX = lastY = lastZ = null;
|
lastX = lastY = lastZ = null;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -136,9 +116,9 @@ public class RecordingEventHandler {
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPlayerTick(PlayerTickEvent e) {
|
public void onPlayerTick(TickEvent.PlayerTickEvent e) {
|
||||||
try {
|
try {
|
||||||
if(e.player != player(mc)) 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) {
|
||||||
@@ -164,11 +144,8 @@ public class RecordingEventHandler {
|
|||||||
|
|
||||||
Packet packet;
|
Packet packet;
|
||||||
if (force || Math.abs(dx) > 8.0 || Math.abs(dy) > 8.0 || Math.abs(dz) > 8.0) {
|
if (force || Math.abs(dx) > 8.0 || Math.abs(dy) > 8.0 || Math.abs(dz) > 8.0) {
|
||||||
//#if MC>=10904
|
|
||||||
packet = new SPacketEntityTeleport(e.player);
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//$$ packet = new S18PacketEntityTeleport(e.player);
|
packet = new SPacketEntityTeleport(e.player);
|
||||||
//#else
|
//#else
|
||||||
//$$ // In 1.7.10 the client player entity has its posY at eye height
|
//$$ // In 1.7.10 the client player entity has its posY at eye height
|
||||||
//$$ // but for all other entities it's at their feet (as it should be).
|
//$$ // but for all other entities it's at their feet (as it should be).
|
||||||
@@ -176,20 +153,15 @@ public class RecordingEventHandler {
|
|||||||
//$$ // Note: this leaves the lastY value offset by the eye height but because it's only used for relative
|
//$$ // Note: this leaves the lastY value offset by the eye height but because it's only used for relative
|
||||||
//$$ // movement, that doesn't matter.
|
//$$ // movement, that doesn't matter.
|
||||||
//$$ S18PacketEntityTeleport teleportPacket = new S18PacketEntityTeleport(e.player);
|
//$$ S18PacketEntityTeleport teleportPacket = new S18PacketEntityTeleport(e.player);
|
||||||
//$$ teleportPacket.field_149457_c = floor(e.player.boundingBox.minY * 32);
|
//$$ teleportPacket.field_149457_c = MathHelper.floor(e.player.boundingBox.minY * 32);
|
||||||
//$$ packet = teleportPacket;
|
//$$ packet = teleportPacket;
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
} else {
|
} else {
|
||||||
byte newYaw = (byte) ((int) (e.player.rotationYaw * 256.0F / 360.0F));
|
byte newYaw = (byte) ((int) (e.player.rotationYaw * 256.0F / 360.0F));
|
||||||
byte newPitch = (byte) ((int) (e.player.rotationPitch * 256.0F / 360.0F));
|
byte newPitch = (byte) ((int) (e.player.rotationPitch * 256.0F / 360.0F));
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
//#if MC>=11300
|
|
||||||
packet = new SPacketEntity.Move(
|
packet = new SPacketEntity.Move(
|
||||||
//#else
|
|
||||||
//$$ packet = new SPacketEntity.S17PacketEntityLookMove(
|
|
||||||
//#endif
|
|
||||||
e.player.getEntityId(),
|
e.player.getEntityId(),
|
||||||
(short) Math.round(dx * 4096), (short) Math.round(dy * 4096), (short) Math.round(dz * 4096),
|
(short) Math.round(dx * 4096), (short) Math.round(dy * 4096), (short) Math.round(dz * 4096),
|
||||||
newYaw, newPitch, e.player.onGround
|
newYaw, newPitch, e.player.onGround
|
||||||
@@ -211,28 +183,23 @@ public class RecordingEventHandler {
|
|||||||
int rotationYawHead = ((int)(e.player.rotationYawHead * 256.0F / 360.0F));
|
int rotationYawHead = ((int)(e.player.rotationYawHead * 256.0F / 360.0F));
|
||||||
|
|
||||||
if(!Objects.equals(rotationYawHead, rotationYawHeadBefore)) {
|
if(!Objects.equals(rotationYawHead, rotationYawHeadBefore)) {
|
||||||
//#if MC>=10904
|
|
||||||
packetListener.save(new SPacketEntityHeadLook(e.player, (byte) rotationYawHead));
|
packetListener.save(new SPacketEntityHeadLook(e.player, (byte) rotationYawHead));
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S19PacketEntityHeadLook(e.player, (byte) rotationYawHead));
|
|
||||||
//#endif
|
|
||||||
rotationYawHeadBefore = rotationYawHead;
|
rotationYawHeadBefore = rotationYawHead;
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
packetListener.save(new SPacketEntityVelocity(e.player.getEntityId(), e.player.motionX, e.player.motionY, e.player.motionZ));
|
packetListener.save(new SPacketEntityVelocity(e.player.getEntityId(), e.player.motionX, e.player.motionY, e.player.motionZ));
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S12PacketEntityVelocity(e.player.getEntityId(), e.player.motionX, e.player.motionY, e.player.motionZ));
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//Animation Packets
|
//Animation Packets
|
||||||
//Swing Animation
|
//Swing Animation
|
||||||
if (e.player.isSwingInProgress && e.player.swingProgressInt == -1) {
|
if (e.player.isSwingInProgress && e.player.swingProgressInt == -1) {
|
||||||
|
packetListener.save(new SPacketAnimation(
|
||||||
|
e.player,
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
packetListener.save(new SPacketAnimation(e.player, e.player.swingingHand == EnumHand.MAIN_HAND ? 0 : 3));
|
e.player.swingingHand == EnumHand.MAIN_HAND ? 0 : 3
|
||||||
//#else
|
//#else
|
||||||
//$$ packetListener.save(new S0BPacketAnimation(e.player, 0));
|
//$$ 0
|
||||||
//#endif
|
//#endif
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -257,33 +224,33 @@ public class RecordingEventHandler {
|
|||||||
|
|
||||||
//Inventory Handling
|
//Inventory Handling
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
if (playerItems[0] != player(mc).getHeldItem(EnumHand.MAIN_HAND)) {
|
if (playerItems[0] != mc.player.getHeldItem(EnumHand.MAIN_HAND)) {
|
||||||
playerItems[0] = player(mc).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] != player(mc).getHeldItem(EnumHand.OFF_HAND)) {
|
if (playerItems[1] != mc.player.getHeldItem(EnumHand.OFF_HAND)) {
|
||||||
playerItems[1] = player(mc).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] != player(mc).getItemStackFromSlot(EntityEquipmentSlot.FEET)) {
|
if (playerItems[2] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.FEET)) {
|
||||||
playerItems[2] = player(mc).getItemStackFromSlot(EntityEquipmentSlot.FEET);
|
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] != player(mc).getItemStackFromSlot(EntityEquipmentSlot.LEGS)) {
|
if (playerItems[3] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.LEGS)) {
|
||||||
playerItems[3] = player(mc).getItemStackFromSlot(EntityEquipmentSlot.LEGS);
|
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] != player(mc).getItemStackFromSlot(EntityEquipmentSlot.CHEST)) {
|
if (playerItems[4] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.CHEST)) {
|
||||||
playerItems[4] = player(mc).getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
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] != player(mc).getItemStackFromSlot(EntityEquipmentSlot.HEAD)) {
|
if (playerItems[5] != mc.player.getItemStackFromSlot(EntityEquipmentSlot.HEAD)) {
|
||||||
playerItems[5] = player(mc).getItemStackFromSlot(EntityEquipmentSlot.HEAD);
|
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]));
|
||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
@@ -320,41 +287,32 @@ public class RecordingEventHandler {
|
|||||||
|
|
||||||
//Leaving Ride
|
//Leaving Ride
|
||||||
|
|
||||||
//#if MC>=11300
|
if((!mc.player.isPassenger() && lastRiding != -1) ||
|
||||||
if((!player(mc).isPassenger() && lastRiding != -1) ||
|
(mc.player.isPassenger() && lastRiding != getRidingEntity(mc.player).getEntityId())) {
|
||||||
(player(mc).isPassenger() && lastRiding != getRidingEntity(player(mc)).getEntityId())) {
|
if(!mc.player.isPassenger()) {
|
||||||
if(!player(mc).isPassenger()) {
|
|
||||||
//#else
|
|
||||||
//$$ if((!player(mc).isRiding() && lastRiding != -1) ||
|
|
||||||
//$$ (player(mc).isRiding() && lastRiding != getRidingEntity(player(mc)).getEntityId())) {
|
|
||||||
//$$ if(!player(mc).isRiding()) {
|
|
||||||
//#endif
|
|
||||||
lastRiding = -1;
|
lastRiding = -1;
|
||||||
} else {
|
} else {
|
||||||
lastRiding = getRidingEntity(player(mc)).getEntityId();
|
lastRiding = getRidingEntity(mc.player).getEntityId();
|
||||||
}
|
}
|
||||||
//#if MC>=10904
|
packetListener.save(new SPacketEntityAttach(
|
||||||
packetListener.save(new SPacketEntityAttach(e.player, getRidingEntity(e.player)));
|
//#if MC<10904
|
||||||
//#else
|
//$$ 0,
|
||||||
//$$ packetListener.save(new S1BPacketEntityAttach(0, e.player, getRidingEntity(e.player)));
|
|
||||||
//#endif
|
//#endif
|
||||||
|
e.player, getRidingEntity(e.player)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sleeping
|
//Sleeping
|
||||||
if(!player(mc).isPlayerSleeping() && wasSleeping) {
|
if(!mc.player.isPlayerSleeping() && wasSleeping) {
|
||||||
//#if MC>=10904
|
|
||||||
packetListener.save(new SPacketAnimation(e.player, 2));
|
packetListener.save(new SPacketAnimation(e.player, 2));
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S0BPacketAnimation(e.player, 2));
|
|
||||||
//#endif
|
|
||||||
wasSleeping = false;
|
wasSleeping = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
// Active hand (e.g. eating, drinking, blocking)
|
// Active hand (e.g. eating, drinking, blocking)
|
||||||
if (player(mc).isHandActive() ^ wasHandActive || player(mc).getActiveHand() != lastActiveHand) {
|
if (mc.player.isHandActive() ^ wasHandActive || mc.player.getActiveHand() != lastActiveHand) {
|
||||||
wasHandActive = player(mc).isHandActive();
|
wasHandActive = mc.player.isHandActive();
|
||||||
lastActiveHand = player(mc).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);
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@@ -362,7 +320,7 @@ public class RecordingEventHandler {
|
|||||||
//#else
|
//#else
|
||||||
//$$ dataManager.register(EntityLiving.HAND_STATES, (byte) state);
|
//$$ dataManager.register(EntityLiving.HAND_STATES, (byte) state);
|
||||||
//#endif
|
//#endif
|
||||||
packetListener.save(new SPacketEntityMetadata(player(mc).getEntityId(), dataManager, true));
|
packetListener.save(new SPacketEntityMetadata(mc.player.getEntityId(), dataManager, true));
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -392,11 +350,7 @@ public class RecordingEventHandler {
|
|||||||
//$$ event.pickedUp.getEntityItem().getMaxStackSize()));
|
//$$ event.pickedUp.getEntityItem().getMaxStackSize()));
|
||||||
//#endif
|
//#endif
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10904
|
|
||||||
//$$ packetListener.save(new SPacketCollectItem(event.pickedUp.getEntityId(), event.player.getEntityId()));
|
//$$ packetListener.save(new SPacketCollectItem(event.pickedUp.getEntityId(), event.player.getEntityId()));
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S0DPacketCollectItem(event.pickedUp.getEntityId(), event.player.getEntityId()));
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -407,13 +361,13 @@ public class RecordingEventHandler {
|
|||||||
public void onSleep(PlayerSleepInBedEvent event) {
|
public void onSleep(PlayerSleepInBedEvent event) {
|
||||||
try {
|
try {
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
if (event.getEntityPlayer() != player(mc)) {
|
if (event.getEntityPlayer() != mc.player) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
packetListener.save(new SPacketUseBed(event.getEntityPlayer(), event.getPos()));
|
packetListener.save(new SPacketUseBed(event.getEntityPlayer(), event.getPos()));
|
||||||
//#else
|
//#else
|
||||||
//$$ if (event.entityPlayer != player(mc)) {
|
//$$ if (event.entityPlayer != mc.thePlayer) {
|
||||||
//$$ return;
|
//$$ return;
|
||||||
//$$ }
|
//$$ }
|
||||||
//$$
|
//$$
|
||||||
@@ -438,7 +392,7 @@ public class RecordingEventHandler {
|
|||||||
public void enterMinecart(MinecartInteractEvent event) {
|
public void enterMinecart(MinecartInteractEvent event) {
|
||||||
try {
|
try {
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
if(event.getEntity() != player(mc)) {
|
if(event.getEntity() != mc.player) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,7 +400,7 @@ public class RecordingEventHandler {
|
|||||||
|
|
||||||
lastRiding = event.getMinecart().getEntityId();
|
lastRiding = event.getMinecart().getEntityId();
|
||||||
//#else
|
//#else
|
||||||
//$$ if(event.entity != player(mc)) {
|
//$$ if(event.entity != mc.thePlayer) {
|
||||||
//$$ return;
|
//$$ return;
|
||||||
//$$ }
|
//$$ }
|
||||||
//$$
|
//$$
|
||||||
@@ -465,19 +419,15 @@ public class RecordingEventHandler {
|
|||||||
//#else
|
//#else
|
||||||
//$$ public void onBlockBreakAnim(int breakerId, int x, int y, int z, int progress) {
|
//$$ public void onBlockBreakAnim(int breakerId, int x, int y, int z, int progress) {
|
||||||
//#endif
|
//#endif
|
||||||
EntityPlayer thePlayer = player(mc);
|
EntityPlayer thePlayer = mc.player;
|
||||||
if (thePlayer != null && breakerId == thePlayer.getEntityId()) {
|
if (thePlayer != null && breakerId == thePlayer.getEntityId()) {
|
||||||
//#if MC>=10904
|
packetListener.save(new SPacketBlockBreakAnim(breakerId,
|
||||||
packetListener.save(new SPacketBlockBreakAnim(breakerId, pos, progress));
|
|
||||||
//#else
|
|
||||||
//$$ packetListener.save(new S25PacketBlockBreakAnim(breakerId,
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//$$ pos,
|
pos,
|
||||||
//#else
|
//#else
|
||||||
//$$ x, y, z,
|
//$$ x, y, z,
|
||||||
//#endif
|
//#endif
|
||||||
//$$ progress));
|
progress));
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,7 @@ import com.replaymod.core.versions.MCVer;
|
|||||||
import com.replaymod.recording.handler.RecordingEventHandler.RecordingEventSender;
|
import com.replaymod.recording.handler.RecordingEventHandler.RecordingEventSender;
|
||||||
import net.minecraft.network.login.server.SPacketCustomPayloadLogin;
|
import net.minecraft.network.login.server.SPacketCustomPayloadLogin;
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.common.network.FMLNetworkEvent;
|
//$$ import net.minecraftforge.fml.common.network.FMLNetworkEvent;
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.network.FMLNetworkEvent;
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@Mixin(NetHandlerLoginClient.class)
|
@Mixin(NetHandlerLoginClient.class)
|
||||||
|
|||||||
@@ -12,20 +12,12 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=10904
|
import net.minecraft.network.play.server.SPacketPlayerListItem;
|
||||||
import net.minecraft.network.play.server.SPacketPlayerListItem.Action;
|
|
||||||
import net.minecraft.network.play.server.SPacketPlayerListItem.AddPlayerData;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.network.play.server.S38PacketPlayerListItem.Action;
|
|
||||||
//$$ import net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData;
|
|
||||||
//#endif
|
|
||||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@Mixin(NetHandlerPlayClient.class)
|
@Mixin(NetHandlerPlayClient.class)
|
||||||
@@ -51,20 +43,21 @@ public abstract class MixinNetHandlerPlayClient {
|
|||||||
*/
|
*/
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
@Inject(method = "handlePlayerListItem", at=@At("HEAD"))
|
@Inject(method = "handlePlayerListItem", at=@At("HEAD"))
|
||||||
//#if MC>=10809
|
|
||||||
//#if MC>=10904
|
|
||||||
public void recordOwnJoin(SPacketPlayerListItem packet, CallbackInfo ci) {
|
public void recordOwnJoin(SPacketPlayerListItem packet, CallbackInfo ci) {
|
||||||
//#else
|
if (gameController.player == null) return;
|
||||||
//$$ public void recordOwnJoin(S38PacketPlayerListItem packet, CallbackInfo ci) {
|
|
||||||
//#endif
|
|
||||||
if (player(gameController) == null) return;
|
|
||||||
|
|
||||||
RecordingEventHandler handler = getRecordingEventHandler();
|
RecordingEventHandler handler = getRecordingEventHandler();
|
||||||
if (handler != null && packet.getAction() == Action.ADD_PLAYER) {
|
if (handler != null && packet.getAction() == SPacketPlayerListItem.Action.ADD_PLAYER) {
|
||||||
for (AddPlayerData data : packet.getEntries()) {
|
//#if MC>=10809
|
||||||
|
List<SPacketPlayerListItem.AddPlayerData> entries = packet.getEntries();
|
||||||
|
//#else
|
||||||
|
//$$ @SuppressWarnings("unchecked")
|
||||||
|
//$$ List<S38PacketPlayerListItem.AddPlayerData> entries = packet.func_179767_a();
|
||||||
|
//#endif
|
||||||
|
for (SPacketPlayerListItem.AddPlayerData data : entries) {
|
||||||
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(player(gameController).getGameProfile().getId())
|
if (data.getProfile().getId().equals(gameController.player.getGameProfile().getId())
|
||||||
&& !playerInfoMap.containsKey(data.getProfile().getId())) {
|
&& !playerInfoMap.containsKey(data.getProfile().getId())) {
|
||||||
handler.onPlayerJoin();
|
handler.onPlayerJoin();
|
||||||
}
|
}
|
||||||
@@ -72,25 +65,6 @@ public abstract class MixinNetHandlerPlayClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//$$ public void recordOwnJoin(S38PacketPlayerListItem packet, CallbackInfo ci) {
|
|
||||||
//$$ if (gameController.thePlayer == null) return;
|
|
||||||
//$$
|
|
||||||
//$$ RecordingEventHandler handler = getRecordingEventHandler();
|
|
||||||
//$$ if (handler != null && packet.func_179768_b() == S38PacketPlayerListItem.Action.ADD_PLAYER) {
|
|
||||||
//$$ @SuppressWarnings("unchecked")
|
|
||||||
//$$ List<S38PacketPlayerListItem.AddPlayerData> dataList = packet.func_179767_a();
|
|
||||||
//$$ for (S38PacketPlayerListItem.AddPlayerData data : dataList) {
|
|
||||||
//$$ if (data.func_179962_a() == null || data.func_179962_a().getId() == null) continue;
|
|
||||||
//$$ // Only add spawn packet for our own player and only if he isn't known yet
|
|
||||||
//$$ if (data.func_179962_a().getId().equals(Minecraft.getMinecraft().thePlayer.getGameProfile().getId())
|
|
||||||
//$$ && !playerInfoMap.containsKey(data.func_179962_a().getId())) {
|
|
||||||
//$$ handler.onPlayerJoin();
|
|
||||||
//$$ }
|
|
||||||
//$$ }
|
|
||||||
//$$ }
|
|
||||||
//$$ }
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ @Inject(method = "handleJoinGame", at=@At("RETURN"))
|
//$$ @Inject(method = "handleJoinGame", at=@At("RETURN"))
|
||||||
//$$ public void recordOwnJoin(S01PacketJoinGame packet, CallbackInfo ci) {
|
//$$ public void recordOwnJoin(S01PacketJoinGame packet, CallbackInfo ci) {
|
||||||
//$$ RecordingEventHandler handler = getRecordingEventHandler();
|
//$$ RecordingEventHandler handler = getRecordingEventHandler();
|
||||||
@@ -108,11 +82,7 @@ public abstract class MixinNetHandlerPlayClient {
|
|||||||
* @param ci Callback info
|
* @param ci Callback info
|
||||||
*/
|
*/
|
||||||
@Inject(method = "handleRespawn", at=@At("RETURN"))
|
@Inject(method = "handleRespawn", at=@At("RETURN"))
|
||||||
//#if MC>=10904
|
|
||||||
public void recordOwnRespawn(SPacketRespawn packet, CallbackInfo ci) {
|
public void recordOwnRespawn(SPacketRespawn packet, CallbackInfo ci) {
|
||||||
//#else
|
|
||||||
//$$ public void recordOwnRespawn(S07PacketRespawn packet, CallbackInfo ci) {
|
|
||||||
//#endif
|
|
||||||
RecordingEventHandler handler = getRecordingEventHandler();
|
RecordingEventHandler handler = getRecordingEventHandler();
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
handler.onPlayerRespawn();
|
handler.onPlayerRespawn();
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
//$$ import com.replaymod.recording.handler.FMLHandshakeFilter;
|
//$$ import com.replaymod.recording.handler.FMLHandshakeFilter;
|
||||||
//$$ import io.netty.channel.ChannelPipeline;
|
//$$ import io.netty.channel.ChannelPipeline;
|
||||||
//$$ import io.netty.channel.embedded.EmbeddedChannel;
|
//$$ import io.netty.channel.embedded.EmbeddedChannel;
|
||||||
|
//$$ import net.minecraftforge.fml.common.network.handshake.FMLHandshakeCodec;
|
||||||
|
//$$ import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
||||||
|
//$$ import net.minecraftforge.fml.relauncher.Side;
|
||||||
//$$ import org.spongepowered.asm.mixin.Mixin;
|
//$$ import org.spongepowered.asm.mixin.Mixin;
|
||||||
//$$ import org.spongepowered.asm.mixin.Shadow;
|
//$$ import org.spongepowered.asm.mixin.Shadow;
|
||||||
//$$ import org.spongepowered.asm.mixin.injection.At;
|
//$$ import org.spongepowered.asm.mixin.injection.At;
|
||||||
@@ -17,16 +20,6 @@
|
|||||||
//$$ import org.spongepowered.asm.mixin.injection.Redirect;
|
//$$ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
//#endif
|
//#endif
|
||||||
//$$
|
//$$
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.common.network.handshake.FMLHandshakeCodec;
|
|
||||||
//$$ import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
|
||||||
//$$ import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.network.handshake.FMLHandshakeCodec;
|
|
||||||
//$$ import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
|
|
||||||
//$$ import cpw.mods.fml.relauncher.Side;
|
|
||||||
//#endif
|
|
||||||
//$$
|
|
||||||
//$$ @Mixin(value = NetworkDispatcher.class, remap = false)
|
//$$ @Mixin(value = NetworkDispatcher.class, remap = false)
|
||||||
//$$ public abstract class MixinNetworkDispatcher {
|
//$$ public abstract class MixinNetworkDispatcher {
|
||||||
//$$
|
//$$
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ package com.replaymod.recording.mixin;
|
|||||||
//$$ @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(player(mc), type, pos, data);
|
//$$ world.playEvent(mc.player, type, pos, data);
|
||||||
//$$ }
|
//$$ }
|
||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -1,30 +1,17 @@
|
|||||||
package com.replaymod.recording.mixin;
|
package com.replaymod.recording.mixin;
|
||||||
|
|
||||||
import com.replaymod.recording.handler.RecordingEventHandler;
|
import com.replaymod.recording.handler.RecordingEventHandler;
|
||||||
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.renderer.RenderGlobal;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//$$ import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
@Mixin(WorldRenderer.class)
|
@Mixin(WorldRenderer.class)
|
||||||
//#else
|
|
||||||
//$$ @Mixin(RenderGlobal.class)
|
|
||||||
//#endif
|
|
||||||
public abstract class MixinRenderGlobal implements RecordingEventHandler.RecordingEventSender {
|
public abstract class MixinRenderGlobal implements RecordingEventHandler.RecordingEventSender {
|
||||||
|
|
||||||
private RecordingEventHandler recordingEventHandler;
|
private RecordingEventHandler recordingEventHandler;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import net.minecraft.world.storage.WorldSavedDataStorage;
|
|||||||
//$$ import net.minecraft.world.WorldProvider;
|
//$$ import net.minecraft.world.WorldProvider;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
|
|
||||||
@Mixin(WorldClient.class)
|
@Mixin(WorldClient.class)
|
||||||
public abstract class MixinWorldClient extends World implements RecordingEventHandler.RecordingEventSender {
|
public abstract class MixinWorldClient extends World implements RecordingEventHandler.RecordingEventSender {
|
||||||
@@ -62,7 +61,7 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
|||||||
at = @At("HEAD"))
|
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 == player(mc)) {
|
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);
|
||||||
@@ -74,7 +73,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 == player(mc)) {
|
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) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import net.minecraft.network.EnumConnectionState;
|
|||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.network.play.server.*;
|
import net.minecraft.network.play.server.*;
|
||||||
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@@ -30,10 +31,8 @@ import net.minecraft.network.login.server.SPacketLoginSuccess;
|
|||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
import net.minecraft.network.datasync.EntityDataManager;
|
import net.minecraft.network.datasync.EntityDataManager;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.entity.DataWatcher;
|
//$$ import net.minecraft.entity.DataWatcher;
|
||||||
//$$ import net.minecraft.util.ChatComponentText;
|
|
||||||
//$$
|
//$$
|
||||||
//$$ import java.util.List;
|
//$$ import java.util.List;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -125,20 +124,11 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
public void save(Packet packet) {
|
public void save(Packet packet) {
|
||||||
try {
|
try {
|
||||||
//#if MC>=10904
|
|
||||||
if(packet instanceof SPacketSpawnPlayer) {
|
if(packet instanceof SPacketSpawnPlayer) {
|
||||||
|
//#if MC>=10800
|
||||||
UUID uuid = ((SPacketSpawnPlayer) packet).getUniqueId();
|
UUID uuid = ((SPacketSpawnPlayer) packet).getUniqueId();
|
||||||
//#else
|
//#else
|
||||||
//$$ if(packet instanceof S0CPacketSpawnPlayer) {
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ UUID uuid = ((S0CPacketSpawnPlayer) packet).getPlayer();
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ UUID uuid = ((S0CPacketSpawnPlayer) packet).func_179819_c();
|
|
||||||
//#else
|
|
||||||
//$$ UUID uuid = ((S0CPacketSpawnPlayer) packet).field_148955_b.getId();
|
//$$ UUID uuid = ((S0CPacketSpawnPlayer) packet).field_148955_b.getId();
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
Set<String> uuids = new HashSet<>(Arrays.asList(metaData.getPlayers()));
|
Set<String> uuids = new HashSet<>(Arrays.asList(metaData.getPlayers()));
|
||||||
uuids.add(uuid.toString());
|
uuids.add(uuid.toString());
|
||||||
@@ -238,15 +228,15 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
if(packet instanceof SPacketCollectItem) {
|
if(packet instanceof SPacketCollectItem) {
|
||||||
if(player(mc) != null ||
|
if(mc.player != null ||
|
||||||
((SPacketCollectItem) packet).getEntityID() == player(mc).getEntityId()) {
|
((SPacketCollectItem) packet).getEntityID() == mc.player.getEntityId()) {
|
||||||
//#else
|
//#else
|
||||||
//$$ if(packet instanceof S0DPacketCollectItem) {
|
//$$ if(packet instanceof S0DPacketCollectItem) {
|
||||||
//$$ if(player(mc) != null ||
|
//$$ if(mc.thePlayer != null ||
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
//$$ ((S0DPacketCollectItem) packet).getEntityID() == player(mc).getEntityId()) {
|
//$$ ((S0DPacketCollectItem) packet).getEntityID() == mc.thePlayer.getEntityId()) {
|
||||||
//#else
|
//#else
|
||||||
//$$ ((S0DPacketCollectItem) packet).func_149353_d() == player(mc).getEntityId()) {
|
//$$ ((S0DPacketCollectItem) packet).func_149353_d() == mc.thePlayer.getEntityId()) {
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
super.channelRead(ctx, msg);
|
super.channelRead(ctx, msg);
|
||||||
@@ -254,18 +244,12 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10800
|
||||||
if (packet instanceof SPacketResourcePackSend) {
|
if (packet instanceof SPacketResourcePackSend) {
|
||||||
save(resourcePackRecorder.handleResourcePack((SPacketResourcePackSend) packet));
|
save(resourcePackRecorder.handleResourcePack((SPacketResourcePackSend) packet));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//#if MC>=10800
|
|
||||||
//$$ if (packet instanceof S48PacketResourcePackSend) {
|
|
||||||
//$$ save(resourcePackRecorder.handleResourcePack((S48PacketResourcePackSend) packet));
|
|
||||||
//$$ return;
|
|
||||||
//$$ }
|
|
||||||
//#else
|
|
||||||
//$$ if (packet instanceof S3FPacketCustomPayload) {
|
//$$ if (packet instanceof S3FPacketCustomPayload) {
|
||||||
//$$ S3FPacketCustomPayload p = (S3FPacketCustomPayload) packet;
|
//$$ S3FPacketCustomPayload p = (S3FPacketCustomPayload) packet;
|
||||||
//$$ if ("MC|RPack".equals(p.func_149169_c())) {
|
//$$ if ("MC|RPack".equals(p.func_149169_c())) {
|
||||||
@@ -274,7 +258,6 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
//$$ }
|
//$$ }
|
||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC<11300
|
//#if MC<11300
|
||||||
//$$ if (packet instanceof FMLProxyPacket) {
|
//$$ if (packet instanceof FMLProxyPacket) {
|
||||||
@@ -291,22 +274,10 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
save(packet);
|
save(packet);
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if (packet instanceof SPacketCustomPayload) {
|
if (packet instanceof SPacketCustomPayload) {
|
||||||
SPacketCustomPayload p = (SPacketCustomPayload) packet;
|
SPacketCustomPayload p = (SPacketCustomPayload) packet;
|
||||||
if (Restrictions.PLUGIN_CHANNEL.equals(p.getChannelName())) {
|
if (Restrictions.PLUGIN_CHANNEL.equals(p.getChannelName())) {
|
||||||
packet = new SPacketDisconnect(new TextComponentString("Please update to view this replay."));
|
packet = new SPacketDisconnect(new TextComponentString("Please update to view this replay."));
|
||||||
//#else
|
|
||||||
//$$ if (packet instanceof S3FPacketCustomPayload) {
|
|
||||||
//$$ S3FPacketCustomPayload p = (S3FPacketCustomPayload) packet;
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ String channelName = p.getChannelName();
|
|
||||||
//#else
|
|
||||||
//$$ String channelName = p.func_149169_c();
|
|
||||||
//#endif
|
|
||||||
//$$ if (Restrictions.PLUGIN_CHANNEL.equals(channelName)) {
|
|
||||||
//$$ packet = new S40PacketDisconnect(new ChatComponentText("Please update to view this replay."));
|
|
||||||
//#endif
|
|
||||||
save(packet);
|
save(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -395,7 +366,7 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
ByteBuf byteBuf = Unpooled.buffer();
|
ByteBuf byteBuf = Unpooled.buffer();
|
||||||
PacketBuffer packetBuffer = new PacketBuffer(byteBuf);
|
PacketBuffer packetBuffer = new PacketBuffer(byteBuf);
|
||||||
writeVarInt(packetBuffer, packetId);
|
packetBuffer.writeVarInt(packetId);
|
||||||
packet.writePacketData(packetBuffer);
|
packet.writePacketData(packetBuffer);
|
||||||
|
|
||||||
byteBuf.readerIndex(0);
|
byteBuf.readerIndex(0);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.client.gui.GuiYesNo;
|
import net.minecraft.client.gui.GuiYesNo;
|
||||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
|
import net.minecraft.client.multiplayer.ServerList;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@@ -20,17 +21,10 @@ import net.minecraft.client.resources.DownloadingPackFinder;
|
|||||||
//$$ import net.minecraft.util.HttpUtil;
|
//$$ import net.minecraft.util.HttpUtil;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10904
|
//#if MC>=10800
|
||||||
import net.minecraft.network.play.client.CPacketResourcePackStatus;
|
import net.minecraft.network.play.client.CPacketResourcePackStatus;
|
||||||
import net.minecraft.network.play.client.CPacketResourcePackStatus.Action;
|
import net.minecraft.network.play.client.CPacketResourcePackStatus.Action;
|
||||||
import net.minecraft.network.play.server.SPacketResourcePackSend;
|
import net.minecraft.network.play.server.SPacketResourcePackSend;
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraft.network.play.client.C19PacketResourcePackStatus;
|
|
||||||
//$$ import net.minecraft.network.play.client.C19PacketResourcePackStatus.Action;
|
|
||||||
//$$ import net.minecraft.network.play.server.S48PacketResourcePackSend;
|
|
||||||
//#else
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
@@ -106,7 +100,6 @@ public class ResourcePackRecorder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=10904
|
|
||||||
public CPacketResourcePackStatus makeStatusPacket(String hash, Action action) {
|
public CPacketResourcePackStatus makeStatusPacket(String hash, Action action) {
|
||||||
//#if MC>=11002
|
//#if MC>=11002
|
||||||
return new CPacketResourcePackStatus(action);
|
return new CPacketResourcePackStatus(action);
|
||||||
@@ -114,32 +107,18 @@ public class ResourcePackRecorder {
|
|||||||
//$$ return new CPacketResourcePackStatus(hash, action);
|
//$$ return new CPacketResourcePackStatus(hash, action);
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
//#else
|
|
||||||
//$$ public C19PacketResourcePackStatus makeStatusPacket(String hash, Action action) {
|
|
||||||
//$$ return new C19PacketResourcePackStatus(hash, action);
|
|
||||||
//$$ }
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
public synchronized SPacketResourcePackSend handleResourcePack(SPacketResourcePackSend packet) {
|
public synchronized SPacketResourcePackSend handleResourcePack(SPacketResourcePackSend packet) {
|
||||||
//#else
|
|
||||||
//$$ public synchronized S48PacketResourcePackSend handleResourcePack(S48PacketResourcePackSend packet) {
|
|
||||||
//#endif
|
|
||||||
final int requestId = nextRequestId++;
|
final int requestId = nextRequestId++;
|
||||||
final NetHandlerPlayClient netHandler = getConnection(mc);
|
final NetHandlerPlayClient netHandler = mc.getConnection();
|
||||||
final NetworkManager netManager = netHandler.getNetworkManager();
|
final NetworkManager netManager = netHandler.getNetworkManager();
|
||||||
//#if MC>=10809
|
|
||||||
final String url = packet.getURL();
|
final String url = packet.getURL();
|
||||||
final String hash = packet.getHash();
|
final String hash = packet.getHash();
|
||||||
//#else
|
|
||||||
//$$ final String url = packet.func_179783_a();
|
|
||||||
//$$ final String hash = packet.func_179784_b();
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
if (url.startsWith("level://")) {
|
if (url.startsWith("level://")) {
|
||||||
String levelName = url.substring("level://".length());
|
String levelName = url.substring("level://".length());
|
||||||
File savesDir = new File(mcDataDir(mc), "saves");
|
File savesDir = new File(mc.gameDir, "saves");
|
||||||
final File levelDir = new File(savesDir, levelName);
|
final File levelDir = new File(savesDir, levelName);
|
||||||
|
|
||||||
if (levelDir.isFile()) {
|
if (levelDir.isFile()) {
|
||||||
@@ -186,30 +165,26 @@ public class ResourcePackRecorder {
|
|||||||
netManager.sendPacket(makeStatusPacket(hash, Action.DECLINED));
|
netManager.sendPacket(makeStatusPacket(hash, Action.DECLINED));
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerList_saveSingleServer(serverData);
|
ServerList.saveSingleServer(serverData);
|
||||||
mc.displayGuiScreen(null);
|
mc.displayGuiScreen(null);
|
||||||
}
|
}
|
||||||
}, I18n.format("multiplayer.texturePrompt.line1"), I18n.format("multiplayer.texturePrompt.line2"), 0)));
|
}, I18n.format("multiplayer.texturePrompt.line1"), I18n.format("multiplayer.texturePrompt.line2"), 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
return new SPacketResourcePackSend("replay://" + requestId, "");
|
return new SPacketResourcePackSend("replay://" + requestId, "");
|
||||||
//#else
|
|
||||||
//$$ return new S48PacketResourcePackSend("replay://" + requestId, "");
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void downloadResourcePackFuture(int requestId, String url, final String hash) {
|
private void downloadResourcePackFuture(int requestId, String url, final String hash) {
|
||||||
Futures.addCallback(downloadResourcePack(requestId, url, hash), new FutureCallback() {
|
Futures.addCallback(downloadResourcePack(requestId, url, hash), new FutureCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Object result) {
|
public void onSuccess(Object result) {
|
||||||
sendPacket(getConnection(mc), makeStatusPacket(hash, Action.SUCCESSFULLY_LOADED));
|
mc.getConnection().sendPacket(makeStatusPacket(hash, Action.SUCCESSFULLY_LOADED));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@Nonnull Throwable throwable) {
|
public void onFailure(@Nonnull Throwable throwable) {
|
||||||
sendPacket(getConnection(mc), makeStatusPacket(hash, Action.FAILED_DOWNLOAD));
|
mc.getConnection().sendPacket(makeStatusPacket(hash, Action.FAILED_DOWNLOAD));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ public class RenderSettings {
|
|||||||
switch (Util.getOSType()) {
|
switch (Util.getOSType()) {
|
||||||
case WINDOWS:
|
case WINDOWS:
|
||||||
// Allow windows users to unpack the ffmpeg archive into a sub-folder of their .minecraft folder
|
// Allow windows users to unpack the ffmpeg archive into a sub-folder of their .minecraft folder
|
||||||
File inDotMinecraft = new File(MCVer.mcDataDir(MCVer.getMinecraft()), "ffmpeg/bin/ffmpeg.exe");
|
File inDotMinecraft = new File(MCVer.getMinecraft().gameDir, "ffmpeg/bin/ffmpeg.exe");
|
||||||
if (inDotMinecraft.exists()) {
|
if (inDotMinecraft.exists()) {
|
||||||
LOGGER.debug("FFmpeg found in .minecraft/ffmpeg");
|
LOGGER.debug("FFmpeg found in .minecraft/ffmpeg");
|
||||||
return inDotMinecraft.getAbsolutePath();
|
return inDotMinecraft.getAbsolutePath();
|
||||||
|
|||||||
@@ -5,22 +5,12 @@ import com.replaymod.core.ReplayMod;
|
|||||||
import com.replaymod.render.utils.RenderJob;
|
import com.replaymod.render.utils.RenderJob;
|
||||||
import com.replaymod.replay.events.ReplayCloseEvent;
|
import com.replaymod.replay.events.ReplayCloseEvent;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
import net.minecraftforge.fml.common.Mod;
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.Mod;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -61,7 +51,7 @@ public class ReplayModRender implements Module {
|
|||||||
|
|
||||||
public File getVideoFolder() {
|
public File getVideoFolder() {
|
||||||
String path = core.getSettingsRegistry().get(Setting.RENDER_PATH);
|
String path = core.getSettingsRegistry().get(Setting.RENDER_PATH);
|
||||||
File folder = new File(path.startsWith("./") ? mcDataDir(core.getMinecraft()) : null, path);
|
File folder = new File(path.startsWith("./") ? core.getMinecraft().gameDir : null, path);
|
||||||
try {
|
try {
|
||||||
FileUtils.forceMkdir(folder);
|
FileUtils.forceMkdir(folder);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -71,7 +61,7 @@ public class ReplayModRender implements Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Path getRenderSettingsPath() {
|
public Path getRenderSettingsPath() {
|
||||||
return mcDataDir(core.getMinecraft()).toPath().resolve("config/replaymod-rendersettings.json");
|
return core.getMinecraft().gameDir.toPath().resolve("config/replaymod-rendersettings.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RenderJob> getRenderQueue() {
|
public List<RenderJob> getRenderQueue() {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class VideoWriter implements FrameConsumer<RGBFrame> {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new NoFFmpegException(e);
|
throw new NoFFmpegException(e);
|
||||||
}
|
}
|
||||||
File exportLogFile = new File(MCVer.mcDataDir(MCVer.getMinecraft()), "export.log");
|
File exportLogFile = new File(MCVer.getMinecraft().gameDir, "export.log");
|
||||||
OutputStream exportLogOut = new TeeOutputStream(new FileOutputStream(exportLogFile), ffmpegLog);
|
OutputStream exportLogOut = new TeeOutputStream(new FileOutputStream(exportLogFile), ffmpegLog);
|
||||||
new StreamPipe(process.getInputStream(), exportLogOut).start();
|
new StreamPipe(process.getInputStream(), exportLogOut).start();
|
||||||
new StreamPipe(process.getErrorStream(), exportLogOut).start();
|
new StreamPipe(process.getErrorStream(), exportLogOut).start();
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class BlendMeshBuilder
|
|||||||
throw new IllegalStateException("Not building!");
|
throw new IllegalStateException("Not building!");
|
||||||
} else {
|
} else {
|
||||||
if (!wellBehaved) {
|
if (!wellBehaved) {
|
||||||
getBuffer(Tessellator.getInstance()).finishDrawing();
|
Tessellator.getInstance().getBuffer().finishDrawing();
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC<10809
|
//#if MC<10809
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.replaymod.render.blend.exporters.TileEntityExporter;
|
|||||||
//#endif
|
//#endif
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
import org.apache.commons.io.output.NullOutputStream;
|
import org.apache.commons.io.output.NullOutputStream;
|
||||||
import org.blender.utils.BlenderFactory;
|
import org.blender.utils.BlenderFactory;
|
||||||
import org.cakelab.blender.io.BlenderFile;
|
import org.cakelab.blender.io.BlenderFile;
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import java.io.IOException;
|
|||||||
import java.util.IdentityHashMap;
|
import java.util.IdentityHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
import static com.replaymod.render.blend.Util.getGlModelViewMatrix;
|
import static com.replaymod.render.blend.Util.getGlModelViewMatrix;
|
||||||
|
|
||||||
public class ParticlesExporter implements Exporter {
|
public class ParticlesExporter implements Exporter {
|
||||||
@@ -111,9 +110,9 @@ public class ParticlesExporter implements Exporter {
|
|||||||
// renderer translate there again.
|
// renderer translate there again.
|
||||||
// Instead of actually translating, we just add the translation on the current model-view-matrix.
|
// Instead of actually translating, we just add the translation on the current model-view-matrix.
|
||||||
Matrix4f modelView = getGlModelViewMatrix();
|
Matrix4f modelView = getGlModelViewMatrix();
|
||||||
double dx = particle.prevPosX + (particle.posX - particle.prevPosX) * renderPartialTicks - interpPosX();
|
double dx = particle.prevPosX + (particle.posX - particle.prevPosX) * renderPartialTicks - Particle.interpPosX;
|
||||||
double dy = particle.prevPosY + (particle.posY - particle.prevPosY) * renderPartialTicks - interpPosY();
|
double dy = particle.prevPosY + (particle.posY - particle.prevPosY) * renderPartialTicks - Particle.interpPosY;
|
||||||
double dz = particle.prevPosZ + (particle.posZ - particle.prevPosZ) * renderPartialTicks - interpPosZ();
|
double dz = particle.prevPosZ + (particle.posZ - particle.prevPosZ) * renderPartialTicks - Particle.interpPosZ;
|
||||||
Vector3f offset = new Vector3f((float) dx, (float) dy, (float) dz);
|
Vector3f offset = new Vector3f((float) dx, (float) dy, (float) dz);
|
||||||
Matrix4f.translate(offset, modelView, modelView);
|
Matrix4f.translate(offset, modelView, modelView);
|
||||||
renderState.pushModelView(modelView);
|
renderState.pushModelView(modelView);
|
||||||
|
|||||||
@@ -8,14 +8,11 @@ import com.replaymod.render.rendering.FrameCapturer;
|
|||||||
import com.replaymod.render.shader.Program;
|
import com.replaymod.render.shader.Program;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
//#else
|
import static net.minecraft.client.renderer.GlStateManager.BooleanState;
|
||||||
//$$ import com.replaymod.render.hooks.GLStateTracker.BooleanState;
|
|
||||||
//$$ import static com.replaymod.core.versions.MCVer.GlStateManager.*;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
|||||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.addDetail;
|
import static com.replaymod.core.versions.MCVer.addDetail;
|
||||||
import static com.replaymod.core.versions.MCVer.newReportedException;
|
|
||||||
import static com.replaymod.render.ReplayModRender.LOGGER;
|
import static com.replaymod.render.ReplayModRender.LOGGER;
|
||||||
|
|
||||||
public class GuiExportFailed extends GuiScreen {
|
public class GuiExportFailed extends GuiScreen {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.replaymod.core.versions.MCVer;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
@@ -16,8 +17,6 @@ import java.util.concurrent.ExecutorService;
|
|||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.newReportedException;
|
|
||||||
|
|
||||||
public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
||||||
|
|
||||||
private final FrameCapturer<R> capturer;
|
private final FrameCapturer<R> capturer;
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.shader.Framebuffer;
|
import net.minecraft.client.shader.Framebuffer;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.Timer;
|
import net.minecraft.util.Timer;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@@ -35,12 +37,6 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
//$$ import org.lwjgl.opengl.Display;
|
//$$ import org.lwjgl.opengl.Display;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
import net.minecraft.util.SoundCategory;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.audio.SoundCategory;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import com.replaymod.render.hooks.ChunkLoadingRenderGlobal;
|
import com.replaymod.render.hooks.ChunkLoadingRenderGlobal;
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
|
|||||||
@@ -24,13 +24,18 @@ import net.minecraft.client.resources.I18n;
|
|||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.network.*;
|
import net.minecraft.network.*;
|
||||||
|
import net.minecraft.network.login.server.SPacketLoginSuccess;
|
||||||
import net.minecraft.network.play.server.*;
|
import net.minecraft.network.play.server.*;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.world.EnumDifficulty;
|
import net.minecraft.world.EnumDifficulty;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldType;
|
import net.minecraft.world.WorldType;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
|
||||||
@@ -47,24 +52,8 @@ import net.minecraft.world.GameType;
|
|||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.world.WorldSettings.GameType;
|
//$$ import net.minecraft.world.WorldSettings.GameType;
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=10904
|
|
||||||
import net.minecraft.network.login.server.SPacketLoginSuccess;
|
|
||||||
import net.minecraft.util.text.ITextComponent;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.network.login.server.S02PacketLoginSuccess;
|
|
||||||
//$$ import net.minecraft.util.IChatComponent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC<10800
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
|
||||||
//$$ import org.apache.commons.io.Charsets;
|
//$$ import org.apache.commons.io.Charsets;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -321,8 +310,8 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
// 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 (world(mc) != null) {
|
if (mc.world != null) {
|
||||||
for (EntityPlayer playerEntity : playerEntities(world(mc))) {
|
for (EntityPlayer playerEntity : playerEntities(mc.world)) {
|
||||||
if (!playerEntity.addedToChunk && playerEntity instanceof EntityOtherPlayerMP) {
|
if (!playerEntity.addedToChunk && playerEntity instanceof EntityOtherPlayerMP) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
playerEntity.livingTick();
|
playerEntity.livingTick();
|
||||||
@@ -360,8 +349,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
// 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 && world(mc) != null) {
|
if (!asyncMode && mc.world != null) {
|
||||||
//#if MC>=10904
|
|
||||||
if (p instanceof SPacketSpawnPlayer
|
if (p instanceof SPacketSpawnPlayer
|
||||||
|| p instanceof SPacketSpawnObject
|
|| p instanceof SPacketSpawnObject
|
||||||
|| p instanceof SPacketSpawnMob
|
|| p instanceof SPacketSpawnMob
|
||||||
@@ -369,23 +357,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
|| p instanceof SPacketSpawnPainting
|
|| p instanceof SPacketSpawnPainting
|
||||||
|| p instanceof SPacketSpawnExperienceOrb
|
|| p instanceof SPacketSpawnExperienceOrb
|
||||||
|| p instanceof SPacketDestroyEntities) {
|
|| p instanceof SPacketDestroyEntities) {
|
||||||
//#else
|
World world = mc.world;
|
||||||
//$$ if (p instanceof S0CPacketSpawnPlayer
|
|
||||||
//$$ || p instanceof S0EPacketSpawnObject
|
|
||||||
//$$ || p instanceof S0FPacketSpawnMob
|
|
||||||
//$$ || p instanceof S2CPacketSpawnGlobalEntity
|
|
||||||
//$$ || p instanceof S10PacketSpawnPainting
|
|
||||||
//$$ || p instanceof S11PacketSpawnExperienceOrb
|
|
||||||
//$$ || p instanceof S13PacketDestroyEntities) {
|
|
||||||
//#endif
|
|
||||||
World world = world(mc);
|
|
||||||
for (int i = 0; i < world.loadedEntityList.size(); ++i) {
|
for (int i = 0; i < world.loadedEntityList.size(); ++i) {
|
||||||
Entity entity = loadedEntityList(world).get(i);
|
Entity entity = loadedEntityList(world).get(i);
|
||||||
//#if MC>=11300
|
|
||||||
if (entity.removed) {
|
if (entity.removed) {
|
||||||
//#else
|
|
||||||
//$$ if (entity.isDead) {
|
|
||||||
//#endif
|
|
||||||
int chunkX = entity.chunkCoordX;
|
int chunkX = entity.chunkCoordX;
|
||||||
int chunkY = entity.chunkCoordZ;
|
int chunkY = entity.chunkCoordZ;
|
||||||
|
|
||||||
@@ -398,11 +373,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//$$ if (entity.addedToChunk && world.getChunkProvider().chunkExists(chunkX, chunkY)) {
|
//$$ if (entity.addedToChunk && world.getChunkProvider().chunkExists(chunkX, chunkY)) {
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
//#if MC>=11300
|
|
||||||
world.getChunk(chunkX, chunkY).removeEntity(entity);
|
world.getChunk(chunkX, chunkY).removeEntity(entity);
|
||||||
//#else
|
|
||||||
//$$ world.getChunkFromChunkCoords(chunkX, chunkY).removeEntity(entity);
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
world.loadedEntityList.remove(i--);
|
world.loadedEntityList.remove(i--);
|
||||||
@@ -425,7 +396,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
ByteBuf bb = Unpooled.wrappedBuffer(bytes);
|
ByteBuf bb = Unpooled.wrappedBuffer(bytes);
|
||||||
PacketBuffer pb = new PacketBuffer(bb);
|
PacketBuffer pb = new PacketBuffer(bb);
|
||||||
|
|
||||||
int i = readVarInt(pb);
|
int i = pb.readVarInt();
|
||||||
|
|
||||||
EnumConnectionState state = loginPhase ? EnumConnectionState.LOGIN : EnumConnectionState.PLAY;
|
EnumConnectionState state = loginPhase ? EnumConnectionState.LOGIN : EnumConnectionState.PLAY;
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
@@ -444,32 +415,14 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
* @return The processed packet or {@code null} if no packet shall be sent
|
* @return The processed packet or {@code null} if no packet shall be sent
|
||||||
*/
|
*/
|
||||||
protected Packet processPacket(Packet p) throws Exception {
|
protected Packet processPacket(Packet p) throws Exception {
|
||||||
//#if MC>=10904
|
|
||||||
if (p instanceof SPacketLoginSuccess) {
|
if (p instanceof SPacketLoginSuccess) {
|
||||||
//#else
|
|
||||||
//$$ if (p instanceof S02PacketLoginSuccess) {
|
|
||||||
//#endif
|
|
||||||
loginPhase = false;
|
loginPhase = false;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if (p instanceof SPacketCustomPayload) {
|
if (p instanceof SPacketCustomPayload) {
|
||||||
SPacketCustomPayload packet = (SPacketCustomPayload) p;
|
SPacketCustomPayload packet = (SPacketCustomPayload) p;
|
||||||
//#else
|
if (Restrictions.PLUGIN_CHANNEL.equals(packet.getChannelName())) {
|
||||||
//$$ if (p instanceof S3FPacketCustomPayload) {
|
|
||||||
//$$ S3FPacketCustomPayload packet = (S3FPacketCustomPayload) p;
|
|
||||||
//#endif
|
|
||||||
//#if MC>=11300
|
|
||||||
ResourceLocation channelName = packet.getChannelName();
|
|
||||||
//#else
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ String channelName = packet.getChannelName();
|
|
||||||
//#else
|
|
||||||
//$$ String channelName = packet.func_149169_c();
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
if (Restrictions.PLUGIN_CHANNEL.equals(channelName)) {
|
|
||||||
final String unknown = replayHandler.getRestrictions().handle(packet);
|
final String unknown = replayHandler.getRestrictions().handle(packet);
|
||||||
if (unknown == null) {
|
if (unknown == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -494,23 +447,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#if MC>=10904
|
|
||||||
if (p instanceof SPacketDisconnect) {
|
if (p instanceof SPacketDisconnect) {
|
||||||
ITextComponent reason = ((SPacketDisconnect) p).getReason();
|
ITextComponent reason = ((SPacketDisconnect) p).getReason();
|
||||||
//#else
|
String message = reason.getString();
|
||||||
//$$ if (p instanceof S40PacketDisconnect) {
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ IChatComponent reason = ((S40PacketDisconnect) p).getReason();
|
|
||||||
//#else
|
|
||||||
//$$ IChatComponent reason = ((S40PacketDisconnect) p).func_149165_c();
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
//#if MC>=11300
|
|
||||||
// FIXME or is it getString?
|
|
||||||
String message = reason.getUnformattedComponentText();
|
|
||||||
//#else
|
|
||||||
//$$ String message = reason.getUnformattedText();
|
|
||||||
//#endif
|
|
||||||
if ("Please update to view this replay.".equals(message)) {
|
if ("Please update to view this replay.".equals(message)) {
|
||||||
// This version of the mod supports replay restrictions so we are allowed
|
// This version of the mod supports replay restrictions so we are allowed
|
||||||
// to remove this packet.
|
// to remove this packet.
|
||||||
@@ -520,22 +459,13 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
|
|
||||||
if(BAD_PACKETS.contains(p.getClass())) return null;
|
if(BAD_PACKETS.contains(p.getClass())) return null;
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if (p instanceof SPacketCustomPayload) {
|
if (p instanceof SPacketCustomPayload) {
|
||||||
SPacketCustomPayload packet = (SPacketCustomPayload) p;
|
SPacketCustomPayload packet = (SPacketCustomPayload) p;
|
||||||
//#else
|
|
||||||
//$$ if (p instanceof S3FPacketCustomPayload) {
|
|
||||||
//$$ S3FPacketCustomPayload packet = (S3FPacketCustomPayload) p;
|
|
||||||
//#endif
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
ResourceLocation channelName = packet.getChannelName();
|
ResourceLocation channelName = packet.getChannelName();
|
||||||
//#else
|
//#else
|
||||||
//$$ String channelName = packet.getChannelName();
|
//$$ String channelName = packet.getChannelName();
|
||||||
//#endif
|
//#endif
|
||||||
//#else
|
|
||||||
//$$ String channelName = packet.func_149169_c();
|
|
||||||
//#endif
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
if (SPacketCustomPayload.BOOK_OPEN.equals(channelName)) {
|
if (SPacketCustomPayload.BOOK_OPEN.equals(channelName)) {
|
||||||
//#else
|
//#else
|
||||||
@@ -546,19 +476,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if(p instanceof SPacketResourcePackSend) {
|
if(p instanceof SPacketResourcePackSend) {
|
||||||
SPacketResourcePackSend packet = (SPacketResourcePackSend) p;
|
SPacketResourcePackSend packet = (SPacketResourcePackSend) p;
|
||||||
String url = packet.getURL();
|
String url = packet.getURL();
|
||||||
//#else
|
|
||||||
//$$ if(p instanceof S48PacketResourcePackSend) {
|
|
||||||
//$$ S48PacketResourcePackSend packet = (S48PacketResourcePackSend) p;
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ String url = packet.getURL();
|
|
||||||
//#else
|
|
||||||
//$$ String url = packet.func_179783_a();
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
if (url.startsWith("replay://")) {
|
if (url.startsWith("replay://")) {
|
||||||
//#else
|
//#else
|
||||||
//$$ String url;
|
//$$ String url;
|
||||||
@@ -581,19 +501,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if(p instanceof SPacketJoinGame) {
|
if(p instanceof SPacketJoinGame) {
|
||||||
SPacketJoinGame packet = (SPacketJoinGame) p;
|
SPacketJoinGame packet = (SPacketJoinGame) p;
|
||||||
int entId = packet.getPlayerId();
|
int entId = packet.getPlayerId();
|
||||||
//#else
|
|
||||||
//$$ if(p instanceof S01PacketJoinGame) {
|
|
||||||
//$$ S01PacketJoinGame packet = (S01PacketJoinGame) p;
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ int entId = packet.getEntityId();
|
|
||||||
//#else
|
|
||||||
//$$ int entId = packet.func_149197_c();
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
allowMovement = true;
|
allowMovement = true;
|
||||||
actualID = entId;
|
actualID = entId;
|
||||||
entId = -1789435; // Camera entity id should be negative which is an invalid id and can't be used by servers
|
entId = -1789435; // Camera entity id should be negative which is an invalid id and can't be used by servers
|
||||||
@@ -629,22 +539,11 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if(p instanceof SPacketRespawn) {
|
if(p instanceof SPacketRespawn) {
|
||||||
SPacketRespawn respawn = (SPacketRespawn) p;
|
SPacketRespawn respawn = (SPacketRespawn) p;
|
||||||
p = new SPacketRespawn(
|
|
||||||
//#if MC>=11300
|
|
||||||
respawn.func_212643_b(),
|
|
||||||
//#else
|
|
||||||
//$$ respawn.getDimensionID(),
|
|
||||||
//#endif
|
|
||||||
respawn.getDifficulty(), respawn.getWorldType(), GameType.SPECTATOR);
|
|
||||||
//#else
|
|
||||||
//$$ if(p instanceof S07PacketRespawn) {
|
|
||||||
//$$ S07PacketRespawn respawn = (S07PacketRespawn) p;
|
|
||||||
//#if MC>=10809
|
//#if MC>=10809
|
||||||
//$$ p = new S07PacketRespawn(respawn.getDimensionID(),
|
p = new SPacketRespawn(respawn.func_212643_b(),
|
||||||
//$$ respawn.getDifficulty(), respawn.getWorldType(), GameType.SPECTATOR);
|
respawn.getDifficulty(), respawn.getWorldType(), GameType.SPECTATOR);
|
||||||
//#else
|
//#else
|
||||||
//$$ p = new S07PacketRespawn(respawn.func_149082_c(),
|
//$$ p = new S07PacketRespawn(respawn.func_149082_c(),
|
||||||
//$$ respawn.func_149081_d(), respawn.func_149080_f(),
|
//$$ respawn.func_149081_d(), respawn.func_149080_f(),
|
||||||
@@ -654,18 +553,12 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//$$ GameType.ADVENTURE);
|
//$$ GameType.ADVENTURE);
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
//#endif
|
||||||
//#endif
|
|
||||||
|
|
||||||
allowMovement = true;
|
allowMovement = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if(p instanceof SPacketPlayerPosLook) {
|
if(p instanceof SPacketPlayerPosLook) {
|
||||||
final SPacketPlayerPosLook ppl = (SPacketPlayerPosLook) p;
|
final SPacketPlayerPosLook ppl = (SPacketPlayerPosLook) p;
|
||||||
//#else
|
|
||||||
//$$ if(p instanceof S08PacketPlayerPosLook) {
|
|
||||||
//$$ final S08PacketPlayerPosLook ppl = (S08PacketPlayerPosLook) p;
|
|
||||||
//#endif
|
|
||||||
if(!hasWorldLoaded) hasWorldLoaded = true;
|
if(!hasWorldLoaded) hasWorldLoaded = true;
|
||||||
|
|
||||||
if (mc.currentScreen instanceof GuiDownloadTerrain) {
|
if (mc.currentScreen instanceof GuiDownloadTerrain) {
|
||||||
@@ -680,15 +573,12 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
//#if MC>=10904
|
//#if MC>=10904
|
||||||
for (SPacketPlayerPosLook.EnumFlags relative : ppl.getFlags()) {
|
for (SPacketPlayerPosLook.EnumFlags relative : ppl.getFlags()) {
|
||||||
|
//#else
|
||||||
|
//$$ for (Object relative : ppl.func_179834_f()) {
|
||||||
|
//#endif
|
||||||
if (relative == SPacketPlayerPosLook.EnumFlags.X
|
if (relative == SPacketPlayerPosLook.EnumFlags.X
|
||||||
|| relative == SPacketPlayerPosLook.EnumFlags.Y
|
|| relative == SPacketPlayerPosLook.EnumFlags.Y
|
||||||
|| relative == SPacketPlayerPosLook.EnumFlags.Z) {
|
|| relative == SPacketPlayerPosLook.EnumFlags.Z) {
|
||||||
//#else
|
|
||||||
//$$ for (Object relative : ppl.func_179834_f()) {
|
|
||||||
//$$ if (relative == S08PacketPlayerPosLook.EnumFlags.X
|
|
||||||
//$$ || relative == S08PacketPlayerPosLook.EnumFlags.Y
|
|
||||||
//$$ || relative == S08PacketPlayerPosLook.EnumFlags.Z) {
|
|
||||||
//#endif
|
|
||||||
return null; // At least one of the coordinates is relative, so we don't care
|
return null; // At least one of the coordinates is relative, so we don't care
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,7 +602,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void run() {
|
public void run() {
|
||||||
if (world(mc) == null || !mc.isCallingFromMinecraftThread()) {
|
if (mc.world == null || !mc.isCallingFromMinecraftThread()) {
|
||||||
ReplayMod.instance.runLater(this);
|
ReplayMod.instance.runLater(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -727,19 +617,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
}.run();
|
}.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if(p instanceof SPacketChangeGameState) {
|
if(p instanceof SPacketChangeGameState) {
|
||||||
SPacketChangeGameState pg = (SPacketChangeGameState)p;
|
SPacketChangeGameState pg = (SPacketChangeGameState)p;
|
||||||
int reason = pg.getGameState();
|
int reason = pg.getGameState();
|
||||||
//#else
|
|
||||||
//$$ if(p instanceof S2BPacketChangeGameState) {
|
|
||||||
//$$ S2BPacketChangeGameState pg = (S2BPacketChangeGameState)p;
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ int reason = pg.getGameState();
|
|
||||||
//#else
|
|
||||||
//$$ int reason = pg.func_149138_c();
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
// only allow the following packets:
|
// only allow the following packets:
|
||||||
// 1 - End raining
|
// 1 - End raining
|
||||||
@@ -753,11 +633,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
if (p instanceof SPacketChat) {
|
if (p instanceof SPacketChat) {
|
||||||
//#else
|
|
||||||
//$$ if (p instanceof S02PacketChat) {
|
|
||||||
//#endif
|
|
||||||
if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) {
|
if (!ReplayModReplay.instance.getCore().getSettingsRegistry().get(Setting.SHOW_CHAT)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -994,23 +870,11 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
protected Packet processPacketAsync(Packet p) {
|
protected Packet processPacketAsync(Packet p) {
|
||||||
//If hurrying, ignore some packets, except for short durations
|
//If hurrying, ignore some packets, except for short durations
|
||||||
if(desiredTimeStamp - lastTimeStamp > 1000) {
|
if(desiredTimeStamp - lastTimeStamp > 1000) {
|
||||||
//#if MC>=10904
|
|
||||||
if(p instanceof SPacketParticles) return null;
|
if(p instanceof SPacketParticles) return null;
|
||||||
|
|
||||||
if(p instanceof SPacketSpawnObject) {
|
if(p instanceof SPacketSpawnObject) {
|
||||||
SPacketSpawnObject pso = (SPacketSpawnObject)p;
|
SPacketSpawnObject pso = (SPacketSpawnObject)p;
|
||||||
int type = pso.getType();
|
int type = pso.getType();
|
||||||
//#else
|
|
||||||
//$$ if(p instanceof S2APacketParticles) return null;
|
|
||||||
//$$
|
|
||||||
//$$ if(p instanceof S0EPacketSpawnObject) {
|
|
||||||
//$$ S0EPacketSpawnObject pso = (S0EPacketSpawnObject)p;
|
|
||||||
//#if MC>=10809
|
|
||||||
//$$ int type = pso.getType();
|
|
||||||
//#else
|
|
||||||
//$$ int type = pso.func_148993_l();
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
if(type == 76) { // Firework rocket
|
if(type == 76) { // Firework rocket
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1123,7 +987,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
// Note: This is only half of the truth. Entities may be removed by chunk-unloading, see else-case below.
|
// Note: This is only half of the truth. Entities may be removed by chunk-unloading, see else-case below.
|
||||||
// To make things worse, it seems like players were never supposed to be unloaded this way because
|
// To make things worse, it seems like players were never supposed to be unloaded this way because
|
||||||
// they will remain glitched in the World#playerEntities list.
|
// they will remain glitched in the World#playerEntities list.
|
||||||
World world = world(mc);
|
World world = mc.world;
|
||||||
IChunkProvider chunkProvider = world.getChunkProvider();
|
IChunkProvider chunkProvider = world.getChunkProvider();
|
||||||
// Get the chunk that will be unloaded
|
// Get the chunk that will be unloaded
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@@ -1151,8 +1015,8 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the entity has left the chunk
|
// Check whether the entity has left the chunk
|
||||||
int chunkX = floor(entity.posX / 16);
|
int chunkX = MathHelper.floor(entity.posX / 16);
|
||||||
int chunkZ = floor(entity.posZ / 16);
|
int chunkZ = MathHelper.floor(entity.posZ / 16);
|
||||||
if (entity.chunkCoordX != chunkX || entity.chunkCoordZ != chunkZ) {
|
if (entity.chunkCoordX != chunkX || entity.chunkCoordZ != chunkZ) {
|
||||||
// Entity has left the chunk
|
// Entity has left the chunk
|
||||||
chunk.removeEntityAtIndex(entity, entity.chunkCoordY);
|
chunk.removeEntityAtIndex(entity, entity.chunkCoordY);
|
||||||
|
|||||||
@@ -14,22 +14,20 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
//$$ import net.minecraft.client.settings.GameSettings;
|
//$$ import net.minecraft.client.settings.GameSettings;
|
||||||
//$$ import net.minecraft.client.settings.KeyBinding;
|
//$$ import net.minecraft.client.settings.KeyBinding;
|
||||||
//$$ import net.minecraft.crash.CrashReport;
|
//$$ import net.minecraft.crash.CrashReport;
|
||||||
|
//$$ import net.minecraft.util.ReportedException;
|
||||||
//$$ import net.minecraftforge.client.ForgeHooksClient;
|
//$$ import net.minecraftforge.client.ForgeHooksClient;
|
||||||
//$$ import net.minecraftforge.common.MinecraftForge;
|
//$$ import net.minecraftforge.common.MinecraftForge;
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
//$$ import org.lwjgl.input.Keyboard;
|
||||||
//$$ import org.lwjgl.input.Mouse;
|
//$$ import org.lwjgl.input.Mouse;
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
//$$
|
//#if MC>=10800
|
||||||
//$$ import java.io.IOException;
|
//$$ import java.io.IOException;
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
||||||
//$$ import net.minecraft.client.renderer.entity.RenderManager;
|
//$$ import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
//$$
|
//$$
|
||||||
//$$ import static com.replaymod.core.versions.MCVer.FML_BUS;
|
//$$ import static com.replaymod.core.versions.MCVer.FML_BUS;
|
||||||
//#endif
|
//#endif
|
||||||
//$$ import static com.replaymod.core.versions.MCVer.newReportedException;
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
public class InputReplayTimer extends WrappedTimer {
|
public class InputReplayTimer extends WrappedTimer {
|
||||||
|
|||||||
@@ -8,15 +8,10 @@ import lombok.AccessLevel;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.util.ScreenShotHelper;
|
import net.minecraft.util.ScreenShotHelper;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
//#else
|
|
||||||
//$$ import com.replaymod.core.versions.MCVer.GlStateManager;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ import net.minecraft.network.EnumConnectionState;
|
|||||||
import net.minecraft.network.EnumPacketDirection;
|
import net.minecraft.network.EnumPacketDirection;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@@ -85,12 +86,6 @@ import java.util.function.Consumer;
|
|||||||
import java.util.zip.Deflater;
|
import java.util.zip.Deflater;
|
||||||
import java.util.zip.Inflater;
|
import java.util.zip.Inflater;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=11200
|
//#if MC>=11200
|
||||||
import com.replaymod.core.utils.WrappedTimer;
|
import com.replaymod.core.utils.WrappedTimer;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -657,12 +652,7 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
|||||||
|
|
||||||
byteBuf.skipBytes(8); // Skip packet length & timestamp
|
byteBuf.skipBytes(8); // Skip packet length & timestamp
|
||||||
|
|
||||||
int packetId =
|
int packetId = packetBuf.readVarInt();
|
||||||
//#if MC>=11102
|
|
||||||
packetBuf.readVarInt();
|
|
||||||
//#else
|
|
||||||
//$$ packetBuf.readVarIntFromBuffer();
|
|
||||||
//#endif
|
|
||||||
Packet<?> mcPacket = state.getPacket(EnumPacketDirection.CLIENTBOUND, packetId);
|
Packet<?> mcPacket = state.getPacket(EnumPacketDirection.CLIENTBOUND, packetId);
|
||||||
mcPacket.readPacketData(packetBuf);
|
mcPacket.readPacketData(packetBuf);
|
||||||
return mcPacket;
|
return mcPacket;
|
||||||
@@ -696,12 +686,7 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
|||||||
byteBuf.writeBytes(in.readBytes(len));
|
byteBuf.writeBytes(in.readBytes(len));
|
||||||
}
|
}
|
||||||
|
|
||||||
int packetId =
|
int packetId = packetBuf.readVarInt();
|
||||||
//#if MC>=11102
|
|
||||||
packetBuf.readVarInt();
|
|
||||||
//#else
|
|
||||||
//$$ packetBuf.readVarIntFromBuffer();
|
|
||||||
//#endif
|
|
||||||
Packet<?> mcPacket = EnumConnectionState.PLAY.getPacket(EnumPacketDirection.CLIENTBOUND, packetId);
|
Packet<?> mcPacket = EnumConnectionState.PLAY.getPacket(EnumPacketDirection.CLIENTBOUND, packetId);
|
||||||
mcPacket.readPacketData(packetBuf);
|
mcPacket.readPacketData(packetBuf);
|
||||||
return mcPacket;
|
return mcPacket;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import io.netty.channel.ChannelHandlerContext;
|
|||||||
import io.netty.channel.embedded.EmbeddedChannel;
|
import io.netty.channel.embedded.EmbeddedChannel;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.network.NetHandlerLoginClient;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -56,22 +57,16 @@ import net.minecraftforge.fml.network.NetworkHooks;
|
|||||||
//$$ import net.minecraftforge.fml.client.FMLClientHandler;
|
//$$ import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
//$$ import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
//$$ import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
||||||
//#endif
|
//#endif
|
||||||
import net.minecraft.client.network.NetHandlerLoginClient;
|
|
||||||
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import cpw.mods.fml.common.Loader;
|
//$$ import cpw.mods.fml.common.Loader;
|
||||||
//$$ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
//$$ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
//$$ import com.replaymod.replay.gui.screen.GuiOpeningReplay;
|
//$$ import com.replaymod.replay.gui.screen.GuiOpeningReplay;
|
||||||
//$$ import io.netty.channel.ChannelOutboundHandlerAdapter;
|
//$$ import io.netty.channel.ChannelOutboundHandlerAdapter;
|
||||||
//$$ import net.minecraft.client.network.NetHandlerLoginClient;
|
|
||||||
//$$ import net.minecraft.entity.EntityLivingBase;
|
//$$ import net.minecraft.entity.EntityLivingBase;
|
||||||
//$$ import net.minecraft.network.EnumConnectionState;
|
//$$ import net.minecraft.network.EnumConnectionState;
|
||||||
//$$
|
//$$
|
||||||
//$$ import java.net.InetSocketAddress;
|
//$$ import java.net.InetSocketAddress;
|
||||||
//$$ import java.net.SocketAddress;
|
//$$ import java.net.SocketAddress;
|
||||||
//$$
|
|
||||||
//$$ import static com.replaymod.core.versions.MCVer.GlStateManager.*;
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@@ -79,6 +74,7 @@ import javax.annotation.Nullable;
|
|||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.*;
|
||||||
import static com.replaymod.replay.ReplayModReplay.LOGGER;
|
import static com.replaymod.replay.ReplayModReplay.LOGGER;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
||||||
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
|
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
|
||||||
|
|
||||||
@@ -185,16 +181,16 @@ public class ReplayHandler {
|
|||||||
|
|
||||||
channel.close().awaitUninterruptibly();
|
channel.close().awaitUninterruptibly();
|
||||||
|
|
||||||
if (player(mc) instanceof CameraEntity) {
|
if (mc.player instanceof CameraEntity) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
player(mc).remove();
|
mc.player.remove();
|
||||||
//#else
|
//#else
|
||||||
//$$ player(mc).setDead();
|
//$$ mc.player.setDead();
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world(mc) != null) {
|
if (mc.world != null) {
|
||||||
world(mc).sendQuittingDisconnectingPacket();
|
mc.world.sendQuittingDisconnectingPacket();
|
||||||
mc.loadWorld(null);
|
mc.loadWorld(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +474,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 player(mc) instanceof CameraEntity && player(mc) == getRenderViewEntity(mc);
|
return mc.player instanceof CameraEntity && mc.player == getRenderViewEntity(mc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -486,7 +482,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 player(mc) instanceof CameraEntity ? (CameraEntity) player(mc) : null;
|
return mc.player instanceof CameraEntity ? (CameraEntity) mc.player : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getSpectatedUUID() {
|
public UUID getSpectatedUUID() {
|
||||||
@@ -516,7 +512,7 @@ public class ReplayHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update all entity positions (especially prev/lastTick values)
|
// Update all entity positions (especially prev/lastTick values)
|
||||||
for (Entity entity : loadedEntityList(world(mc))) {
|
for (Entity entity : loadedEntityList(mc.world)) {
|
||||||
skipTeleportInterpolation(entity);
|
skipTeleportInterpolation(entity);
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX;
|
entity.lastTickPosX = entity.prevPosX = entity.posX;
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY;
|
entity.lastTickPosY = entity.prevPosY = entity.posY;
|
||||||
@@ -540,7 +536,7 @@ public class ReplayHandler {
|
|||||||
quickReplaySender.sendPacketsTill(targetTime);
|
quickReplaySender.sendPacketsTill(targetTime);
|
||||||
|
|
||||||
// Immediately apply player teleport interpolation
|
// Immediately apply player teleport interpolation
|
||||||
for (Entity entity : loadedEntityList(world(mc))) {
|
for (Entity entity : loadedEntityList(mc.world)) {
|
||||||
skipTeleportInterpolation(entity);
|
skipTeleportInterpolation(entity);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -580,7 +576,7 @@ public class ReplayHandler {
|
|||||||
//$$ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
//$$ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
//#endif
|
//#endif
|
||||||
drawBackground(0);
|
drawBackground(0);
|
||||||
drawCenteredString(getFontRenderer(mc), I18n.format("replaymod.gui.pleasewait"),
|
drawCenteredString(mc.fontRenderer, I18n.format("replaymod.gui.pleasewait"),
|
||||||
width / 2, height / 2, 0xffffffff);
|
width / 2, height / 2, 0xffffffff);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -633,13 +629,13 @@ public class ReplayHandler {
|
|||||||
replaySender.setAsyncMode(true);
|
replaySender.setAsyncMode(true);
|
||||||
replaySender.setReplaySpeed(0);
|
replaySender.setReplaySpeed(0);
|
||||||
|
|
||||||
getConnection(mc).getNetworkManager()
|
mc.getConnection().getNetworkManager()
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
.tick();
|
.tick();
|
||||||
//#else
|
//#else
|
||||||
//$$ .processReceivedPackets();
|
//$$ .processReceivedPackets();
|
||||||
//#endif
|
//#endif
|
||||||
for (Entity entity : loadedEntityList(world(mc))) {
|
for (Entity entity : loadedEntityList(mc.world)) {
|
||||||
skipTeleportInterpolation(entity);
|
skipTeleportInterpolation(entity);
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX;
|
entity.lastTickPosX = entity.prevPosX = entity.posX;
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY;
|
entity.lastTickPosY = entity.prevPosY = entity.posY;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.replaymod.core.Module;
|
|||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.utils.ModCompat;
|
import com.replaymod.core.utils.ModCompat;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replay.camera.CameraController;
|
import com.replaymod.replay.camera.CameraController;
|
||||||
import com.replaymod.replay.camera.CameraControllerRegistry;
|
import com.replaymod.replay.camera.CameraControllerRegistry;
|
||||||
import com.replaymod.replay.camera.CameraEntity;
|
import com.replaymod.replay.camera.CameraEntity;
|
||||||
@@ -24,12 +25,6 @@ import net.minecraft.client.Minecraft;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
|
||||||
//#else
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -19,11 +19,17 @@ import net.minecraft.entity.EntityLiving;
|
|||||||
import net.minecraft.entity.item.EntityItemFrame;
|
import net.minecraft.entity.item.EntityItemFrame;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.event.EntityViewRenderEvent;
|
import net.minecraftforge.client.event.EntityViewRenderEvent;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import net.minecraftforge.client.event.RenderHandEvent;
|
import net.minecraftforge.client.event.RenderHandEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.eventbus.api.EventPriority;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraft.util.math.RayTraceFluidMode;
|
import net.minecraft.util.math.RayTraceFluidMode;
|
||||||
@@ -43,30 +49,13 @@ import net.minecraft.client.util.RecipeBookClient;
|
|||||||
//#endif
|
//#endif
|
||||||
import net.minecraft.stats.StatisticsManager;
|
import net.minecraft.stats.StatisticsManager;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
|
||||||
import net.minecraft.util.text.ITextComponent;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.stats.StatFileWriter;
|
//$$ import net.minecraft.stats.StatFileWriter;
|
||||||
//$$ import net.minecraft.util.AxisAlignedBB;
|
|
||||||
//$$ import net.minecraft.util.IChatComponent;
|
|
||||||
//$$ import net.minecraft.util.MovingObjectPosition;
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.EventPriority;
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.EventPriority;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//$$ import cpw.mods.fml.common.gameevent.TickEvent;
|
|
||||||
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
|
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
//$$ import net.minecraft.util.Session;
|
//$$ import net.minecraft.util.Session;
|
||||||
//#endif
|
//#endif
|
||||||
@@ -245,14 +234,14 @@ public class CameraEntity
|
|||||||
// 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
|
||||||
|| world(view) != world(this))
|
|| view.world != world)
|
||||||
|| world(this).getEntityByID(view.getEntityId()) != view) {
|
|| world.getEntityByID(view.getEntityId()) != view) {
|
||||||
if (spectating == null) {
|
if (spectating == null) {
|
||||||
// Entity (non-player) died, stop spectating
|
// Entity (non-player) died, stop spectating
|
||||||
ReplayModReplay.instance.getReplayHandler().spectateEntity(this);
|
ReplayModReplay.instance.getReplayHandler().spectateEntity(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
view = world(this).getPlayerEntityByUUID(spectating);
|
view = world.getPlayerEntityByUUID(spectating);
|
||||||
if (view != null) {
|
if (view != null) {
|
||||||
setRenderViewEntity(mc, view);
|
setRenderViewEntity(mc, view);
|
||||||
} else {
|
} else {
|
||||||
@@ -271,8 +260,8 @@ public class CameraEntity
|
|||||||
@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 (world(mc) != null) {
|
if (mc.world != null) {
|
||||||
world(this, world(mc));
|
world = mc.world;
|
||||||
}
|
}
|
||||||
super.preparePlayerToSpawn();
|
super.preparePlayerToSpawn();
|
||||||
}
|
}
|
||||||
@@ -513,10 +502,10 @@ public class CameraEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, KeyBinding> keyBindings = ReplayMod.instance.getKeyBindingRegistry().getKeyBindings();
|
Map<String, KeyBinding> keyBindings = ReplayMod.instance.getKeyBindingRegistry().getKeyBindings();
|
||||||
if (isKeyDown(keyBindings.get("replaymod.input.rollclockwise"))) {
|
if (keyBindings.get("replaymod.input.rollclockwise").isKeyDown()) {
|
||||||
roll += Utils.isCtrlDown() ? 0.2 : 1;
|
roll += Utils.isCtrlDown() ? 0.2 : 1;
|
||||||
}
|
}
|
||||||
if (isKeyDown(keyBindings.get("replaymod.input.rollcounterclockwise"))) {
|
if (keyBindings.get("replaymod.input.rollcounterclockwise").isKeyDown()) {
|
||||||
roll -= Utils.isCtrlDown() ? 0.2 : 1;
|
roll -= Utils.isCtrlDown() ? 0.2 : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -545,11 +534,7 @@ public class CameraEntity
|
|||||||
}
|
}
|
||||||
//#else
|
//#else
|
||||||
//$$ @Override
|
//$$ @Override
|
||||||
//#if MC>=10904
|
|
||||||
//$$ public void addChatMessage(ITextComponent message) {
|
//$$ public void addChatMessage(ITextComponent message) {
|
||||||
//#else
|
|
||||||
//$$ public void addChatMessage(IChatComponent message) {
|
|
||||||
//#endif
|
|
||||||
//$$ if (MinecraftForge.EVENT_BUS.post(new ReplayChatMessageEvent(this))) return;
|
//$$ if (MinecraftForge.EVENT_BUS.post(new ReplayChatMessageEvent(this))) return;
|
||||||
//$$ super.addChatMessage(message);
|
//$$ super.addChatMessage(message);
|
||||||
//$$ }
|
//$$ }
|
||||||
@@ -633,8 +618,8 @@ public class CameraEntity
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
player(mc).renderArmYaw = player(mc).prevRenderArmYaw = player.rotationYaw;
|
mc.player.renderArmYaw = mc.player.prevRenderArmYaw = player.rotationYaw;
|
||||||
player(mc).renderArmPitch = player(mc).prevRenderArmPitch = player.rotationPitch;
|
mc.player.renderArmPitch = mc.player.prevRenderArmPitch = player.rotationPitch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class ClassicCameraController implements CameraController {
|
|||||||
boolean forward = false, backward = false, left = false, right = false, up = false, down = false;
|
boolean forward = false, backward = false, left = false, right = false, up = false, down = false;
|
||||||
speedup = false;
|
speedup = false;
|
||||||
for(KeyBinding kb : getMinecraft().gameSettings.keyBindings) {
|
for(KeyBinding kb : getMinecraft().gameSettings.keyBindings) {
|
||||||
if(!isKeyDown(kb)) continue;
|
if(!kb.isKeyDown()) continue;
|
||||||
if(kb.getKeyDescription().equals("key.forward")) {
|
if(kb.getKeyDescription().equals("key.forward")) {
|
||||||
forward = true;
|
forward = true;
|
||||||
speedup = true;
|
speedup = true;
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import net.minecraft.client.GameSettings;
|
|||||||
|
|
||||||
import javax.vecmath.Vector3f;
|
import javax.vecmath.Vector3f;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Camera controller performing vanilla creative-like camera movements.
|
* Camera controller performing vanilla creative-like camera movements.
|
||||||
*/
|
*/
|
||||||
@@ -47,7 +45,7 @@ public class VanillaCameraController implements CameraController {
|
|||||||
if (partialTicksPassed == 0) return;
|
if (partialTicksPassed == 0) return;
|
||||||
Vector3f direction = new Vector3f(0, 0, 0);
|
Vector3f direction = new Vector3f(0, 0, 0);
|
||||||
for (int i = 0; i < 6; i++) { // First, get movement direction depending on keys pressed
|
for (int i = 0; i < 6; i++) { // First, get movement direction depending on keys pressed
|
||||||
if (isKeyDown(bindings[i])) {
|
if (bindings[i].isKeyDown()) {
|
||||||
direction.add(DIRECTIONS[i]);
|
direction.add(DIRECTIONS[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,19 +3,8 @@ package com.replaymod.replay.events;
|
|||||||
import com.replaymod.replay.camera.CameraEntity;
|
import com.replaymod.replay.camera.CameraEntity;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Cancelable;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|||||||
@@ -3,16 +3,7 @@ package com.replaymod.replay.events;
|
|||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public abstract class ReplayCloseEvent extends Event {
|
public abstract class ReplayCloseEvent extends Event {
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
package com.replaymod.replay.events;
|
package com.replaymod.replay.events;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Cancelable;
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
public abstract class ReplayDispatchKeypressesEvent extends Event {
|
public abstract class ReplayDispatchKeypressesEvent extends Event {
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,7 @@ package com.replaymod.replay.events;
|
|||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.Event;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public abstract class ReplayOpenEvent extends Event {
|
public abstract class ReplayOpenEvent extends Event {
|
||||||
|
|||||||
@@ -10,15 +10,10 @@ import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
|||||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||||
import de.johni0702.minecraft.gui.utils.Colors;
|
import de.johni0702.minecraft.gui.utils.Colors;
|
||||||
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replaystudio.data.Marker;
|
import com.replaymod.replaystudio.data.Marker;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
|
||||||
//#else
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class GuiEditMarkerPopup extends AbstractGuiPopup<GuiEditMarkerPopup> implements Typeable {
|
public class GuiEditMarkerPopup extends AbstractGuiPopup<GuiEditMarkerPopup> implements Typeable {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.replaymod.replay.gui.overlay;
|
package com.replaymod.replay.gui.overlay;
|
||||||
|
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
import com.replaymod.replaystudio.data.Marker;
|
import com.replaymod.replaystudio.data.Marker;
|
||||||
@@ -15,12 +16,6 @@ import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
|
||||||
//#else
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
|||||||
@@ -17,25 +17,13 @@ import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
|||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||||
import de.johni0702.minecraft.gui.utils.lwjgl.WritablePoint;
|
import de.johni0702.minecraft.gui.utils.lwjgl.WritablePoint;
|
||||||
import net.minecraft.client.resources.I18n;
|
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraft.client.GameSettings;
|
import net.minecraft.client.GameSettings;
|
||||||
//#else
|
import net.minecraft.client.resources.I18n;
|
||||||
//$$ import net.minecraft.client.settings.GameSettings;
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
//#if MC<11300
|
||||||
//$$ import cpw.mods.fml.common.gameevent.InputEvent;
|
//$$ import org.lwjgl.input.Keyboard;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
import static com.replaymod.core.ReplayMod.TEXTURE_SIZE;
|
import static com.replaymod.core.ReplayMod.TEXTURE_SIZE;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.replaymod.core.SettingsRegistry;
|
|||||||
import com.replaymod.core.gui.GuiReplaySettings;
|
import com.replaymod.core.gui.GuiReplaySettings;
|
||||||
import com.replaymod.core.utils.Utils;
|
import com.replaymod.core.utils.Utils;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
import com.replaymod.replay.Setting;
|
import com.replaymod.replay.Setting;
|
||||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||||
@@ -25,7 +26,6 @@ import de.johni0702.minecraft.gui.element.*;
|
|||||||
import de.johni0702.minecraft.gui.element.advanced.AbstractGuiResourceLoadingList;
|
import de.johni0702.minecraft.gui.element.advanced.AbstractGuiResourceLoadingList;
|
||||||
import de.johni0702.minecraft.gui.function.Typeable;
|
import de.johni0702.minecraft.gui.function.Typeable;
|
||||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||||
import de.johni0702.minecraft.gui.layout.GridLayout;
|
|
||||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||||
@@ -39,17 +39,12 @@ import lombok.Getter;
|
|||||||
import net.minecraft.client.gui.GuiErrorScreen;
|
import net.minecraft.client.gui.GuiErrorScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOCase;
|
import org.apache.commons.io.IOCase;
|
||||||
import org.apache.commons.io.filefilter.SuffixFileFilter;
|
import org.apache.commons.io.filefilter.SuffixFileFilter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
|
||||||
//#else
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileFilter;
|
import java.io.FileFilter;
|
||||||
@@ -61,7 +56,6 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.replaymod.replay.ReplayModReplay.LOGGER;
|
import static com.replaymod.replay.ReplayModReplay.LOGGER;
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
|
|
||||||
public class GuiReplayViewer extends GuiScreen {
|
public class GuiReplayViewer extends GuiScreen {
|
||||||
private final ReplayModReplay mod;
|
private final ReplayModReplay mod;
|
||||||
|
|||||||
@@ -10,16 +10,7 @@ import net.minecraft.client.gui.GuiMainMenu;
|
|||||||
import net.minecraft.client.gui.GuiMultiplayer;
|
import net.minecraft.client.gui.GuiMultiplayer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
//#else
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -70,7 +61,7 @@ public class GuiHandler {
|
|||||||
// Replace "Exit Server" button with "Exit Replay" button
|
// Replace "Exit Server" button with "Exit Replay" button
|
||||||
case BUTTON_EXIT_SERVER:
|
case BUTTON_EXIT_SERVER:
|
||||||
removeButton(event, b);
|
removeButton(event, b);
|
||||||
addButton(event, new GuiButton(BUTTON_EXIT_REPLAY, x(b), y(b), b.width, b.height, I18n.format("replaymod.gui.exit")) {
|
addButton(event, new GuiButton(BUTTON_EXIT_REPLAY, b.x, b.y, b.width, b.height, I18n.format("replaymod.gui.exit")) {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@Override
|
@Override
|
||||||
public void onClick(double mouseX, double mouseY) {
|
public void onClick(double mouseX, double mouseY) {
|
||||||
@@ -97,14 +88,14 @@ public class GuiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (achievements != null && stats != null) {
|
if (achievements != null && stats != null) {
|
||||||
moveAllButtonsDirectlyBelowUpwards(buttonList, y(achievements),
|
moveAllButtonsDirectlyBelowUpwards(buttonList, achievements.y,
|
||||||
x(achievements), x(stats) + stats.width);
|
achievements.x, stats.x + stats.width);
|
||||||
}
|
}
|
||||||
// In 1.13+ Forge, the Options button shares one row with the Open to LAN button
|
// In 1.13+ Forge, the Options button shares one row with the Open to LAN button
|
||||||
//#if MC<11300
|
//#if MC<11300
|
||||||
//$$ if (openToLan != null) {
|
//$$ if (openToLan != null) {
|
||||||
//$$ moveAllButtonsDirectlyBelowUpwards(buttonList, y(openToLan),
|
//$$ moveAllButtonsDirectlyBelowUpwards(buttonList, openToLan.y,
|
||||||
//$$ x(openToLan), x(openToLan) + openToLan.width);
|
//$$ openToLan.x, openToLan.x + openToLan.width);
|
||||||
//$$ }
|
//$$ }
|
||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
@@ -119,8 +110,8 @@ public class GuiHandler {
|
|||||||
*/
|
*/
|
||||||
private void moveAllButtonsDirectlyBelowUpwards(List<GuiButton> buttons, int belowY, int xStart, int xEnd) {
|
private void moveAllButtonsDirectlyBelowUpwards(List<GuiButton> buttons, int belowY, int xStart, int xEnd) {
|
||||||
for (GuiButton button : buttons) {
|
for (GuiButton button : buttons) {
|
||||||
if (y(button) >= belowY && x(button) <= xEnd && x(button) + button.width >= xStart) {
|
if (button.y >= belowY && button.x <= xEnd && button.x + button.width >= xStart) {
|
||||||
y(button, y(button) - 24);
|
button.y -= 24;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public abstract class MixinGuiSpectator {
|
|||||||
//#endif
|
//#endif
|
||||||
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 (player(getMinecraft()) instanceof CameraEntity) {
|
if (getMinecraft().player instanceof CameraEntity) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import net.minecraft.stats.StatisticsManager;
|
|||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
|
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
@@ -90,8 +88,8 @@ public abstract class MixinPlayerControllerMP {
|
|||||||
//$$ @Inject(method = "isSpectator", at=@At("HEAD"), cancellable = true)
|
//$$ @Inject(method = "isSpectator", at=@At("HEAD"), cancellable = true)
|
||||||
//#endif
|
//#endif
|
||||||
private void replayModReplay_isSpectator(CallbackInfoReturnable<Boolean> ci) {
|
private void replayModReplay_isSpectator(CallbackInfoReturnable<Boolean> ci) {
|
||||||
if (player(mc) 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(player(mc).isSpectator());
|
ci.setReturnValue(mc.player.isSpectator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -2,27 +2,18 @@ package com.replaymod.replay.mixin;
|
|||||||
|
|
||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
|
import net.minecraft.client.renderer.ItemRenderer;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
import net.minecraft.client.renderer.ItemRenderer;
|
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.Minecraft;
|
//$$ import net.minecraft.client.Minecraft;
|
||||||
//#if MC>=10904
|
|
||||||
//$$ import net.minecraft.client.renderer.RenderItem;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.renderer.entity.RenderItem;
|
|
||||||
//#endif
|
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
@Mixin(ItemRenderer.class)
|
@Mixin(ItemRenderer.class)
|
||||||
//#else
|
|
||||||
//$$ @Mixin(RenderItem.class)
|
|
||||||
//#endif
|
|
||||||
public class MixinRenderItem {
|
public class MixinRenderItem {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@Redirect(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J"))
|
@Redirect(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J"))
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import static com.replaymod.core.versions.MCVer.*;
|
|||||||
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 = player(getMinecraft());
|
EntityPlayer thePlayer = getMinecraft().player;
|
||||||
if (thePlayer instanceof CameraEntity && entity.isInvisible()) {
|
if (thePlayer instanceof CameraEntity && entity.isInvisible()) {
|
||||||
ci.setReturnValue(false);
|
ci.setReturnValue(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
package com.replaymod.replay.mixin;
|
package com.replaymod.replay.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.GameSettings;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -12,12 +13,6 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraft.client.GameSettings;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.settings.GameSettings;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@Mixin(RenderManager.class)
|
@Mixin(RenderManager.class)
|
||||||
public class MixinRenderManager {
|
public class MixinRenderManager {
|
||||||
@Shadow
|
@Shadow
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.replaymod.replay.mixin;
|
|||||||
|
|
||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
@@ -12,17 +13,7 @@ import net.minecraft.util.Util;
|
|||||||
//$$ import net.minecraft.client.Minecraft;
|
//$$ import net.minecraft.client.Minecraft;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.client.renderer.tileentity.RenderEndPortal;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if MC>=10800
|
|
||||||
@Mixin(TileEntityEndPortalRenderer.class)
|
@Mixin(TileEntityEndPortalRenderer.class)
|
||||||
//#else
|
|
||||||
//$$ @Mixin(RenderEndPortal.class)
|
|
||||||
//#endif
|
|
||||||
public class MixinTileEntityEndPortalRenderer {
|
public class MixinTileEntityEndPortalRenderer {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J"))
|
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J"))
|
||||||
|
|||||||
@@ -3,16 +3,11 @@ package com.replaymod.replay.mixin;
|
|||||||
|
|
||||||
import net.minecraft.client.renderer.ViewFrustum;
|
import net.minecraft.client.renderer.ViewFrustum;
|
||||||
import net.minecraft.client.renderer.chunk.RenderChunk;
|
import net.minecraft.client.renderer.chunk.RenderChunk;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
//#if MC>=10904
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
//#else
|
|
||||||
//$$ import net.minecraft.util.BlockPos;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
@Mixin(ViewFrustum.class)
|
@Mixin(ViewFrustum.class)
|
||||||
public abstract class MixinViewFrustum {
|
public abstract class MixinViewFrustum {
|
||||||
@Redirect(method = "updateChunkPositions", at=@At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/chunk/RenderChunk;setPosition(III)V"))
|
@Redirect(method = "updateChunkPositions", at=@At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/chunk/RenderChunk;setPosition(III)V"))
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.replaymod.core.KeyBindingRegistry;
|
|||||||
import com.replaymod.core.Module;
|
import com.replaymod.core.Module;
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.core.events.SettingsChangedEvent;
|
import com.replaymod.core.events.SettingsChangedEvent;
|
||||||
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
import com.replaymod.replay.events.ReplayCloseEvent;
|
import com.replaymod.replay.events.ReplayCloseEvent;
|
||||||
import com.replaymod.replay.events.ReplayOpenEvent;
|
import com.replaymod.replay.events.ReplayOpenEvent;
|
||||||
@@ -19,20 +20,11 @@ import com.replaymod.simplepathing.gui.GuiPathing;
|
|||||||
import com.replaymod.simplepathing.preview.PathPreview;
|
import com.replaymod.simplepathing.preview.PathPreview;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
//#if MC>=11300
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import org.lwjgl.input.Keyboard;
|
|
||||||
//#if MC>=10800
|
|
||||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#else
|
|
||||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
//#endif
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -41,7 +33,7 @@ import java.util.concurrent.Executors;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import static com.replaymod.core.versions.MCVer.*;
|
import static com.replaymod.core.versions.MCVer.FML_BUS;
|
||||||
|
|
||||||
public class ReplayModSimplePathing implements Module {
|
public class ReplayModSimplePathing implements Module {
|
||||||
{ instance = this; }
|
{ instance = this; }
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
|
import net.minecraft.crash.ReportedException;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
import org.apache.commons.lang3.tuple.Triple;
|
import org.apache.commons.lang3.tuple.Triple;
|
||||||
|
|||||||
6
versions/1.11.2/mapping.txt
Normal file
6
versions/1.11.2/mapping.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
net.minecraft.network.PacketBuffer readVarInt() readVarIntFromBuffer()
|
||||||
|
net.minecraft.network.PacketBuffer writeVarInt() writeVarIntToBuffer()
|
||||||
|
net.minecraft.util.math.MathHelper floor() floor_double()
|
||||||
|
net.minecraft.client.Minecraft player thePlayer
|
||||||
|
net.minecraft.client.Minecraft world theWorld
|
||||||
|
net.minecraft.entity.Entity world worldObj
|
||||||
4
versions/1.12/mapping.txt
Normal file
4
versions/1.12/mapping.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
net.minecraft.client.Minecraft fontRenderer fontRendererObj
|
||||||
|
net.minecraft.client.renderer.BufferBuilder net.minecraft.client.renderer.VertexBuffer
|
||||||
|
net.minecraft.client.gui.GuiButton x xPosition
|
||||||
|
net.minecraft.client.gui.GuiButton y yPosition
|
||||||
21
versions/1.13.2/mapping.txt
Normal file
21
versions/1.13.2/mapping.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
net.minecraft.client.GameSettings net.minecraft.client.settings.GameSettings
|
||||||
|
net.minecraftforge.eventbus.api.SubscribeEvent net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
net.minecraftforge.eventbus.api.EventPriority net.minecraftforge.fml.common.eventhandler.EventPriority
|
||||||
|
net.minecraftforge.eventbus.api.Cancelable net.minecraftforge.fml.common.eventhandler.Cancelable
|
||||||
|
net.minecraftforge.eventbus.api.Event net.minecraftforge.fml.common.eventhandler.Event
|
||||||
|
net.minecraft.client.renderer.entity.model.ModelBox net.minecraft.client.model.ModelBox
|
||||||
|
net.minecraft.client.renderer.entity.model.ModelRenderer net.minecraft.client.model.ModelRenderer
|
||||||
|
net.minecraft.crash.ReportedException net.minecraft.util.ReportedException
|
||||||
|
net.minecraftforge.eventbus.api.IEventBus net.minecraftforge.fml.common.eventhandler.EventBus
|
||||||
|
com.replaymod.core.versions.MCVer.Keyboard org.lwjgl.input.Keyboard
|
||||||
|
net.minecraft.client.Minecraft gameDir mcDataDir
|
||||||
|
net.minecraft.client.Minecraft getInstance() getMinecraft()
|
||||||
|
net.minecraft.client.renderer.WorldRenderer net.minecraft.client.renderer.RenderGlobal
|
||||||
|
net.minecraft.network.play.server.SPacketEntity.Move net.minecraft.network.play.server.SPacketEntity.S17PacketEntityLookMove
|
||||||
|
net.minecraft.entity.Entity isPassenger() isRiding()
|
||||||
|
net.minecraft.entity.Entity removed isDead
|
||||||
|
net.minecraftforge.fml.network.NetworkRegistry net.minecraftforge.fml.common.network.NetworkRegistry
|
||||||
|
net.minecraft.client.renderer.ItemRenderer net.minecraft.client.renderer.RenderItem
|
||||||
|
net.minecraft.world.World getChunk() getChunkFromChunkCoords()
|
||||||
|
net.minecraft.util.text.ITextComponent getString() getUnformattedText()
|
||||||
|
net.minecraft.network.play.server.SPacketRespawn func_212643_b() getDimensionID()
|
||||||
8
versions/1.8.9/mapping.txt
Normal file
8
versions/1.8.9/mapping.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
net.minecraft.network.play.server.S38PacketPlayerListItem getAction() func_179768_b()
|
||||||
|
net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData getProfile() func_179962_a()
|
||||||
|
net.minecraft.network.play.server.S48PacketResourcePackSend getURL() func_179783_a()
|
||||||
|
net.minecraft.network.play.server.S48PacketResourcePackSend getHash() func_179784_b()
|
||||||
|
net.minecraft.network.play.server.S0CPacketSpawnPlayer getPlayer() func_179819_c()
|
||||||
|
net.minecraft.network.play.server.S40PacketDisconnect getReason() func_149165_c()
|
||||||
|
net.minecraft.network.play.server.S2BPacketChangeGameState getGameState() func_149138_c()
|
||||||
|
net.minecraft.network.play.server.S0EPacketSpawnObject getType() func_148993_l()
|
||||||
33
versions/1.8/mapping.txt
Normal file
33
versions/1.8/mapping.txt
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
net.minecraftforge.fml.common.Mod cpw.mods.fml.common.Mod
|
||||||
|
net.minecraftforge.fml.common.Loader cpw.mods.fml.common.Loader
|
||||||
|
net.minecraftforge.fml.common.Mod.EventHandler cpw.mods.fml.common.Mod.EventHandler
|
||||||
|
net.minecraftforge.fml.common.Mod.Instance cpw.mods.fml.common.Mod.Instance
|
||||||
|
net.minecraftforge.fml.common.ModContainer cpw.mods.fml.common.ModContainer
|
||||||
|
net.minecraftforge.fml.common.event.FMLInitializationEvent cpw.mods.fml.common.event.FMLInitializationEvent
|
||||||
|
net.minecraftforge.fml.common.event.FMLPreInitializationEvent cpw.mods.fml.common.event.FMLPreInitializationEvent
|
||||||
|
net.minecraftforge.fml.common.eventhandler.SubscribeEvent cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||||
|
net.minecraftforge.fml.common.eventhandler.EventPriority cpw.mods.fml.common.eventhandler.EventPriority
|
||||||
|
net.minecraftforge.fml.common.eventhandler.Cancelable cpw.mods.fml.common.eventhandler.Cancelable
|
||||||
|
net.minecraftforge.fml.common.eventhandler.Event cpw.mods.fml.common.eventhandler.Event
|
||||||
|
net.minecraftforge.fml.client.registry.ClientRegistry cpw.mods.fml.client.registry.ClientRegistry
|
||||||
|
net.minecraftforge.fml.common.gameevent.InputEvent cpw.mods.fml.common.gameevent.InputEvent
|
||||||
|
net.minecraftforge.fml.common.gameevent.TickEvent cpw.mods.fml.common.gameevent.TickEvent
|
||||||
|
net.minecraftforge.fml.relauncher.CoreModManager cpw.mods.fml.relauncher.CoreModManager
|
||||||
|
net.minecraftforge.fml.relauncher.IFMLLoadingPlugin cpw.mods.fml.relauncher.IFMLLoadingPlugin
|
||||||
|
net.minecraftforge.fml.common.FMLCommonHandler cpw.mods.fml.common.FMLCommonHandler
|
||||||
|
net.minecraftforge.fml.common.eventhandler.EventBus cpw.mods.fml.common.eventhandler.EventBus
|
||||||
|
net.minecraft.client.renderer.GlStateManager com.replaymod.core.versions.MCVer.GlStateManager
|
||||||
|
net.minecraft.client.renderer.GlStateManager.BooleanState com.replaymod.render.hooks.GLStateTracker.BooleanState
|
||||||
|
net.minecraft.client.settings.KeyBinding isKeyDown() getIsKeyPressed()
|
||||||
|
net.minecraftforge.fml.common.network.FMLNetworkEvent cpw.mods.fml.common.network.FMLNetworkEvent
|
||||||
|
net.minecraftforge.fml.common.network.handshake.FMLHandshakeCodec cpw.mods.fml.common.network.handshake.FMLHandshakeCodec
|
||||||
|
net.minecraftforge.fml.common.network.handshake.NetworkDispatcher cpw.mods.fml.common.network.handshake.NetworkDispatcher
|
||||||
|
net.minecraftforge.fml.relauncher.Side cpw.mods.fml.relauncher.Side
|
||||||
|
net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent
|
||||||
|
net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage cpw.mods.fml.common.network.handshake.FMLHandshakeMessage
|
||||||
|
net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage.RegistryData cpw.mods.fml.common.network.handshake.FMLHandshakeMessage.ModIdData
|
||||||
|
net.minecraftforge.fml.common.network.NetworkRegistry cpw.mods.fml.common.network.NetworkRegistry
|
||||||
|
net.minecraftforge.fml.common.gameevent.InputEvent cpw.mods.fml.common.gameevent.InputEvent
|
||||||
|
net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer net.minecraft.client.renderer.tileentity.RenderEndPortal
|
||||||
|
net.minecraft.network.play.server.S3FPacketCustomPayload getChannelName() func_149169_c()
|
||||||
|
net.minecraft.network.play.server.S01PacketJoinGame getEntityId() func_149197_c()
|
||||||
45
versions/1.9.4/mapping.txt
Normal file
45
versions/1.9.4/mapping.txt
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
net.minecraft.client.renderer.VertexBuffer net.minecraft.client.renderer.WorldRenderer
|
||||||
|
net.minecraft.client.renderer.Tessellator getBuffer() getWorldRenderer()
|
||||||
|
net.minecraft.client.particle.Particle net.minecraft.client.particle.EntityFX
|
||||||
|
net.minecraft.util.math.MathHelper net.minecraft.util.MathHelper
|
||||||
|
net.minecraft.util.SoundCategory net.minecraft.client.audio.SoundCategory
|
||||||
|
net.minecraft.client.Minecraft getConnection() getNetHandler()
|
||||||
|
net.minecraft.client.multiplayer.ServerList saveSingleServer() func_147414_b()
|
||||||
|
net.minecraft.client.network.NetHandlerPlayClient sendPacket() addToSendQueue()
|
||||||
|
net.minecraft.util.math.BlockPos net.minecraft.util.BlockPos
|
||||||
|
net.minecraft.client.gui.GuiWorldSelection net.minecraft.client.gui.GuiSelectWorld
|
||||||
|
net.minecraft.util.text.TextComponentString net.minecraft.util.ChatComponentText
|
||||||
|
net.minecraft.util.text.ITextComponent net.minecraft.util.IChatComponent
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnPlayer getUniqueId() getPlayer()
|
||||||
|
net.minecraft.util.math.AxisAlignedBB net.minecraft.util.AxisAlignedBB
|
||||||
|
net.minecraft.util.math.RayTraceResult net.minecraft.util.MovingObjectPosition
|
||||||
|
net.minecraft.client.renderer.RenderItem net.minecraft.client.renderer.entity.RenderItem
|
||||||
|
net.minecraft.network.play.server.SPacketJoinGame getPlayerId() getEntityId()
|
||||||
|
|
||||||
|
net.minecraft.network.play.server.SPacketJoinGame net.minecraft.network.play.server.S01PacketJoinGame
|
||||||
|
net.minecraft.network.play.server.SPacketChat net.minecraft.network.play.server.S02PacketChat
|
||||||
|
net.minecraft.network.play.server.SPacketParticles net.minecraft.network.play.server.S2APacketParticles
|
||||||
|
net.minecraft.network.play.server.SPacketChangeGameState net.minecraft.network.play.server.S2BPacketChangeGameState
|
||||||
|
net.minecraft.network.play.server.SPacketPlayerPosLook net.minecraft.network.play.server.S08PacketPlayerPosLook
|
||||||
|
net.minecraft.network.play.server.SPacketPlayerListItem net.minecraft.network.play.server.S38PacketPlayerListItem
|
||||||
|
net.minecraft.network.play.server.SPacketRespawn net.minecraft.network.play.server.S07PacketRespawn
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnPlayer net.minecraft.network.play.server.S0CPacketSpawnPlayer
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnObject net.minecraft.network.play.server.S0EPacketSpawnObject
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnMob net.minecraft.network.play.server.S0FPacketSpawnMob
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnGlobalEntity net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnPainting net.minecraft.network.play.server.S10PacketSpawnPainting
|
||||||
|
net.minecraft.network.play.server.SPacketSpawnExperienceOrb net.minecraft.network.play.server.S11PacketSpawnExperienceOrb
|
||||||
|
net.minecraft.network.play.server.SPacketDestroyEntities net.minecraft.network.play.server.S13PacketDestroyEntities
|
||||||
|
net.minecraft.network.play.server.SPacketEntityTeleport net.minecraft.network.play.server.S18PacketEntityTeleport
|
||||||
|
net.minecraft.network.play.server.SPacketEntityHeadLook net.minecraft.network.play.server.S19PacketEntityHeadLook
|
||||||
|
net.minecraft.network.play.server.SPacketEntityVelocity net.minecraft.network.play.server.S12PacketEntityVelocity
|
||||||
|
net.minecraft.network.play.server.SPacketEntityAttach net.minecraft.network.play.server.S1BPacketEntityAttach
|
||||||
|
net.minecraft.network.play.server.SPacketAnimation net.minecraft.network.play.server.S0BPacketAnimation
|
||||||
|
net.minecraft.network.play.server.SPacketCollectItem net.minecraft.network.play.server.S0DPacketCollectItem
|
||||||
|
net.minecraft.network.play.server.SPacketBlockBreakAnim net.minecraft.network.play.server.S25PacketBlockBreakAnim
|
||||||
|
net.minecraft.network.play.client.CPacketResourcePackStatus net.minecraft.network.play.client.C19PacketResourcePackStatus
|
||||||
|
net.minecraft.network.play.client.CPacketResourcePackStatus.Action net.minecraft.network.play.client.C19PacketResourcePackStatus.Action
|
||||||
|
net.minecraft.network.play.server.SPacketResourcePackSend net.minecraft.network.play.server.S48PacketResourcePackSend
|
||||||
|
net.minecraft.network.play.server.SPacketCustomPayload net.minecraft.network.play.server.S3FPacketCustomPayload
|
||||||
|
net.minecraft.network.play.server.SPacketDisconnect net.minecraft.network.play.server.S40PacketDisconnect
|
||||||
|
net.minecraft.network.login.server.SPacketLoginSuccess net.minecraft.network.login.server.S02PacketLoginSuccess
|
||||||
@@ -42,7 +42,7 @@ buildscript {
|
|||||||
mcVersion >= 10710 ? '1.2-SNAPSHOT' :
|
mcVersion >= 10710 ? '1.2-SNAPSHOT' :
|
||||||
'invalid'
|
'invalid'
|
||||||
)
|
)
|
||||||
classpath 'com.github.replaymod:preprocessor:3654e32'
|
classpath 'com.github.replaymod:preprocessor:92151f1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user