Replace all accessors with accesswideners.

This commit is contained in:
modmuss50 2022-04-20 23:46:50 +01:00
parent 2a5645bb19
commit 22c29fea14
22 changed files with 57 additions and 328 deletions

View file

@ -31,3 +31,8 @@ curseforge {
forgeGradleIntegration = false
}
}
def rcAw = file("src/main/resources/reborncore.accesswidener")
def trAw = rootProject.file("src/main/resources/techreborn.accesswidener")
trAw.text = (rcAw.text + "\n\n# DO NOT EDIT THIS FILE, edit the RebornCore AW, it will automatically be coped to this one.")

View file

@ -49,9 +49,7 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.blockentity.SlotConfiguration;
import reborncore.common.chunkloading.ChunkLoaderManager;
import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.NetworkManager;
import reborncore.common.screen.BuiltScreenHandler;
import reborncore.mixin.client.AccessorChatHud;
@Environment(EnvType.CLIENT)
public class ClientBoundPacketHandlers {
@ -150,8 +148,7 @@ public class ClientBoundPacketHandlers {
client.execute(() -> {
int deleteID = RebornCore.MOD_ID.hashCode() + messageId;
ChatHud chat = MinecraftClient.getInstance().inGameHud.getChatHud();
AccessorChatHud accessorChatHud = (AccessorChatHud) chat;
accessorChatHud.invokeAddMessage(text, deleteID);
chat.addMessage(text, deleteID);
});
});

View file

