Ender IO Zoo

Ender IO Zoo

964k Downloads

Wireless Charger is Extremely Wireless

ZeekDaGeek opened this issue ยท 4 comments

commented

Issue Description:

Once you get a certain distance away from a wireless charger it seems to charge you due to a integer overflow in getDistSq.

https://github.com/SleepyTrousers/EnderIO/blob/master/src/main/java/crazypants/enderio/machine/wireless/WirelessChargerController.java#L73

This is a real issue when you're on a skyblock server that spreads each player out by a specific amount for their starter islands.

What you expected to happen:

Not have everyone on the server stealing my power when they get far enough away from me.

Steps to reproduce:

  1. Teleport to 0, 64, 0
  2. Place down a wireless charger with a Energy Cell of some kind with a fixed amount of power, that way you can measure the drop in charge later.
  3. Teleport to 46340, 64, 0
  4. Walk East 1 block and enjoy your EXTREME WIRELESS CHARGER! Any distance above 46340 in the X or Y or below -46340 will work. (The way to figure out this number is with sqrt(Integer.MAX_VALUE) = 46340)

Affected Versions (Do not use "latest"):

  • EnderIO: 2.3.0.424_beta
  • EnderCore: 0.2.0.32
  • Minecraft: 1.7.10
  • Forge: 10.13.4.1614-1.7.10

Related: #2498

commented

Fixed in 1.9

commented

Should the rangeSq methods/fields not be changed to long?

commented

I have seen this before then.. wow at least i know why it happened :)

commented

Still seeing this issue in EIO 1.7.10-2.3.0.429_beta, is this not going to be fixed?