Update for 22w06a
This commit is contained in:
parent
e93f3c5b77
commit
46fcb539de
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ public class TinyConfigScreen extends Screen {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
public void close() {
|
||||
MinecraftClient.getInstance().setScreen(parent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class PresetsScreen extends Screen {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
public void close() {
|
||||
MinecraftClient.getInstance().setScreen(parent);
|
||||
}
|
||||
|
||||
|
|
|
@ -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}"))
|
||||
}
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue