minecraft-renderer 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/mesher.js.map +2 -2
  2. package/dist/metafile.json +1 -1
  3. package/dist/minecraft-renderer.js +58 -58
  4. package/dist/threeWorker.js +413 -413
  5. package/package.json +1 -1
  6. package/src/graphicsBackend/appViewer.ts +1 -0
  7. package/src/graphicsBackend/config.ts +1 -0
  8. package/src/graphicsBackend/index.ts +1 -0
  9. package/src/graphicsBackend/playerState.ts +1 -0
  10. package/src/graphicsBackend/types.ts +1 -0
  11. package/src/index.ts +1 -0
  12. package/src/lib/DebugGui.ts +1 -0
  13. package/src/lib/animationController.ts +1 -0
  14. package/src/lib/cameraBobbing.ts +1 -0
  15. package/src/lib/canvas2DOverlay.example.ts +1 -0
  16. package/src/lib/canvas2DOverlay.quickstart.ts +1 -0
  17. package/src/lib/canvas2DOverlay.ts +1 -0
  18. package/src/lib/cleanupDecorator.ts +1 -0
  19. package/src/lib/createPlayerObject.ts +1 -0
  20. package/src/lib/frameTimingCollector.ts +1 -0
  21. package/src/lib/guiRenderer.ts +1 -0
  22. package/src/lib/items.ts +1 -0
  23. package/src/lib/mesherlogReader.ts +1 -0
  24. package/src/lib/simpleUtils.ts +1 -0
  25. package/src/lib/smoothSwitcher.ts +1 -0
  26. package/src/lib/spiral.ts +1 -0
  27. package/src/lib/ui/newStats.ts +1 -0
  28. package/src/lib/utils/proxy.ts +1 -0
  29. package/src/lib/utils/skins.ts +1 -0
  30. package/src/lib/utils.ts +1 -0
  31. package/src/lib/workerProxy.ts +1 -0
  32. package/src/lib/worldrendererCommon.ts +1 -0
  33. package/src/mesher/mesher.ts +1 -0
  34. package/src/mesher/models.ts +1 -0
  35. package/src/mesher/modelsGeometryCommon.ts +1 -0
  36. package/src/mesher/shared.ts +1 -0
  37. package/src/mesher/standaloneRenderer.ts +1 -0
  38. package/src/mesher/test/a.ts +1 -0
  39. package/src/mesher/test/mesherTester.ts +1 -0
  40. package/src/mesher/test/playground.ts +1 -0
  41. package/src/mesher/test/test-perf.ts +1 -0
  42. package/src/mesher/test/tests.test.ts +1 -0
  43. package/src/mesher/world.ts +1 -0
  44. package/src/mesher/worldConstants.ts +1 -0
  45. package/src/playerState/playerState.ts +1 -0
  46. package/src/playerState/types.ts +1 -0
  47. package/src/playground/allEntitiesDebug.ts +1 -0
  48. package/src/playground/baseScene.ts +1 -0
  49. package/src/playground/playground.ts +1 -0
  50. package/src/playground/reactUtils.ts +1 -0
  51. package/src/playground/scenes/allEntities.ts +1 -0
  52. package/src/playground/scenes/floorRandom.ts +1 -0
  53. package/src/playground/scenes/geometryExport.ts +1 -0
  54. package/src/playground/scenes/index.ts +1 -0
  55. package/src/playground/scenes/main.ts +1 -0
  56. package/src/playground/scenes/railsCobweb.ts +1 -0
  57. package/src/playground/scenes/rotationIssue.ts +1 -0
  58. package/src/playground/scenes/slabsOptimization.ts +1 -0
  59. package/src/playground/scenes/transparencyIssue.ts +1 -0
  60. package/src/playground/shared.ts +1 -0
  61. package/src/resourcesManager/index.ts +1 -0
  62. package/src/resourcesManager/resourcesManager.ts +1 -0
  63. package/src/shims/minecraftData.ts +1 -0
  64. package/src/sign-renderer/index.ts +1 -0
  65. package/src/sign-renderer/playground.ts +1 -0
  66. package/src/sign-renderer/tests.test.ts +1 -0
  67. package/src/sign-renderer/vite.config.ts +1 -0
  68. package/src/three/appShared.ts +1 -0
  69. package/src/three/bannerRenderer.ts +1 -0
  70. package/src/three/cameraShake.ts +1 -0
  71. package/src/three/cinimaticScript.ts +1 -0
  72. package/src/three/documentRenderer.ts +1 -0
  73. package/src/three/entities.ts +150 -42
  74. package/src/three/entity/EntityMesh.ts +1 -0
  75. package/src/three/entity/animations.js +248 -133
  76. package/src/three/entity/armorModels.ts +1 -0
  77. package/src/three/fireworks.ts +1 -0
  78. package/src/three/fireworksRenderer.ts +1 -0
  79. package/src/three/globals.d.ts +1 -0
  80. package/src/three/graphicsBackendBase.ts +1 -0
  81. package/src/three/graphicsBackendOffThread.ts +1 -0
  82. package/src/three/graphicsBackendSingleThread.ts +1 -0
  83. package/src/three/hand.ts +1 -0
  84. package/src/three/holdingBlock.ts +1 -0
  85. package/src/three/itemMesh.ts +1 -0
  86. package/src/three/modules/index.ts +1 -0
  87. package/src/three/modules/sciFiWorldReveal.ts +1 -0
  88. package/src/three/modules/starfield.ts +1 -0
  89. package/src/three/modules.d.ts +1 -0
  90. package/src/three/panorama.ts +1 -0
  91. package/src/three/panoramaShared.ts +1 -0
  92. package/src/three/renderSlot.ts +1 -0
  93. package/src/three/rendererModuleSystem.ts +1 -0
  94. package/src/three/skyboxRenderer.ts +1 -0
  95. package/src/three/threeJsMedia.ts +1 -0
  96. package/src/three/threeJsMethods.ts +1 -0
  97. package/src/three/threeJsParticles.ts +1 -0
  98. package/src/three/threeJsSound.ts +1 -0
  99. package/src/three/threeJsUtils.ts +1 -0
  100. package/src/three/threeWorker.ts +1 -0
  101. package/src/three/waypointSprite.ts +1 -0
  102. package/src/three/waypoints.ts +1 -0
  103. package/src/three/world/cursorBlock.ts +1 -0
  104. package/src/three/world/vr.ts +1 -0
  105. package/src/three/worldBlockGeometry.ts +1 -0
  106. package/src/three/worldGeometryExport.ts +1 -0
  107. package/src/three/worldRendererThree.ts +1 -0
  108. package/src/worldView/index.ts +1 -0
  109. package/src/worldView/types.ts +1 -0
  110. package/src/worldView/worldView.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-renderer",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "The most Modular Minecraft world renderer with Three.js WebGL backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * AppViewer - Base application viewer for Minecraft renderer.
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Default configurations for the graphics backend and world renderer.
3
4
  */
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Graphics Backend Module
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Player State - Initial player state for renderer.
3
4
  */
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Graphics Backend Types
3
4
  *
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Minecraft Renderer
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  // eslint-disable-next-line import/no-named-as-default
2
3
  import GUI from 'lil-gui'
