Reformat and bump version

This commit is contained in:
Max
2021-05-15 00:13:39 +02:00
parent 2ff5dd500d
commit 428f98be44
88 changed files with 392 additions and 327 deletions

View File

@@ -4,160 +4,116 @@ GNU Lesser General Public License
_Version 3, 29 June 2007_ _Version 3, 29 June 2007_
_Copyright © 2007 Free Software Foundation, Inc. &lt;<http://fsf.org/>&gt;_ _Copyright © 2007 Free Software Foundation, Inc. &lt;<http://fsf.org/>&gt;_
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU
This version of the GNU Lesser General Public License incorporates General Public License, supplemented by the additional permissions listed below.
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
### 0. Additional Definitions ### 0. Additional Definitions
As used herein, “this License” refers to version 3 of the GNU Lesser As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to
General Public License, and the GNU GPL” refers to version 3 of the GNU version 3 of the GNU General Public License.
General Public License.
“The Library” refers to a covered work governed by this License, “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined
other than an Application or a Combined Work as defined below. below.
An “Application” is any work that makes use of an interface provided An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on
by the Library, but which is not otherwise based on the Library. the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by
Defining a subclass of a class defined by the Library is deemed a mode the Library.
of using an interface provided by the Library.
A “Combined Work” is a work produced by combining or linking an A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of
Application with the Library. The particular version of the Library the Library with which the Combined Work was made is also called the Linked Version”.
with which the Combined Work was made is also called the “Linked
Version”.
The “Minimal Corresponding Source” for a Combined Work means the The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding
Corresponding Source for the Combined Work, excluding any source code any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not
for portions of the Combined Work that, considered in isolation, are on the Linked Version.
based on the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application,
object code and/or source code for the Application, including any data including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the
and utility programs needed for reproducing the Combined Work from the System Libraries of the Combined Work.
Application, but excluding the System Libraries of the Combined Work.
### 1. Exception to Section 3 of the GNU GPL ### 1. Exception to Section 3 of the GNU GPL
You may convey a covered work under sections 3 and 4 of this License You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
without being bound by section 3 of the GNU GPL.
### 2. Conveying Modified Versions ### 2. Conveying Modified Versions
If you modify a copy of the Library, and, in your modifications, a If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied
facility refers to a function or data to be supplied by an Application by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may
that uses the facility (other than as an argument passed when the convey a copy of the modified version:
facility is invoked), then you may convey a copy of the modified
version:
* **a)** under this License, provided that you make a good faith effort to * **a)** under this License, provided that you make a good faith effort to ensure that, in the event an Application does
ensure that, in the event an Application does not supply the not supply the function or data, the facility still operates, and performs whatever part of its purpose remains
function or data, the facility still operates, and performs meaningful, or
whatever part of its purpose remains meaningful, or
* **b)** under the GNU GPL, with none of the additional permissions of * **b)** under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
this License applicable to that copy.
### 3. Object Code Incorporating Material from Library Header Files ### 3. Object Code Incorporating Material from Library Header Files
The object code form of an Application may incorporate material from The object code form of an Application may incorporate material from a header file that is part of the Library. You may
a header file that is part of the Library. You may convey such object convey such object code under terms of your choice, provided that, if the incorporated material is not limited to
code under terms of your choice, provided that, if the incorporated numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following: (ten or fewer lines in length), you do both of the following:
* **a)** Give prominent notice with each copy of the object code that the * **a)** Give prominent notice with each copy of the object code that the Library is used in it and that the Library and
Library is used in it and that the Library and its use are its use are covered by this License.
covered by this License. * **b)** Accompany the object code with a copy of the GNU GPL and this license document.
* **b)** Accompany the object code with a copy of the GNU GPL and this license
document.
### 4. Combined Works ### 4. Combined Works
You may convey a Combined Work under terms of your choice that, You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification
taken together, effectively do not restrict modification of the of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications,
portions of the Library contained in the Combined Work and reverse if you also do each of the following:
engineering for debugging such modifications, if you also do each of
the following:
* **a)** Give prominent notice with each copy of the Combined Work that * **a)** Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library
the Library is used in it and that the Library and its use are and its use are covered by this License.
covered by this License.
* **b)** Accompany the Combined Work with a copy of the GNU GPL and this license * **b)** Accompany the Combined Work with a copy of the GNU GPL and this license document.
* **c)** For a Combined Work that displays copyright notices during execution, include the copyright notice for the
Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license
document. document.
* **c)** For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
* **d)** Do one of the following: * **d)** Do one of the following:
- **0)** Convey the Minimal Corresponding Source under the terms of this - **0)** Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application
License, and the Corresponding Application Code in a form Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a
suitable for, and under terms that permit, the user to modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6
recombine or relink the Application with a modified version of of the GNU GPL for conveying Corresponding Source.
the Linked Version to produce a modified Combined Work, in the - **1)** Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that **(
manner specified by section 6 of the GNU GPL for conveying a)** uses at run time a copy of the Library already present on the user's computer system, and **(b)** will
Corresponding Source. operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
- **1)** Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that **(a)** uses at run time
a copy of the Library already present on the user's computer
system, and **(b)** will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
* **e)** Provide Installation Information, but only if you would otherwise * **e)** Provide Installation Information, but only if you would otherwise be required to provide such information under
be required to provide such information under section 6 of the section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified
GNU GPL, and only to the extent that such information is version of the Combined Work produced by recombining or relinking the Application with a modified version of the
necessary to install and execute a modified version of the Linked Version. (If you use option **4d0**, the Installation Information must accompany the Minimal Corresponding
Combined Work produced by recombining or relinking the Source and Corresponding Application Code. If you use option **4d1**, you must provide the Installation Information in
Application with a modified version of the Linked Version. (If the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
you use option **4d0**, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option **4d1**, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
### 5. Combined Libraries ### 5. Combined Libraries
You may place library facilities that are a work based on the You may place library facilities that are a work based on the Library side by side in a single library together with
Library side by side in a single library together with other library other library facilities that are not Applications and are not covered by this License, and convey such a combined
facilities that are not Applications and are not covered by this library under terms of your choice, if you do both of the following:
License, and convey such a combined library under terms of your
choice, if you do both of the following:
* **a)** Accompany the combined library with a copy of the same work based * **a)** Accompany the combined library with a copy of the same work based on the Library, uncombined with any other
on the Library, uncombined with any other library facilities, library facilities, conveyed under the terms of this License.
conveyed under the terms of this License. * **b)** Give prominent notice with the combined library that part of it is a work based on the Library, and explaining
* **b)** Give prominent notice with the combined library that part of it where to find the accompanying uncombined form of the same work.
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
### 6. Revised Versions of the GNU Lesser General Public License ### 6. Revised Versions of the GNU Lesser General Public License
The Free Software Foundation may publish revised and/or new versions The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time
of the GNU Lesser General Public License from time to time. Such new to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new
versions will be similar in spirit to the present version, but may problems or concerns.
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Each version is given a distinguishing version number. If the Library as you received it specifies that a certain
Library as you received it specifies that a certain numbered version numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of
of the GNU Lesser General Public License “or any later version” following the terms and conditions either of that published version or of any later version published by the Free
applies to it, you have the option of following the terms and Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General
conditions either of that published version or of any later version Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software
published by the Free Software Foundation. If the Library as you Foundation.
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General
whether future versions of the GNU Lesser General Public License shall Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for
apply, that proxy's public statement of acceptance of any version is you to choose that version for the Library.
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,26 +1,38 @@
# Architectury API # Architectury API
Talk to us on [Discord](https://discord.gg/C2RdJDpRBP)! Talk to us on [Discord](https://discord.gg/C2RdJDpRBP)!
An intermediary api aimed to ease developing multiplatform mods. An intermediary api aimed to ease developing multiplatform mods.
### What is Architectury API ### What is Architectury API
Architectury API is an api to abstract calls to fabric api and forge api as both loader has different implementations of what can be perceived as the same thing.
Architectury API updates regularly, with new hooks and features. Currently contains over **90** events hooks, networking abstraction, loader calls abstraction, game registry abstraction and an easy to use @ExpectPlatform annotation (Only works on static methods). Architectury API is an api to abstract calls to fabric api and forge api as both loader has different implementations of
what can be perceived as the same thing.
Architectury API updates regularly, with new hooks and features. Currently contains over **90** events hooks, networking
abstraction, loader calls abstraction, game registry abstraction and an easy to use @ExpectPlatform annotation (Only
works on static methods).
### Do I really need this API? ### Do I really need this API?
Architectury API is only one part of the architectury ecosystem, **Architectury Plugin** is the gradle plugin enabling all this multiplatform actions.
Architectury API is optional for projects built on architectury, you may create your architectury project with just Architectury Plugin. Architectury API is only one part of the architectury ecosystem, **Architectury Plugin** is the gradle plugin enabling
all this multiplatform actions.
Architectury API is optional for projects built on architectury, you may create your architectury project with just
Architectury Plugin.
### Advantages of Architectury ### Advantages of Architectury
- Open sourced - Open sourced
- Less boilerplate for your multiplatform mod - Less boilerplate for your multiplatform mod
### Getting started with making multiplatform mods ### Getting started with making multiplatform mods
Gradle Plugin: https://github.com/architectury/architectury-plugin Gradle Plugin: https://github.com/architectury/architectury-plugin
Example Mod: https://github.com/architectury/architectury-example-mod Example Mod: https://github.com/architectury/architectury-example-mod
### Credits ### Credits
This library bundles typetools, which you can find its license [here](https://github.com/jhalterman/typetools/blob/master/LICENSE.txt "")
This library bundles typetools, which you can find its
license [here](https://github.com/jhalterman/typetools/blob/master/LICENSE.txt "")

View File

@@ -39,7 +39,8 @@ import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
public final class EventFactory { public final class EventFactory {
private EventFactory() {} private EventFactory() {
}
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval @ApiStatus.ScheduledForRemoval

View File

@@ -29,7 +29,8 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
public final class EventHandler { public final class EventHandler {
private EventHandler() {} private EventHandler() {
}
private static boolean initialized = false; private static boolean initialized = false;

View File

@@ -63,11 +63,13 @@ public interface LifecycleEvent {
void stateChanged(T instance); void stateChanged(T instance);
} }
interface ServerState extends InstanceState<MinecraftServer> {} interface ServerState extends InstanceState<MinecraftServer> {
}
interface WorldState<T extends Level> { interface WorldState<T extends Level> {
void act(T world); void act(T world);
} }
interface ServerWorldState extends WorldState<ServerLevel> {} interface ServerWorldState extends WorldState<ServerLevel> {
}
} }

View File

@@ -35,11 +35,15 @@ public interface TickEvent<T> {
void tick(T instance); void tick(T instance);
interface Server extends TickEvent<MinecraftServer> {} interface Server extends TickEvent<MinecraftServer> {
}
interface WorldTick<T extends Level> extends TickEvent<T> {}
interface WorldTick<T extends Level> extends TickEvent<T> {
interface ServerWorld extends WorldTick<ServerLevel> {} }
interface Player extends TickEvent<net.minecraft.world.entity.player.Player> {} interface ServerWorld extends WorldTick<ServerLevel> {
}
interface Player extends TickEvent<net.minecraft.world.entity.player.Player> {
}
} }

View File

@@ -32,11 +32,13 @@ public interface ClientLifecycleEvent {
/** /**
* Invoked when client has been initialised, not available in forge. * Invoked when client has been initialised, not available in forge.
*/ */
@Deprecated Event<ClientState> CLIENT_STARTED = EventFactory.createLoop(); @Deprecated
Event<ClientState> CLIENT_STARTED = EventFactory.createLoop();
/** /**
* Invoked when client is stopping, not available in forge. * Invoked when client is stopping, not available in forge.
*/ */
@Deprecated Event<ClientState> CLIENT_STOPPING = EventFactory.createLoop(); @Deprecated
Event<ClientState> CLIENT_STOPPING = EventFactory.createLoop();
/** /**
* Invoked after a world is loaded only on client, equivalent to forge's {@code WorldEvent.Load}. * Invoked after a world is loaded only on client, equivalent to forge's {@code WorldEvent.Load}.
*/ */
@@ -44,8 +46,10 @@ public interface ClientLifecycleEvent {
Event<ClientState> CLIENT_SETUP = EventFactory.createLoop(); Event<ClientState> CLIENT_SETUP = EventFactory.createLoop();
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
interface ClientState extends LifecycleEvent.InstanceState<Minecraft> {} interface ClientState extends LifecycleEvent.InstanceState<Minecraft> {
}
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
interface ClientWorldState extends LifecycleEvent.WorldState<ClientLevel> {} interface ClientWorldState extends LifecycleEvent.WorldState<ClientLevel> {
}
} }

View File

@@ -36,8 +36,10 @@ public interface ClientTickEvent<T> {
void tick(T instance); void tick(T instance);
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
interface Client extends ClientTickEvent<Minecraft> {} interface Client extends ClientTickEvent<Minecraft> {
}
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
interface ClientWorld extends ClientTickEvent<ClientLevel> {} interface ClientWorld extends ClientTickEvent<ClientLevel> {
}
} }

View File

@@ -23,7 +23,8 @@ import me.shedaniel.architectury.ExpectPlatform;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
public class BlockEntityHooks { public class BlockEntityHooks {
private BlockEntityHooks() {} private BlockEntityHooks() {
}
/** /**
* Sync data to the clients. * Sync data to the clients.

View File

@@ -23,7 +23,8 @@ import me.shedaniel.architectury.annotations.ExpectPlatform;
import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.DyeColor;
public class DyeColorHooks { public class DyeColorHooks {
private DyeColorHooks() {} private DyeColorHooks() {
}
@ExpectPlatform @ExpectPlatform
public static int getColorValue(DyeColor color) { public static int getColorValue(DyeColor color) {

View File

@@ -25,7 +25,8 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public final class EntityHooks { public final class EntityHooks {
private EntityHooks() {} private EntityHooks() {
}
@ExpectPlatform @ExpectPlatform
public static String getEncodeId(Entity entity) { public static String getEncodeId(Entity entity) {

View File

@@ -26,7 +26,8 @@ import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public final class ExplosionHooks { public final class ExplosionHooks {
private ExplosionHooks() {} private ExplosionHooks() {
}
@ExpectPlatform @ExpectPlatform
public static Vec3 getPosition(Explosion explosion) { public static Vec3 getPosition(Explosion explosion) {

View File

@@ -35,7 +35,8 @@ import net.minecraft.world.level.material.FluidState;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class FluidStackHooks { public class FluidStackHooks {
private FluidStackHooks() {} private FluidStackHooks() {
}
@ExpectPlatform @ExpectPlatform
public static Component getName(FluidStack stack) { public static Component getName(FluidStack stack) {

View File

@@ -24,7 +24,8 @@ import me.shedaniel.architectury.utils.IntValue;
import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.item.ItemEntity;
public final class ItemEntityHooks { public final class ItemEntityHooks {
private ItemEntityHooks() {} private ItemEntityHooks() {
}
/** /**
* The lifespan of an {@link ItemEntity}. * The lifespan of an {@link ItemEntity}.

View File

@@ -26,7 +26,8 @@ import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
public final class ItemStackHooks { public final class ItemStackHooks {
private ItemStackHooks() {} private ItemStackHooks() {
}
public static ItemStack copyWithCount(ItemStack stack, int count) { public static ItemStack copyWithCount(ItemStack stack, int count) {
ItemStack copy = stack.copy(); ItemStack copy = stack.copy();

View File

@@ -22,7 +22,8 @@ package me.shedaniel.architectury.hooks;
import net.minecraft.world.level.storage.LevelResource; import net.minecraft.world.level.storage.LevelResource;
public class LevelResourceHooks { public class LevelResourceHooks {
private LevelResourceHooks() {} private LevelResourceHooks() {
}
public static LevelResource create(String id) { public static LevelResource create(String id) {
return new LevelResource(id); return new LevelResource(id);

View File

@@ -24,7 +24,8 @@ import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.RepositorySource; import net.minecraft.server.packs.repository.RepositorySource;
public class PackRepositoryHooks { public class PackRepositoryHooks {
private PackRepositoryHooks() {} private PackRepositoryHooks() {
}
@ExpectPlatform @ExpectPlatform
public static void addSource(PackRepository repository, RepositorySource source) { public static void addSource(PackRepository repository, RepositorySource source) {

View File

@@ -23,7 +23,8 @@ import me.shedaniel.architectury.annotations.ExpectPlatform;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
public final class PlayerHooks { public final class PlayerHooks {
private PlayerHooks() {} private PlayerHooks() {
}
@ExpectPlatform @ExpectPlatform
public static boolean isFake(Player player) { public static boolean isFake(Player player) {

View File

@@ -30,7 +30,8 @@ import java.util.List;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public final class ScreenHooks { public final class ScreenHooks {
private ScreenHooks() {} private ScreenHooks() {
}
@ExpectPlatform @ExpectPlatform
public static List<AbstractWidget> getButtons(Screen screen) { public static List<AbstractWidget> getButtons(Screen screen) {

View File

@@ -31,7 +31,8 @@ import net.minecraft.world.level.material.Fluid;
import java.util.function.Supplier; import java.util.function.Supplier;
public final class TagHooks { public final class TagHooks {
private TagHooks() {} private TagHooks() {
}
@ExpectPlatform @ExpectPlatform
public static <T> Tag.Named<T> getOptional(ResourceLocation id, Supplier<TagCollection<T>> collection) { public static <T> Tag.Named<T> getOptional(ResourceLocation id, Supplier<TagCollection<T>> collection) {

View File

@@ -31,7 +31,6 @@ import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
import net.minecraft.world.level.levelgen.surfacebuilders.ConfiguredSurfaceBuilder; import net.minecraft.world.level.levelgen.surfacebuilders.ConfiguredSurfaceBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;

View File

@@ -21,7 +21,6 @@ package me.shedaniel.architectury.hooks.biome;
import net.minecraft.world.level.biome.Biome.Precipitation; import net.minecraft.world.level.biome.Biome.Precipitation;
import net.minecraft.world.level.biome.Biome.TemperatureModifier; import net.minecraft.world.level.biome.Biome.TemperatureModifier;
import org.jetbrains.annotations.NotNull;
public interface ClimateProperties { public interface ClimateProperties {
Precipitation getPrecipitation(); Precipitation getPrecipitation();

View File

@@ -32,7 +32,8 @@ import java.util.Collection;
import java.util.Optional; import java.util.Optional;
public final class Platform { public final class Platform {
private Platform() {} private Platform() {
}
private static int simpleLoaderCache = -1; private static int simpleLoaderCache = -1;

View File

@@ -31,7 +31,8 @@ import java.util.function.Function;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public final class BlockEntityRenderers { public final class BlockEntityRenderers {
private BlockEntityRenderers() {} private BlockEntityRenderers() {
}
@ExpectPlatform @ExpectPlatform
public static <T extends BlockEntity> void registerRenderer(BlockEntityType<T> type, Function<BlockEntityRenderDispatcher, BlockEntityRenderer<? super T>> provider) { public static <T extends BlockEntity> void registerRenderer(BlockEntityType<T> type, Function<BlockEntityRenderDispatcher, BlockEntityRenderer<? super T>> provider) {

View File

@@ -32,7 +32,8 @@ import java.util.function.Supplier;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public final class ColorHandlers { public final class ColorHandlers {
private ColorHandlers() {} private ColorHandlers() {
}
public static void registerItemColors(ItemColor color, ItemLike... items) { public static void registerItemColors(ItemColor color, ItemLike... items) {
Supplier<ItemLike>[] array = new Supplier[items.length]; Supplier<ItemLike>[] array = new Supplier[items.length];

View File

@@ -27,7 +27,8 @@ import net.minecraft.world.item.ItemStack;
import java.util.function.Supplier; import java.util.function.Supplier;
public final class CreativeTabs { public final class CreativeTabs {
private CreativeTabs() {} private CreativeTabs() {
}
// I am sorry, fabric wants a resource location instead of the translation key for whatever reason // I am sorry, fabric wants a resource location instead of the translation key for whatever reason
@ExpectPlatform @ExpectPlatform

View File

@@ -23,7 +23,8 @@ import me.shedaniel.architectury.annotations.ExpectPlatform;
import net.minecraft.advancements.CriterionTrigger; import net.minecraft.advancements.CriterionTrigger;
public final class CriteriaTriggersRegistry { public final class CriteriaTriggersRegistry {
private CriteriaTriggersRegistry() {} private CriteriaTriggersRegistry() {
}
/** /**
* Invokes {@link net.minecraft.advancements.CriteriaTriggers#register(CriterionTrigger)}. * Invokes {@link net.minecraft.advancements.CriteriaTriggers#register(CriterionTrigger)}.

View File

@@ -29,7 +29,8 @@ import java.util.function.BiConsumer;
* A utility class for creating game rule types. * A utility class for creating game rule types.
*/ */
public final class GameRuleFactory { public final class GameRuleFactory {
private GameRuleFactory() {} private GameRuleFactory() {
}
/** /**
* Creates a boolean rule type. * Creates a boolean rule type.

View File

@@ -26,7 +26,8 @@ import net.minecraft.world.level.GameRules;
* A registry for registering game rules. * A registry for registering game rules.
*/ */
public final class GameRuleRegistry { public final class GameRuleRegistry {
private GameRuleRegistry() {} private GameRuleRegistry() {
}
/** /**
* Registers a game rule. * Registers a game rule.

View File

@@ -26,7 +26,8 @@ import net.minecraft.client.KeyMapping;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public final class KeyBindings { public final class KeyBindings {
private KeyBindings() {} private KeyBindings() {
}
@ExpectPlatform @ExpectPlatform
public static void registerKeyBinding(KeyMapping binding) { public static void registerKeyBinding(KeyMapping binding) {

View File

@@ -41,7 +41,8 @@ import java.util.function.Consumer;
* A utility class to register {@link MenuType}s and {@link Screen}s for containers * A utility class to register {@link MenuType}s and {@link Screen}s for containers
*/ */
public final class MenuRegistry { public final class MenuRegistry {
private MenuRegistry() {} private MenuRegistry() {
}
/** /**
* Opens the menu. * Opens the menu.

View File

@@ -24,7 +24,8 @@ import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.resources.PreparableReloadListener; import net.minecraft.server.packs.resources.PreparableReloadListener;
public final class ReloadListeners { public final class ReloadListeners {
private ReloadListeners() {} private ReloadListeners() {
}
@ExpectPlatform @ExpectPlatform
public static void registerReloadListener(PackType type, PreparableReloadListener listener) { public static void registerReloadListener(PackType type, PreparableReloadListener listener) {

View File

@@ -28,7 +28,8 @@ import net.minecraft.world.level.material.Fluid;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public final class RenderTypes { public final class RenderTypes {
private RenderTypes() {} private RenderTypes() {
}
@ExpectPlatform @ExpectPlatform
public static void register(RenderType type, Block... blocks) { public static void register(RenderType type, Block... blocks) {

View File

@@ -27,7 +27,8 @@ import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import java.util.function.Supplier; import java.util.function.Supplier;
public final class EntityAttributes { public final class EntityAttributes {
private EntityAttributes() {} private EntityAttributes() {
}
/** /**
* Registers default attributes to entities. * Registers default attributes to entities.

View File

@@ -31,7 +31,8 @@ import java.util.function.Function;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public final class EntityRenderers { public final class EntityRenderers {
private EntityRenderers() {} private EntityRenderers() {
}
@ExpectPlatform @ExpectPlatform
public static <T extends Entity> void register(EntityType<T> type, Function<EntityRenderDispatcher, EntityRenderer<T>> factory) { public static <T extends Entity> void register(EntityType<T> type, Function<EntityRenderDispatcher, EntityRenderer<T>> factory) {

View File

@@ -24,7 +24,8 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
public final class FuelRegistry { public final class FuelRegistry {
private FuelRegistry() {} private FuelRegistry() {
}
/** /**
* Registers a burn time for items. * Registers a burn time for items.

View File

@@ -24,7 +24,8 @@ import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.entity.npc.VillagerTrades; import net.minecraft.world.entity.npc.VillagerTrades;
public class TradeRegistry { public class TradeRegistry {
private TradeRegistry() {} private TradeRegistry() {
}
/** /**
* Register a trade ({@link VillagerTrades.ItemListing}) for a villager by its profession and level. * Register a trade ({@link VillagerTrades.ItemListing}) for a villager by its profession and level.

View File

@@ -56,5 +56,6 @@ public final class EnvExecutor {
} }
} }
private EnvExecutor() {} private EnvExecutor() {
}
} }

View File

@@ -40,5 +40,6 @@ public final class NbtType {
*/ */
public static final int NUMBER = 99; public static final int NUMBER = 99;
private NbtType() {} private NbtType() {
}
} }

View File

@@ -22,4 +22,5 @@ package me.shedaniel.architectury.utils;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Supplier; import java.util.function.Supplier;
public interface Value<T> extends Supplier<T>, Consumer<T> {} public interface Value<T> extends Supplier<T>, Consumer<T> {
}

View File

@@ -5,7 +5,11 @@
"minVersion": "0.7.11", "minVersion": "0.7.11",
"client": [ "client": [
], ],
"mixins": ["BlockLandingInvoker", "FluidTagsAccessor", "MixinLightningBolt"], "mixins": [
"BlockLandingInvoker",
"FluidTagsAccessor",
"MixinLightningBolt"
],
"injectors": { "injectors": {
"maxShiftBy": 5, "maxShiftBy": 5,
"defaultRequire": 1 "defaultRequire": 1

View File

@@ -22,8 +22,8 @@ package me.shedaniel.architectury.compat.fabric;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import io.github.prospector.modmenu.api.ConfigScreenFactory; import io.github.prospector.modmenu.api.ConfigScreenFactory;
import io.github.prospector.modmenu.api.ModMenuApi; import io.github.prospector.modmenu.api.ModMenuApi;
import me.shedaniel.architectury.platform.fabric.PlatformImpl;
import me.shedaniel.architectury.platform.Mod; import me.shedaniel.architectury.platform.Mod;
import me.shedaniel.architectury.platform.fabric.PlatformImpl;
import java.util.Map; import java.util.Map;

View File

@@ -19,7 +19,6 @@
package me.shedaniel.architectury.hooks.fabric; package me.shedaniel.architectury.hooks.fabric;
import com.google.common.base.Preconditions;
import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable; import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;

View File

@@ -38,13 +38,28 @@ import java.util.Set;
@Mixin(Explosion.class) @Mixin(Explosion.class)
public class MixinExplosion implements ExplosionHooksImpl.ExplosionExtensions { public class MixinExplosion implements ExplosionHooksImpl.ExplosionExtensions {
@Shadow @Final private Level level; @Shadow
@Shadow @Final private double x; @Final
@Shadow @Final private double y; private Level level;
@Shadow @Final private double z; @Shadow
@Shadow @Final @Nullable private Entity source; @Final
@Shadow @Final @Mutable private float radius; private double x;
@Unique Vec3 position; @Shadow
@Final
private double y;
@Shadow
@Final
private double z;
@Shadow
@Final
@Nullable
private Entity source;
@Shadow
@Final
@Mutable
private float radius;
@Unique
Vec3 position;
@Inject(method = "explode", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/phys/Vec3;<init>(DDD)V", ordinal = 0), @Inject(method = "explode", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/phys/Vec3;<init>(DDD)V", ordinal = 0),
locals = LocalCapture.CAPTURE_FAILHARD) locals = LocalCapture.CAPTURE_FAILHARD)

View File

@@ -21,19 +21,15 @@ package me.shedaniel.architectury.mixin.fabric;
import me.shedaniel.architectury.event.events.InteractionEvent; import me.shedaniel.architectury.event.events.InteractionEvent;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.util.Tuple;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.FarmBlock; import net.minecraft.world.level.block.FarmBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.lang3.tuple.Triple;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(FarmBlock.class) @Mixin(FarmBlock.class)

View File

@@ -32,7 +32,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(FurnaceResultSlot.class) @Mixin(FurnaceResultSlot.class)
public class MixinFurnaceResultSlot { public class MixinFurnaceResultSlot {
@Shadow @Final private Player player; @Shadow
@Final
private Player player;
@Inject(method = "checkTakeAchievements", at = @At("RETURN")) @Inject(method = "checkTakeAchievements", at = @At("RETURN"))
private void checkTakeAchievements(ItemStack itemStack, CallbackInfo ci) { private void checkTakeAchievements(ItemStack itemStack, CallbackInfo ci) {

View File

@@ -33,7 +33,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(LevelChunk.class) @Mixin(LevelChunk.class)
public class MixinLevelChunk { public class MixinLevelChunk {
@Shadow @Final private ChunkPos chunkPos; @Shadow
@Final
private ChunkPos chunkPos;
@Inject( @Inject(
method = "addEntity", method = "addEntity",

View File

@@ -22,7 +22,8 @@ package me.shedaniel.architectury.mixin.fabric;
import me.shedaniel.architectury.event.EventResult; import me.shedaniel.architectury.event.EventResult;
import me.shedaniel.architectury.event.events.EntityEvent; import me.shedaniel.architectury.event.events.EntityEvent;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.*; import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.NaturalSpawner; import net.minecraft.world.level.NaturalSpawner;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;

View File

@@ -31,7 +31,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerAdvancements.class) @Mixin(PlayerAdvancements.class)
public class MixinPlayerAdvancements { public class MixinPlayerAdvancements {
@Shadow private ServerPlayer player; @Shadow
private ServerPlayer player;
@Inject(method = "award", @Inject(method = "award",
at = @At(value = "INVOKE", target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V",

View File

@@ -33,9 +33,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ResultSlot.class) @Mixin(ResultSlot.class)
public class MixinResultSlot { public class MixinResultSlot {
@Shadow @Final private Player player; @Shadow
@Final
private Player player;
@Shadow @Final private CraftingContainer craftSlots; @Shadow
@Final
private CraftingContainer craftSlots;
@Inject(method = "checkTakeAchievements", at = @At(value = "INVOKE", @Inject(method = "checkTakeAchievements", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/item/ItemStack;onCraftedBy(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;I)V", target = "Lnet/minecraft/world/item/ItemStack;onCraftedBy(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;I)V",

View File

@@ -23,13 +23,11 @@ import me.shedaniel.architectury.event.events.ChatEvent;
import net.minecraft.network.chat.ChatType; import net.minecraft.network.chat.ChatType;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.protocol.game.ServerboundChatPacket;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.InteractionResultHolder;
import org.apache.commons.lang3.StringUtils;
import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
@@ -39,11 +37,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ServerGamePacketListenerImpl.class) @Mixin(ServerGamePacketListenerImpl.class)
public abstract class MixinServerGamePacketListenerImpl { public abstract class MixinServerGamePacketListenerImpl {
@Shadow public ServerPlayer player; @Shadow
public ServerPlayer player;
@Shadow @Final private MinecraftServer server; @Shadow
@Final
private MinecraftServer server;
@Shadow private int chatSpamTickCount; @Shadow
private int chatSpamTickCount;
@Shadow @Shadow
public abstract void disconnect(Component component); public abstract void disconnect(Component component);

View File

@@ -35,9 +35,11 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(ServerPlayerGameMode.class) @Mixin(ServerPlayerGameMode.class)
public class MixinServerPlayerGameMode { public class MixinServerPlayerGameMode {
@Shadow public ServerLevel level; @Shadow
public ServerLevel level;
@Shadow public ServerPlayer player; @Shadow
public ServerPlayer player;
@Inject(method = "destroyBlock", at = @At(value = "INVOKE", @Inject(method = "destroyBlock", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/level/block/state/BlockState;getBlock()Lnet/minecraft/world/level/block/Block;", target = "Lnet/minecraft/world/level/block/state/BlockState;getBlock()Lnet/minecraft/world/level/block/Block;",

View File

@@ -43,9 +43,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ClientPacketListener.class) @Mixin(ClientPacketListener.class)
public class MixinClientPacketListener { public class MixinClientPacketListener {
@Shadow private Minecraft minecraft; @Shadow
@Shadow @Final private RecipeManager recipeManager; private Minecraft minecraft;
@Unique private LocalPlayer tmpPlayer; @Shadow
@Final
private RecipeManager recipeManager;
@Unique
private LocalPlayer tmpPlayer;
@Inject(method = "handleLogin", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Options;broadcastOptions()V")) @Inject(method = "handleLogin", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Options;broadcastOptions()V"))
private void handleLogin(ClientboundLoginPacket packet, CallbackInfo ci) { private void handleLogin(ClientboundLoginPacket packet, CallbackInfo ci) {

View File

@@ -34,7 +34,9 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(GameRenderer.class) @Mixin(GameRenderer.class)
public abstract class MixinGameRenderer { public abstract class MixinGameRenderer {
@Shadow @Final private Minecraft minecraft; @Shadow
@Final
private Minecraft minecraft;
@Inject(method = "render(FJZ)V", @Inject(method = "render(FJZ)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;render(Lcom/mojang/blaze3d/vertex/PoseStack;IIF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;render(Lcom/mojang/blaze3d/vertex/PoseStack;IIF)V",

View File

@@ -43,9 +43,13 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Unique @Unique
@Mixin(Minecraft.class) @Mixin(Minecraft.class)
public abstract class MixinMinecraft { public abstract class MixinMinecraft {
@Shadow @Nullable public LocalPlayer player; @Shadow
@Nullable
public LocalPlayer player;
@Shadow @Nullable public HitResult hitResult; @Shadow
@Nullable
public HitResult hitResult;
@Shadow @Shadow
public abstract void setScreen(@Nullable Screen screen); public abstract void setScreen(@Nullable Screen screen);

View File

@@ -44,9 +44,13 @@ import java.util.List;
@Mixin(Screen.class) @Mixin(Screen.class)
public abstract class MixinScreen implements ScreenInputDelegate { public abstract class MixinScreen implements ScreenInputDelegate {
@Shadow @Final public List<AbstractWidget> buttons; @Shadow
@Unique private static ThreadLocal<TooltipEventPositionContextImpl> tooltipPositionContext = ThreadLocal.withInitial(TooltipEventPositionContextImpl::new); @Final
@Unique private static ThreadLocal<TooltipEventColorContextImpl> tooltipColorContext = ThreadLocal.withInitial(TooltipEventColorContextImpl::new); public List<AbstractWidget> buttons;
@Unique
private static ThreadLocal<TooltipEventPositionContextImpl> tooltipPositionContext = ThreadLocal.withInitial(TooltipEventPositionContextImpl::new);
@Unique
private static ThreadLocal<TooltipEventColorContextImpl> tooltipColorContext = ThreadLocal.withInitial(TooltipEventColorContextImpl::new);
@Shadow @Shadow
public abstract List<? extends GuiEventListener> children(); public abstract List<? extends GuiEventListener> children();

View File

@@ -23,7 +23,8 @@ import me.shedaniel.architectury.fluid.FluidStack;
import me.shedaniel.architectury.utils.Fraction; import me.shedaniel.architectury.utils.Fraction;
public final class FluidStackHooksForge { public final class FluidStackHooksForge {
private FluidStackHooksForge() {} private FluidStackHooksForge() {
}
public static FluidStack fromForge(net.minecraftforge.fluids.FluidStack stack) { public static FluidStack fromForge(net.minecraftforge.fluids.FluidStack stack) {
return FluidStack.create(stack.getFluid().delegate, Fraction.ofWhole(stack.getAmount()), stack.getTag()); return FluidStack.create(stack.getFluid().delegate, Fraction.ofWhole(stack.getAmount()), stack.getTag());

View File

@@ -33,7 +33,6 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;

View File

@@ -25,7 +25,8 @@ import java.util.*;
import java.util.function.Consumer; import java.util.function.Consumer;
public final class EventBuses { public final class EventBuses {
private EventBuses() {} private EventBuses() {
}
private static final Map<String, IEventBus> EVENT_BUS_MAP = new HashMap<>(); private static final Map<String, IEventBus> EVENT_BUS_MAP = new HashMap<>();
private static final Map<String, List<Consumer<IEventBus>>> ON_REGISTERED = new HashMap<>(); private static final Map<String, List<Consumer<IEventBus>>> ON_REGISTERED = new HashMap<>();

View File

@@ -27,7 +27,6 @@ import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraftforge.event.entity.EntityAttributeCreationEvent; import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier; import java.util.function.Supplier;

View File

@@ -157,7 +157,9 @@ public class BiomeModificationsImpl {
private static class GenerationSettingsBuilderWrapped implements GenerationProperties { private static class GenerationSettingsBuilderWrapped implements GenerationProperties {
protected final BiomeGenerationSettingsBuilder generation; protected final BiomeGenerationSettingsBuilder generation;
public GenerationSettingsBuilderWrapped(BiomeGenerationSettingsBuilder generation) {this.generation = generation;} public GenerationSettingsBuilderWrapped(BiomeGenerationSettingsBuilder generation) {
this.generation = generation;
}
@Override @Override
public @NotNull Optional<Supplier<ConfiguredSurfaceBuilder<?>>> getSurfaceBuilder() { public @NotNull Optional<Supplier<ConfiguredSurfaceBuilder<?>>> getSurfaceBuilder() {
@@ -184,7 +186,9 @@ public class BiomeModificationsImpl {
private static class SpawnSettingsBuilderWrapped implements SpawnProperties { private static class SpawnSettingsBuilderWrapped implements SpawnProperties {
protected final MobSpawnInfoBuilder builder; protected final MobSpawnInfoBuilder builder;
public SpawnSettingsBuilderWrapped(MobSpawnInfoBuilder builder) {this.builder = builder;} public SpawnSettingsBuilderWrapped(MobSpawnInfoBuilder builder) {
this.builder = builder;
}
@Override @Override
public float getCreatureProbability() { public float getCreatureProbability() {

View File

@@ -26,7 +26,8 @@ import net.minecraft.world.level.GameRules;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
public class GameRuleFactoryImpl { public class GameRuleFactoryImpl {
private GameRuleFactoryImpl() {} private GameRuleFactoryImpl() {
}
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue) { public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue) {
return GameRulesAccessor.BooleanValueSimple.invokeCreateArchitectury(defaultValue); return GameRulesAccessor.BooleanValueSimple.invokeCreateArchitectury(defaultValue);

View File

@@ -7,9 +7,17 @@
"client": [ "client": [
], ],
"mixins": [ "mixins": [
"BiomeGenerationSettingsBuilderAccessor", "GameRulesAccessor", "GameRulesAccessor$BooleanValue", "GameRulesAccessor$BooleanValueSimple", "BiomeGenerationSettingsBuilderAccessor",
"GameRulesAccessor$IntegerValue", "GameRulesAccessor$IntegerValueSimple", "MixinBlockEntity", "MixinBlockEntityExtension", "MixinItemExtension", "GameRulesAccessor",
"MixinRegistryEntry", "MobSpawnSettingsBuilderAccessor" "GameRulesAccessor$BooleanValue",
"GameRulesAccessor$BooleanValueSimple",
"GameRulesAccessor$IntegerValue",
"GameRulesAccessor$IntegerValueSimple",
"MixinBlockEntity",
"MixinBlockEntityExtension",
"MixinItemExtension",
"MixinRegistryEntry",
"MobSpawnSettingsBuilderAccessor"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1

View File

@@ -6,7 +6,7 @@ supported_version=1.16.4/5
archives_base_name=architectury archives_base_name=architectury
archives_base_name_snapshot=architectury-snapshot archives_base_name_snapshot=architectury-snapshot
base_version=1.13 base_version=1.14
maven_group=me.shedaniel maven_group=me.shedaniel
fabric_loader_version=0.11.1 fabric_loader_version=0.11.1

View File

@@ -29,7 +29,6 @@ import me.shedaniel.architectury.platform.Platform;
import me.shedaniel.architectury.utils.Env; import me.shedaniel.architectury.utils.Env;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.client.gui.screens.inventory.AnvilScreen; import net.minecraft.client.gui.screens.inventory.AnvilScreen;
import net.minecraft.core.Position; import net.minecraft.core.Position;
import net.minecraft.core.Vec3i; import net.minecraft.core.Vec3i;

View File

@@ -34,5 +34,6 @@ public class TestGameRules {
public static final GameRules.Key<GameRules.BooleanValue> CALLBACK_BOOL = register("callbackBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true, (server, value) -> LOGGER.info("changed to {}", value.get()))); public static final GameRules.Key<GameRules.BooleanValue> CALLBACK_BOOL = register("callbackBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true, (server, value) -> LOGGER.info("changed to {}", value.get())));
public static final GameRules.Key<GameRules.IntegerValue> CALLBACK_INT = register("callbackInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10, (server, value) -> LOGGER.info("changed to {}", value.get()))); public static final GameRules.Key<GameRules.IntegerValue> CALLBACK_INT = register("callbackInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10, (server, value) -> LOGGER.info("changed to {}", value.get())));
public static void init() {} public static void init() {
}
} }

View File

@@ -19,8 +19,8 @@
package me.shedaniel.architectury.test.trade; package me.shedaniel.architectury.test.trade;
import me.shedaniel.architectury.registry.trade.TradeRegistry;
import me.shedaniel.architectury.registry.trade.SimpleTrade; import me.shedaniel.architectury.registry.trade.SimpleTrade;
import me.shedaniel.architectury.registry.trade.TradeRegistry;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.world.entity.npc.VillagerProfession; import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.entity.npc.VillagerTrades; import net.minecraft.world.entity.npc.VillagerTrades;