Initial commit
This commit is contained in:
parent
5e1336f27c
commit
a53fc02f07
|
@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
|
||||
@Mixin(ClientPacketListener.class)
|
||||
public abstract class ClientPlayNetworkHandlerMixin {
|
||||
@UnconstrainedRedirect(method = "handleLogin", at = @At(value = "NEW", target = "()Lnet/minecraft/client/ClientRecipeBook;"))
|
||||
@UnconstrainedRedirect(method = "*", at = @At(value = "NEW", target = "()Lnet/minecraft/client/ClientRecipeBook;"))
|
||||
private ClientRecipeBook onGameJoin$noRecipeBook() {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package dev.pfaff.recipe_nope.mixin;
|
||||
|
||||
import net.minecraft.client.ClientRecipeBook;
|
||||
import net.minecraft.client.RecipeBookCategories;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeCollection;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(ClientRecipeBook.class)
|
||||
public abstract class ClientRecipeBookMixin {
|
||||
@Overwrite
|
||||
public void setupCollections(Iterable<Recipe<?>> p_90626_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
private static Map<RecipeBookCategories, List<List<Recipe<?>>>> categorizeAndGroupRecipes(Iterable<Recipe<?>> p_90643_) {
|
||||
return Map.of();
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
private static RecipeBookCategories getCategory(Recipe<?> p_90647_) {
|
||||
return RecipeBookCategories.UNKNOWN;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public List<RecipeCollection> getCollections() {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public List<RecipeCollection> getCollection(RecipeBookCategories p_90624_) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
private static Object lambda$getCategory$5(Recipe par1) {
|
||||
return RecipeType.CRAFTING;
|
||||
}
|
||||
}
|
|
@ -22,11 +22,6 @@ public abstract class CraftingScreenMixin extends AbstractContainerScreen {
|
|||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@UnconstrainedRedirect(method = "<init>", at = @At(value = "NEW", target = "()Lnet/minecraft/client/gui/screens/recipebook/RecipeBookComponent;"))
|
||||
private RecipeBookComponent constructor$skipNewRecipeBook() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Redirect(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/recipebook/RecipeBookComponent;init(IILnet/minecraft/client/Minecraft;ZLnet/minecraft/world/inventory/RecipeBookMenu;)V"))
|
||||
private void init$skipRecipeBookInit(RecipeBookComponent instance,
|
||||
int p_100310_,
|
||||
|
|
|
@ -0,0 +1,199 @@
|
|||
package dev.pfaff.recipe_nope.mixin;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.inventory.RecipeBookMenu;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(RecipeBookComponent.class)
|
||||
public abstract class RecipeBookComponentMixin {
|
||||
@Shadow @Final private static Component ALL_RECIPES_TOOLTIP;
|
||||
@Shadow @Final private static Component ONLY_CRAFTABLES_TOOLTIP;
|
||||
|
||||
@Overwrite
|
||||
public void init(int p_100310_, int p_100311_, Minecraft p_100312_, boolean p_100313_, RecipeBookMenu<?> p_100314_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void initVisuals() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean changeFocus(boolean p_100372_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected void initFilterButtonTextures() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void removed() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public int updateScreenPosition(int p_181402_, int p_181403_) {
|
||||
return (p_181402_ - p_181403_) / 2;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void toggleVisibility() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isVisible() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isVisibleAccordingToBookData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected void setVisible(boolean p_100370_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void slotClicked(@Nullable Slot p_100315_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void updateCollections(boolean p_100383_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void updateTabs() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void tick() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void updateStackedContents() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void render(PoseStack p_100319_, int p_100320_, int p_100321_, float p_100322_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void renderTooltip(PoseStack p_100362_, int p_100363_, int p_100364_, int p_100365_, int p_100366_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public Component getFilterButtonTooltip() {
|
||||
return ALL_RECIPES_TOOLTIP;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected Component getRecipeFilterName() {
|
||||
return ONLY_CRAFTABLES_TOOLTIP;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void renderGhostRecipeTooltip(PoseStack p_100375_, int p_100376_, int p_100377_, int p_100378_, int p_100379_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void renderGhostRecipe(PoseStack p_100323_, int p_100324_, int p_100325_, boolean p_100326_, float p_100327_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean mouseClicked(double p_100294_, double p_100295_, int p_100296_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean toggleFiltering() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean hasClickedOutside(double p_100298_,
|
||||
double p_100299_,
|
||||
int p_100300_,
|
||||
int p_100301_,
|
||||
int p_100302_,
|
||||
int p_100303_,
|
||||
int p_100304_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean keyPressed(int p_100306_, int p_100307_, int p_100308_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean keyReleased(int p_100356_, int p_100357_, int p_100358_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean charTyped(char p_100291_, int p_100292_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isMouseOver(double p_100353_, double p_100354_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void checkSearchStringUpdate() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void pirateSpeechForThePeople(String p_100336_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isOffsetNextToMainGUI() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void recipesUpdated() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void recipesShown(List<Recipe<?>> p_100344_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void setupGhostRecipe(Recipe<?> p_100316_, List<Slot> p_100317_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void addItemToSlot(Iterator<Ingredient> p_100338_, int p_100339_, int p_100340_, int p_100341_, int p_100342_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected void sendUpdateSettings() {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public NarratableEntry.NarrationPriority narrationPriority() {
|
||||
return NarratableEntry.NarrationPriority.NONE;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void updateNarration(NarrationElementOutput p_170046_) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package dev.pfaff.recipe_nope.mixin;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.stats.RecipeBook;
|
||||
import net.minecraft.stats.RecipeBookSettings;
|
||||
import net.minecraft.world.inventory.RecipeBookMenu;
|
||||
import net.minecraft.world.inventory.RecipeBookType;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Set;
|
||||
|
||||
@Mixin(RecipeBook.class)
|
||||
public abstract class RecipeBookMixin {
|
||||
@Shadow @Final private RecipeBookSettings bookSettings;
|
||||
|
||||
@Overwrite
|
||||
public void copyOverData(RecipeBook p_12686_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void add(Recipe<?> p_12701_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected void add(ResourceLocation p_12703_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean contains(@Nullable Recipe<?> p_12710_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean contains(ResourceLocation p_12712_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void remove(Recipe<?> p_12714_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected void remove(ResourceLocation p_12716_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean willHighlight(Recipe<?> p_12718_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void removeHighlight(Recipe<?> p_12722_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void addHighlight(Recipe<?> p_12724_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
protected void addHighlight(ResourceLocation p_12720_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isOpen(RecipeBookType p_12692_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void setOpen(RecipeBookType p_12694_, boolean p_12695_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isFiltering(RecipeBookMenu<?> p_12690_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public boolean isFiltering(RecipeBookType p_12705_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void setFiltering(RecipeBookType p_12707_, boolean p_12708_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void setBookSettings(RecipeBookSettings p_12688_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public RecipeBookSettings getBookSettings() {
|
||||
return this.bookSettings.copy();
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void setBookSetting(RecipeBookType p_12697_, boolean p_12698_, boolean p_12699_) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package dev.pfaff.recipe_nope.mixin;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.network.protocol.game.ClientboundRecipePacket;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.stats.ServerRecipeBook;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mixin(ServerRecipeBook.class)
|
||||
public abstract class ServerRecipeBookMixin {
|
||||
@Overwrite
|
||||
public int addRecipes(Collection<Recipe<?>> p_12792_, ServerPlayer p_12793_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public int removeRecipes(Collection<Recipe<?>> p_12807_, ServerPlayer p_12808_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
private void sendRecipes(ClientboundRecipePacket.State p_12802_,
|
||||
ServerPlayer p_12803_,
|
||||
List<ResourceLocation> p_12804_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public CompoundTag toNbt() {
|
||||
return new CompoundTag();
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void fromNbt(CompoundTag p_12795_, RecipeManager p_12796_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
private void loadRecipes(ListTag p_12798_, Consumer<Recipe<?>> p_12799_, RecipeManager p_12800_) {
|
||||
}
|
||||
|
||||
@Overwrite
|
||||
public void sendInitialRecipeBook(ServerPlayer p_12790_) {
|
||||
}
|
||||
}
|
|
@ -3,18 +3,23 @@
|
|||
"minVersion": "0.8",
|
||||
"package": "dev.pfaff.recipe_nope.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"refmap": "recipe_nope.refmap.json",
|
||||
"mixins": [
|
||||
"InventoryScreenMixin",
|
||||
"PlayerManagerMixin",
|
||||
"RecipeBookDataC2SPacketMixin",
|
||||
"RecipeBookMixin",
|
||||
"ServerPlayerEntityMixin",
|
||||
"ServerRecipeBookMixin",
|
||||
"UnlockRecipesS2CPacketMixin"
|
||||
],
|
||||
"client": [
|
||||
"ClientPlayerEntityMixin",
|
||||
"ClientPlayNetworkHandlerMixin",
|
||||
"ClientRecipeBookMixin",
|
||||
"CraftingScreenMixin",
|
||||
"InventoryScreenMixin"
|
||||
"InventoryScreenMixin",
|
||||
"RecipeBookComponentMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Reference in New Issue