Make use of the source remapping feature of The Preprocessor plugin
This commit is contained in:
@@ -6,35 +6,22 @@ import com.replaymod.core.versions.MCVer;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
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
|
||||
//#else
|
||||
//$$ import org.lwjgl.input.Keyboard;
|
||||
//#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.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
public class KeyBindingRegistry {
|
||||
private Map<String, KeyBinding> keyBindings = new HashMap<String, KeyBinding>();
|
||||
private Multimap<KeyBinding, Runnable> keyBindingHandlers = ArrayListMultimap.create();
|
||||
@@ -81,7 +68,7 @@ public class KeyBindingRegistry {
|
||||
|
||||
public void handleRepeatedKeyBindings() {
|
||||
for (Map.Entry<KeyBinding, Collection<Runnable>> entry : repeatedKeyBindingHandlers.asMap().entrySet()) {
|
||||
if (isKeyDown(entry.getKey())) {
|
||||
if (entry.getKey().isKeyDown()) {
|
||||
invokeKeyBindingHandlers(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
@@ -104,7 +91,7 @@ public class KeyBindingRegistry {
|
||||
CrashReportCategory category = crashReport.makeCategory("Key Binding");
|
||||
MCVer.addDetail(category, "Key Binding", keyBinding::toString);
|
||||
MCVer.addDetail(category, "Handler", runnable::toString);
|
||||
throw newReportedException(crashReport);
|
||||
throw new ReportedException(crashReport);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,7 +107,7 @@ public class KeyBindingRegistry {
|
||||
CrashReportCategory category = crashReport.makeCategory("Key Binding");
|
||||
MCVer.addDetail(category, "Key Code", () -> "" + keyCode);
|
||||
MCVer.addDetail(category, "Handler", runnable::toString);
|
||||
throw newReportedException(crashReport);
|
||||
throw new ReportedException(crashReport);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,11 @@ package com.replaymod.core;
|
||||
//$$ import org.spongepowered.asm.launch.MixinBootstrap;
|
||||
//$$ import org.spongepowered.asm.mixin.Mixins;
|
||||
//$$
|
||||
//#if MC>=10800
|
||||
//$$ import net.minecraftforge.fml.relauncher.CoreModManager;
|
||||
//$$ import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
||||
//#else
|
||||
//#if MC<10800
|
||||
//$$ import com.replaymod.core.asm.GLErrorTransformer;
|
||||
//$$ 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.List;
|
||||
|
||||
@@ -19,6 +19,7 @@ import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -49,38 +50,29 @@ import net.minecraft.util.text.*;
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=11300
|
||||
import net.minecraft.client.GameSettings;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11300
|
||||
import net.minecraftforge.fml.ModContainer;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.settings.GameSettings;
|
||||
//$$ import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
//$$ import net.minecraftforge.fml.common.Loader;
|
||||
//$$ import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
//$$ import net.minecraftforge.fml.common.Mod.Instance;
|
||||
//$$ import net.minecraftforge.fml.common.ModContainer;
|
||||
//$$ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
//$$ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
//$$ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
//#endif
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
//#if MC>=10800
|
||||
//$$ import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
//#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 java.util.ArrayDeque;
|
||||
//#endif
|
||||
//#endif
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
@@ -198,7 +190,7 @@ public class ReplayMod implements Module {
|
||||
|
||||
public File getReplayFolder() throws IOException {
|
||||
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);
|
||||
return folder;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,8 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiScreenRealmsProxy;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=11300
|
||||
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 org.lwjgl.opengl.GL11;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
@@ -37,13 +28,13 @@ public class MainMenuHandler {
|
||||
int realmsOffset = 0;
|
||||
for (GuiButton button : getButtonList(event)) {
|
||||
// Buttons that aren't in a rectangle directly above our space don't need moving
|
||||
if (x(button) + button.width < gui.width / 2 - 100
|
||||
|| x(button) > gui.width / 2 + 100
|
||||
|| y(button) > gui.height / 4 + 10 + 4 * 24) continue;
|
||||
if (button.x + button.width < gui.width / 2 - 100
|
||||
|| button.x > gui.width / 2 + 100
|
||||
|| button.y > gui.height / 4 + 10 + 4 * 24) continue;
|
||||
// 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
|
||||
int offset = -1 * 24 + 10;
|
||||
y(button, y(button) + offset);
|
||||
button.y += offset;
|
||||
|
||||
//#if MC>=11300
|
||||
if (button.id == 14) {
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.getConnection;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.Minecraft;
|
||||
//$$ import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
@@ -69,7 +68,6 @@ import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.Minecraft_mcDataDir;
|
||||
import static com.replaymod.core.versions.MCVer.getMinecraft;
|
||||
|
||||
public class Utils {
|
||||
@@ -190,7 +188,7 @@ public class Utils {
|
||||
|
||||
public static ResourceLocation getResourceLocationForPlayerUUID(UUID uuid) {
|
||||
//#if MC>=10800
|
||||
NetworkPlayerInfo info = getConnection(getMinecraft()).getPlayerInfo(uuid);
|
||||
NetworkPlayerInfo info = getMinecraft().getConnection().getPlayerInfo(uuid);
|
||||
ResourceLocation skinLocation;
|
||||
if (info != null && info.hasLocationSkin()) {
|
||||
skinLocation = info.getLocationSkin();
|
||||
@@ -239,7 +237,7 @@ public class Utils {
|
||||
// Try to save the crash report
|
||||
if (crashReport.getFile() == null) {
|
||||
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");
|
||||
logger.debug("Saving crash report to file: {}", file);
|
||||
crashReport.saveToFile(file);
|
||||
|
||||
@@ -2,94 +2,59 @@ package com.replaymod.core.versions;
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
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.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.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.settings.KeyBinding;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
|
||||
//#if MC>=11300
|
||||
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.crash.ReportedException;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
//#else
|
||||
//$$ 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.util.ReportedException;
|
||||
//$$ import org.apache.logging.log4j.LogManager;
|
||||
//$$ import org.lwjgl.Sys;
|
||||
//$$ import java.awt.Desktop;
|
||||
//$$ import java.io.IOException;
|
||||
//#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
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.GlStateManager.BooleanState;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.world.WorldType;
|
||||
//#if MC>=11300
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
//#else
|
||||
//$$ import net.minecraftforge.fml.common.eventhandler.EventBus;
|
||||
//#endif
|
||||
//#else
|
||||
//$$ import com.google.common.util.concurrent.Futures;
|
||||
//$$ import com.replaymod.render.hooks.GLStateTracker;
|
||||
//$$ import com.replaymod.render.hooks.GLStateTracker.BooleanState;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.EventBus;
|
||||
//$$ import io.netty.handler.codec.DecoderException;
|
||||
//$$ import net.minecraft.client.resources.FileResourcePack;
|
||||
//$$
|
||||
@@ -97,7 +62,6 @@ import net.minecraftforge.eventbus.api.IEventBus;
|
||||
//#endif
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -106,17 +70,12 @@ import java.util.concurrent.Callable;
|
||||
* Abstraction over things that have changed between different MC versions.
|
||||
*/
|
||||
public class MCVer {
|
||||
//#if MC>=11300
|
||||
public static IEventBus FORGE_BUS = MinecraftForge.EVENT_BUS;
|
||||
//#if MC>=10809
|
||||
public static IEventBus FML_BUS = FORGE_BUS;
|
||||
//#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();
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
public static void addDetail(CrashReportCategory category, String name, Callable<String> callable) {
|
||||
//#if MC>=10904
|
||||
@@ -171,30 +130,6 @@ public class MCVer {
|
||||
//#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) {
|
||||
//#if MC>=10904
|
||||
return event.getEntity();
|
||||
@@ -203,14 +138,6 @@ public class MCVer {
|
||||
//#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) {
|
||||
//#if MC>=11102
|
||||
return buffer.readString(max);
|
||||
@@ -227,30 +154,6 @@ public class MCVer {
|
||||
//#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) {
|
||||
//#if MC>=10904
|
||||
return event.getType();
|
||||
@@ -268,14 +171,6 @@ public class MCVer {
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
public static File mcDataDir(Minecraft mc) {
|
||||
//#if MC>=11300
|
||||
return mc.gameDir;
|
||||
//#else
|
||||
//$$ return mc.mcDataDir;
|
||||
//#endif
|
||||
}
|
||||
|
||||
//#if MC>=10800
|
||||
public static Entity getRenderViewEntity(Minecraft mc) {
|
||||
return mc.getRenderViewEntity();
|
||||
@@ -303,38 +198,6 @@ public class MCVer {
|
||||
//$$ = TextureMap.locationBlocksTexture;
|
||||
//#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) {
|
||||
//#if MC>=10904
|
||||
return ridden.getRidingEntity();
|
||||
@@ -423,22 +286,6 @@ public class MCVer {
|
||||
//#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
|
||||
public static MainWindow newScaledResolution(Minecraft mc) {
|
||||
@@ -478,56 +325,33 @@ public class MCVer {
|
||||
//#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) {
|
||||
//#if MC>=10904
|
||||
//#if MC>=10800
|
||||
Tessellator.getInstance().getBuffer().setTranslation(x, y, z);
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ Tessellator.getInstance().getWorldRenderer().setTranslation(x, y, z);
|
||||
//#else
|
||||
//$$ Tessellator.instance.setTranslation(x, y, z);
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
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
|
||||
//$$ 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
|
||||
//$$ Tessellator.instance.startDrawing(mode);
|
||||
//#endif
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
public static void BufferBuilder_addPosCol(double x, double y, double z, int r, int g, int b, int a) {
|
||||
//#if MC>=10904
|
||||
//#if MC>=11200
|
||||
//#if MC>=10800
|
||||
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
||||
//#else
|
||||
//$$ VertexBuffer worldRenderer = Tessellator.getInstance().getBuffer();
|
||||
//#endif
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
|
||||
//#else
|
||||
//$$ Tessellator worldRenderer = Tessellator.instance;
|
||||
//#endif
|
||||
//#endif
|
||||
//#if MC>=10809
|
||||
worldRenderer.pos(x, y, z).color(r, g, b, a).endVertex();
|
||||
//#else
|
||||
@@ -537,35 +361,24 @@ public class MCVer {
|
||||
}
|
||||
|
||||
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
|
||||
//$$ 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
|
||||
//$$ Tessellator.instance.startDrawing(mode);
|
||||
//#endif
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
public static void BufferBuilder_addPosTex(double x, double y, double z, double u, double v) {
|
||||
//#if MC>=10904
|
||||
//#if MC>=11200
|
||||
//#if MC>=10800
|
||||
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
||||
//#else
|
||||
//$$ VertexBuffer worldRenderer = Tessellator.getInstance().getBuffer();
|
||||
//#endif
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
|
||||
//#else
|
||||
//$$ Tessellator worldRenderer = Tessellator.instance;
|
||||
//#endif
|
||||
//#endif
|
||||
//#if MC>=10809
|
||||
worldRenderer.pos(x, y, z).tex(u, v).endVertex();
|
||||
//#else
|
||||
@@ -574,35 +387,24 @@ public class MCVer {
|
||||
}
|
||||
|
||||
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
|
||||
//$$ 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
|
||||
//$$ Tessellator.instance.startDrawing(mode);
|
||||
//#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) {
|
||||
//#if MC>=10904
|
||||
//#if MC>=11200
|
||||
//#if MC>=10800
|
||||
BufferBuilder worldRenderer = Tessellator.getInstance().getBuffer();
|
||||
//#else
|
||||
//$$ VertexBuffer worldRenderer = Tessellator.getInstance().getBuffer();
|
||||
//#endif
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
|
||||
//#else
|
||||
//$$ Tessellator worldRenderer = Tessellator.instance;
|
||||
//#endif
|
||||
//#endif
|
||||
//#if MC>=10809
|
||||
worldRenderer.pos(x, y, z).tex(u, v).color(r, g, b, a).endVertex();
|
||||
//#else
|
||||
@@ -612,22 +414,6 @@ public class MCVer {
|
||||
}
|
||||
|
||||
//#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")
|
||||
public static List<VertexFormatElement> getElements(VertexFormat vertexFormat) {
|
||||
return vertexFormat.getElements();
|
||||
@@ -651,11 +437,7 @@ public class MCVer {
|
||||
}
|
||||
|
||||
public static Minecraft getMinecraft() {
|
||||
//#if MC>=11300
|
||||
return Minecraft.getInstance();
|
||||
//#else
|
||||
//$$ return Minecraft.getMinecraft();
|
||||
//#endif
|
||||
}
|
||||
|
||||
public static long milliTime() {
|
||||
@@ -666,22 +448,6 @@ public class MCVer {
|
||||
//#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) {
|
||||
//#if MC>=11300
|
||||
getMinecraft().getTextureManager().bindTexture(texture);
|
||||
@@ -698,34 +464,6 @@ public class MCVer {
|
||||
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) {
|
||||
//#if MC>=11300
|
||||
Util.getOSType().openFile(file);
|
||||
|
||||
Reference in New Issue
Block a user