mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-27 19:47:00 -05:00
Big clean up, more details in the PR (#216)
* Big clean up, more details in the PR * Fix build * Deprecate BlockProperties, generate AWs for Item constructors, Block constructors and RenderStateShard fields * Add a few more RenderType AWs * Deprecate BlockPropertiesExtension * Set defaultType on resolving the entity type in SpawnEggItem * Used the wrong object * Add license information for generating AWs * Add link to original PR * Properly add support for forge vanilla registries * Bump to 4.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/architectury-common.accessWidener")
|
||||
accessWidenerPath = file("src/main/resources/architectury.accessWidener")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -12,6 +12,130 @@ architectury {
|
||||
common(rootProject.forgeEnabled.toBoolean())
|
||||
}
|
||||
|
||||
/**
|
||||
* The following code to generate the access widener is based on the following pull request by Juuxel;
|
||||
* https://github.com/Juuxel/
|
||||
* https://github.com/FabricMC/fabric/pull/2044/
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC and Juuxel
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.objectweb.asm.ClassReader
|
||||
import org.objectweb.asm.Opcodes
|
||||
import org.objectweb.asm.Type
|
||||
import org.objectweb.asm.tree.ClassNode
|
||||
|
||||
import java.nio.file.FileSystem
|
||||
import java.nio.file.FileSystems
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
|
||||
task generateAccessWidener {
|
||||
doLast {
|
||||
List<String> lines = ["", "##############################", "# This section is generated automatically with Gradle task generateAccessWidener!!!", "##############################", ""]
|
||||
Path inputJar = loom.namedMinecraftProvider.parentMinecraftProvider.mergedJar
|
||||
|
||||
try (def fs = FileSystems.newFileSystem(URI.create("jar:${inputJar.toUri()}"), [create: false])) {
|
||||
generateItemConstructors(lines, fs)
|
||||
lines.add("")
|
||||
generateBlockConstructors(lines, fs)
|
||||
lines.add("")
|
||||
generateRenderTypeRelated(lines, fs)
|
||||
}
|
||||
|
||||
file('.gradle/generated.accesswidener').text = String.join('\n', lines) + '\n'
|
||||
}
|
||||
}
|
||||
|
||||
static def generateBlockConstructors(List<String> lines, FileSystem fs) {
|
||||
lines.add("# Constructors of non-abstract block classes")
|
||||
Files.list(fs.getPath("net/minecraft/world/level/block"))
|
||||
.filter { Files.isRegularFile(it) && it.toString().endsWith(".class") }
|
||||
.map { loadClass(it) }
|
||||
.sorted(Comparator.comparing { it.name })
|
||||
.filter { (it.access & Opcodes.ACC_ABSTRACT) == 0 }
|
||||
.forEach { node ->
|
||||
for (def method : node.methods) {
|
||||
// Checklist for finding block constructors as of 1.18.2:
|
||||
// - class directly in net.minecraft.world.level.block (excluding subpackages)
|
||||
// - method name == <init> (by definition)
|
||||
// - contains an BlockBehaviour$Properties parameter
|
||||
// - only taking into account non-abstract classes and non-public constructors
|
||||
|
||||
// Block constructor...
|
||||
if (method.name == "<init>" && Type.getArgumentTypes(method.desc).any { it.internalName == 'net/minecraft/world/level/block/state/BlockBehaviour$Properties' }) {
|
||||
// ...and non-public
|
||||
if ((method.access & Opcodes.ACC_PUBLIC) == 0) {
|
||||
lines.add("transitive-accessible method $node.name <init> $method.desc")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static def generateItemConstructors(List<String> lines, FileSystem fs) {
|
||||
lines.add("# Constructors of non-abstract item classes")
|
||||
Files.list(fs.getPath("net/minecraft/world/item"))
|
||||
.filter { Files.isRegularFile(it) && it.toString().endsWith(".class") }
|
||||
.map { loadClass(it) }
|
||||
.sorted(Comparator.comparing { it.name })
|
||||
.filter { (it.access & Opcodes.ACC_ABSTRACT) == 0 }
|
||||
.forEach { node ->
|
||||
for (def method : node.methods) {
|
||||
// Checklist for finding block constructors as of 1.18.2:
|
||||
// - class directly in net.minecraft.world.item (excluding subpackages)
|
||||
// - method name == <init> (by definition)
|
||||
// - contains an Item$Properties parameter
|
||||
// - only taking into account non-abstract classes and non-public constructors
|
||||
|
||||
// Item constructor...
|
||||
if (method.name == "<init>" && Type.getArgumentTypes(method.desc).any { it.internalName == 'net/minecraft/world/item/Item$Properties' }) {
|
||||
// ...and non-public
|
||||
if ((method.access & Opcodes.ACC_PUBLIC) == 0) {
|
||||
lines.add("transitive-accessible method $node.name <init> $method.desc")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static def generateRenderTypeRelated(List<String> lines, FileSystem fs) {
|
||||
lines.add("# RenderStateShard fields")
|
||||
def node = loadClass(fs.getPath("net/minecraft/client/renderer/RenderStateShard.class"))
|
||||
for (def field : node.fields) {
|
||||
if ((field.access & Opcodes.ACC_STATIC) != 0 && (field.access & Opcodes.ACC_FINAL) != 0) {
|
||||
if ((field.access & Opcodes.ACC_PUBLIC) == 0) {
|
||||
lines.add("transitive-accessible field $node.name $field.name $field.desc")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ClassNode loadClass(Path path) {
|
||||
def node = new ClassNode()
|
||||
|
||||
try (def is = Files.newInputStream(path)) {
|
||||
new ClassReader(is).accept(node, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES)
|
||||
}
|
||||
|
||||
return node
|
||||
}
|
||||
|
||||
/**
|
||||
* End of access widener code.
|
||||
*/
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenCommon(MavenPublication) {
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.core.item;
|
||||
|
||||
import dev.architectury.registry.registries.RegistrySupplier;
|
||||
import net.minecraft.core.BlockSource;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.dispenser.DefaultDispenseItemBehavior;
|
||||
import net.minecraft.core.dispenser.DispenseItemBehavior;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.MobSpawnType;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SpawnEggItem;
|
||||
import net.minecraft.world.level.block.DispenserBlock;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ArchitecturySpawnEggItem extends SpawnEggItem {
|
||||
private static final Logger LOGGER = LogManager.getLogger(ArchitecturySpawnEggItem.class);
|
||||
|
||||
private final RegistrySupplier<? extends EntityType<? extends Mob>> entityType;
|
||||
|
||||
protected static DispenseItemBehavior createDispenseItemBehavior() {
|
||||
return new DefaultDispenseItemBehavior() {
|
||||
@Override
|
||||
public ItemStack execute(BlockSource source, ItemStack stack) {
|
||||
Direction direction = source.getBlockState().getValue(DispenserBlock.FACING);
|
||||
EntityType<?> entityType = ((SpawnEggItem) stack.getItem()).getType(stack.getTag());
|
||||
|
||||
try {
|
||||
entityType.spawn(source.getLevel(), stack, null, source.getPos().relative(direction), MobSpawnType.DISPENSER, direction != Direction.UP, false);
|
||||
} catch (Exception var6) {
|
||||
LOGGER.error("Error while dispensing spawn egg from dispenser at {}", source.getPos(), var6);
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
stack.shrink(1);
|
||||
source.getLevel().gameEvent(GameEvent.ENTITY_PLACE, source.getPos());
|
||||
return stack;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public ArchitecturySpawnEggItem(RegistrySupplier<? extends EntityType<? extends Mob>> entityType, int backgroundColor, int highlightColor, Properties properties) {
|
||||
this(entityType, backgroundColor, highlightColor, properties, createDispenseItemBehavior());
|
||||
}
|
||||
|
||||
public ArchitecturySpawnEggItem(RegistrySupplier<? extends EntityType<? extends Mob>> entityType, int backgroundColor, int highlightColor, Properties properties,
|
||||
@Nullable DispenseItemBehavior dispenseItemBehavior) {
|
||||
super(null, backgroundColor, highlightColor, properties);
|
||||
this.entityType = Objects.requireNonNull(entityType, "entityType");
|
||||
SpawnEggItem.BY_ID.remove(null);
|
||||
entityType.listen(type -> {
|
||||
SpawnEggItem.BY_ID.put(type, this);
|
||||
this.defaultType = type;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType<?> getType(@Nullable CompoundTag compoundTag) {
|
||||
EntityType<?> type = super.getType(compoundTag);
|
||||
return type == null ? entityType.get() : type;
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import dev.architectury.annotations.ForgeEvent;
|
||||
import dev.architectury.annotations.ForgeEventCancellable;
|
||||
import dev.architectury.injectables.annotations.ExpectPlatform;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -58,7 +57,7 @@ public final class EventFactory {
|
||||
public static <T> Event<T> createLoop(Class<T> 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 {
|
||||
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
for (var listener : listeners) {
|
||||
invokeMethod(listener, method, args);
|
||||
}
|
||||
@@ -77,7 +76,7 @@ public final class EventFactory {
|
||||
public static <T> Event<T> createEventResult(Class<T> 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 {
|
||||
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
for (var listener : listeners) {
|
||||
var result = (EventResult) Objects.requireNonNull(invokeMethod(listener, method, args));
|
||||
if (result.interruptsFurtherEvaluation()) {
|
||||
@@ -99,7 +98,7 @@ public final class EventFactory {
|
||||
public static <T> Event<T> createCompoundEventResult(Class<T> 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 {
|
||||
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
for (var listener : listeners) {
|
||||
var result = (CompoundEventResult) Objects.requireNonNull(invokeMethod(listener, method, args));
|
||||
if (result.interruptsFurtherEvaluation()) {
|
||||
@@ -121,7 +120,7 @@ public final class EventFactory {
|
||||
public static <T> Event<Consumer<T>> createConsumerLoop(Class<T> clazz) {
|
||||
Event<Consumer<T>> event = of(listeners -> (Consumer<T>) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{Consumer.class}, new AbstractInvocationHandler() {
|
||||
@Override
|
||||
protected Object handleInvocation(@NotNull Object proxy, @NotNull Method method, Object @NotNull [] args) throws Throwable {
|
||||
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
for (var listener : listeners) {
|
||||
invokeMethod(listener, method, args);
|
||||
}
|
||||
@@ -148,7 +147,7 @@ public final class EventFactory {
|
||||
public static <T> Event<EventActor<T>> createEventActorLoop(Class<T> clazz) {
|
||||
Event<EventActor<T>> event = of(listeners -> (EventActor<T>) 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 {
|
||||
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
for (var listener : listeners) {
|
||||
var result = (EventResult) invokeMethod(listener, method, args);
|
||||
if (result.interruptsFurtherEvaluation()) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import dev.architectury.injectables.targets.ArchitecturyTarget;
|
||||
import dev.architectury.utils.Env;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.minecraft.SharedConstants;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -25,9 +25,12 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public abstract class BlockProperties extends BlockBehaviour.Properties implements BlockPropertiesExtension {
|
||||
public BlockProperties(Material material, Function<BlockState, MaterialColor> function) {
|
||||
super(material, function);
|
||||
|
||||
@@ -19,5 +19,9 @@
|
||||
|
||||
package dev.architectury.registry.block;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public interface BlockPropertiesExtension {
|
||||
}
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
package dev.architectury.registry.level;
|
||||
|
||||
import dev.architectury.injectables.annotations.ExpectPlatform;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
@@ -37,10 +37,12 @@ public final class GameRuleFactory {
|
||||
*
|
||||
* @param defaultValue the rule's default value
|
||||
* @return the created type
|
||||
* @deprecated Use the method directly.
|
||||
*/
|
||||
@ExpectPlatform
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue) {
|
||||
throw new AssertionError();
|
||||
return GameRules.BooleanValue.create(defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,10 +51,12 @@ public final class GameRuleFactory {
|
||||
* @param defaultValue the rule's default value
|
||||
* @param changedCallback a callback that is called when the rule's value is changed
|
||||
* @return the created type
|
||||
* @deprecated Use the method directly.
|
||||
*/
|
||||
@ExpectPlatform
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue, BiConsumer<MinecraftServer, GameRules.BooleanValue> changedCallback) {
|
||||
throw new AssertionError();
|
||||
return GameRules.BooleanValue.create(defaultValue, changedCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,10 +64,12 @@ public final class GameRuleFactory {
|
||||
*
|
||||
* @param defaultValue the rule's default value
|
||||
* @return the created type
|
||||
* @deprecated Use the method directly.
|
||||
*/
|
||||
@ExpectPlatform
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue) {
|
||||
throw new AssertionError();
|
||||
return GameRules.IntegerValue.create(defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,9 +78,11 @@ public final class GameRuleFactory {
|
||||
* @param defaultValue the rule's default value
|
||||
* @param changedCallback a callback that is called when the rule's value is changed
|
||||
* @return the created type
|
||||
* @deprecated Use the method directly.
|
||||
*/
|
||||
@ExpectPlatform
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue, BiConsumer<MinecraftServer, GameRules.IntegerValue> changedCallback) {
|
||||
throw new AssertionError();
|
||||
return GameRules.IntegerValue.create(defaultValue, changedCallback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
package dev.architectury.registry.level;
|
||||
|
||||
import dev.architectury.injectables.annotations.ExpectPlatform;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* A registry for registering game rules.
|
||||
@@ -37,9 +37,11 @@ public final class GameRuleRegistry {
|
||||
* @param type the type of the rule
|
||||
* @param <T> the type of the rule value
|
||||
* @return a key for the registered rule
|
||||
* @deprecated Use the method directly.
|
||||
*/
|
||||
@ExpectPlatform
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
|
||||
throw new AssertionError();
|
||||
return GameRules.register(name, category, type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
package dev.architectury.registry.level.advancement;
|
||||
|
||||
import dev.architectury.injectables.annotations.ExpectPlatform;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.advancements.CriterionTrigger;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
public final class CriteriaTriggersRegistry {
|
||||
private CriteriaTriggersRegistry() {
|
||||
@@ -32,9 +33,11 @@ public final class CriteriaTriggersRegistry {
|
||||
* @param trigger The trigger to register
|
||||
* @param <T> The type of trigger
|
||||
* @return The trigger registered
|
||||
* @deprecated Use the method directly.
|
||||
*/
|
||||
@ExpectPlatform
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static <T extends CriterionTrigger<?>> T register(T trigger) {
|
||||
throw new AssertionError();
|
||||
return CriteriaTriggers.register(trigger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class EntityAttributeRegistry {
|
||||
* @see net.minecraft.world.entity.ai.attributes.DefaultAttributes
|
||||
*/
|
||||
@ExpectPlatform
|
||||
public static void register(Supplier<EntityType<? extends LivingEntity>> type, Supplier<AttributeSupplier.Builder> attribute) {
|
||||
public static void register(Supplier<? extends EntityType<? extends LivingEntity>> type, Supplier<AttributeSupplier.Builder> attribute) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.google.common.base.Suppliers;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
@@ -61,7 +60,7 @@ public class DeferredRegister<T> implements Iterable<RegistrySupplier<T>> {
|
||||
var entry = new Entry<T>(id, (Supplier<T>) supplier);
|
||||
this.entries.add(entry);
|
||||
if (registered) {
|
||||
var registrar = registriesSupplier.get().get(key);
|
||||
var registrar = getRegistrar();
|
||||
entry.value = registrar.register(entry.id, entry.supplier);
|
||||
}
|
||||
return (RegistrySupplier<R>) entry;
|
||||
@@ -72,18 +71,25 @@ public class DeferredRegister<T> implements Iterable<RegistrySupplier<T>> {
|
||||
throw new IllegalStateException("Cannot register a deferred register twice!");
|
||||
}
|
||||
registered = true;
|
||||
var registrar = registriesSupplier.get().get(key);
|
||||
var registrar = getRegistrar();
|
||||
for (var entry : entries) {
|
||||
entry.value = registrar.register(entry.id, entry.supplier);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Iterator<RegistrySupplier<T>> iterator() {
|
||||
return entryView.iterator();
|
||||
}
|
||||
|
||||
public Registries getRegistries() {
|
||||
return registriesSupplier.get();
|
||||
}
|
||||
|
||||
public Registrar<T> getRegistrar() {
|
||||
return registriesSupplier.get().get(key);
|
||||
}
|
||||
|
||||
private class Entry<R> implements RegistrySupplier<R> {
|
||||
private final ResourceLocation id;
|
||||
private final Supplier<R> supplier;
|
||||
@@ -94,6 +100,16 @@ public class DeferredRegister<T> implements Iterable<RegistrySupplier<T>> {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registries getRegistries() {
|
||||
return DeferredRegister.this.getRegistries();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registrar<R> getRegistrar() {
|
||||
return (Registrar<R>) DeferredRegister.this.getRegistrar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRegistryId() {
|
||||
return key.location();
|
||||
|
||||
@@ -27,11 +27,22 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public interface Registrar<T> extends Iterable<T> {
|
||||
RegistrySupplier<T> delegate(ResourceLocation id);
|
||||
|
||||
default <R extends T> RegistrySupplier<R> wrap(R obj) {
|
||||
ResourceLocation id = getId(obj);
|
||||
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("Cannot wrap an object without an id: " + obj);
|
||||
} else {
|
||||
return (RegistrySupplier<R>) delegate(id);
|
||||
}
|
||||
}
|
||||
|
||||
<E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier);
|
||||
|
||||
@Nullable
|
||||
@@ -56,4 +67,32 @@ public interface Registrar<T> extends Iterable<T> {
|
||||
Set<Map.Entry<ResourceKey<T>, T>> entrySet();
|
||||
|
||||
ResourceKey<? extends Registry<T>> key();
|
||||
|
||||
/**
|
||||
* Listens to when the registry entry is registered, and calls the given action.
|
||||
* Evaluates immediately if the entry is already registered.
|
||||
* <p>
|
||||
* Whenever the callback is called is dependent on the registry implementation.
|
||||
* On fabric, this will be called when the registry entry is registered.
|
||||
* On forge, this will be called when the registry entry is registered or when Minecraft has started.
|
||||
*
|
||||
* @param supplier the entry to listen to
|
||||
* @param callback the action to call when the registry entry is registered
|
||||
*/
|
||||
default <R extends T> void listen(RegistrySupplier<R> supplier, Consumer<R> callback) {
|
||||
listen(supplier.getId(), obj -> callback.accept((R) obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* Listens to when the registry entry is registered, and calls the given action.
|
||||
* Evaluates immediately if the entry is already registered.
|
||||
* <p>
|
||||
* Whenever the callback is called is dependent on the registry implementation.
|
||||
* On fabric, this will be called when the registry entry is registered.
|
||||
* On forge, this will be called when the registry entry is registered or when Minecraft has started.
|
||||
*
|
||||
* @param id the entry to listen to
|
||||
* @param callback the action to call when the registry entry is registered
|
||||
*/
|
||||
void listen(ResourceLocation id, Consumer<T> callback);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
|
||||
package dev.architectury.registry.registries;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -27,12 +30,24 @@ import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistrySupplier<T> extends Supplier<T> {
|
||||
Registries getRegistries();
|
||||
|
||||
Registrar<T> getRegistrar();
|
||||
|
||||
/**
|
||||
* @return the identifier of the registry
|
||||
*/
|
||||
ResourceLocation getRegistryId();
|
||||
|
||||
/**
|
||||
* @return the identifier of the registry
|
||||
*/
|
||||
default ResourceKey<Registry<T>> getRegistryKey() {
|
||||
return ResourceKey.createRegistryKey(getRegistryId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the identifier of the entry
|
||||
*/
|
||||
@@ -84,4 +99,14 @@ public interface RegistrySupplier<T> extends Supplier<T> {
|
||||
default T orElseGet(Supplier<? extends T> supplier) {
|
||||
return isPresent() ? get() : supplier.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Listens to when the registry entry is registered, and calls the given action.
|
||||
* Evaluates immediately if the entry is already registered.
|
||||
*
|
||||
* @param callback the action to call when the registry entry is registered
|
||||
*/
|
||||
default void listen(Consumer<T> callback) {
|
||||
getRegistrar().listen(this, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
accessWidener v2 named
|
||||
accessible method net/minecraft/world/level/block/state/BlockBehaviour$Properties <init> (Lnet/minecraft/world/level/material/Material;Ljava/util/function/Function;)V
|
||||
accessible field net/minecraft/world/level/biome/Biome climateSettings Lnet/minecraft/world/level/biome/Biome$ClimateSettings;
|
||||
accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
|
||||
mutable field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings precipitation Lnet/minecraft/world/level/biome/Biome$Precipitation;
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings precipitation Lnet/minecraft/world/level/biome/Biome$Precipitation;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings temperature F
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings temperature F
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings temperatureModifier Lnet/minecraft/world/level/biome/Biome$TemperatureModifier;
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings temperatureModifier Lnet/minecraft/world/level/biome/Biome$TemperatureModifier;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings downfall F
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings downfall F
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects fogColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects fogColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects waterColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects waterColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects waterFogColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects waterFogColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects skyColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects skyColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects foliageColorOverride Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects foliageColorOverride Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorOverride Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorOverride Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorModifier Lnet/minecraft/world/level/biome/BiomeSpecialEffects$GrassColorModifier;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorModifier Lnet/minecraft/world/level/biome/BiomeSpecialEffects$GrassColorModifier;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientParticleSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientParticleSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientLoopSoundEvent Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientLoopSoundEvent Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientMoodSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientMoodSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientAdditionsSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientAdditionsSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects backgroundMusic Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects backgroundMusic Ljava/util/Optional;
|
||||
transitive-accessible method net/minecraft/world/entity/Entity getEncodeId ()Ljava/lang/String;
|
||||
transitive-accessible method net/minecraft/world/level/storage/LevelResource <init> (Ljava/lang/String;)V
|
||||
transitive-accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier
|
||||
accessible field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
|
||||
transitive-accessible field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
|
||||
transitive-mutable field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
|
||||
transitive-accessible field net/minecraft/world/level/Explosion radius F
|
||||
transitive-mutable field net/minecraft/world/level/Explosion radius F
|
||||
transitive-accessible method net/minecraft/world/entity/player/Player closeContainer ()V
|
||||
transitive-accessible method net/minecraft/client/renderer/RenderType create (Ljava/lang/String;Lcom/mojang/blaze3d/vertex/VertexFormat;Lcom/mojang/blaze3d/vertex/VertexFormat$Mode;IZZLnet/minecraft/client/renderer/RenderType$CompositeState;)Lnet/minecraft/client/renderer/RenderType$CompositeRenderType;
|
||||
transitive-accessible class net/minecraft/client/renderer/RenderType$CompositeState
|
||||
326
common/src/main/resources/architectury.accessWidener
Normal file
326
common/src/main/resources/architectury.accessWidener
Normal file
@@ -0,0 +1,326 @@
|
||||
accessWidener v2 named
|
||||
accessible method net/minecraft/client/gui/screens/Screen addRenderableWidget (Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener;
|
||||
accessible method net/minecraft/client/gui/screens/Screen addRenderableOnly (Lnet/minecraft/client/gui/components/Widget;)Lnet/minecraft/client/gui/components/Widget;
|
||||
accessible method net/minecraft/client/gui/screens/Screen addWidget (Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener;
|
||||
accessible field net/minecraft/client/gui/screens/Screen narratables Ljava/util/List;
|
||||
accessible field net/minecraft/client/gui/screens/Screen renderables Ljava/util/List;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour properties Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties material Lnet/minecraft/world/level/material/Material;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties material Lnet/minecraft/world/level/material/Material;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties materialColor Ljava/util/function/Function;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties materialColor Ljava/util/function/Function;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasCollision Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasCollision Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties soundType Lnet/minecraft/world/level/block/SoundType;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties soundType Lnet/minecraft/world/level/block/SoundType;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties lightEmission Ljava/util/function/ToIntFunction;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties lightEmission Ljava/util/function/ToIntFunction;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties explosionResistance F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties explosionResistance F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties destroyTime F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties destroyTime F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties requiresCorrectToolForDrops Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties requiresCorrectToolForDrops Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRandomlyTicking Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRandomlyTicking Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties friction F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties friction F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties speedFactor F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties speedFactor F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties jumpFactor F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties jumpFactor F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties drops Lnet/minecraft/resources/ResourceLocation;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties drops Lnet/minecraft/resources/ResourceLocation;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties canOcclude Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties canOcclude Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isAir Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isAir Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isValidSpawn Lnet/minecraft/world/level/block/state/BlockBehaviour$StateArgumentPredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isValidSpawn Lnet/minecraft/world/level/block/state/BlockBehaviour$StateArgumentPredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRedstoneConductor Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRedstoneConductor Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isSuffocating Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isSuffocating Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isViewBlocking Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isViewBlocking Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasPostProcess Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasPostProcess Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties emissiveRendering Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties emissiveRendering Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties dynamicShape Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties dynamicShape Z
|
||||
accessible method net/minecraft/world/level/block/state/BlockBehaviour$Properties <init> (Lnet/minecraft/world/level/material/Material;Ljava/util/function/Function;)V
|
||||
transitive-accessible method net/minecraft/world/entity/player/Player closeContainer ()V
|
||||
transitive-accessible method net/minecraft/advancements/CriteriaTriggers register (Lnet/minecraft/advancements/CriterionTrigger;)Lnet/minecraft/advancements/CriterionTrigger;
|
||||
accessible method net/minecraft/world/inventory/MenuType <init> (Lnet/minecraft/world/inventory/MenuType$MenuSupplier;)V
|
||||
accessible class net/minecraft/world/inventory/MenuType$MenuSupplier
|
||||
accessible method net/minecraft/world/entity/Entity getEncodeId ()Ljava/lang/String;
|
||||
accessible field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set;
|
||||
mutable field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set;
|
||||
accessible field net/minecraft/world/level/biome/Biome climateSettings Lnet/minecraft/world/level/biome/Biome$ClimateSettings;
|
||||
accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
|
||||
mutable field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings precipitation Lnet/minecraft/world/level/biome/Biome$Precipitation;
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings precipitation Lnet/minecraft/world/level/biome/Biome$Precipitation;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings temperature F
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings temperature F
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings temperatureModifier Lnet/minecraft/world/level/biome/Biome$TemperatureModifier;
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings temperatureModifier Lnet/minecraft/world/level/biome/Biome$TemperatureModifier;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings downfall F
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings downfall F
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects fogColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects fogColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects waterColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects waterColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects waterFogColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects waterFogColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects skyColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects skyColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects foliageColorOverride Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects foliageColorOverride Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorOverride Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorOverride Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorModifier Lnet/minecraft/world/level/biome/BiomeSpecialEffects$GrassColorModifier;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorModifier Lnet/minecraft/world/level/biome/BiomeSpecialEffects$GrassColorModifier;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientParticleSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientParticleSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientLoopSoundEvent Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientLoopSoundEvent Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientMoodSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientMoodSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientAdditionsSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientAdditionsSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects backgroundMusic Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects backgroundMusic Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeGenerationSettings$Builder features Ljava/util/List;
|
||||
accessible field net/minecraft/world/level/biome/MobSpawnSettings$Builder spawners Ljava/util/Map;
|
||||
accessible field net/minecraft/world/level/biome/MobSpawnSettings$Builder mobSpawnCosts Ljava/util/Map;
|
||||
accessible field net/minecraft/world/level/biome/MobSpawnSettings$Builder creatureGenerationProbability F
|
||||
transitive-accessible method net/minecraft/world/level/GameRules register (Ljava/lang/String;Lnet/minecraft/world/level/GameRules$Category;Lnet/minecraft/world/level/GameRules$Type;)Lnet/minecraft/world/level/GameRules$Key;
|
||||
transitive-accessible method net/minecraft/world/level/GameRules$BooleanValue create (ZLjava/util/function/BiConsumer;)Lnet/minecraft/world/level/GameRules$Type;
|
||||
transitive-accessible method net/minecraft/world/level/GameRules$BooleanValue create (Z)Lnet/minecraft/world/level/GameRules$Type;
|
||||
transitive-accessible method net/minecraft/world/level/GameRules$IntegerValue create (ILjava/util/function/BiConsumer;)Lnet/minecraft/world/level/GameRules$Type;
|
||||
transitive-accessible method net/minecraft/world/level/GameRules$IntegerValue create (I)Lnet/minecraft/world/level/GameRules$Type;
|
||||
transitive-accessible method net/minecraft/world/level/storage/LevelResource <init> (Ljava/lang/String;)V
|
||||
transitive-accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier
|
||||
accessible field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
|
||||
transitive-accessible field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
|
||||
transitive-mutable field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
|
||||
transitive-accessible field net/minecraft/world/level/Explosion radius F
|
||||
transitive-mutable field net/minecraft/world/level/Explosion radius F
|
||||
transitive-accessible method net/minecraft/world/entity/player/Player closeContainer ()V
|
||||
transitive-accessible method net/minecraft/client/renderer/RenderType create (Ljava/lang/String;Lcom/mojang/blaze3d/vertex/VertexFormat;Lcom/mojang/blaze3d/vertex/VertexFormat$Mode;ILnet/minecraft/client/renderer/RenderType$CompositeState;)Lnet/minecraft/client/renderer/RenderType$CompositeRenderType;
|
||||
transitive-accessible method net/minecraft/client/renderer/RenderType create (Ljava/lang/String;Lcom/mojang/blaze3d/vertex/VertexFormat;Lcom/mojang/blaze3d/vertex/VertexFormat$Mode;IZZLnet/minecraft/client/renderer/RenderType$CompositeState;)Lnet/minecraft/client/renderer/RenderType$CompositeRenderType;
|
||||
transitive-accessible class net/minecraft/client/renderer/RenderType$CompositeState
|
||||
transitive-accessible class net/minecraft/client/renderer/RenderType$CompositeRenderType
|
||||
transitive-accessible class net/minecraft/client/renderer/RenderType$OutlineProperty
|
||||
accessible field net/minecraft/world/item/SpawnEggItem BY_ID Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/SpawnEggItem defaultType Lnet/minecraft/world/entity/EntityType;
|
||||
mutable field net/minecraft/world/item/SpawnEggItem defaultType Lnet/minecraft/world/entity/EntityType;
|
||||
accessible field net/minecraft/client/particle/ParticleEngine textureAtlas Lnet/minecraft/client/renderer/texture/TextureAtlas;
|
||||
accessible class net/minecraft/client/particle/ParticleEngine$MutableSpriteSet
|
||||
accessible field net/minecraft/client/particle/ParticleEngine$MutableSpriteSet sprites Ljava/util/List;
|
||||
|
||||
##############################
|
||||
# This section is generated automatically with Gradle task generateAccessWidener!!!
|
||||
##############################
|
||||
|
||||
# Constructors of non-abstract item classes
|
||||
transitive-accessible method net/minecraft/world/item/AxeItem <init> (Lnet/minecraft/world/item/Tier;FFLnet/minecraft/world/item/Item$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/item/DiggerItem <init> (FFLnet/minecraft/world/item/Tier;Lnet/minecraft/tags/TagKey;Lnet/minecraft/world/item/Item$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/item/HoeItem <init> (Lnet/minecraft/world/item/Tier;IFLnet/minecraft/world/item/Item$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/item/PickaxeItem <init> (Lnet/minecraft/world/item/Tier;IFLnet/minecraft/world/item/Item$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/item/RecordItem <init> (ILnet/minecraft/sounds/SoundEvent;Lnet/minecraft/world/item/Item$Properties;)V
|
||||
|
||||
# Constructors of non-abstract block classes
|
||||
transitive-accessible method net/minecraft/world/level/block/AirBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/AttachedStemBlock <init> (Lnet/minecraft/world/level/block/StemGrownBlock;Ljava/util/function/Supplier;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/AzaleaBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BarrierBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BaseCoralFanBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BaseCoralPlantBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BaseCoralPlantTypeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BaseCoralWallFanBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BigDripleafBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BigDripleafStemBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BlastFurnaceBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/BushBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CactusBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CakeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CandleCakeBlock <init> (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CartographyTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CarvedPumpkinBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/ChestBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Ljava/util/function/Supplier;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/ChorusFlowerBlock <init> (Lnet/minecraft/world/level/block/ChorusPlantBlock;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/ChorusPlantBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CoralFanBlock <init> (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CoralPlantBlock <init> (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CoralWallFanBlock <init> (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CraftingTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CropBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/CrossCollisionBlock <init> (FFFFFLnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/DeadBushBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/DirtPathBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/DispenserBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/DoorBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/EnchantmentTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/EndGatewayBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/EndPortalBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/EndRodBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/EnderChestBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/FaceAttachedHorizontalDirectionalBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/FarmBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/FletchingTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/FungusBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Ljava/util/function/Supplier;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/FurnaceBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/GrindstoneBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/HalfTransparentBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/HangingRootsBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/IronBarsBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/JigsawBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/JukeboxBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/KelpBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/KelpPlantBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/LadderBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/LecternBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/LeverBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/LiquidBlock <init> (Lnet/minecraft/world/level/material/FlowingFluid;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/LoomBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/MelonBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/NetherWartBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/NyliumBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/PipeBlock <init> (FLnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/PlayerHeadBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/PlayerWallHeadBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/PoweredRailBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/PressurePlateBlock <init> (Lnet/minecraft/world/level/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/PumpkinBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/RailBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/RedstoneTorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/RedstoneWallTorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/RepeaterBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/RodBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/RootsBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SaplingBlock <init> (Lnet/minecraft/world/level/block/grower/AbstractTreeGrower;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/ScaffoldingBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SeaPickleBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SeagrassBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SkullBlock <init> (Lnet/minecraft/world/level/block/SkullBlock$Type;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SmithingTableBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SmokerBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SnowLayerBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SnowyDirtBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SpawnerBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SpongeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/StairBlock <init> (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/StemBlock <init> (Lnet/minecraft/world/level/block/StemGrownBlock;Ljava/util/function/Supplier;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/StoneButtonBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/StructureBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/StructureVoidBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/SugarCaneBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/TallGrassBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/TorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/TrapDoorBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WallSkullBlock <init> (Lnet/minecraft/world/level/block/SkullBlock$Type;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WallTorchBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WaterlilyBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WeightedPressurePlateBlock <init> (ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WetSpongeBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WitherSkullBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WitherWallSkullBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WoodButtonBlock <init> (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
transitive-accessible method net/minecraft/world/level/block/WoolCarpetBlock <init> (Lnet/minecraft/world/item/DyeColor;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V
|
||||
|
||||
# RenderStateShard fields
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard VIEW_SCALE_Z_EPSILON F
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_TRANSPARENCY Lnet/minecraft/client/renderer/RenderStateShard$TransparencyStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard ADDITIVE_TRANSPARENCY Lnet/minecraft/client/renderer/RenderStateShard$TransparencyStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard LIGHTNING_TRANSPARENCY Lnet/minecraft/client/renderer/RenderStateShard$TransparencyStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard GLINT_TRANSPARENCY Lnet/minecraft/client/renderer/RenderStateShard$TransparencyStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard CRUMBLING_TRANSPARENCY Lnet/minecraft/client/renderer/RenderStateShard$TransparencyStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard TRANSLUCENT_TRANSPARENCY Lnet/minecraft/client/renderer/RenderStateShard$TransparencyStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard BLOCK_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NEW_ENTITY_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POSITION_COLOR_LIGHTMAP_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POSITION_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POSITION_COLOR_TEX_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POSITION_TEX_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POSITION_COLOR_TEX_LIGHTMAP_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POSITION_COLOR_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_SOLID_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_CUTOUT_MIPPED_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_CUTOUT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TRANSLUCENT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TRANSLUCENT_MOVING_BLOCK_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TRANSLUCENT_NO_CRUMBLING_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ARMOR_CUTOUT_NO_CULL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_SOLID_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_CUTOUT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_CUTOUT_NO_CULL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_CUTOUT_NO_CULL_Z_OFFSET_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ITEM_ENTITY_TRANSLUCENT_CULL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_TRANSLUCENT_CULL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_TRANSLUCENT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_SMOOTH_CUTOUT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_BEACON_BEAM_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_DECAL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_NO_OUTLINE_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_SHADOW_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_ALPHA_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_EYES_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENERGY_SWIRL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_LEASH_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_WATER_MASK_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_OUTLINE_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ARMOR_GLINT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ARMOR_ENTITY_GLINT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_GLINT_TRANSLUCENT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_GLINT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_GLINT_DIRECT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_GLINT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_ENTITY_GLINT_DIRECT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_CRUMBLING_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TEXT_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TEXT_INTENSITY_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TEXT_SEE_THROUGH_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TEXT_INTENSITY_SEE_THROUGH_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_LIGHTNING_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_TRIPWIRE_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_END_PORTAL_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_END_GATEWAY_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard RENDERTYPE_LINES_SHADER Lnet/minecraft/client/renderer/RenderStateShard$ShaderStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard BLOCK_SHEET_MIPPED Lnet/minecraft/client/renderer/RenderStateShard$TextureStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard BLOCK_SHEET Lnet/minecraft/client/renderer/RenderStateShard$TextureStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_TEXTURE Lnet/minecraft/client/renderer/RenderStateShard$EmptyTextureStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard DEFAULT_TEXTURING Lnet/minecraft/client/renderer/RenderStateShard$TexturingStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard GLINT_TEXTURING Lnet/minecraft/client/renderer/RenderStateShard$TexturingStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard ENTITY_GLINT_TEXTURING Lnet/minecraft/client/renderer/RenderStateShard$TexturingStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard LIGHTMAP Lnet/minecraft/client/renderer/RenderStateShard$LightmapStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_LIGHTMAP Lnet/minecraft/client/renderer/RenderStateShard$LightmapStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard OVERLAY Lnet/minecraft/client/renderer/RenderStateShard$OverlayStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_OVERLAY Lnet/minecraft/client/renderer/RenderStateShard$OverlayStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard CULL Lnet/minecraft/client/renderer/RenderStateShard$CullStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_CULL Lnet/minecraft/client/renderer/RenderStateShard$CullStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_DEPTH_TEST Lnet/minecraft/client/renderer/RenderStateShard$DepthTestStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard EQUAL_DEPTH_TEST Lnet/minecraft/client/renderer/RenderStateShard$DepthTestStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard LEQUAL_DEPTH_TEST Lnet/minecraft/client/renderer/RenderStateShard$DepthTestStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard COLOR_DEPTH_WRITE Lnet/minecraft/client/renderer/RenderStateShard$WriteMaskStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard COLOR_WRITE Lnet/minecraft/client/renderer/RenderStateShard$WriteMaskStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard DEPTH_WRITE Lnet/minecraft/client/renderer/RenderStateShard$WriteMaskStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard NO_LAYERING Lnet/minecraft/client/renderer/RenderStateShard$LayeringStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard POLYGON_OFFSET_LAYERING Lnet/minecraft/client/renderer/RenderStateShard$LayeringStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard VIEW_OFFSET_Z_LAYERING Lnet/minecraft/client/renderer/RenderStateShard$LayeringStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard MAIN_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard OUTLINE_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard TRANSLUCENT_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard PARTICLES_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard WEATHER_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard CLOUDS_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard ITEM_ENTITY_TARGET Lnet/minecraft/client/renderer/RenderStateShard$OutputStateShard;
|
||||
transitive-accessible field net/minecraft/client/renderer/RenderStateShard DEFAULT_LINE Lnet/minecraft/client/renderer/RenderStateShard$LineStateShard;
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"accessWidener": "architectury-common.accessWidener"
|
||||
"accessWidener": "architectury.accessWidener"
|
||||
}
|
||||
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/architectury.accessWidener")
|
||||
accessWidenerPath = project(":common").loom.accessWidenerPath
|
||||
}
|
||||
|
||||
architectury {
|
||||
@@ -49,6 +49,7 @@ shadowJar {
|
||||
}
|
||||
|
||||
remapJar {
|
||||
injectAccessWidener = true
|
||||
input.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
classifier null
|
||||
|
||||
@@ -38,7 +38,6 @@ import net.minecraft.world.level.BlockAndTintGetter;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -109,7 +108,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getStillTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
||||
public static TextureAtlasSprite getStillTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
|
||||
if (state.getType() == Fluids.EMPTY) return null;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(state.getType());
|
||||
if (handler == null) return null;
|
||||
@@ -120,7 +119,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getStillTexture(@NotNull FluidStack stack) {
|
||||
public static TextureAtlasSprite getStillTexture(FluidStack stack) {
|
||||
if (stack.getFluid() == Fluids.EMPTY) return null;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(stack.getFluid());
|
||||
if (handler == null) return null;
|
||||
@@ -131,7 +130,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getStillTexture(@NotNull Fluid fluid) {
|
||||
public static TextureAtlasSprite getStillTexture(Fluid fluid) {
|
||||
if (fluid == Fluids.EMPTY) return null;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
|
||||
if (handler == null) return null;
|
||||
@@ -142,7 +141,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getFlowingTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
||||
public static TextureAtlasSprite getFlowingTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
|
||||
if (state.getType() == Fluids.EMPTY) return null;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(state.getType());
|
||||
if (handler == null) return null;
|
||||
@@ -153,7 +152,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getFlowingTexture(@NotNull FluidStack stack) {
|
||||
public static TextureAtlasSprite getFlowingTexture(FluidStack stack) {
|
||||
if (stack.getFluid() == Fluids.EMPTY) return null;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(stack.getFluid());
|
||||
if (handler == null) return null;
|
||||
@@ -164,7 +163,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getFlowingTexture(@NotNull Fluid fluid) {
|
||||
public static TextureAtlasSprite getFlowingTexture(Fluid fluid) {
|
||||
if (fluid == Fluids.EMPTY) return null;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
|
||||
if (handler == null) return null;
|
||||
@@ -174,7 +173,7 @@ public class FluidStackHooksImpl {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static int getColor(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
||||
public static int getColor(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
|
||||
if (state.getType() == Fluids.EMPTY) return -1;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(state.getType());
|
||||
if (handler == null) return -1;
|
||||
@@ -182,7 +181,7 @@ public class FluidStackHooksImpl {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static int getColor(@NotNull FluidStack stack) {
|
||||
public static int getColor(FluidStack stack) {
|
||||
if (stack.getFluid() == Fluids.EMPTY) return -1;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(stack.getFluid());
|
||||
if (handler == null) return -1;
|
||||
@@ -190,7 +189,7 @@ public class FluidStackHooksImpl {
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static int getColor(@NotNull Fluid fluid) {
|
||||
public static int getColor(Fluid fluid) {
|
||||
if (fluid == Fluids.EMPTY) return -1;
|
||||
var handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
|
||||
if (handler == null) return -1;
|
||||
|
||||
@@ -26,7 +26,6 @@ import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.fabricmc.loader.api.metadata.ModMetadata;
|
||||
import net.fabricmc.loader.api.metadata.Person;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.nio.file.Path;
|
||||
@@ -99,37 +98,37 @@ public class PlatformImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getModId() {
|
||||
public String getModId() {
|
||||
return metadata.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getVersion() {
|
||||
public String getVersion() {
|
||||
return metadata.getVersion().getFriendlyString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getName() {
|
||||
public String getName() {
|
||||
return metadata.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getDescription() {
|
||||
public String getDescription() {
|
||||
return metadata.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getLogoFile(int preferredSize) {
|
||||
public Optional<String> getLogoFile(int preferredSize) {
|
||||
return metadata.getIconPath(preferredSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Path getFilePath() {
|
||||
public Path getFilePath() {
|
||||
return container.getRootPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Collection<String> getAuthors() {
|
||||
public Collection<String> getAuthors() {
|
||||
return metadata.getAuthors().stream()
|
||||
.map(Person::getName)
|
||||
.collect(Collectors.toList());
|
||||
@@ -141,17 +140,17 @@ public class PlatformImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getHomepage() {
|
||||
public Optional<String> getHomepage() {
|
||||
return metadata.getContact().get("homepage");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getSources() {
|
||||
public Optional<String> getSources() {
|
||||
return metadata.getContact().get("issues");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getIssueTracker() {
|
||||
public Optional<String> getIssueTracker() {
|
||||
return metadata.getContact().get("sources");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,12 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public class BlockPropertiesImpl {
|
||||
public static BlockProperties of(Material material, MaterialColor color) {
|
||||
return new Impl(material, (state) -> color);
|
||||
|
||||
@@ -19,18 +19,19 @@
|
||||
|
||||
package dev.architectury.registry.item.fabric;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry;
|
||||
import net.minecraft.client.renderer.item.ClampedItemPropertyFunction;
|
||||
import net.minecraft.client.renderer.item.ItemProperties;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
|
||||
public class ItemPropertiesRegistryImpl {
|
||||
public static ClampedItemPropertyFunction registerGeneric(ResourceLocation propertyId, ClampedItemPropertyFunction function) {
|
||||
return ItemProperties.registerGeneric(propertyId, function);
|
||||
FabricModelPredicateProviderRegistry.register(propertyId, function);
|
||||
return function;
|
||||
}
|
||||
|
||||
public static ClampedItemPropertyFunction register(ItemLike item, ResourceLocation propertyId, ClampedItemPropertyFunction function) {
|
||||
ItemProperties.register(item.asItem(), propertyId, function);
|
||||
FabricModelPredicateProviderRegistry.register(item.asItem(), propertyId, function);
|
||||
return function;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.registry.level.advancement.fabric;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.advancements.CriterionTrigger;
|
||||
|
||||
public class CriteriaTriggersRegistryImpl {
|
||||
public static <T extends CriterionTrigger<?>> T register(T trigger) {
|
||||
return CriteriaTriggers.register(trigger);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,6 @@ import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
@@ -103,13 +102,11 @@ public class BiomeModificationsImpl {
|
||||
BiomeProperties properties = BiomeHooks.getBiomeProperties(context.getBiome());
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ResourceLocation getKey() {
|
||||
return context.getBiomeKey().location();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public BiomeProperties getProperties() {
|
||||
return properties;
|
||||
}
|
||||
@@ -125,8 +122,7 @@ public class BiomeModificationsImpl {
|
||||
new MutableSpawnProperties(biome, context.getSpawnSettings())
|
||||
) {
|
||||
@Override
|
||||
@NotNull
|
||||
public BiomeProperties.Mutable setCategory(@NotNull BiomeCategory category) {
|
||||
public BiomeProperties.Mutable setCategory(BiomeCategory category) {
|
||||
context.setCategory(category);
|
||||
return this;
|
||||
}
|
||||
@@ -185,7 +181,7 @@ public class BiomeModificationsImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setCreatureProbability(float probability) {
|
||||
public Mutable setCreatureProbability(float probability) {
|
||||
context.setCreatureSpawnProbability(probability);
|
||||
return this;
|
||||
}
|
||||
@@ -223,28 +219,24 @@ public class BiomeModificationsImpl {
|
||||
private static ClimateProperties.Mutable wrapWeather(Biome biome, WeatherContext context) {
|
||||
return new BiomeHooks.ClimateWrapped(biome) {
|
||||
@Override
|
||||
@NotNull
|
||||
public ClimateProperties.Mutable setPrecipitation(@NotNull Precipitation precipitation) {
|
||||
public ClimateProperties.Mutable setPrecipitation(Precipitation precipitation) {
|
||||
context.setPrecipitation(precipitation);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ClimateProperties.Mutable setTemperature(float temperature) {
|
||||
context.setTemperature(temperature);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ClimateProperties.Mutable setTemperatureModifier(@NotNull TemperatureModifier temperatureModifier) {
|
||||
public ClimateProperties.Mutable setTemperatureModifier(TemperatureModifier temperatureModifier) {
|
||||
context.setTemperatureModifier(temperatureModifier);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ClimateProperties.Mutable setDownfall(float downfall) {
|
||||
context.setDownfall(downfall);
|
||||
return this;
|
||||
@@ -255,84 +247,72 @@ public class BiomeModificationsImpl {
|
||||
private static EffectsProperties.Mutable wrapEffects(Biome biome, EffectsContext context) {
|
||||
return new BiomeHooks.EffectsWrapped(biome) {
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setFogColor(int color) {
|
||||
context.setFogColor(color);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setWaterColor(int color) {
|
||||
context.setWaterColor(color);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setWaterFogColor(int color) {
|
||||
context.setWaterFogColor(color);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setSkyColor(int color) {
|
||||
context.setSkyColor(color);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setFoliageColorOverride(@Nullable Integer colorOverride) {
|
||||
context.setFoliageColor(Optional.ofNullable(colorOverride));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setGrassColorOverride(@Nullable Integer colorOverride) {
|
||||
context.setGrassColor(Optional.ofNullable(colorOverride));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setGrassColorModifier(@NotNull GrassColorModifier modifier) {
|
||||
public EffectsProperties.Mutable setGrassColorModifier(GrassColorModifier modifier) {
|
||||
context.setGrassColorModifier(modifier);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setAmbientParticle(@Nullable AmbientParticleSettings settings) {
|
||||
context.setParticleConfig(Optional.ofNullable(settings));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setAmbientLoopSound(@Nullable SoundEvent sound) {
|
||||
context.setAmbientSound(Optional.ofNullable(sound));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setAmbientMoodSound(@Nullable AmbientMoodSettings settings) {
|
||||
context.setMoodSound(Optional.ofNullable(settings));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setAmbientAdditionsSound(@Nullable AmbientAdditionsSettings settings) {
|
||||
context.setAdditionsSound(Optional.ofNullable(settings));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EffectsProperties.Mutable setBackgroundMusic(@Nullable Music music) {
|
||||
context.setMusic(Optional.ofNullable(music));
|
||||
return this;
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class EntityAttributeRegistryImpl {
|
||||
public static void register(Supplier<EntityType<? extends LivingEntity>> type, Supplier<AttributeSupplier.Builder> attribute) {
|
||||
public static void register(Supplier<? extends EntityType<? extends LivingEntity>> type, Supplier<AttributeSupplier.Builder> attribute) {
|
||||
FabricDefaultAttributeRegistry.register(type.get(), attribute.get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.registry.level.fabric;
|
||||
|
||||
import net.fabricmc.fabric.api.gamerule.v1.GameRuleFactory;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public class GameRuleFactoryImpl {
|
||||
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue) {
|
||||
return GameRuleFactory.createBooleanRule(defaultValue);
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue, BiConsumer<MinecraftServer, GameRules.BooleanValue> changedCallback) {
|
||||
return GameRuleFactory.createBooleanRule(defaultValue, changedCallback);
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue) {
|
||||
return GameRuleFactory.createIntRule(defaultValue);
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue, BiConsumer<MinecraftServer, GameRules.IntegerValue> changedCallback) {
|
||||
return GameRuleFactory.createIntRule(defaultValue, changedCallback);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.registry.level.fabric;
|
||||
|
||||
import net.fabricmc.fabric.api.gamerule.v1.GameRuleRegistry;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
|
||||
public class GameRuleRegistryImpl {
|
||||
public static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
|
||||
return GameRuleRegistry.register(name, category, type);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,8 @@ package dev.architectury.registry.registries.fabric;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Suppliers;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import dev.architectury.registry.registries.Registrar;
|
||||
import dev.architectury.registry.registries.RegistrarBuilder;
|
||||
import dev.architectury.registry.registries.Registries;
|
||||
@@ -29,48 +31,66 @@ import dev.architectury.registry.registries.options.RegistrarOption;
|
||||
import dev.architectury.registry.registries.options.StandardRegistrarOption;
|
||||
import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder;
|
||||
import net.fabricmc.fabric.api.event.registry.RegistryAttribute;
|
||||
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
|
||||
import net.minecraft.core.MappedRegistry;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class RegistriesImpl {
|
||||
private static final Multimap<RegistryEntryId<?>, Consumer<?>> LISTENERS = HashMultimap.create();
|
||||
private static final Set<ResourceKey<?>> LISTENED_REGISTRIES = new HashSet<>();
|
||||
|
||||
private static void listen(ResourceKey<?> resourceKey, ResourceLocation id, Consumer<?> listener) {
|
||||
if (LISTENED_REGISTRIES.add(resourceKey)) {
|
||||
RegistryEntryAddedCallback.event(Registry.REGISTRY.get(resourceKey.location())).register((rawId, entryId, object) -> {
|
||||
RegistryEntryId<?> registryEntryId = new RegistryEntryId<>(resourceKey, entryId);
|
||||
for (Consumer<?> consumer : LISTENERS.get(registryEntryId)) {
|
||||
((Consumer<Object>) consumer).accept(object);
|
||||
}
|
||||
LISTENERS.removeAll(registryEntryId);
|
||||
});
|
||||
}
|
||||
|
||||
LISTENERS.put(new RegistryEntryId<>(resourceKey, id), listener);
|
||||
}
|
||||
|
||||
public static Registries.RegistryProvider _get(String modId) {
|
||||
return RegistryProviderImpl.INSTANCE;
|
||||
return new RegistryProviderImpl(modId);
|
||||
}
|
||||
|
||||
public static <T> ResourceLocation getId(T object, ResourceKey<Registry<T>> fallback) {
|
||||
if (fallback == null)
|
||||
return null;
|
||||
return RegistryProviderImpl.INSTANCE.get(fallback).getId(object);
|
||||
return getId(object, (Registry<T>) Registry.REGISTRY.get(fallback.location()));
|
||||
}
|
||||
|
||||
public static <T> ResourceLocation getId(T object, Registry<T> fallback) {
|
||||
if (fallback == null)
|
||||
return null;
|
||||
return RegistryProviderImpl.INSTANCE.get(fallback).getId(object);
|
||||
return fallback.getKey(object);
|
||||
}
|
||||
|
||||
public enum RegistryProviderImpl implements Registries.RegistryProvider {
|
||||
INSTANCE;
|
||||
public static class RegistryProviderImpl implements Registries.RegistryProvider {
|
||||
private final String modId;
|
||||
|
||||
public RegistryProviderImpl(String modId) {
|
||||
this.modId = modId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Registrar<T> get(ResourceKey<Registry<T>> key) {
|
||||
return new RegistrarImpl<>((Registry<T>) Registry.REGISTRY.get(key.location()));
|
||||
return new RegistrarImpl<>(modId, (Registry<T>) Registry.REGISTRY.get(key.location()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Registrar<T> get(Registry<T> registry) {
|
||||
return new RegistrarImpl<>(registry);
|
||||
return new RegistrarImpl<>(modId, registry);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,27 +99,50 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public <T> RegistrarBuilder<T> builder(Class<T> type, ResourceLocation registryId) {
|
||||
return new RegistrarBuilderWrapper<>(FabricRegistryBuilder.createSimple(type, registryId));
|
||||
return new RegistrarBuilderWrapper<>(modId, FabricRegistryBuilder.createSimple(type, registryId));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RegistryEntryId<T> {
|
||||
private final ResourceKey<T> registryKey;
|
||||
private final ResourceLocation id;
|
||||
|
||||
public RegistryEntryId(ResourceKey<T> registryKey, ResourceLocation id) {
|
||||
this.registryKey = registryKey;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof RegistryEntryId)) return false;
|
||||
RegistryEntryId<?> that = (RegistryEntryId<?>) o;
|
||||
return java.util.Objects.equals(registryKey, that.registryKey) && java.util.Objects.equals(id, that.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(registryKey, id);
|
||||
}
|
||||
}
|
||||
|
||||
public static class RegistrarBuilderWrapper<T> implements RegistrarBuilder<T> {
|
||||
@NotNull
|
||||
private final String modId;
|
||||
private FabricRegistryBuilder<T, MappedRegistry<T>> builder;
|
||||
|
||||
public RegistrarBuilderWrapper(@NotNull FabricRegistryBuilder<T, MappedRegistry<T>> builder) {
|
||||
public RegistrarBuilderWrapper(String modId, FabricRegistryBuilder<T, MappedRegistry<T>> builder) {
|
||||
this.modId = modId;
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Registrar<T> build() {
|
||||
return RegistryProviderImpl.INSTANCE.get(builder.buildAndRegister());
|
||||
public Registrar<T> build() {
|
||||
return Registries.get(modId).get(builder.buildAndRegister());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RegistrarBuilder<T> option(@NotNull RegistrarOption option) {
|
||||
public RegistrarBuilder<T> option(RegistrarOption option) {
|
||||
if (option == StandardRegistrarOption.SAVE_TO_DISC) {
|
||||
this.builder.attribute(RegistryAttribute.PERSISTED);
|
||||
} else if (option == StandardRegistrarOption.SYNC_TO_CLIENTS) {
|
||||
@@ -110,23 +153,36 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
public static class RegistrarImpl<T> implements Registrar<T> {
|
||||
private final String modId;
|
||||
private Registry<T> delegate;
|
||||
|
||||
public RegistrarImpl(Registry<T> delegate) {
|
||||
public RegistrarImpl(String modId, Registry<T> delegate) {
|
||||
this.modId = modId;
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RegistrySupplier<T> delegate(ResourceLocation id) {
|
||||
public RegistrySupplier<T> delegate(ResourceLocation id) {
|
||||
Supplier<T> value = Suppliers.memoize(() -> get(id));
|
||||
RegistrarImpl<T> registrar = this;
|
||||
return new RegistrySupplier<>() {
|
||||
@Override
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
public Registries getRegistries() {
|
||||
return Registries.get(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registrar<T> getRegistrar() {
|
||||
return registrar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRegistryId() {
|
||||
return delegate.key().location();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
public ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -160,7 +216,7 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull <E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier) {
|
||||
public <E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier) {
|
||||
Registry.register(delegate, id, supplier.get());
|
||||
return (RegistrySupplier<E>) delegate(id);
|
||||
}
|
||||
@@ -215,10 +271,19 @@ public class RegistriesImpl {
|
||||
return delegate.key();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
return delegate.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void listen(ResourceLocation id, Consumer<T> callback) {
|
||||
T value = get(id);
|
||||
if (value != null) {
|
||||
callback.accept(value);
|
||||
} else {
|
||||
RegistriesImpl.listen(key(), id, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
accessWidener v2 named
|
||||
accessible method net/minecraft/client/gui/screens/Screen addRenderableWidget (Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener;
|
||||
accessible method net/minecraft/client/gui/screens/Screen addRenderableOnly (Lnet/minecraft/client/gui/components/Widget;)Lnet/minecraft/client/gui/components/Widget;
|
||||
accessible method net/minecraft/client/gui/screens/Screen addWidget (Lnet/minecraft/client/gui/components/events/GuiEventListener;)Lnet/minecraft/client/gui/components/events/GuiEventListener;
|
||||
accessible field net/minecraft/client/gui/screens/Screen narratables Ljava/util/List;
|
||||
accessible field net/minecraft/client/gui/screens/Screen renderables Ljava/util/List;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour properties Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties material Lnet/minecraft/world/level/material/Material;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties material Lnet/minecraft/world/level/material/Material;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties materialColor Ljava/util/function/Function;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties materialColor Ljava/util/function/Function;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasCollision Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasCollision Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties soundType Lnet/minecraft/world/level/block/SoundType;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties soundType Lnet/minecraft/world/level/block/SoundType;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties lightEmission Ljava/util/function/ToIntFunction;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties lightEmission Ljava/util/function/ToIntFunction;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties explosionResistance F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties explosionResistance F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties destroyTime F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties destroyTime F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties requiresCorrectToolForDrops Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties requiresCorrectToolForDrops Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRandomlyTicking Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRandomlyTicking Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties friction F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties friction F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties speedFactor F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties speedFactor F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties jumpFactor F
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties jumpFactor F
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties drops Lnet/minecraft/resources/ResourceLocation;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties drops Lnet/minecraft/resources/ResourceLocation;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties canOcclude Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties canOcclude Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isAir Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isAir Z
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isValidSpawn Lnet/minecraft/world/level/block/state/BlockBehaviour$StateArgumentPredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isValidSpawn Lnet/minecraft/world/level/block/state/BlockBehaviour$StateArgumentPredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRedstoneConductor Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isRedstoneConductor Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isSuffocating Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isSuffocating Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties isViewBlocking Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties isViewBlocking Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasPostProcess Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties hasPostProcess Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties emissiveRendering Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties emissiveRendering Lnet/minecraft/world/level/block/state/BlockBehaviour$StatePredicate;
|
||||
accessible field net/minecraft/world/level/block/state/BlockBehaviour$Properties dynamicShape Z
|
||||
mutable field net/minecraft/world/level/block/state/BlockBehaviour$Properties dynamicShape Z
|
||||
accessible method net/minecraft/world/entity/Entity getEncodeId ()Ljava/lang/String;
|
||||
accessible field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set;
|
||||
mutable field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set;
|
||||
accessible method net/minecraft/world/entity/player/Player closeContainer ()V
|
||||
accessible method net/minecraft/advancements/CriteriaTriggers register (Lnet/minecraft/advancements/CriterionTrigger;)Lnet/minecraft/advancements/CriterionTrigger;
|
||||
accessible method net/minecraft/world/inventory/MenuType <init> (Lnet/minecraft/world/inventory/MenuType$MenuSupplier;)V
|
||||
accessible class net/minecraft/world/inventory/MenuType$MenuSupplier
|
||||
accessible method net/minecraft/world/level/block/state/BlockBehaviour$Properties <init> (Lnet/minecraft/world/level/material/Material;Ljava/util/function/Function;)V
|
||||
accessible field net/minecraft/world/level/biome/Biome climateSettings Lnet/minecraft/world/level/biome/Biome$ClimateSettings;
|
||||
accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
|
||||
mutable field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings precipitation Lnet/minecraft/world/level/biome/Biome$Precipitation;
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings precipitation Lnet/minecraft/world/level/biome/Biome$Precipitation;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings temperature F
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings temperature F
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings temperatureModifier Lnet/minecraft/world/level/biome/Biome$TemperatureModifier;
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings temperatureModifier Lnet/minecraft/world/level/biome/Biome$TemperatureModifier;
|
||||
accessible field net/minecraft/world/level/biome/Biome$ClimateSettings downfall F
|
||||
mutable field net/minecraft/world/level/biome/Biome$ClimateSettings downfall F
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects fogColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects fogColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects waterColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects waterColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects waterFogColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects waterFogColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects skyColor I
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects skyColor I
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects foliageColorOverride Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects foliageColorOverride Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorOverride Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorOverride Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorModifier Lnet/minecraft/world/level/biome/BiomeSpecialEffects$GrassColorModifier;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects grassColorModifier Lnet/minecraft/world/level/biome/BiomeSpecialEffects$GrassColorModifier;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientParticleSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientParticleSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientLoopSoundEvent Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientLoopSoundEvent Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientMoodSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientMoodSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects ambientAdditionsSettings Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects ambientAdditionsSettings Ljava/util/Optional;
|
||||
accessible field net/minecraft/world/level/biome/BiomeSpecialEffects backgroundMusic Ljava/util/Optional;
|
||||
mutable field net/minecraft/world/level/biome/BiomeSpecialEffects backgroundMusic Ljava/util/Optional;
|
||||
accessible method net/minecraft/world/level/storage/LevelResource <init> (Ljava/lang/String;)V
|
||||
accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier
|
||||
accessible field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/AxeItem STRIPPABLES Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
|
||||
accessible field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
|
||||
mutable field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
|
||||
accessible method net/minecraft/client/renderer/item/ItemProperties registerGeneric (Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;)Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;
|
||||
accessible method net/minecraft/client/renderer/item/ItemProperties register (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;)V
|
||||
accessible field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
|
||||
mutable field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
|
||||
accessible field net/minecraft/world/level/Explosion radius F
|
||||
mutable field net/minecraft/world/level/Explosion radius F
|
||||
accessible method net/minecraft/client/renderer/RenderType create (Ljava/lang/String;Lcom/mojang/blaze3d/vertex/VertexFormat;Lcom/mojang/blaze3d/vertex/VertexFormat$Mode;IZZLnet/minecraft/client/renderer/RenderType$CompositeState;)Lnet/minecraft/client/renderer/RenderType$CompositeRenderType;
|
||||
accessible class net/minecraft/client/renderer/RenderType$CompositeState
|
||||
@@ -32,7 +32,6 @@
|
||||
"dev.architectury.compat.fabric.ModMenuCompatibility"
|
||||
]
|
||||
},
|
||||
"accessWidener": "architectury.accessWidener",
|
||||
"icon": "icon.png",
|
||||
"depends": {
|
||||
"minecraft": "~1.18-",
|
||||
|
||||
@@ -4,9 +4,14 @@ plugins {
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = project(":common").loom.accessWidenerPath
|
||||
|
||||
forge {
|
||||
mixinConfig "architectury.mixins.json"
|
||||
mixinConfig "architectury-common.mixins.json"
|
||||
|
||||
convertAccessWideners = true
|
||||
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class FluidStackHooksImpl {
|
||||
@@ -68,7 +67,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getStillTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
||||
public static TextureAtlasSprite getStillTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
|
||||
if (state.getType() == Fluids.EMPTY) return null;
|
||||
ResourceLocation texture = state.getType().getAttributes().getStillTexture(level, pos);
|
||||
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(texture);
|
||||
@@ -76,7 +75,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getStillTexture(@NotNull FluidStack stack) {
|
||||
public static TextureAtlasSprite getStillTexture(FluidStack stack) {
|
||||
if (stack.getFluid() == Fluids.EMPTY) return null;
|
||||
ResourceLocation texture = stack.getFluid().getAttributes().getStillTexture(FluidStackHooksForge.toForge(stack));
|
||||
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(texture);
|
||||
@@ -84,7 +83,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getStillTexture(@NotNull Fluid fluid) {
|
||||
public static TextureAtlasSprite getStillTexture(Fluid fluid) {
|
||||
if (fluid == Fluids.EMPTY) return null;
|
||||
ResourceLocation texture = fluid.getAttributes().getStillTexture();
|
||||
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(texture);
|
||||
@@ -92,7 +91,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getFlowingTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
||||
public static TextureAtlasSprite getFlowingTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
|
||||
if (state.getType() == Fluids.EMPTY) return null;
|
||||
ResourceLocation texture = state.getType().getAttributes().getFlowingTexture(level, pos);
|
||||
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(texture);
|
||||
@@ -100,7 +99,7 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getFlowingTexture(@NotNull FluidStack stack) {
|
||||
public static TextureAtlasSprite getFlowingTexture(FluidStack stack) {
|
||||
if (stack.getFluid() == Fluids.EMPTY) return null;
|
||||
ResourceLocation texture = stack.getFluid().getAttributes().getFlowingTexture(FluidStackHooksForge.toForge(stack));
|
||||
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(texture);
|
||||
@@ -108,26 +107,26 @@ public class FluidStackHooksImpl {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
public static TextureAtlasSprite getFlowingTexture(@NotNull Fluid fluid) {
|
||||
public static TextureAtlasSprite getFlowingTexture(Fluid fluid) {
|
||||
if (fluid == Fluids.EMPTY) return null;
|
||||
ResourceLocation texture = fluid.getAttributes().getFlowingTexture();
|
||||
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(texture);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static int getColor(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
||||
public static int getColor(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
|
||||
if (state.getType() == Fluids.EMPTY) return -1;
|
||||
return state.getType().getAttributes().getColor(level, pos);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static int getColor(@NotNull FluidStack stack) {
|
||||
public static int getColor(FluidStack stack) {
|
||||
if (stack.getFluid() == Fluids.EMPTY) return -1;
|
||||
return stack.getFluid().getAttributes().getColor(FluidStackHooksForge.toForge(stack));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static int getColor(@NotNull Fluid fluid) {
|
||||
public static int getColor(Fluid fluid) {
|
||||
if (fluid == Fluids.EMPTY) return -1;
|
||||
return fluid.getAttributes().getColor();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraftforge.fml.loading.FMLPaths;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -124,17 +123,17 @@ public class PlatformImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getLogoFile(int i) {
|
||||
public Optional<String> getLogoFile(int i) {
|
||||
return this.info.getLogoFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Path getFilePath() {
|
||||
public Path getFilePath() {
|
||||
return this.info.getOwningFile().getFile().getFilePath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Collection<String> getAuthors() {
|
||||
public Collection<String> getAuthors() {
|
||||
Optional<String> optional = this.info.getConfig().getConfigElement("authors")
|
||||
.map(String::valueOf);
|
||||
return optional.isPresent() ? Collections.singleton(optional.get()) : Collections.emptyList();
|
||||
@@ -146,18 +145,18 @@ public class PlatformImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getHomepage() {
|
||||
public Optional<String> getHomepage() {
|
||||
return this.info.getConfig().getConfigElement("displayURL")
|
||||
.map(String::valueOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getSources() {
|
||||
public Optional<String> getSources() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<String> getIssueTracker() {
|
||||
public Optional<String> getIssueTracker() {
|
||||
IModFileInfo owningFile = this.info.getOwningFile();
|
||||
if (owningFile instanceof ModFileInfo info) {
|
||||
return Optional.ofNullable(info.getIssueURL())
|
||||
|
||||
@@ -24,9 +24,12 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public class BlockPropertiesImpl {
|
||||
public static BlockProperties of(Material material, MaterialColor materialColor) {
|
||||
return new Impl(material, (state) -> materialColor);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.registry.level.advancement.forge;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.advancements.CriterionTrigger;
|
||||
|
||||
public class CriteriaTriggersRegistryImpl {
|
||||
public static <T extends CriterionTrigger<?>> T register(T trigger) {
|
||||
return CriteriaTriggers.register(trigger);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,6 @@ import net.minecraftforge.eventbus.api.EventPriority;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -76,13 +75,11 @@ public class BiomeModificationsImpl {
|
||||
BiomeProperties properties = new BiomeWrapped(event);
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ResourceLocation getKey() {
|
||||
return event.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public BiomeProperties getProperties() {
|
||||
return properties;
|
||||
}
|
||||
@@ -113,32 +110,28 @@ public class BiomeModificationsImpl {
|
||||
this.spawnProperties = spawnProperties;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ClimateProperties getClimateProperties() {
|
||||
return climateProperties;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EffectsProperties getEffectsProperties() {
|
||||
return effectsProperties;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GenerationProperties getGenerationProperties() {
|
||||
return generationProperties;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SpawnProperties getSpawnProperties() {
|
||||
return spawnProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome.@NotNull BiomeCategory getCategory() {
|
||||
public Biome.BiomeCategory getCategory() {
|
||||
return event.getCategory();
|
||||
}
|
||||
}
|
||||
@@ -179,12 +172,12 @@ public class BiomeModificationsImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Map<MobCategory, List<MobSpawnSettings.SpawnerData>> getSpawners() {
|
||||
public Map<MobCategory, List<MobSpawnSettings.SpawnerData>> getSpawners() {
|
||||
return builder.spawners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Map<EntityType<?>, MobSpawnSettings.MobSpawnCost> getMobSpawnCosts() {
|
||||
public Map<EntityType<?>, MobSpawnSettings.MobSpawnCost> getMobSpawnCosts() {
|
||||
return builder.mobSpawnCosts;
|
||||
}
|
||||
}
|
||||
@@ -200,27 +193,27 @@ public class BiomeModificationsImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ClimateProperties.Mutable getClimateProperties() {
|
||||
public ClimateProperties.Mutable getClimateProperties() {
|
||||
return (ClimateProperties.Mutable) super.getClimateProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull EffectsProperties.Mutable getEffectsProperties() {
|
||||
public EffectsProperties.Mutable getEffectsProperties() {
|
||||
return (EffectsProperties.Mutable) super.getEffectsProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull GenerationProperties.Mutable getGenerationProperties() {
|
||||
public GenerationProperties.Mutable getGenerationProperties() {
|
||||
return (GenerationProperties.Mutable) super.getGenerationProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull SpawnProperties.Mutable getSpawnProperties() {
|
||||
public SpawnProperties.Mutable getSpawnProperties() {
|
||||
return (SpawnProperties.Mutable) super.getSpawnProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setCategory(Biome.@NotNull BiomeCategory category) {
|
||||
public Mutable setCategory(Biome.BiomeCategory category) {
|
||||
event.setCategory(category);
|
||||
return this;
|
||||
}
|
||||
@@ -248,7 +241,6 @@ public class BiomeModificationsImpl {
|
||||
this.downfall = downfall;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome.Precipitation getPrecipitation() {
|
||||
return precipitation;
|
||||
@@ -259,7 +251,6 @@ public class BiomeModificationsImpl {
|
||||
return temperature;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Biome.TemperatureModifier getTemperatureModifier() {
|
||||
return temperatureModifier;
|
||||
@@ -271,28 +262,28 @@ public class BiomeModificationsImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setPrecipitation(Biome.@NotNull Precipitation precipitation) {
|
||||
public Mutable setPrecipitation(Biome.Precipitation precipitation) {
|
||||
this.precipitation = precipitation;
|
||||
this.dirty = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setTemperature(float temperature) {
|
||||
public Mutable setTemperature(float temperature) {
|
||||
this.temperature = temperature;
|
||||
this.dirty = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setTemperatureModifier(Biome.@NotNull TemperatureModifier temperatureModifier) {
|
||||
public Mutable setTemperatureModifier(Biome.TemperatureModifier temperatureModifier) {
|
||||
this.temperatureModifier = temperatureModifier;
|
||||
this.dirty = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setDownfall(float downfall) {
|
||||
public Mutable setDownfall(float downfall) {
|
||||
this.downfall = downfall;
|
||||
this.dirty = true;
|
||||
return this;
|
||||
@@ -336,7 +327,7 @@ public class BiomeModificationsImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Mutable setCreatureProbability(float probability) {
|
||||
public Mutable setCreatureProbability(float probability) {
|
||||
builder.creatureGenerationProbability(probability);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class EntityAttributeRegistryImpl {
|
||||
private static final Map<Supplier<EntityType<? extends LivingEntity>>, Supplier<AttributeSupplier.Builder>> ATTRIBUTES = new ConcurrentHashMap<>();
|
||||
private static final Map<Supplier<? extends EntityType<? extends LivingEntity>>, Supplier<AttributeSupplier.Builder>> ATTRIBUTES = new ConcurrentHashMap<>();
|
||||
|
||||
public static void register(Supplier<EntityType<? extends LivingEntity>> type, Supplier<AttributeSupplier.Builder> attribute) {
|
||||
public static void register(Supplier<? extends EntityType<? extends LivingEntity>> type, Supplier<AttributeSupplier.Builder> attribute) {
|
||||
ATTRIBUTES.put(type, attribute);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class EntityAttributeRegistryImpl {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void event(EntityAttributeCreationEvent event) {
|
||||
for (Map.Entry<Supplier<EntityType<? extends LivingEntity>>, Supplier<AttributeSupplier.Builder>> entry : ATTRIBUTES.entrySet()) {
|
||||
for (Map.Entry<Supplier<? extends EntityType<? extends LivingEntity>>, Supplier<AttributeSupplier.Builder>> entry : ATTRIBUTES.entrySet()) {
|
||||
event.put(entry.getKey().get(), entry.getValue().get().build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.registry.level.forge;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public class GameRuleFactoryImpl {
|
||||
private GameRuleFactoryImpl() {
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue) {
|
||||
return GameRules.BooleanValue.create(defaultValue);
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue, BiConsumer<MinecraftServer, GameRules.BooleanValue> changedCallback) {
|
||||
return GameRules.BooleanValue.create(defaultValue, changedCallback);
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue) {
|
||||
return GameRules.IntegerValue.create(defaultValue);
|
||||
}
|
||||
|
||||
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue, BiConsumer<MinecraftServer, GameRules.IntegerValue> changedCallback) {
|
||||
return GameRules.IntegerValue.create(defaultValue, changedCallback);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 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 dev.architectury.registry.level.forge;
|
||||
|
||||
import net.minecraft.world.level.GameRules;
|
||||
|
||||
public class GameRuleRegistryImpl {
|
||||
public static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
|
||||
return GameRules.register(name, category, type);
|
||||
}
|
||||
}
|
||||
@@ -33,19 +33,29 @@ import dev.architectury.registry.registries.options.StandardRegistrarOption;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.common.world.ForgeWorldPreset;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.EventPriority;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.registries.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class RegistriesImpl {
|
||||
private static final Logger LOGGER = LogManager.getLogger(RegistriesImpl.class);
|
||||
private static final Multimap<RegistryEntryId<?>, Consumer<?>> LISTENERS = HashMultimap.create();
|
||||
|
||||
private static void listen(ResourceKey<?> resourceKey, ResourceLocation id, Consumer<?> listener, boolean vanilla) {
|
||||
LISTENERS.put(new RegistryEntryId<>(resourceKey, id), listener);
|
||||
}
|
||||
|
||||
public static Registries.RegistryProvider _get(String modId) {
|
||||
return new RegistryProviderImpl(modId);
|
||||
}
|
||||
@@ -65,21 +75,68 @@ public class RegistriesImpl {
|
||||
public static class Data {
|
||||
private boolean collected = false;
|
||||
private final Map<RegistryObject<?>, Supplier<? extends IForgeRegistryEntry<?>>> objects = new LinkedHashMap<>();
|
||||
private final Map<ResourceLocation, Supplier<?>> vanillaObjects = new LinkedHashMap<>();
|
||||
|
||||
public void register(IForgeRegistry registry, RegistryObject object, Supplier<? extends IForgeRegistryEntry<?>> reference) {
|
||||
if (!collected) {
|
||||
objects.put(object, reference);
|
||||
} else {
|
||||
registry.register(reference.get());
|
||||
ResourceKey<? extends Registry<Object>> resourceKey = ResourceKey.createRegistryKey(registry.getRegistryName());
|
||||
IForgeRegistryEntry<?> value = reference.get();
|
||||
registry.register(value);
|
||||
object.updateReference(registry);
|
||||
|
||||
RegistryEntryId<?> registryEntryId = new RegistryEntryId<>(resourceKey, object.getId());
|
||||
for (Consumer<?> consumer : LISTENERS.get(registryEntryId)) {
|
||||
((Consumer<Object>) consumer).accept(value);
|
||||
}
|
||||
LISTENERS.removeAll(registryEntryId);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void register(Registry<T> registry, ResourceLocation id, Supplier<? extends T> reference) {
|
||||
if (!collected) {
|
||||
vanillaObjects.put(id, reference);
|
||||
} else {
|
||||
T value = reference.get();
|
||||
Registry.register(registry, id, value);
|
||||
|
||||
RegistryEntryId<?> registryEntryId = new RegistryEntryId<>(registry.key(), id);
|
||||
for (Consumer<?> consumer : LISTENERS.get(registryEntryId)) {
|
||||
((Consumer<Object>) consumer).accept(value);
|
||||
}
|
||||
LISTENERS.removeAll(registryEntryId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class RegistryEntryId<T> {
|
||||
private final ResourceKey<T> registryKey;
|
||||
private final ResourceLocation id;
|
||||
|
||||
public RegistryEntryId(ResourceKey<T> registryKey, ResourceLocation id) {
|
||||
this.registryKey = registryKey;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof RegistryEntryId)) return false;
|
||||
RegistryEntryId<?> that = (RegistryEntryId<?>) o;
|
||||
return java.util.Objects.equals(registryKey, that.registryKey) && java.util.Objects.equals(id, that.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(registryKey, id);
|
||||
}
|
||||
}
|
||||
|
||||
public static class RegistryProviderImpl implements Registries.RegistryProvider {
|
||||
private final String modId;
|
||||
private final Supplier<IEventBus> eventBus;
|
||||
private final Map<Type, Data> registry = new HashMap<>();
|
||||
private final Map<ResourceKey<? extends Registry<?>>, Data> registry = new HashMap<>();
|
||||
private final Multimap<ResourceKey<Registry<?>>, Consumer<Registrar<?>>> listeners = HashMultimap.create();
|
||||
|
||||
public RegistryProviderImpl(String modId) {
|
||||
@@ -101,18 +158,27 @@ public class RegistriesImpl {
|
||||
@Override
|
||||
public <T> Registrar<T> get(ResourceKey<net.minecraft.core.Registry<T>> registryKey) {
|
||||
updateEventBus();
|
||||
return get(RegistryManager.ACTIVE.getRegistry(registryKey.location()));
|
||||
ForgeRegistry registry = RegistryManager.ACTIVE.getRegistry(registryKey.location());
|
||||
if (registry == null) {
|
||||
Registry<T> ts = (Registry<T>) Registry.REGISTRY.get(registryKey.location());
|
||||
if (ts == null) {
|
||||
throw new IllegalArgumentException("Registry " + registryKey + " does not exist!");
|
||||
} else {
|
||||
return get(ts);
|
||||
}
|
||||
}
|
||||
return get(registry);
|
||||
}
|
||||
|
||||
public <T> Registrar<T> get(IForgeRegistry registry) {
|
||||
updateEventBus();
|
||||
return new ForgeBackedRegistryImpl<>(this.registry, registry);
|
||||
return new ForgeBackedRegistryImpl<>(modId, this.registry, registry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Registrar<T> get(net.minecraft.core.Registry<T> registry) {
|
||||
updateEventBus();
|
||||
return new VanillaBackedRegistryImpl<>(registry);
|
||||
return new VanillaBackedRegistryImpl<>(modId, this.registry, registry);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,20 +195,96 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
public class EventListener {
|
||||
public void handleVanillaRegistries() {
|
||||
for (Registry<?> vanillaRegistry : Registry.REGISTRY) {
|
||||
if (RegistryManager.ACTIVE.getRegistry(vanillaRegistry.key().location()) == null) {
|
||||
// Must be vanilla
|
||||
Registrar<?> archRegistry = get(vanillaRegistry);
|
||||
|
||||
for (Map.Entry<ResourceKey<? extends Registry<?>>, Data> typeDataEntry : RegistryProviderImpl.this.registry.entrySet()) {
|
||||
ResourceKey<? extends Registry<?>> resourceKey = archRegistry.key();
|
||||
if (typeDataEntry.getKey().equals(resourceKey)) {
|
||||
Data data = typeDataEntry.getValue();
|
||||
data.collected = true;
|
||||
|
||||
for (Map.Entry<ResourceLocation, Supplier<?>> entry : data.vanillaObjects.entrySet()) {
|
||||
Object value = entry.getValue().get();
|
||||
Registry.register((Registry<Object>) vanillaRegistry, entry.getKey(), value);
|
||||
|
||||
RegistryEntryId<?> registryEntryId = new RegistryEntryId<>(resourceKey, entry.getKey());
|
||||
for (Consumer<?> consumer : LISTENERS.get(registryEntryId)) {
|
||||
((Consumer<Object>) consumer).accept(value);
|
||||
}
|
||||
LISTENERS.removeAll(registryEntryId);
|
||||
}
|
||||
|
||||
data.objects.clear();
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<ResourceKey<net.minecraft.core.Registry<?>>, Consumer<Registrar<?>>> entry : listeners.entries()) {
|
||||
if (entry.getKey().equals(vanillaRegistry.key())) {
|
||||
entry.getValue().accept(archRegistry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleVanillaRegistriesPost() {
|
||||
for (Registry<?> vanillaRegistry : Registry.REGISTRY) {
|
||||
if (RegistryManager.ACTIVE.getRegistry(vanillaRegistry.key().location()) == null) {
|
||||
// Must be vanilla
|
||||
Registrar<?> archRegistry = get(vanillaRegistry);
|
||||
|
||||
List<RegistryEntryId<?>> toRemove = new ArrayList<>();
|
||||
for (Map.Entry<RegistryEntryId<?>, Collection<Consumer<?>>> entry : LISTENERS.asMap().entrySet()) {
|
||||
if (entry.getKey().registryKey.equals(archRegistry.key())) {
|
||||
if (vanillaRegistry.containsKey(entry.getKey().id)) {
|
||||
Object value = vanillaRegistry.get(entry.getKey().id);
|
||||
for (Consumer<?> consumer : entry.getValue()) {
|
||||
((Consumer<Object>) consumer).accept(value);
|
||||
}
|
||||
toRemove.add(entry.getKey());
|
||||
} else {
|
||||
LOGGER.warn("Registry entry listened {} was not realized!", entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (RegistryEntryId<?> entryId : toRemove) {
|
||||
LISTENERS.removeAll(entryId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void handleEvent(RegistryEvent.Register event) {
|
||||
if (event.getGenericType() == Block.class) {
|
||||
handleVanillaRegistries();
|
||||
}
|
||||
|
||||
IForgeRegistry registry = event.getRegistry();
|
||||
Registrar<Object> archRegistry = get(registry);
|
||||
|
||||
for (Map.Entry<Type, Data> typeDataEntry : RegistryProviderImpl.this.registry.entrySet()) {
|
||||
if (typeDataEntry.getKey() == registry.getRegistrySuperType()) {
|
||||
for (Map.Entry<ResourceKey<? extends Registry<?>>, Data> typeDataEntry : RegistryProviderImpl.this.registry.entrySet()) {
|
||||
ResourceKey<? extends Registry<Object>> resourceKey = archRegistry.key();
|
||||
if (typeDataEntry.getKey().equals(resourceKey)) {
|
||||
Data data = typeDataEntry.getValue();
|
||||
|
||||
data.collected = true;
|
||||
|
||||
for (Map.Entry<RegistryObject<?>, Supplier<? extends IForgeRegistryEntry<?>>> entry : data.objects.entrySet()) {
|
||||
registry.register(entry.getValue().get());
|
||||
IForgeRegistryEntry<?> value = entry.getValue().get();
|
||||
registry.register(value);
|
||||
entry.getKey().updateReference(registry);
|
||||
|
||||
RegistryEntryId<?> registryEntryId = new RegistryEntryId<>(resourceKey, entry.getKey().getId());
|
||||
for (Consumer<?> consumer : LISTENERS.get(registryEntryId)) {
|
||||
((Consumer<Object>) consumer).accept(value);
|
||||
}
|
||||
LISTENERS.removeAll(registryEntryId);
|
||||
}
|
||||
|
||||
data.objects.clear();
|
||||
@@ -155,31 +297,57 @@ public class RegistriesImpl {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void handleEventPost(RegistryEvent.Register event) {
|
||||
if (event.getGenericType() == ForgeWorldPreset.class) {
|
||||
handleVanillaRegistriesPost();
|
||||
}
|
||||
|
||||
IForgeRegistry registry = event.getRegistry();
|
||||
Registrar<Object> archRegistry = get(registry);
|
||||
ResourceKey<? extends Registry<Object>> resourceKey = archRegistry.key();
|
||||
List<RegistryEntryId<?>> toRemove = new ArrayList<>();
|
||||
for (Map.Entry<RegistryEntryId<?>, Collection<Consumer<?>>> entry : LISTENERS.asMap().entrySet()) {
|
||||
if (entry.getKey().registryKey.equals(resourceKey)) {
|
||||
if (registry.containsKey(entry.getKey().id)) {
|
||||
IForgeRegistryEntry value = registry.getValue(entry.getKey().id);
|
||||
for (Consumer<?> consumer : entry.getValue()) {
|
||||
((Consumer<Object>) consumer).accept(value);
|
||||
}
|
||||
toRemove.add(entry.getKey());
|
||||
} else {
|
||||
LOGGER.warn("Registry entry listened {} was not realized!", entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (RegistryEntryId<?> id : toRemove) {
|
||||
LISTENERS.removeAll(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class RegistryBuilderWrapper<T> implements RegistrarBuilder<T> {
|
||||
@NotNull
|
||||
private final RegistryProviderImpl provider;
|
||||
@NotNull
|
||||
private final net.minecraftforge.registries.RegistryBuilder<?> builder;
|
||||
private boolean saveToDisk = false;
|
||||
private boolean syncToClients = false;
|
||||
|
||||
public RegistryBuilderWrapper(@NotNull RegistryProviderImpl provider, @NotNull net.minecraftforge.registries.RegistryBuilder<?> builder) {
|
||||
public RegistryBuilderWrapper(RegistryProviderImpl provider, net.minecraftforge.registries.RegistryBuilder<?> builder) {
|
||||
this.provider = provider;
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Registrar<T> build() {
|
||||
public Registrar<T> build() {
|
||||
if (!syncToClients) builder.disableSync();
|
||||
if (!saveToDisk) builder.disableSaving();
|
||||
return provider.get(builder.create());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RegistrarBuilder<T> option(@NotNull RegistrarOption option) {
|
||||
public RegistrarBuilder<T> option(RegistrarOption option) {
|
||||
if (option == StandardRegistrarOption.SAVE_TO_DISC) {
|
||||
this.saveToDisk = true;
|
||||
} else if (option == StandardRegistrarOption.SYNC_TO_CLIENTS) {
|
||||
@@ -190,23 +358,38 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
public static class VanillaBackedRegistryImpl<T> implements Registrar<T> {
|
||||
private final String modId;
|
||||
private net.minecraft.core.Registry<T> delegate;
|
||||
private Map<ResourceKey<? extends Registry<?>>, Data> registry;
|
||||
|
||||
public VanillaBackedRegistryImpl(net.minecraft.core.Registry<T> delegate) {
|
||||
public VanillaBackedRegistryImpl(String modId, Map<ResourceKey<? extends Registry<?>>, Data> registry, net.minecraft.core.Registry<T> delegate) {
|
||||
this.modId = modId;
|
||||
this.registry = registry;
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RegistrySupplier<T> delegate(ResourceLocation id) {
|
||||
public RegistrySupplier<T> delegate(ResourceLocation id) {
|
||||
Supplier<T> value = Suppliers.memoize(() -> get(id));
|
||||
Registrar<T> registrar = this;
|
||||
return new RegistrySupplier<T>() {
|
||||
@Override
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
public Registries getRegistries() {
|
||||
return Registries.get(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registrar<T> getRegistrar() {
|
||||
return registrar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRegistryId() {
|
||||
return delegate.key().location();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
public ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -241,8 +424,9 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull <E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier) {
|
||||
net.minecraft.core.Registry.register(delegate, id, supplier.get());
|
||||
public <E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier) {
|
||||
registry.computeIfAbsent(key(), type -> new Data())
|
||||
.register(delegate, id, supplier);
|
||||
return (RegistrySupplier<E>) delegate(id);
|
||||
}
|
||||
|
||||
@@ -302,28 +486,51 @@ public class RegistriesImpl {
|
||||
public Iterator<T> iterator() {
|
||||
return delegate.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void listen(ResourceLocation id, Consumer<T> callback) {
|
||||
T value = get(id);
|
||||
if (value != null) {
|
||||
callback.accept(value);
|
||||
} else {
|
||||
RegistriesImpl.listen(key(), id, callback, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class ForgeBackedRegistryImpl<T extends IForgeRegistryEntry<T>> implements Registrar<T> {
|
||||
private final String modId;
|
||||
private IForgeRegistry<T> delegate;
|
||||
private Map<Type, Data> registry;
|
||||
private Map<ResourceKey<? extends Registry<?>>, Data> registry;
|
||||
|
||||
public ForgeBackedRegistryImpl(Map<Type, Data> registry, IForgeRegistry<T> delegate) {
|
||||
public ForgeBackedRegistryImpl(String modId, Map<ResourceKey<? extends Registry<?>>, Data> registry, IForgeRegistry<T> delegate) {
|
||||
this.modId = modId;
|
||||
this.registry = registry;
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RegistrySupplier<T> delegate(ResourceLocation id) {
|
||||
public RegistrySupplier<T> delegate(ResourceLocation id) {
|
||||
Supplier<T> value = Suppliers.memoize(() -> get(id));
|
||||
Registrar<T> registrar = this;
|
||||
return new RegistrySupplier<T>() {
|
||||
@Override
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
public Registries getRegistries() {
|
||||
return Registries.get(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registrar<T> getRegistrar() {
|
||||
return registrar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRegistryId() {
|
||||
return delegate.getRegistryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
public ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -358,18 +565,29 @@ public class RegistriesImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull <E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier) {
|
||||
public <E extends T> RegistrySupplier<E> register(ResourceLocation id, Supplier<E> supplier) {
|
||||
RegistryObject registryObject = RegistryObject.of(id, delegate);
|
||||
registry.computeIfAbsent(delegate.getRegistrySuperType(), type -> new Data())
|
||||
registry.computeIfAbsent(key(), type -> new Data())
|
||||
.register(delegate, registryObject, () -> supplier.get().setRegistryName(id));
|
||||
Registrar<T> registrar = this;
|
||||
return new RegistrySupplier<E>() {
|
||||
@Override
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
public Registries getRegistries() {
|
||||
return Registries.get(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registrar<E> getRegistrar() {
|
||||
return (Registrar<E>) registrar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRegistryId() {
|
||||
return delegate.getRegistryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
public ResourceLocation getId() {
|
||||
return registryObject.getId();
|
||||
}
|
||||
|
||||
@@ -459,5 +677,15 @@ public class RegistriesImpl {
|
||||
public Iterator<T> iterator() {
|
||||
return delegate.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void listen(ResourceLocation id, Consumer<T> callback) {
|
||||
T value = get(id);
|
||||
if (value != null) {
|
||||
callback.accept(value);
|
||||
} else {
|
||||
RegistriesImpl.listen(key(), id, callback, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour f_60439_ #properties
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties <init>(Lnet/minecraft/world/level/material/Material;Ljava/util/function/Function;)V
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60882_ #material
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60888_ #destroyTime
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60887_ #explosionResistance
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60884_ #hasCollision
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60890_ #isRandomlyTicking
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60886_ #lightEmission
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60883_ #materialColor
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60885_ #soundType
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60891_ #friction
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60892_ #speedFactor
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60903_ #dynamicShape
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60895_ #canOcclude
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60896_ #isAir
|
||||
public net.minecraft.world.level.block.state.BlockBehaviour$Properties f_60889_ #requiresCorrectToolForDrops
|
||||
public-f net.minecraft.world.level.Explosion f_46017_ #radius
|
||||
public net.minecraft.client.gui.screens.Screen f_169368_ #narratables
|
||||
public net.minecraft.client.gui.screens.Screen f_169369_ #renderables
|
||||
public-f net.minecraft.world.level.biome.Biome$ClimateSettings field_242460_b # precipitation
|
||||
public-f net.minecraft.world.level.biome.Biome$ClimateSettings field_242461_c # temperature
|
||||
public-f net.minecraft.world.level.biome.Biome$ClimateSettings field_242462_d # temperatureModifier
|
||||
public-f net.minecraft.world.level.biome.Biome$ClimateSettings field_242463_e # downfall
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47927_ # fogColor
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47928_ # waterColor
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47929_ # waterFogColor
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47934_ # ambientParticleSettings
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47935_ # ambientLoopSoundEvent
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47936_ # ambientMoodSettings
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47937_ # ambientAdditionsSettings
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47938_ # backgroundMusic
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47930_ # skyColor
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47931_ # foliageColorOverride
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47932_ # grassColorOverride
|
||||
public-f net.minecraft.world.level.biome.BiomeSpecialEffects f_47933_ # grassColorModifier
|
||||
public net.minecraft.world.level.storage.LevelResource <init>(Ljava/lang/String;)V
|
||||
public net.minecraft.world.level.biome.BiomeGenerationSettings$Builder f_47828_ # features
|
||||
public net.minecraft.world.level.biome.MobSpawnSettings$Builder f_48362_ # spawners
|
||||
public net.minecraft.world.level.biome.MobSpawnSettings$Builder f_48363_ # mobSpawnCosts
|
||||
public net.minecraft.world.level.biome.MobSpawnSettings$Builder f_48365_ # playerCanSpawn
|
||||
public net.minecraft.world.level.GameRules$BooleanValue m_46250_(Z)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.GameRules$BooleanValue m_46252_(ZLjava/util/function/BiConsumer;)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.GameRules$IntegerValue m_46312_(I)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.GameRules$IntegerValue m_46294_(ILjava/util/function/BiConsumer;)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.client.particle.ParticleEngine f_107296_ # textureAtlas
|
||||
public net.minecraft.client.particle.ParticleEngine$MutableSpriteSet
|
||||
public net.minecraft.client.particle.ParticleEngine$MutableSpriteSet f_107406_ # sprites
|
||||
public-f net.minecraft.world.item.AxeItem f_150683_ # STRIPPABLES
|
||||
public-f net.minecraft.world.item.ShovelItem f_43110_ # FLATTENABLES
|
||||
public-f net.minecraft.world.item.HoeItem f_41332_ # TILLABLES
|
||||
@@ -10,7 +10,7 @@ cf_type=release
|
||||
|
||||
archives_base_name=architectury
|
||||
archives_base_name_snapshot=architectury-snapshot
|
||||
base_version=4.0
|
||||
base_version=4.1
|
||||
maven_group=dev.architectury
|
||||
|
||||
fabric_loader_version=0.13.2
|
||||
|
||||
@@ -38,8 +38,7 @@ import dev.architectury.utils.Env;
|
||||
import dev.architectury.utils.EnvExecutor;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.model.geom.ModelLayers;
|
||||
import net.minecraft.client.renderer.entity.MinecartRenderer;
|
||||
import net.minecraft.client.renderer.entity.PigRenderer;
|
||||
|
||||
public class TestMod {
|
||||
public static final MessageSink SINK = EnvExecutor.getEnvSpecific(() -> ClientOverlayMessageSink::new, () -> ConsoleMessageSink::new);
|
||||
@@ -65,8 +64,7 @@ public class TestMod {
|
||||
ClientLifecycleEvent.CLIENT_STOPPING.register((client) -> SINK.accept("Client stopping!"));
|
||||
TestKeybinds.initialize();
|
||||
TestModNet.initializeClient();
|
||||
EntityRendererRegistry.register(() -> TestEntity.TYPE, context ->
|
||||
new MinecartRenderer<>(context, ModelLayers.MINECART));
|
||||
EntityRendererRegistry.register(() -> TestEntity.TYPE, PigRenderer::new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,21 +23,16 @@ import dev.architectury.networking.NetworkManager;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.MobCategory;
|
||||
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
||||
import net.minecraft.world.entity.animal.Pig;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
public class TestEntity extends AbstractMinecart {
|
||||
public class TestEntity extends Pig {
|
||||
public static final EntityType<TestEntity> TYPE = EntityType.Builder.of(TestEntity::new, MobCategory.MISC).sized(0.98F, 0.7F).clientTrackingRange(8).build("test_entity");
|
||||
|
||||
public TestEntity(EntityType<? extends AbstractMinecart> entityType, Level level) {
|
||||
public TestEntity(EntityType<? extends Pig> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getMinecartType() {
|
||||
return Type.RIDEABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet<?> getAddEntityPacket() {
|
||||
return NetworkManager.createAddEntityPacket(this);
|
||||
|
||||
@@ -218,10 +218,10 @@ public class DebugEvents {
|
||||
TestMod.SINK.accept(bolt.getScoreboardName() + " struck at " + toShortString(pos) + logSide(level));
|
||||
});
|
||||
ChunkEvent.LOAD_DATA.register((chunk, level, nbt) -> {
|
||||
TestMod.SINK.accept("Chunk loaded at x=" + chunk.getPos().x + ", z=" + chunk.getPos().z + " in dimension '" + level.dimension().location() + "'");
|
||||
// TestMod.SINK.accept("Chunk loaded at x=" + chunk.getPos().x + ", z=" + chunk.getPos().z + " in dimension '" + level.dimension().location() + "'");
|
||||
});
|
||||
ChunkEvent.SAVE_DATA.register((chunk, level, nbt) -> {
|
||||
TestMod.SINK.accept("Chunk saved at x=" + chunk.getPos().x + ", z=" + chunk.getPos().z + " in dimension '" + level.dimension().location() + "'");
|
||||
// TestMod.SINK.accept("Chunk saved at x=" + chunk.getPos().x + ", z=" + chunk.getPos().z + " in dimension '" + level.dimension().location() + "'");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
|
||||
package dev.architectury.test.registry;
|
||||
|
||||
import dev.architectury.core.item.ArchitecturySpawnEggItem;
|
||||
import dev.architectury.hooks.item.food.FoodPropertiesHooks;
|
||||
import dev.architectury.hooks.level.entity.EntityHooks;
|
||||
import dev.architectury.registry.block.BlockProperties;
|
||||
import dev.architectury.registry.level.entity.EntityAttributeRegistry;
|
||||
import dev.architectury.registry.registries.DeferredRegister;
|
||||
import dev.architectury.registry.registries.RegistrySupplier;
|
||||
import dev.architectury.test.TestMod;
|
||||
@@ -35,11 +37,13 @@ import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectCategory;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.animal.Pig;
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.crafting.CustomRecipe;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
@@ -55,6 +59,7 @@ public class TestRegistries {
|
||||
public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(TestMod.MOD_ID, Registry.ENTITY_TYPE_REGISTRY);
|
||||
public static final DeferredRegister<MobEffect> MOB_EFFECTS = DeferredRegister.create(TestMod.MOD_ID, Registry.MOB_EFFECT_REGISTRY);
|
||||
public static final DeferredRegister<RecipeSerializer<?>> RECIPE_SERIALIZERS = DeferredRegister.create(TestMod.MOD_ID, Registry.RECIPE_SERIALIZER_REGISTRY);
|
||||
public static final DeferredRegister<RecipeType<?>> RECIPE_TYPES = DeferredRegister.create(TestMod.MOD_ID, Registry.RECIPE_TYPE_REGISTRY);
|
||||
|
||||
public static final RegistrySupplier<MobEffect> TEST_EFFECT = MOB_EFFECTS.register("test_effect", () ->
|
||||
new MobEffect(MobEffectCategory.NEUTRAL, 0x123456) {
|
||||
@@ -69,6 +74,9 @@ public class TestRegistries {
|
||||
FoodPropertiesHooks.effect(fpBuilder, () -> new MobEffectInstance(TEST_EFFECT.get(), 100), 1);
|
||||
return new Item(new Item.Properties().tab(TestCreativeTabs.TEST_TAB).food(fpBuilder.build()));
|
||||
});
|
||||
public static final RegistrySupplier<Item> TEST_SPAWN_EGG = ITEMS.register("test_spawn_egg", () ->
|
||||
new ArchitecturySpawnEggItem(TestRegistries.TEST_ENTITY, 0xFF000000, 0xFFFFFFFF,
|
||||
new Item.Properties().tab(TestCreativeTabs.TEST_TAB)));
|
||||
|
||||
public static final RegistrySupplier<Block> TEST_BLOCK = BLOCKS.register("test_block", () ->
|
||||
new Block(BlockProperties.copy(Blocks.STONE)));
|
||||
@@ -90,11 +98,29 @@ public class TestRegistries {
|
||||
|
||||
public static final RegistrySupplier<RecipeSerializer<CustomRecipe>> TEST_SERIALIZER = RECIPE_SERIALIZERS.register("test_serializer", TestRecipeSerializer::new);
|
||||
|
||||
public static final RegistrySupplier<RecipeType<CustomRecipe>> TEST_RECIPE_TYPE = RECIPE_TYPES.register("test_recipe_type", () -> new RecipeType<CustomRecipe>() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return TestMod.MOD_ID + ":test_recipe_type";
|
||||
}
|
||||
});
|
||||
|
||||
public static void initialize() {
|
||||
MOB_EFFECTS.register();
|
||||
BLOCKS.register();
|
||||
ITEMS.register();
|
||||
ENTITY_TYPES.register();
|
||||
RECIPE_TYPES.register();
|
||||
RECIPE_SERIALIZERS.register();
|
||||
EntityAttributeRegistry.register(TEST_ENTITY, Pig::createAttributes);
|
||||
TEST_BLOCK_ITEM.listen(item -> {
|
||||
System.out.println("Registered item!");
|
||||
});
|
||||
TEST_SERIALIZER.listen(type -> {
|
||||
System.out.println("Registered recipe serializer!");
|
||||
});
|
||||
TEST_RECIPE_TYPE.listen(type -> {
|
||||
System.out.println("Registered recipe type!");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "minecraft:item/template_spawn_egg"
|
||||
}
|
||||
@@ -4,6 +4,8 @@ plugins {
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = project(":common").loom.accessWidenerPath
|
||||
|
||||
mixin { useLegacyMixinAp = true }
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ plugins {
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = project(":common").loom.accessWidenerPath
|
||||
|
||||
forge {
|
||||
mixinConfig "architectury.mixins.json"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user