aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-01 21:25:13 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-01 21:25:13 +0800
commitc71b4f83abb2697781f8e6eafa8ad35f924fbdf7 (patch)
tree7e992f047e1b19864cea8cee1671573a44cf20de /features
parent556eedeb7d58909cb716abe16d2c40910acdc43c (diff)
downloadSoopyV2-c71b4f83abb2697781f8e6eafa8ad35f924fbdf7.tar.gz
SoopyV2-c71b4f83abb2697781f8e6eafa8ad35f924fbdf7.tar.bz2
SoopyV2-c71b4f83abb2697781f8e6eafa8ad35f924fbdf7.zip
many changes (will list in a bit)
Diffstat (limited to 'features')
-rw-r--r--features/betterGuis/index.js1
-rw-r--r--features/betterGuis/museumGui.js4
-rw-r--r--features/cosmetics/index.js8
-rw-r--r--features/dungeonMap/index.js302
-rw-r--r--features/dungeonSolvers/index.js11
-rw-r--r--features/events/index.js22
-rw-r--r--features/friendsGUI/index.js8
-rw-r--r--features/hud/index.js2
-rw-r--r--features/improvements/index.js7
-rw-r--r--features/performance/hiddenRequirement.js7
-rw-r--r--features/performance/index.js127
-rw-r--r--features/performance/metadata.json8
-rw-r--r--features/settings/index.js2
-rw-r--r--features/spamHider/index.js13
-rw-r--r--features/streamsGUI/index.js7
15 files changed, 445 insertions, 84 deletions
diff --git a/features/betterGuis/index.js b/features/betterGuis/index.js
index 1f76310..c931e50 100644
--- a/features/betterGuis/index.js
+++ b/features/betterGuis/index.js
@@ -149,6 +149,7 @@ class BetterGuis extends Feature {
}
guiSlotClicked(inventoryName, slotId){
+ if(inventoryName.endsWith(" Sack")) return false
switch(inventoryName){
case "SkyBlock Menu":
switch(slotId){
diff --git a/features/betterGuis/museumGui.js b/features/betterGuis/museumGui.js
index d2756da..7015e5f 100644
--- a/features/betterGuis/museumGui.js
+++ b/features/betterGuis/museumGui.js
@@ -899,8 +899,6 @@ class MuseumGui {
}
if(this.dontOpen > 0){
this.dontOpen--
- cancel(event)
- return
}
if(this.soopyGui.ctGui.isOpen()){
if(event.gui && event.gui.field_147002_h){
@@ -966,7 +964,7 @@ class MuseumGui {
keyPress(key, keyId){
if(keyId === 1){ //escape key
this.isInMuseum = false
- this.dontOpen = 3
+ // this.dontOpen = 1
Client.currentGui.close()
}
}
diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js
index eeee12e..c5ff21e 100644
--- a/features/cosmetics/index.js
+++ b/features/cosmetics/index.js
@@ -48,9 +48,9 @@ class Cosmetics extends Feature {
this.registerEvent("playerLeft", this.playerLeft)
this.registerEvent("worldLoad", this.worldLoad)
this.registerStep(false, 2, this.step)
- this.registerStep(false, 60*10, ()=>{
- new Thread(()=>{this.loadCosmeticsData.call(this)}).start()
- })
+ // this.registerStep(false, 60*10, ()=>{
+ // new Thread(()=>{this.loadCosmeticsData.call(this)}).start()
+ // })
// this.registerEvent("renderEntity", this.renderEntity)
this.loadedRenderEntity = false
@@ -90,7 +90,7 @@ class Cosmetics extends Feature {
this.cosmeticsData = data
this.playerHasACosmeticA = !!data[Player.getUUID().toString().replace(/-/g,"")]
if(this.playerHasACosmeticA && !this.loadedRenderEntity){
- this.registerEvent("renderEntity", this.renderEntity)
+ this.registerEvent("postRenderEntity", this.renderEntity)
this.loadedRenderEntity = true
}
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js
index dadfef2..95369dc 100644
--- a/features/dungeonMap/index.js
+++ b/features/dungeonMap/index.js
@@ -8,6 +8,10 @@ import { f, m } from "../../../mappings/mappings";
import renderLibs from "../../../guimanager/renderLibs";
import ToggleSetting from "../settings/settingThings/toggle";
import { drawBoxAtBlock } from "../../utils/renderUtils";
+import { SoopyGui, SoopyRenderEvent } from "../../../guimanager";
+import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement";
+import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent";
+import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow";
const BufferedImage = Java.type("java.awt.image.BufferedImage")
class DungeonMap extends Feature {
@@ -24,6 +28,7 @@ class DungeonMap extends Feature {
this.renderMap = new ToggleSetting("Render Map", "Toggles Rendering the map on the hud (scuffed)", false, "dmap_render", this)
this.brBox = new ToggleSetting("Box around doors in br", "In map category because it uses map to find location (no esp)", true, "dmap_door", this)
+ this.spiritLeapOverlay = new ToggleSetting("Spirit leap overlay", "Cool overlay for the spirit leap menu", true, "spirit_leap_overlay", this)
this.MAP_QUALITY_SCALE = 2
this.IMAGE_SIZE = 128*this.MAP_QUALITY_SCALE
@@ -32,6 +37,7 @@ class DungeonMap extends Feature {
this.playerImages = {}
this.mapDataPlayers = {}
this.offset = []
+ this.people = []
this.mapScale = 1
this.puzzles = {}
this.puzzlesTab = []
@@ -46,11 +52,17 @@ class DungeonMap extends Feature {
this.mapLocation = [10,10]
this.mapRenderScale = 128/this.IMAGE_SIZE
+ this.spiritLeapOverlayGui = new SpiritLeapOverlay(this)
+
// this.registerEvent("tick", this.tick)
this.registerStep(true, 3, this.step)
this.registerEvent("renderOverlay", this.renderOverlay)
this.registerEvent("renderWorld", this.renderWorld)
this.registerEvent("worldLoad", this.worldLoad)
+
+ this.registerEvent("guiOpened", (event)=>{
+ if(this.spiritLeapOverlay.getValue()) this.spiritLeapOverlayGui.guiOpened.call(this.spiritLeapOverlayGui, event)
+ })
this.running = true
this.registerEvent("gameUnload", ()=>{
@@ -86,7 +98,6 @@ class DungeonMap extends Feature {
this.mapScale = 1
this.puzzles = {}
this.puzzlesTab = []
- this.newPuzzlesTab = []
this.brBoxLoc = undefined
this.mortLocationOnMap = undefined
}
@@ -101,52 +112,58 @@ class DungeonMap extends Feature {
renderOverlay(){
if(this.isInDungeon() && this.renderMap.getValue()){
- if(this.mapImage){
- this.mapImage.draw(...this.mapLocation, this.mapRenderScale*this.IMAGE_SIZE, this.mapRenderScale*this.IMAGE_SIZE)
-
- this.drawOtherMisc()
-
- this.drawPlayersLocations()
- }
+ this.drawMap(...this.mapLocation, this.mapRenderScale*this.IMAGE_SIZE, this.mapRenderScale)
+ }
+ }
+
+ drawMap(x, y, size, scale){
+ if(this.mapImage){
+ this.mapImage.draw(x, y, size, size)
+
+ this.drawOtherMisc(x, y, size, scale)
+
+ this.drawPlayersLocations(x, y, size, scale)
}
}
- drawOtherMisc(){
+ drawOtherMisc(x2, y2, size2, scale){
Object.keys(this.puzzles).forEach(loc=>{
+ if(!this.puzzles[loc]) return
let x = loc%128
let y = Math.floor(loc/128)
let lines = this.puzzles[loc].split(" ")
lines.forEach((l, i)=>{
- renderLibs.drawStringCentered("&0&l" + l, x+this.mapLocation[0]+this.roomWidth/2*this.mapRenderScale*2-l.length/2*this.mapRenderScale*2, y+this.mapLocation[1]+this.roomWidth/3*this.mapRenderScale*2+i*6*this.mapRenderScale*2-((lines.length-1)*3+4)*this.mapRenderScale*2, this.mapRenderScale*2)
+ renderLibs.drawStringCentered("&0&l" + l, x*scale*2+x2+this.roomWidth/2*scale*2-l.length/2*scale*2, y*scale*2+y2+this.roomWidth/3*scale*2+i*6*scale*2-((lines.length-1)*3+4)*scale*2, scale*2)
})
})
}
- drawPlayersLocations(){
+ drawPlayersLocations(x, y, size, scale){
let uuidToPlayer = {}
World.getAllPlayers().forEach(player=>{
+ if(player.getPing()===-1)return
+ if(!this.people.includes(player.getName())) return
uuidToPlayer[player.getUUID().toString()] = player
+ this.mapDataPlayers[player.getUUID().toString()] = {
+ x: player.getX(),
+ y: player.getZ(),
+ rot: player.getYaw()+180,
+ username: player.getName(),
+ uuid: player.getUUID().toString()
+ }
})
Object.keys(this.mapDataPlayers).forEach((uuid)=>{
- let player = uuidToPlayer[uuid]
- if(player){
- this.mapDataPlayers[uuid] = {
- x: player.getX()/this.mapScale,
- y: player.getZ()/this.mapScale,
- rot: player.getYaw()+180
- }
- }
-
- let renderX = this.mapDataPlayers[uuid].x/128*this.mapRenderScale*this.IMAGE_SIZE//*16/this.roomWidth
- let renderY = this.mapDataPlayers[uuid].y/128*this.mapRenderScale*this.IMAGE_SIZE//*16/this.roomWidth
+ let renderX = this.mapDataPlayers[uuid].x/this.mapScale/128*size//*16/this.roomWidth
+ let renderY = this.mapDataPlayers[uuid].y/this.mapScale/128*size//*16/this.roomWidth
- Renderer.translate(renderX+this.mapLocation[0]+this.offset[0]/128*this.mapRenderScale*this.IMAGE_SIZE, renderY+this.mapLocation[1]+this.offset[1]/128*this.mapRenderScale*this.IMAGE_SIZE)
+ Renderer.translate(renderX+x+this.offset[0]/128*size, renderY+y+this.offset[1]/128*size)
+ Renderer.scale(scale*2, scale*2)
Renderer.rotate(this.mapDataPlayers[uuid].rot)
this.getImageForPlayer(uuid).draw(-5,-5, 10, 10)
})
@@ -155,27 +172,51 @@ class DungeonMap extends Feature {
step(){
if(!World.getWorld()) return
// console.log("asjbfoasbgp")
- TabList.getNames().forEach(name=>{
- name = ChatLib.removeFormatting(name).trim().split(" ")
+ this.people = []
+ this.puzzlesTab = []
+ TabList.getNames().forEach(nameo=>{
+
+
+// Party (2) | Soopyboo32 (Mage XXXVI) | Ultimate: Ready | Revive Stones: 1 | | zZzJAKE ♲ (DEAD) | Ultimate: 00m 45s | Revive Stones: 0 | | | | | | | | | | | | | Player Stats | Downed: zZzJAKE | Time: 00m 47s | Revive: 01m 40s | | Deaths: (2) | Damage Dealt: 4.7M❤ | Healing Done: 718❤ | Milestone: ☠❸ | | Discoveries: (0) | Secrets Found: 0 | Crypts: 0 | | | | | | | | Dungeon Stats | Dungeon: Catacombs | Opened Rooms: 13 | Completed Rooms: 12 | Secrets Found: 0% | Time: 01m 51s | | Puzzles: (3) | ???: [✦] | ???: [✦] | ???: [✦] | | | | | | | | | | Account Info | Profile: Pomegranate | Pet Sitter: N/A | Bank: 57M/11M | Interest: 04h 19m 10s | | Skills: Combat 60: MAX | Speed: ✦457 | Strength: ❁859 | Crit Chance: ☣62 | Crit Damage: ☠1479 | Attack Speed: ⚔92 | | Event: Election Over! | Starts In: 2h 39m 10s | | Election: 0d 2h 39m 10s | Aatrox: |||||||||| (79%) | Marina: |||||||||| (7%) | Cole: |||||||||| (6%) | Soopyboo32
+ let line = ChatLib.removeFormatting(nameo).trim().replace("♲ ","") //TODO: Remove bingo symbol
+ if(line.endsWith(")") && line.includes(" (") && line.split(" (").length === 2 && line.split(" (")[0].split(" ").length === 1 && line.split(" (")[1].length>5){
+ this.people.push(line.split(" ")[0])
+ }
+
+ name = ChatLib.removeFormatting(nameo).trim().split(" ")
let end = name.pop()
- if(end !== "[✦]") return
+ // console.log(end) Water Board: [✔]
+ if(end !== "[✦]" && end !== "[✔]") return
name = name.join(" ").trim().replace(":", "")
- if(name.length > 1 && !name.includes("?") && !this.puzzlesTab.includes(name)){
- this.newPuzzlesTab.push(name)
+ if(name.length > 1 && !name.includes("?")){
this.puzzlesTab.push(name)
}
+ // console.log(name)
+ })
+ let puzzlesTab2 = this.puzzlesTab.map(a=>a)
+ // console.log(this.puzzlesTab.length)
+ Object.keys(this.puzzles).forEach(key=>{
+ this.puzzles[key] = puzzlesTab2.shift()
+ // console.log(key, this.puzzles[key], this.puzzlesTab.length)
})
+
+ this.spiritLeapOverlayGui.tick()
}
updateMapImage(){
World.getAllPlayers().forEach(player=>{
+ if(player.getPing()===-1)return
+ if(!this.people.includes(player.getName())) return
this.mapDataPlayers[Player.getUUID().toString()] = {
- x: player.getX()/this.mapScale,
- y: player.getZ()/this.mapScale,
- rot: player.getYaw()+180
+ x: player.getX(),
+ y: player.getZ(),
+ rot: player.getYaw()+180,
+ username: player.getName(),
+ uuid: player.getUUID().toString()
}
})
if(!this.mortLocation){
+ try{
World.getAllEntities().forEach(entity=>{
if(ChatLib.removeFormatting(entity.getName()) === ("Mort")){
this.mortLocation = [
@@ -184,6 +225,7 @@ class DungeonMap extends Feature {
]
}
})
+ }catch(e){}
}
let graphics = this.renderImage.getGraphics()
@@ -198,29 +240,6 @@ class DungeonMap extends Feature {
} catch (error) {
}
if(mapData){
- let deco = mapData[f.mapDecorations]
- deco.forEach((icon, vec4b) => {
- let x = vec4b.func_176112_b()
- let y = vec4b.func_176113_c()
- let rot = vec4b.func_176111_d()
-
- //wtf is this
-
- //vec4b.func_176110_a()
-
- let closestP = undefined
- let closestDistance = Infinity
- Object.keys(this.mapDataPlayers).forEach((uuid)=>{
- if((x-this.mapDataPlayers[uuid].x)**2+(y-this.mapDataPlayers[uuid].y)**2 < closestDistance){
- closestDistance = (x-this.mapDataPlayers[uuid].x)**2+(y-this.mapDataPlayers[uuid].y)**2
- closestP = uuid
- }
- })
-
- this.mapDataPlayers[closestP].x = x
- this.mapDataPlayers[closestP].y = y
- this.mapDataPlayers[closestP].rot = rot
- });
// console.log("has map data poggies")
let bytes = mapData[f.colors.MapData]
@@ -320,8 +339,8 @@ class DungeonMap extends Feature {
}
// mortLocationOnMap = mortLocationOnMap*16/this.roomWidth
if(bytes[x+y*128] === 66 && bytes[(x-1)+(y)*128] === 0 && bytes[(x)+(y-1)*128] === 0){
- if(!this.puzzles[x+y*128] && this.newPuzzlesTab.length > 0){
- this.puzzles[x+y*128] = this.newPuzzlesTab.shift()
+ if(!this.puzzles[x+y*128]){
+ this.puzzles[x+y*128] = "Loading"
}
}
@@ -398,11 +417,51 @@ class DungeonMap extends Feature {
this.roomWidth = roomWidth
this.mortLocationOnMap = this.mortLocationOnMap
+
+ if(this.mortLocation && mortLocationOnMap && roomWidth){
+ let deco = mapData[f.mapDecorations]
+ this.extraDeco = []
+ try{
+ deco.forEach((icon, vec4b) => {
+ let x = vec4b.func_176112_b()
+ let y = vec4b.func_176113_c()
+ let rot = vec4b.func_176111_d()
+ x = x/2+64
+ y = y/2+64
+ rot=rot*360/16+180
+
+
+ x= (x-mortLocationOnMap[0])/roomWidth*32+this.mortLocation[0]
+ y= (y-mortLocationOnMap[1])/roomWidth*32+this.mortLocation[1]
+
+
+ //wtf is this
+
+ //vec4b.func_176110_a()
+
+
+ let closestP = undefined
+ let closestDistance = Infinity
+ Object.keys(this.mapDataPlayers).forEach((uuid)=>{
+ if((x-this.mapDataPlayers[uuid].x)**2+(y-this.mapDataPlayers[uuid].y)**2 < closestDistance){
+ closestDistance = (x-this.mapDataPlayers[uuid].x)**2+(y-this.mapDataPlayers[uuid].y)**2
+ closestP = uuid
+ }
+ })
+ if(closestP){
+ // console.log(closestP, x, y)
+ this.mapDataPlayers[closestP].x = x
+ this.mapDataPlayers[closestP].y = y
+ this.mapDataPlayers[closestP].rot = rot
+ }
+ });
+ }catch(e){}
+ }
+ let newMapImageThing = new Image(this.renderImage)
+ this.mapImage = newMapImageThing
}
- let newMapImageThing = new Image(this.renderImage)
- this.mapImage = newMapImageThing
// this.mapImage.setImage(this.renderImage)
}
@@ -440,4 +499,131 @@ class DungeonMap extends Feature {
module.exports = {
class: new DungeonMap()
+}
+
+const ContainerChest = Java.type("net.minecraft.inventory.ContainerChest")
+class SpiritLeapOverlay {
+ constructor(parent){
+ this.parent = parent
+
+ this.soopyGui = new SoopyGui()
+
+ let renderThing = new soopyGuiMapRendererThing(this).setLocation(0,0,1,1)
+ this.soopyGui.element.addChild(renderThing)
+
+ this.buttonsContainer = new SoopyGuiElement().setLocation(0.25,0.6, 0.5, 0.4)
+ this.soopyGui.element.addChild(this.buttonsContainer)
+
+ this.items = {}
+ }
+
+ guiOpened(event){
+ if(event.gui && event.gui.field_147002_h instanceof ContainerChest){
+ name = event.gui.field_147002_h.func_85151_d().func_145748_c_().func_150260_c()
+ if(name === "Spirit Leap"){
+ this.soopyGui.open()
+ }
+ }
+ }
+
+ tick(){
+ let itemsNew = {}
+
+ if(Player.getOpenedInventory()?.getName() === "Spirit Leap"){
+ for(let i = 1;i<9*3;i++){
+ let item = Player.getOpenedInventory().getStackInSlot(i)
+ if(item && item.getID()!==160){
+ itemsNew[item.getName()] = i
+ }
+ }
+ }
+
+ if(JSON.stringify(this.items) !== JSON.stringify(itemsNew)){
+ this.items = itemsNew
+ this.buttonsContainer.clearChildren()
+ Object.keys(this.items).forEach((name, i)=>{ //TODO: make the button to leap to the last person to open a door a diff color AND MAKE IT UPDATE LIVE
+ let button = new ButtonWithArrow().setText(name).addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ Player.getOpenedInventory().click(itemsNew[name])
+ ChatLib.chat("Leaping to " + name)
+ })).setLocation(0,i/5,1,1/5)
+ this.buttonsContainer.addChild(button)
+ })
+ }
+ }
+}
+
+class soopyGuiMapRendererThing extends SoopyGuiElement {
+ constructor(parent){
+ super()
+
+ this.parentE = parent
+
+ this.addEvent(new SoopyRenderEvent().setHandler((mouseX, mouseY)=>{
+ let size2 = Math.min(Renderer.screen.getWidth()/2, Renderer.screen.getHeight()/2)
+
+ let [x, y, size, scale] = [Renderer.screen.getWidth()/2-size2/2,Renderer.screen.getHeight()/3-size2/2, size2, size2/this.parentE.parent.IMAGE_SIZE]
+
+ this.parentE.parent.drawMap(x, y, size, scale)
+
+ if(mouseY>y+size2) return
+ let closestPlayer = this.getClosestPlayerTo(x, y, size, scale, mouseX, mouseY)
+
+ if(closestPlayer){
+ let renderX = closestPlayer.x/this.parentE.parent.mapScale/128*size//*16/this.roomWidth
+ let renderY = closestPlayer.y/this.parentE.parent.mapScale/128*size//*16/this.roomWidth
+
+ Renderer.translate(renderX+x+this.parentE.parent.offset[0]/128*size, renderY+y+this.parentE.parent.offset[1]/128*size)
+ renderLibs.drawStringCentered("&a" + closestPlayer.username, 0,-10*scale*3, 2)
+ Renderer.translate(renderX+x+this.parentE.parent.offset[0]/128*size, renderY+y+this.parentE.parent.offset[1]/128*size)
+ Renderer.scale(scale*3, scale*3)
+ Renderer.rotate(closestPlayer.rot)
+ this.parentE.parent.getImageForPlayer(closestPlayer.uuid).draw(-5,-5, 10, 10)
+ }
+ }))
+ this.addEvent(new SoopyMouseClickEvent().setHandler((mouseX, mouseY)=>{
+ let size2 = Math.min(Renderer.screen.getWidth()/2, Renderer.screen.getHeight()/2)
+
+ let [x, y, size, scale] = [Renderer.screen.getWidth()/2-size2/2,Renderer.screen.getHeight()/3-size2/2, size2, size2/this.parentE.parent.IMAGE_SIZE]
+
+ if(mouseY>y+size2) return
+
+ let closestPlayer = this.getClosestPlayerTo(x, y, size, scale, mouseX, mouseY)
+
+ if(closestPlayer){
+ if(Player.getOpenedInventory()?.getName() === "Spirit Leap"){
+ for(let i = 1;i<9*3;i++){
+ let item = Player.getOpenedInventory().getStackInSlot(i)
+ if(item && item.getID()!==160){
+ if(ChatLib.removeFormatting(item.getName()) === closestPlayer.username){
+ Player.getOpenedInventory().click(i)
+ ChatLib.chat("Leaping to " + closestPlayer.username)
+ }
+ }
+ }
+ }
+ }
+ }))
+ }
+
+ getClosestPlayerTo(x, y, size, scale, scanX, scanY){
+
+ let closest = null
+ let closestD = Infinity
+ Object.keys(this.parentE.parent.mapDataPlayers).forEach((uuid)=>{
+
+ if(uuid === Player.getUUID()) return
+
+ let renderX = this.parentE.parent.mapDataPlayers[uuid].x/this.parentE.parent.mapScale/128*size//*16/this.roomWidth
+ let renderY = this.parentE.parent.mapDataPlayers[uuid].y/this.parentE.parent.mapScale/128*size//*16/this.roomWidth
+
+ let distance = (renderX+x+this.parentE.parent.offset[0]/128*size-scanX)**2+ (renderY+y+this.parentE.parent.offset[1]/128*size-scanY)**2
+
+ if(distance < closestD){
+ closestD = distance
+ closest = this.parentE.parent.mapDataPlayers[uuid]
+ }
+ })
+
+ return closest
+ }
} \ No newline at end of file
diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js
index 4993ac9..9449cb3 100644
--- a/features/dungeonSolvers/index.js
+++ b/features/dungeonSolvers/index.js
@@ -11,6 +11,7 @@ import ToggleSetting from "../settings/settingThings/toggle";
const EntityArrow = Java.type("net.minecraft.entity.projectile.EntityArrow")
const EntityBlaze = Java.type("net.minecraft.entity.monster.EntityBlaze")
const AxisAlignedBB = Java.type("net.minecraft.util.AxisAlignedBB")
+let translate = net.minecraft.util.StringTranslate.func_74808_a()
class DungeonSolvers extends Feature {
constructor() {
@@ -244,7 +245,7 @@ class DungeonSolvers extends Feature {
this.arrows = []
this.blazes = []
World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((e) => {
- if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith("Head")) {
+ if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name"))) {
this.addSkull(e);
}
});
@@ -285,7 +286,7 @@ class DungeonSolvers extends Feature {
if (this.eMovingThing[skull.getUUID().toString()].lastX !== skullE[f.posX.Entity] || this.eMovingThing[skull.getUUID().toString()].lastY !== skullE[f.posY.Entity]) {
this.eMovingThing[skull.getUUID().toString()].timeTook = Date.now() - this.eMovingThing[skull.getUUID().toString()].startMovingTime;
- } else if (!this.eMovingThing[skull.getUUID().toString()].logged && (skullE[f.isDead] || !skullE[m.getEquipmentInSlot](4) || !skullE[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith("Head"))) {
+ } else if (!this.eMovingThing[skull.getUUID().toString()].logged && (skullE[f.isDead] || !skullE[m.getEquipmentInSlot](4) || !skullE[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name")))) {
this.eMovingThing[skull.getUUID().toString()].logged = true;
this.spawnIdThing++;
@@ -386,12 +387,12 @@ class DungeonSolvers extends Feature {
if (xA !== this.bloodX || yA !== this.bloodY) return;
} else {
- if (skull.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().trim() === Player.getName() + "'s Head" || skull.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().trim() === Player.getName() + "' Head") {
+ if (skull.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().trim() === translate.func_74805_b("item.skull.player.name").replace("%s",Player.getName())) {
this.bloodX = skull.getX() - (skull.getX() % 32);
this.bloodY = skull.getZ() - (skull.getZ() % 32);
this.skulls = [];
World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((e) => {
- if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith("Head")) {
+ if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name"))) {
this.addSkull(e);
}
});
@@ -499,7 +500,7 @@ class DungeonSolvers extends Feature {
this.todoE.forEach((e) => {
let en = new Entity(e);
// console.log(en.getName())
- if (en.getName().trim() === "Armor Stand" && e[m.getEquipmentInSlot](4) && e[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith("Head")) {
+ if (en.getName().trim() === translate.func_74805_b("item.armorStand.name") && e[m.getEquipmentInSlot](4) && e[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name"))) {
this.addSkull(en);
}
});
diff --git a/features/events/index.js b/features/events/index.js
index bbe1b6d..63d8320 100644
--- a/features/events/index.js
+++ b/features/events/index.js
@@ -32,6 +32,7 @@ class Events extends Feature {
this.hudElements = []
this.lastPathCords = undefined
+
this.burrialWaypointsEnabled = new ToggleSetting("Burrial waypoints", "Show waypoints for burrials during the diana event", true, "burrial_waypoints", this)
this.burrialWaypointsPath = new ToggleSetting("Pathfind waypoints", "Calculate a path thru all the waypoints", true, "burrial_waypoints_path", this).requires(this.burrialWaypointsEnabled)
this.burrialWaypointsNearest = new ToggleSetting("Show nearest using pathfinding", "Use pathfinding to highlight the next burrial instead of disance", true, "burrial_nearest_path", this).requires(this.burrialWaypointsEnabled)
@@ -43,12 +44,16 @@ class Events extends Feature {
.requires(this.burrialWaypointsEnabled)
.editTempText("&6Update&7> &f100s"))
this.hudElements.push(this.updateTimer)
-
+
+ this.shinyBlocks = []
+
+ this.shinyBlockOverlayEnabled = new ToggleSetting("Shiny blocks highlight", "Will highlight shiny blocks in the end", false, "shiny_blocks_overlay", this)
this.registerEvent("worldLoad", this.worldLoad)
this.registerEvent("spawnParticle", this.spawnParticle)
this.registerEvent("renderWorld", this.renderWorld)
this.registerEvent("renderOverlay", this.renderOverlay)
+ this.registerEvent("blockBreak", this.blockBreak)
this.registerStep(true, 2, this.step)
this.registerStep(false, 5, this.step_5s)
this.registerSoopy("apiLoad", this.apiLoad)
@@ -64,6 +69,9 @@ class Events extends Feature {
}
renderWorld(ticks){
+ this.shinyBlocks.forEach(([loc])=>{
+ drawBoxAtBlockNotVisThruWalls(loc[0], loc[1], loc[2], 0,255,0,0.1,0.1)
+ })
if(this.showingWaypoints && this.lastPathCords && this.burrialWaypointsPath.getValue()){
let startPoint = [Player.getPlayer()[f.lastTickPosX]+Player.getPlayer()[f.motionX.Entity]*ticks,
Player.getPlayer()[f.lastTickPosY]+Player.getPlayer()[f.motionY.Entity]*ticks,
@@ -159,7 +167,12 @@ class Events extends Feature {
this.updateTimer.setText("")
}
+ this.shinyBlocks = this.shinyBlocks.filter(([loc, time])=>{
+ return time > Date.now()-5000
+ })
+
}
+
step_5s(){
if(this.showingWaypoints){
if(this.burrialWaypointsPath.getValue() || this.burrialWaypointsNearest.getValue()){
@@ -251,6 +264,13 @@ class Events extends Feature {
spawnParticle(particle, type, event){
+ if(this.shinyBlockOverlayEnabled.getValue()){
+ if(particle.toString().startsWith("EntitySpellParticleFX,")){
+ if(particle.getUnderlyingEntity().func_70534_d()===particle.getUnderlyingEntity().func_70535_g()){
+ this.shinyBlocks.push([[particle.getX(), particle.getY(), particle.getZ()], Date.now()])
+ }
+ }
+ }
if(this.showingWaypoints){
let foundEnchant = false
let foundCrit = false
diff --git a/features/friendsGUI/index.js b/features/friendsGUI/index.js
index c7a370e..51335a9 100644
--- a/features/friendsGUI/index.js
+++ b/features/friendsGUI/index.js
@@ -125,9 +125,13 @@ class SettingPage extends GuiPage {
}
})
+ this.loadingElement.location.location.y.set(this.heightPerFriend*Object.keys(this.loadedFriends).length, 500)
+ this.friendsArea.addChild(this.loadingElement)
+
if(this.maxLoadedPage !== this.pageCount){
- this.loadingElement.location.location.y.set(this.heightPerFriend*Object.keys(this.loadedFriends).length, 500)
- this.friendsArea.addChild(this.loadingElement)
+ this.loadingElement.visable = true
+ }else{
+ this.loadingElement.visable = false
}
}
}
diff --git a/features/hud/index.js b/features/hud/index.js
index 9f83449..8bdab52 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -564,7 +564,7 @@ class Hud extends Feature {
}
if(type === "cata"){
let cataData = getLevelByXp(this.lastStatData.dungeons.dungeon_types.catacombs.experience, 2, 50)
- string = "&6Cata&7> &f" + (cataData.level+cataData.progress).toFixed(2) + " &7(" + this.numberUtils.numberWithCommas(cataData.xpCurrent) + (cataData.level===50?"":"/" + this.numberUtils.numberWithCommas(cataData.xpForNext)) + ")"
+ string = "&6Cata&7> &f" + (~~((cataData.level+cataData.progress)*100)/100).toFixed(2) + " &7(" + this.numberUtils.numberWithCommas(cataData.xpCurrent) + (cataData.level===50?"":"/" + this.numberUtils.numberWithCommas(cataData.xpForNext)) + ")"
}
Object.keys(this.skillLevelCaps).forEach(skill => {
diff --git a/features/improvements/index.js b/features/improvements/index.js
index c2b098a..fa573af 100644
--- a/features/improvements/index.js
+++ b/features/improvements/index.js
@@ -20,18 +20,11 @@ class Improvements extends Feature {
ChatLib.chat(color + "&m" + ChatLib.getChatBreak(" ") + "&r");
}
}).trigger.triggerIfCanceled(false)
-
- this.registerCommand("warp", (...args)=>{
- if(args[0] === "dung") args[0] = "dungeon_hub"
-
- ChatLib.command("warp " + args.join(" "))
- })
this.registerCommand("dung", (...args)=>{
ChatLib.command("warp dungeon_hub")
})
}
-
initVariables(){
this.betterLineBreaks = undefined
}
diff --git a/features/performance/hiddenRequirement.js b/features/performance/hiddenRequirement.js
new file mode 100644
index 0000000..bc74bfc
--- /dev/null
+++ b/features/performance/hiddenRequirement.js
@@ -0,0 +1,7 @@
+let allowedUUIDS = [
+ "dc8c39647b294e03ae9ed13ebd65dd29"
+]
+
+module.exports = {hidden: function(featureManager){
+ return !allowedUUIDS.includes(Player.getUUID().toString().replace(/-/g, ""))
+}} \ No newline at end of file
diff --git a/features/performance/index.js b/features/performance/index.js
new file mode 100644
index 0000000..4bc4002
--- /dev/null
+++ b/features/performance/index.js
@@ -0,0 +1,127 @@
+/// <reference types="../../../CTAutocomplete" />
+/// <reference lib="es2015" />
+import Feature from "../../featureClass/class";
+import SettingBase from "../settings/settingThings/settingBase";
+import ToggleSetting from "../settings/settingThings/toggle";
+
+class Performance extends Feature {
+ constructor() {
+ super()
+ }
+
+ onEnable(){
+ new SettingBase("NOTE: If you dont use any of the features, disable this", "Having performance enabled will decrease performance if no features are used\n(this is due to it using the render entity event)", true, "hide_performance_description", this)
+
+ this.armourStandCapSetting = new ToggleSetting("Armorstand render cap", "Limits the max number of armor stands rendered to 50\n(50 closest to player)", true, "armorstand_render_cap", this)
+
+ this.entitysRenderingTemp = {}
+ this.entitysRendering = {}
+
+ this.dontRender = {}
+
+ // this.removeHiddenEnts = []
+
+ this.nextUpdateDontRender = 0
+ this.maxEntsRender = 50
+ this.armourstandClass = Java.type("net.minecraft.entity.item.EntityArmorStand").class
+ this.armourstandClassString = this.armourstandClass.toString()
+
+ this.registerStep(true, 5, this.updateDontRender)
+
+ this.registerEvent("renderEntity", this.renderEntity)
+ this.registerEvent("renderWorld", this.renderWorld)
+
+ // this.registerForge(net.minecraftforge.event.entity.living.LivingAttackEvent, this.entityAttackEvent);
+ }
+
+ // entityAttackEvent(event) { //TODO: maby make an actual feature for this (0ping 1tap)
+ // if (event.source.func_76346_g() === Player.getPlayer()) {
+ // if(event.entity.func_110143_aJ()<800000){
+
+ // let uuid = new Entity(event.entity).getUUID().toString()
+ // this.dontRender[uuid] = "hit"
+ // this.removeHiddenEnts.push([uuid, Date.now()+1000])
+ // }
+ // }
+ // }
+
+ renderWorld(){
+ if(!this.armourStandCapSetting.getValue()) return
+ this.entitysRendering = {}
+ Object.keys(this.entitysRenderingTemp).forEach(a=>{
+ this.entitysRendering[a] = true
+ })
+ this.entitysRenderingTemp = {}
+ }
+
+ updateDontRender(){
+ if(!this.armourStandCapSetting.getValue()) return
+
+ // this.removeHiddenEnts = this.removeHiddenEnts.filter(([uuid, time])=>{
+ // if(Date.now()<time) return true
+ // delete this.dontRender[uuid]
+ // return false
+ // })
+ // try{
+ let start = Date.now()
+ if(start < this.nextUpdateDontRender) return
+ let entities = World.getAllEntitiesOfType(this.armourstandClass)
+ let Ents = new Array(100)
+ for(let i = 0; i < entities.length; i++){
+ // if(this.dontRender[entities[i].getUUID().toString()] === "hit") continue
+ if(!this.entitysRendering[entities[i].getUUID().toString()]){
+ delete this.dontRender[entities[i].getUUID().toString()]
+ continue //not rendering
+ }
+
+ let dist = (Player.getX()-entities[i].getX())**2+(Player.getY()-entities[i].getY())**2+(Player.getZ()-entities[i].getZ())**2
+ if(dist > 100**2){
+ this.dontRender[entities[i].getUUID().toString()] = true
+ continue
+ }
+
+ dist = ~~Math.sqrt(dist)
+ Ents[dist] = [entities[i], Ents[dist]]
+ }
+
+ let entsNumber = 0
+ for(let i = 0; i < Ents.length; i++){
+ let entsNumberTemp = entsNumber
+ while(Ents[i]){
+ if(entsNumber > this.maxEntsRender){
+ this.dontRender[Ents[i][0].getUUID().toString()] = true
+ }else{
+ delete this.dontRender[Ents[i][0].getUUID().toString()]
+ }
+
+ Ents[i] = Ents[i][1]
+ entsNumberTemp++
+ }
+ entsNumber = entsNumberTemp
+ }
+ let timeTook = Date.now()-start
+ // console.log(`Update took ${timeTook}ms | ${entsNumber} ents`)
+ this.nextUpdateDontRender = Date.now()+100+10*timeTook
+ // }catch(e){
+ // //cucurrent modification
+ // }
+ }
+
+ renderEntity(e, pos, ticks, event){
+ if(!this.armourStandCapSetting.getValue()) return
+ if(!e.getEntity().class.toString()===this.armourstandClassString) return
+ this.entitysRenderingTemp[e.getUUID().toString()] = true
+ if(this.dontRender[e.getUUID().toString()]){
+ cancel(event)
+ return
+ }
+ }
+
+ onDisable(){
+ this.running = false
+ }
+}
+
+module.exports = {
+ class: new Performance()
+} \ No newline at end of file
diff --git a/features/performance/metadata.json b/features/performance/metadata.json
new file mode 100644
index 0000000..673854b
--- /dev/null
+++ b/features/performance/metadata.json
@@ -0,0 +1,8 @@
+{
+ "name": "Performance Settings",
+ "description": "Settings that may improve / decrease performance",
+ "isHidden": "hiddenRequirement.js",
+ "isTogglable": true,
+ "defaultEnabled": false,
+ "sortA": 0
+} \ No newline at end of file
diff --git a/features/settings/index.js b/features/settings/index.js
index 872b25c..701da01 100644
--- a/features/settings/index.js
+++ b/features/settings/index.js
@@ -135,6 +135,7 @@ class SettingPage extends GuiPage {
this.updateSettingCategories()
this.settingsCategoryArea.location.scroll.x.set(0, 0)
this.settingsCategoryArea.location.scroll.y.set(0, 0)
+ this.settingsCategoryArea._scrollAmount = 0
}
updateSettingCategories(){
@@ -241,6 +242,7 @@ class SettingPage extends GuiPage {
this.settingsArea.location.scroll.x.set(0, 0)
this.settingsArea.location.scroll.y.set(0, 0)
+ this.settingsArea._scrollAmount = 0
}
}
diff --git a/features/spamHider/index.js b/features/spamHider/index.js
index d49f62e..0215896 100644
--- a/features/spamHider/index.js
+++ b/features/spamHider/index.js
@@ -1,5 +1,6 @@
/// <reference types="../../../CTAutocomplete" />
/// <reference lib="es2015" />
+import SoopyContentChangeEvent from "../../../guimanager/EventListener/SoopyContentChangeEvent";
import Feature from "../../featureClass/class";
import soopyV2Server from "../../socketConnection";
import ToggleSetting from "../settings/settingThings/toggle";
@@ -20,8 +21,12 @@ class SpamHider extends Feature {
this.hideMessagesSetting = new ToggleSetting("Hide some messages", "This will completely remove some spammy messages from chat", true, "completely_hide_spam", this)
this.moveMessagesSetting = new ToggleSetting("Move some messages to spam hider", "This will move some (potentially) usefull messages into a 'second chat'", true, "move_spam", this)
this.moveChatMessages = new ToggleSetting("Move spammed chat messages to spam hider", "This will move messages spammed in hubs to spam hider\n(eg the website advertisment bots)", true, "move_spam_chat", this)
+ this.textShadowSetting = new ToggleSetting("Spam Hider Text Shadow", "Whether to give the spam hider text shadow", true, "spam_text_shadow", this)
this.SpamHiderMessagesRenderer = new SpamHiderMessagesRenderer()
+ this.textShadowSetting.toggleObject.addEvent(new SoopyContentChangeEvent().setHandler((newVal, oldVal, resetFun)=>{
+ this.SpamHiderMessagesRenderer.textShadow = this.textShadowSetting.getValue()
+ }))
this.loadSpamMessages()
@@ -121,6 +126,8 @@ class SpamHiderMessagesRenderer{
this.corner = 2
this.lastRender = 0
+
+ this.textShadow = true
}
addMessage(str){
@@ -192,7 +199,11 @@ class SpamHiderMessagesRenderer{
y = sheight - 30 - (height)
}
- Renderer.drawString(str, x + this.x, y + this.y);
+ if(this.textShadow){
+ Renderer.drawStringWithShadow(str, x + this.x, y + this.y);
+ }else{
+ Renderer.drawString(str, x + this.x, y + this.y);
+ }
if (time > 4000) {
this.messages.shift()
diff --git a/features/streamsGUI/index.js b/features/streamsGUI/index.js
index 01040cd..b9912c2 100644
--- a/features/streamsGUI/index.js
+++ b/features/streamsGUI/index.js
@@ -93,8 +93,9 @@ class StreamPage extends GuiPage {
let title = new SoopyMarkdownElement().setText(data.title).setLocation(0.1, 0.15, 0.8, 0.1)
sidebar.addChild(title)
- let image = new SoopyImageElement().setImage(data.image).setLocation(0.1, 0.15+title.getHeight(), 0.8, 0.4).loadHeightFromImage()
+ let image = new SoopyImageElement().setImage(data.image).setLocation(0.1, 0.15+title.getHeight(), 0.8, 0.4)
sidebar.addChild(image)
+ image.loadHeightFromImage()
let button = new ButtonWithArrow().setText("§0Watch on Twitch").setLocation(0.1, 0.15+image.location.size.y.get()+title.getHeight(), 0.8, 0.1)
sidebar.addChild(button)
@@ -133,7 +134,7 @@ class StreamElement extends SoopyBoxElement {
this.channelElement = new SoopyTextElement().setLocation(0.1,0.025,0.8,0.1).setMaxTextScale(10)
- this.channelImg = new SoopyImageElement().setLocation(0.1,0.125,0.8,0.2).loadHeightFromImage()
+ this.channelImg = new SoopyImageElement().setLocation(0.1,0.125,0.8,0.2)
this.titleElement = new SoopyMarkdownElement().setLocation(0.1,0.45,0.8,0.1)
@@ -150,6 +151,7 @@ class StreamElement extends SoopyBoxElement {
this.addChild(this.channelElement)
this.addChild(this.titleElement)
this.addChild(this.channelImg)
+ this.channelImg.loadHeightFromImage()
}
setStream(stream, twitch){
@@ -161,6 +163,7 @@ class StreamElement extends SoopyBoxElement {
this.streamData.image = twitch ? `https://static-cdn.jtvnw.net/previews-ttv/live_user_${stream.user_login}-640x360.jpg` : stream.thumbnails.high.url
this.channelImg.setImage(this.streamData.image)
+ this.channelImg.loadHeightFromImage()
return this
}