ConstructionWand/src/main/java/thetadev/constructionwand/wand/undo/ISnapshot.java
Theta-Dev cdba987f8d Fixed crash when placing many connectable blocks
(iron bars, glass panes, redstone)

The reason for this crash is that I precomputed the blockstates to be placed (which would be free standing poles when no blocks are present around them).
Placing all blocks at once then causes lots of block updates which may crash the game (especially in MC1.15).
So the solution is to calculate the blockstate directly before the placement.
2021-03-14 22:49:09 +01:00

25 lines
665 B
Java

package thetadev.constructionwand.wand.undo;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
public interface ISnapshot
{
BlockPos getPos();
BlockState getBlockState();
ItemStack getRequiredItems();
boolean execute(World world, PlayerEntity player, BlockRayTraceResult rayTraceResult);
boolean canRestore(World world, PlayerEntity player);
boolean restore(World world, PlayerEntity player);
void forceRestore(World world);
}