Skip to content

Commit bb0a85d

Browse files
committed
format everything
1 parent 270adae commit bb0a85d

File tree

576 files changed

+15209
-10099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

576 files changed

+15209
-10099
lines changed

Common/src/main/java/at/petrak/hexcasting/annotations/SoftImplement.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,18 @@
99
// yoinky sploinky
1010

1111
/**
12-
* A purely-documentative annotation.
13-
* This annotation is used by developers in xplat code. The annotated method is intended
14-
* to "soft implement" a certain method in a loader specific interface that cannot be
15-
* named in xplat code and thus cannot be checked with @Override.
16-
* In this context, "soft implement" means to implement the method by matching the signature
17-
* with the intended interface method.
18-
* Examples of interfaces that we would use this for is IForgeItem or FabricItem.
19-
* <p>
20-
* The intent is that we audit such sites every major Minecraft version or so, to ensure
21-
* that they still properly override the intended target.
12+
* A purely-documentative annotation. This annotation is used by developers in xplat code. The
13+
* annotated method is intended to "soft implement" a certain method in a loader specific interface
14+
* that cannot be named in xplat code and thus cannot be checked with @Override. In this context,
15+
* "soft implement" means to implement the method by matching the signature with the intended
16+
* interface method. Examples of interfaces that we would use this for is IForgeItem or FabricItem.
17+
*
18+
* <p>The intent is that we audit such sites every major Minecraft version or so, to ensure that
19+
* they still properly override the intended target.
2220
*/
2321
@Retention(RetentionPolicy.SOURCE)
2422
@Target(ElementType.METHOD)
2523
public @interface SoftImplement {
26-
/**
27-
* What interface we're soft implementing
28-
*/
24+
/** What interface we're soft implementing */
2925
String value();
3026
}

Common/src/main/java/at/petrak/hexcasting/api/HexAPI.java

