diff --git a/build.gradle b/build.gradle index b62d4c3d..f0d23bd6 100644 --- a/build.gradle +++ b/build.gradle @@ -56,7 +56,7 @@ allprojects { header = rootProject.file("HEADER") ext { - name = "shedaniel" + name = "architectury" year = "2020, 2021" } diff --git a/common/src/main/java/me/shedaniel/architectury/Architectury.java b/common/src/main/java/me/shedaniel/architectury/Architectury.java index 2b7878fe..ce0c85a7 100644 --- a/common/src/main/java/me/shedaniel/architectury/Architectury.java +++ b/common/src/main/java/me/shedaniel/architectury/Architectury.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/ForgeEvent.java b/common/src/main/java/me/shedaniel/architectury/ForgeEvent.java index b623c1ef..69946567 100644 --- a/common/src/main/java/me/shedaniel/architectury/ForgeEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/ForgeEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/ForgeEventCancellable.java b/common/src/main/java/me/shedaniel/architectury/ForgeEventCancellable.java index d66695f4..f3a218b9 100644 --- a/common/src/main/java/me/shedaniel/architectury/ForgeEventCancellable.java +++ b/common/src/main/java/me/shedaniel/architectury/ForgeEventCancellable.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java b/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java index 0f42b194..458c3a2d 100644 --- a/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java +++ b/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/core/AbstractRecipeSerializer.java b/common/src/main/java/me/shedaniel/architectury/core/AbstractRecipeSerializer.java index c5ec2a13..c758061b 100644 --- a/common/src/main/java/me/shedaniel/architectury/core/AbstractRecipeSerializer.java +++ b/common/src/main/java/me/shedaniel/architectury/core/AbstractRecipeSerializer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/core/RegistryEntry.java b/common/src/main/java/me/shedaniel/architectury/core/RegistryEntry.java index 77cd8e1d..1b8523b6 100644 --- a/common/src/main/java/me/shedaniel/architectury/core/RegistryEntry.java +++ b/common/src/main/java/me/shedaniel/architectury/core/RegistryEntry.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/Actor.java b/common/src/main/java/me/shedaniel/architectury/event/Actor.java index 7d1aa024..aafc670c 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/Actor.java +++ b/common/src/main/java/me/shedaniel/architectury/event/Actor.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/CompoundEventResult.java b/common/src/main/java/me/shedaniel/architectury/event/CompoundEventResult.java new file mode 100644 index 00000000..40f99d3d --- /dev/null +++ b/common/src/main/java/me/shedaniel/architectury/event/CompoundEventResult.java @@ -0,0 +1,147 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.event; + +import net.minecraft.world.InteractionResultHolder; + +/** + * A result from an event, determines if the event should continue to other listeners, + * determines the outcome of the event, and provides extra result for the outcome. + * + * @param the type of the extra result + * @see #pass() + * @see #interrupt(Boolean, Object) + * @see CompoundEventResult + */ +public class CompoundEventResult { + private static final CompoundEventResult PASS = new CompoundEventResult<>(EventResult.pass(), null); + private final EventResult result; + private final T object; + + /** + * Passes the event to other listeners, and does not set an outcome of the event. + * + * @param the type of the extra result + * @return an event that passes the event to other listeners + */ + public static CompoundEventResult pass() { + return (CompoundEventResult) PASS; + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * may or may not set an outcome and extra data of the event. + * + * @param value the outcome of the event, passing {@code null} here means the default outcome, + * which often means falling back to vanilla logic + * @param object the extra data of the result, this usually is the returning value of the event + * @return an event that interrupts the event + */ + public static CompoundEventResult interrupt(Boolean value, T object) { + return new CompoundEventResult<>(EventResult.interrupt(value), object); + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * denotes the {@code true} outcome and may or may not set an extra data of the event. + * + * @param object the extra data of the result, this usually is the returning value of the event + * @return an event that interrupts the event + */ + public static CompoundEventResult interruptTrue(T object) { + return new CompoundEventResult<>(EventResult.interruptTrue(), object); + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * does not set an outcome and may or may not set an extra data of the event. + * + * @param object the extra data of the result, this usually is the returning value of the event + * @return an event that interrupts the event + */ + public static CompoundEventResult interruptDefault(T object) { + return new CompoundEventResult<>(EventResult.interruptDefault(), object); + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * denotes the {@code false} outcome and may or may not set an extra data of the event. + * + * @param object the extra data of the result, this usually is the returning value of the event + * @return an event that interrupts the event + */ + public static CompoundEventResult interruptFalse(T object) { + return new CompoundEventResult<>(EventResult.interruptFalse(), object); + } + + private CompoundEventResult(EventResult result, T object) { + this.result = result; + this.object = object; + } + + /** + * Returns whether this result interrupts the evaluation of other listeners. + * + * @return whether this result interrupts the evaluation of other listeners + */ + public boolean interruptsFurtherEvaluation() { + return result.interruptsFurtherEvaluation(); + } + + /** + * Returns the outcome of the result, an passing result will never have an outcome. + * + * @return the outcome of the result, returns {@code null} if fallback + */ + public Boolean value() { + return result.value(); + } + + /** + * Returns the {@link EventResult} view of the result, this returns the same values as + * {@link #interruptsFurtherEvaluation()} and {@link #value()}. + * + * @return the {@link EventResult} view of the result. + */ + public EventResult result() { + return result; + } + + /** + * Returns the extra data of the result, an passing result will never contain any extra data. + * + * @return the extra data of the result, returns {@code null} if passing + */ + public T object() { + return object; + } + + /** + * Returns the Minecraft-facing result, however ignores {@link #interruptsFurtherEvaluation()}. + * + * @return the Minecraft-facing result + */ + public InteractionResultHolder asMinecraft() { + if (value() != null) { + return value() ? InteractionResultHolder.success(object()) : InteractionResultHolder.fail(object()); + } + return InteractionResultHolder.pass(object()); + } +} diff --git a/common/src/main/java/me/shedaniel/architectury/event/Event.java b/common/src/main/java/me/shedaniel/architectury/event/Event.java index 0af44500..f5d46284 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/Event.java +++ b/common/src/main/java/me/shedaniel/architectury/event/Event.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/EventActor.java b/common/src/main/java/me/shedaniel/architectury/event/EventActor.java new file mode 100644 index 00000000..bb3c7f95 --- /dev/null +++ b/common/src/main/java/me/shedaniel/architectury/event/EventActor.java @@ -0,0 +1,25 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.event; + +@FunctionalInterface +public interface EventActor { + EventResult act(T t); +} diff --git a/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java b/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java index 84cd04c1..792b454b 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java +++ b/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ import me.shedaniel.architectury.ForgeEventCancellable; import me.shedaniel.architectury.annotations.ExpectPlatform; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Method; @@ -83,6 +84,28 @@ public final class EventFactory { })); } + @SafeVarargs + public static Event createEventResult(T... typeGetter) { + if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); + return createEventResult((Class) typeGetter.getClass().getComponentType()); + } + + @SuppressWarnings("UnstableApiUsage") + public static Event createEventResult(Class clazz) { + return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() { + @Override + protected Object handleInvocation(@NotNull Object proxy, @NotNull Method method, Object @NotNull [] args) throws Throwable { + for (T listener : listeners) { + EventResult result = (EventResult) Objects.requireNonNull(method.invoke(listener, args)); + if (result.interruptsFurtherEvaluation()) { + return result; + } + } + return EventResult.pass(); + } + })); + } + @SafeVarargs public static Event createInteractionResultHolder(T... typeGetter) { if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); @@ -105,6 +128,28 @@ public final class EventFactory { })); } + @SafeVarargs + public static Event createCompoundEventResult(T... typeGetter) { + if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); + return createCompoundEventResult((Class) typeGetter.getClass().getComponentType()); + } + + @SuppressWarnings("UnstableApiUsage") + public static Event createCompoundEventResult(Class clazz) { + return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() { + @Override + protected Object handleInvocation(@NotNull Object proxy, @NotNull Method method, Object @NotNull [] args) throws Throwable { + for (T listener : listeners) { + CompoundEventResult result = (CompoundEventResult) Objects.requireNonNull(method.invoke(listener, args)); + if (result.interruptsFurtherEvaluation()) { + return result; + } + } + return CompoundEventResult.pass(); + } + })); + } + @SafeVarargs public static Event> createConsumerLoop(T... typeGetter) { if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); @@ -171,21 +216,75 @@ public final class EventFactory { return event; } + @SafeVarargs + public static Event> createEventActorLoop(T... typeGetter) { + if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); + return createEventActorLoop((Class) typeGetter.getClass().getComponentType()); + } + + @SuppressWarnings("UnstableApiUsage") + public static Event> createEventActorLoop(Class clazz) { + Event> event = of(listeners -> (EventActor) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{EventActor.class}, new AbstractInvocationHandler() { + @Override + protected Object handleInvocation(@NotNull Object proxy, @NotNull Method method, Object @NotNull [] args) throws Throwable { + for (EventActor listener : listeners) { + EventResult result = (EventResult) method.invoke(listener, args); + if (result.interruptsFurtherEvaluation()) { + return result; + } + } + return EventResult.pass(); + } + })); + Class superClass = clazz; + do { + + if (superClass.isAnnotationPresent(ForgeEventCancellable.class)) { + return attachToForgeEventActorCancellable(event); + } + superClass = superClass.getSuperclass(); + } while (superClass != null); + superClass = clazz; + do { + + if (superClass.isAnnotationPresent(ForgeEvent.class)) { + return attachToForgeEventActor(event); + } + superClass = superClass.getSuperclass(); + } while (superClass != null); + return event; + } + @ExpectPlatform + @ApiStatus.Internal public static Event> attachToForge(Event> event) { throw new AssertionError(); } @ExpectPlatform + @ApiStatus.Internal public static Event> attachToForgeActor(Event> event) { throw new AssertionError(); } @ExpectPlatform + @ApiStatus.Internal public static Event> attachToForgeActorCancellable(Event> event) { throw new AssertionError(); } + @ExpectPlatform + @ApiStatus.Internal + public static Event> attachToForgeEventActor(Event> event) { + throw new AssertionError(); + } + + @ExpectPlatform + @ApiStatus.Internal + public static Event> attachToForgeEventActorCancellable(Event> event) { + throw new AssertionError(); + } + private static class EventImpl implements Event { private final Function, T> function; private T invoker = null; diff --git a/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java b/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java index 6502540b..aa7bd970 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java +++ b/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/EventResult.java b/common/src/main/java/me/shedaniel/architectury/event/EventResult.java new file mode 100644 index 00000000..c1802020 --- /dev/null +++ b/common/src/main/java/me/shedaniel/architectury/event/EventResult.java @@ -0,0 +1,115 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.event; + +/** + * A result from an event, determines if the event should continue to other listeners, + * and determines the outcome of the event. + * + * @see #pass() + * @see #interrupt(Boolean) + * @see CompoundEventResult + */ +public final class EventResult { + private static final EventResult TRUE = new EventResult(true, true); + private static final EventResult STOP = new EventResult(true, null); + private static final EventResult PASS = new EventResult(false, null); + private static final EventResult FALSE = new EventResult(true, false); + + /** + * Passes the event to other listeners, and does not set an outcome of the event. + * + * @return an event that passes the event to other listeners + */ + public static EventResult pass() { + return PASS; + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * may or may not set an outcome of the event. + * + * @param value the outcome of the event, passing {@code null} here means the default outcome, + * which often means falling back to vanilla logic + * @return an event that interrupts the event + */ + public static EventResult interrupt(Boolean value) { + if (value == null) return STOP; + if (value) return TRUE; + return FALSE; + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * and denotes the {@code true} outcome. + * + * @return an event that interrupts the event + */ + public static EventResult interruptTrue() { + return TRUE; + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * and does not set an outcome. + * + * @return an event that interrupts the event + */ + public static EventResult interruptDefault() { + return STOP; + } + + /** + * Interrupts the event and stops it from being passed on to other listeners, + * and denotes the {@code false} outcome. + * + * @return an event that interrupts the event + */ + public static EventResult interruptFalse() { + return FALSE; + } + + private final boolean interruptsFurtherEvaluation; + + private final Boolean value; + + EventResult(boolean interruptsFurtherEvaluation, Boolean value) { + this.interruptsFurtherEvaluation = interruptsFurtherEvaluation; + this.value = value; + } + + /** + * Returns whether this result interrupts the evaluation of other listeners. + * + * @return whether this result interrupts the evaluation of other listeners + */ + public boolean interruptsFurtherEvaluation() { + return interruptsFurtherEvaluation; + } + + /** + * Returns the outcome of the result, an passing result will never have an outcome. + * + * @return the outcome of the result, returns {@code null} if fallback + */ + public Boolean value() { + return value; + } +} diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/BlockEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/BlockEvent.java index 4c783f1b..2ada5de3 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/BlockEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/BlockEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/ChatEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/ChatEvent.java index 87aba021..accdacd3 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/ChatEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/ChatEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/CommandPerformEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/CommandPerformEvent.java index 99b32364..3664e7e5 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/CommandPerformEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/CommandPerformEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/CommandRegistrationEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/CommandRegistrationEvent.java index 97103893..cc36daa1 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/CommandRegistrationEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/CommandRegistrationEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java index 2120d6df..c60cc221 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,12 +21,16 @@ package me.shedaniel.architectury.event.events; import me.shedaniel.architectury.event.Event; import me.shedaniel.architectury.event.EventFactory; +import me.shedaniel.architectury.event.EventResult; import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.BaseSpawner; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; @@ -40,10 +44,18 @@ public interface EntityEvent { * Invoked before LivingEntity#hurt, equivalent to forge's {@code LivingAttackEvent}. */ Event LIVING_ATTACK = EventFactory.createInteractionResult(); + /** + * Invoked when an entity is about to be spawned, equivalent to forge's {@code LivingSpawnEvent.CheckSpawn} + */ + Event LIVING_CHECK_SPAWN = EventFactory.createEventResult(); /** * Invoked before entity is added to a world, equivalent to forge's {@code EntityJoinWorldEvent}. */ Event ADD = EventFactory.createInteractionResult(); + /** + * Invoked when an entity enters a chunk, equivalent to forge's {@code EnteringChunk} + */ + Event ENTER_CHUNK = EventFactory.createLoop(); interface LivingDeath { InteractionResult die(LivingEntity entity, DamageSource source); @@ -53,7 +65,16 @@ public interface EntityEvent { InteractionResult attack(LivingEntity entity, DamageSource source, float amount); } + interface LivingCheckSpawn { + EventResult canSpawn(LivingEntity entity, LevelAccessor world, double x, double y, double z, MobSpawnType type, @Nullable BaseSpawner spawner); + } + interface Add { InteractionResult add(Entity entity, Level world); } + + interface EnterChunk { + void enterChunk(Entity entity, int chunkX, int chunkZ, int prevX, int prevZ); + } + } diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/ExplosionEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/ExplosionEvent.java index 9a2699bc..9c5b8b23 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/ExplosionEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/ExplosionEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/GuiEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/GuiEvent.java index 9a7863f5..0dfc41dc 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/GuiEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/GuiEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/InteractionEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/InteractionEvent.java index 286380e2..8e62f002 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/InteractionEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/InteractionEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,6 +21,7 @@ package me.shedaniel.architectury.event.events; import me.shedaniel.architectury.event.Event; import me.shedaniel.architectury.event.EventFactory; +import me.shedaniel.architectury.event.EventResult; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; @@ -29,6 +30,7 @@ import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; public interface InteractionEvent { @@ -38,6 +40,10 @@ public interface InteractionEvent { Event CLIENT_LEFT_CLICK_AIR = EventFactory.createLoop(); Event CLIENT_RIGHT_CLICK_AIR = EventFactory.createLoop(); Event INTERACT_ENTITY = EventFactory.createInteractionResult(); + /** + * Invoked before a farmland block is trampled by an entity, equivalent to forge's {@code BlockEvent.FarmlandTrampleEvent} + */ + Event FARMLAND_TRAMPLE = EventFactory.createEventResult(); interface RightClickBlock { InteractionResult click(Player player, InteractionHand hand, BlockPos pos, Direction face); @@ -66,4 +72,8 @@ public interface InteractionEvent { interface BlockBreak { InteractionResult breakBlock(Player player, BlockPos pos, BlockState state); } + + interface FarmlandTrample { + EventResult trample(Level world, BlockPos pos, BlockState state, float distance, Entity entity); + } } diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/LifecycleEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/LifecycleEvent.java index 1fb689e1..0794edca 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/LifecycleEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/LifecycleEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/LightningEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/LightningEvent.java index f1fac890..e5a6dfcb 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/LightningEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/LightningEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java index 2c7320dd..4a2f2475 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,7 @@ package me.shedaniel.architectury.event.events; +import me.shedaniel.architectury.event.CompoundEventResult; import me.shedaniel.architectury.event.Event; import me.shedaniel.architectury.event.EventFactory; import me.shedaniel.architectury.utils.IntValue; @@ -34,6 +35,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.HitResult; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; @@ -51,6 +53,14 @@ public interface PlayerEvent { Event DROP_ITEM = EventFactory.createLoop(); Event OPEN_MENU = EventFactory.createLoop(); Event CLOSE_MENU = EventFactory.createLoop(); + /** + * Invoked when a player attempts to fill a bucket using right-click. + * You can return a non-PASS interaction result to cancel further processing by other mods. + *

+ * On Forge, FAIL cancels the event, and SUCCESS sets the event as handled. + * On Fabric, any non-PASS result is returned directly and immediately. + */ + Event FILL_BUCKET = EventFactory.createCompoundEventResult(); interface PlayerJoin { void join(ServerPlayer player); @@ -103,4 +113,8 @@ public interface PlayerEvent { interface CloseMenu { void close(Player player, AbstractContainerMenu menu); } + + interface FillBucket { + CompoundEventResult fill(Player player, Level level, ItemStack stack, @Nullable HitResult target); + } } diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/RecipeUpdateEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/RecipeUpdateEvent.java index bccd8681..2bd68e4e 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/RecipeUpdateEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/RecipeUpdateEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/TextureStitchEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/TextureStitchEvent.java index 8079675c..4103ea91 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/TextureStitchEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/TextureStitchEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/TickEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/TickEvent.java index fcfd20fc..1e132dc5 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/TickEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/TickEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/TooltipEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/TooltipEvent.java index 8a492439..eebb1998 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/TooltipEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/TooltipEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientChatEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientChatEvent.java index 3ae2273a..5c35146d 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientChatEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientChatEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientLifecycleEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientLifecycleEvent.java index fb03e34b..999ebf07 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientLifecycleEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientLifecycleEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientPlayerEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientPlayerEvent.java index cd53ab52..359172d0 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientPlayerEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientPlayerEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientRawInputEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientRawInputEvent.java index 5b4c759e..dad3e44a 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientRawInputEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientRawInputEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientScreenInputEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientScreenInputEvent.java index ceeedbf7..2fdec177 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientScreenInputEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientScreenInputEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientTickEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientTickEvent.java index 56b5e6ae..319f80b6 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientTickEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/client/ClientTickEvent.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/extensions/BlockEntityExtension.java b/common/src/main/java/me/shedaniel/architectury/extensions/BlockEntityExtension.java index 0add5bb1..ab84b386 100644 --- a/common/src/main/java/me/shedaniel/architectury/extensions/BlockEntityExtension.java +++ b/common/src/main/java/me/shedaniel/architectury/extensions/BlockEntityExtension.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/extensions/ItemExtension.java b/common/src/main/java/me/shedaniel/architectury/extensions/ItemExtension.java new file mode 100644 index 00000000..40fa182a --- /dev/null +++ b/common/src/main/java/me/shedaniel/architectury/extensions/ItemExtension.java @@ -0,0 +1,50 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.extensions; + +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.Nullable; + +/** + * Extensions to {@link net.minecraft.world.item.Item}, implement this on to your item. + */ +public interface ItemExtension { + /** + * Invoked every tick when this item is equipped. + * + * @param stack the item stack + * @param player the player wearing the armor + */ + default void tickArmor(ItemStack stack, Player player) { + } + + /** + * Returns the {@link EquipmentSlot} for {@link ItemStack}. + * + * @param stack the item stack + * @return the {@link EquipmentSlot}, return {@code null} to default to vanilla's {@link net.minecraft.world.entity.Mob#getEquipmentSlotForItem(ItemStack)} + */ + @Nullable + default EquipmentSlot getCustomEquipmentSlot(ItemStack stack) { + return null; + } +} diff --git a/common/src/main/java/me/shedaniel/architectury/fluid/FluidStack.java b/common/src/main/java/me/shedaniel/architectury/fluid/FluidStack.java index dfc45af0..474193a3 100644 --- a/common/src/main/java/me/shedaniel/architectury/fluid/FluidStack.java +++ b/common/src/main/java/me/shedaniel/architectury/fluid/FluidStack.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java index 0027d319..f44de4c3 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/DyeColorHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/DyeColorHooks.java index a51c9d59..5b378a07 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/DyeColorHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/DyeColorHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/EntityHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/EntityHooks.java index 96dcff38..2113543d 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/EntityHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/EntityHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/ExplosionHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/ExplosionHooks.java index 8b8b4b48..60221be7 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/ExplosionHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/ExplosionHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/FluidStackHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/FluidStackHooks.java index 67b533f6..2ebc0f8d 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/FluidStackHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/FluidStackHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/ItemEntityHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/ItemEntityHooks.java index a3d52cd0..18ac127c 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/ItemEntityHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/ItemEntityHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/ItemStackHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/ItemStackHooks.java index a8e6d0f2..4ea35c01 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/ItemStackHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/ItemStackHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/LevelResourceHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/LevelResourceHooks.java index 3eb08748..23487e36 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/LevelResourceHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/LevelResourceHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/PackRepositoryHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/PackRepositoryHooks.java index 806c13a3..f7bf8182 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/PackRepositoryHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/PackRepositoryHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java index f775a6bf..573b2209 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/PlayerHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/ScreenHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/ScreenHooks.java index f133bc5a..471eb86e 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/ScreenHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/ScreenHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/TagHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/TagHooks.java index c596fcf0..40e5492f 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/TagHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/TagHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeHooks.java index 45b05583..ef4b4543 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeProperties.java b/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeProperties.java index 650169fc..45b02374 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeProperties.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/biome/BiomeProperties.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/biome/ClimateProperties.java b/common/src/main/java/me/shedaniel/architectury/hooks/biome/ClimateProperties.java index 0213ad32..e35cf16f 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/biome/ClimateProperties.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/biome/ClimateProperties.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/biome/EffectsProperties.java b/common/src/main/java/me/shedaniel/architectury/hooks/biome/EffectsProperties.java index 11c1032c..b6f807a0 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/biome/EffectsProperties.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/biome/EffectsProperties.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/biome/GenerationProperties.java b/common/src/main/java/me/shedaniel/architectury/hooks/biome/GenerationProperties.java index 73ba4448..78e3fd34 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/biome/GenerationProperties.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/biome/GenerationProperties.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/biome/SpawnProperties.java b/common/src/main/java/me/shedaniel/architectury/hooks/biome/SpawnProperties.java index b9ec19a3..228a9ad3 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/biome/SpawnProperties.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/biome/SpawnProperties.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventColorContextImpl.java b/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventColorContextImpl.java index 93cdcee2..1803944f 100644 --- a/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventColorContextImpl.java +++ b/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventColorContextImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventPositionContextImpl.java b/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventPositionContextImpl.java index cb089f46..db50d936 100644 --- a/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventPositionContextImpl.java +++ b/common/src/main/java/me/shedaniel/architectury/impl/TooltipEventPositionContextImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/mixin/FluidTagsAccessor.java b/common/src/main/java/me/shedaniel/architectury/mixin/FluidTagsAccessor.java index f095c06e..bb3426a8 100644 --- a/common/src/main/java/me/shedaniel/architectury/mixin/FluidTagsAccessor.java +++ b/common/src/main/java/me/shedaniel/architectury/mixin/FluidTagsAccessor.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/mixin/MixinFallingBlockEntity.java b/common/src/main/java/me/shedaniel/architectury/mixin/MixinFallingBlockEntity.java index 7e2b327e..1f587e11 100644 --- a/common/src/main/java/me/shedaniel/architectury/mixin/MixinFallingBlockEntity.java +++ b/common/src/main/java/me/shedaniel/architectury/mixin/MixinFallingBlockEntity.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/mixin/MixinLightningBolt.java b/common/src/main/java/me/shedaniel/architectury/mixin/MixinLightningBolt.java index 38b7bf46..5c400327 100644 --- a/common/src/main/java/me/shedaniel/architectury/mixin/MixinLightningBolt.java +++ b/common/src/main/java/me/shedaniel/architectury/mixin/MixinLightningBolt.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java b/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java index 8e4fab79..1f4c1df2 100644 --- a/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java +++ b/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/networking/NetworkManager.java b/common/src/main/java/me/shedaniel/architectury/networking/NetworkManager.java index 51a74cd1..d643596a 100644 --- a/common/src/main/java/me/shedaniel/architectury/networking/NetworkManager.java +++ b/common/src/main/java/me/shedaniel/architectury/networking/NetworkManager.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/platform/Mod.java b/common/src/main/java/me/shedaniel/architectury/platform/Mod.java index 1cd8f98a..45241b26 100644 --- a/common/src/main/java/me/shedaniel/architectury/platform/Mod.java +++ b/common/src/main/java/me/shedaniel/architectury/platform/Mod.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/platform/Platform.java b/common/src/main/java/me/shedaniel/architectury/platform/Platform.java index 4f2fe40f..a6543cde 100644 --- a/common/src/main/java/me/shedaniel/architectury/platform/Platform.java +++ b/common/src/main/java/me/shedaniel/architectury/platform/Platform.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/BiomeModifications.java b/common/src/main/java/me/shedaniel/architectury/registry/BiomeModifications.java index 2777a465..96fc62c0 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/BiomeModifications.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/BiomeModifications.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/BlockEntityRenderers.java b/common/src/main/java/me/shedaniel/architectury/registry/BlockEntityRenderers.java index 525ebad8..6a9eecbc 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/BlockEntityRenderers.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/BlockEntityRenderers.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/BlockProperties.java b/common/src/main/java/me/shedaniel/architectury/registry/BlockProperties.java index 27166adf..ccea650a 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/BlockProperties.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/BlockProperties.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/BlockPropertiesExtension.java b/common/src/main/java/me/shedaniel/architectury/registry/BlockPropertiesExtension.java index 4bd22b92..1d13f703 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/BlockPropertiesExtension.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/BlockPropertiesExtension.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/ColorHandlers.java b/common/src/main/java/me/shedaniel/architectury/registry/ColorHandlers.java index 4be8cbae..908d179b 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/ColorHandlers.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/ColorHandlers.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/CreativeTabs.java b/common/src/main/java/me/shedaniel/architectury/registry/CreativeTabs.java index c6c55ca3..3e285dd8 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/CreativeTabs.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/CreativeTabs.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/CriteriaTriggersRegistry.java b/common/src/main/java/me/shedaniel/architectury/registry/CriteriaTriggersRegistry.java index 8592aba8..dbd0dab1 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/CriteriaTriggersRegistry.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/CriteriaTriggersRegistry.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/DeferredRegister.java b/common/src/main/java/me/shedaniel/architectury/registry/DeferredRegister.java index f0945182..5b9514c9 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/DeferredRegister.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/DeferredRegister.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java index 8efef201..72a77484 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java index bae13668..c6a4946c 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/KeyBindings.java b/common/src/main/java/me/shedaniel/architectury/registry/KeyBindings.java index 6bcbdcc4..c774a2fc 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/KeyBindings.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/KeyBindings.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/MenuRegistry.java b/common/src/main/java/me/shedaniel/architectury/registry/MenuRegistry.java index f6715b0f..f3696b35 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/MenuRegistry.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/MenuRegistry.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/Registries.java b/common/src/main/java/me/shedaniel/architectury/registry/Registries.java index 60377776..6023d189 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/Registries.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/Registries.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/Registry.java b/common/src/main/java/me/shedaniel/architectury/registry/Registry.java index 0c512eeb..a25a5b3d 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/Registry.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/Registry.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/RegistrySupplier.java b/common/src/main/java/me/shedaniel/architectury/registry/RegistrySupplier.java index a9bde6c9..cdeedf4e 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/RegistrySupplier.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/RegistrySupplier.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/ReloadListeners.java b/common/src/main/java/me/shedaniel/architectury/registry/ReloadListeners.java index bed17a3e..1cc90a48 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/ReloadListeners.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/ReloadListeners.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/RenderTypes.java b/common/src/main/java/me/shedaniel/architectury/registry/RenderTypes.java index 9fc7643d..a91729d5 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/RenderTypes.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/RenderTypes.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/ToolType.java b/common/src/main/java/me/shedaniel/architectury/registry/ToolType.java index 8e41d1dd..6c2ec82a 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/ToolType.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/ToolType.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/entity/EntityRenderers.java b/common/src/main/java/me/shedaniel/architectury/registry/entity/EntityRenderers.java index a2ecc0bf..437e9cd4 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/entity/EntityRenderers.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/entity/EntityRenderers.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/menu/ExtendedMenuProvider.java b/common/src/main/java/me/shedaniel/architectury/registry/menu/ExtendedMenuProvider.java index 70ef6641..4c96f7f4 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/menu/ExtendedMenuProvider.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/menu/ExtendedMenuProvider.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryBuilder.java b/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryBuilder.java index 9f2df633..cb130c6a 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryBuilder.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryBuilder.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryOption.java b/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryOption.java index 8b7bebb5..a02bee9a 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryOption.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/registries/RegistryOption.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/registry/registries/StandardRegistryOption.java b/common/src/main/java/me/shedaniel/architectury/registry/registries/StandardRegistryOption.java index 34783086..6b23081c 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/registries/StandardRegistryOption.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/registries/StandardRegistryOption.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/BooleanValue.java b/common/src/main/java/me/shedaniel/architectury/utils/BooleanValue.java index 6389cfca..8a86b7f4 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/BooleanValue.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/BooleanValue.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/DoubleValue.java b/common/src/main/java/me/shedaniel/architectury/utils/DoubleValue.java index 119231cc..a861870b 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/DoubleValue.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/DoubleValue.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/Env.java b/common/src/main/java/me/shedaniel/architectury/utils/Env.java index 907e3de6..de9e27b4 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/Env.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/Env.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/EnvExecutor.java b/common/src/main/java/me/shedaniel/architectury/utils/EnvExecutor.java index 87b6e346..088a51ce 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/EnvExecutor.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/EnvExecutor.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/FloatSupplier.java b/common/src/main/java/me/shedaniel/architectury/utils/FloatSupplier.java index 5453c29f..33a77df3 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/FloatSupplier.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/FloatSupplier.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/FloatValue.java b/common/src/main/java/me/shedaniel/architectury/utils/FloatValue.java index 725e5a14..cc5ea1d0 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/FloatValue.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/FloatValue.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/GameInstance.java b/common/src/main/java/me/shedaniel/architectury/utils/GameInstance.java index ffad77f3..d1fc42d3 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/GameInstance.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/GameInstance.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/IntValue.java b/common/src/main/java/me/shedaniel/architectury/utils/IntValue.java index b3ab6641..0bd936e3 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/IntValue.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/IntValue.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/LongValue.java b/common/src/main/java/me/shedaniel/architectury/utils/LongValue.java index a77f2af3..500dbe2c 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/LongValue.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/LongValue.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/PlatformExpectedError.java b/common/src/main/java/me/shedaniel/architectury/utils/PlatformExpectedError.java index 66a75bea..96bf0d67 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/PlatformExpectedError.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/PlatformExpectedError.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/common/src/main/java/me/shedaniel/architectury/utils/Value.java b/common/src/main/java/me/shedaniel/architectury/utils/Value.java index 284e36fc..ecb63d70 100644 --- a/common/src/main/java/me/shedaniel/architectury/utils/Value.java +++ b/common/src/main/java/me/shedaniel/architectury/utils/Value.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/compat/fabric/ModMenuCompatibility.java b/fabric/src/main/java/me/shedaniel/architectury/compat/fabric/ModMenuCompatibility.java index 9d2f6f26..065305be 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/compat/fabric/ModMenuCompatibility.java +++ b/fabric/src/main/java/me/shedaniel/architectury/compat/fabric/ModMenuCompatibility.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventFactoryImpl.java b/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventFactoryImpl.java index 48c881ca..f2f18400 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventFactoryImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventFactoryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,6 +21,8 @@ package me.shedaniel.architectury.event.fabric; import me.shedaniel.architectury.event.Actor; import me.shedaniel.architectury.event.Event; +import me.shedaniel.architectury.event.EventActor; +import org.jetbrains.annotations.ApiStatus; import java.util.function.Consumer; @@ -36,4 +38,14 @@ public class EventFactoryImpl { public static Event> attachToForgeActorCancellable(Event> event) { return event; } + + @ApiStatus.Internal + public static Event> attachToForgeEventActor(Event> event) { + return event; + } + + @ApiStatus.Internal + public static Event> attachToForgeEventActorCancellable(Event> event) { + return event; + } } diff --git a/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventHandlerImpl.java b/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventHandlerImpl.java index 11e907a1..a170f860 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventHandlerImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/event/fabric/EventHandlerImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/BlockEntityHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/BlockEntityHooksImpl.java index e2c8c284..9df256a3 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/BlockEntityHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/BlockEntityHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/DyeColorHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/DyeColorHooksImpl.java index ad9d62f8..000d89b6 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/DyeColorHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/DyeColorHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/EntityHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/EntityHooksImpl.java index beda611b..f2524632 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/EntityHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/EntityHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ExplosionHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ExplosionHooksImpl.java index 57000713..bf18cc78 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ExplosionHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ExplosionHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/FluidStackHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/FluidStackHooksImpl.java index d113bc0b..49916ad1 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/FluidStackHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/FluidStackHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ItemEntityHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ItemEntityHooksImpl.java index 73f81284..a4022c4c 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ItemEntityHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ItemEntityHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PackRepositoryHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PackRepositoryHooksImpl.java index c5e09193..aa0e366f 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PackRepositoryHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PackRepositoryHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PersistentEntitySectionManagerHooks.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PersistentEntitySectionManagerHooks.java index ca0dbe2b..74061961 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PersistentEntitySectionManagerHooks.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PersistentEntitySectionManagerHooks.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java index c62139d8..9febe502 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/PlayerHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ScreenHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ScreenHooksImpl.java index a97a2959..ee8c1c96 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ScreenHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/ScreenHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/TagHooksImpl.java b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/TagHooksImpl.java index 378405c8..6b848be4 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/TagHooksImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/hooks/fabric/TagHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/impl/fabric/ScreenInputDelegate.java b/fabric/src/main/java/me/shedaniel/architectury/impl/fabric/ScreenInputDelegate.java index 2d5b1d22..6549b16b 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/impl/fabric/ScreenInputDelegate.java +++ b/fabric/src/main/java/me/shedaniel/architectury/impl/fabric/ScreenInputDelegate.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/init/fabric/ArchitecturyClient.java b/fabric/src/main/java/me/shedaniel/architectury/init/fabric/ArchitecturyClient.java index 4a050f16..3d1f2046 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/init/fabric/ArchitecturyClient.java +++ b/fabric/src/main/java/me/shedaniel/architectury/init/fabric/ArchitecturyClient.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/ExplosionPreInvoker.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/ExplosionPreInvoker.java index 8cc51bd4..d6d352bd 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/ExplosionPreInvoker.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/ExplosionPreInvoker.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/LivingDeathInvoker.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/LivingDeathInvoker.java index 6e39ee88..b48c1935 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/LivingDeathInvoker.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/LivingDeathInvoker.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBaseSpawner.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBaseSpawner.java new file mode 100644 index 00000000..9dbe6640 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBaseSpawner.java @@ -0,0 +1,63 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.EventResult; +import me.shedaniel.architectury.event.events.EntityEvent; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.BaseSpawner; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(BaseSpawner.class) +public abstract class MixinBaseSpawner { + @Redirect( + method = "tick", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/Mob;checkSpawnRules(Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/world/entity/MobSpawnType;)Z", + ordinal = 0 + ) + ) + private boolean checkSpawnerSpawn(Mob mob, LevelAccessor level, MobSpawnType type) { + EventResult result = EntityEvent.LIVING_CHECK_SPAWN.invoker() + .canSpawn(mob, level, mob.getX(), mob.getY(), mob.getZ(), type, (BaseSpawner) (Object) this); + if (result.value() != null) { + return result.value(); + } + return mob.checkSpawnRules(level, type) && mob.checkSpawnObstruction(level); + } + + @Redirect( + method = "tick", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/Mob;checkSpawnObstruction(Lnet/minecraft/world/level/LevelReader;)Z", + ordinal = 0 + ) + ) + private boolean skipDoubleObstruction(Mob mob, LevelReader levelReader) { + return true; + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockEntityExtension.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockEntityExtension.java index bcb97b89..c533a3e3 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockEntityExtension.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockEntityExtension.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockItem.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockItem.java index 73fb715f..70c31fb9 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockItem.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBlockItem.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBucketItem.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBucketItem.java new file mode 100644 index 00000000..da207df4 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinBucketItem.java @@ -0,0 +1,58 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.CompoundEventResult; +import me.shedaniel.architectury.event.events.PlayerEvent; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.HitResult; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +@Mixin(BucketItem.class) +public class MixinBucketItem { + + @Inject( + method = "use", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/phys/HitResult;getType()Lnet/minecraft/world/phys/HitResult$Type;", + ordinal = 0 + ), + locals = LocalCapture.CAPTURE_FAILHARD, + cancellable = true + ) + public void fillBucket(Level level, Player player, InteractionHand hand, CallbackInfoReturnable> cir, ItemStack stack, HitResult target) { + CompoundEventResult result = PlayerEvent.FILL_BUCKET.invoker().fill(player, level, stack, target); + if (result.interruptsFurtherEvaluation() && result.value() != null) { + cir.setReturnValue(result.asMinecraft()); + cir.cancel(); + } + } + +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCatSpawner.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCatSpawner.java new file mode 100644 index 00000000..debdd5dd --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCatSpawner.java @@ -0,0 +1,52 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.events.EntityEvent; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.animal.Cat; +import net.minecraft.world.entity.npc.CatSpawner; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +@Mixin(CatSpawner.class) +public abstract class MixinCatSpawner { + @Inject( + method = "spawnCat", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/animal/Cat;finalizeSpawn(Lnet/minecraft/world/level/ServerLevelAccessor;Lnet/minecraft/world/DifficultyInstance;Lnet/minecraft/world/entity/MobSpawnType;Lnet/minecraft/world/entity/SpawnGroupData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/world/entity/SpawnGroupData;", + ordinal = 0 + ), + cancellable = true, + locals = LocalCapture.CAPTURE_FAILHARD + ) + private void checkCatSpawn(BlockPos pos, ServerLevel level, CallbackInfoReturnable cir, Cat entity) { + if (EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(entity, level, pos.getX(), pos.getY(), pos.getZ(), MobSpawnType.NATURAL, null).value() == Boolean.FALSE) { + cir.setReturnValue(0); + cir.cancel(); + } + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCommands.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCommands.java index 60e8c7c8..70de43ae 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCommands.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinCommands.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinDedicatedServer.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinDedicatedServer.java index 5a2ea780..c07f4747 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinDedicatedServer.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinDedicatedServer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinExplosion.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinExplosion.java index 4b68e7e1..f1e9b00e 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinExplosion.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinExplosion.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFarmBlock.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFarmBlock.java new file mode 100644 index 00000000..43a491e9 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFarmBlock.java @@ -0,0 +1,65 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.events.InteractionEvent; +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.level.Level; +import net.minecraft.world.level.block.FarmBlock; +import net.minecraft.world.level.block.state.BlockState; +import org.apache.commons.lang3.tuple.Triple; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(FarmBlock.class) +public abstract class MixinFarmBlock { + @Unique + private static ThreadLocal> turnToDirtLocal = new ThreadLocal<>(); + + @Inject( + method = "fallOn", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/level/block/FarmBlock;turnToDirt(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)V" + ) + ) + private void fallOn(Level level, BlockPos blockPos, Entity entity, float f, CallbackInfo ci) { + turnToDirtLocal.set(Triple.of(blockPos.asLong(), f, entity)); + } + + @Inject(method = "turnToDirt", at = @At("HEAD"), cancellable = true) + private static void turnToDirt(BlockState state, Level level, BlockPos pos, CallbackInfo ci) { + Triple triple = turnToDirtLocal.get(); + turnToDirtLocal.remove(); + if (triple != null && triple.getLeft() == pos.asLong()) { + if (InteractionEvent.FARMLAND_TRAMPLE.invoker().trample(level, pos, state, triple.getMiddle(), triple.getRight()).value() != null) { + ci.cancel(); + } + } + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFurnaceResultSlot.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFurnaceResultSlot.java index 3313713d..27692b9d 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFurnaceResultSlot.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinFurnaceResultSlot.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinInventory.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinInventory.java new file mode 100644 index 00000000..73133306 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinInventory.java @@ -0,0 +1,52 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.extensions.ItemExtension; +import net.minecraft.core.NonNullList; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(Inventory.class) +public class MixinInventory { + @Shadow + @Final + public NonNullList armor; + + @Shadow + @Final + public Player player; + + @Inject(method = "tick", at = @At("RETURN")) + private void updateItems(CallbackInfo ci) { + for (ItemStack stack : armor) { + if (stack.getItem() instanceof ItemExtension) { + ((ItemExtension) stack.getItem()).tickArmor(stack, player); + } + } + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinItemEntity.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinItemEntity.java index a1cee332..124b9a52 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinItemEntity.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinItemEntity.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLevelChunk.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLevelChunk.java new file mode 100644 index 00000000..957d6917 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLevelChunk.java @@ -0,0 +1,51 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.events.EntityEvent; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.ChunkPos; +import net.minecraft.world.level.chunk.LevelChunk; +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(LevelChunk.class) +public class MixinLevelChunk { + @Shadow @Final private ChunkPos chunkPos; + + @Inject( + method = "addEntity", + at = @At( + value = "FIELD", + opcode = Opcodes.PUTFIELD, + target = "Lnet/minecraft/world/entity/Entity;inChunk:Z", + shift = At.Shift.BY, + by = -1 + ) + ) + public void enterChunk(Entity entity, CallbackInfo ci) { + EntityEvent.ENTER_CHUNK.invoker().enterChunk(entity, this.chunkPos.x, this.chunkPos.z, entity.xChunk, entity.zChunk); + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLivingEntity.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLivingEntity.java index 9a899ae8..cc3d16b3 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLivingEntity.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLivingEntity.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinMob.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinMob.java new file mode 100644 index 00000000..a58a6a93 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinMob.java @@ -0,0 +1,44 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.extensions.ItemExtension; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(Mob.class) +public class MixinMob { + @Inject(method = "getEquipmentSlotForItem", at = @At("HEAD"), cancellable = true) + private static void getEquipmentSlotForItem(ItemStack stack, CallbackInfoReturnable cir) { + Item item = stack.getItem(); + if (item instanceof ItemExtension) { + EquipmentSlot slot = ((ItemExtension) item).getCustomEquipmentSlot(stack); + if (slot != null) { + cir.setReturnValue(slot); + } + } + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinNaturalSpawner.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinNaturalSpawner.java new file mode 100644 index 00000000..5827b953 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinNaturalSpawner.java @@ -0,0 +1,74 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.EventResult; +import me.shedaniel.architectury.event.events.EntityEvent; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.*; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.NaturalSpawner; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(NaturalSpawner.class) +public abstract class MixinNaturalSpawner { + @Shadow + private static boolean isValidPositionForMob(ServerLevel serverLevel, Mob mob, double d) { + return false; + } + + @Redirect( + method = "spawnCategoryForPosition", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/level/NaturalSpawner;isValidPositionForMob(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/Mob;D)Z", + ordinal = 0 + ) + ) + private static boolean overrideNaturalSpawnCondition(ServerLevel level, Mob entity, double f) { + EventResult result = EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(entity, level, entity.xOld, entity.yOld, entity.zOld, MobSpawnType.NATURAL, null); + if (result.value() != null) { + return result.value(); + } else { + return isValidPositionForMob(level, entity, f); + } + } + + @Redirect( + method = "spawnMobsForChunkGeneration", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/Mob;checkSpawnRules(Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/world/entity/MobSpawnType;)Z", + ordinal = 0 + ) + ) + private static boolean overrideChunkGenSpawnCondition(Mob mob, LevelAccessor level, MobSpawnType type) { + EventResult result = EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(mob, level, mob.xOld, mob.yOld, mob.zOld, MobSpawnType.CHUNK_GENERATION, null); + if (result.value() != null) { + return result.value(); + } else { + return mob.checkSpawnRules(level, type); + } + } + +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPatrolSpawner.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPatrolSpawner.java new file mode 100644 index 00000000..9abee30b --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPatrolSpawner.java @@ -0,0 +1,58 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.EventResult; +import me.shedaniel.architectury.event.events.EntityEvent; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.monster.PatrollingMonster; +import net.minecraft.world.level.levelgen.PatrolSpawner; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import java.util.Random; + +@Mixin(PatrolSpawner.class) +public abstract class MixinPatrolSpawner { + + @Inject( + method = "spawnPatrolMember", + at = @At( + value = "INVOKE_ASSIGN", + target = "Lnet/minecraft/world/entity/EntityType;create(Lnet/minecraft/world/level/Level;)Lnet/minecraft/world/entity/Entity;", + ordinal = 0, + shift = At.Shift.BY, + by = 2 + ), + cancellable = true, + locals = LocalCapture.CAPTURE_FAILHARD + ) + private void checkPatrolSpawn(ServerLevel level, BlockPos pos, Random r, boolean b, CallbackInfoReturnable cir, PatrollingMonster entity) { + EventResult result = EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(entity, level, pos.getX(), pos.getY(), pos.getZ(), MobSpawnType.PATROL, null); + if (result.value() != null) { + cir.setReturnValue(result.value()); + } + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPhantomSpawner.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPhantomSpawner.java new file mode 100644 index 00000000..322b79e6 --- /dev/null +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPhantomSpawner.java @@ -0,0 +1,63 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.fabric; + +import me.shedaniel.architectury.event.events.EntityEvent; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.SpawnGroupData; +import net.minecraft.world.entity.monster.Phantom; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.levelgen.PhantomSpawner; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import java.util.Iterator; +import java.util.Random; + +@Mixin(PhantomSpawner.class) +public abstract class MixinPhantomSpawner { + + @Inject( + method = "tick", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/monster/Phantom;finalizeSpawn(Lnet/minecraft/world/level/ServerLevelAccessor;Lnet/minecraft/world/DifficultyInstance;Lnet/minecraft/world/entity/MobSpawnType;Lnet/minecraft/world/entity/SpawnGroupData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/world/entity/SpawnGroupData;", + ordinal = 0, + shift = At.Shift.BEFORE + ), + cancellable = true, + locals = LocalCapture.CAPTURE_FAILSOFT // SOFT, because this will break in 2 seconds + ) + private void checkPhantomSpawn(ServerLevel level, boolean bl, boolean bl2, CallbackInfoReturnable cir, + Random random, int i, Iterator it, Player player, BlockPos pos, DifficultyInstance diff, BlockPos pos2, + SpawnGroupData sgd, int l, int m, Phantom entity) { + if (EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(entity, level, pos.getX(), pos.getY(), pos.getZ(), MobSpawnType.NATURAL, null).value() == Boolean.FALSE) { + cir.setReturnValue(0); + cir.cancel(); + } + } +} diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayer.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayer.java index 22fd42d5..1af6979c 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayer.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerAdvancements.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerAdvancements.java index a9360ec8..5edda21d 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerAdvancements.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerAdvancements.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerList.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerList.java index e06ec66c..71e6ee93 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerList.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinPlayerList.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinResultSlot.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinResultSlot.java index 141b5d93..7fd0ca1c 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinResultSlot.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinResultSlot.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerGamePacketListenerImpl.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerGamePacketListenerImpl.java index 0e2de0b4..3c2c5b45 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerGamePacketListenerImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerGamePacketListenerImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerLevel.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerLevel.java index 1ed4e62b..631f0afc 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerLevel.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerLevel.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayer.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayer.java index 09680175..eb1a2802 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayer.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayerGameMode.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayerGameMode.java index 57a0f97a..6e8620a6 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayerGameMode.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerPlayerGameMode.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/PlayerAttackInvoker.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/PlayerAttackInvoker.java index 31ab0fd0..6ee88088 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/PlayerAttackInvoker.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/PlayerAttackInvoker.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientLevel.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientLevel.java index db65bbed..da1e979f 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientLevel.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientLevel.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientPacketListener.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientPacketListener.java index 6f7bca12..766ba948 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientPacketListener.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinClientPacketListener.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinDebugScreenOverlay.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinDebugScreenOverlay.java index 4f64d608..c8d65386 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinDebugScreenOverlay.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinDebugScreenOverlay.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinEffectInstance.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinEffectInstance.java index 1294d5bb..48fd1d26 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinEffectInstance.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinEffectInstance.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinGameRenderer.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinGameRenderer.java index 3ac3b754..a04a291d 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinGameRenderer.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinGameRenderer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinIntegratedServer.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinIntegratedServer.java index af9719c6..d4becaff 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinIntegratedServer.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinIntegratedServer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinKeyboardHandler.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinKeyboardHandler.java index e556b2bb..ab7e3169 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinKeyboardHandler.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinKeyboardHandler.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMinecraft.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMinecraft.java index a83c8f4c..aa36a7a9 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMinecraft.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMinecraft.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMouseHandler.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMouseHandler.java index 6d199d8b..a39bccc6 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMouseHandler.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMouseHandler.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMultiPlayerGameMode.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMultiPlayerGameMode.java index 2ac45141..ccb9edb0 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMultiPlayerGameMode.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMultiPlayerGameMode.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinScreen.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinScreen.java index 56c88e68..ce3f0f0a 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinScreen.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinScreen.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinTextureAtlas.java b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinTextureAtlas.java index 9ccf234d..f2cc8ae9 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinTextureAtlas.java +++ b/fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinTextureAtlas.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/networking/fabric/NetworkManagerImpl.java b/fabric/src/main/java/me/shedaniel/architectury/networking/fabric/NetworkManagerImpl.java index 376591f4..66f421a4 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/networking/fabric/NetworkManagerImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/networking/fabric/NetworkManagerImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/platform/fabric/PlatformImpl.java b/fabric/src/main/java/me/shedaniel/architectury/platform/fabric/PlatformImpl.java index a5245480..91d2c1cd 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/platform/fabric/PlatformImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/platform/fabric/PlatformImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/plugin/fabric/ArchitecturyMixinPlugin.java b/fabric/src/main/java/me/shedaniel/architectury/plugin/fabric/ArchitecturyMixinPlugin.java index bde86bc3..4d01f54b 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/plugin/fabric/ArchitecturyMixinPlugin.java +++ b/fabric/src/main/java/me/shedaniel/architectury/plugin/fabric/ArchitecturyMixinPlugin.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/entity/fabric/EntityRenderersImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/entity/fabric/EntityRenderersImpl.java index 1368a82a..c75c1049 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/entity/fabric/EntityRenderersImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/entity/fabric/EntityRenderersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BiomeModificationsImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BiomeModificationsImpl.java index fc36f9ea..8a88317c 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BiomeModificationsImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BiomeModificationsImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockEntityRenderersImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockEntityRenderersImpl.java index 4fde2218..14f1263d 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockEntityRenderersImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockEntityRenderersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockPropertiesImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockPropertiesImpl.java index 3edb4bd6..93c2b1a7 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockPropertiesImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/BlockPropertiesImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ColorHandlersImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ColorHandlersImpl.java index f6f264b1..ff4bd263 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ColorHandlersImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ColorHandlersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CreativeTabsImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CreativeTabsImpl.java index 478b182f..2df5f719 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CreativeTabsImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CreativeTabsImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CriteriaTriggersRegistryImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CriteriaTriggersRegistryImpl.java index 24cf7c19..79af464a 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CriteriaTriggersRegistryImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/CriteriaTriggersRegistryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleFactoryImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleFactoryImpl.java index ef125401..6ee405f6 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleFactoryImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleFactoryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleRegistryImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleRegistryImpl.java index bed77e86..ecd9288b 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleRegistryImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/GameRuleRegistryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/KeyBindingsImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/KeyBindingsImpl.java index 9d47b697..c4345c6e 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/KeyBindingsImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/KeyBindingsImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/MenuRegistryImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/MenuRegistryImpl.java index 2b66236a..44753f68 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/MenuRegistryImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/MenuRegistryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RegistriesImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RegistriesImpl.java index 6fb73886..65139465 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RegistriesImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RegistriesImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ReloadListenersImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ReloadListenersImpl.java index c8769b22..4f27c280 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ReloadListenersImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ReloadListenersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RenderTypesImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RenderTypesImpl.java index 4f87f88b..7dfc5ad7 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RenderTypesImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/RenderTypesImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ToolTypeImpl.java b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ToolTypeImpl.java index 5f289513..1517b876 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ToolTypeImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/registry/fabric/ToolTypeImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/java/me/shedaniel/architectury/utils/fabric/GameInstanceImpl.java b/fabric/src/main/java/me/shedaniel/architectury/utils/fabric/GameInstanceImpl.java index 8aeb185b..76b7938a 100644 --- a/fabric/src/main/java/me/shedaniel/architectury/utils/fabric/GameInstanceImpl.java +++ b/fabric/src/main/java/me/shedaniel/architectury/utils/fabric/GameInstanceImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/fabric/src/main/resources/architectury.mixins.json b/fabric/src/main/resources/architectury.mixins.json index b80e18ae..939bf5f8 100644 --- a/fabric/src/main/resources/architectury.mixins.json +++ b/fabric/src/main/resources/architectury.mixins.json @@ -21,25 +21,37 @@ "mixins": [ "ExplosionPreInvoker", "LivingDeathInvoker", + "MixinBaseSpawner", "MixinBlockEntityExtension", "MixinBlockItem", + "MixinBucketItem", + "MixinCatSpawner", "MixinCommands", "MixinDedicatedServer", "MixinExplosion", + "MixinFarmBlock", "MixinFurnaceResultSlot", + "MixinInventory", "MixinItemEntity", + "MixinLevelChunk", "MixinLivingEntity", - "MixinPersistentEntitySectionManager", "MixinPlayer", - "MixinPlayerAdvancements", - "MixinPlayerList", - "MixinResultSlot", - "MixinServerGamePacketListenerImpl", "MixinServerLevel", - "MixinServerPlayer", - "MixinServerPlayerGameMode", - "PlayerAttackInvoker" - ], - "injectors": { - "maxShiftBy": 5, - "defaultRequire": 1 - } + "MixinMob", + "MixinNaturalSpawner", + "MixinPatrolSpawner", + "MixinPersistentEntitySectionManager", + "MixinPhantomSpawner", + "MixinPlayer", + "MixinPlayerAdvancements", + "MixinPlayerList", + "MixinResultSlot", + "MixinServerGamePacketListenerImpl", + "MixinServerLevel", + "MixinServerPlayer", + "MixinServerPlayerGameMode", + "PlayerAttackInvoker" + ], + "injectors": { + "maxShiftBy": 5, + "defaultRequire": 1 + } } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 13ff4d36..7970a749 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -7,6 +7,11 @@ "authors": [ "shedaniel" ], + "contact": { + "issues": "https://github.com/architectury/architectury-api/issues", + "sources": "https://github.com/architectury/architectury-api", + "homepage": "https://architectury.github.io/architectury-documentations/" + }, "license": "LGPL-3", "environment": "*", "mixins": [ @@ -25,6 +30,7 @@ ] }, "accessWidener": "architectury.accessWidener", + "icon": "icon.png", "depends": { "minecraft": ">=1.16.4" }, diff --git a/fabric/src/main/resources/icon.png b/fabric/src/main/resources/icon.png new file mode 100644 index 00000000..812d0b57 Binary files /dev/null and b/fabric/src/main/resources/icon.png differ diff --git a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventFactoryImpl.java b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventFactoryImpl.java index a0936270..5e397894 100644 --- a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventFactoryImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventFactoryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,8 +21,11 @@ package me.shedaniel.architectury.event.forge; import me.shedaniel.architectury.event.Actor; import me.shedaniel.architectury.event.Event; +import me.shedaniel.architectury.event.EventActor; +import me.shedaniel.architectury.event.EventResult; import net.minecraft.world.InteractionResult; import net.minecraftforge.common.MinecraftForge; +import org.jetbrains.annotations.ApiStatus; import java.util.function.Consumer; @@ -63,4 +66,36 @@ public class EventFactoryImpl { }); return event; } -} \ No newline at end of file + + @ApiStatus.Internal + public static Event> attachToForgeEventActor(Event> event) { + event.register(eventObj -> { + if (!(eventObj instanceof net.minecraftforge.eventbus.api.Event)) { + throw new ClassCastException(eventObj.getClass() + " is not an instance of forge Event!"); + } + if (!((net.minecraftforge.eventbus.api.Event) eventObj).isCancelable()) { + throw new ClassCastException(eventObj.getClass() + " is not cancellable Event!"); + } + MinecraftForge.EVENT_BUS.post((net.minecraftforge.eventbus.api.Event) eventObj); + return EventResult.pass(); + }); + return event; + } + + @ApiStatus.Internal + public static Event> attachToForgeEventActorCancellable(Event> event) { + event.register(eventObj -> { + if (!(eventObj instanceof net.minecraftforge.eventbus.api.Event)) { + throw new ClassCastException(eventObj.getClass() + " is not an instance of forge Event!"); + } + if (!((net.minecraftforge.eventbus.api.Event) eventObj).isCancelable()) { + throw new ClassCastException(eventObj.getClass() + " is not cancellable Event!"); + } + if (MinecraftForge.EVENT_BUS.post((net.minecraftforge.eventbus.api.Event) eventObj)) { + return EventResult.interrupt(false); + } + return EventResult.pass(); + }); + return event; + } +} diff --git a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImpl.java b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImpl.java index 59518862..c5c1ebde 100644 --- a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplClient.java b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplClient.java index 76627c45..eaaf7d0e 100644 --- a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplClient.java +++ b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplClient.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplCommon.java b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplCommon.java index e3c98f7f..057476b6 100644 --- a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplCommon.java +++ b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplCommon.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,9 @@ package me.shedaniel.architectury.event.forge; +import me.shedaniel.architectury.event.CompoundEventResult; +import me.shedaniel.architectury.event.EventResult; +import me.shedaniel.architectury.event.events.PlayerEvent; import me.shedaniel.architectury.event.events.*; import me.shedaniel.architectury.utils.IntValue; import net.minecraft.network.chat.Component; @@ -35,17 +38,17 @@ import net.minecraftforge.event.TickEvent.Phase; import net.minecraftforge.event.TickEvent.PlayerTickEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.TickEvent.WorldTickEvent; +import net.minecraftforge.event.entity.EntityEvent.EnteringChunk; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.item.ItemTossEvent; import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.AdvancementEvent; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.event.entity.player.PlayerContainerEvent; +import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import net.minecraftforge.event.entity.player.*; import net.minecraftforge.event.entity.player.PlayerEvent.*; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.event.world.BlockEvent.EntityPlaceEvent; +import net.minecraftforge.event.world.BlockEvent.FarmlandTrampleEvent; import net.minecraftforge.event.world.ExplosionEvent.Detonate; import net.minecraftforge.event.world.ExplosionEvent.Start; import net.minecraftforge.event.world.WorldEvent; @@ -214,6 +217,43 @@ public class EventHandlerImplCommon { } } + @SubscribeEvent(priority = EventPriority.HIGH) + public static void event(FarmlandTrampleEvent event) { + if (InteractionEvent.FARMLAND_TRAMPLE.invoker().trample((Level) event.getWorld(), event.getPos(), event.getState(), event.getFallDistance(), event.getEntity()).value() != null) { + event.setCanceled(true); + } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public static void event(FillBucketEvent event) { + ItemStack oldItem = event.getEmptyBucket(); + CompoundEventResult result = PlayerEvent.FILL_BUCKET.invoker().fill(event.getPlayer(), event.getWorld(), oldItem, event.getTarget()); + if (result.interruptsFurtherEvaluation()) { + event.setCanceled(true); + event.setFilledBucket(result.object()); + + if (result.value() != null) { + event.setResult(result.value() ? Event.Result.ALLOW : Event.Result.DENY); + } + } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public static void event(EnteringChunk event) { + EntityEvent.ENTER_CHUNK.invoker().enterChunk(event.getEntity(), event.getNewChunkX(), event.getNewChunkZ(), event.getOldChunkX(), event.getOldChunkZ()); + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public static void event(LivingSpawnEvent.CheckSpawn event) { + EventResult result = EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(event.getEntityLiving(), event.getWorld(), event.getX(), event.getY(), event.getZ(), event.getSpawnReason(), event.getSpawner()); + if (result.interruptsFurtherEvaluation()) { + if (result.value() != null) { + event.setResult(result.value() == Boolean.TRUE ? Event.Result.ALLOW : Event.Result.DENY); + } + event.setCanceled(true); + } + } + @SubscribeEvent(priority = EventPriority.HIGH) public static void event(ItemCraftedEvent event) { PlayerEvent.CRAFT_ITEM.invoker().craft(event.getPlayer(), event.getCrafting(), event.getInventory()); diff --git a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplServer.java b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplServer.java index 72f4d112..7d7dc2ac 100644 --- a/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplServer.java +++ b/forge/src/main/java/me/shedaniel/architectury/event/forge/EventHandlerImplServer.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/forge/ArchitecturyForge.java b/forge/src/main/java/me/shedaniel/architectury/forge/ArchitecturyForge.java index 792ec65e..6465435b 100644 --- a/forge/src/main/java/me/shedaniel/architectury/forge/ArchitecturyForge.java +++ b/forge/src/main/java/me/shedaniel/architectury/forge/ArchitecturyForge.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/BlockEntityHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/BlockEntityHooksImpl.java index 3135ff24..e664f099 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/BlockEntityHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/BlockEntityHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/DyeColorHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/DyeColorHooksImpl.java index 3cd91c56..73034a52 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/DyeColorHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/DyeColorHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/EntityHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/EntityHooksImpl.java index def8695c..68e1a21c 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/EntityHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/EntityHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ExplosionHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ExplosionHooksImpl.java index 619caf4d..c21e947a 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ExplosionHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ExplosionHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksForge.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksForge.java index 46cba4b5..16955d58 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksForge.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksForge.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksImpl.java index 94ce950c..aa13d374 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/FluidStackHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ItemEntityHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ItemEntityHooksImpl.java index 9563ecd9..f5582fd5 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ItemEntityHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ItemEntityHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PackRepositoryHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PackRepositoryHooksImpl.java index bb0c8513..84db4f78 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PackRepositoryHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PackRepositoryHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java index a558f21f..915b0b7e 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/PlayerHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ScreenHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ScreenHooksImpl.java index f168679b..4cd6a999 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ScreenHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/ScreenHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/TagHooksImpl.java b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/TagHooksImpl.java index 079ec9d2..b699fe03 100644 --- a/forge/src/main/java/me/shedaniel/architectury/hooks/forge/TagHooksImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/hooks/forge/TagHooksImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/BiomeGenerationSettingsBuilderAccessor.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/BiomeGenerationSettingsBuilderAccessor.java index 6bd48afe..43b68ed0 100644 --- a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/BiomeGenerationSettingsBuilderAccessor.java +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/BiomeGenerationSettingsBuilderAccessor.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/GameRulesAccessor.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/GameRulesAccessor.java index 03713b65..0b2ec508 100644 --- a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/GameRulesAccessor.java +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/GameRulesAccessor.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntity.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntity.java index ad0de1c0..d02d050a 100644 --- a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntity.java +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntity.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntityExtension.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntityExtension.java index 02dd3e41..a850d7e4 100644 --- a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntityExtension.java +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinBlockEntityExtension.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinItemExtension.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinItemExtension.java new file mode 100644 index 00000000..04562c51 --- /dev/null +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinItemExtension.java @@ -0,0 +1,43 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.mixin.forge; + +import me.shedaniel.architectury.extensions.ItemExtension; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraftforge.common.extensions.IForgeItem; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; + +@Mixin(ItemExtension.class) +public interface MixinItemExtension extends IForgeItem { + @Override + default void onArmorTick(ItemStack stack, Level world, Player player) { + ((ItemExtension) this).tickArmor(stack, player); + } + + @Nullable + @Override + default EquipmentSlot getEquipmentSlot(ItemStack stack) { + return ((ItemExtension) this).getCustomEquipmentSlot(stack); + } +} diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinRegistryEntry.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinRegistryEntry.java index 8d675a1b..7ba71dea 100644 --- a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinRegistryEntry.java +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MixinRegistryEntry.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MobSpawnSettingsBuilderAccessor.java b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MobSpawnSettingsBuilderAccessor.java index 87605419..9430939a 100644 --- a/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MobSpawnSettingsBuilderAccessor.java +++ b/forge/src/main/java/me/shedaniel/architectury/mixin/forge/MobSpawnSettingsBuilderAccessor.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/networking/forge/ClientNetworkingManager.java b/forge/src/main/java/me/shedaniel/architectury/networking/forge/ClientNetworkingManager.java index e7ce2d31..e946eb8f 100644 --- a/forge/src/main/java/me/shedaniel/architectury/networking/forge/ClientNetworkingManager.java +++ b/forge/src/main/java/me/shedaniel/architectury/networking/forge/ClientNetworkingManager.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/networking/forge/NetworkManagerImpl.java b/forge/src/main/java/me/shedaniel/architectury/networking/forge/NetworkManagerImpl.java index 54fe4ea8..5ec26f0b 100644 --- a/forge/src/main/java/me/shedaniel/architectury/networking/forge/NetworkManagerImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/networking/forge/NetworkManagerImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/platform/forge/EventBuses.java b/forge/src/main/java/me/shedaniel/architectury/platform/forge/EventBuses.java index 16993ab0..3fd13c9f 100644 --- a/forge/src/main/java/me/shedaniel/architectury/platform/forge/EventBuses.java +++ b/forge/src/main/java/me/shedaniel/architectury/platform/forge/EventBuses.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/platform/forge/PlatformImpl.java b/forge/src/main/java/me/shedaniel/architectury/platform/forge/PlatformImpl.java index b9e57393..fb9883b2 100644 --- a/forge/src/main/java/me/shedaniel/architectury/platform/forge/PlatformImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/platform/forge/PlatformImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/plugin/forge/ArchitecturyMixinPlugin.java b/forge/src/main/java/me/shedaniel/architectury/plugin/forge/ArchitecturyMixinPlugin.java index 8ae4cd42..348889b5 100644 --- a/forge/src/main/java/me/shedaniel/architectury/plugin/forge/ArchitecturyMixinPlugin.java +++ b/forge/src/main/java/me/shedaniel/architectury/plugin/forge/ArchitecturyMixinPlugin.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/entity/forge/EntityRenderersImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/entity/forge/EntityRenderersImpl.java index 8be995d3..e043251e 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/entity/forge/EntityRenderersImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/entity/forge/EntityRenderersImpl.java @@ -1,3 +1,22 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + package me.shedaniel.architectury.registry.entity.forge; import net.minecraft.client.renderer.entity.EntityRenderDispatcher; diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/BiomeModificationsImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/BiomeModificationsImpl.java index 95c68bba..ca3a2b6f 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/BiomeModificationsImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/BiomeModificationsImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockEntityRenderersImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockEntityRenderersImpl.java index 7bdf1f84..109b784c 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockEntityRenderersImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockEntityRenderersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockPropertiesImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockPropertiesImpl.java index b2d3721d..44d50dd4 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockPropertiesImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/BlockPropertiesImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/ColorHandlersImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/ColorHandlersImpl.java index 2e234347..9985e828 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/ColorHandlersImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/ColorHandlersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/CreativeTabsImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/CreativeTabsImpl.java index 92b90879..344d4242 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/CreativeTabsImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/CreativeTabsImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/CriteriaTriggersRegistryImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/CriteriaTriggersRegistryImpl.java index 0610c8e7..29f58fce 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/CriteriaTriggersRegistryImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/CriteriaTriggersRegistryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleFactoryImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleFactoryImpl.java index bec7c989..3051ad01 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleFactoryImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleFactoryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleRegistryImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleRegistryImpl.java index 5fd5de13..c256e12c 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleRegistryImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/GameRuleRegistryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/KeyBindingsImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/KeyBindingsImpl.java index 9eb2c020..9b4a3d48 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/KeyBindingsImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/KeyBindingsImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/MenuRegistryImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/MenuRegistryImpl.java index dc04742a..9d94f326 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/MenuRegistryImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/MenuRegistryImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/RegistriesImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/RegistriesImpl.java index 48f0f594..a1c13104 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/RegistriesImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/RegistriesImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/ReloadListenersImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/ReloadListenersImpl.java index b1bc82b1..63a4f1b7 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/ReloadListenersImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/ReloadListenersImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/RenderTypesImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/RenderTypesImpl.java index 3d2817a8..7cb799a4 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/RenderTypesImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/RenderTypesImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/registry/forge/ToolTypeImpl.java b/forge/src/main/java/me/shedaniel/architectury/registry/forge/ToolTypeImpl.java index 8dbc83cd..bc6ec489 100644 --- a/forge/src/main/java/me/shedaniel/architectury/registry/forge/ToolTypeImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/registry/forge/ToolTypeImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/java/me/shedaniel/architectury/utils/forge/GameInstanceImpl.java b/forge/src/main/java/me/shedaniel/architectury/utils/forge/GameInstanceImpl.java index 7d989232..ba0d4b69 100644 --- a/forge/src/main/java/me/shedaniel/architectury/utils/forge/GameInstanceImpl.java +++ b/forge/src/main/java/me/shedaniel/architectury/utils/forge/GameInstanceImpl.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 3d9b282d..09091f4b 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,7 +1,7 @@ modLoader = "javafml" loaderVersion = "[33,)" issueTrackerURL = "https://github.com/shedaniel/architectury/issues" -license = "LGPL-3" +license = "GNU LGPLv3" [[mods]] modId = "architectury" @@ -11,4 +11,12 @@ authors = "shedaniel" description = ''' A intermediary api aimed to ease developing multiplatform mods. ''' -license = "LGPL-3" \ No newline at end of file +logoFile="icon.png" +license = "LGPL-3" + +[[dependencies.architectury]] +modId = "minecraft" +mandatory = true +versionRange = "[1.16.2,)" +ordering = "NONE" +side = "BOTH" diff --git a/forge/src/main/resources/architectury.mixins.json b/forge/src/main/resources/architectury.mixins.json index 383b59e3..277733fc 100644 --- a/forge/src/main/resources/architectury.mixins.json +++ b/forge/src/main/resources/architectury.mixins.json @@ -7,8 +7,9 @@ "client": [ ], "mixins": [ - "BiomeGenerationSettingsBuilderAccessor", "MixinRegistryEntry", "MixinBlockEntity", "MixinBlockEntityExtension", - "MobSpawnSettingsBuilderAccessor", "GameRulesAccessor", "GameRulesAccessor$BooleanValue", "GameRulesAccessor$BooleanValueSimple", "GameRulesAccessor$IntegerValue", "GameRulesAccessor$IntegerValueSimple" + "BiomeGenerationSettingsBuilderAccessor", "GameRulesAccessor", "GameRulesAccessor$BooleanValue", "GameRulesAccessor$BooleanValueSimple", + "GameRulesAccessor$IntegerValue", "GameRulesAccessor$IntegerValueSimple", "MixinBlockEntity", "MixinBlockEntityExtension", "MixinItemExtension", + "MixinRegistryEntry", "MobSpawnSettingsBuilderAccessor" ], "injectors": { "defaultRequire": 1 diff --git a/forge/src/main/resources/icon.png b/forge/src/main/resources/icon.png new file mode 100644 index 00000000..812d0b57 Binary files /dev/null and b/forge/src/main/resources/icon.png differ diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/TestMod.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/TestMod.java index 2d7a2905..e1e87e5b 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/TestMod.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/TestMod.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/ConsoleMessageSink.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/ConsoleMessageSink.java index 37cfa725..8eb2af8c 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/ConsoleMessageSink.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/ConsoleMessageSink.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/MessageSink.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/MessageSink.java index 5c06b316..d8fc0876 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/MessageSink.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/MessageSink.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/client/ClientOverlayMessageSink.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/client/ClientOverlayMessageSink.java index db9b8891..a10f3ea8 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/client/ClientOverlayMessageSink.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/debug/client/ClientOverlayMessageSink.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/events/DebugEvents.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/events/DebugEvents.java index a3ca5c7d..229041c0 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/events/DebugEvents.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/events/DebugEvents.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,8 @@ package me.shedaniel.architectury.test.events; import com.mojang.blaze3d.platform.InputConstants; +import me.shedaniel.architectury.event.CompoundEventResult; +import me.shedaniel.architectury.event.EventResult; import me.shedaniel.architectury.event.events.*; import me.shedaniel.architectury.event.events.client.*; import me.shedaniel.architectury.hooks.ExplosionHooks; @@ -28,15 +30,20 @@ import me.shedaniel.architectury.utils.Env; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.gui.screens.ChatScreen; +import net.minecraft.client.gui.screens.inventory.AnvilScreen; import net.minecraft.core.Position; import net.minecraft.core.Vec3i; +import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; import java.util.Optional; @@ -87,6 +94,34 @@ public class DebugEvents { } return InteractionResult.PASS; }); + EntityEvent.ENTER_CHUNK.register(((entity, nx, nz, ox, oz) -> { + if (entity instanceof Player && entity.inChunk) { + Player player = (Player) entity; + SINK.accept("%s switched chunks: %s => %s", entity.getScoreboardName(), chunkPos(ox, oz), chunkPos(nx, nz)); + player.displayClientMessage(new TextComponent("Entering chunk: " + chunkPos(nx, nz)), true); + } + })); + EntityEvent.LIVING_CHECK_SPAWN.register(((entity, level, x, y, z, type, spawner) -> { + StringBuilder sb = new StringBuilder(); + sb.append(entity.getType()); + sb.append(" is trying to spawn"); + sb.append(" at "); + sb.append(toShortString(new Vec3(x, y, z))); + if (level instanceof Level) { + sb.append(" in world "); + sb.append(((Level) level).dimension().location()); + } + sb.append(" from cause "); + sb.append(type.name()); + if (spawner != null) { + sb.append(" ("); + sb.append(spawner); + sb.append(") "); + } + + SINK.accept(sb.toString()); + return EventResult.pass(); + })); ExplosionEvent.DETONATE.register((world, explosion, affectedEntities) -> { SINK.accept(world.dimension().location() + " explodes at " + toShortString(ExplosionHooks.getPosition(explosion)) + logSide(world)); }); @@ -106,6 +141,13 @@ public class DebugEvents { SINK.accept(player.getScoreboardName() + " interacts with " + entity.getScoreboardName() + " using " + (hand == InteractionHand.MAIN_HAND ? "main hand" : "off hand") + logSide(player.level)); return InteractionResult.PASS; }); + InteractionEvent.FARMLAND_TRAMPLE.register((level, pos, state, distance, entity) -> { + if (entity instanceof Player && ((Player) entity).getItemBySlot(EquipmentSlot.FEET).getItem() == Items.DIAMOND_BOOTS) { + return EventResult.interrupt(false); + } + SINK.accept("%s trampled farmland (%s) at %s in %s (Fall height: %f blocks)", entity, state, pos, level, distance); + return EventResult.pass(); + }); LifecycleEvent.SERVER_BEFORE_START.register(instance -> { SINK.accept("Server ready to start"); }); @@ -169,6 +211,10 @@ public class DebugEvents { PlayerEvent.CHANGE_DIMENSION.register((player, oldLevel, newLevel) -> { SINK.accept(player.getScoreboardName() + " switched from " + oldLevel.location() + " to " + newLevel.location() + logSide(player.level)); }); + PlayerEvent.FILL_BUCKET.register(((player, level, stack, target) -> { + SINK.accept("%s used a bucket (%s) in %s%s while looking at %s", player.getScoreboardName(), stack, level.dimension().location(), logSide(level), target == null ? "nothing" : target.getLocation()); + return CompoundEventResult.pass(); + })); LightningEvent.STRIKE.register((bolt, level, pos, toStrike) -> { SINK.accept(bolt.getScoreboardName() + " struck at " + toShortString(pos) + logSide(level)); }); @@ -269,7 +315,7 @@ public class DebugEvents { return InteractionResult.PASS; }); GuiEvent.SET_SCREEN.register(screen -> { - if (screen instanceof ChatScreen) { + if (screen instanceof AnvilScreen) { return InteractionResultHolder.fail(screen); } @@ -278,6 +324,10 @@ public class DebugEvents { }); } + private static String chunkPos(int x, int z) { + return "[" + x + ", " + z + "]"; + } + private static String toSimpleName(Object o) { return o == null ? "null" : o.getClass().getSimpleName() + "@" + Integer.toHexString(o.hashCode()); } diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/gamerule/TestGameRules.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/gamerule/TestGameRules.java index d20aad5f..d2fe1462 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/gamerule/TestGameRules.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/gamerule/TestGameRules.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/TestRegistries.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/TestRegistries.java index a0d789c6..ff485c8a 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/TestRegistries.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/TestRegistries.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,7 @@ import me.shedaniel.architectury.registry.BlockProperties; import me.shedaniel.architectury.registry.DeferredRegister; import me.shedaniel.architectury.registry.RegistrySupplier; import me.shedaniel.architectury.test.TestMod; +import me.shedaniel.architectury.test.registry.objects.EquippableTickingItem; import me.shedaniel.architectury.test.tab.TestCreativeTabs; import net.minecraft.core.BlockPos; import net.minecraft.core.Registry; @@ -44,6 +45,8 @@ public class TestRegistries { public static final RegistrySupplier TEST_ITEM = ITEMS.register("test_item", () -> new Item(new Item.Properties().tab(TestCreativeTabs.TEST_TAB))); + public static final RegistrySupplier TEST_EQUIPPABLE = ITEMS.register("test_eqippable", () -> + new EquippableTickingItem(new Item.Properties().tab(TestCreativeTabs.TEST_TAB))); public static final RegistrySupplier TEST_BLOCK = BLOCKS.register("test_block", () -> new Block(BlockProperties.copy(Blocks.STONE))); diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/client/TestKeybinds.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/client/TestKeybinds.java index 4a390338..539a6d7a 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/client/TestKeybinds.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/client/TestKeybinds.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/objects/EquippableTickingItem.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/objects/EquippableTickingItem.java new file mode 100644 index 00000000..75c45971 --- /dev/null +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/registry/objects/EquippableTickingItem.java @@ -0,0 +1,46 @@ +/* + * This file is part of architectury. + * Copyright (C) 2020, 2021 architectury + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package me.shedaniel.architectury.test.registry.objects; + +import me.shedaniel.architectury.extensions.ItemExtension; +import me.shedaniel.architectury.test.TestMod; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.Nullable; + +public class EquippableTickingItem extends Item implements ItemExtension { + public EquippableTickingItem(Properties properties) { + super(properties); + } + + @Override + public void tickArmor(ItemStack stack, Player player) { + TestMod.SINK.accept("Ticking " + new TranslatableComponent(stack.getDescriptionId()).getString()); + } + + @Nullable + @Override + public EquipmentSlot getCustomEquipmentSlot(ItemStack stack) { + return EquipmentSlot.HEAD; + } +} diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/tab/TestCreativeTabs.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/tab/TestCreativeTabs.java index 41219a6f..ec4c2396 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/tab/TestCreativeTabs.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/tab/TestCreativeTabs.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-common/src/main/java/me/shedaniel/architectury/test/tags/TestTags.java b/testmod-common/src/main/java/me/shedaniel/architectury/test/tags/TestTags.java index ec25be88..ca95936d 100644 --- a/testmod-common/src/main/java/me/shedaniel/architectury/test/tags/TestTags.java +++ b/testmod-common/src/main/java/me/shedaniel/architectury/test/tags/TestTags.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/testmod-forge/src/main/java/me/shedaniel/architectury/test/TestModForge.java b/testmod-forge/src/main/java/me/shedaniel/architectury/test/TestModForge.java index d9f130ce..cdf26df9 100644 --- a/testmod-forge/src/main/java/me/shedaniel/architectury/test/TestModForge.java +++ b/testmod-forge/src/main/java/me/shedaniel/architectury/test/TestModForge.java @@ -1,6 +1,6 @@ /* * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel + * Copyright (C) 2020, 2021 architectury * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public