@@ -42,89 +42,60 @@ public class BlockESP extends Module {
4242
4343 // General
4444
45- private final Setting <List <Block >> blocks = sgGeneral .add (
46- new BlockListSetting .Builder ()
47- .name ("blocks" )
48- .description ("Blocks to search for." )
49- .onChanged (blocks1 -> {
50- if (isActive () && Utils .canUpdate ()) onActivate ();
51- })
52- .build ()
45+ private final Setting <List <Block >> blocks = sgGeneral .add (new BlockListSetting .Builder ()
46+ .name ("blocks" )
47+ .description ("Blocks to search for." )
48+ .onChanged (blocks1 -> {
49+ if (isActive () && Utils .canUpdate ()) onActivate ();
50+ })
51+ .build ()
5352 );
54-
55- // uncomment if NBT-Data should apply to all blocks !!! UNTESTED !!!
56-
57- /*
58- private final Setting<List<String>> customFilters = sgGeneral.add(
59- new StringListSetting.Builder()
60- .name("NTB-Data")
61- .description(
62- "Filters with ntbdata (e.g. 'waterlogged=true')."
53+
54+ private final Setting <ESPBlockData > defaultBlockConfig = sgGeneral .add (new GenericSetting .Builder <ESPBlockData >()
55+ .name ("default-block-config" )
56+ .description ("Default block config." )
57+ .defaultValue (
58+ new ESPBlockData (
59+ ShapeMode .Lines ,
60+ new SettingColor (0 , 255 , 200 ),
61+ new SettingColor (0 , 255 , 200 , 25 ),
62+ true ,
63+ new SettingColor (0 , 255 , 200 , 125 )
6364 )
64- .defaultValue(new ArrayList<>())
65- .onChanged(this::parseFilters)
66- .build()
65+ )
66+ .build ()
6767 );
68- */
69-
70- private final Setting <ESPBlockData > defaultBlockConfig = sgGeneral .add (
71- new GenericSetting .Builder <ESPBlockData >()
72- .name ("default-block-config" )
73- .description ("Default block config." )
74- .defaultValue (
75- new ESPBlockData (
76- ShapeMode .Lines ,
77- new SettingColor (0 , 255 , 200 ),
78- new SettingColor (0 , 255 , 200 , 25 ),
79- true ,
80- new SettingColor (0 , 255 , 200 , 125 )
81- )
82- )
83- .build ()
68+
69+ private final Setting <Map <Block , ESPBlockData >> blockConfigs = sgGeneral .add (new BlockDataSetting .Builder <ESPBlockData >()
70+ .name ("block-configs" )
71+ .description ("Config for each block." )
72+ .defaultData (defaultBlockConfig )
73+ .onChanged (configs -> {
74+ if (isActive () && Utils .canUpdate ()) onActivate ();
75+ })
76+ .build ()
8477 );
8578
86- private final Setting <Map <Block , ESPBlockData >> blockConfigs =
87- sgGeneral .add (
88- new BlockDataSetting .Builder <ESPBlockData >()
89- .name ("block-configs" )
90- .description ("Config for each block." )
91- .defaultData (defaultBlockConfig )
92- .onChanged (configs -> {
93- if (isActive () && Utils .canUpdate ()) onActivate ();
94- })
95- .build ()
96- );
97-
98- private final Setting <Boolean > tracers = sgGeneral .add (
99- new BoolSetting .Builder ()
100- .name ("tracers" )
101- .description ("Render tracer lines." )
102- .defaultValue (false )
103- .build ()
79+ private final Setting <Boolean > tracers = sgGeneral .add (new BoolSetting .Builder ()
80+ .name ("tracers" )
81+ .description ("Render tracer lines." )
82+ .defaultValue (false )
83+ .build ()
10484 );
10585
10686 private final BlockPos .Mutable blockPos = new BlockPos .Mutable ();
10787
108- private final Map <
109- Block ,
110- Map <Property <?>, Comparable <?>>
111- > activeFilterCache = new HashMap <>();
88+ private final Map <Block , Map <Property <?>, Comparable <?>>> activeFilterCache = new HashMap <>();
11289
113- private final Long2ObjectMap <ESPChunk > chunks =
114- new Long2ObjectOpenHashMap <>();
90+ private final Long2ObjectMap <ESPChunk > chunks = new Long2ObjectOpenHashMap <>();
11591 private final Set <ESPGroup > groups = new ReferenceOpenHashSet <>();
116- private final ExecutorService workerThread =
117- Executors .newSingleThreadExecutor ();
92+ private final ExecutorService workerThread = Executors .newSingleThreadExecutor ();
11893
11994 private DimensionType lastDimension ;
12095
12196 public BlockESP () {
122- super (
123- Categories .Render ,
124- "block-esp" ,
125- "Renders specified blocks through walls." ,
126- "search"
127- );
97+ super (Categories .Render , "block-esp" , "Renders specified blocks through walls." , "search" );
98+
12899 RainbowColors .register (this ::onTickRainbow );
129100 }
130101
0 commit comments