diff --git a/Common/src/main/java/at/petrak/hexcasting/api/misc/ManaConstants.java b/Common/src/main/java/at/petrak/hexcasting/api/misc/ManaConstants.java index 7a2111df..9ae4a8d9 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/misc/ManaConstants.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/misc/ManaConstants.java @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.misc; public final class ManaConstants { - public static final int DUST_UNIT = 10000; - public static final int SHARD_UNIT = 5 * DUST_UNIT; - public static final int CRYSTAL_UNIT = 10 * DUST_UNIT; + public static final int DUST_UNIT = 10000; + public static final int SHARD_UNIT = 5 * DUST_UNIT; + public static final int CRYSTAL_UNIT = 10 * DUST_UNIT; } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/misc/ScrollQuantity.java b/Common/src/main/java/at/petrak/hexcasting/api/misc/ScrollQuantity.java index 31ec39f9..bc262ea3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/misc/ScrollQuantity.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/misc/ScrollQuantity.java @@ -6,19 +6,19 @@ import org.jetbrains.annotations.Nullable; import static at.petrak.hexcasting.api.HexAPI.modLoc; public enum ScrollQuantity { - NONE(null), - FEW(modLoc("inject/scroll_loot_few")), - SOME(modLoc("inject/scroll_loot_some")), - MANY(modLoc("inject/scroll_loot_many")); + NONE(null), + FEW(modLoc("inject/scroll_loot_few")), + SOME(modLoc("inject/scroll_loot_some")), + MANY(modLoc("inject/scroll_loot_many")); - private final ResourceLocation pool; + private final ResourceLocation pool; - ScrollQuantity(ResourceLocation pool) { - this.pool = pool; - } + ScrollQuantity(ResourceLocation pool) { + this.pool = pool; + } - @Nullable - public ResourceLocation getPool() { - return pool; - } + @Nullable + public ResourceLocation getPool() { + return pool; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/mod/HexApiMessages.java b/Common/src/main/java/at/petrak/hexcasting/api/mod/HexApiMessages.java index fea08078..44c04c79 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/mod/HexApiMessages.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/mod/HexApiMessages.java @@ -14,38 +14,38 @@ import java.util.function.Function; @ApiStatus.Internal public final class HexApiMessages { - private static SimpleChannel channel; - private static Function sentinelMessage; - private static Function colorizerMessage; - private static BiFunction particleSprayMessage; + private static SimpleChannel channel; + private static Function sentinelMessage; + private static Function colorizerMessage; + private static BiFunction particleSprayMessage; - public static void setSyncChannel(SimpleChannel channel, - Function sentinelMessage, - Function colorizerMessage, - BiFunction particleSprayMessage) { - if (HexApiMessages.channel != null) - throw new IllegalStateException("Already set sync channel! If you're not Hex, you shouldn't be calling this."); - HexApiMessages.channel = channel; - HexApiMessages.sentinelMessage = sentinelMessage; - HexApiMessages.colorizerMessage = colorizerMessage; - HexApiMessages.particleSprayMessage = particleSprayMessage; - } + public static void setSyncChannel(SimpleChannel channel, + Function sentinelMessage, + Function colorizerMessage, + BiFunction particleSprayMessage) { + if (HexApiMessages.channel != null) + throw new IllegalStateException("Already set sync channel! If you're not Hex, you shouldn't be calling this."); + HexApiMessages.channel = channel; + HexApiMessages.sentinelMessage = sentinelMessage; + HexApiMessages.colorizerMessage = colorizerMessage; + HexApiMessages.particleSprayMessage = particleSprayMessage; + } - public static SimpleChannel getChannel() { - return channel; - } + public static SimpleChannel getChannel() { + return channel; + } - public static Object getColorizerMessage(FrozenColorizer colorizer) { - return colorizerMessage.apply(colorizer); - } + public static Object getColorizerMessage(FrozenColorizer colorizer) { + return colorizerMessage.apply(colorizer); + } - public static Object getSentinelMessage(Sentinel colorizer) { - return sentinelMessage.apply(colorizer); - } + public static Object getSentinelMessage(Sentinel colorizer) { + return sentinelMessage.apply(colorizer); + } - public static Object getParticleSprayMessage(ParticleSpray spray, FrozenColorizer colorizer) { - return particleSprayMessage.apply(spray, colorizer); - } + public static Object getParticleSprayMessage(ParticleSpray spray, FrozenColorizer colorizer) { + return particleSprayMessage.apply(spray, colorizer); + } } */ diff --git a/Common/src/main/java/at/petrak/hexcasting/api/player/FlightAbility.java b/Common/src/main/java/at/petrak/hexcasting/api/player/FlightAbility.java index f9925bca..55828a7e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/player/FlightAbility.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/player/FlightAbility.java @@ -5,7 +5,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; public record FlightAbility(boolean allowed, int timeLeft, ResourceKey dimension, Vec3 origin, double radius) { - public static FlightAbility deny() { - return new FlightAbility(false, 0, Level.OVERWORLD, Vec3.ZERO, 0); - } + public static FlightAbility deny() { + return new FlightAbility(false, 0, Level.OVERWORLD, Vec3.ZERO, 0); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/player/Sentinel.java b/Common/src/main/java/at/petrak/hexcasting/api/player/Sentinel.java index 7419d20e..f7cb6274 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/player/Sentinel.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/player/Sentinel.java @@ -5,10 +5,10 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; public record Sentinel(boolean hasSentinel, boolean extendsRange, Vec3 position, - ResourceKey dimension) { - public static Sentinel none() { - return new Sentinel(false, false, Vec3.ZERO, Level.OVERWORLD); - } + ResourceKey dimension) { + public static Sentinel none() { + return new Sentinel(false, false, Vec3.ZERO, Level.OVERWORLD); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/client/shader/FakeBufferSource.java b/Common/src/main/java/at/petrak/hexcasting/client/shader/FakeBufferSource.java index f8356214..2a5443bd 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/shader/FakeBufferSource.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/shader/FakeBufferSource.java @@ -15,18 +15,18 @@ import java.util.function.Function; public record FakeBufferSource(MultiBufferSource parent, Function mapper) implements MultiBufferSource { - @Override - @SuppressWarnings("ConstantConditions") - public @NotNull VertexConsumer getBuffer(@NotNull RenderType renderType) { - if (((AccessorRenderStateShard) renderType).hex$name().equals("entity_cutout_no_cull") - && renderType instanceof RenderType.CompositeRenderType) { - RenderType.CompositeState state = ((AccessorCompositeRenderType) renderType).hex$state(); - RenderStateShard.EmptyTextureStateShard shard = state.textureState; - Optional texture = ((AccessorEmptyTextureStateShard) shard).hex$cutoutTexture(); - if (texture.isPresent()) { - return parent.getBuffer(mapper.apply(texture.get())); - } - } - return parent.getBuffer(renderType); - } + @Override + @SuppressWarnings("ConstantConditions") + public @NotNull VertexConsumer getBuffer(@NotNull RenderType renderType) { + if (((AccessorRenderStateShard) renderType).hex$name().equals("entity_cutout_no_cull") + && renderType instanceof RenderType.CompositeRenderType) { + RenderType.CompositeState state = ((AccessorCompositeRenderType) renderType).hex$state(); + RenderStateShard.EmptyTextureStateShard shard = state.textureState; + Optional texture = ((AccessorEmptyTextureStateShard) shard).hex$cutoutTexture(); + if (texture.isPresent()) { + return parent.getBuffer(mapper.apply(texture.get())); + } + } + return parent.getBuffer(renderType); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/client/shader/HexRenderTypes.java b/Common/src/main/java/at/petrak/hexcasting/client/shader/HexRenderTypes.java index 7b0ae7f1..57244037 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/shader/HexRenderTypes.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/shader/HexRenderTypes.java @@ -13,31 +13,31 @@ import java.util.function.Function; // https://github.com/VazkiiMods/Botania/blob/3a43accc2fbc439c9f2f00a698f8f8ad017503db/Common/src/main/java/vazkii/botania/client/core/helper/RenderHelper.java public final class HexRenderTypes extends RenderType { - private HexRenderTypes(String string, VertexFormat vertexFormat, VertexFormat.Mode mode, int i, boolean bl, boolean bl2, Runnable runnable, Runnable runnable2) { - super(string, vertexFormat, mode, i, bl, bl2, runnable, runnable2); - throw new UnsupportedOperationException("Should not be instantiated"); - } + private HexRenderTypes(String string, VertexFormat vertexFormat, VertexFormat.Mode mode, int i, boolean bl, boolean bl2, Runnable runnable, Runnable runnable2) { + super(string, vertexFormat, mode, i, bl, bl2, runnable, runnable2); + throw new UnsupportedOperationException("Should not be instantiated"); + } - private static RenderType makeLayer(String name, VertexFormat format, VertexFormat.Mode mode, - int bufSize, boolean hasCrumbling, boolean sortOnUpload, RenderType.CompositeState glState) { - return AccessorRenderType.hex$create(name, format, mode, bufSize, hasCrumbling, sortOnUpload, glState); - } + private static RenderType makeLayer(String name, VertexFormat format, VertexFormat.Mode mode, + int bufSize, boolean hasCrumbling, boolean sortOnUpload, RenderType.CompositeState glState) { + return AccessorRenderType.hex$create(name, format, mode, bufSize, hasCrumbling, sortOnUpload, glState); + } - private static final Function GRAYSCALE_PROVIDER = Util.memoize(texture -> { - CompositeState glState = RenderType.CompositeState.builder() - .setShaderState(new ShaderStateShard(HexShaders::grayscale)) - .setTextureState(new TextureStateShard(texture, false, false)) - .setTransparencyState(NO_TRANSPARENCY) - .setCullState(NO_CULL) - .setLightmapState(LIGHTMAP) - .setOverlayState(OVERLAY) - .createCompositeState(true); + private static final Function GRAYSCALE_PROVIDER = Util.memoize(texture -> { + CompositeState glState = RenderType.CompositeState.builder() + .setShaderState(new ShaderStateShard(HexShaders::grayscale)) + .setTextureState(new TextureStateShard(texture, false, false)) + .setTransparencyState(NO_TRANSPARENCY) + .setCullState(NO_CULL) + .setLightmapState(LIGHTMAP) + .setOverlayState(OVERLAY) + .createCompositeState(true); - return makeLayer(HexAPI.MOD_ID + ":grayscale", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, false, glState); - }); + return makeLayer(HexAPI.MOD_ID + ":grayscale", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, false, glState); + }); - public static RenderType getGrayscaleLayer(ResourceLocation texture) { - return GRAYSCALE_PROVIDER.apply(texture); - } + public static RenderType getGrayscaleLayer(ResourceLocation texture) { + return GRAYSCALE_PROVIDER.apply(texture); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/client/shader/HexShaders.java b/Common/src/main/java/at/petrak/hexcasting/client/shader/HexShaders.java index d55c48a4..e0f3f39d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/shader/HexShaders.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/shader/HexShaders.java @@ -10,16 +10,16 @@ import java.util.function.Consumer; // https://github.com/VazkiiMods/Botania/blob/3a43accc2fbc439c9f2f00a698f8f8ad017503db/Common/src/main/java/vazkii/botania/client/core/helper/CoreShaders.java public class HexShaders { - private static ShaderInstance grayscale; - public static void init(ResourceManager resourceManager, - Consumer>> registrations) throws IOException { - registrations.accept(Pair.of( - new ShaderInstance(resourceManager, "hexcasting__grayscale", DefaultVertexFormat.NEW_ENTITY), - inst -> grayscale = inst) - ); - } + private static ShaderInstance grayscale; + public static void init(ResourceManager resourceManager, + Consumer>> registrations) throws IOException { + registrations.accept(Pair.of( + new ShaderInstance(resourceManager, "hexcasting__grayscale", DefaultVertexFormat.NEW_ENTITY), + inst -> grayscale = inst) + ); + } - public static ShaderInstance grayscale() { - return grayscale; - } + public static ShaderInstance grayscale() { + return grayscale; + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/misc/PlayerPositionRecorder.java b/Common/src/main/java/at/petrak/hexcasting/common/misc/PlayerPositionRecorder.java index 7dd9650b..60099917 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/misc/PlayerPositionRecorder.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/misc/PlayerPositionRecorder.java @@ -9,28 +9,28 @@ import java.util.Map; import java.util.WeakHashMap; public final class PlayerPositionRecorder { - private static final Map LAST_SECOND_POSITION_MAP = new WeakHashMap<>(); - private static final Map LAST_POSITION_MAP = new WeakHashMap<>(); + private static final Map LAST_SECOND_POSITION_MAP = new WeakHashMap<>(); + private static final Map LAST_POSITION_MAP = new WeakHashMap<>(); - public static void updateAllPlayers(ServerLevel world) { - for (ServerPlayer player : world.players()) { - var prev = LAST_POSITION_MAP.get(player); - if (prev != null) - LAST_SECOND_POSITION_MAP.put(player, prev); - LAST_POSITION_MAP.put(player, player.position()); - } - } + public static void updateAllPlayers(ServerLevel world) { + for (ServerPlayer player : world.players()) { + var prev = LAST_POSITION_MAP.get(player); + if (prev != null) + LAST_SECOND_POSITION_MAP.put(player, prev); + LAST_POSITION_MAP.put(player, player.position()); + } + } - public static Vec3 getMotion(ServerPlayer player) { - Vec3 vec = LAST_POSITION_MAP.get(player); - Vec3 prev = LAST_SECOND_POSITION_MAP.get(player); + public static Vec3 getMotion(ServerPlayer player) { + Vec3 vec = LAST_POSITION_MAP.get(player); + Vec3 prev = LAST_SECOND_POSITION_MAP.get(player); - if (vec == null) - return Vec3.ZERO; + if (vec == null) + return Vec3.ZERO; - if (prev == null) - return player.position().subtract(vec); + if (prev == null) + return player.position().subtract(vec); - return vec.subtract(prev); - } + return vec.subtract(prev); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/interop/patchouli/ManualPatternComponent.java b/Common/src/main/java/at/petrak/hexcasting/interop/patchouli/ManualPatternComponent.java index ba6f8b05..fa97bcd6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/interop/patchouli/ManualPatternComponent.java +++ b/Common/src/main/java/at/petrak/hexcasting/interop/patchouli/ManualPatternComponent.java @@ -25,7 +25,7 @@ public class ManualPatternComponent extends AbstractPatternComponent { protected transient boolean strokeOrder; @Override - public List> getPatterns(UnaryOperator lookup) { + public List> getPatterns(UnaryOperator lookup) { this.strokeOrder = lookup.apply(IVariable.wrap(this.strokeOrderRaw)).asBoolean(true); var patsRaw = lookup.apply(IVariable.wrap(patternsRaw)).asListOrSingleton(); diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/AccessorVillager.java b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/AccessorVillager.java index 997e58fc..dc036024 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/AccessorVillager.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/AccessorVillager.java @@ -7,9 +7,9 @@ import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(Villager.class) public interface AccessorVillager { - @Invoker("tellWitnessesThatIWasMurdered") - void hex$tellWitnessesThatIWasMurdered(Entity murderer); + @Invoker("tellWitnessesThatIWasMurdered") + void hex$tellWitnessesThatIWasMurdered(Entity murderer); - @Invoker("releaseAllPois") - void hex$releaseAllPois(); + @Invoker("releaseAllPois") + void hex$releaseAllPois(); } diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorCompositeRenderType.java b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorCompositeRenderType.java index f23f5087..c7965fd5 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorCompositeRenderType.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorCompositeRenderType.java @@ -6,6 +6,6 @@ import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(RenderType.CompositeRenderType.class) public interface AccessorCompositeRenderType { - @Invoker("state") - RenderType.CompositeState hex$state(); + @Invoker("state") + RenderType.CompositeState hex$state(); } diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorEmptyTextureStateShard.java b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorEmptyTextureStateShard.java index 20bf6d8f..2ee90b15 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorEmptyTextureStateShard.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorEmptyTextureStateShard.java @@ -9,6 +9,6 @@ import java.util.Optional; @Mixin(RenderStateShard.EmptyTextureStateShard.class) public interface AccessorEmptyTextureStateShard { - @Invoker("cutoutTexture") - Optional hex$cutoutTexture(); + @Invoker("cutoutTexture") + Optional hex$cutoutTexture(); } diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorMouseHandler.java b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorMouseHandler.java index d663d132..54343bb8 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorMouseHandler.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorMouseHandler.java @@ -6,9 +6,9 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(MouseHandler.class) public interface AccessorMouseHandler { - @Accessor("accumulatedScroll") - double hex$getAccumulatedScroll(); + @Accessor("accumulatedScroll") + double hex$getAccumulatedScroll(); - @Accessor("accumulatedScroll") - void hex$setAccumulatedScroll(double scroll); + @Accessor("accumulatedScroll") + void hex$setAccumulatedScroll(double scroll); } diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderStateShard.java b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderStateShard.java index 7ce50318..653ce5fb 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderStateShard.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderStateShard.java @@ -6,6 +6,6 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(RenderStateShard.class) public interface AccessorRenderStateShard { - @Accessor("name") - String hex$name(); + @Accessor("name") + String hex$name(); } diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderType.java b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderType.java index fcd4723d..5908725e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderType.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/accessor/client/AccessorRenderType.java @@ -8,10 +8,10 @@ import org.spongepowered.asm.mixin.gen.Invoker; // https://github.com/VazkiiMods/Botania/blob/13b7bcd9cbb6b1a418b0afe455662d29b46f1a7f/Xplat/src/main/java/vazkii/botania/mixin/client/AccessorRenderType.java @Mixin(RenderType.class) public interface AccessorRenderType { - @Invoker("create") - static RenderType.CompositeRenderType hex$create(String string, VertexFormat vertexFormat, - VertexFormat.Mode mode, int bufSize, boolean hasCrumbling, boolean sortOnUpload, - RenderType.CompositeState compositeState) { - throw new IllegalStateException(); - } + @Invoker("create") + static RenderType.CompositeRenderType hex$create(String string, VertexFormat vertexFormat, + VertexFormat.Mode mode, int bufSize, boolean hasCrumbling, boolean sortOnUpload, + RenderType.CompositeState compositeState) { + throw new IllegalStateException(); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/xplat/IForgeLikeBlock.java b/Common/src/main/java/at/petrak/hexcasting/xplat/IForgeLikeBlock.java index e94bd547..1c4bb996 100644 --- a/Common/src/main/java/at/petrak/hexcasting/xplat/IForgeLikeBlock.java +++ b/Common/src/main/java/at/petrak/hexcasting/xplat/IForgeLikeBlock.java @@ -11,11 +11,11 @@ import net.minecraft.world.level.block.state.BlockState; * Fabric implementation will use mixins to achieve the same effects. */ public interface IForgeLikeBlock { - default boolean addLandingEffects(BlockState state, ServerLevel level, BlockPos pos, LivingEntity entity, int numberOfParticles) { - return false; - } + default boolean addLandingEffects(BlockState state, ServerLevel level, BlockPos pos, LivingEntity entity, int numberOfParticles) { + return false; + } - default boolean hasEnchantPowerBonus(BlockState state, LevelReader level, BlockPos pos) { - return false; - } + default boolean hasEnchantPowerBonus(BlockState state, LevelReader level, BlockPos pos) { + return false; + } } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiBrainsweepRecipe.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiBrainsweepRecipe.java index e418c13c..448cc262 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiBrainsweepRecipe.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiBrainsweepRecipe.java @@ -13,49 +13,49 @@ import java.util.List; import static at.petrak.hexcasting.api.HexAPI.modLoc; public record EmiBrainsweepRecipe(EmiIngredient blockInput, - EmiIngredient villagerInput, - EmiStack output, - ResourceLocation id) implements EmiRecipe { - private static final ResourceLocation OVERLAY = modLoc("textures/gui/brainsweep_jei.png"); + EmiIngredient villagerInput, + EmiStack output, + ResourceLocation id) implements EmiRecipe { + private static final ResourceLocation OVERLAY = modLoc("textures/gui/brainsweep_jei.png"); - @Override - public EmiRecipeCategory getCategory() { - return HexEMIPlugin.BRAINSWEEP; - } + @Override + public EmiRecipeCategory getCategory() { + return HexEMIPlugin.BRAINSWEEP; + } - @Override - public @Nullable ResourceLocation getId() { - return id; - } + @Override + public @Nullable ResourceLocation getId() { + return id; + } - @Override - public List getInputs() { - return List.of(blockInput, villagerInput); - } + @Override + public List getInputs() { + return List.of(blockInput, villagerInput); + } - @Override - public List getOutputs() { - return List.of(output); - } + @Override + public List getOutputs() { + return List.of(output); + } - @Override - public int getDisplayWidth() { - return 118; - } + @Override + public int getDisplayWidth() { + return 118; + } - @Override - public int getDisplayHeight() { - return 85; - } + @Override + public int getDisplayHeight() { + return 85; + } - @Override - public void addWidgets(WidgetHolder widgets) { - widgets.addTexture(OVERLAY, 0, 0, 118, 85, 0, 0, 118, 85, 128, 128); - widgets.addSlot(blockInput, 11, 34).drawBack(false).custom(null, 0, 0, 19, 19); + @Override + public void addWidgets(WidgetHolder widgets) { + widgets.addTexture(OVERLAY, 0, 0, 118, 85, 0, 0, 118, 85, 128, 128); + widgets.addSlot(blockInput, 11, 34).drawBack(false).custom(null, 0, 0, 19, 19); - widgets.add(new TheCoolerSlotWidget(villagerInput, 37, 19, 2.75f).useOffset(false).customShift(-8.5f, 2.485f)) - .drawBack(false).custom(null, 0, 0, 27, 49); + widgets.add(new TheCoolerSlotWidget(villagerInput, 37, 19, 2.75f).useOffset(false).customShift(-8.5f, 2.485f)) + .drawBack(false).custom(null, 0, 0, 27, 49); - widgets.addSlot(output, 86, 34).drawBack(false).output(true).recipeContext(this).custom(null, 0, 0, 19, 19); - } + widgets.addSlot(output, 86, 34).drawBack(false).output(true).recipeContext(this).custom(null, 0, 0, 19, 19); + } } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiLevelupRecipe.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiLevelupRecipe.java index f5d9438f..1e2d6ecd 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiLevelupRecipe.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiLevelupRecipe.java @@ -9,17 +9,17 @@ import net.minecraft.world.item.Items; import java.util.List; public class EmiLevelupRecipe extends EmiVillagerRecipe { - public EmiLevelupRecipe(EmiIngredient input, VillagerEmiStack result, ResourceLocation id) { - super(input, EmiStack.of(Items.EMERALD), result, id, false); - } + public EmiLevelupRecipe(EmiIngredient input, VillagerEmiStack result, ResourceLocation id) { + super(input, EmiStack.of(Items.EMERALD), result, id, false); + } - @Override - public List getInputs() { - return List.of(input); - } + @Override + public List getInputs() { + return List.of(input); + } - @Override - public EmiRecipeCategory getCategory() { - return HexEMIPlugin.VILLAGER_LEVELING; - } + @Override + public EmiRecipeCategory getCategory() { + return HexEMIPlugin.VILLAGER_LEVELING; + } } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiProfessionRecipe.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiProfessionRecipe.java index b9cba71d..926b2558 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiProfessionRecipe.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiProfessionRecipe.java @@ -5,12 +5,12 @@ import dev.emi.emi.api.stack.EmiIngredient; import net.minecraft.resources.ResourceLocation; public class EmiProfessionRecipe extends EmiVillagerRecipe { - public EmiProfessionRecipe(EmiIngredient input, EmiIngredient catalyst, VillagerEmiStack result, ResourceLocation id) { - super(input, catalyst, result, id); - } + public EmiProfessionRecipe(EmiIngredient input, EmiIngredient catalyst, VillagerEmiStack result, ResourceLocation id) { + super(input, catalyst, result, id); + } - @Override - public EmiRecipeCategory getCategory() { - return HexEMIPlugin.VILLAGER_PROFESSION; - } + @Override + public EmiRecipeCategory getCategory() { + return HexEMIPlugin.VILLAGER_PROFESSION; + } } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiVillagerRecipe.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiVillagerRecipe.java index 4bbb4953..92f7177a 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiVillagerRecipe.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/EmiVillagerRecipe.java @@ -12,60 +12,60 @@ import java.util.List; // Mostly copypasta from EmiWorldRecipe, to avoid depending on impl public abstract class EmiVillagerRecipe implements EmiRecipe { - protected final boolean isCatalyst; - protected final ResourceLocation id; - protected final EmiIngredient input; - protected final EmiIngredient catalyst; - protected final EmiStack result; + protected final boolean isCatalyst; + protected final ResourceLocation id; + protected final EmiIngredient input; + protected final EmiIngredient catalyst; + protected final EmiStack result; - public EmiVillagerRecipe(EmiIngredient input, EmiIngredient catalyst, VillagerEmiStack result, ResourceLocation id) { - this(input, catalyst, result, id, true); - } + public EmiVillagerRecipe(EmiIngredient input, EmiIngredient catalyst, VillagerEmiStack result, ResourceLocation id) { + this(input, catalyst, result, id, true); + } - public EmiVillagerRecipe(EmiIngredient input, EmiIngredient catalyst, VillagerEmiStack result, ResourceLocation id, boolean isCatalyst) { - this.isCatalyst = isCatalyst; - this.input = input; - this.catalyst = catalyst; - this.result = result; - this.id = id; - if (isCatalyst) { - for (EmiStack stack : catalyst.getEmiStacks()) { - stack.setRemainder(stack); - } - } + public EmiVillagerRecipe(EmiIngredient input, EmiIngredient catalyst, VillagerEmiStack result, ResourceLocation id, boolean isCatalyst) { + this.isCatalyst = isCatalyst; + this.input = input; + this.catalyst = catalyst; + this.result = result; + this.id = id; + if (isCatalyst) { + for (EmiStack stack : catalyst.getEmiStacks()) { + stack.setRemainder(stack); + } + } - } + } - @Nullable - public ResourceLocation getId() { - return this.id; - } + @Nullable + public ResourceLocation getId() { + return this.id; + } - public List getInputs() { - return this.isCatalyst ? List.of(this.input) : List.of(this.input, this.catalyst); - } + public List getInputs() { + return this.isCatalyst ? List.of(this.input) : List.of(this.input, this.catalyst); + } - public List getCatalysts() { - return this.isCatalyst ? List.of(this.catalyst) : List.of(); - } + public List getCatalysts() { + return this.isCatalyst ? List.of(this.catalyst) : List.of(); + } - public List getOutputs() { - return List.of(this.result); - } + public List getOutputs() { + return List.of(this.result); + } - public int getDisplayWidth() { - return 125; - } + public int getDisplayWidth() { + return 125; + } - public int getDisplayHeight() { - return 18; - } + public int getDisplayHeight() { + return 18; + } - public void addWidgets(WidgetHolder widgets) { - widgets.addTexture(EmiTexture.PLUS, 27, 3); - widgets.addTexture(EmiTexture.EMPTY_ARROW, 75, 1); - widgets.addSlot(this.input, 0, 0); - widgets.addSlot(this.catalyst, 49, 0).catalyst(this.isCatalyst); - widgets.addSlot(this.result, 107, 0).recipeContext(this); - } + public void addWidgets(WidgetHolder widgets) { + widgets.addTexture(EmiTexture.PLUS, 27, 3); + widgets.addTexture(EmiTexture.EMPTY_ARROW, 75, 1); + widgets.addSlot(this.input, 0, 0); + widgets.addSlot(this.catalyst, 49, 0).catalyst(this.isCatalyst); + widgets.addSlot(this.result, 107, 0).recipeContext(this); + } } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/VillagerVariant.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/VillagerVariant.java index ca430cfa..6584ffd4 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/VillagerVariant.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/interop/emi/VillagerVariant.java @@ -3,5 +3,5 @@ package at.petrak.hexcasting.fabric.interop.emi; import at.petrak.hexcasting.common.recipe.ingredient.VillagerIngredient; public record VillagerVariant(VillagerIngredient ingredient, boolean mindless) { - // NO-OP + // NO-OP } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricMixinGameRenderer.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricMixinGameRenderer.java index 3d540a63..1e0b0c79 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricMixinGameRenderer.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricMixinGameRenderer.java @@ -19,20 +19,20 @@ import java.util.function.Consumer; // https://github.com/VazkiiMods/Botania/blob/b1f1cf80e10b1c739b0188171b367d9cefc4d3c7/Fabric/src/main/java/vazkii/botania/fabric/mixin/client/FabricMixinGameRenderer.java @Mixin(GameRenderer.class) public class FabricMixinGameRenderer { - @SuppressWarnings("InvalidInjectorMethodSignature") - @Inject( - method = "reloadShaders", - at = @At( - value = "INVOKE_ASSIGN", - target = "Lcom/google/common/collect/Lists;newArrayListWithCapacity(I)Ljava/util/ArrayList;", - remap = false - ), - locals = LocalCapture.CAPTURE_FAILHARD - ) - private void loadShaders(ResourceManager resourceManager, CallbackInfo ci, - List _programsToClose, - List>> shadersToLoad) - throws IOException { - HexShaders.init(resourceManager, shadersToLoad::add); - } + @SuppressWarnings("InvalidInjectorMethodSignature") + @Inject( + method = "reloadShaders", + at = @At( + value = "INVOKE_ASSIGN", + target = "Lcom/google/common/collect/Lists;newArrayListWithCapacity(I)Ljava/util/ArrayList;", + remap = false + ), + locals = LocalCapture.CAPTURE_FAILHARD + ) + private void loadShaders(ResourceManager resourceManager, CallbackInfo ci, + List _programsToClose, + List>> shadersToLoad) + throws IOException { + HexShaders.init(resourceManager, shadersToLoad::add); + } } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricParticleEngineMixin.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricParticleEngineMixin.java index b5c6fa60..ddef27ce 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricParticleEngineMixin.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricParticleEngineMixin.java @@ -16,15 +16,15 @@ import java.util.List; @Mixin(ParticleEngine.class) public class FabricParticleEngineMixin { - @Mutable - @Final - @Shadow - private static List RENDER_ORDER; + @Mutable + @Final + @Shadow + private static List RENDER_ORDER; - @Inject(at = @At("RETURN"), method = "") - private static void addTypes(CallbackInfo ci) { - RENDER_ORDER = ImmutableList.builder().addAll(RENDER_ORDER) - .add(ConjureParticle.CONJURE_RENDER_TYPE, ConjureParticle.LIGHT_RENDER_TYPE) - .build(); - } + @Inject(at = @At("RETURN"), method = "") + private static void addTypes(CallbackInfo ci) { + RENDER_ORDER = ImmutableList.builder().addAll(RENDER_ORDER) + .add(ConjureParticle.CONJURE_RENDER_TYPE, ConjureParticle.LIGHT_RENDER_TYPE) + .build(); + } } diff --git a/Forge/src/main/java/at/petrak/hexcasting/forge/cap/ForgeImpetusCapability.java b/Forge/src/main/java/at/petrak/hexcasting/forge/cap/ForgeImpetusCapability.java index f624a21c..77287ce4 100644 --- a/Forge/src/main/java/at/petrak/hexcasting/forge/cap/ForgeImpetusCapability.java +++ b/Forge/src/main/java/at/petrak/hexcasting/forge/cap/ForgeImpetusCapability.java @@ -6,48 +6,48 @@ import net.minecraftforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; public record ForgeImpetusCapability(BlockEntityAbstractImpetus impetus) implements IItemHandler { - @Override - public int getSlots() { - return 1; - } + @Override + public int getSlots() { + return 1; + } - @NotNull - @Override - public ItemStack getStackInSlot(int slot) { - return ItemStack.EMPTY; - } + @NotNull + @Override + public ItemStack getStackInSlot(int slot) { + return ItemStack.EMPTY; + } - @NotNull - @Override - public ItemStack insertItem(int slot, @NotNull ItemStack originalStack, boolean simulate) { - if (!isItemValid(slot, originalStack)) { - return originalStack; - } + @NotNull + @Override + public ItemStack insertItem(int slot, @NotNull ItemStack originalStack, boolean simulate) { + if (!isItemValid(slot, originalStack)) { + return originalStack; + } - ItemStack stack = originalStack.copy(); + ItemStack stack = originalStack.copy(); - if (!simulate) { - impetus.insertMana(stack); - } else { - impetus.extractManaFromItem(stack, false); // Mana goes nowhere, since nothing is actually being done - } + if (!simulate) { + impetus.insertMana(stack); + } else { + impetus.extractManaFromItem(stack, false); // Mana goes nowhere, since nothing is actually being done + } - return stack; - } + return stack; + } - @NotNull - @Override - public ItemStack extractItem(int slot, int amount, boolean simulate) { - return ItemStack.EMPTY; - } + @NotNull + @Override + public ItemStack extractItem(int slot, int amount, boolean simulate) { + return ItemStack.EMPTY; + } - @Override - public int getSlotLimit(int slot) { - return 64; - } + @Override + public int getSlotLimit(int slot) { + return 64; + } - @Override - public boolean isItemValid(int slot, @NotNull ItemStack stack) { - return impetus.canPlaceItem(slot, stack); - } + @Override + public boolean isItemValid(int slot, @NotNull ItemStack stack) { + return impetus.canPlaceItem(slot, stack); + } }