1515import net .minecraft .core .Direction ;
1616import net .minecraft .core .registries .BuiltInRegistries ;
1717import net .minecraft .network .protocol .game .ServerboundPlayerActionPacket ;
18- import net .minecraft .resources .Identifier ;
18+ import net .minecraft .resources .ResourceLocation ;
1919import net .minecraft .world .InteractionHand ;
20- import net .minecraft .world .attribute .EnvironmentAttributes ;
20+ // import net.minecraft.world.attribute.EnvironmentAttributes; // Removed
2121import net .minecraft .world .effect .MobEffect ;
2222import net .minecraft .world .item .Item ;
2323import net .minecraft .world .item .ItemStack ;
@@ -83,15 +83,15 @@ public class AutoExtinguish extends Module {
8383 private BlockPos blockPos = null ;
8484 private boolean doesWaterBucketWork = true ;
8585
86- private static final MobEffect FIRE_RESISTANCE = BuiltInRegistries .MOB_EFFECT .getValue ( Identifier . parse ("fire_resistance" ));
86+ private static final MobEffect FIRE_RESISTANCE = BuiltInRegistries .MOB_EFFECT .get ( net . minecraft . resources . ResourceLocation . parse ("fire_resistance" )). get (). value ( );
8787
8888 public AutoExtinguish () {
8989 super (MeteorRejectsAddon .CATEGORY , "auto-extinguish" , "Automatically extinguishes fire around you" );
9090 }
9191
9292 @ EventHandler
9393 private void onTick (TickEvent .Pre event ) {
94- if (mc .level .dimensionType ().attributes (). applyModifier ( EnvironmentAttributes . RESPAWN_ANCHOR_WORKS , false )) {
94+ if (mc .level .dimensionType ().respawnAnchorWorks ( )) {
9595 if (doesWaterBucketWork ) {
9696 warning ("Water Buckets don't work in this dimension!" );
9797 doesWaterBucketWork = false ;
@@ -118,8 +118,8 @@ private void onTick(TickEvent.Pre event) {
118118 blockPos = mc .player .blockPosition ();
119119 final int slot = findSlot (Items .WATER_BUCKET );
120120 if (mc .level .getBlockState (blockPos ).getBlock () == Blocks .FIRE || mc .level .getBlockState (blockPos ).getBlock () == Blocks .SOUL_FIRE ) {
121- float yaw = mc .gameRenderer .getMainCamera ().yRot () % 360 ;
122- float pitch = mc .gameRenderer .getMainCamera ().xRot () % 360 ;
121+ float yaw = mc .gameRenderer .getMainCamera ().getYRot () % 360 ;
122+ float pitch = mc .gameRenderer .getMainCamera ().getXRot () % 360 ;
123123 if (center .get ()) {
124124 PlayerUtils .centerPlayer ();
125125 }
@@ -155,8 +155,8 @@ private void place(int slot) {
155155 PlayerUtils .centerPlayer ();
156156 }
157157 mc .player .getInventory ().setSelectedSlot (slot );
158- float yaw = mc .gameRenderer .getMainCamera ().yRot () % 360 ;
159- float pitch = mc .gameRenderer .getMainCamera ().xRot () % 360 ;
158+ float yaw = mc .gameRenderer .getMainCamera ().getYRot () % 360 ;
159+ float pitch = mc .gameRenderer .getMainCamera ().getXRot () % 360 ;
160160
161161 Rotations .rotate (yaw , 90 );
162162 mc .gameMode .useItem (mc .player , InteractionHand .MAIN_HAND );
0 commit comments