Fixed server crash when ticking jar items

This commit is contained in:
Sollace 2024-04-26 15:14:13 +01:00
parent cda4e5b0b6
commit da38726bc0
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 0 additions and 16 deletions

View file

@ -84,17 +84,6 @@ public class JarBlock extends AbstractGlassBlock implements Waterloggable {
}
}
@Deprecated
@Override
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
super.onStateReplaced(state, world, pos, newState, moved);
}
@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
super.onBreak(world, pos, state, player);
}
@Override
public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosion) {
if (asItem() instanceof WeatherJarItem jar) {

View file

@ -1,12 +1,9 @@
package com.minelittlepony.unicopia.item;
import com.minelittlepony.unicopia.block.UBlocks;
import com.minelittlepony.unicopia.entity.IItemEntity;
import com.minelittlepony.unicopia.entity.ItemImpl;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.minecraft.block.Block;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LightningEntity;
@ -24,8 +21,6 @@ public class EmptyJarItem extends BlockItem implements ItemImpl.GroundTickCallba
public ActionResult onGroundTick(IItemEntity item) {
ItemEntity entity = item.get().asEntity();
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), UBlocks.CLOUD_JAR, UBlocks.STORM_JAR, UBlocks.LIGHTNING_JAR, UBlocks.ZAP_JAR);
entity.setInvulnerable(true);
if (!entity.getWorld().isClient