diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2021-08-11 13:11:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 13:11:49 +0200 |
| commit | 55bb27aa9bd2a288c28a17502b421f4cf647570d (patch) | |
| tree | 05fc6a8fb187e1388e5a4a1131b2359392f89baf /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures | |
| parent | 9cceb9cbf0e8da94022ddaf7d00b3565a1c83557 (diff) | |
| parent | b9969795b98665509af5ba05fc60c30e7459a52a (diff) | |
| download | notenoughupdates-55bb27aa9bd2a288c28a17502b421f4cf647570d.tar.gz notenoughupdates-55bb27aa9bd2a288c28a17502b421f4cf647570d.tar.bz2 notenoughupdates-55bb27aa9bd2a288c28a17502b421f4cf647570d.zip | |
Merge branch 'DoKM:master' into yep
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java | 61 | ||||
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java | 8 |
2 files changed, 10 insertions, 59 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 cc13f59a..2f9d326e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -59,10 +59,7 @@ public class CustomItemEffects { public long lastUsedHyperion = 0; - private boolean heldBonemerang = false; - public final Set<EntityLivingBase> bonemeragedEntities = new HashSet<>(); - public boolean bonemerangBreak = false; public int aoteTeleportationMillis = 0; public Vector3f aoteTeleportationCurr = null; @@ -197,55 +194,7 @@ public class CustomItemEffects { tick++; if(tick > Integer.MAX_VALUE/2) tick = 0; - heldBonemerang = false; - bonemerangBreak = false; - bonemeragedEntities.clear(); - if(Minecraft.getMinecraft().thePlayer == null) return; - if(Minecraft.getMinecraft().theWorld == null) return; - - ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem(); - - String internal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held); - if(internal != null && internal.equals("BONE_BOOMERANG")) { - heldBonemerang = true; - - EntityPlayerSP p = Minecraft.getMinecraft().thePlayer; - float stepSize = 0.15f; - float bonemerangDistance = 15; - - Vector3f position = new Vector3f((float)p.posX, (float)p.posY + p.getEyeHeight(), (float)p.posZ); - Vec3 look = p.getLook(0); - - Vector3f step = new Vector3f((float)look.xCoord, (float)look.yCoord, (float)look.zCoord); - step.scale(stepSize / step.length()); - - for(int i=0; i<Math.floor(bonemerangDistance/stepSize)-2; i++) { - AxisAlignedBB bb = new AxisAlignedBB(position.x - 0.75f, position.y - 0.1, position.z - 0.75f, - position.x + 0.75f, position.y + 0.25, position.z + 0.75); - - BlockPos blockPos = new BlockPos(position.x, position.y, position.z); - - if(!Minecraft.getMinecraft().theWorld.isAirBlock(blockPos) && - Minecraft.getMinecraft().theWorld.getBlockState(blockPos).getBlock().isFullCube()) { - if(NotEnoughUpdates.INSTANCE.config.itemOverlays.showBreak) { - bonemerangBreak = true; - } - break; - } - if(NotEnoughUpdates.INSTANCE.config.itemOverlays.highlightTargeted) { - List<Entity> entities = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABBExcludingEntity(Minecraft.getMinecraft().thePlayer, bb); - for(Entity entity : entities) { - if(entity instanceof EntityLivingBase && !(entity instanceof EntityArmorStand) && !entity.isInvisible()) { - if(!bonemeragedEntities.contains(entity)) { - bonemeragedEntities.add((EntityLivingBase)entity); - } - } - } - } - position.translate(step.x, step.y, step.z); - } - } } private float lastPartialTicks = 0; @@ -329,14 +278,8 @@ public class CustomItemEffects { } } - if(heldBonemerang) { - if(bonemerangBreak) { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - Utils.drawStringCentered(EnumChatFormatting.RED+"Bonemerang will break!", - Minecraft.getMinecraft().fontRendererObj, - scaledResolution.getScaledWidth()/2f, scaledResolution.getScaledHeight()/2f+10, true, 0); - } - } else if(NotEnoughUpdates.INSTANCE.config.itemOverlays.enableWandOverlay && + + if(NotEnoughUpdates.INSTANCE.config.itemOverlays.enableWandOverlay && Minecraft.getMinecraft().objectMouseOver != null && Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java index 256cf03f..cd128ebe 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java @@ -79,6 +79,14 @@ public class SlotLocking { private boolean lockKeyHeld = false; private Slot pairingSlot = null; + private Slot realSlot = null; + + public void setRealSlot(Slot slot){ + realSlot = slot; + } + + public Slot getRealSlot(){ return realSlot;} + public void loadConfig(File file) { try(BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) { config = GSON.fromJson(reader, SlotLockingConfig.class); |
