Replace all accessors with accesswideners.
This commit is contained in:
parent
2a5645bb19
commit
22c29fea14
22 changed files with 57 additions and 328 deletions
|
@ -30,4 +30,9 @@ curseforge {
|
||||||
options {
|
options {
|
||||||
forgeGradleIntegration = false
|
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.")
|
|
@ -49,9 +49,7 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||||
import reborncore.common.blockentity.SlotConfiguration;
|
import reborncore.common.blockentity.SlotConfiguration;
|
||||||
import reborncore.common.chunkloading.ChunkLoaderManager;
|
import reborncore.common.chunkloading.ChunkLoaderManager;
|
||||||
import reborncore.common.network.ExtendedPacketBuffer;
|
import reborncore.common.network.ExtendedPacketBuffer;
|
||||||
import reborncore.common.network.NetworkManager;
|
|
||||||
import reborncore.common.screen.BuiltScreenHandler;
|
import reborncore.common.screen.BuiltScreenHandler;
|
||||||
import reborncore.mixin.client.AccessorChatHud;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class ClientBoundPacketHandlers {
|
public class ClientBoundPacketHandlers {
|
||||||
|
@ -150,8 +148,7 @@ public class ClientBoundPacketHandlers {
|
||||||
client.execute(() -> {
|
client.execute(() -> {
|
||||||
int deleteID = RebornCore.MOD_ID.hashCode() + messageId;
|
int deleteID = RebornCore.MOD_ID.hashCode() + messageId;
|
||||||
ChatHud chat = MinecraftClient.getInstance().inGameHud.getChatHud();
|
ChatHud chat = MinecraftClient.getInstance().inGameHud.getChatHud();
|
||||||
AccessorChatHud accessorChatHud = (AccessorChatHud) chat;
|
chat.addMessage(text, deleteID);
|
||||||
accessorChatHud.invokeAddMessage(text, deleteID);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||||
import reborncore.common.screen.BuiltScreenHandler;
|
import reborncore.common.screen.BuiltScreenHandler;
|
||||||
import reborncore.client.screen.builder.slot.PlayerInventorySlot;
|
import reborncore.client.screen.builder.slot.PlayerInventorySlot;
|
||||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||||
import reborncore.mixin.client.AccessorScreen;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -278,8 +277,7 @@ public class GuiBase<T extends ScreenHandler> extends HandledScreen<T> {
|
||||||
offset += 24;
|
offset += 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessorScreen accessorScreen = (AccessorScreen)this;
|
for (Selectable selectable : selectables) {
|
||||||
for (Selectable selectable : accessorScreen.getSelectables()) {
|
|
||||||
if (selectable instanceof ClickableWidget clickable) {
|
if (selectable instanceof ClickableWidget clickable) {
|
||||||
if (clickable.isHovered()) {
|
if (clickable.isHovered()) {
|
||||||
clickable.renderTooltip(matrixStack, mouseX, mouseY);
|
clickable.renderTooltip(matrixStack, mouseX, mouseY);
|
||||||
|
|
|
@ -42,7 +42,6 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||||
import reborncore.common.network.NetworkManager;
|
import reborncore.common.network.NetworkManager;
|
||||||
import reborncore.common.network.ServerBoundPackets;
|
import reborncore.common.network.ServerBoundPackets;
|
||||||
import reborncore.common.util.Color;
|
import reborncore.common.util.Color;
|
||||||
import reborncore.mixin.common.AccessorSlot;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -68,9 +67,9 @@ public class SlotConfigGui {
|
||||||
if (guiBase.be != slot.inventory) {
|
if (guiBase.be != slot.inventory) {
|
||||||
continue;
|
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);
|
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(accessorSlot.getIndex(), slotElement);
|
slotElementMap.put(slot.getIndex(), slotElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -167,8 +166,7 @@ public class SlotConfigGui {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (guiBase.isPointInRect(slot.x, slot.y, 18, 18, mouseX, mouseY)) {
|
if (guiBase.isPointInRect(slot.x, slot.y, 18, 18, mouseX, mouseY)) {
|
||||||
AccessorSlot accessorSlot = (AccessorSlot) slot;
|
selectedSlot = slot.getIndex();
|
||||||
selectedSlot = accessorSlot.getIndex();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class ConfigSlotElement extends ElementBase {
|
||||||
.filter(slot -> slot.inventory == inventory)
|
.filter(slot -> slot.inventory == inventory)
|
||||||
.filter(slot -> slot instanceof BaseSlot)
|
.filter(slot -> slot instanceof BaseSlot)
|
||||||
.map(slot -> (BaseSlot) slot)
|
.map(slot -> (BaseSlot) slot)
|
||||||
.filter(baseSlot -> baseSlot.getSlotID() == slotId)
|
.filter(baseSlot -> baseSlot.getIndex() == slotId)
|
||||||
.allMatch(BaseSlot::canWorldBlockInsert);
|
.allMatch(BaseSlot::canWorldBlockInsert);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ package reborncore.client.gui.slots;
|
||||||
import net.minecraft.inventory.Inventory;
|
import net.minecraft.inventory.Inventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.screen.slot.Slot;
|
import net.minecraft.screen.slot.Slot;
|
||||||
import reborncore.mixin.common.AccessorSlot;
|
|
||||||
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
@ -59,8 +58,4 @@ public class BaseSlot extends Slot {
|
||||||
public boolean canWorldBlockInsert() {
|
public boolean canWorldBlockInsert() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSlotID() {
|
|
||||||
return ((AccessorSlot) this).getIndex();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ import net.minecraft.world.World;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import reborncore.common.util.DefaultedListCollector;
|
import reborncore.common.util.DefaultedListCollector;
|
||||||
import reborncore.common.util.serialization.SerializationUtil;
|
import reborncore.common.util.serialization.SerializationUtil;
|
||||||
import reborncore.mixin.common.AccessorRecipeManager;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -56,8 +55,7 @@ import java.util.Objects;
|
||||||
public class RecipeUtils {
|
public class RecipeUtils {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static <T extends RebornRecipe> List<T> getRecipes(World world, RebornRecipeType<T> type) {
|
public static <T extends RebornRecipe> List<T> getRecipes(World world, RebornRecipeType<T> type) {
|
||||||
final AccessorRecipeManager accessorRecipeManager = (AccessorRecipeManager) world.getRecipeManager();
|
final Collection<Recipe<Inventory>> recipes = world.getRecipeManager().getAllOfType(type).values().stream().toList();
|
||||||
final Collection<Recipe<Inventory>> recipes = accessorRecipeManager.getAll(type).values().stream().toList();
|
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return (List<T>) (Object) recipes;
|
return (List<T>) (Object) recipes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.item.ItemVariant;
|
||||||
import net.fabricmc.fabric.api.transfer.v1.storage.Storage;
|
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.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.storage.base.SingleSlotStorage;
|
||||||
import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction;
|
import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction;
|
||||||
import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext;
|
import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.FluidBlock;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.fluid.Fluid;
|
import net.minecraft.fluid.Fluid;
|
||||||
import net.minecraft.fluid.Fluids;
|
import net.minecraft.fluid.Fluids;
|
||||||
|
@ -44,11 +44,9 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import reborncore.common.fluid.container.FluidInstance;
|
import reborncore.common.fluid.container.FluidInstance;
|
||||||
import reborncore.common.util.Tank;
|
import reborncore.common.util.Tank;
|
||||||
import reborncore.mixin.common.AccessorFluidBlock;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
@ -58,9 +56,10 @@ public class FluidUtils {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static Fluid fluidFromBlock(Block block) {
|
public static Fluid fluidFromBlock(Block block) {
|
||||||
if (block instanceof AccessorFluidBlock) {
|
if (block instanceof FluidBlock fluidBlock) {
|
||||||
return ((AccessorFluidBlock) block).getFluid();
|
return fluidBlock.fluid;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Fluids.EMPTY;
|
return Fluids.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||||
import reborncore.common.network.ClientBoundPackets;
|
import reborncore.common.network.ClientBoundPackets;
|
||||||
import reborncore.common.network.NetworkManager;
|
import reborncore.common.network.NetworkManager;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import reborncore.mixin.common.AccessorScreenHandler;
|
|
||||||
import reborncore.mixin.ifaces.ServerPlayerEntityScreenHandler;
|
import reborncore.mixin.ifaces.ServerPlayerEntityScreenHandler;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -115,7 +114,7 @@ public class BuiltScreenHandler extends ScreenHandler {
|
||||||
public void sendContentUpdates() {
|
public void sendContentUpdates() {
|
||||||
super.sendContentUpdates();
|
super.sendContentUpdates();
|
||||||
|
|
||||||
for (final ScreenHandlerListener listener : ((AccessorScreenHandler) (this)).getListeners()) {
|
for (final ScreenHandlerListener listener : listeners) {
|
||||||
sendContentUpdatePacketToListener(listener);
|
sendContentUpdatePacketToListener(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
|
@ -12,4 +12,14 @@ 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/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/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;
|
|
@ -4,10 +4,7 @@
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"client": [
|
"client": [
|
||||||
"MixinGameRenderer",
|
"MixinGameRenderer",
|
||||||
"MixinDebugRenderer",
|
"MixinDebugRenderer"
|
||||||
"AccessorModelPredicateProviderRegistry",
|
|
||||||
"AccessorChatHud",
|
|
||||||
"AccessorScreen"
|
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
|
@ -3,11 +3,6 @@
|
||||||
"package": "reborncore.mixin.common",
|
"package": "reborncore.mixin.common",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"AccessorFluidBlock",
|
|
||||||
"AccessorFoliagePlacerType",
|
|
||||||
"AccessorRecipeManager",
|
|
||||||
"AccessorScreenHandler",
|
|
||||||
"AccessorSlot",
|
|
||||||
"MixinBucketItem",
|
"MixinBucketItem",
|
||||||
"MixinCraftingResultSlot",
|
"MixinCraftingResultSlot",
|
||||||
"MixinItemEntity",
|
"MixinItemEntity",
|
||||||
|
|
|
@ -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.model.ModelLoadingRegistry;
|
||||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
|
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
|
||||||
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
|
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
|
||||||
|
import net.minecraft.client.item.ModelPredicateProviderRegistry;
|
||||||
import net.minecraft.client.item.UnclampedModelPredicateProvider;
|
import net.minecraft.client.item.UnclampedModelPredicateProvider;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
import net.minecraft.client.render.RenderLayer;
|
||||||
import net.minecraft.client.render.model.BakedModel;
|
import net.minecraft.client.render.model.BakedModel;
|
||||||
|
@ -53,7 +54,6 @@ import reborncore.client.gui.builder.GuiBase;
|
||||||
import reborncore.client.multiblock.MultiblockRenderer;
|
import reborncore.client.multiblock.MultiblockRenderer;
|
||||||
import reborncore.common.powerSystem.RcEnergyItem;
|
import reborncore.common.powerSystem.RcEnergyItem;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import reborncore.mixin.client.AccessorModelPredicateProviderRegistry;
|
|
||||||
import team.reborn.energy.api.base.SimpleBatteryItem;
|
import team.reborn.energy.api.base.SimpleBatteryItem;
|
||||||
import techreborn.client.ClientGuiType;
|
import techreborn.client.ClientGuiType;
|
||||||
import techreborn.client.ClientboundPacketHandlers;
|
import techreborn.client.ClientboundPacketHandlers;
|
||||||
|
@ -72,7 +72,6 @@ import techreborn.items.FrequencyTransmitterItem;
|
||||||
import techreborn.items.armor.BatpackItem;
|
import techreborn.items.armor.BatpackItem;
|
||||||
import techreborn.items.tool.ChainsawItem;
|
import techreborn.items.tool.ChainsawItem;
|
||||||
import techreborn.items.tool.industrial.NanosaberItem;
|
import techreborn.items.tool.industrial.NanosaberItem;
|
||||||
import techreborn.packets.ClientboundPackets;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
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) {
|
private static <T extends Item> void registerPredicateProvider(Class<T> itemClass, Identifier identifier, ItemModelPredicateProvider<T> modelPredicateProvider) {
|
||||||
Registry.ITEM.stream()
|
Registry.ITEM.stream()
|
||||||
.filter(item -> item.getClass().isAssignableFrom(itemClass))
|
.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
|
//Need the item instance in a few places, this makes it easier
|
||||||
|
|
|
@ -1,3 +1,27 @@
|
||||||
accessWidener v2 named
|
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/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.
|
Loading…
Add table
Add a link
Reference in a new issue