[root] update for 1.19.4-pre1
This commit is contained in:
parent
5aac567273
commit
1d71c3870d
|
@ -5,7 +5,7 @@ libjf-data-manipulation-v0 provides code for modifying existing resources
|
|||
RecipeUtil provides to methods to end users:
|
||||
|
||||
- `removeRecipe` blocks minecraft from loading recipes using the specified tag
|
||||
- `removeRecipeFor` blocks minecraft from loading recipes producing the specified output. (Look at the log to find out which ones it blocks)
|
||||
- ~~`removeRecipeFor` blocks minecraft from loading recipes producing the specified output. (Look at the log to find out which ones it blocks)~~ **removed for 1.19.4**
|
||||
|
||||
### UserResourceEvents
|
||||
UserResourceEvents provides four events (CONTAINS, FIND_RESOURCE, OPEN, OPEN_ROOT) which get called every time
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# https://fabricmc.net/develop/
|
||||
minecraft_version=1.19.3
|
||||
yarn_mappings=build.5
|
||||
loader_version=0.14.15
|
||||
minecraft_version=1.19.4-pre1
|
||||
yarn_mappings=build.6
|
||||
loader_version=0.14.17
|
||||
|
||||
maven_group=io.gitlab.jfronny.libjf
|
||||
archive_base_name=libjf
|
||||
|
@ -14,10 +14,10 @@ modrinth_optional_dependencies=fabric-api
|
|||
curseforge_id=482600
|
||||
curseforge_optional_dependencies=fabric-api
|
||||
|
||||
fabric_version=0.75.0+1.19.3
|
||||
commons_version=1.0-SNAPSHOT
|
||||
fabric_version=0.75.1+1.19.4
|
||||
commons_version=1.1-SNAPSHOT
|
||||
gson_compile_version=1.2-SNAPSHOT
|
||||
modmenu_version=5.0.2
|
||||
modmenu_version=6.1.0-beta.3
|
||||
|
||||
asm_version=9.4
|
||||
ant_version=1.10.12
|
||||
|
|
|
@ -18,7 +18,7 @@ public class PlaceholderScreen extends Screen {
|
|||
@Override
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
renderBackground(matrices);
|
||||
drawCenteredText(matrices, textRenderer, description, width / 2, (height - textRenderer.fontHeight) / 2, 0xFFFFFF);
|
||||
drawCenteredTextWithShadow(matrices, textRenderer, description, width / 2, (height - textRenderer.fontHeight) / 2, 0xFFFFFF);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ public class TinyConfigScreen extends Screen {
|
|||
this.renderBackground(matrices);
|
||||
this.list.render(matrices, mouseX, mouseY, delta);
|
||||
|
||||
drawCenteredText(matrices, textRenderer, title, width / 2, 15, 0xFFFFFF);
|
||||
drawCenteredTextWithShadow(matrices, textRenderer, title, width / 2, 15, 0xFFFFFF);
|
||||
|
||||
Optional<Text> hovered = list.getHoveredEntryTitle(mouseY);
|
||||
if (hovered.isPresent()) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class PresetsScreen extends Screen {
|
|||
this.renderBackground(matrices);
|
||||
this.list.render(matrices, mouseX, mouseY, delta);
|
||||
|
||||
drawCenteredText(matrices, textRenderer, title, width / 2, 15, 0xFFFFFF);
|
||||
drawCenteredTextWithShadow(matrices, textRenderer, title, width / 2, 15, 0xFFFFFF);
|
||||
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package io.gitlab.jfronny.libjf.data.manipulation.api;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -10,26 +8,12 @@ import java.util.Set;
|
|||
@SuppressWarnings("unused")
|
||||
public class RecipeUtil {
|
||||
private static final Set<Identifier> REMOVAL_BY_ID = new HashSet<>();
|
||||
private static final Set<ItemStack> RECIPES_FOR_REMOVAL = new HashSet<>();
|
||||
|
||||
public static void removeRecipe(Identifier identifier) {
|
||||
REMOVAL_BY_ID.add(identifier);
|
||||
}
|
||||
|
||||
public static void removeRecipeFor(Item product) {
|
||||
RECIPES_FOR_REMOVAL.add(product.getDefaultStack());
|
||||
}
|
||||
|
||||
public static boolean isIdBlocked(Identifier identifier) {
|
||||
return REMOVAL_BY_ID.contains(identifier);
|
||||
}
|
||||
|
||||
public static boolean isOutputBlocked(ItemStack product) {
|
||||
for (ItemStack stack : RECIPES_FOR_REMOVAL) {
|
||||
if (product.isItemEqual(stack)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
package io.gitlab.jfronny.libjf.data.manipulation.mixin;
|
||||
package io.gitlab.jfronny.libjf.data.manipulation.impl.mixin;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.gson.JsonObject;
|
||||
import io.gitlab.jfronny.libjf.LibJf;
|
||||
import io.gitlab.jfronny.libjf.data.manipulation.api.RecipeUtil;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeManager;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Mixin(RecipeManager.class)
|
||||
public class RecipeManagerMixin {
|
||||
|
@ -34,17 +29,4 @@ public class RecipeManagerMixin {
|
|||
|
||||
return replacement.iterator();
|
||||
}
|
||||
|
||||
@Redirect(method = "apply(Ljava/util/Map;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/ImmutableMap$Builder;put(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableMap$Builder;", remap = false))
|
||||
private ImmutableMap.Builder<Identifier, Recipe<?>> onPutRecipe(ImmutableMap.Builder<Identifier, Recipe<?>> builder, Object key, Object value) {
|
||||
Identifier id = (Identifier) key;
|
||||
Recipe<?> recipe = (Recipe<?>) value;
|
||||
|
||||
if (RecipeUtil.isOutputBlocked(recipe.getOutput())) {
|
||||
LibJf.LOGGER.info("Blocked recipe by predicate: " + recipe.getId());
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder.put(id, recipe);
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "io.gitlab.jfronny.libjf.data.manipulation.mixin",
|
||||
"package": "io.gitlab.jfronny.libjf.data.manipulation.impl.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"mixins": [
|
||||
"RecipeManagerMixin"
|
||||
|
|
|
@ -18,6 +18,5 @@ public class TestEntrypoint implements ModInitializer {
|
|||
}
|
||||
return previous;
|
||||
});
|
||||
RecipeUtil.removeRecipeFor(Items.DIAMOND_SWORD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue