Fix Server Crash
This commit is contained in:
parent
b58f4b0809
commit
d1f6af50af
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**1.0.28**
|
||||
* Fix Server Crash
|
||||
|
||||
**1.0.27**
|
||||
* Use DataTracker
|
||||
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.8.8+build.202
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.27
|
||||
mod_version = 1.0.28
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = reliccraft
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.thebrokenrail.reliccraft.client;
|
||||
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import com.thebrokenrail.reliccraft.client.entity.RelicEntityRenderer;
|
||||
import com.thebrokenrail.reliccraft.item.DragonEggHolderBlockItem;
|
||||
import com.thebrokenrail.reliccraft.item.RelicItem;
|
||||
import com.thebrokenrail.reliccraft.packet.UpdateTimeDilationS2CPacket;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
@ -75,6 +76,8 @@ public class RelicCraftClient implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
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.STAFF_ITEM);
|
||||
|
||||
|
@ -2,6 +2,8 @@ package com.thebrokenrail.reliccraft.item;
|
||||
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import com.thebrokenrail.reliccraft.mixin.ModelPredicateProviderRegistryHook;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.Inventories;
|
||||
import net.minecraft.item.BlockItem;
|
||||
@ -11,10 +13,21 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Rarity;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DragonEggHolderBlockItem extends BlockItem {
|
||||
private static final List<DragonEggHolderBlockItem> list = new ArrayList<>();
|
||||
|
||||
public DragonEggHolderBlockItem(Block block) {
|
||||
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);
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static void initClient() {
|
||||
for (DragonEggHolderBlockItem item : list) {
|
||||
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);
|
||||
@ -26,4 +39,5 @@ public class DragonEggHolderBlockItem extends BlockItem {
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user