File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1212#include < mc/world/level/BlockSource.h>
1313
1414// /////////////////// Enum //////////////////////
15- ClassDefine<void > DamageCauseEnumBuilder = EnumDefineBuilder<ActorDamageCause>::build(" DamageCause" );
15+ ClassDefine<void > DamageCauseEnumBuilder =
16+ EnumDefineBuilder<SharedTypes::Legacy::ActorDamageCause>::build(" DamageCause" );
1617// For compatibility
17- ClassDefine<void > ActorDamageCauseEnumBuilder = EnumDefineBuilder<ActorDamageCause>::build(" ActorDamageCause" );
18+ ClassDefine<void > ActorDamageCauseEnumBuilder =
19+ EnumDefineBuilder<SharedTypes::Legacy::ActorDamageCause>::build(" ActorDamageCause" );
1820
1921// ////////////////// Class Definition ////////////////////
2022
@@ -181,7 +183,13 @@ Local<Value> DirectionAngle::toString() {
181183
182184Local<Value> DirectionAngle::toFacing () {
183185 int facing = -1 ;
184- switch (Facing::convertYRotationToFacingDirection (yaw)) {
186+ // Facing::convertYRotationToFacingDirection
187+ float value = yaw * 0 .011111111f + 0 .5f ;
188+ int result = static_cast <int >(value) - 1 ;
189+ if (static_cast <float >(static_cast <int >(value)) <= value) {
190+ result = static_cast <int >(value);
191+ }
192+ switch (result) {
185193 case 2 :
186194 facing = 0 ;
187195 break ;
You can’t perform that action at this time.
0 commit comments