mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Added getter to IExtendedPlayerController.
This commit is contained in:
1 parent
2cec34a139
commit
240fa3be96
5 files changed
+12
-3
No files matched your search
@@ -22,4 +22,8 @@ public interface IExtendedPlayerController {
|
||||
*/
|
||||
public void setReachDistanceExtension(float f);
|
||||
|
||||
/**
|
||||
* Gets the current reach extension.
|
||||
*/
|
||||
public float getReachDistanceExtension();
|
||||
}
|
||||
@@ -36,5 +36,10 @@ public class BotaniaPlayerController extends PlayerControllerMP implements IExte
|
||||
public void setReachDistanceExtension(float f) {
|
||||
distance = f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getReachDistanceExtension() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class ClientProxy extends CommonProxy {
|
||||
mc.playerController = controller;
|
||||
}
|
||||
|
||||
((IExtendedPlayerController) mc.playerController).setReachDistanceExtension(reach);
|
||||
((IExtendedPlayerController) mc.playerController).setReachDistanceExtension(((IExtendedPlayerController) mc.playerController).getReachDistanceExtension() + reach);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class CommonProxy {
|
||||
|
||||
public void setExtraReach(EntityLivingBase entity, float reach) {
|
||||
if(entity instanceof EntityPlayerMP)
|
||||
((EntityPlayerMP) entity).theItemInWorldManager.setBlockReachDistance(5.0 + reach);
|
||||
((EntityPlayerMP) entity).theItemInWorldManager.setBlockReachDistance(((EntityPlayerMP) entity).theItemInWorldManager.getBlockReachDistance() + reach);
|
||||
}
|
||||
|
||||
public long getWorldElapsedTicks() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemReachRing extends ItemBauble {
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
Botania.proxy.setExtraReach(player, 0F);
|
||||
Botania.proxy.setExtraReach(player, -3.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user