Skip to content

Commit

Permalink
0.8.4 AutoScoreboard bugfix, LavaAura range calcs made better
Browse files Browse the repository at this point in the history
**0.8.4**
- AutoScoreboard fix, I forgot a return statement which was causing the module to spam ridiculously to no end.
- Implemented more precise range calculations for LavaAura when using the lava/burn everything option, and for extinquishing fire and picking up lava.
- Adjusted lava pickup delay default in lava aura to 2 instead of 1 because it feels a little better.
  • Loading branch information
etianl authored Feb 12, 2024
1 parent 79350b2 commit 36a984a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 47 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=0.8.3-1.20.4
mod_version=0.8.4-1.20.4
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void onTick(TickEvent.Post event) {
else {
error("Title is too long, shorten it somehow");
toggle();
return;
}
ChatUtils.sendPlayerMsg("/scoreboard objectives setdisplay sidebar " + scoreboardName);
int i = content.get().size();
Expand All @@ -93,6 +94,7 @@ private void onTick(TickEvent.Post event) {
else {
error("A content line is too long, shorten it somehow");
toggle();
return;
}
ChatUtils.sendPlayerMsg("/team modify " + randomName + " color " + contentColor);
ChatUtils.sendPlayerMsg("/team join " + randomName + " " + i);
Expand Down
97 changes: 52 additions & 45 deletions src/main/java/pwn/noobs/trouserstreak/modules/LavaAura.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class LavaAura extends Module {
public final Setting<Integer> pickuptickdelay = sgLAVA.add(new IntSetting.Builder()
.name("Lava Pickup Tick Delay")
.description("Tick Delay for lava pickup")
.defaultValue(1)
.defaultValue(2)
.min(0)
.sliderMax(20)
.visible(() -> pickup.get() && mode.get() == Mode.LAVA)
Expand Down Expand Up @@ -351,24 +351,27 @@ private void onTick(TickEvent.Pre event) {
if (lavaeverything.get()) {
BlockPos playerPos = mc.player.getBlockPos();

for (int x = (int) -Math.round(range.get()); x < range.get(); x++) {
for (int y = (int) -Math.round(range.get()); y < range.get(); y++) {
for (int z = (int) -Math.round(range.get()); z < range.get(); z++) {
BlockPos blockPos = playerPos.add(x, y, z);
for (int x = (int) -Math.round(range.get()+1); x <= range.get()+1; x++) {
for (int y = (int) -Math.round(range.get()+1); y <= range.get()+1; y++) {
for (int z = (int) -Math.round(range.get()+1); z <= range.get()+1; z++) {

if (mc.world.getBlockState(blockPos).getBlock() != Blocks.AIR && mc.world.getBlockState(blockPos).getBlock() != Blocks.WATER && mc.world.getBlockState(blockPos).getBlock() != Blocks.LAVA) {
// Check if the block has not had lava placed on it
if (!lavaPlaced.contains(blockPos)) {
if (mode.get() == Mode.LAVA) {
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
placeLava();
} else if (mode.get() == Mode.FIRE) {
if (!norotate.get())mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
placeFire(blockPos.up());
};
BlockPos blockPos = playerPos.add(x, y, z);
double distance = mc.player.getPos().distanceTo(blockPos.toCenterPos());
if (distance <= range.get()) {
if (mc.world.getBlockState(blockPos).getBlock() != Blocks.AIR && mc.world.getBlockState(blockPos).getBlock() != Blocks.WATER && mc.world.getBlockState(blockPos).getBlock() != Blocks.LAVA) {
// Check if the block has not had lava placed on it
if (!lavaPlaced.contains(blockPos)) {
if (mode.get() == Mode.LAVA) {
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
placeLava();
} else if (mode.get() == Mode.FIRE) {
if (!norotate.get())mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
placeFire(blockPos.up());
};

// Add the block to the set to indicate that lava has been placed on it
lavaPlaced.add(blockPos);
// Add the block to the set to indicate that lava has been placed on it
lavaPlaced.add(blockPos);
}
}
}
}
Expand Down Expand Up @@ -429,20 +432,22 @@ private void pickUpLavaOnTick() {
for (int z = (int) -Math.round(range.get()+1); z <= range.get()+1; z++) {
BlockPos blockPos = playerPos.add(x, y, z);
BlockState blockState = mc.world.getBlockState(blockPos);
double distance = mc.player.getPos().distanceTo(blockPos.toCenterPos());
if (distance <= range.get()) {
if (blockState.getBlock() == Blocks.LAVA) {
// Perform a raycast to check for obstructions
BlockHitResult blockHitResult = mc.world.raycast(new RaycastContext(
mc.player.getCameraPosVec(1.0f),
new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()),
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE,
mc.player
));

if (blockState.getBlock() == Blocks.LAVA) {
// Perform a raycast to check for obstructions
BlockHitResult blockHitResult = mc.world.raycast(new RaycastContext(
mc.player.getCameraPosVec(1.0f),
new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()),
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE,
mc.player
));

if (blockHitResult.getType() == HitResult.Type.MISS) {
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()));
pickupLiquid();
if (blockHitResult.getType() == HitResult.Type.MISS) {
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()));
pickupLiquid();
}
}
}
}
Expand All @@ -457,25 +462,27 @@ private void extinguishFireOnTick() {
for (int z = (int) -Math.round(range.get()+1); z <= range.get()+1; z++) {
BlockPos blockPos = playerPos.add(x, y, z);
BlockState blockState = mc.world.getBlockState(blockPos);
double distance = mc.player.getPos().distanceTo(blockPos.toCenterPos());
if (distance <= range.get()) {
if (blockState.getBlock() == Blocks.FIRE) {
if (!ignorewalls.get()){
// Perform a raycast to check for obstructions
BlockHitResult blockHitResult = mc.world.raycast(new RaycastContext(
mc.player.getCameraPosVec(1.0f),
new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()),
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE,
mc.player
));

if (blockState.getBlock() == Blocks.FIRE) {
if (!ignorewalls.get()){
// Perform a raycast to check for obstructions
BlockHitResult blockHitResult = mc.world.raycast(new RaycastContext(
mc.player.getCameraPosVec(1.0f),
new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()),
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE,
mc.player
));

if (blockHitResult.getType() == HitResult.Type.MISS) {
if (blockHitResult.getType() == HitResult.Type.MISS) {
if (!norotate.get()) mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()));
mc.interactionManager.attackBlock(blockPos, Direction.DOWN);
}
} else if (ignorewalls.get()){
if (!norotate.get()) mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()));
mc.interactionManager.attackBlock(blockPos, Direction.DOWN);
}
} else if (ignorewalls.get()){
if (!norotate.get()) mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY()+0.25, blockPos.getZ()));
mc.interactionManager.attackBlock(blockPos, Direction.DOWN);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "streak-addon",
"version": "0.8.3",
"version": "0.8.4",
"name": "TrouserStreak",
"description": "Trouser-Streak is a compilation of modules, updated to the latest version and optimized for maximum grief. I did not make all of these.",
"authors": [
Expand Down

0 comments on commit 36a984a

Please sign in to comment.