修复两处调用报错
This commit is contained in:
parent
c42f0c18f7
commit
b9cff51b28
3 changed files with 13 additions and 4 deletions
|
@ -158,7 +158,14 @@ public class ContainerBlockItem extends BlockItem implements GeoItem {
|
|||
var data = stack.get(DataComponents.CUSTOM_DATA);
|
||||
var tag = data != null ? data.copyTag() : new CompoundTag();
|
||||
|
||||
tag.put("Entity", entity.serializeNBT(entity.level().registryAccess()));
|
||||
var entityTag = new CompoundTag();
|
||||
var encodedId = entity.getEncodeId();
|
||||
if (encodedId != null) {
|
||||
entityTag.putString("id", encodedId);
|
||||
}
|
||||
entity.saveWithoutId(entityTag);
|
||||
tag.put("Entity", entityTag);
|
||||
|
||||
tag.putString("EntityType", EntityType.getKey(entity.getType()).toString());
|
||||
BlockItem.setBlockEntityData(stack, ModBlockEntities.CONTAINER.get(), tag);
|
||||
tag.putBoolean("CanPlacedAboveWater", canPlacedAboveWater);
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.item.armor;
|
|||
|
||||
import com.atsuishio.superbwarfare.init.ModItems;
|
||||
import com.atsuishio.superbwarfare.item.CustomRendererArmor;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.HumanoidModel;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
@ -30,8 +31,8 @@ public class ArmorRendererRegister {
|
|||
if (this.renderer == null)
|
||||
this.renderer = armor.getRenderer();
|
||||
|
||||
// TODO other params?
|
||||
this.renderer.prepForRender(livingEntity, itemStack, equipmentSlot, original);
|
||||
var mc = Minecraft.getInstance();
|
||||
this.renderer.prepForRender(livingEntity, itemStack, equipmentSlot, original, mc.levelRenderer.renderBuffers.bufferSource(), mc.getTimer().getGameTimeDeltaPartialTick(true), 0, 0, 0, 0);
|
||||
return this.renderer;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,3 +3,4 @@ public net.minecraft.world.entity.Entity passengers # passengers
|
|||
public net.minecraft.world.entity.Entity boardingCooldown # boardingCooldown
|
||||
public net.minecraft.client.player.LocalPlayer handsBusy # handsBusy
|
||||
public net.minecraft.client.renderer.culling.Frustum matrix # matrix
|
||||
public net.minecraft.client.renderer.LevelRenderer renderBuffers # renderBuffers
|
Loading…
Add table
Reference in a new issue