Skip to content

Commit

Permalink
fix #315
Browse files Browse the repository at this point in the history
  • Loading branch information
DerToaster98 committed Jan 2, 2022
1 parent a47f7c2 commit cea7b8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/team/cqr/cqrepoured/event/EventsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public static void onAttackEntityEvent(AttackEntityEvent event) {

@SubscribeEvent
public static void sayNoToCowardlyPlacingLavaAgainstBosses(FillBucketEvent event) {
if (CQRConfig.bosses.antiCowardMode && !event.getEntityPlayer().isCreative()) {
if (CQRConfig.bosses.antiCowardMode && event.getEntityPlayer() != null && !event.getEntityPlayer().isCreative()) {
BlockPos pos = new BlockPos(event.getEntityPlayer());
int radius = CQRConfig.bosses.antiCowardRadius;
AxisAlignedBB aabb = new AxisAlignedBB(pos.add(-radius, -radius / 2, -radius), pos.add(radius, radius / 2, radius));
Expand All @@ -244,7 +244,7 @@ public static void sayNoToCowardlyPlacingLavaAgainstBosses(FillBucketEvent event

@SubscribeEvent
public static void sayNoToPlacingBlocksNearBosses(BlockEvent.EntityPlaceEvent event) {
if (CQRConfig.bosses.preventBlockPlacingNearBosses && (!(event.getEntity() instanceof EntityPlayer) || !((EntityPlayer) event.getEntity()).isCreative())) {
if (CQRConfig.bosses.preventBlockPlacingNearBosses && event.getEntity() != null && (!(event.getEntity() instanceof EntityPlayer) || !((EntityPlayer) event.getEntity()).isCreative())) {
BlockPos pos = new BlockPos(event.getEntity());
int radius = CQRConfig.bosses.antiCowardRadius;
AxisAlignedBB aabb = new AxisAlignedBB(pos.add(-radius, -radius / 2, -radius), pos.add(radius, radius / 2, radius));
Expand Down

0 comments on commit cea7b8b

Please sign in to comment.