- 20
- 1
Как нужно нормально уничтожать блоки? Я делаю world.destroyBlock, но он выдает ошибку.
Можно ли как-то применить топор к блокам? Или хотя бы сделать постепенное уничтожение блока
Java:
@Override
public void tick() {
if(world instanceof ServerWorld) {
if (cuttingTreeNow == null || cuttingTreeNow.isEmpty()) {
cuttingTreeNow = new Tree(this.getPos().up(), world);
}
Treefarm.LOGGER.info("WORLD STATE " + world);
world.destroyBlock(cuttingTreeNow.pop(), true);
}
}
Можно ли как-то применить топор к блокам? Или хотя бы сделать постепенное уничтожение блока
- Краш-лог
[21:22:07] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:103]: ---- Minecraft Crash Report ----
// I blame Dinnerbone.
Time: 12.07.2020, 21:22
Description: Ticking block entity
java.lang.NullPointerException: Ticking block entity
at net.minecraft.world.World.isOutsideBuildHeight(World.java:138) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.World.getBlockState(World.java:363) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.World.func_225521_a_(World.java:247) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.IWorldWriter.destroyBlock(IWorldWriter.java:14) ~[?:?] {re:classloading}
at lishy2.treefarm.entities.WoodCutterBlockEntity.tick(WoodCutterBlockEntity.java:51) ~[?:?] {re:classloading}
at net.minecraft.world.World.tickBlockEntities(World.java:478) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:368) ~[?:?] {re:classloading}
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:849) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:784) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:114) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) ~[?:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:834) ~[?:?] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.minecraft.world.World.isOutsideBuildHeight(World.java:138)
at net.minecraft.world.World.getBlockState(World.java:363)
at net.minecraft.world.World.func_225521_a_(World.java:247)
at net.minecraft.world.IWorldWriter.destroyBlock(IWorldWriter.java:14)
at lishy2.treefarm.entities.WoodCutterBlockEntity.tick(WoodCutterBlockEntity.java:51)
-- Block entity being ticked --
Details:
Name: null // lishy2.treefarm.entities.WoodCutterBlockEntity
Block: Block{treefarm:wood_cutter_block}
Block location: World: (-316,73,-230), Chunk: (at 4,4,10 in -20,-15; contains blocks -320,0,-240 to -305,255,-225), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Block: Block{treefarm:wood_cutter_block}
Block location: World: (-316,73,-230), Chunk: (at 4,4,10 in -20,-15; contains blocks -320,0,-240 to -305,255,-225), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Stacktrace:
at net.minecraft.world.World.tickBlockEntities(World.java:478)
at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:368)
-- Affected level --
Details:
All players: 1 total; [ServerPlayerEntity['LIshy2005'/272, l='Testing', x=-315.55, y=73.00, z=-227.19]]
Chunk stats: ServerChunkCache: 2627
Level dimension: DimensionType{minecraft:overworld}
Level name: Testing
Level seed: 6368286180295824428
Level generator: ID 00 - default, ver 1. Features enabled: true
Level generator options: {}
Level spawn location: World: (-256,63,-160), Chunk: (at 0,3,0 in -16,-10; contains blocks -256,0,-160 to -241,255,-145), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 12484 game time, 12484 day time
Known server brands: forge
Level was modded: true
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 57939 (now: false), thunder time: 66063 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:849)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:784)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:114)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637)
at java.base/java.lang.Thread.run(Thread.java:834)
-- System Details --
Details:
Minecraft Version: 1.15.2
Minecraft Version ID: 1.15.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 11.0.4, JetBrains s.r.o
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), JetBrains s.r.o
Memory: 566330880 bytes (540 MB) / 1415577600 bytes (1350 MB) up to 4282384384 bytes (4084 MB)
CPUs: 12
JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
ModLauncher: 5.1.0+69+master.79f13f7
ModLauncher launch target: fmluserdevclient
ModLauncher naming: mcp
ModLauncher services:
/eventbus-2.2.0-service.jar eventbus PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar object_holder_definalize PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar runtime_enum_extender PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar capability_inject_definalize PLUGINSERVICE
/accesstransformers-2.1.1-shadowed.jar accesstransformer PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar runtimedistcleaner PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar fml TRANSFORMATIONSERVICE
FML: 31.2
Forge: net.minecraftforge:31.2.9
FML Language Providers:
[email protected]
minecraft@1
Mod List:
client-extra.jar Minecraft {[email protected] DONE}
main TreeFarm {treefarm@NONE DONE}
forge-1.15.2-31.2.9_mapped_stable_60-1.15-recomp.jar Forge {[email protected] DONE}
Player Count: 1 / 8; [ServerPlayerEntity['LIshy2005'/272, l='Testing', x=-315.55, y=73.00, z=-227.19]]
Data Packs: vanilla, mod:treefarm (incompatible), mod:forge (incompatible)
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge'
[21:22:07] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:103]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2020-07-12_21.22.07-server.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Краш-лог:
[21:22:07] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:103]: ---- Minecraft Crash Report ----
// I blame Dinnerbone.
Time: 12.07.2020, 21:22
Description: Ticking block entity
java.lang.NullPointerException: Ticking block entity
at net.minecraft.world.World.isOutsideBuildHeight(World.java:138) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.World.getBlockState(World.java:363) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.World.func_225521_a_(World.java:247) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.IWorldWriter.destroyBlock(IWorldWriter.java:14) ~[?:?] {re:classloading}
at lishy2.treefarm.entities.WoodCutterBlockEntity.tick(WoodCutterBlockEntity.java:51) ~[?:?] {re:classloading}
at net.minecraft.world.World.tickBlockEntities(World.java:478) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:368) ~[?:?] {re:classloading}
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:849) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:784) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:114) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) ~[?:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:834) ~[?:?] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.minecraft.world.World.isOutsideBuildHeight(World.java:138)
at net.minecraft.world.World.getBlockState(World.java:363)
at net.minecraft.world.World.func_225521_a_(World.java:247)
at net.minecraft.world.IWorldWriter.destroyBlock(IWorldWriter.java:14)
at lishy2.treefarm.entities.WoodCutterBlockEntity.tick(WoodCutterBlockEntity.java:51)
-- Block entity being ticked --
Details:
Name: null // lishy2.treefarm.entities.WoodCutterBlockEntity
Block: Block{treefarm:wood_cutter_block}
Block location: World: (-316,73,-230), Chunk: (at 4,4,10 in -20,-15; contains blocks -320,0,-240 to -305,255,-225), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Block: Block{treefarm:wood_cutter_block}
Block location: World: (-316,73,-230), Chunk: (at 4,4,10 in -20,-15; contains blocks -320,0,-240 to -305,255,-225), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Stacktrace:
at net.minecraft.world.World.tickBlockEntities(World.java:478)
at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:368)
-- Affected level --
Details:
All players: 1 total; [ServerPlayerEntity['LIshy2005'/272, l='Testing', x=-315.55, y=73.00, z=-227.19]]
Chunk stats: ServerChunkCache: 2627
Level dimension: DimensionType{minecraft:overworld}
Level name: Testing
Level seed: 6368286180295824428
Level generator: ID 00 - default, ver 1. Features enabled: true
Level generator options: {}
Level spawn location: World: (-256,63,-160), Chunk: (at 0,3,0 in -16,-10; contains blocks -256,0,-160 to -241,255,-145), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 12484 game time, 12484 day time
Known server brands: forge
Level was modded: true
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 57939 (now: false), thunder time: 66063 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:849)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:784)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:114)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637)
at java.base/java.lang.Thread.run(Thread.java:834)
-- System Details --
Details:
Minecraft Version: 1.15.2
Minecraft Version ID: 1.15.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 11.0.4, JetBrains s.r.o
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), JetBrains s.r.o
Memory: 566330880 bytes (540 MB) / 1415577600 bytes (1350 MB) up to 4282384384 bytes (4084 MB)
CPUs: 12
JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
ModLauncher: 5.1.0+69+master.79f13f7
ModLauncher launch target: fmluserdevclient
ModLauncher naming: mcp
ModLauncher services:
/eventbus-2.2.0-service.jar eventbus PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar object_holder_definalize PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar runtime_enum_extender PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar capability_inject_definalize PLUGINSERVICE
/accesstransformers-2.1.1-shadowed.jar accesstransformer PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar runtimedistcleaner PLUGINSERVICE
/forge-1.15.2-31.2.9_mapped_stable_60-1.15-launcher.jar fml TRANSFORMATIONSERVICE
FML: 31.2
Forge: net.minecraftforge:31.2.9
FML Language Providers:
[email protected]
minecraft@1
Mod List:
client-extra.jar Minecraft {[email protected] DONE}
main TreeFarm {treefarm@NONE DONE}
forge-1.15.2-31.2.9_mapped_stable_60-1.15-recomp.jar Forge {[email protected] DONE}
Player Count: 1 / 8; [ServerPlayerEntity['LIshy2005'/272, l='Testing', x=-315.55, y=73.00, z=-227.19]]
Data Packs: vanilla, mod:treefarm (incompatible), mod:forge (incompatible)
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge'
[21:22:07] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:103]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2020-07-12_21.22.07-server.txt
AL lib: (EE) alc_cleanup: 1 device not closed