interaction behaviour doesn't invalidate _every_ renderer now

This commit is contained in:
Talrey 2021-08-15 16:00:04 -07:00
parent c6db66876a
commit 6c3337ae75

View file

@ -2,6 +2,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement;
import com.simibubi.create.CreateClient; import com.simibubi.create.CreateClient;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
@ -21,7 +23,8 @@ public class LeverMovingInteraction extends MovingInteractionBehaviour {
null, player.blockPosition(), SoundEvents.LEVER_CLICK, SoundCategory.BLOCKS, 0.3f, null, player.blockPosition(), SoundEvents.LEVER_CLICK, SoundCategory.BLOCKS, 0.3f,
newState.getValue(BlockStateProperties.POWERED) ? 0.6f : 0.5f newState.getValue(BlockStateProperties.POWERED) ? 0.6f : 0.5f
); );
CreateClient.invalidateRenderers(); // mark contraption to re-render
ContraptionRenderDispatcher.invalidate(contraptionEntity.contraption);
return true; return true;
} }
} }