Lines changed: 94 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import at.petrak.hexcasting.api.pigment.FrozenPigment;
77
import at.petrak.hexcasting.api.player.Sentinel;
88
import at.petrak.hexcasting.xplat.IXplatAbstractions;
9+
910
import com.google.common.base.Suppliers;
11+
1012
import net.minecraft.ChatFormatting;
1113
import net.minecraft.network.chat.Component;
1214
import net.minecraft.resources.ResourceKey;
@@ -16,14 +18,14 @@
1618
import net.minecraft.sounds.SoundEvents;
1719
import net.minecraft.world.entity.Entity;
1820
import net.minecraft.world.entity.EntityType;
19-
import net.minecraft.world.entity.EquipmentSlot;
2021
import net.minecraft.world.entity.Mob;
2122
import net.minecraft.world.entity.player.Player;
2223
import net.minecraft.world.item.ArmorItem;
2324
import net.minecraft.world.item.ArmorMaterial;
2425
import net.minecraft.world.item.ItemStack;
2526
import net.minecraft.world.item.crafting.Ingredient;
2627
import net.minecraft.world.phys.Vec3;
28+
2729
import org.apache.logging.log4j.LogManager;
2830
import org.apache.logging.log4j.Logger;
2931
import org.jetbrains.annotations.NotNull;
@@ -36,23 +38,27 @@ public interface HexAPI {
3638
String MOD_ID = "hexcasting";
3739
Logger LOGGER = LogManager.getLogger(MOD_ID);
3840

39-
Supplier<HexAPI> INSTANCE = Suppliers.memoize(() -> {
40-
try {
41-
return (HexAPI) Class.forName("at.petrak.hexcasting.common.impl.HexAPIImpl")
42-
.getDeclaredConstructor().newInstance();
43-
} catch (ReflectiveOperationException e) {
44-
LogManager.getLogger().warn("Unable to find HexAPIImpl, using a dummy");
45-
return new HexAPI() {
46-
};
47-
}
48-
});
41+
Supplier<HexAPI> INSTANCE =
42+
Suppliers.memoize(
43+
() -> {
44+
try {
45+
return (HexAPI)
46+
Class.forName("at.petrak.hexcasting.common.impl.HexAPIImpl")
47+
.getDeclaredConstructor()
48+
.newInstance();
49+
} catch (ReflectiveOperationException e) {
50+
LogManager.getLogger().warn("Unable to find HexAPIImpl, using a dummy");
51+
return new HexAPI() {};
52+
}
53+
});
4954

5055
/**
5156
* Return the localization key for the given action.
52-
* <p>
53-
* Note we're allowed to have action <em>resource keys</em> on the client, just no actual actions.
54-
* <p>
55-
* Special handlers should be calling {@link SpecialHandler#getName()}
57+
*
58+
* <p>Note we're allowed to have action <em>resource keys</em> on the client, just no actual
59+
* actions.
60+
*
61+
* <p>Special handlers should be calling {@link SpecialHandler#getName()}
5662
*/
5763
default String getActionI18nKey(ResourceKey<ActionRegistryEntry> action) {
5864
return "hexcasting.action.%s".formatted(action.location().toString());
@@ -63,37 +69,40 @@ default String getSpecialHandlerI18nKey(ResourceKey<SpecialHandler.Factory<?>> a
6369
}
6470

6571
/**
66-
* Currently introspection/retrospection/consideration are hardcoded, but at least their names won't be
72+
* Currently introspection/retrospection/consideration are hardcoded, but at least their names
73+
* won't be
6774
*/
6875
default String getRawHookI18nKey(ResourceLocation name) {
6976
return "hexcasting.rawhook.%s".formatted(name);
7077
}
7178

7279
default Component getActionI18n(ResourceKey<ActionRegistryEntry> key, boolean isGreat) {
7380
return Component.translatable(getActionI18nKey(key))
74-
.withStyle(isGreat ? ChatFormatting.GOLD : ChatFormatting.LIGHT_PURPLE);
81+
.withStyle(isGreat ? ChatFormatting.GOLD : ChatFormatting.LIGHT_PURPLE);
7582
}
7683

7784
default Component getSpecialHandlerI18n(ResourceKey<SpecialHandler.Factory<?>> key) {
7885
return Component.translatable(getSpecialHandlerI18nKey(key))
79-
.withStyle(ChatFormatting.LIGHT_PURPLE);
86+
.withStyle(ChatFormatting.LIGHT_PURPLE);
8087
}
8188

8289
default Component getRawHookI18n(ResourceLocation name) {
83-
return Component.translatable(getRawHookI18nKey(name)).withStyle(ChatFormatting.LIGHT_PURPLE);
90+
return Component.translatable(getRawHookI18nKey(name))
91+
.withStyle(ChatFormatting.LIGHT_PURPLE);
8492
}
8593

8694
/**
87-
* Register an entity with the given ID to have its velocity as perceived by OpEntityVelocity be different
88-
* than it's "normal" velocity
95+
* Register an entity with the given ID to have its velocity as perceived by OpEntityVelocity be
96+
* different than it's "normal" velocity
8997
*/
9098
// Should be OK to use the type directly as the key as they're singleton identity objects
91-
default <T extends Entity> void registerSpecialVelocityGetter(EntityType<T> key, EntityVelocityGetter<T> getter) {
92-
}
99+
default <T extends Entity> void registerSpecialVelocityGetter(
100+
EntityType<T> key, EntityVelocityGetter<T> getter) {}
93101

94102
/**
95-
* If the entity has had a special getter registered with {@link HexAPI#registerSpecialVelocityGetter} then
96-
* return that, otherwise return its normal delta movement
103+
* If the entity has had a special getter registered with {@link
104+
* HexAPI#registerSpecialVelocityGetter} then return that, otherwise return its normal delta
105+
* movement
97106
*/
98107
default Vec3 getEntityVelocitySpecial(Entity entity) {
99108
return entity.getDeltaMovement();
@@ -106,36 +115,34 @@ interface EntityVelocityGetter<T extends Entity> {
106115

107116
/**
108117
* Register an entity type to have a custom behavior when getting brainswept.
109-
* <p>
110-
* This knocks out the normal behavior; if you want that behavior you should call
118+
*
119+
* <p>This knocks out the normal behavior; if you want that behavior you should call
111120
*/
112-
default <T extends Mob> void registerCustomBrainsweepingBehavior(EntityType<T> key, Consumer<T> hook) {
113-
}
121+
default <T extends Mob> void registerCustomBrainsweepingBehavior(
122+
EntityType<T> key, Consumer<T> hook) {}
114123

115124
/**
116125
* The default behavior when an entity gets brainswept.
117-
* <p>
118-
* Something registered with {@link HexAPI#registerCustomBrainsweepingBehavior} doesn't call this automatically;
119-
* you can use this to add things on top of the default behavior
126+
*
127+
* <p>Something registered with {@link HexAPI#registerCustomBrainsweepingBehavior} doesn't call
128+
* this automatically; you can use this to add things on top of the default behavior
120129
*/
121130
default Consumer<Mob> defaultBrainsweepingBehavior() {
122-
return mob -> {
123-
};
131+
return mob -> {};
124132
}
125133

126134
/**
127-
* If something special's been returned with {@link HexAPI#registerCustomBrainsweepingBehavior}, return that,
128-
* otherwise return the default behavior
135+
* If something special's been returned with {@link HexAPI#registerCustomBrainsweepingBehavior},
136+
* return that, otherwise return the default behavior
129137
*/
130138
default <T extends Mob> Consumer<T> getBrainsweepBehavior(EntityType<T> mobType) {
131-
return mob -> {
132-
};
139+
return mob -> {};
133140
}
134141

135142
/**
136143
* Brainsweep (flay the mind of) the given mob.
137-
* <p>
138-
* This ignores the unbrainsweepable tag.
144+
*
145+
* <p>This ignores the unbrainsweepable tag.
139146
*/
140147
default void brainsweep(Mob mob) {
141148
var type = (EntityType<? extends Mob>) mob.getType();
@@ -165,61 +172,59 @@ default FrozenPigment getColorizer(Player player) {
165172
return FrozenPigment.DEFAULT.get();
166173
}
167174

168-
ArmorMaterial DUMMY_ARMOR_MATERIAL = new ArmorMaterial() {
169-
@Override
170-
public int getDurabilityForType(ArmorItem.Type type) {
171-
return 0;
172-
}
173-
174-
@Override
175-
public int getDefenseForType(ArmorItem.Type type) {
176-
return 0;
177-
}
178-
179-
@Override
180-
public int getEnchantmentValue() {
181-
return 0;
182-
}
183-
184-
@NotNull
185-
@Override
186-
public SoundEvent getEquipSound() {
187-
return SoundEvents.ARMOR_EQUIP_LEATHER;
188-
}
189-
190-
@NotNull
191-
@Override
192-
public Ingredient getRepairIngredient() {
193-
return Ingredient.EMPTY;
194-
}
195-
196-
@Override
197-
public String getName() {
198-
return "missingno";
199-
}
200-
201-
@Override
202-
public float getToughness() {
203-
return 0;
204-
}
205-
206-
@Override
207-
public float getKnockbackResistance() {
208-
return 0;
209-
}
210-
};
175+
ArmorMaterial DUMMY_ARMOR_MATERIAL =
176+
new ArmorMaterial() {
177+
@Override
178+
public int getDurabilityForType(ArmorItem.Type type) {
179+
return 0;
180+
}
181+
182+
@Override
183+
public int getDefenseForType(ArmorItem.Type type) {
184+
return 0;
185+
}
186+
187+
@Override
188+
public int getEnchantmentValue() {
189+
return 0;
190+
}
191+
192+
@NotNull
193+
@Override
194+
public SoundEvent getEquipSound() {
195+
return SoundEvents.ARMOR_EQUIP_LEATHER;
196+
}
197+
198+
@NotNull
199+
@Override
200+
public Ingredient getRepairIngredient() {
201+
return Ingredient.EMPTY;
202+
}
203+
204+
@Override
205+
public String getName() {
206+
return "missingno";
207+
}
208+
209+
@Override
210+
public float getToughness() {
211+
return 0;
212+
}
213+
214+
@Override
215+
public float getKnockbackResistance() {
216+
return 0;
217+
}
218+
};
211219

212220
default ArmorMaterial robesMaterial() {
213221
return DUMMY_ARMOR_MATERIAL;
214222
}
215223

216-
/**
217-
* Location in the userdata of the ravenmind
218-
*/
224+
/** Location in the userdata of the ravenmind */
219225
String RAVENMIND_USERDATA = modLoc("ravenmind").toString();
220-
/**
221-
* Location in the userdata of the number of ops executed
222-
*/
226+
227+
/** Location in the userdata of the number of ops executed */
223228
String OP_COUNT_USERDATA = modLoc("op_count").toString();
224229

225230
String MARKED_MOVED_USERDATA = modLoc("impulsed").toString();

Common/src/main/java/at/petrak/hexcasting/api/addldata/ADHexHolder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import at.petrak.hexcasting.api.casting.iota.Iota;
44
import at.petrak.hexcasting.api.pigment.FrozenPigment;
5+
56
import net.minecraft.server.level.ServerLevel;
7+
68
import org.jetbrains.annotations.Nullable;
79

810
import java.util.List;
@@ -20,5 +22,6 @@ public interface ADHexHolder {
2022

2123
void clearHex();
2224

23-
@Nullable FrozenPigment getPigment();
25+
@Nullable
26+
FrozenPigment getPigment();
2427
}

Common/src/main/java/at/petrak/hexcasting/api/addldata/ADIotaHolder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import at.petrak.hexcasting.api.casting.iota.Iota;
44
import at.petrak.hexcasting.api.casting.iota.IotaType;
5+
56
import net.minecraft.nbt.CompoundTag;
67
import net.minecraft.server.level.ServerLevel;
8+
79
import org.jetbrains.annotations.Nullable;
810

911
public interface ADIotaHolder {

0 commit comments

Comments
 (0)