actually fix a crash while selecting
All checks were successful
/ Build BaseBand (push) Successful in 2m13s
All checks were successful
/ Build BaseBand (push) Successful in 2m13s
This commit is contained in:
parent
262c217d6d
commit
acdb41a1ea
3 changed files with 9 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue