diff options
Diffstat (limited to 'src/main/java')
21 files changed, 546 insertions, 95 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 7fa81a59..c3cb4a73 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -270,7 +270,6 @@ public class NEUEventListener { FairySouls.tick(); XPInformation.getInstance().tick(); ProfileApiSyncer.getInstance().tick(); - DamageCommas.tick(); ItemCustomizeManager.tick(); BackgroundBlur.markDirty(); NPCRetexturing.getInstance().tick(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 4f2e8a93..cfab28e0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -1052,7 +1052,7 @@ public class NotEnoughUpdates { } }); - SimpleCommand customizeCommand = new SimpleCommand("neucustomize", new SimpleCommand.ProcessCommandRunnable() { + SimpleCommand.ProcessCommandRunnable customizeRunnable = new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem(); @@ -1070,7 +1070,10 @@ public class NotEnoughUpdates { openGui = new GuiItemCustomize(held, heldUUID); } - }); + }; + + SimpleCommand customizeCommand = new SimpleCommand("neucustomize", customizeRunnable); + SimpleCommand customizeCommand2 = new SimpleCommand("neurename", customizeRunnable); SimpleCommand.ProcessCommandRunnable settingsRunnable = new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { @@ -1195,6 +1198,7 @@ public class NotEnoughUpdates { ClientCommandHandler.instance.registerCommand(dhCommand); ClientCommandHandler.instance.registerCommand(dnCommand); ClientCommandHandler.instance.registerCommand(customizeCommand); + ClientCommandHandler.instance.registerCommand(customizeCommand2); ClientCommandHandler.instance.registerCommand(devTestCommand); ClientCommandHandler.instance.registerCommand(packDevCommand); if(!Loader.isModLoaded("skyblockextras")) ClientCommandHandler.instance.registerCommand(viewCataCommand); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index 560cdf51..1ebf9937 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -14,6 +14,7 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.shader.Framebuffer; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.RenderWorldEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; @@ -49,17 +50,84 @@ public class CapeManager { public JsonObject lastJsonSync = null; - private String[] capes = new String[]{"patreon1", "patreon2", "fade", "contrib", "nullzee", + public static class CapeData { + public String capeName; + public boolean special; + public boolean hidden; + + public boolean canShow() { + return !special && !hidden; + } + + public CapeData(String capeName, boolean special, boolean hidden) { + this.capeName = capeName; + this.special = special; + this.hidden = hidden; + } + } + + public CapeData[] capes = new CapeData[]{ + //Content Creator + new CapeData("jakethybro", false, true), + new CapeData("krusty", false, true), + new CapeData("krusty_day", false, true), + new CapeData("krusty_sunset", false, true), + new CapeData("krusty_night", false, true), + new CapeData("zera", false, true), + new CapeData("soldier", false, true), + new CapeData("alexxoffi", false, false), + + //Patreon + new CapeData("patreon1", false, false), + new CapeData("patreon2", false, false), + new CapeData("fade", false, false), + new CapeData("space", false, false), + new CapeData("mcworld", false, false), + new CapeData("negative", false, false), + new CapeData("void", false, false), + new CapeData("lava", false, false), + new CapeData("tunnel", false, false), + new CapeData("planets", false, false), + + //Admins + new CapeData("nullzee", true, false), + new CapeData("ironmoon", true, false), + new CapeData("gravy", true, false), + + //Partner + new CapeData("thebakery", true, false), + new CapeData("furf", true, false), + new CapeData("dsm", true, false), + new CapeData("skyclient", true, false), + new CapeData("subreddit_dark", true, false), + new CapeData("subreddit_light", true, false), + new CapeData("packshq", true, false), + new CapeData("skytils", true, false), + + //Special Other + new CapeData("contrib", true, false), + new CapeData("mbstaff", true, false) + }; + + /*private String[] capes = new String[]{"patreon1", "patreon2", "fade", "contrib", "nullzee", "gravy", "space", "mcworld", "lava", "packshq", "mbstaff", "thebakery", "negative", "void", "ironmoon", "krusty", "furf", "soldier", "dsm", "zera", "tunnel", "alexxoffi", "parallax", "jakethybro", "planets", "skytils" }; - public Boolean[] specialCapes = new Boolean[]{ true, true, false, true, true, + public Boolean[] specialCapes = new Boolean[] {true, true, false, true, true, true, false, false, false, true, true, true, false, - false, true, false, true, true, true, true, false, true, true, true, true, true }; + false, true, false, true, true, true, true, false, true, true, true, true, true };*/ public static CapeManager getInstance() { return INSTANCE; } + public void tryUnlockCape(String unlock) { + for(CapeData data : capes) { + if(data.capeName.equalsIgnoreCase(unlock)) { + data.hidden = false; + } + } + } + public void tick() { long currentTime = System.currentTimeMillis(); if(currentTime - lastCapeUpdate > 60*1000) { @@ -227,7 +295,7 @@ public class CapeManager { } if(uuid.equals(clientUuid) && localCape != null && localCape.getRight() != null && !localCape.getRight().equals("null")) { localCape.getLeft().onRenderPlayer(e); - } else if(capeMap.containsKey(uuid)) { + } else if(!Minecraft.getMinecraft().thePlayer.isPotionActive(Potion.blindness) && capeMap.containsKey(uuid)) { capeMap.get(uuid).getLeft().onRenderPlayer(e); } } catch(Exception ignored) {} @@ -301,7 +369,7 @@ public class CapeManager { } } - public String[] getCapes() { + public CapeData[] getCapes() { return capes; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java index 164dfeb8..31eaccb1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java @@ -1,6 +1,7 @@ package io.github.moulberry.notenoughupdates.cosmetics; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.GuiElementTextField; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; @@ -12,10 +13,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.Matrix4f; import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; import java.awt.*; +import java.io.IOException; import java.math.BigInteger; import java.util.List; import java.util.*; @@ -27,6 +30,8 @@ public class GuiCosmetics extends GuiScreen { public static final ResourceLocation cosmetics_fg = new ResourceLocation("notenoughupdates:cosmetics_fg.png"); public static final ResourceLocation pv_elements = new ResourceLocation("notenoughupdates:pv_elements.png"); + private GuiElementTextField unlockTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT); + private CosmeticsPage currentPage = CosmeticsPage.CAPES; private int sizeX; private int sizeY; @@ -134,6 +139,15 @@ public class GuiCosmetics extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth(equipMsg, Minecraft.getMinecraft().fontRendererObj, guiLeft+sizeX/2f, guiTop+sizeY+5+10, false, 90, 0); } + + if(unlockTextField.getFocus() || !unlockTextField.getText().isEmpty()) { + unlockTextField.setPrependText(""); + } else { + unlockTextField.setPrependText("\u00a77Creator Code"); + } + + unlockTextField.setSize(80, 20); + unlockTextField.render(guiLeft+sizeX-80, guiTop+sizeY+2); } private void renderTabs(boolean renderPressed) { @@ -193,7 +207,29 @@ public class GuiCosmetics extends GuiScreen { } @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + if(unlockTextField.getFocus()) { + if(keyCode == Keyboard.KEY_ESCAPE || keyCode == Keyboard.KEY_RETURN) { + CapeManager.INSTANCE.tryUnlockCape(unlockTextField.getText().trim()); + unlockTextField.setText(""); + unlockTextField.setFocus(false); + } else { + unlockTextField.keyTyped(typedChar, keyCode); + } + } else { + super.keyTyped(typedChar, keyCode); + } + } + + @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + //guiLeft+sizeX-140, guiTop+sizeY+2 + + if(mouseX > guiLeft+sizeX-140 & mouseX < guiLeft+sizeX && + mouseY > guiTop+sizeY && mouseY < guiTop+sizeY+22) { + unlockTextField.mouseClicked(mouseX, mouseY, mouseButton); + } + for (int i = 0; i < CosmeticsPage.values().length; i++) { CosmeticsPage page = CosmeticsPage.values()[i]; int x = guiLeft + i * 28; @@ -216,9 +252,9 @@ public class GuiCosmetics extends GuiScreen { int index = 0; int displayingCapes = 0; - for(String cape : CapeManager.INSTANCE.getCapes()) { - boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(cape); - if (!CapeManager.INSTANCE.specialCapes[index++] || equipable) { + for(CapeManager.CapeData cape : CapeManager.INSTANCE.getCapes()) { + boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(cape.capeName); + if (cape.canShow() || equipable) { displayingCapes++; } } @@ -229,9 +265,9 @@ public class GuiCosmetics extends GuiScreen { index = 0; int displayIndex = 0; - for(String cape : CapeManager.INSTANCE.getCapes()) { - boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(cape); - if(CapeManager.INSTANCE.specialCapes[index++] && !equipable) continue; + for(CapeManager.CapeData cape : CapeManager.INSTANCE.getCapes()) { + boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(cape.capeName); + if(!cape.canShow() && !equipable) continue; GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect(guiLeft + 20 + 91 * displayIndex - xOffset, guiTop + 123, 81, 20, @@ -239,20 +275,20 @@ public class GuiCosmetics extends GuiScreen { if(mouseX > guiLeft + 20 + 91 * displayIndex - xOffset && mouseX < guiLeft + 20 + 91 * displayIndex - xOffset+81) { if(mouseY > guiTop + 123 && mouseY < guiTop + 123 + 20) { - if(CapeManager.INSTANCE.localCape != null && CapeManager.INSTANCE.localCape.getRight().equals(cape)) { + if(CapeManager.INSTANCE.localCape != null && CapeManager.INSTANCE.localCape.getRight().equals(cape.capeName)) { CapeManager.INSTANCE.setCape(Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""), "null", true); } else { CapeManager.INSTANCE.setCape(Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""), - cape, true); + cape.capeName, true); } return; } else if(equipable && mouseY > guiTop + 149 && mouseY < guiTop + 149 + 20) { - if(cape.equals(wantToEquipCape)) { + if(cape.capeName.equals(wantToEquipCape)) { wantToEquipCape = null; } else { - wantToEquipCape = cape; + wantToEquipCape = cape.capeName; } return; } @@ -342,9 +378,9 @@ public class GuiCosmetics extends GuiScreen { int index = 0; int displayingCapes = 0; - for(String cape : CapeManager.INSTANCE.getCapes()) { - boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(cape); - if (!CapeManager.INSTANCE.specialCapes[index++] || equipable) { + for(CapeManager.CapeData capeData : CapeManager.INSTANCE.getCapes()) { + boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(capeData.capeName); + if (capeData.canShow() || equipable) { displayingCapes++; } } @@ -355,21 +391,21 @@ public class GuiCosmetics extends GuiScreen { index = 0; int displayIndex = 0; - for(String cape : CapeManager.INSTANCE.getCapes()) { - boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(cape); - if(CapeManager.INSTANCE.specialCapes[index++] && !equipable) continue; + for(CapeManager.CapeData capeData : CapeManager.INSTANCE.getCapes()) { + boolean equipable = CapeManager.INSTANCE.getAvailableCapes() == null || CapeManager.INSTANCE.getAvailableCapes().contains(capeData.capeName); + if(!capeData.canShow() && !equipable) continue; - if(cape.equals(CapeManager.INSTANCE.getCape(Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "")))) { + if(capeData.capeName.equals(CapeManager.INSTANCE.getCape(Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "")))) { GlStateManager.color(250 / 255f, 200 / 255f, 0 / 255f, 1); Utils.drawGradientRect(guiLeft + 20 + 91 * displayIndex - (int) xOffset, guiTop + 10, guiLeft + 20 + 91 * displayIndex - (int) xOffset + 81, guiTop + 10 + 108, new Color(150, 100, 0, 40).getRGB(), new Color(250, 200, 0, 40).getRGB()); - } else if(cape.equals(wantToEquipCape)) { + } else if(capeData.capeName.equals(wantToEquipCape)) { GlStateManager.color(0, 200 / 255f, 250 / 255f, 1); Utils.drawGradientRect(guiLeft + 20 + 91 * displayIndex - (int) xOffset, guiTop + 10, guiLeft + 20 + 91 * displayIndex - (int) xOffset + 81, guiTop + 10 + 108, new Color(0, 100, 150, 40).getRGB(), new Color(0, 200, 250, 40).getRGB()); - } else if(CapeManager.INSTANCE.localCape != null && CapeManager.INSTANCE.localCape.getRight().equals(cape)) { + } else if(CapeManager.INSTANCE.localCape != null && CapeManager.INSTANCE.localCape.getRight().equals(capeData.capeName)) { GlStateManager.color(100/255f, 250/255f, 150/255f, 1); Utils.drawGradientRect(guiLeft+20+91*displayIndex-(int)xOffset, guiTop+10, guiLeft+20+91*displayIndex-(int)xOffset+81, guiTop+10+108, @@ -383,7 +419,7 @@ public class GuiCosmetics extends GuiScreen { Utils.drawTexturedRect(guiLeft+20+91*displayIndex-xOffset, guiTop+123, 81, 20, 0, 81/256f, 216/256f, 236/256f, GL11.GL_NEAREST); - boolean equipPressed = cape.equals(wantToEquipCape); + boolean equipPressed = capeData.capeName.equals(wantToEquipCape); if(!equipable) GlStateManager.color(1, 1, 1, 0.5f); Utils.drawTexturedRect(guiLeft+20+91*displayIndex-xOffset, guiTop+149, 81, 20, equipPressed?81/256f:0, equipPressed?0:81/256f, equipPressed?236/256f:216/256f, equipPressed?216/256f:236/256f, GL11.GL_NEAREST); @@ -399,8 +435,8 @@ public class GuiCosmetics extends GuiScreen { } GlStateManager.color(1, 1, 1, 1); - ResourceLocation capeTexture = capesLocation.computeIfAbsent(cape, - k -> new ResourceLocation("notenoughupdates", "capes/"+cape+"_preview.png")); + ResourceLocation capeTexture = capesLocation.computeIfAbsent(capeData.capeName, + k -> new ResourceLocation("notenoughupdates", "capes/"+capeData.capeName+"_preview.png")); Minecraft.getMinecraft().getTextureManager().bindTexture(capeTexture); Utils.drawTexturedRect(guiLeft+31+91*displayIndex-xOffset, guiTop+24, 59, 84, GL11.GL_NEAREST); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java index 163b14dd..c1d36e8f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/NEUCape.java @@ -87,7 +87,7 @@ public class NEUCape { shaderName = "fade_cape"; } else if(capeName.equalsIgnoreCase("space")) { shaderName = "space_cape"; - } else if(capeName.equalsIgnoreCase("mcworld")) { + } else if(capeName.equalsIgnoreCase("mcworld") || capeName.equalsIgnoreCase("skyclient")) { shaderName = "mcworld_cape"; } else if(capeName.equalsIgnoreCase("lava")) { shaderName = "lava_cape"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java index 48601df3..0aa5e84d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java @@ -51,9 +51,10 @@ public class BetterContainers { private static long clickedSlotMillis = 0; public static long lastRenderMillis = 0; + private static int lastInvHashcode = 0; + private static int lastHashcodeCheck = 0; + public static HashMap<Integer, ItemStack> itemCache = new HashMap<>(); - public static boolean lastUsingCached = false; - public static boolean usingCached = false; public static void clickSlot(int slot) { clickedSlotMillis = System.currentTimeMillis(); @@ -68,22 +69,30 @@ public class BetterContainers { } public static void bindHook(TextureManager textureManager, ResourceLocation location) { + long currentMillis = System.currentTimeMillis(); + if(isChestOpen() && NEUEventListener.inventoryLoaded) { - if((texture != null && lastClickedSlot != getClickedSlot()) || - lastUsingCached != getUsingCache() || !loaded) { - lastUsingCached = getUsingCache(); + int invHashcode = lastInvHashcode; + + if(currentMillis - lastHashcodeCheck > 50) { + Container container = ((GuiChest)Minecraft.getMinecraft().currentScreen).inventorySlots; + invHashcode = container.getInventory().hashCode(); + } + + if((texture != null && lastClickedSlot != getClickedSlot()) || !loaded || lastInvHashcode != invHashcode) { + lastInvHashcode = invHashcode; lastClickedSlot = getClickedSlot(); generateTex(location); } if(texture != null && loaded) { - lastRenderMillis = System.currentTimeMillis(); + lastRenderMillis = currentMillis; GlStateManager.color(1, 1, 1, 1); textureManager.loadTexture(rl, texture); textureManager.bindTexture(rl); return; } - } else if(System.currentTimeMillis() - lastRenderMillis < 200 && texture != null) { + } else if(currentMillis - lastRenderMillis < 200 && texture != null) { GlStateManager.color(1, 1, 1, 1); textureManager.loadTexture(rl, texture); textureManager.bindTexture(rl); @@ -94,7 +103,7 @@ public class BetterContainers { } public static boolean getUsingCache() { - return usingCached && System.currentTimeMillis() - lastRenderMillis < 300; + return false; } public static boolean isBlacklistedInventory() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java index e953ba60..f3a33aa9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java @@ -126,8 +126,6 @@ public class CrystalOverlay { public static HashMap<CrystalType, BlockPos> crystals = new HashMap<>(); - private static ExecutorService es = Executors.newSingleThreadExecutor(); - public static void tick() { if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableCrystalOverlay) return; if(Minecraft.getMinecraft().theWorld == null) return; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index ba96777f..83ad8a0d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -13,6 +13,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.texture.TextureUtil; @@ -30,6 +31,7 @@ import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.*; +import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -65,6 +67,10 @@ public class CustomItemEffects { public int aoteTeleportationMillis = 0; public Vector3f aoteTeleportationCurr = null; + public int tpTime = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis; + + private int tick; + public long lastMillis = 0; public Vector3f getCurrentPosition() { @@ -84,8 +90,8 @@ public class CustomItemEffects { if(delta <= 0) return; - if(aoteTeleportationMillis > NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis*2) { - aoteTeleportationMillis = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis*2; + if(aoteTeleportationMillis > tpTime*2) { + aoteTeleportationMillis = tpTime*2; } if(aoteTeleportationMillis < 0) aoteTeleportationMillis = 0; @@ -148,12 +154,21 @@ public class CustomItemEffects { } } - if(NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis <= 0 - || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0) return; + if(usingEtherwarp) { + lastEtherwarpUse = tick; + } - boolean aote = NotEnoughUpdates.INSTANCE.config.itemOverlays.enableSmoothAOTE && (internal.equals("ASPECT_OF_THE_END") || internal.equals("ASPECT_OF_THE_VOID")); + if(tpTime <= 0 || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0) return; + + boolean aote = NotEnoughUpdates.INSTANCE.config.itemOverlays.enableSmoothAOTE && + (internal.equals("ASPECT_OF_THE_END") || internal.equals("ASPECT_OF_THE_VOID")); boolean hyp = NotEnoughUpdates.INSTANCE.config.itemOverlays.enableSmoothHyperion && shadowWarp; - if(aote || hyp) { + if(usingEtherwarp) { + tpTime = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillisEtherwarp; + } else { + tpTime = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis; + } + if(usingEtherwarp || aote || hyp) { aoteUseMillis = System.currentTimeMillis(); if(aoteTeleportationCurr == null) { aoteTeleportationCurr = new Vector3f(); @@ -170,6 +185,18 @@ public class CustomItemEffects { public void onGameTick(TickEvent.ClientTickEvent event) { if(event.phase != TickEvent.Phase.END) return; + if(!usingEtherwarp && wasUsingEtherwarp) { + if(Minecraft.getMinecraft().thePlayer.rotationYaw > 0) { + Minecraft.getMinecraft().thePlayer.rotationYaw -= 0.000001; + } else { + Minecraft.getMinecraft().thePlayer.rotationYaw += 0.000001; + } + } + wasUsingEtherwarp = usingEtherwarp; + + tick++; + if(tick > Integer.MAX_VALUE/2) tick = 0; + heldBonemerang = false; bonemerangBreak = false; bonemeragedEntities.clear(); @@ -216,18 +243,92 @@ public class CustomItemEffects { } } } - position.translate(step.x, step.y, step.z); } } + } + + private float lastPartialTicks = 0; + private float currentFOVMult = 1; + private float targetFOVMult = 1; + + private float lastPartialDelta = 0; + + private float currentSensMult = 1; + private float targetSensMult = 1; + + public float getSensMultiplier() { + if(targetSensMult < 0) { + currentSensMult = 1; + } else { + float deltaSens = targetSensMult - currentSensMult; + + currentSensMult += deltaSens*lastPartialDelta*0.1;// (0.05 * ); + if(currentSensMult < 0.25f) currentSensMult = 0.25f; + if(currentSensMult > 1) currentSensMult = 1; + } + return currentSensMult; + } + + public float getFovMultiplier(float partialTicks) { + float partialDelta = partialTicks+tick - lastPartialTicks; + if(partialDelta < 0) partialDelta++; + if(partialDelta > 0) lastPartialDelta = partialDelta; + if(targetFOVMult < 0) { + currentFOVMult = 1; + } else { + float deltaFOV = targetFO |