@ -57,7 +57,6 @@ import reborncore.client.gui.guibuilder.GuiBuilder;
import reborncore.common.screen.BuiltScreenHandler;
import reborncore.client.screen.builder.slot.PlayerInventorySlot;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.mixin.client.AccessorScreen;
import java.util.ArrayList;
import java.util.Collections;
@ -278,8 +277,7 @@ public class GuiBase<T extends ScreenHandler> extends HandledScreen<T> {
offset += 24;
}
AccessorScreen accessorScreen = (AccessorScreen)this;
for (Selectable selectable : accessorScreen.getSelectables()) {
for (Selectable selectable : selectables) {
if (selectable instanceof ClickableWidget clickable) {
if (clickable.isHovered()) {
clickable.renderTooltip(matrixStack, mouseX, mouseY);

View file

@ -42,7 +42,6 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.network.NetworkManager;
import reborncore.common.network.ServerBoundPackets;
import reborncore.common.util.Color;
import reborncore.mixin.common.AccessorSlot;
import java.util.Collections;
import java.util.HashMap;
@ -68,9 +67,9 @@ public class SlotConfigGui {
if (guiBase.be != slot.inventory) {
continue;
}
AccessorSlot accessorSlot = (AccessorSlot) slot;
ConfigSlotElement slotElement = new ConfigSlotElement(guiBase.getMachine().getOptionalInventory().get(), accessorSlot.getIndex(), SlotType.NORMAL, slot.x - guiBase.getGuiLeft() + 50, slot.y - guiBase.getGuiTop() - 25, guiBase);
slotElementMap.put(accessorSlot.getIndex(), slotElement);
ConfigSlotElement slotElement = new ConfigSlotElement(guiBase.getMachine().getOptionalInventory().get(), slot.getIndex(), SlotType.NORMAL, slot.x - guiBase.getGuiLeft() + 50, slot.y - guiBase.getGuiTop() - 25, guiBase);
slotElementMap.put(slot.getIndex(), slotElement);
}
}
@ -167,8 +166,7 @@ public class SlotConfigGui {
continue;
}
if (guiBase.isPointInRect(slot.x, slot.y, 18, 18, mouseX, mouseY)) {
AccessorSlot accessorSlot = (AccessorSlot) slot;
selectedSlot = accessorSlot.getIndex();
selectedSlot = slot.getIndex();
return true;
}
}

View file

@ -62,7 +62,7 @@ public class ConfigSlotElement extends ElementBase {
.filter(slot -> slot.inventory == inventory)
.filter(slot -> slot instanceof BaseSlot)
.map(slot -> (BaseSlot) slot)
.filter(baseSlot -> baseSlot.getSlotID() == slotId)
.filter(baseSlot -> baseSlot.getIndex() == slotId)
.allMatch(BaseSlot::canWorldBlockInsert);

View file

@ -27,7 +27,6 @@ package reborncore.client.gui.slots;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.slot.Slot;
import reborncore.mixin.common.AccessorSlot;
import java.util.function.Predicate;
@ -59,8 +58,4 @@ public class BaseSlot extends Slot {
public boolean canWorldBlockInsert() {
return true;
}
public int getSlotID() {
return ((AccessorSlot) this).getIndex();
}
}

View file

@ -47,7 +47,6 @@ import net.minecraft.world.World;
import org.jetbrains.annotations.NotNull;
import reborncore.common.util.DefaultedListCollector;
import reborncore.common.util.serialization.SerializationUtil;
import reborncore.mixin.common.AccessorRecipeManager;
import java.util.Collection;
import java.util.List;
@ -56,8 +55,7 @@ import java.util.Objects;
public class RecipeUtils {
@SuppressWarnings("unchecked")
public static <T extends RebornRecipe> List<T> getRecipes(World world, RebornRecipeType<T> type) {
final AccessorRecipeManager accessorRecipeManager = (AccessorRecipeManager) world.getRecipeManager();
final Collection<Recipe<Inventory>> recipes = accessorRecipeManager.getAll(type).values().stream().toList();
final Collection<Recipe<Inventory>> recipes = world.getRecipeManager().getAllOfType(type).values().stream().toList();
//noinspection unchecked
return (List<T>) (Object) recipes;
}

View file

@ -31,11 +31,11 @@ import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage;
import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant;
import net.fabricmc.fabric.api.transfer.v1.storage.Storage;
import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil;
import net.fabricmc.fabric.api.transfer.v1.storage.base.FilteringStorage;
import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage;
import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction;
import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext;
import net.minecraft.block.Block;
import net.minecraft.block.FluidBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.Fluids;
@ -44,11 +44,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Hand;
import net.minecraft.util.registry.Registry;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import reborncore.common.fluid.container.FluidInstance;
import reborncore.common.util.Tank;
import reborncore.mixin.common.AccessorFluidBlock;
import java.util.List;
import java.util.function.Predicate;
@ -58,9 +56,10 @@ public class FluidUtils {
@NotNull
public static Fluid fluidFromBlock(Block block) {
if (block instanceof AccessorFluidBlock) {
return ((AccessorFluidBlock) block).getFluid();
if (block instanceof FluidBlock fluidBlock) {
return fluidBlock.fluid;
}
return Fluids.EMPTY;
}

View file

@ -43,7 +43,6 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.network.ClientBoundPackets;
import reborncore.common.network.NetworkManager;
import reborncore.common.util.ItemUtils;
import reborncore.mixin.common.AccessorScreenHandler;
import reborncore.mixin.ifaces.ServerPlayerEntityScreenHandler;
import java.util.HashMap;
@ -115,7 +114,7 @@ public class BuiltScreenHandler extends ScreenHandler {
public void sendContentUpdates() {
super.sendContentUpdates();
for (final ScreenHandlerListener listener : ((AccessorScreenHandler) (this)).getListeners()) {
for (final ScreenHandlerListener listener : listeners) {
sendContentUpdatePacketToListener(listener);
}
}

View file

@ -1,36 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.client;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(ChatHud.class)
public interface AccessorChatHud {
@Invoker("addMessage")
void invokeAddMessage(Text message, int messageId);
}

View file

@ -1,40 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.client;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.item.UnclampedModelPredicateProvider;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(ModelPredicateProviderRegistry.class)
public interface AccessorModelPredicateProviderRegistry {
@Invoker
static void callRegister(Item item, Identifier id, UnclampedModelPredicateProvider provider) {
throw new RuntimeException("nope");
}
}

View file

@ -1,14 +0,0 @@
package reborncore.mixin.client;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.Screen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.List;
@Mixin(Screen.class)
public interface AccessorScreen {
@Accessor
List<Selectable> getSelectables();
}

View file

@ -1,37 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.common;
import net.minecraft.block.FluidBlock;
import net.minecraft.fluid.FlowableFluid;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(FluidBlock.class)
public interface AccessorFluidBlock {
@Accessor
FlowableFluid getFluid();
}

View file

@ -1,40 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.common;
import com.mojang.serialization.Codec;
import net.minecraft.world.gen.foliage.FoliagePlacer;
import net.minecraft.world.gen.foliage.FoliagePlacerType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(FoliagePlacerType.class)
public interface AccessorFoliagePlacerType {
@Invoker("register")
static <P extends FoliagePlacer> FoliagePlacerType<P> register(String id, Codec<P> codec) {
throw new UnsupportedOperationException();
}
}

View file

@ -1,42 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.common;
import net.minecraft.inventory.Inventory;
import net.minecraft.recipe.Recipe;
import net.minecraft.recipe.RecipeManager;
import net.minecraft.recipe.RecipeType;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
import java.util.Map;
@Mixin(RecipeManager.class)
public interface AccessorRecipeManager {
@Invoker(value = "getAllOfType")
<C extends Inventory, T extends Recipe<C>> Map<Identifier, Recipe<C>> getAll(RecipeType<T> type);
}

View file

@ -1,40 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.common;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.ScreenHandlerListener;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.List;
@Mixin(ScreenHandler.class)
public interface AccessorScreenHandler {
@Accessor
List<ScreenHandlerListener> getListeners();
}

View file

@ -1,36 +0,0 @@
/*
* This file is part of RebornCore, licensed under the MIT License (MIT).
*
* Copyright (c) 2021 TeamReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package reborncore.mixin.common;
import net.minecraft.screen.slot.Slot;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(Slot.class)
public interface AccessorSlot {
@Accessor
int getIndex();
}

View file

@ -13,3 +13,13 @@ accessible field net/minecraft/recipe/Ingredient$TagEntry tag Lnet/m
accessible method net/minecraft/client/gui/screen/ingame/HandledScreen getSlotAt (DD)Lnet/minecraft/screen/slot/Slot;
accessible method net/minecraft/client/render/WorldRenderer drawShapeOutline (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/util/shape/VoxelShape;DDDFFFF)V
accessible method net/minecraft/world/gen/treedecorator/TreeDecoratorType <init> (Lcom/mojang/serialization/Codec;)V
accessible method net/minecraft/client/gui/hud/ChatHud addMessage (Lnet/minecraft/text/Text;I)V
accessible method net/minecraft/client/item/ModelPredicateProviderRegistry register (Lnet/minecraft/item/Item;Lnet/minecraft/util/Identifier;Lnet/minecraft/client/item/UnclampedModelPredicateProvider;)V
accessible field net/minecraft/client/gui/screen/Screen selectables Ljava/util/List;
accessible field net/minecraft/block/FluidBlock fluid Lnet/minecraft/fluid/FlowableFluid;
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType register (Ljava/lang/String;Lcom/mojang/serialization/Codec;)Lnet/minecraft/world/gen/foliage/FoliagePlacerType;
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
accessible field net/minecraft/screen/ScreenHandler listeners Ljava/util/List;

View file

@ -4,10 +4,7 @@
"compatibilityLevel": "JAVA_17",
"client": [
"MixinGameRenderer",
"MixinDebugRenderer",
"AccessorModelPredicateProviderRegistry",
"AccessorChatHud",
"AccessorScreen"
"MixinDebugRenderer"
],
"injectors": {
"defaultRequire": 1

View file

@ -3,11 +3,6 @@
"package": "reborncore.mixin.common",
"compatibilityLevel": "JAVA_17",
"mixins": [
"AccessorFluidBlock",
"AccessorFoliagePlacerType",
"AccessorRecipeManager",
"AccessorScreenHandler",
"AccessorSlot",
"MixinBucketItem",
"MixinCraftingResultSlot",
"MixinItemEntity",

View file

@ -30,6 +30,7 @@ import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.item.UnclampedModelPredicateProvider;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.model.BakedModel;
@ -53,7 +54,6 @@ import reborncore.client.gui.builder.GuiBase;
import reborncore.client.multiblock.MultiblockRenderer;
import reborncore.common.powerSystem.RcEnergyItem;
import reborncore.common.util.ItemUtils;
import reborncore.mixin.client.AccessorModelPredicateProviderRegistry;
import team.reborn.energy.api.base.SimpleBatteryItem;
import techreborn.client.ClientGuiType;
import techreborn.client.ClientboundPacketHandlers;
@ -72,7 +72,6 @@ import techreborn.items.FrequencyTransmitterItem;
import techreborn.items.armor.BatpackItem;
import techreborn.items.tool.ChainsawItem;
import techreborn.items.tool.industrial.NanosaberItem;
import techreborn.packets.ClientboundPackets;
import java.util.Arrays;
import java.util.Collection;
@ -251,7 +250,7 @@ public class TechRebornClient implements ClientModInitializer {
private static <T extends Item> void registerPredicateProvider(Class<T> itemClass, Identifier identifier, ItemModelPredicateProvider<T> modelPredicateProvider) {
Registry.ITEM.stream()
.filter(item -> item.getClass().isAssignableFrom(itemClass))
.forEach(item -> AccessorModelPredicateProviderRegistry.callRegister(item, identifier, modelPredicateProvider));
.forEach(item -> ModelPredicateProviderRegistry.register(item, identifier, modelPredicateProvider));
}
//Need the item instance in a few places, this makes it easier

View file

@ -1,3 +1,27 @@
accessWidener v2 named
accessible method net/minecraft/recipe/ShapedRecipe readSymbols (Lcom/google/gson/JsonObject;)Ljava/util/Map;
accessible method net/minecraft/recipe/ShapedRecipe getPattern (Lcom/google/gson/JsonArray;)[Ljava/lang/String;
accessible method net/minecraft/recipe/ShapedRecipe createPatternMatrix ([Ljava/lang/String;Ljava/util/Map;II)Lnet/minecraft/util/collection/DefaultedList;
accessible class net/minecraft/recipe/Ingredient$Entry
accessible class net/minecraft/recipe/Ingredient$TagEntry
accessible class net/minecraft/recipe/Ingredient$StackEntry
accessible field net/minecraft/recipe/Ingredient entries [Lnet/minecraft/recipe/Ingredient$Entry;
accessible field net/minecraft/recipe/Ingredient$TagEntry tag Lnet/minecraft/tag/TagKey;
accessible method net/minecraft/client/gui/screen/ingame/HandledScreen getSlotAt (DD)Lnet/minecraft/screen/slot/Slot;
accessible method net/minecraft/client/render/WorldRenderer drawShapeOutline (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/util/shape/VoxelShape;DDDFFFF)V
accessible method net/minecraft/world/gen/treedecorator/TreeDecoratorType <init> (Lcom/mojang/serialization/Codec;)V
accessible method net/minecraft/client/gui/hud/ChatHud addMessage (Lnet/minecraft/text/Text;I)V
accessible method net/minecraft/client/item/ModelPredicateProviderRegistry register (Lnet/minecraft/item/Item;Lnet/minecraft/util/Identifier;Lnet/minecraft/client/item/UnclampedModelPredicateProvider;)V
accessible field net/minecraft/client/gui/screen/Screen selectables Ljava/util/List;
accessible field net/minecraft/block/FluidBlock fluid Lnet/minecraft/fluid/FlowableFluid;
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType register (Ljava/lang/String;Lcom/mojang/serialization/Codec;)Lnet/minecraft/world/gen/foliage/FoliagePlacerType;
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
accessible field net/minecraft/screen/ScreenHandler listeners Ljava/util/List;
# DO NOT EDIT THIS FILE, edit the RebornCore AW, it will automatically be coped to this one.