@@ -46,6 +46,7 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack item) {
4646
4747 NBTTagCompound data = GTUtility .getOrCreateNbtCompound (item );
4848 boolean hoverMode = data .hasKey ("hover" ) && data .getBoolean ("hover" );
49+ boolean cancelInertiaMode = data .hasKey ("cancelInertia" ) && data .getBoolean ("cancelInertia" );
4950 byte toggleTimer = data .hasKey ("toggleTimer" ) ? data .getByte ("toggleTimer" ) : 0 ;
5051 boolean canShare = data .hasKey ("canShare" ) && data .getBoolean ("canShare" );
5152
@@ -61,6 +62,20 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack item) {
6162 }
6263 }
6364
65+ if (toggleTimer == 0 && KeyBind .ARMOR_CANCEL_INERTIA .isKeyDown (player )) {
66+ cancelInertiaMode = !cancelInertiaMode ;
67+ toggleTimer = 5 ;
68+ data .setBoolean ("cancelInertia" , cancelInertiaMode );
69+ if (!world .isRemote ) {
70+ if (cancelInertiaMode )
71+ player .sendStatusMessage (new TextComponentTranslation ("metaarmor.jetpack.cancel_inertia.enable" ),
72+ true );
73+ else
74+ player .sendStatusMessage (new TextComponentTranslation ("metaarmor.jetpack.cancel_inertia.disable" ),
75+ true );
76+ }
77+ }
78+
6479 if (toggleTimer == 0 && KeyBind .ARMOR_CHARGING .isKeyDown (player )) {
6580 canShare = !canShare ;
6681 toggleTimer = 5 ;
@@ -78,7 +93,7 @@ else if (canShare)
7893 data .setBoolean ("canShare" , canShare );
7994 }
8095
81- performFlying (player , hoverMode , item );
96+ performFlying (player , hoverMode , cancelInertiaMode , item );
8297
8398 if (player .isBurning ())
8499 player .extinguish ();
@@ -130,6 +145,7 @@ else if (canShare)
130145 if (toggleTimer > 0 ) toggleTimer --;
131146
132147 data .setBoolean ("canShare" , canShare );
148+ data .setBoolean ("cancelInertia" , cancelInertiaMode );
133149 data .setBoolean ("hover" , hoverMode );
134150 data .setByte ("toggleTimer" , toggleTimer );
135151 player .inventoryContainer .detectAndSendChanges ();
@@ -157,6 +173,11 @@ public void addInfo(ItemStack itemStack, List<String> lines) {
157173 status = I18n .format ("metaarmor.hud.status.enabled" );
158174 }
159175 lines .add (I18n .format ("metaarmor.hud.hover_mode" , status ));
176+ if (data .hasKey ("cancelInertia" )) {
177+ if (data .getBoolean ("cancelInertia" ))
178+ status = I18n .format ("metaarmor.hud.status.enabled" );
179+ }
180+ lines .add (I18n .format ("metaarmor.hud.cancel_inertia_mode" , status ));
160181 super .addInfo (itemStack , lines );
161182 }
162183
@@ -210,6 +231,12 @@ public void drawHUD(ItemStack item) {
210231 "metaarmor.hud.status.disabled" ;
211232 this .HUD .newString (I18n .format ("metaarmor.hud.hover_mode" , I18n .format (status )));
212233 }
234+
235+ if (data .hasKey ("cancelInertia" )) {
236+ String status = data .getBoolean ("cancelInertia" ) ? "metaarmor.hud.status.enabled" :
237+ "metaarmor.hud.status.disabled" ;
238+ this .HUD .newString (I18n .format ("metaarmor.hud.cancel_inertia_mode" , I18n .format (status )));
239+ }
213240 }
214241 this .HUD .draw ();
215242 this .HUD .reset ();
0 commit comments