Skip to content

Commit e235704

Browse files
committed
ItemFramePT now changed to SignFramePT
1 parent aa12209 commit e235704

File tree

5 files changed

+177
-131
lines changed

5 files changed

+177
-131
lines changed

README.md

136 Bytes

AutoDisenchant

  • Feeds items from your inventory (and or hotbar) that can be disenchanted into the grindstone automatically.

ItemSignFramePassThrough

  • You can now open chests that have item frames or signs in the way!
  • Right-clicking item frames (with items in them) or signs interacts with the block behind them. Hold sneak to interact with the frame or sign normally.
  • Toggle between signs, frames or both

ItemESP (Expanded)

Highlights dropped, equipped, and framed items with powerful filters and customization.

src/main/java/net/wurstclient/hack/HackList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public final class HackList implements UpdateListener
117117
public final InvWalkHack invWalkHack = new InvWalkHack();
118118
public final ItemEspHack itemEspHack = new ItemEspHack();
119119
public final ItemGeneratorHack itemGeneratorHack = new ItemGeneratorHack();
120-
public final ItemFramePTHack itemFramePTHack = new ItemFramePTHack();
120+
public final SignFramePTHack signFramePTHack = new SignFramePTHack();
121121
public final JesusHack jesusHack = new JesusHack();
122122
public final JetpackHack jetpackHack = new JetpackHack();
123123
public final KaboomHack kaboomHack = new KaboomHack();

src/main/java/net/wurstclient/hacks/ItemFramePTHack.java