3
4
  import { isWebWorker } from '../three/documentRenderer'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import * as tweenJs from '@tweenjs/tween.js'
2
3
 
3
4
  export class AnimationController {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  export class CameraBobbing {
2
3
  private walkDistance = 0
3
4
  private prevWalkDistance = 0
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * EXAMPLES: How to use Canvas2DOverlay with Three.js
3
4
  * Works in both main thread and Web Workers!
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * QUICK START: Add a black 100px box at bottom-left corner
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Canvas 2D Overlay for Three.js WebGL Canvas
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  export function buildCleanupDecorator (cleanupMethod: string) {
2
3
  return function () {
3
4
  return function (_target: { snapshotInitialValues }, propertyKey: string) {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { PlayerObject, PlayerAnimation } from 'skinview3d'
2
3
  import * as THREE from 'three'
3
4
  import { WalkingGeneralSwing } from '../three/entity/animations'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Frame Timing Collector (Worker-side)
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  // Import placeholders - replace with actual imports for your environment
2
3
  import { ItemRenderer, Identifier, ItemStack, NbtString, Structure, StructureRenderer, ItemRendererResources, BlockDefinition, BlockModel, TextureAtlas, Resources, ItemModel } from 'deepslate'
3
4
  import { AssetsParser } from 'mc-assets/dist/assetsParser'
package/src/lib/items.ts CHANGED
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import mojangson from 'mojangson'
2
3
  import nbt from 'prismarine-nbt'
3
4
  import { fromFormattedString } from '@xmcl/text-component'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /* eslint-disable no-await-in-loop */
2
3
  import { Vec3 } from 'vec3'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  export async function getBufferFromStream (stream) {
2
3
  return new Promise((resolve, reject) => {
3
4
  let buffer = Buffer.from([])
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import * as tweenJs from '@tweenjs/tween.js'
2
3
  import { AnimationController } from './animationController'
3
4
 
package/src/lib/spiral.ts CHANGED
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  export function generateSpiralMatrix(distance: number): [number, number][] {
2
3
  const n = distance * 2 + 1
3
4
  if (n <= 0) {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /* eslint-disable unicorn/prefer-dom-node-text-content */
2
3
  import { isWebWorker } from '../../three/documentRenderer'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { subscribeKey } from 'valtio/utils'
2
3
 
3
4
  // eslint-disable-next-line max-params
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { loadSkinToCanvas } from 'skinview-utils'
2
3
  import * as THREE from 'three'
3
4
  import stevePng from 'mc-assets/dist/other-textures/latest/entity/player/wide/steve.png'
package/src/lib/utils.ts CHANGED
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  export const loadScript = async function (scriptSrc: string, highPriority = true): Promise<HTMLScriptElement> {
2
3
  const existingScript = document.querySelector<HTMLScriptElement>(`script[src="${scriptSrc}"]`)
3
4
  if (existingScript) {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { proxy, getVersion, subscribe } from 'valtio'
2
3
  import { Vec3 } from 'vec3'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /* eslint-disable guard-for-in */
2
3
  import { EventEmitter } from 'events'
3
4
  import { Vec3 } from 'vec3'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { Vec3 } from 'vec3'
2
3
  import { World } from './world'
3
4
  import { getSectionGeometry, setBlockStatesData as setMesherData } from './models'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { Vec3 } from 'vec3'
2
3
  import worldBlockProvider, { WorldBlockProvider } from 'mc-assets/dist/worldBlockProvider'
3
4
  import legacyJson from '../lib/preflatMap.json'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BlockModelPartsResolved } from './world'
2
3
 
3
4
  export type BlockElement = NonNullable<BlockModelPartsResolved[0][0]['elements']>[0]
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BlockType } from '../playground/shared'
2
3
 
3
4
  // only here for easier testing
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /* eslint-disable @stylistic/function-call-argument-newline */
2
3
  import { Vec3 } from 'vec3'
3
4
  import { Block } from 'prismarine-block'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import {MaxRectsPacker } from 'maxrects-packer'
2
3
 
3
4
  console.log('test', MaxRectsPacker)
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import ChunkLoader, { PCChunk } from 'prismarine-chunk'
2
3
  import { Vec3 } from 'vec3'
3
4
  import MinecraftData from 'minecraft-data'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { setup } from './mesherTester'
2
3
 
3
4
  const addPositions = [
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import PrismarineWorld from 'prismarine-world'
2
3
  import PrismarineChunk from 'prismarine-chunk'
3
4
  import { Vec3 } from 'vec3'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { test, expect } from 'vitest'
2
3
  import { versions } from 'minecraft-data'
3
4
  import { INVISIBLE_BLOCKS } from '../worldConstants'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import Chunks from 'prismarine-chunk'
2
3
  import mcData from 'minecraft-data'
3
4
  import { Block } from 'prismarine-block'
@@ -1 +1,2 @@
1
+ //@ts-nocheck
1
2
  export const INVISIBLE_BLOCKS = new Set(['air', 'void_air', 'cave_air', 'barrier', 'light', 'moving_piston'])
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { proxy } from 'valtio'
2
3
  import type { GameMode, HandItemBlock, BlocksShapes, BlockShape, MovementState, CameraPerspective, Team, ItemSpecificContextProperties } from './types'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { ItemSelector } from 'mc-assets/dist/itemDefinitions'
2
3
 
3
4
  export type GameMode = 'survival' | 'creative' | 'adventure' | 'spectator'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { EntityMesh, rendererSpecialHandled, EntityDebugFlags } from '../three/entity/EntityMesh'
2
3
 
3
4
  export const displayEntitiesDebugList = (version: string) => {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { Vec3 } from 'vec3'
2
3
  import * as THREE from 'three'
3
4
  import MinecraftData, { IndexedData } from 'minecraft-data'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from './baseScene'
2
3
  import { playgroundGlobalUiState } from './playgroundUi'
3
4
  import * as scenes from './scenes'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { useCallback, useRef, useState } from 'react'
2
3
 
3
4
  interface LongPressOptions {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from '../baseScene'
2
3
  import { displayEntitiesDebugList } from '../allEntitiesDebug'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from '../baseScene'
2
3
 
3
4
  export default class RailsCobwebScene extends BasePlaygroundScene {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import * as THREE from 'three'
2
3
  import { BasePlaygroundScene } from '../baseScene'
3
4
  import {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  // export { default as rotation } from './rotation'
2
3
  export { default as main } from './main'
3
4
  export { default as railsCobweb } from './railsCobweb'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  // eslint-disable-next-line import/no-named-as-default
2
3
  import GUI, { Controller } from 'lil-gui'
3
4
  import * as THREE from 'three'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from '../baseScene'
2
3
 
3
4
  export default class RailsCobwebScene extends BasePlaygroundScene {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from '../baseScene'
2
3
 
3
4
  export default class RotationIssueScene extends BasePlaygroundScene {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from '../baseScene'
2
3
 
3
4
  export default class extends BasePlaygroundScene {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BasePlaygroundScene } from '../baseScene'
2
3
 
3
4
  export default class extends BasePlaygroundScene {
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import WorldLoader, { world } from 'prismarine-world'
2
3
  import ChunkLoader from 'prismarine-chunk'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * ResourcesManager module - handles Minecraft assets loading and management.
3
4
  */
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { EventEmitter } from 'events'
2
3
  import TypedEmitter from 'typed-emitter'
3
4
  import MinecraftData, { IndexedData } from 'minecraft-data'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * Minecraft Data Shim
3
4
  *
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import type { ChatMessage } from 'prismarine-chat'
2
3
  import { createCanvas } from '../lib/utils'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import PrismarineChatLoader from 'prismarine-chat'
2
3
  import { renderSign } from '.'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { test, expect } from 'vitest'
2
3
  import PrismarineChatLoader from 'prismarine-chat'
3
4
  import { renderSign } from '.'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { defineConfig } from 'vite'
2
3
 
3
4
  export default defineConfig({
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { BlockModel } from 'mc-assets/dist/types'
2
3
  import { ItemSpecificContextProperties } from '../playerState/types'
3
4
  import { PlayerStateRenderer } from '../playerState/playerState'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import * as THREE from 'three'
2
3
  import { Vec3 } from 'vec3'
3
4
  import { createCanvas } from '../lib/utils'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import * as THREE from 'three'
2
3
  import { WorldRendererThree } from './worldRendererThree'
3
4
 
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import * as THREE from 'three'
2
3
  import * as tweenJs from '@tweenjs/tween.js'
3
4
  import { Vec3 } from 'vec3'
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  /**
2
3
  * DocumentRenderer - Manages Three.js WebGLRenderer and render loop.
3
4
  *