1111import eu .ha3 .presencefootsteps .config .EntitySelector ;
1212import eu .ha3 .presencefootsteps .config .VolumeOption ;
1313import eu .ha3 .presencefootsteps .sound .generator .Locomotion ;
14- import net .minecraft .entity .EntityType ;
15- import net .minecraft .registry .Registries ;
16- import net .minecraft .util .Identifier ;
17- import net .minecraft .util .crash .CrashReportSection ;
18- import net .minecraft .util .math .MathHelper ;
14+ import net .minecraft .CrashReportCategory ;
15+ import net .minecraft .resources .Identifier ;
16+ import net .minecraft .util .Mth ;
17+ import net .minecraft .world .entity .EntityType ;
1918
2019public class PFConfig extends Config {
2120
@@ -81,9 +80,9 @@ public class PFConfig extends Config {
8180 .addComment ("Default: ALL" );
8281
8382 public final Setting <Set <Identifier >> ignoredEntityTypes = this .<Identifier , Set <Identifier >>value ("compatibility" , "ignoredEntityTypes" , () -> new HashSet <Identifier >(Set .of (
84- Identifier .ofVanilla ("ghast" ),
85- Identifier .ofVanilla ("happy_ghast" ),
86- Identifier .ofVanilla ("phantom" )
83+ Identifier .withDefaultNamespace ("ghast" ),
84+ Identifier .withDefaultNamespace ("happy_ghast" ),
85+ Identifier .withDefaultNamespace ("phantom" )
8786 )), Identifier .class )
8887 .addComment ("A list of entity type for any types of mobs that should never produce footsteps. Usually should be any flying 'bird' mobs." )
8988 .addComment ("Default: minecraft:ghast, minecraft:happy_ghast, minecraft:phantom" );
@@ -93,7 +92,7 @@ public class PFConfig extends Config {
9392
9493 public PFConfig (Path file , PresenceFootsteps pf ) {
9594 super (new HeirarchicalJsonConfigAdapter (new GsonBuilder ()
96- .registerTypeAdapter (Identifier .class , new ToStringAdapter <>(Identifier ::toString , Identifier ::of ))
95+ .registerTypeAdapter (Identifier .class , new ToStringAdapter <>(Identifier ::toString , Identifier ::parse ))
9796 ), file );
9897 this .pf = pf ;
9998 }
@@ -106,7 +105,7 @@ public boolean toggleMultiplayer() {
106105 }
107106
108107 public boolean isIgnoredForFootsteps (EntityType <?> type ) {
109- return this .ignoredEntityTypes .get ().contains (Registries . ENTITY_TYPE . getId (type ));
108+ return this .ignoredEntityTypes .get ().contains (EntityType . getKey (type ));
110109 }
111110
112111 public EntitySelector cycleTargetSelector () {
@@ -191,11 +190,11 @@ public boolean getEnabled() {
191190 }
192191
193192 public int getGlobalVolume () {
194- return MathHelper .clamp (volume .get (), 0 , 100 );
193+ return Mth .clamp (volume .get (), 0 , 100 );
195194 }
196195
197196 public int getRunningVolumeIncrease () {
198- return MathHelper .clamp (runningVolumeIncrease .get (), -100 , 100 );
197+ return Mth .clamp (runningVolumeIncrease .get (), -100 , 100 );
199198 }
200199
201200 public float setGlobalVolume (float volume ) {
@@ -221,13 +220,13 @@ public float setRunningVolumeIncrease(float volume) {
221220 return getRunningVolumeIncrease ();
222221 }
223222
224- public void populateCrashReport (CrashReportSection section ) {
225- section .add ("Disabled" , getDisabled ());
226- section .add ("Global Volume" , volume .get ());
227- section .add ("User's Selected Stance" , getLocomotion ());
228- section .add ("Target Selector" , getEntitySelector ());
229- section .add ("Enabled Global" , global .get ());
230- section .add ("Enabled Multiplayer" , multiplayer .get ());
223+ public void populateCrashReport (CrashReportCategory section ) {
224+ section .setDetail ("Disabled" , getDisabled ());
225+ section .setDetail ("Global Volume" , volume .get ());
226+ section .setDetail ("User's Selected Stance" , getLocomotion ());
227+ section .setDetail ("Target Selector" , getEntitySelector ());
228+ section .setDetail ("Enabled Global" , global .get ());
229+ section .setDetail ("Enabled Multiplayer" , multiplayer .get ());
231230 }
232231
233232 private static int volumeScaleToInt (float volume ) {
0 commit comments