Lines changed: 0 additions & 129 deletions
This file was deleted.
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
/*
2+
* Copyright (c) 2014-2025 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.hacks;
9+
10+
import net.minecraft.entity.Entity;
11+
import net.minecraft.entity.decoration.ItemFrameEntity;
12+
import net.minecraft.item.ItemStack;
13+
import net.minecraft.util.hit.BlockHitResult;
14+
import net.minecraft.util.hit.EntityHitResult;
15+
import net.minecraft.util.hit.HitResult;
16+
import net.minecraft.util.math.Box;
17+
import net.minecraft.util.math.Vec3d;
18+
import net.minecraft.block.AbstractSignBlock;
19+
import net.wurstclient.Category;
20+
import net.wurstclient.events.RightClickListener;
21+
import net.wurstclient.hack.Hack;
22+
import net.wurstclient.settings.CheckboxSetting;
23+
import net.wurstclient.util.BlockUtils;
24+
import net.wurstclient.util.EntityUtils;
25+
import net.wurstclient.util.RotationUtils;
26+
27+
/**
28+
* Forwards right-clicks on item frames that contain an item or on signs to the
29+
* block behind them (e.g. opens a chest behind an item frame or wall sign).
30+
* When the player is sneaking the normal interaction is preserved.
31+
*
32+
* The hack can be configured to apply to frames, signs, or both.
33+
*/
34+
public class SignFramePTHack extends Hack implements RightClickListener
35+
{
36+
private final CheckboxSetting framesEnabled =
37+
new CheckboxSetting("Frames", true);
38+
private final CheckboxSetting signsEnabled =
39+
new CheckboxSetting("Signs", true);
40+
41+
public SignFramePTHack()
42+
{
43+
super("SignFramePT");
44+
setCategory(Category.ITEMS);
45+
addSetting(framesEnabled);
46+
addSetting(signsEnabled);
47+
}
48+
49+
@Override
50+
protected void onEnable()
51+
{
52+
EVENTS.add(RightClickListener.class, this);
53+
}
54+
55+
@Override
56+
protected void onDisable()
57+
{
58+
EVENTS.remove(RightClickListener.class, this);
59+
}
60+
61+
@Override
62+
public void onRightClick(RightClickEvent event)
63+
{
64+
// Respect vanilla item use cooldown
65+
if(MC.itemUseCooldown > 0)
66+
return;
67+
68+
// Only when the use key is pressed
69+
if(!MC.options.useKey.isPressed())
70+
return;
71+
72+
HitResult hr = MC.crosshairTarget;
73+
if(hr == null)
74+
return;
75+
76+
EntityHitResult ehr = null;
77+
BlockHitResult bh = null;
78+
boolean signHit = false;
79+
80+
if(hr.getType() == HitResult.Type.ENTITY)
81+
{
82+
ehr = (EntityHitResult)hr;
83+
}else if(hr.getType() == HitResult.Type.BLOCK)
84+
{
85+
// If the crosshair target is a block (common when looking at
86+
// frames or signs), try to find an item frame entity at the hit
87+
// position (if frames are enabled). If not found and signs are
88+
// enabled, check whether the block is a sign.
89+
bh = (BlockHitResult)hr;
90+
Vec3d hitPos = bh.getPos();
91+
if(framesEnabled.isChecked())
92+
{
93+
for(Entity e : MC.world.getEntities())
94+
{
95+
if(!(e instanceof ItemFrameEntity))
96+
continue;
97+
ItemFrameEntity frame = (ItemFrameEntity)e;
98+
// Only consider frames that actually hold an item
99+
ItemStack held = frame.getHeldItemStack();
100+
if(held == null || held.isEmpty())
101+
continue;
102+
Box box = EntityUtils.getLerpedBox(frame, 0.0f);
103+
if(box.contains(hitPos))
104+
{
105+
ehr = new EntityHitResult(frame, frame.getPos());
106+
break;
107+
}
108+
}
109+
}
110+
if(ehr == null && signsEnabled.isChecked())
111+
{
112+
BlockHitResult blockResult = bh;
113+
if(blockResult != null && blockResult.getBlockPos() != null)
114+
{
115+
var pos = blockResult.getBlockPos();
116+
var state = MC.world.getBlockState(pos);
117+
if(state.getBlock() instanceof AbstractSignBlock)
118+
{
119+
signHit = true;
120+
}
121+
}
122+
}
123+
}
124+
125+
if(ehr == null && !signHit)
126+
return;
127+
128+
// If we have an entity hit it must be an item frame and frames must be
129+
// enabled
130+
if(ehr != null)
131+
{
132+
if(!(ehr.getEntity() instanceof ItemFrameEntity frame))
133+
return;
134+
if(!framesEnabled.isChecked())
135+
return;
136+
ItemStack stack = frame.getHeldItemStack();
137+
if(stack == null || stack.isEmpty())
138+
return;
139+
// If the player is sneaking (sneak key pressed), keep normal
140+
// behavior
141+
if(MC.options.sneakKey.isPressed())
142+
return;
143+
}
144+
145+
// For sign hits, also respect sneaking (keep normal interaction)
146+
if(signHit && MC.options.sneakKey.isPressed())
147+
return;
148+
149+
// Raycast from the player's eyes past the entity/block hit position to
150+
// find the underlying block (the block the frame or sign is attached
151+
// to). We extend the ray a bit past the hit so that the block behind
152+
// the object is detected.
153+
Vec3d eyes = RotationUtils.getEyesPos();
154+
Vec3d target = null;
155+
if(ehr != null)
156+
target = ehr.getPos();
157+
else if(bh != null)
158+
target = bh.getPos();
159+
if(target == null)
160+
return;
161+
Vec3d look = RotationUtils.getServerLookVec();
162+
double dist = eyes.distanceTo(target);
163+
double extend = 1.5; // extend beyond the frame/sign
164+
Vec3d end = eyes.add(look.multiply(dist + extend));
165+
BlockHitResult bhit = BlockUtils.raycast(eyes, end);
166+
if(bhit == null || bhit.getType() != HitResult.Type.BLOCK)
167+
return;
168+
169+
// Cancel the normal interaction and interact with the block behind
170+
// the frame/sign instead.
171+
event.cancel();
172+
IMC.getInteractionManager().rightClickBlock(bhit.getBlockPos(),
173+
bhit.getSide(), bhit.getPos());
174+
}
175+
}

src/main/resources/assets/wurst/translations/en_us.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"description.wurst.hack.invwalk": "Allows you to move around while the inventory is open.",
9797
"description.wurst.hack.itemesp": "Highlights nearby items.",
9898
"description.wurst.hack.itemgenerator": "Generates random items and drops them on the ground.\n??oCreative mode only.??r",
99-
"description.wurst.hack.itemframept": "Right-clicking item frames with items in them interacts with the block behind them. Hold sneak to interact with the frame normally.",
99+
"description.wurst.hack.signframept": "Right-clicking item frames (with items in them) or signs forwards the interaction to the block behind them. Use the hack settings to enable Frames, Signs, or both. Hold sneak to interact with the frame or sign normally.",
100100
"description.wurst.hack.jesus": "Allows you to walk on water.\nJesus used this hack ~2000 years ago.",
101101
"description.wurst.hack.jetpack": "Allows you to fly as if you had a jetpack.\n\n??c??lWARNING:??r You will take fall damage if you don't use NoFall.",
102102
"description.wurst.hack.kaboom": "Breaks blocks around you like an explosion.\n\nCan be a lot faster than Nuker if the server doesn't have an anti-cheat plugin. It works best with fast tools and weak blocks.\n\nNote: This is not an actual explosion.",

0 commit comments

Comments
 (0)