mirror of
https://github.com/Theta-Dev/ConstructionWand.git
synced 2025-10-08 17:23:54 +02:00
(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.
25 lines
665 B
Java
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);
|
|
}
|