Skip to content

[Bug] Turret Shaft Not Extending to Full #170

@ComputerErika

Description

@ComputerErika

Describe the bug
When using the Energy Turret, there is a function called exstendShaft() that gives the description of being able to extend 0 through 2, but when I input a value it only extends up to 0.5.

Is this on purpose and the desc function hasn't been updated?
Or am I just being dumb and missed something?
I have tried to install the movement upgrades but it doesn't seem to work.

I believe it should be able to move this high because setting the pitch with moveTo and in the wiki notes it says it can be set in the range -45 to 90 when assumedly fully extended.

In which environment did the Bug appear?
This appeared in my Singleplayer world

To Reproduce
Connect Energy Turret to Working OC Computer
type "lua" to get to the lua terminal
type "component.os_energyturret.powerOn()"
type "component.os_energyturret.extendShaft" to see desc of 0 through 2
type "component.os_energyturret.extendShaft(2)" (or any number larger than 0.5)
to see it only goes up to 0.5 in what it says in the return value.
Or type "component.os_energyturret.getShaftLength()" to see its only 0.5

Expected behavior
After typing "component.os_energyturret.extendShaft(2)", the rotary shaft of the turret should extend to 2, and by typing "component.os_energyturret.getShaftLength()" I should get 2.
This then gives the ability to set the turret pitch to the full range of -45 through 90

Minecraft:

  • OpenSecurity-1.12.2-1.0-83
  • 1.12.2
  • Forge 14.23.5.2855
  • OptiFine_1.12.2_HD_U_F5, with no shaders

Additional context
I saw in OpenSecurity/src/main/java/pcl/opensecurity/common/tileentity/logic/EnergyTurret.java
that maxShaftLengthForOneBlock = 0.5f and
getMaxAvailableShaftLength(float newExt) { newExt = Math.max(0, Math.min(newExt, 2)); return newExt <= maxShaftLengthForOneBlock /* && canExtendShaft() */ ? newExt : maxShaftLengthForOneBlock; }

which could be the cause or have something to do with it?

Tho for all I know I could be a complete dummy and there's a way to set shaft length to 2 and I am just doing it wrong xD, if so, then sorry on my part

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions