Fix Server Crash
This commit is contained in:
parent
b58f4b0809
commit
d1f6af50af
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**1.0.28**
|
||||||
|
* Fix Server Crash
|
||||||
|
|
||||||
**1.0.27**
|
**1.0.27**
|
||||||
* Use DataTracker
|
* Use DataTracker
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.8.8+build.202
|
fabric_loader_version = 0.8.8+build.202
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0.27
|
mod_version = 1.0.28
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
archives_base_name = reliccraft
|
archives_base_name = reliccraft
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.thebrokenrail.reliccraft.client;
|
|||||||
|
|
||||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||||
import com.thebrokenrail.reliccraft.client.entity.RelicEntityRenderer;
|
import com.thebrokenrail.reliccraft.client.entity.RelicEntityRenderer;
|
||||||
|
import com.thebrokenrail.reliccraft.item.DragonEggHolderBlockItem;
|
||||||
import com.thebrokenrail.reliccraft.item.RelicItem;
|
import com.thebrokenrail.reliccraft.item.RelicItem;
|
||||||
import com.thebrokenrail.reliccraft.packet.UpdateTimeDilationS2CPacket;
|
import com.thebrokenrail.reliccraft.packet.UpdateTimeDilationS2CPacket;
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
@ -75,6 +76,8 @@ public class RelicCraftClient implements ClientModInitializer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
|
DragonEggHolderBlockItem.initClient();
|
||||||
|
|
||||||
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : getStackColor(stack), RelicCraft.ORB_ITEM);
|
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : getStackColor(stack), RelicCraft.ORB_ITEM);
|
||||||
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : getStackColor(stack), RelicCraft.STAFF_ITEM);
|
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : getStackColor(stack), RelicCraft.STAFF_ITEM);
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ package com.thebrokenrail.reliccraft.item;
|
|||||||
|
|
||||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||||
import com.thebrokenrail.reliccraft.mixin.ModelPredicateProviderRegistryHook;
|
import com.thebrokenrail.reliccraft.mixin.ModelPredicateProviderRegistryHook;
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.inventory.Inventories;
|
import net.minecraft.inventory.Inventories;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
@ -11,19 +13,31 @@ import net.minecraft.util.Identifier;
|
|||||||
import net.minecraft.util.Rarity;
|
import net.minecraft.util.Rarity;
|
||||||
import net.minecraft.util.collection.DefaultedList;
|
import net.minecraft.util.collection.DefaultedList;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class DragonEggHolderBlockItem extends BlockItem {
|
public class DragonEggHolderBlockItem extends BlockItem {
|
||||||
|
private static final List<DragonEggHolderBlockItem> list = new ArrayList<>();
|
||||||
|
|
||||||
public DragonEggHolderBlockItem(Block block) {
|
public DragonEggHolderBlockItem(Block block) {
|
||||||
super(block, new Settings().rarity(Rarity.UNCOMMON).group(RelicCraft.ITEM_GROUP));
|
super(block, new Settings().rarity(Rarity.UNCOMMON).group(RelicCraft.ITEM_GROUP));
|
||||||
ModelPredicateProviderRegistryHook.callRegister(this, new Identifier(RelicCraft.NAMESPACE, "active"), (stack, world, entity) -> {
|
list.add(this);
|
||||||
CompoundTag tag = stack.getSubTag("BlockEntityTag");
|
}
|
||||||
if (tag != null) {
|
|
||||||
DefaultedList<ItemStack> list = DefaultedList.ofSize(1, ItemStack.EMPTY);
|
@Environment(EnvType.CLIENT)
|
||||||
Inventories.fromTag(tag, list);
|
public static void initClient() {
|
||||||
if (!list.get(0).isEmpty()) {
|
for (DragonEggHolderBlockItem item : list) {
|
||||||
return 1;
|
ModelPredicateProviderRegistryHook.callRegister(item, new Identifier(RelicCraft.NAMESPACE, "active"), (stack, world, entity) -> {
|
||||||
|
CompoundTag tag = stack.getSubTag("BlockEntityTag");
|
||||||
|
if (tag != null) {
|
||||||
|
DefaultedList<ItemStack> list = DefaultedList.ofSize(1, ItemStack.EMPTY);
|
||||||
|
Inventories.fromTag(tag, list);
|
||||||
|
if (!list.get(0).isEmpty()) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return 0;
|
||||||
return 0;
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user