aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-28 20:17:13 +0900
committersyeyoung <cyong06@naver.com>2021-02-28 20:17:13 +0900
commitcf903cf649f7983f6b8c3b9be687c607335c25ba (patch)
tree8c4c45eea6910b02d4f518dfbf6b7a0755fc201b /src/main/java/kr/syeyoung/dungeonsguide/features/impl
parentd2404f10a849ea9e847b3e295ae4f66b679ecc4c (diff)
downloadSkyblock-Dungeons-Guide-cf903cf649f7983f6b8c3b9be687c607335c25ba.tar.gz
Skyblock-Dungeons-Guide-cf903cf649f7983f6b8c3b9be687c607335c25ba.tar.bz2
Skyblock-Dungeons-Guide-cf903cf649f7983f6b8c3b9be687c607335c25ba.zip
breh
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java53
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java63
2 files changed, 112 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java
index 14d62437..490f4c18 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java
@@ -12,10 +12,16 @@ import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener;
import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
+import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityBat;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraftforge.client.event.RenderPlayerEvent;
import org.jetbrains.annotations.Nullable;
@@ -36,29 +42,68 @@ public class FeaturePlayerESP extends SimpleFeature implements PlayerRenderListe
private boolean preCalled = false;
@Override
public void onEntityRenderPre(RenderPlayerEvent.Pre renderPlayerEvent) {
+
+
if (preCalled) return;
if (!isEnabled()) return;
+
DungeonContext dungeonContext = skyblockStatus.getContext();
if (dungeonContext == null) return;
if (!dungeonContext.getPlayers().contains(renderPlayerEvent.entityPlayer.getName())) {
return;
}
+ preCalled = true;
+ GL11.glEnable(GL11.GL_STENCIL_TEST);
+ GL11.glClearStencil(0);
+ GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
+
+ GL11.glStencilMask(0xFF);
+ GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xFF);
+ GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_REPLACE, GL11.GL_REPLACE);
+
+ EntityPlayer entity = renderPlayerEvent.entityPlayer;
+ InventoryPlayer inv = entity.inventory;
+ ItemStack[] armor = inv.armorInventory;
+ inv.armorInventory = new ItemStack[4];
+ ItemStack[] hand = inv.mainInventory;
+ inv.mainInventory = new ItemStack[36];
- preCalled = true;
- GlStateManager.depthFunc(GL11.GL_GEQUAL);
- Entity entity = renderPlayerEvent.entityPlayer;
float f = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * renderPlayerEvent.partialRenderTick;
try {
renderPlayerEvent.renderer.doRender((AbstractClientPlayer) renderPlayerEvent.entityPlayer, renderPlayerEvent.x, renderPlayerEvent.y, renderPlayerEvent.z, f, renderPlayerEvent.partialRenderTick);
} catch (Throwable t) {}
+
+ GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
+ GL11.glStencilFunc(GL11.GL_NOTEQUAL, 1, 0xff);
+ GL11.glDepthMask(false);
+ GL11.glDepthFunc(GL11.GL_GEQUAL);
+
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(renderPlayerEvent.x, renderPlayerEvent.y + 0.9, renderPlayerEvent.z);
+ GlStateManager.scale(1.2f, 1.1f, 1.2f);
+ renderPlayerEvent.renderer.setRenderOutlines(true);
+ try {
+ renderPlayerEvent.renderer.doRender((AbstractClientPlayer) renderPlayerEvent.entityPlayer, 0,-0.9,0, f, renderPlayerEvent.partialRenderTick);
+ } catch (Throwable t) {}
+
+ renderPlayerEvent.renderer.setRenderOutlines(false);
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ GlStateManager.popMatrix();
+
+ GL11.glDisable(GL11.GL_STENCIL_TEST); // Turn this shit off!
+
+ inv.armorInventory = armor;
+ inv.mainInventory = hand;
+
preCalled = false;
- GlStateManager.depthFunc(GL11.GL_LEQUAL);
+
}
@Override
public void onEntityRenderPost(RenderPlayerEvent.Post renderPlayerEvent) {
}
+
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java
new file mode 100644
index 00000000..081beb19
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureAutoAcceptReparty.java
@@ -0,0 +1,63 @@
+package kr.syeyoung.dungeonsguide.features.impl.etc;
+
+import kr.syeyoung.dungeonsguide.SkyblockStatus;
+import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.features.FeatureParameter;
+import kr.syeyoung.dungeonsguide.features.GuiFeature;
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+import kr.syeyoung.dungeonsguide.features.listener.ChatListener;
+import kr.syeyoung.dungeonsguide.features.listener.DungeonQuitListener;
+import kr.syeyoung.dungeonsguide.features.listener.GuiOpenListener;
+import kr.syeyoung.dungeonsguide.utils.TextUtils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiChest;
+import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.inventory.ContainerChest;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+import net.minecraftforge.client.event.GuiOpenEvent;
+
+import java.awt.*;
+
+public class FeatureAutoAcceptReparty extends SimpleFeature implements ChatListener {
+ public FeatureAutoAcceptReparty() {
+ super("ETC", "Auto accept reparty", "Automatically accept reparty", "qol.autoacceptreparty", true);
+ }
+
+ SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+
+ private String lastDisband;
+ @Override
+ public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) {
+ if (clientChatReceivedEvent.message.getFormattedText().endsWith("§ehas disbanded the party!§r")) {
+ lastDisband = null;
+ String[] texts = TextUtils.stripColor(clientChatReceivedEvent.message.getFormattedText()).split(" ");
+ for (String s : texts) {
+ if (s.isEmpty()) continue;
+ if (s.startsWith("[")) continue;
+ if (s.equalsIgnoreCase("has")) break;
+ lastDisband = s;
+ break;
+ }
+ System.out.println(lastDisband);
+ } else if (clientChatReceivedEvent.message.getFormattedText().contains("§ehas invited you to join their party!")) {
+ String[] texts = TextUtils.stripColor(clientChatReceivedEvent.message.getFormattedText()).split(" ");
+ boolean equals = false;
+ for (String s : texts) {
+ System.out.println(s);
+ if (s.isEmpty()) continue;
+ if (s.startsWith("[")) continue;
+ if (s.equalsIgnoreCase("has")) continue;
+ if (s.equalsIgnoreCase(lastDisband)) {
+ equals = true;
+ break;
+ }
+ }
+ System.out.println(lastDisband + " - "+equals);
+
+ if (equals) {
+ Minecraft.getMinecraft().thePlayer.sendChatMessage("/p join "+lastDisband);
+ }
+ }
+ }
+}