actually fix a crash while selecting
All checks were successful
/ Build BaseBand (push) Successful in 2m13s

This commit is contained in:
Daniella / Tove 2024-10-05 02:11:30 +02:00
parent 262c217d6d
commit acdb41a1ea
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
3 changed files with 9 additions and 2 deletions

View file

@ -266,7 +266,7 @@ public abstract class Feature extends ToggleButton implements SetCommand {
protected boolean notIngame() {
if (mc == null) {
throw new RuntimeException();
throw new RuntimeException("BaseBand BUG - Code FNOMCN");
}
return mc.world == null || mc.player == null;
}
@ -374,6 +374,9 @@ public abstract class Feature extends ToggleButton implements SetCommand {
}
public void internalOnEveryTick() {
if (mc == null) {
throw new RuntimeException("BaseBand BUG - Code FNOMCT");
}
if(enabled && !tryEnable())
toggle();
onEveryTick();

View file

@ -108,6 +108,8 @@ public class MidClick extends Feature {
down = true;
RayTraceResult hover = mc.objectMouseOver;
if(hover == null)
return;
if(hover.entityHit != null) {
if(hover.entityHit instanceof EntityPlayer) {
playerAction.action.accept(((EntityPlayer) hover.entityHit));

View file

@ -82,7 +82,9 @@ public class Select extends Feature {
if(!renderSelection)
return;
Selection selection = Select.selection;
if(selection == null && mc.objectMouseOver != null) {
if(selection == null) {
if(mc.objectMouseOver == null)
return;
BlockPos pos = mc.objectMouseOver.getBlockPos();
//noinspection ConstantValue - pos can indeed be null.
if(renderIncomplete && begin != null && pos != null)