aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDoKM <mcazzyman@gmail.com>2021-08-25 09:51:17 +0200
committerDoKM <mcazzyman@gmail.com>2021-08-25 09:51:17 +0200
commitd7c31c78fe6cf41de8f0140f00a94d57fbea22be (patch)
tree9cdf6d0ce84c07636f4ae9d26666eabf9bc1df95 /src
parent0671b644762f8db0da3e749331df7dd33e1124a6 (diff)
downloadNotEnoughUpdates-d7c31c78fe6cf41de8f0140f00a94d57fbea22be.tar.gz
NotEnoughUpdates-d7c31c78fe6cf41de8f0140f00a94d57fbea22be.tar.bz2
NotEnoughUpdates-d7c31c78fe6cf41de8f0140f00a94d57fbea22be.zip
Fix fetchur crash/disable BuilderW/BZ/Prisma overlay when not on Pisland
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java15
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java4
2 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java
index 0f4e2f4d..d7d27f99 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java
@@ -283,10 +283,12 @@ public class CustomItemEffects {
}
}
+ boolean onPrivateIsland = SBInfo.getInstance().getLocation() == null || SBInfo.getInstance().getLocation().equals("dynamic");
+
if(NotEnoughUpdates.INSTANCE.config.itemOverlays.enableWandOverlay &&
Minecraft.getMinecraft().objectMouseOver != null &&
- Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
+ Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && onPrivateIsland) {
IBlockState hover = Minecraft.getMinecraft().theWorld.getBlockState(
Minecraft.getMinecraft().objectMouseOver.getBlockPos().offset(
@@ -528,6 +530,7 @@ public class CustomItemEffects {
ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem();
String heldInternal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held);
if(heldInternal != null) {
+ boolean onPrivateIsland = SBInfo.getInstance().getLocation() == null || SBInfo.getInstance().getLocation().equals("dynamic");
EntityPlayer player = event.player;
double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)event.partialTicks;
double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)event.partialTicks;
@@ -592,8 +595,8 @@ public class CustomItemEffects {
}
if(heldInternal.equals("BLOCK_ZAPPER")) {
- boolean privateIs = SBInfo.getInstance().getLocation() == null || SBInfo.getInstance().getLocation().equals("dynamic");
- if (!privateIs || !NotEnoughUpdates.INSTANCE.config.itemOverlays.enableZapperOverlay ||
+
+ if (!onPrivateIsland || !NotEnoughUpdates.INSTANCE.config.itemOverlays.enableZapperOverlay ||
event.target.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
zapperBlocks.clear();
return;
@@ -729,7 +732,7 @@ public class CustomItemEffects {
GlStateManager.disableBlend();
}
} else if(NotEnoughUpdates.INSTANCE.config.itemOverlays.enableWandOverlay) {
- if(heldInternal.equals("BUILDERS_WAND")) {
+ if(heldInternal.equals("BUILDERS_WAND") && onPrivateIsland) {
int maxBlocks = MAX_BUILDERS_BLOCKS;
if (event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
IBlockState hover = Minecraft.getMinecraft().theWorld.getBlockState(event.target.getBlockPos().offset(event.target.sideHit, 1));
@@ -811,7 +814,7 @@ public class CustomItemEffects {
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}
- } else if((heldInternal.equals("WATER_BUCKET") || heldInternal.equals("MAGICAL_WATER_BUCKET") && NotEnoughUpdates.INSTANCE.config.itemOverlays.enablePrismapumpOverlay) &&
+ } else if((heldInternal.equals("WATER_BUCKET") || heldInternal.equals("MAGICAL_WATER_BUCKET") && NotEnoughUpdates.INSTANCE.config.itemOverlays.enablePrismapumpOverlay && onPrivateIsland) &&
event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos hover = event.target.getBlockPos().offset(event.target.sideHit, 1);
@@ -893,7 +896,7 @@ public class CustomItemEffects {
GlStateManager.depthMask(true);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
- } else if((heldInternal.equals("HOE_OF_GREAT_TILLING") || heldInternal.equals("HOE_OF_GREATER_TILLING")) &&
+ } else if((heldInternal.equals("HOE_OF_GREAT_TILLING") || heldInternal.equals("HOE_OF_GREATER_TILLING") && onPrivateIsland) &&
event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos target = event.target.getBlockPos();
IBlockState targetState = Minecraft.getMinecraft().theWorld.getBlockState(target);
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java
index 429a3c60..5c0c5ddd 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java
@@ -134,10 +134,10 @@ public class TimersOverlay extends TextOverlay {
ZonedDateTime currentTimeEST = ZonedDateTime.now(ZoneId.of("America/Atikokan"));
- long fetchurIndex = (currentTimeEST.getDayOfMonth() % 13)-1;
+ long fetchurIndex = ((currentTimeEST.getDayOfMonth()+3) % 13)-1;
//Added because disabled fetchur and enabled it again but it was showing the wrong item
//Lets see if this stays correct
- fetchurIndex+=2;
+
if(fetchurIndex < 0) fetchurIndex += 13;
icon = FETCHUR_ICONS[(int)fetchurIndex];