Update for 22w06a

This commit is contained in:
Johannes Frohnmeyer 2022-02-12 09:52:43 +01:00
parent e93f3c5b77
commit 46fcb539de
Signed by: Johannes
GPG Key ID: E76429612C2929F4
11 changed files with 15 additions and 18 deletions

View File

@ -4,4 +4,4 @@ libjf-data-v0 provides two additional tags for use in other mods or datapacks:
- `libjf:shulker_boxes_illegal` prevents items from being placed in shulker boxes (intended for backpacks)
- `libjf:overpowered` makes entities wearing four or more armor items with this tag invincible
It depends on libjf-base, fabric-tag-extensions-v0 and fabric-resource-loader-v0
It depends on libjf-base and fabric-resource-loader-v0

View File

@ -1,8 +1,8 @@
# https://fabricmc.net/develop/
minecraft_version=1.18.1
yarn_mappings=build.22
minecraft_version=22w06a
yarn_mappings=build.8
loader_version=0.13.1
fabric_version=0.46.4+1.18
fabric_version=0.47.1+1.18.2
maven_group=io.gitlab.jfronny.libjf
archive_base_name=libjf
dev_only_module=libjf-devutil-v0

View File

@ -130,7 +130,8 @@ public class Config {
for (EntryInfo info : entries) {
try {
info.value = info.field.get(null);
info.tempValue = info.value.toString();
if (info.value == null) info.value = info.defaultValue;
info.tempValue = info.value == null ? null : info.value.toString();
} catch (IllegalAccessException e) {
LibJf.LOGGER.error("Could not read value", e);
}

View File

@ -140,7 +140,7 @@ public class TinyConfigScreen extends Screen {
}
@Override
public void onClose() {
public void close() {
MinecraftClient.getInstance().setScreen(parent);
}
}

View File

@ -42,7 +42,7 @@ public class PresetsScreen extends Screen {
}
@Override
public void onClose() {
public void close() {
MinecraftClient.getInstance().setScreen(parent);
}

View File

@ -2,6 +2,5 @@ archivesBaseName = "libjf-data-v0"
dependencies {
moduleDependencies(project, ["libjf-base"])
include modImplementation(fabricApi.module("fabric-tag-extensions-v0", "${project.fabric_version}"))
include(fabricApi.module("fabric-resource-loader-v0", "${project.fabric_version}"))
}

View File

@ -1,12 +1,12 @@
package io.gitlab.jfronny.libjf.data;
import io.gitlab.jfronny.libjf.LibJf;
import net.fabricmc.fabric.api.tag.TagFactory;
import net.minecraft.item.Item;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class Tags {
public static final Tag<Item> SHULKER_ILLEGAL = TagFactory.ITEM.create(new Identifier(LibJf.MOD_ID, "shulker_boxes_illegal"));
public static final Tag<Item> OVERPOWERED = TagFactory.ITEM.create(new Identifier(LibJf.MOD_ID, "overpowered"));
public static final TagKey<Item> SHULKER_ILLEGAL = TagKey.intern(Registry.ITEM_KEY, new Identifier(LibJf.MOD_ID, "shulker_boxes_illegal"));
public static final TagKey<Item> OVERPOWERED = TagKey.intern(Registry.ITEM_KEY, new Identifier(LibJf.MOD_ID, "overpowered"));
}

View File

@ -39,7 +39,7 @@ public class EntityMixin {
Entity entity = (Entity) (Object) this;
AtomicInteger armorCount = new AtomicInteger();
for (ItemStack s : entity.getArmorItems()) {
if (Tags.OVERPOWERED.contains(s.getItem()))
if (s.isIn(Tags.OVERPOWERED))
armorCount.getAndIncrement();
}
return armorCount.get() >= 4;

View File

@ -18,6 +18,6 @@ public class ShulkerBoxBlockEntityMixin {
*/
@Overwrite
public boolean canInsert(int slot, ItemStack stack, Direction dir) {
return !Tags.SHULKER_ILLEGAL.contains(stack.getItem());
return !stack.isIn(Tags.SHULKER_ILLEGAL);
}
}

View File

@ -17,6 +17,6 @@ public class ShulkerBoxSlotMixin {
*/
@Overwrite
public boolean canInsert(ItemStack stack) {
return !Tags.SHULKER_ILLEGAL.contains(stack.getItem());
return !stack.isIn(Tags.SHULKER_ILLEGAL);
}
}

View File

@ -61,7 +61,6 @@ public class MixinPlugin implements IMixinConfigPlugin {
@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
}
@Override
@ -71,11 +70,9 @@ public class MixinPlugin implements IMixinConfigPlugin {
@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
}
@Override
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
}
}