Compare commits

..
284 Commits
Author SHA1 Message Date
tr7zw 8f2f379860 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5bdddc134a 🚀 2026-09-17 18:09:38 +00:00
tr7zw 7d422726cb Deploying to gh-pages from @ tr7zw/Item-NBT-API@733b871c09 🚀 2026-09-17 18:07:20 +00:00
tr7zw 32eead2ffa Deploying to gh-pages from @ tr7zw/Item-NBT-API@bc48239fdd 🚀 2026-09-16 16:54:46 +00:00
tr7zw affa91700b Deploying to gh-pages from @ tr7zw/Item-NBT-API@f182204b2f 🚀 2026-09-16 16:53:51 +00:00
tr7zw 4edca926c8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@2d6aa142de 🚀 2026-07-27 16:24:23 +00:00
tr7zw fac4c9645e Deploying to gh-pages from @ tr7zw/Item-NBT-API@cc1436cd09 🚀 2026-07-27 16:15:30 +00:00
tr7zw fedbe8abbf Deploying to gh-pages from @ tr7zw/Item-NBT-API@bbc02e1299 🚀 2026-07-24 19:31:11 +00:00
tr7zw 484c7fc5f7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@25c82a5ad0 🚀 2026-07-08 18:08:59 +00:00
tr7zw 7dd63d09f9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@46a9116613 🚀 2026-06-16 18:05:30 +00:00
tr7zw 0b16ba1322 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5776be4a35 🚀 2026-04-06 14:09:31 +00:00
tr7zw c503b1c795 Deploying to gh-pages from @ tr7zw/Item-NBT-API@9fbee68966 🚀 2026-03-28 16:07:08 +00:00
tr7zw fbe545dc55 Deploying to gh-pages from @ tr7zw/Item-NBT-API@b277f0b01d 🚀 2026-03-28 16:01:32 +00:00
tr7zw a71adde37a Deploying to gh-pages from @ tr7zw/Item-NBT-API@e4793a0d46 🚀 2026-03-28 15:14:17 +00:00
tr7zw 0b4e4a33e2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@7c34542b86 🚀 2026-03-28 15:10:56 +00:00
tr7zw 3589d03f43 Deploying to gh-pages from @ tr7zw/Item-NBT-API@123da87a3a 🚀 2026-03-05 20:47:33 +00:00
tr7zw af7484f129 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f3d7545c6b 🚀 2026-03-05 20:46:58 +00:00
tr7zw 3880cddc37 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3b29fe399e 🚀 2026-03-05 20:46:46 +00:00
tr7zw 25ae561d7a Deploying to gh-pages from @ tr7zw/Item-NBT-API@c368318bb6 🚀 2026-03-05 20:46:17 +00:00
tr7zw 6d93b6305c Deploying to gh-pages from @ tr7zw/Item-NBT-API@b66353d0d0 🚀 2025-12-09 19:21:56 +00:00
tr7zw 2d5502e98d Deploying to gh-pages from @ tr7zw/Item-NBT-API@5bec1371d2 🚀 2025-12-09 18:13:49 +00:00
tr7zw 8339236531 Deploying to gh-pages from @ tr7zw/Item-NBT-API@309455ecfc 🚀 2025-12-09 17:47:07 +00:00
tr7zw 8d76b643fd Deploying to gh-pages from @ tr7zw/Item-NBT-API@bc6bd56ce9 🚀 2025-12-09 17:45:46 +00:00
tr7zw 4dcf549b2f Deploying to gh-pages from @ tr7zw/Item-NBT-API@fcdf0929f9 🚀 2025-12-09 17:40:06 +00:00
tr7zw 8c4457a260 Deploying to gh-pages from @ tr7zw/Item-NBT-API@eec2c0980e 🚀 2025-10-11 15:08:06 +00:00
tr7zw d774043aaa Deploying to gh-pages from @ tr7zw/Item-NBT-API@3ddf3e53dc 🚀 2025-10-04 18:12:25 +00:00
tr7zw 9c31c27780 Deploying to gh-pages from @ tr7zw/Item-NBT-API@70d5ab12eb 🚀 2025-09-30 17:27:55 +00:00
tr7zw 9f2f0ab262 Deploying to gh-pages from @ tr7zw/Item-NBT-API@a63e9ba8f4 🚀 2025-09-30 17:18:21 +00:00
tr7zw db3cbfee88 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f9f1c204b6 🚀 2025-09-28 09:55:20 +00:00
tr7zw 2d3574e903 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d8a59d6383 🚀 2025-09-28 09:55:16 +00:00
tr7zw 3b7b81d122 Deploying to gh-pages from @ tr7zw/Item-NBT-API@6c70ce2ccc 🚀 2025-09-28 09:55:04 +00:00
tr7zw d29f3350ca Deploying to gh-pages from @ tr7zw/Item-NBT-API@71783a8dc9 🚀 2025-08-26 20:02:04 +00:00
tr7zw 7c97b89f27 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5d06ae9275 🚀 2025-08-26 19:54:45 +00:00
tr7zw d230270260 Deploying to gh-pages from @ tr7zw/Item-NBT-API@835fdf48cd 🚀 2025-08-26 19:37:52 +00:00
tr7zw ad88e77a26 Deploying to gh-pages from @ tr7zw/Item-NBT-API@31d77d25f9 🚀 2025-08-20 19:58:26 +00:00
tr7zw b3fe163e7f Deploying to gh-pages from @ tr7zw/Item-NBT-API@08a92ac06c 🚀 2025-07-17 18:32:02 +00:00
tr7zw 728655d3ae Deploying to gh-pages from @ tr7zw/Item-NBT-API@6bcd00d114 🚀 2025-07-01 17:44:36 +00:00
tr7zw c840cef609 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bc93986392 🚀 2025-07-01 13:04:22 +00:00
tr7zw 1359ab4d32 Deploying to gh-pages from @ tr7zw/Item-NBT-API@1054d16996 🚀 2025-06-24 20:21:16 +00:00
tr7zw de6d6e997f Deploying to gh-pages from @ tr7zw/Item-NBT-API@9351a86774 🚀 2025-06-24 19:58:52 +00:00
tr7zw 8d6ba14c37 Deploying to gh-pages from @ tr7zw/Item-NBT-API@56a43d246b 🚀 2025-06-24 19:58:45 +00:00
tr7zw 15a48012d8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@df231c2324 🚀 2025-06-21 11:57:03 +00:00
tr7zw b705b7e227 Deploying to gh-pages from @ tr7zw/Item-NBT-API@b068284b6e 🚀 2025-06-19 00:27:55 +00:00
tr7zw 020e21201b Deploying to gh-pages from @ tr7zw/Item-NBT-API@9e9b85f46a 🚀 2025-06-18 20:45:02 +00:00
tr7zw 3690faee24 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3baed4b1e7 🚀 2025-06-16 16:52:18 +00:00
tr7zw 2999404f51 Deploying to gh-pages from @ tr7zw/Item-NBT-API@432b40b3bc 🚀 2025-06-06 20:26:30 +00:00
tr7zw 93de262738 Deploying to gh-pages from @ tr7zw/Item-NBT-API@fdf3638948 🚀 2025-06-06 19:42:11 +00:00
tr7zw 7fb6f42a16 Deploying to gh-pages from @ tr7zw/Item-NBT-API@35f541d3db 🚀 2025-04-17 18:33:23 +00:00
tr7zw b326a2bdcb Deploying to gh-pages from @ tr7zw/Item-NBT-API@d4ee3b998c 🚀 2025-04-17 17:49:27 +00:00
tr7zw 210c728df2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@2902dca5a5 🚀 2025-04-17 17:47:13 +00:00
tr7zw a6cf73580a Deploying to gh-pages from @ tr7zw/Item-NBT-API@1c1e3c8664 🚀 2025-04-17 17:43:17 +00:00
tr7zw a7af469c32 Deploying to gh-pages from @ tr7zw/Item-NBT-API@7f8f021ced 🚀 2025-04-17 17:26:24 +00:00
tr7zw f3f02fe557 Deploying to gh-pages from @ tr7zw/Item-NBT-API@764e01503d 🚀 2025-03-31 17:07:11 +00:00
tr7zw 956db5d74a Deploying to gh-pages from @ tr7zw/Item-NBT-API@689cd4fa3b 🚀 2025-03-31 16:05:46 +00:00
tr7zw e822152b65 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c8f68f8b3b 🚀 2025-03-28 09:24:09 +00:00
tr7zw 11e6e6c620 Deploying to gh-pages from @ tr7zw/Item-NBT-API@e52ba209e6 🚀 2025-03-25 21:52:35 +00:00
tr7zw 67709875e2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@418f5bea07 🚀 2025-03-25 21:44:31 +00:00
tr7zw ed58902924 Deploying to gh-pages from @ tr7zw/Item-NBT-API@a974142a55 🚀 2025-02-23 10:41:24 +00:00
tr7zw 4dde60c0a6 Deploying to gh-pages from @ tr7zw/Item-NBT-API@da6be72d29 🚀 2024-12-28 19:13:19 +00:00
tr7zw 5d4c8392cc Deploying to gh-pages from @ tr7zw/Item-NBT-API@f3af749b11 🚀 2024-12-21 23:45:50 +00:00
tr7zw 3211d5c4ff Deploying to gh-pages from @ tr7zw/Item-NBT-API@d81c2b4e8e 🚀 2024-12-21 23:45:48 +00:00
tr7zw 5c39b36226 Deploying to gh-pages from @ tr7zw/Item-NBT-API@94192feb8f 🚀 2024-12-21 23:45:18 +00:00
tr7zw 48b7932568 Deploying to gh-pages from @ tr7zw/Item-NBT-API@af3d9c8502 🚀 2024-12-21 23:44:01 +00:00
tr7zw 51b0296e50 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ae98859524 🚀 2024-12-16 16:14:28 +00:00
tr7zw e5cfd36350 Deploying to gh-pages from @ tr7zw/Item-NBT-API@70f0bb62f9 🚀 2024-12-14 21:01:19 +00:00
tr7zw d9634fc4a9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@e2e8aad70a 🚀 2024-12-07 13:19:48 +00:00
tr7zw 27eda51ba5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d2de90ee25 🚀 2024-12-03 22:30:50 +00:00
tr7zw 4f4f02f3a9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3425a6672d 🚀 2024-11-13 22:56:47 +00:00
tr7zw 38b4d5ca2d Deploying to gh-pages from @ tr7zw/Item-NBT-API@b339c9e9c2 🚀 2024-11-13 22:56:24 +00:00
tr7zw bfebe76c0a Deploying to gh-pages from @ tr7zw/Item-NBT-API@67616266da 🚀 2024-11-13 22:55:56 +00:00
tr7zw 39a983c3a5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@73776cfec4 🚀 2024-11-02 14:20:11 +00:00
tr7zw b1caeb7365 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bd674e31c0 🚀 2024-11-02 14:10:03 +00:00
tr7zw 027298235f Deploying to gh-pages from @ tr7zw/Item-NBT-API@42db79706c 🚀 2024-11-02 14:08:05 +00:00
tr7zw 6974cd5a2b Deploying to gh-pages from @ tr7zw/Item-NBT-API@3405ffe0a3 🚀 2024-11-02 12:26:29 +00:00
tr7zw 8143e3d3b2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f8736c8188 🚀 2024-08-27 16:09:29 +00:00
tr7zw d7386ec4d1 Deploying to gh-pages from @ tr7zw/Item-NBT-API@0f926998f6 🚀 2024-08-10 18:31:35 +00:00
tr7zw 956f3ff7c9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3a44a5e989 🚀 2024-08-10 18:24:19 +00:00
tr7zw e958d7c097 Deploying to gh-pages from @ tr7zw/Item-NBT-API@30b931945c 🚀 2024-08-10 18:22:54 +00:00
tr7zw 493cbb321c Deploying to gh-pages from @ tr7zw/Item-NBT-API@88d8629541 🚀 2024-07-21 18:58:30 +00:00
tr7zw 998ce3a958 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ce26e180e6 🚀 2024-07-21 18:54:12 +00:00
tr7zw cadc79f304 Deploying to gh-pages from @ tr7zw/Item-NBT-API@2079123a42 🚀 2024-07-21 18:50:47 +00:00
tr7zw f8af76faf4 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5280ba82a2 🚀 2024-06-20 20:40:08 +00:00
tr7zw be2c91057e Deploying to gh-pages from @ tr7zw/Item-NBT-API@522f732ed1 🚀 2024-06-20 20:36:33 +00:00
tr7zw f499253590 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ac84a4d69a 🚀 2024-06-20 20:22:12 +00:00
tr7zw 745df6bfe2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d7e18c1cb6 🚀 2024-06-20 20:21:44 +00:00
tr7zw 2d5d03b1e7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ffa612634a 🚀 2024-06-20 20:14:42 +00:00
tr7zw e4cfbbd26e Deploying to gh-pages from @ tr7zw/Item-NBT-API@2e20af40e5 🚀 2024-06-20 19:42:02 +00:00
tr7zw 3fb66aad40 Deploying to gh-pages from @ tr7zw/Item-NBT-API@25c59b0eae 🚀 2024-06-16 20:53:48 +00:00
tr7zw 50c7257373 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3ec606ae21 🚀 2024-06-15 21:41:46 +00:00
tr7zw e3058d4ce5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@53216d3b7d 🚀 2024-06-15 21:08:30 +00:00
tr7zw c489158f29 Deploying to gh-pages from @ tr7zw/Item-NBT-API@7cf23201ce 🚀 2024-06-14 19:31:58 +00:00
tr7zw 37c6bc9e6c Deploying to gh-pages from @ tr7zw/Item-NBT-API@fe1d586f44 🚀 2024-06-14 10:35:54 +00:00
tr7zw 053e0e51e4 Deploying to gh-pages from @ tr7zw/Item-NBT-API@956ef15a1d 🚀 2024-06-13 19:17:45 +00:00
tr7zw 7ccafb3ac9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ed867749f8 🚀 2024-06-13 18:59:36 +00:00
tr7zw 0f9c04c659 Deploying to gh-pages from @ tr7zw/Item-NBT-API@82e52267b8 🚀 2024-06-13 18:30:19 +00:00
tr7zw 38ec6b5146 Deploying to gh-pages from @ tr7zw/Item-NBT-API@cf30cf996e 🚀 2024-06-13 17:59:01 +00:00
tr7zw 29edbbd010 Deploying to gh-pages from @ tr7zw/Item-NBT-API@153c72818a 🚀 2024-06-08 19:04:46 +00:00
tr7zw 37050144a8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@633433d6d0 🚀 2024-06-08 19:04:17 +00:00
tr7zw 50fd7149ab Deploying to gh-pages from @ tr7zw/Item-NBT-API@8570c6f77e 🚀 2024-05-18 23:09:25 +00:00
tr7zw 58bbea97e3 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c0a9197113 🚀 2024-04-30 13:29:22 +00:00
tr7zw 34ab19662f Deploying to gh-pages from @ tr7zw/Item-NBT-API@e14dd4f82a 🚀 2024-04-29 22:16:03 +00:00
tr7zw 718ebc7f06 Deploying to gh-pages from @ tr7zw/Item-NBT-API@198dbfabae 🚀 2024-04-29 17:48:35 +00:00
tr7zw 4e6763a15e Deploying to gh-pages from @ tr7zw/Item-NBT-API@8bd49db49b 🚀 2024-04-28 17:33:24 +00:00
tr7zw 77628b42ff Deploying to gh-pages from @ tr7zw/Item-NBT-API@caf1d7cd98 🚀 2024-04-25 16:59:59 +00:00
tr7zw 2bddf68b8a Deploying to gh-pages from @ tr7zw/Item-NBT-API@027f2a2edd 🚀 2024-04-25 16:41:50 +00:00
tr7zw 8e390856d1 Deploying to gh-pages from @ tr7zw/Item-NBT-API@b74b0b852e 🚀 2024-04-25 16:06:31 +00:00
tr7zw 31b518f64d Deploying to gh-pages from @ tr7zw/Item-NBT-API@6ea6ab7e13 🚀 2024-04-25 16:06:20 +00:00
tr7zw e20ba82bd4 Deploying to gh-pages from @ tr7zw/Item-NBT-API@372225626c 🚀 2024-04-24 14:06:21 +00:00
tr7zw fee2c02d5f Deploying to gh-pages from @ tr7zw/Item-NBT-API@fdc16aad69 🚀 2024-04-23 23:49:59 +00:00
tr7zw cff69b50a3 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c723eef68b 🚀 2024-04-23 23:43:38 +00:00
tr7zw 37f7642a87 Deploying to gh-pages from @ tr7zw/Item-NBT-API@03299012ac 🚀 2024-04-23 23:42:29 +00:00
tr7zw 8d5184f6d2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@9367942b54 🚀 2024-04-23 22:11:04 +00:00
tr7zw c4010866bc Deploying to gh-pages from @ tr7zw/Item-NBT-API@0b8d5b153c 🚀 2024-04-06 16:56:50 +00:00
tr7zw 7ca99e7109 Deploying to gh-pages from @ tr7zw/Item-NBT-API@246e3fa38e 🚀 2024-04-06 16:56:34 +00:00
tr7zw 0b71af4de5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3afd9df2ae 🚀 2024-03-24 16:30:10 +00:00
tr7zw ff3fd6872b Deploying to gh-pages from @ tr7zw/Item-NBT-API@2cb16ed0c4 🚀 2024-03-21 20:40:12 +00:00
tr7zw 08a3027f26 Deploying to gh-pages from @ tr7zw/Item-NBT-API@85cc13a817 🚀 2024-03-18 18:49:11 +00:00
tr7zw 4a4d26a9ec Deploying to gh-pages from @ tr7zw/Item-NBT-API@75c8575b5b 🚀 2024-02-22 19:00:21 +00:00
tr7zw b8c0ac7e9c Deploying to gh-pages from @ tr7zw/Item-NBT-API@330fb7711c 🚀 2024-02-12 23:24:35 +00:00
tr7zw 525c02b243 Deploying to gh-pages from @ tr7zw/Item-NBT-API@a37a2c6729 🚀 2024-01-23 23:44:47 +00:00
tr7zw 5524852918 Deploying to gh-pages from @ tr7zw/Item-NBT-API@eee2dfa181 🚀 2024-01-01 15:12:09 +00:00
tr7zw 92f4d8f6a9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ccd78d1b00 🚀 2023-12-27 21:19:42 +00:00
tr7zw 4ef7fe2896 Deploying to gh-pages from @ tr7zw/Item-NBT-API@87fd1ee8ee 🚀 2023-12-19 18:52:20 +00:00
tr7zw 6d3a2f8c70 Deploying to gh-pages from @ tr7zw/Item-NBT-API@af0528328f 🚀 2023-12-19 18:52:09 +00:00
tr7zw f991efdfed Deploying to gh-pages from @ tr7zw/Item-NBT-API@7bf91d0510 🚀 2023-12-10 13:30:17 +00:00
tr7zw c2b61dd2d4 Deploying to gh-pages from @ tr7zw/Item-NBT-API@aed5af12a2 🚀 2023-12-08 20:43:39 +00:00
tr7zw 68ce82f878 Deploying to gh-pages from @ tr7zw/Item-NBT-API@dd6e9e8312 🚀 2023-12-05 15:25:17 +00:00
tr7zw e58782c4f8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@4ad7a172a0 🚀 2023-11-11 16:28:21 +00:00
tr7zw 21201dc06f Deploying to gh-pages from @ tr7zw/Item-NBT-API@6f112c0130 🚀 2023-11-11 16:28:02 +00:00
tr7zw 3b28393b81 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f5a1b21761 🚀 2023-11-04 16:51:23 +00:00
tr7zw fcdc150900 Deploying to gh-pages from @ tr7zw/Item-NBT-API@4af722752e 🚀 2023-11-03 20:23:51 +00:00
tr7zw 2e56777e13 Deploying to gh-pages from @ tr7zw/Item-NBT-API@af3b7a49d0 🚀 2023-10-26 19:15:06 +00:00
tr7zw 2dba049bcb Deploying to gh-pages from @ tr7zw/Item-NBT-API@189ff2f369 🚀 2023-10-24 23:07:18 +00:00
tr7zw e1321862ac Deploying to gh-pages from @ tr7zw/Item-NBT-API@a8a81eee83 🚀 2023-10-22 15:47:04 +00:00
tr7zw a62b6329b1 Deploying to gh-pages from @ tr7zw/Item-NBT-API@fb384784f0 🚀 2023-10-22 15:46:17 +00:00
tr7zw 2a97e723fb Deploying to gh-pages from @ tr7zw/Item-NBT-API@dc333ae25a 🚀 2023-09-21 21:23:14 +00:00
tr7zw 8499c91783 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d18adb459d 🚀 2023-09-21 21:02:45 +00:00
tr7zw b916396ea6 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bc914b73bc 🚀 2023-09-21 18:53:04 +00:00
tr7zw 56ae63007e Deploying to gh-pages from @ tr7zw/Item-NBT-API@60172ea2a7 🚀 2023-09-21 18:27:39 +00:00
tr7zw 2382aec144 Deploying to gh-pages from @ tr7zw/Item-NBT-API@7b30c1533e 🚀 2023-09-21 18:18:03 +00:00
tr7zw 248084ebe3 Deploying to gh-pages from @ tr7zw/Item-NBT-API@a1c90658f3 🚀 2023-09-19 20:29:38 +00:00
tr7zw e745f49bb8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d989797453 🚀 2023-09-14 23:17:53 +00:00
tr7zw 25e505c9a5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c70aefe670 🚀 2023-09-14 22:00:32 +00:00
tr7zw f55772dec6 Deploying to gh-pages from @ tr7zw/Item-NBT-API@7d0fc09470 🚀 2023-09-13 16:56:38 +00:00
tr7zw 0c2394084e Deploying to gh-pages from @ tr7zw/Item-NBT-API@427113e6f0 🚀 2023-09-13 16:53:30 +00:00
tr7zw 2978b942b8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@20ae1cb178 🚀 2023-09-12 22:23:30 +00:00
tr7zw e9dfe70e06 Deploying to gh-pages from @ tr7zw/Item-NBT-API@9b60978af6 🚀 2023-09-08 18:08:22 +00:00
tr7zw 83dbce0908 Deploying to gh-pages from @ tr7zw/Item-NBT-API@598db19d8d 🚀 2023-09-08 17:34:40 +00:00
tr7zw 8452c6b7e0 Deploying to gh-pages from @ tr7zw/Item-NBT-API@7141c56319 🚀 2023-09-04 11:03:40 +00:00
tr7zw ffd55d160c Deploying to gh-pages from @ tr7zw/Item-NBT-API@3bb4d7b449 🚀 2023-08-10 23:09:21 +00:00
tr7zw 79f529c694 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d3d7a3138c 🚀 2023-08-08 18:12:53 +00:00
tr7zw 08f1197e0d Deploying to gh-pages from @ tr7zw/Item-NBT-API@6b1d4e28ed 🚀 2023-08-06 14:18:49 +00:00
tr7zw d951c83466 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bde0bf7c8d 🚀 2023-08-06 14:05:38 +00:00
tr7zw 73cef7c2c3 Deploying to gh-pages from @ tr7zw/Item-NBT-API@6e8b8f3565 🚀 2023-08-05 22:09:18 +00:00
tr7zw 75bfea1871 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d653bc67d8 🚀 2023-08-04 19:03:11 +00:00
tr7zw 4c69189e60 Deploying to gh-pages from @ tr7zw/Item-NBT-API@533765ba74 🚀 2023-08-02 22:52:05 +00:00
tr7zw b94ad1c2d6 Deploying to gh-pages from @ tr7zw/Item-NBT-API@0232f720cb 🚀 2023-08-02 22:32:02 +00:00
tr7zw 437bd7ee92 Deploying to gh-pages from @ tr7zw/Item-NBT-API@fa62c9825d 🚀 2023-08-02 21:00:19 +00:00
tr7zw 2164d63086 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5051bc834d 🚀 2023-08-02 20:35:30 +00:00
tr7zw fa6eeb29ee Deploying to gh-pages from @ tr7zw/Item-NBT-API@10ea4b1767 🚀 2023-08-02 20:26:11 +00:00
tr7zw cde6529905 Deploying to gh-pages from @ tr7zw/Item-NBT-API@b801b46bce 🚀 2023-08-02 17:35:20 +00:00
tr7zw bc20db1003 Deploying to gh-pages from @ tr7zw/Item-NBT-API@fc94dac05b 🚀 2023-07-28 15:31:00 +00:00
tr7zw 814205b332 Deploying to gh-pages from @ tr7zw/Item-NBT-API@1ab5f70c88 🚀 2023-07-26 13:38:11 +00:00
tr7zw a00ab7440e Deploying to gh-pages from @ tr7zw/Item-NBT-API@c90636970a 🚀 2023-07-25 22:20:01 +00:00
tr7zw 7ba193ce47 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f3b1cc27e7 🚀 2023-07-25 21:16:29 +00:00
tr7zw 179b142803 Deploying to gh-pages from @ tr7zw/Item-NBT-API@33eddbaece 🚀 2023-07-25 19:19:24 +00:00
tr7zw bf59db7e11 Deploying to gh-pages from @ tr7zw/Item-NBT-API@20f9b2f1ce 🚀 2023-07-24 01:01:53 +00:00
tr7zw f68c0b0357 Deploying to gh-pages from @ tr7zw/Item-NBT-API@affad0d92c 🚀 2023-07-23 22:09:09 +00:00
tr7zw 46515c8724 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ba169438ba 🚀 2023-07-17 17:55:41 +00:00
tr7zw 485bfb13e7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@9ff2e38d07 🚀 2023-07-05 22:31:10 +00:00
tr7zw a17b792b08 Deploying to gh-pages from @ tr7zw/Item-NBT-API@8b76359143 🚀 2023-07-05 22:22:06 +00:00
tr7zw 47670787f0 Deploying to gh-pages from @ tr7zw/Item-NBT-API@a341c6a81e 🚀 2023-07-04 22:43:53 +00:00
tr7zw 0385106a77 Deploying to gh-pages from @ tr7zw/Item-NBT-API@23b9f9128f 🚀 2023-07-04 22:21:53 +00:00
tr7zw 9c93319247 Deploying to gh-pages from @ tr7zw/Item-NBT-API@81c3b75dc9 🚀 2023-07-04 22:18:37 +00:00
tr7zw e3ac4d0da5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d3b1d00e15 🚀 2023-07-04 22:09:27 +00:00
tr7zw f5bffca69c Deploying to gh-pages from @ tr7zw/Item-NBT-API@177d1fe5b7 🚀 2023-07-04 21:36:35 +00:00
tr7zw c7c25b7f37 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f1682205d8 🚀 2023-07-04 21:21:29 +00:00
tr7zw 4eae5f3e1c Deploying to gh-pages from @ tr7zw/Item-NBT-API@1bfdb93622 🚀 2023-07-04 21:07:44 +00:00
tr7zw 1c8411ee54 Deploying to gh-pages from @ tr7zw/Item-NBT-API@09af2df542 🚀 2023-07-04 21:06:39 +00:00
tr7zw 40d23fb0f5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@cd1bdc0436 🚀 2023-07-04 20:58:14 +00:00
tr7zw 538fe3e974 Deploying to gh-pages from @ tr7zw/Item-NBT-API@b2ea170f9e 🚀 2023-07-04 20:04:58 +00:00
tr7zw f2b516c7de Deploying to gh-pages from @ tr7zw/Item-NBT-API@9bdd79ef7d 🚀 2023-06-27 12:44:37 +00:00
tr7zw db2d032ab8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bfe627658e 🚀 2023-06-21 12:13:07 +00:00
tr7zw a1a62666c3 Deploying to gh-pages from @ tr7zw/Item-NBT-API@a929bd2ddc 🚀 2023-06-17 00:00:07 +00:00
tr7zw 07c433fd15 Deploying to gh-pages from @ tr7zw/Item-NBT-API@62105ead48 🚀 2023-06-15 14:54:38 +00:00
tr7zw d21f091230 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f7bceec594 🚀 2023-06-15 14:53:38 +00:00
tr7zw 2c7d14e448 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c377927ee6 🚀 2023-06-07 18:29:52 +00:00
tr7zw 8fdf10207b Deploying to gh-pages from @ tr7zw/Item-NBT-API@0653f47bc1 🚀 2023-06-07 18:26:06 +00:00
tr7zw 04dd24ba07 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5588fc60b4 🚀 2023-05-23 08:11:17 +00:00
tr7zw 42a9e31532 Deploying to gh-pages from @ tr7zw/Item-NBT-API@45dd70afad 🚀 2023-05-10 19:52:16 +00:00
tr7zw 74ba9fcc15 Deploying to gh-pages from @ tr7zw/Item-NBT-API@175065dac4 🚀 2023-05-07 22:18:36 +00:00
tr7zw d6fb2f494c Deploying to gh-pages from @ tr7zw/Item-NBT-API@91b1e64e85 🚀 2023-05-07 22:12:26 +00:00
tr7zw 3cc10ade03 Deploying to gh-pages from @ tr7zw/Item-NBT-API@243d17a71e 🚀 2023-05-07 21:54:43 +00:00
tr7zw f709d204d6 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f4bfca8ba8 🚀 2023-05-07 18:17:14 +00:00
tr7zw 740fc32332 Deploying to gh-pages from @ tr7zw/Item-NBT-API@37378b4ee1 🚀 2023-05-06 14:18:41 +00:00
tr7zw f9e71ef82d Deploying to gh-pages from @ tr7zw/Item-NBT-API@662c0bb92d 🚀 2023-05-06 14:17:46 +00:00
tr7zw 1ddc9955e6 Deploying to gh-pages from @ tr7zw/Item-NBT-API@5759b68d89 🚀 2023-05-06 13:53:04 +00:00
tr7zw 73adc850ad Deploying to gh-pages from @ tr7zw/Item-NBT-API@c22cbaaaf0 🚀 2023-05-06 13:52:57 +00:00
tr7zw bd9d71b8bf Deploying to gh-pages from @ tr7zw/Item-NBT-API@6f25881eda 🚀 2023-03-16 18:18:12 +00:00
tr7zw 9633a44785 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bd69504f54 🚀 2023-03-09 20:10:11 +00:00
tr7zw fda4eaf341 Deploying to gh-pages from @ tr7zw/Item-NBT-API@8dc51a3d30 🚀 2023-02-16 09:05:05 +00:00
tr7zw 2d4e5db3b9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@4a93fdc869 🚀 2023-02-15 21:09:03 +00:00
tr7zw cf8ae46b8a Deploying to gh-pages from @ tr7zw/Item-NBT-API@c905de852d 🚀 2023-01-31 11:18:52 +00:00
tr7zw 4e494b6457 Deploying to gh-pages from @ tr7zw/Item-NBT-API@1123e27b10 🚀 2023-01-31 10:44:44 +00:00
tr7zw 4368af872f Deploying to gh-pages from @ tr7zw/Item-NBT-API@05b4249bb4 🚀 2023-01-25 19:35:13 +00:00
tr7zw 021994ed1f Deploying to gh-pages from @ tr7zw/Item-NBT-API@e399590d1d 🚀 2023-01-25 19:34:43 +00:00
tr7zw 18082e610b Deploying to gh-pages from @ tr7zw/Item-NBT-API@310682ea25 🚀 2023-01-24 10:04:11 +00:00
tr7zw 2eed0e5591 Deploying to gh-pages from @ tr7zw/Item-NBT-API@79e1e62862 🚀 2023-01-03 22:54:39 +00:00
tr7zw 7645fbb4bb Deploying to gh-pages from @ tr7zw/Item-NBT-API@f648aca74b 🚀 2022-12-14 16:11:56 +00:00
tr7zw aee4f5f513 Deploying to gh-pages from @ tr7zw/Item-NBT-API@9e79a604d3 🚀 2022-12-14 16:00:09 +00:00
tr7zw 0e90dd17d7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@54d9ac614e 🚀 2022-12-11 18:52:13 +00:00
tr7zw d58480a8ed Deploying to gh-pages from @ tr7zw/Item-NBT-API@306812264f 🚀 2022-12-10 23:06:57 +00:00
tr7zw 850ddd852d Deploying to gh-pages from @ tr7zw/Item-NBT-API@38c42ed577 🚀 2022-12-07 20:51:10 +00:00
tr7zw 5026b5b887 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3c20b5db32 🚀 2022-12-01 19:03:36 +00:00
tr7zw d4b810bd75 Deploying to gh-pages from @ tr7zw/Item-NBT-API@f10ba986ba 🚀 2022-11-25 22:57:38 +00:00
tr7zw 4f06f53541 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c5c96e6d17 🚀 2022-11-24 19:02:43 +00:00
tr7zw 1493f32caa Deploying to gh-pages from @ tr7zw/Item-NBT-API@22ded53d31 🚀 2022-11-24 19:01:08 +00:00
tr7zw 136ec1d5fc Deploying to gh-pages from @ tr7zw/Item-NBT-API@49fd713c63 🚀 2022-11-10 22:47:36 +00:00
tr7zw 35bfd9cbf9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@58f2fda332 🚀 2022-11-10 22:41:45 +00:00
tr7zw 58804323ef Deploying to gh-pages from @ tr7zw/Item-NBT-API@c06f8f8145 🚀 2022-11-10 22:16:50 +00:00
tr7zw fa93851bec Deploying to gh-pages from @ tr7zw/Item-NBT-API@45504d09f0 🚀 2022-11-10 22:08:52 +00:00
tr7zw e584023026 Deploying to gh-pages from @ tr7zw/Item-NBT-API@88fb62677d 🚀 2022-11-10 18:31:37 +00:00
tr7zw 17e0349cdd Deploying to gh-pages from @ tr7zw/Item-NBT-API@9aad17aa0d 🚀 2022-11-10 16:30:09 +00:00
tr7zw 15128bb852 Deploying to gh-pages from @ tr7zw/Item-NBT-API@fc2c944bb7 🚀 2022-11-10 16:18:29 +00:00
tr7zw 27bfeb9c47 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c6f8f4163a 🚀 2022-11-10 15:13:50 +00:00
tr7zw bbdc9152ac Deploying to gh-pages from @ tr7zw/Item-NBT-API@c6f8f4163a 🚀 2022-11-10 15:13:48 +00:00
tr7zw eaa041d7b7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@793540f282 🚀 2022-11-09 19:30:35 +00:00
tr7zw fca9e78b1b Deploying to gh-pages from @ tr7zw/Item-NBT-API@793540f282 🚀 2022-11-09 19:30:33 +00:00
tr7zw e277c67629 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d30f984376 🚀 2022-11-07 00:56:48 +00:00
tr7zw cf9a983231 Deploying to gh-pages from @ tr7zw/Item-NBT-API@d30f984376 🚀 2022-11-07 00:56:47 +00:00
tr7zw 01066f990b Deploying to gh-pages from @ tr7zw/Item-NBT-API@3a987af139 🚀 2022-11-07 00:37:45 +00:00
tr7zw 6a68f7f219 Deploying to gh-pages from @ tr7zw/Item-NBT-API@3a987af139 🚀 2022-11-07 00:37:43 +00:00
tr7zw fe1605d944 Deploying to gh-pages from @ tr7zw/Item-NBT-API@783d4548ab 🚀 2022-10-27 23:37:22 +00:00
tr7zw 70b593e338 Deploying to gh-pages from @ tr7zw/Item-NBT-API@783d4548ab 🚀 2022-10-27 23:37:19 +00:00
tr7zw 1c8135f29a Deploying to gh-pages from @ tr7zw/Item-NBT-API@766d57a085 🚀 2022-10-11 18:16:57 +00:00
tr7zw 6c79f5ac7a Deploying to gh-pages from @ tr7zw/Item-NBT-API@766d57a085 🚀 2022-10-11 18:16:55 +00:00
tr7zw 12eda26763 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bf65c7ce68 🚀 2022-10-03 00:25:09 +00:00
tr7zw ebd6e44729 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bf65c7ce68 🚀 2022-10-03 00:25:07 +00:00
tr7zw bd6b3dc22b Deploying to gh-pages from @ tr7zw/Item-NBT-API@42f4af52bc 🚀 2022-10-03 00:23:54 +00:00
tr7zw 689c66f6a7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@42f4af52bc 🚀 2022-10-03 00:23:53 +00:00
tr7zw 654c0f4c31 Deploying to gh-pages from @ tr7zw/Item-NBT-API@8e8285b36d 🚀 2022-09-27 20:24:18 +00:00
tr7zw c80de011a0 Deploying to gh-pages from @ tr7zw/Item-NBT-API@8e8285b36d 🚀 2022-09-27 20:24:14 +00:00
tr7zw 2096cab041 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ca76df589b 🚀 2022-09-15 12:23:33 +00:00
tr7zw 4c7bf37103 Deploying to gh-pages from @ tr7zw/Item-NBT-API@ca76df589b 🚀 2022-09-15 12:23:32 +00:00
tr7zw 4bb5a7ebee Deploying to gh-pages from @ tr7zw/Item-NBT-API@9e6ae13711 🚀 2022-09-15 12:23:30 +00:00
tr7zw 91198208fd Deploying to gh-pages from @ tr7zw/Item-NBT-API@9e6ae13711 🚀 2022-09-15 12:23:28 +00:00
tr7zw 1ec52ec80a Deploying to gh-pages from @ tr7zw/Item-NBT-API@7263b5a12f 🚀 2022-09-04 14:52:42 +00:00
tr7zw 95e47e41bd Deploying to gh-pages from @ tr7zw/Item-NBT-API@7263b5a12f 🚀 2022-09-04 14:52:38 +00:00
tr7zw 5a855939e9 Deploying to gh-pages from @ tr7zw/Item-NBT-API@e500a443a1 🚀 2022-09-03 19:25:21 +00:00
tr7zw 87277ed801 Deploying to gh-pages from @ tr7zw/Item-NBT-API@e500a443a1 🚀 2022-09-03 19:25:18 +00:00
tr7zw 16fd0c3934 Deploying to gh-pages from @ tr7zw/Item-NBT-API@332f9e4b42 🚀 2022-09-03 19:15:08 +00:00
tr7zw ae4817ff86 Deploying to gh-pages from @ tr7zw/Item-NBT-API@332f9e4b42 🚀 2022-09-03 19:15:07 +00:00
tr7zw f65fdf8950 Deploying to gh-pages from @ tr7zw/Item-NBT-API@42e37f0838 🚀 2022-09-03 18:32:50 +00:00
tr7zw a9438a4e31 Deploying to gh-pages from @ tr7zw/Item-NBT-API@42e37f0838 🚀 2022-09-03 18:32:48 +00:00
tr7zw 0271807b5f Deploying to gh-pages from @ tr7zw/Item-NBT-API@efd22f2bd1 🚀 2022-09-03 18:31:02 +00:00
tr7zw 574efc59e8 Deploying to gh-pages from @ tr7zw/Item-NBT-API@efd22f2bd1 🚀 2022-09-03 18:31:00 +00:00
tr7zw fac549cb0a Deploying to gh-pages from @ tr7zw/Item-NBT-API@4dace8749d 🚀 2022-09-03 18:30:21 +00:00
tr7zw b3456026ca Deploying to gh-pages from @ tr7zw/Item-NBT-API@4dace8749d 🚀 2022-09-03 18:30:20 +00:00
tr7zw 9861724ee5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@82dbb4b7d1 🚀 2022-09-03 18:29:57 +00:00
tr7zw 9d62f6923b Deploying to gh-pages from @ tr7zw/Item-NBT-API@82dbb4b7d1 🚀 2022-09-03 18:29:56 +00:00
tr7zw 2a4d34ef62 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bb85fd092d 🚀 2022-09-03 18:17:17 +00:00
tr7zw ff7f234184 Deploying to gh-pages from @ tr7zw/Item-NBT-API@bb85fd092d 🚀 2022-09-03 18:17:15 +00:00
tr7zw cc40b199c5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c9d4ec6cc1 🚀 2022-09-03 18:06:47 +00:00
tr7zw b0bfe7cfc5 Deploying to gh-pages from @ tr7zw/Item-NBT-API@c9d4ec6cc1 🚀 2022-09-03 18:06:45 +00:00
tr7zw 4445488ab2 Deploying to gh-pages from @ tr7zw/Item-NBT-API@0a033f1fc9 🚀 2022-07-27 23:14:20 +00:00
tr7zw 883369db62 Deploying to gh-pages from @ tr7zw/Item-NBT-API@0a033f1fc9 🚀 2022-07-27 23:14:18 +00:00
tr7zw 58a7f1b853 Deploying to gh-pages from @ tr7zw/Item-NBT-API@0954eaa294 🚀 2022-07-27 22:31:59 +00:00
tr7zw 286062c2d7 Deploying to gh-pages from @ tr7zw/Item-NBT-API@0954eaa294 🚀 2022-07-27 22:31:57 +00:00
tr7zw 535243d424 Deploying to gh-pages from @ tr7zw/Item-NBT-API@1b7465b990 🚀 2022-07-27 22:29:48 +00:00
tr7zw 4694412eb3 Deploying to gh-pages from @ tr7zw/Item-NBT-API@1b7465b990 🚀 2022-07-27 22:29:46 +00:00
tr7zw 931a811064 Deploying to gh-pages from @ tr7zw/Item-NBT-API@854524062e 🚀 2022-07-27 22:26:22 +00:00
tr7zw 324aba64ee Deploying to gh-pages from @ tr7zw/Item-NBT-API@854524062e 🚀 2022-07-27 22:26:18 +00:00
tr7zw 0f6ee075eb Deploying to gh-pages from @ tr7zw/Item-NBT-API@4e498e3247 🚀 2022-07-27 21:42:20 +00:00
tr7zw cacfaece2c Deploying to gh-pages from @ tr7zw/Item-NBT-API@4e498e3247 🚀 2022-07-27 21:42:18 +00:00
tr7zw 970fa482be Deploying to gh-pages from @ tr7zw/Item-NBT-API@54d3d4a83f 🚀 2022-06-26 21:38:59 +00:00
tr7zw 05b982d769 Deploying to gh-pages from @ tr7zw/Item-NBT-API@54d3d4a83f 🚀 2022-06-26 21:38:58 +00:00
tr7zw 57ef0ac41d Deploying to gh-pages from @ tr7zw/Item-NBT-API@7ae34cc78c 🚀 2022-06-26 21:37:28 +00:00
tr7zw c2ce0f49eb Deploying to gh-pages from @ tr7zw/Item-NBT-API@7ae34cc78c 🚀 2022-06-26 21:37:25 +00:00
tr7zw dc3ce01a7f Update index.html 2022-06-15 19:43:07 +02:00
tr7zw c2fef6a5da Remove other data, add redirect 2022-06-15 19:37:54 +02:00
tr7zw 8cacee954b Deploying to gh-pages from @ tr7zw/Item-NBT-API@80facd8d8b 🚀 2022-06-15 17:26:47 +00:00
tr7zw 669ac3eec0 Deploying to gh-pages from @ tr7zw/Item-NBT-API@80facd8d8b 🚀 2022-06-15 17:26:44 +00:00
tr7zw c5e4d21a00 Deploying to gh-pages from @ tr7zw/Item-NBT-API@8e4e674443 🚀 2022-06-15 17:17:24 +00:00
tr7zw 2e1574faab Deploying to gh-pages from @ 9d1448f96e 🚀 2022-06-15 17:08:08 +00:00
tr7zw c056b40b66 Initial gh-pages commit 2022-06-15 17:08:06 +00:00
617 changed files with 141181 additions and 7791 deletions

No files matched your search

-176
View File
@@ -1,176 +0,0 @@
{
"projectName": "Item-NBT-API",
"projectOwner": "tr7zw",
"imageSize": 100,
"contributorsPerLine": 7,
"repoHost": "https://github.com",
"types": {
"discord": {
"symbol": "🤝",
"description": "Discord help"
}
},
"contributors": [
{
"login": "sgdc3",
"name": "Gabriele C.",
"avatar_url": "https://avatars3.githubusercontent.com/u/8779252?s=460&v=4",
"profile": "https://github.com/sgdc3",
"contributions": [
"code",
"infra"
],
"links": {
"infra": "https://codemc.io/"
}
},
{
"login": "SoSeDiK",
"name": "SoSeDiK",
"avatar_url": "https://avatars0.githubusercontent.com/u/19875118?s=460&v=4",
"profile": "https://github.com/SoSeDiK",
"contributions": [
"code",
"userTesting"
],
"links": {
"userTesting": "https://github.com/SoSeDiK?tab=repositories"
}
},
{
"login": "e3ndr",
"name": "Ender",
"avatar_url": "https://avatars1.githubusercontent.com/u/33337309?s=460&v=4",
"profile": "https://github.com/e3ndr",
"contributions": [
"doc",
"discord"
],
"links": {
"doc": "https://github.com/tr7zw/Item-NBT-API/wiki"
}
},
{
"login": "inventivetalentdev",
"name": "Haylee Schäfer",
"avatar_url": "https://avatars3.githubusercontent.com/u/6525296?s=460&v=4",
"profile": "https://github.com/inventivetalentdev",
"contributions": [
"code",
"ideas"
],
"links": {
"code": "https://github.com/tr7zw/Item-NBT-API/tree/master/nbt-injector",
"ideas": "https://github.com/InventivetalentDev/NBTInjector"
}
},
{
"login": "SpiGet",
"name": "SpiGet",
"avatar_url": "https://avatars3.githubusercontent.com/u/15632072?s=200&v=4",
"profile": "https://spiget.org/",
"contributions": [
"plugin"
],
"links": {
"plugin": "https://github.com/tr7zw/Item-NBT-API/blob/master/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/VersionChecker.java"
}
},
{
"login": "bStats",
"name": "bStats",
"avatar_url": "https://avatars2.githubusercontent.com/u/5033001?s=460&v=4",
"profile": "https://github.com/Bastian/bStats",
"contributions": [
"plugin"
],
"links": {
"plugin": "https://bstats.org/plugin/bukkit/ItemNBTAPI/1058"
}
},
{
"login": "MrAxeTv",
"name": "MrAxeTv",
"avatar_url": "https://avatars0.githubusercontent.com/u/17033332?s=460&v=4",
"profile": "https://github.com/MrAxeTv",
"contributions": [
"financial",
"userTesting",
"discord"
],
"links": {
"financial": "https://tr7zw.dev/donate/",
"userTesting": "https://www.spigotmc.org/resources/beastwithdraw-multy-withdraw-plugin.13896/"
}
},
{
"login": "MrDienns",
"name": "Dennis van der Veeke",
"avatar_url": "https://avatars3.githubusercontent.com/u/15938901?s=460&v=4",
"profile": "https://github.com/MrDienns",
"contributions": [
"financial"
],
"links": {
"financial": "https://tr7zw.dev/donate/"
}
},
{
"login": "iGabyTM",
"name": "Gabriel Dumitru",
"avatar_url": "https://avatars2.githubusercontent.com/u/32105478?s=460&v=4",
"profile": "https://github.com/iGabyTM",
"contributions": [
"discord"
]
},
{
"login": "TauCubed",
"name": "TauCubed",
"avatar_url": "https://avatars0.githubusercontent.com/u/35522873?s=460&v=4",
"profile": "https://github.com/TauCubed",
"contributions": [
"discord"
]
},
{
"login": "LoneDev",
"name": "LoneDev",
"avatar_url": "https://www.spigotmc.org/data/avatars/l/88/88296.jpg?1563463602",
"profile": "https://www.spigotmc.org/members/lonedev.88296",
"contributions": [
"code",
"ideas",
"financial"
],
"links": {
"ideas": "https://www.spigotmc.org/threads/nbt-api.70503/page-7#post-3652832",
"financial": "https://tr7zw.dev/donate/"
}
},
{
"login": "GC.",
"name": "GC.",
"avatar_url": "https://www.spigotmc.org/data/avatars/l/25/25090.jpg?1502396477",
"profile": "https://www.spigotmc.org/members/gc.25090",
"contributions": [
"financial"
],
"links": {
"financial": "https://tr7zw.dev/donate/"
}
},
{
"login": "Peaches_MLG",
"name": "Peaches_MLG",
"avatar_url": "https://www.spigotmc.org/data/avatars/l/194/194338.jpg?1561235996",
"profile": "https://www.spigotmc.org/members/peaches_mlg100.194338/",
"contributions": [
"financial"
],
"links": {
"financial": "https://tr7zw.dev/donate/"
}
}
]
}
-4
View File
@@ -1,4 +0,0 @@
# These are supported funding model platforms
patreon: tr7zw
custom: https://tr7zw.dev/donate/
-17
View File
@@ -1,17 +0,0 @@
name: Java CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn --file pom.xml
-104
View File
@@ -1,104 +0,0 @@
### Java files ###
*.class
# Package Files
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
# Ignore project files
*.iml
# Ignore IDEA directory
.idea/*
# File-based project format:
*.ipr
*.iws
### Plugin-specific files: ###
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Eclipse ###
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/
### Git ###
# Don't exclude the .gitignore itself
!.gitignore
View File
Whitespace-only changes.
-6
View File
@@ -1,6 +0,0 @@
language: java
addons:
sonarcloud:
organization: "tr7zw-github"
script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar
-22
View File
@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2020 tr7zw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-54
View File
@@ -1,54 +0,0 @@
# Item-NBT-API
Add custom NBT tags to Items/Tiles/Entities without NMS! Modify NBT and store it Files, other NBT or as String in yaml/json/SQL/Redis.
[Server Owner/Developer Wiki](https://github.com/tr7zw/Item-NBT-API/wiki)
### Build/Maven/Sonar Status
[![Build Status](https://ci.codemc.org/buildStatus/icon?job=Tr7zw%2FItem-NBT-API)](https://ci.codemc.org/job/Tr7zw/job/Item-NBT-API/)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=alert_status)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=ncloc)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)
[![Discord](https://img.shields.io/discord/342814924310970398?color=%237289DA&label=Discord&logo=discord&logoColor=white)](https://discordapp.com/invite/yk4caxM)
[![Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dtr7zw%26type%3Dpatrons&style=for-the-badge)](https://www.patreon.com/tr7zw)
### SpigotMC Status
[![Version](https://badges.spiget.org/resources/version/Version-yellow-7939.svg)](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/)[![Rating](https://badges.spiget.org/resources/rating/Rating-yellow-7939.svg)](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/)[![Rating](https://badges.spiget.org/resources/downloads/SpigotDownloads-yellow-7939.svg)](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/)[![bStats Servers](https://img.shields.io/bstats/servers/1058.svg?color=green&label=OnlineServers&style=plastic)](https://bstats.org/plugin/bukkit/ItemNBTAPI)[![bStats Players](https://img.shields.io/bstats/players/1058.svg?color=green&label=OnlinePlayers&style=plastic)](https://bstats.org/plugin/bukkit/ItemNBTAPI)[![All Contributors](https://img.shields.io/badge/all_contributors-13-green.svg?style=plastic)](#contributors-%e2%9c%a8)
## Getting started
Import the API [using Maven](https://github.com/tr7zw/Item-NBT-API/wiki/Using-Maven), then check out the [basic usage](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API) or code examples like [working with Skulls](https://github.com/tr7zw/Item-NBT-API/wiki/Set-a-skull's-skin-using-NBT-API).
### bStats
[![bStats Stats](https://bstats.org/signatures/bukkit/ItemNBTAPI.svg)](https://bstats.org/plugin/bukkit/ItemNBTAPI)
### Github Stargazers
<img src="https://starchart.cc/tr7zw/Item-NBT-API.svg" alt="stargazers" width="800"/>
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/sgdc3"><img src="https://avatars3.githubusercontent.com/u/8779252?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Gabriele C.</b></sub></a><br /><a href="https://github.com/tr7zw/Item-NBT-API/commits?author=sgdc3" title="Code">💻</a> <a href="https://codemc.io/" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center"><a href="https://github.com/SoSeDiK"><img src="https://avatars0.githubusercontent.com/u/19875118?s=460&v=4" width="100px;" alt=""/><br /><sub><b>SoSeDiK</b></sub></a><br /><a href="https://github.com/tr7zw/Item-NBT-API/commits?author=SoSeDiK" title="Code">💻</a> <a href="https://github.com/SoSeDiK?tab=repositories" title="User Testing">📓</a></td>
<td align="center"><a href="https://github.com/e3ndr"><img src="https://avatars1.githubusercontent.com/u/33337309?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Ender</b></sub></a><br /><a href="https://github.com/tr7zw/Item-NBT-API/wiki" title="Documentation">📖</a> <a href="#discord-e3ndr" title="Discord help">🤝</a></td>
<td align="center"><a href="https://github.com/inventivetalentdev"><img src="https://avatars3.githubusercontent.com/u/6525296?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Haylee Schäfer</b></sub></a><br /><a href="https://github.com/tr7zw/Item-NBT-API/tree/master/nbt-injector" title="Code">💻</a> <a href="https://github.com/InventivetalentDev/NBTInjector" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://spiget.org/"><img src="https://avatars3.githubusercontent.com/u/15632072?s=200&v=4" width="100px;" alt=""/><br /><sub><b>SpiGet</b></sub></a><br /><a href="https://github.com/tr7zw/Item-NBT-API/blob/master/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/VersionChecker.java" title="Plugin/utility libraries">🔌</a></td>
<td align="center"><a href="https://github.com/Bastian/bStats"><img src="https://avatars2.githubusercontent.com/u/5033001?s=460&v=4" width="100px;" alt=""/><br /><sub><b>bStats</b></sub></a><br /><a href="https://bstats.org/plugin/bukkit/ItemNBTAPI/1058" title="Plugin/utility libraries">🔌</a></td>
<td align="center"><a href="https://github.com/MrAxeTv"><img src="https://avatars0.githubusercontent.com/u/17033332?s=460&v=4" width="100px;" alt=""/><br /><sub><b>MrAxeTv</b></sub></a><br /><a href="https://tr7zw.dev/donate/" title="Financial Support">💵</a> <a href="https://www.spigotmc.org/resources/beastwithdraw-multy-withdraw-plugin.13896/" title="User Testing">📓</a> <a href="#discord-MrAxeTv" title="Discord help">🤝</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/MrDienns"><img src="https://avatars3.githubusercontent.com/u/15938901?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Dennis van der Veeke</b></sub></a><br /><a href="https://tr7zw.dev/donate/" title="Financial Support">💵</a></td>
<td align="center"><a href="https://github.com/iGabyTM"><img src="https://avatars2.githubusercontent.com/u/32105478?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Gabriel Dumitru</b></sub></a><br /><a href="#discord-iGabyTM" title="Discord help">🤝</a></td>
<td align="center"><a href="https://github.com/TauCubed"><img src="https://avatars0.githubusercontent.com/u/35522873?s=460&v=4" width="100px;" alt=""/><br /><sub><b>TauCubed</b></sub></a><br /><a href="#discord-TauCubed" title="Discord help">🤝</a></td>
<td align="center"><a href="https://www.spigotmc.org/members/lonedev.88296"><img src="https://www.spigotmc.org/data/avatars/l/88/88296.jpg?1563463602" width="100px;" alt=""/><br /><sub><b>LoneDev</b></sub></a><br /><a href="https://github.com/tr7zw/Item-NBT-API/commits?author=LoneDev" title="Code">💻</a> <a href="https://www.spigotmc.org/threads/nbt-api.70503/page-7#post-3652832" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://tr7zw.dev/donate/" title="Financial Support">💵</a></td>
<td align="center"><a href="https://www.spigotmc.org/members/gc.25090"><img src="https://www.spigotmc.org/data/avatars/l/25/25090.jpg?1502396477" width="100px;" alt=""/><br /><sub><b>GC.</b></sub></a><br /><a href="https://tr7zw.dev/donate/" title="Financial Support">💵</a></td>
<td align="center"><a href="https://www.spigotmc.org/members/peaches_mlg100.194338/"><img src="https://www.spigotmc.org/data/avatars/l/194/194338.jpg?1561235996" width="100px;" alt=""/><br /><sub><b>Peaches_MLG</b></sub></a><br /><a href="https://tr7zw.dev/donate/" title="Financial Support">💵</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://allcontributors.org) specification.
Contributions of any kind are welcome! Shoot me a message or pullrequest to be added!
-17
View File
@@ -1,17 +0,0 @@
# (Item)-NBT-API
Add custom NBT tags to Items/Tiles/Entities without NMS! Modify NBT and store it Files, other NBT or as String in yaml/json/SQL/Redis.
[Server Owner/Developer Wiki](https://github.com/tr7zw/Item-NBT-API/wiki)
### Build/Maven/Sonar Status
[![Build Status](https://github.com/tr7zw/Item-NBT-API/workflows/Java%20CI/badge.svg)](https://ci.codemc.org/job/Tr7zw/job/Item-NBT-API/)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=alert_status)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=ncloc)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)[![](https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent)
Discord:[![Discord](https://img.shields.io/discord/342814924310970398?color=%237289DA&label=Discord&logo=discord&logoColor=white)](https://discordapp.com/invite/yk4caxM)
[![Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dtr7zw%26type%3Dpatrons&style=for-the-badge)](https://www.patreon.com/tr7zw)
### SpigotMC Status
[![Version](https://badges.spiget.org/resources/version/Version-yellow-7939.svg)](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/)[![Rating](https://badges.spiget.org/resources/rating/Rating-yellow-7939.svg)](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/)[![Rating](https://badges.spiget.org/resources/downloads/SpigotDownloads-yellow-7939.svg)](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/)[![bStats Servers](https://img.shields.io/bstats/servers/1058.svg?color=green&label=OnlineServers&style=plastic)](https://bstats.org/plugin/bukkit/ItemNBTAPI)[![bStats Players](https://img.shields.io/bstats/players/1058.svg?color=green&label=OnlinePlayers&style=plastic)](https://bstats.org/plugin/bukkit/ItemNBTAPI)
## Getting started
Import the API [using Maven](https://github.com/tr7zw/Item-NBT-API/wiki/Using-Maven), then check out the [basic usage](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API) or code examples like [working with Skulls](https://github.com/tr7zw/Item-NBT-API/wiki/Set-a-skull's-skin-using-NBT-API).
### bStats
[![bStats Stats](https://bstats.org/signatures/bukkit/ItemNBTAPI.svg)](https://bstats.org/plugin/bukkit/ItemNBTAPI)
+9
View File
@@ -0,0 +1,9 @@
<meta property="og:type" content="website">
<meta property="og:url" content="https://tr7zw.github.io/project/nbtapi/">
<meta property="og:title" content="NBTAPI">
<meta property="og:description" content="Add custom NBT tags to Items/Tiles/Entities without NMS!">
<meta property="og:image" content="https://tr7zw.github.io/images/nbtapi-logo.png">
<meta http-equiv="Refresh" content="0; url='https://tr7zw.github.io/project/nbtapi/'" />
<script>
window.location.href = "https://tr7zw.github.io/project/nbtapi/";
</script>
-22
View File
@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 tr7zw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-60
View File
@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>${nbt.version}</version>
</parent>
<artifactId>item-nbt-api</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>functional-annotations</artifactId>
<version>0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean install javadoc:javadoc</defaultGoal>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>de.tr7zw.annotations</pattern>
<shadedPattern>de.tr7zw.changeme.nbtapi.utils.annotations</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,26 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import org.bukkit.block.Block;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
public class NBTBlock {
private final Block block;
private final NBTChunk nbtChunk;
public NBTBlock(Block block) {
this.block = block;
if(!MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_16_R3)) {
throw new NbtApiException("NBTBlock is only working for 1.16.4+!");
}
nbtChunk = new NBTChunk(block.getChunk());
}
public NBTCompound getData() {
return nbtChunk.getPersistentDataContainer().getOrCreateCompound("blocks").getOrCreateCompound(block.getX() + "_" + block.getY() + "_" + block.getZ());
}
}
@@ -1,30 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import org.bukkit.Chunk;
import de.tr7zw.annotations.FAUtil;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.annotations.AvaliableSince;
import de.tr7zw.changeme.nbtapi.utils.annotations.CheckUtil;
public class NBTChunk {
private final Chunk chunk;
public NBTChunk(Chunk chunk) {
this.chunk = chunk;
}
/**
* Gets the NBTCompound used by spigots PersistentDataAPI. This method is only
* available for 1.16.4+!
*
* @return NBTCompound containing the data of the PersistentDataAPI
*/
@AvaliableSince(version = MinecraftVersion.MC1_16_R3)
public NBTCompound getPersistentDataContainer() {
FAUtil.check(this::getPersistentDataContainer, CheckUtil::isAvaliable);
return new NBTPersistentDataContainer(chunk.getPersistentDataContainer());
}
}
@@ -1,839 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.bukkit.inventory.ItemStack;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Base class representing NMS Compounds. For a standalone implementation check
* {@link NBTContainer}
*
* @author tr7zw
*
*/
public class NBTCompound {
private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
private final Lock readLock = readWriteLock.readLock();
private final Lock writeLock = readWriteLock.writeLock();
private String compundName;
private NBTCompound parent;
protected NBTCompound(NBTCompound owner, String name) {
this.compundName = name;
this.parent = owner;
}
protected Lock getReadLock() {
return readLock;
}
protected Lock getWriteLock() {
return writeLock;
}
protected void saveCompound() {
if (parent != null)
parent.saveCompound();
}
/**
* @return The Compound name
*/
public String getName() {
return compundName;
}
/**
* @return The NMS Compound behind this Object
*/
public Object getCompound() {
return parent.getCompound();
}
protected void setCompound(Object compound) {
parent.setCompound(compound);
}
/**
* @return The parent Compound
*/
public NBTCompound getParent() {
return parent;
}
/**
* Merges all data from comp into this compound. This is done in one action, so
* it also works with Tiles/Entities
*
* @param comp
*/
public void mergeCompound(NBTCompound comp) {
try {
writeLock.lock();
NBTReflectionUtil.mergeOtherNBTCompound(this, comp);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setString(String key, String value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_STRING, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public String getString(String key) {
try {
readLock.lock();
return (String) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_STRING, key);
} finally {
readLock.unlock();
}
}
protected String getContent(String key) {
return NBTReflectionUtil.getContent(this, key);
}
/**
* Setter
*
* @param key
* @param value
*/
public void setInteger(String key, Integer value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_INT, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Integer getInteger(String key) {
try {
readLock.lock();
return (Integer) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_INT, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setDouble(String key, Double value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_DOUBLE, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Double getDouble(String key) {
try {
readLock.lock();
return (Double) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_DOUBLE, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setByte(String key, Byte value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_BYTE, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Byte getByte(String key) {
try {
readLock.lock();
return (Byte) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_BYTE, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setShort(String key, Short value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_SHORT, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Short getShort(String key) {
try {
readLock.lock();
return (Short) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_SHORT, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setLong(String key, Long value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_LONG, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Long getLong(String key) {
try {
readLock.lock();
return (Long) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_LONG, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setFloat(String key, Float value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_FLOAT, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Float getFloat(String key) {
try {
readLock.lock();
return (Float) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_FLOAT, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setByteArray(String key, byte[] value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_BYTEARRAY, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public byte[] getByteArray(String key) {
try {
readLock.lock();
return (byte[]) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_BYTEARRAY, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setIntArray(String key, int[] value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_INTARRAY, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public int[] getIntArray(String key) {
try {
readLock.lock();
return (int[]) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_INTARRAY, key);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setBoolean(String key, Boolean value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_BOOLEAN, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
protected void set(String key, Object val) {
NBTReflectionUtil.set(this, key, val);
saveCompound();
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public Boolean getBoolean(String key) {
try {
readLock.lock();
return (Boolean) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_BOOLEAN, key);
} finally {
readLock.unlock();
}
}
/**
* Uses Gson to store an {@link Serializable} Object
*
* @param key
* @param value
*/
public void setObject(String key, Object value) {
try {
writeLock.lock();
NBTReflectionUtil.setObject(this, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Uses Gson to retrieve a stored Object
*
* @param key
* @param type Class of the Object
* @return The created Object or null if empty
*/
public <T> T getObject(String key, Class<T> type) {
try {
readLock.lock();
return NBTReflectionUtil.getObject(this, key, type);
} finally {
readLock.unlock();
}
}
/**
* Save an ItemStack as a compound under a given key
*
* @param key
* @param item
*/
public void setItemStack(String key, ItemStack item) {
try {
writeLock.lock();
removeKey(key);
addCompound(key).mergeCompound(NBTItem.convertItemtoNBT(item));
} finally {
writeLock.unlock();
}
}
/**
* Get an ItemStack that was saved at the given key
*
* @param key
* @return
*/
public ItemStack getItemStack(String key) {
try {
readLock.lock();
NBTCompound comp = getCompound(key);
return NBTItem.convertNBTtoItem(comp);
} finally {
readLock.unlock();
}
}
/**
* Setter
*
* @param key
* @param value
*/
public void setUUID(String key, UUID value) {
try {
writeLock.lock();
NBTReflectionUtil.setData(this, ReflectionMethod.COMPOUND_SET_UUID, key, value);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* Getter
*
* @param key
* @return The stored value or NMS fallback
*/
public UUID getUUID(String key) {
try {
readLock.lock();
return (UUID) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_UUID, key);
} finally {
readLock.unlock();
}
}
/**
* @param key
* @return True if the key is set
*/
public Boolean hasKey(String key) {
try {
readLock.lock();
Boolean b = (Boolean) NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_HAS_KEY, key);
if (b == null)
return false;
return b;
} finally {
readLock.unlock();
}
}
/**
* @param key Deletes the given Key
*/
public void removeKey(String key) {
try {
writeLock.lock();
NBTReflectionUtil.remove(this, key);
saveCompound();
} finally {
writeLock.unlock();
}
}
/**
* @return Set of all stored Keys
*/
public Set<String> getKeys() {
try {
readLock.lock();
return NBTReflectionUtil.getKeys(this);
} finally {
readLock.unlock();
}
}
/**
* Creates a subCompound, or returns it if already provided
*
* @param name Key to use
* @return The subCompound Object
*/
public NBTCompound addCompound(String name) {
try {
writeLock.lock();
if (getType(name) == NBTType.NBTTagCompound)
return getCompound(name);
NBTReflectionUtil.addNBTTagCompound(this, name);
NBTCompound comp = getCompound(name);
if (comp == null)
throw new NbtApiException("Error while adding Compound, got null!");
saveCompound();
return comp;
} finally {
writeLock.unlock();
}
}
/**
* @param name
* @return The Compound instance or null
*/
public NBTCompound getCompound(String name) {
try {
readLock.lock();
if (getType(name) != NBTType.NBTTagCompound)
return null;
NBTCompound next = new NBTCompound(this, name);
if (NBTReflectionUtil.valideCompound(next))
return next;
return null;
} finally {
readLock.unlock();
}
}
/**
* The same as addCompound, just with a name that better reflects what it does
*
* @param name
* @return
*/
public NBTCompound getOrCreateCompound(String name) {
return addCompound(name);
}
/**
* @param name
* @return The retrieved String List
*/
public NBTList<String> getStringList(String name) {
try {
writeLock.lock();
NBTList<String> list = NBTReflectionUtil.getList(this, name, NBTType.NBTTagString, String.class);
saveCompound();
return list;
} finally {
writeLock.unlock();
}
}
/**
* @param name
* @return The retrieved Integer List
*/
public NBTList<Integer> getIntegerList(String name) {
try {
writeLock.lock();
NBTList<Integer> list = NBTReflectionUtil.getList(this, name, NBTType.NBTTagInt, Integer.class);
saveCompound();
return list;
} finally {
writeLock.unlock();
}
}
/**
* @param name
* @return The retrieved Float List
*/
public NBTList<Float> getFloatList(String name) {
try {
writeLock.lock();
NBTList<Float> list = NBTReflectionUtil.getList(this, name, NBTType.NBTTagFloat, Float.class);
saveCompound();
return list;
} finally {
writeLock.unlock();
}
}
/**
* @param name
* @return The retrieved Double List
*/
public NBTList<Double> getDoubleList(String name) {
try {
writeLock.lock();
NBTList<Double> list = NBTReflectionUtil.getList(this, name, NBTType.NBTTagDouble, Double.class);
saveCompound();
return list;
} finally {
writeLock.unlock();
}
}
/**
* @param name
* @return The retrieved Long List
*/
public NBTList<Long> getLongList(String name) {
try {
writeLock.lock();
NBTList<Long> list = NBTReflectionUtil.getList(this, name, NBTType.NBTTagLong, Long.class);
saveCompound();
return list;
} finally {
writeLock.unlock();
}
}
/**
* Returns the type of the list, null if not a list
*
* @param name
* @return
*/
public NBTType getListType(String name) {
try {
readLock.lock();
if (getType(name) != NBTType.NBTTagList)
return null;
return NBTReflectionUtil.getListType(this, name);
} finally {
readLock.unlock();
}
}
/**
* @param name
* @return The retrieved Compound List
*/
public NBTCompoundList getCompoundList(String name) {
try {
writeLock.lock();
NBTCompoundList list = (NBTCompoundList) NBTReflectionUtil.getList(this, name, NBTType.NBTTagCompound,
NBTListCompound.class);
saveCompound();
return list;
} finally {
writeLock.unlock();
}
}
/**
* @param name
* @return The type of the given stored key or null
*/
public NBTType getType(String name) {
try {
readLock.lock();
if (MinecraftVersion.getVersion() == MinecraftVersion.MC1_7_R4) {
Object nbtbase = NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET, name);
if(nbtbase == null)
return null;
return NBTType.valueOf((byte)ReflectionMethod.COMPOUND_OWN_TYPE.run(nbtbase));
}
Object o = NBTReflectionUtil.getData(this, ReflectionMethod.COMPOUND_GET_TYPE, name);
if (o == null)
return null;
return NBTType.valueOf((byte) o);
} finally {
readLock.unlock();
}
}
public void writeCompound(OutputStream stream) {
try {
writeLock.lock();
NBTReflectionUtil.writeApiNBT(this, stream);
} finally {
writeLock.unlock();
}
}
@Override
public String toString() {
/*
* StringBuilder result = new StringBuilder(); for (String key : getKeys()) {
* result.append(toString(key)); } return result.toString();
*/
return asNBTString();
}
/**
* @deprecated Just use toString()
* @param key
* @return A string representation of the given key
*/
@Deprecated
public String toString(String key) {
/*
* StringBuilder result = new StringBuilder(); NBTCompound compound = this;
* while (compound.getParent() != null) { result.append(" "); compound =
* compound.getParent(); } if (this.getType(key) == NBTType.NBTTagCompound) {
* return this.getCompound(key).toString(); } else { return result + "-" + key +
* ": " + getContent(key) + System.lineSeparator(); }
*/
return asNBTString();
}
/**
* @deprecated Just use toString()
* @return A {@link String} representation of the NBT in Mojang JSON. This is different from normal JSON!
*/
@Deprecated
public String asNBTString() {
try {
readLock.lock();
Object comp = NBTReflectionUtil.gettoCompount(getCompound(), this);
if (comp == null)
return "{}";
return comp.toString();
} finally {
readLock.unlock();
}
}
@Override
public int hashCode() {
return toString().hashCode();
}
/**
* Does a deep compare to check if everything is the same
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if(obj instanceof NBTCompound) {
NBTCompound other = (NBTCompound) obj;
if(getKeys().equals(other.getKeys())) {
for(String key : getKeys()) {
if(!isEqual(this, other, key)) {
return false;
}
return true;
}
}
}
return false;
}
protected static boolean isEqual(NBTCompound compA, NBTCompound compB, String key) {
if(compA.getType(key) != compB.getType(key))return false;
switch(compA.getType(key)) {
case NBTTagByte:
return compA.getByte(key).equals(compB.getByte(key));
case NBTTagByteArray:
return Arrays.equals(compA.getByteArray(key), compB.getByteArray(key));
case NBTTagCompound:
return compA.getCompound(key).equals(compB.getCompound(key));
case NBTTagDouble:
return compA.getDouble(key).equals(compB.getDouble(key));
case NBTTagEnd:
return true; //??
case NBTTagFloat:
return compA.getFloat(key).equals(compB.getFloat(key));
case NBTTagInt:
return compA.getInteger(key).equals(compB.getInteger(key));
case NBTTagIntArray:
return Arrays.equals(compA.getIntArray(key), compB.getIntArray(key));
case NBTTagList:
return NBTReflectionUtil.getEntry(compA, key).toString().equals(NBTReflectionUtil.getEntry(compB, key).toString()); // Just string compare the 2 lists
case NBTTagLong:
return compA.getLong(key).equals(compB.getLong(key));
case NBTTagShort:
return compA.getShort(key).equals(compB.getShort(key));
case NBTTagString:
return compA.getString(key).equals(compB.getString(key));
}
return false;
}
}
@@ -1,108 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import org.apache.commons.lang.NotImplementedException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* {@link NBTListCompound} implementation for NBTLists
*
* @author tr7zw
*
*/
public class NBTCompoundList extends NBTList<NBTListCompound> {
protected NBTCompoundList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
/**
* Adds a new Compound to the end of the List and returns it.
*
* @return The added {@link NBTListCompound}
*/
public NBTListCompound addCompound() {
return (NBTListCompound) addCompound(null);
}
/**
* Adds a copy of the Compound to the end of the List and returns it.
* When null is given, a new Compound will be created
*
* @param comp
* @return
*/
public NBTCompound addCompound(NBTCompound comp) {
try {
Object compound = ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance();
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_14_R1.getVersionId()) {
ReflectionMethod.LIST_ADD.run(listObject, size(), compound);
} else {
ReflectionMethod.LEGACY_LIST_ADD.run(listObject, compound);
}
getParent().saveCompound();
NBTListCompound listcomp = new NBTListCompound(this, compound);
if(comp != null){
listcomp.mergeCompound(comp);
}
return listcomp;
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
/**
* Adds a new Compound to the end of the List.
*
*
* @deprecated Please use addCompound!
* @param empty
* @return True, if compound was added
*/
@Override
@Deprecated
public boolean add(NBTListCompound empty) {
return addCompound(empty) != null;
}
@Override
public void add(int index, NBTListCompound element) {
if (element != null) {
throw new NotImplementedException("You need to pass null! ListCompounds from other lists won't work.");
}
try {
Object compound = ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance();
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_14_R1.getVersionId()) {
ReflectionMethod.LIST_ADD.run(listObject, index, compound);
} else {
ReflectionMethod.LEGACY_LIST_ADD.run(listObject, compound);
}
super.getParent().saveCompound();
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
@Override
public NBTListCompound get(int index) {
try {
Object compound = ReflectionMethod.LIST_GET_COMPOUND.run(listObject, index);
return new NBTListCompound(this, compound);
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
@Override
public NBTListCompound set(int index, NBTListCompound element) {
throw new NotImplementedException("This method doesn't work in the ListCompound context.");
}
@Override
protected Object asTag(NBTListCompound object) {
return null;
}
}
@@ -1,82 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.io.InputStream;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ObjectCreator;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* A Standalone {@link NBTCompound} implementation. All data is just kept inside
* this Object.
*
* @author tr7zw
*
*/
public class NBTContainer extends NBTCompound {
private Object nbt;
/**
* Creates an empty, standalone NBTCompound
*/
public NBTContainer() {
super(null, null);
nbt = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
/**
* Takes in any NMS Compound to wrap it
*
* @param nbt
*/
public NBTContainer(Object nbt) {
super(null, null);
if (nbt == null) {
throw new NullPointerException("The NBT-Object can't be null!");
}
if (!ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().isAssignableFrom(nbt.getClass())) {
throw new NbtApiException("The object '" + nbt.getClass() + "' is not a valid NBT-Object!");
}
this.nbt = nbt;
}
/**
* Reads in a NBT InputStream
*
* @param inputsteam
*/
public NBTContainer(InputStream inputsteam) {
super(null, null);
this.nbt = NBTReflectionUtil.readNBT(inputsteam);
}
/**
* Parses in a NBT String to a standalone {@link NBTCompound}. Can throw a
* {@link NbtApiException} in case something goes wrong.
*
* @param nbtString
*/
public NBTContainer(String nbtString) {
super(null, null);
if (nbtString == null) {
throw new NullPointerException("The String can't be null!");
}
try {
nbt = ReflectionMethod.PARSE_NBT.run(null, nbtString);
} catch (Exception ex) {
throw new NbtApiException("Unable to parse Malformed Json!", ex);
}
}
@Override
public Object getCompound() {
return nbt;
}
@Override
public void setCompound(Object tag) {
nbt = tag;
}
}
@@ -1,45 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Double implementation for NBTLists
*
* @author tr7zw
*
*/
public class NBTDoubleList extends NBTList<Double> {
protected NBTDoubleList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
@Override
protected Object asTag(Double object) {
try {
Constructor<?> con = ClassWrapper.NMS_NBTTAGDOUBLE.getClazz().getDeclaredConstructor(double.class);
con.setAccessible(true);
return con.newInstance(object);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
throw new NbtApiException("Error while wrapping the Object " + object + " to it's NMS object!", e);
}
}
@Override
public Double get(int index) {
try {
Object obj = ReflectionMethod.LIST_GET.run(listObject, index);
return Double.valueOf(obj.toString());
} catch (NumberFormatException nf) {
return 0d;
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
}
@@ -1,55 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import org.bukkit.entity.Entity;
import de.tr7zw.annotations.FAUtil;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.annotations.AvaliableSince;
import de.tr7zw.changeme.nbtapi.utils.annotations.CheckUtil;
/**
* NBT class to access vanilla tags from Entities. Entities don't support custom
* tags. Use the NBTInjector for custom tags. Changes will be instantly applied
* to the Entity, use the merge method to do many things at once.
*
* @author tr7zw
*
*/
public class NBTEntity extends NBTCompound {
private final Entity ent;
/**
* @param entity Any valid Bukkit Entity
*/
public NBTEntity(Entity entity) {
super(null, null);
if (entity == null) {
throw new NullPointerException("Entity can't be null!");
}
ent = entity;
}
@Override
public Object getCompound() {
return NBTReflectionUtil.getEntityNBTTagCompound(NBTReflectionUtil.getNMSEntity(ent));
}
@Override
protected void setCompound(Object compound) {
NBTReflectionUtil.setEntityNBTTag(compound, NBTReflectionUtil.getNMSEntity(ent));
}
/**
* Gets the NBTCompound used by spigots PersistentDataAPI. This method is only
* available for 1.14+!
*
* @return NBTCompound containing the data of the PersistentDataAPI
*/
@AvaliableSince(version = MinecraftVersion.MC1_14_R1)
public NBTCompound getPersistentDataContainer() {
FAUtil.check(this::getPersistentDataContainer, CheckUtil::isAvaliable);
return new NBTPersistentDataContainer(ent.getPersistentDataContainer());
}
}
@@ -1,80 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ObjectCreator;
/**
* {@link NBTCompound} implementation backed by a {@link File}
*
* @author tr7zw
*
*/
public class NBTFile extends NBTCompound {
private final File file;
private Object nbt;
/**
* Creates a NBTFile that uses @param file to store it's data. If this file
* exists, the data will be loaded.
*
* @param file
* @throws IOException
*/
public NBTFile(File file) throws IOException {
super(null, null);
if (file == null) {
throw new NullPointerException("File can't be null!");
}
this.file = file;
if (file.exists()) {
FileInputStream inputsteam = new FileInputStream(file);
nbt = NBTReflectionUtil.readNBT(inputsteam);
} else {
nbt = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
save();
}
}
/**
* Saves the data to the file
*
* @throws IOException
*/
public void save() throws IOException {
try {
getWriteLock().lock();
if (!file.exists()) {
file.getParentFile().mkdirs();
if (!file.createNewFile())
throw new IOException("Unable to create file at " + file.getAbsolutePath());
}
FileOutputStream outStream = new FileOutputStream(file);
NBTReflectionUtil.writeNBT(nbt, outStream);
} finally {
getWriteLock().unlock();
}
}
/**
* @return The File used to store the data
*/
public File getFile() {
return file;
}
@Override
public Object getCompound() {
return nbt;
}
@Override
protected void setCompound(Object compound) {
nbt = compound;
}
}
@@ -1,45 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Float implementation for NBTLists
*
* @author tr7zw
*
*/
public class NBTFloatList extends NBTList<Float> {
protected NBTFloatList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
@Override
protected Object asTag(Float object) {
try {
Constructor<?> con = ClassWrapper.NMS_NBTTAGFLOAT.getClazz().getDeclaredConstructor(float.class);
con.setAccessible(true);
return con.newInstance(object);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
throw new NbtApiException("Error while wrapping the Object " + object + " to it's NMS object!", e);
}
}
@Override
public Float get(int index) {
try {
Object obj = ReflectionMethod.LIST_GET.run(listObject, index);
return Float.valueOf(obj.toString());
} catch (NumberFormatException nf) {
return 0f;
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
}
@@ -1,30 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import com.mojang.authlib.GameProfile;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ObjectCreator;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
public class NBTGameProfile {
/**
* Convert a GameProfile to NBT. The NBT then can be modified or be stored
*
* @param profile
* @return A NBTContainer with all the GameProfile data
*/
public static NBTCompound toNBT(GameProfile profile) {
return new NBTContainer(ReflectionMethod.GAMEPROFILE_SERIALIZE.run(null, ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance(), profile));
}
/**
* Reconstructs a GameProfile from a NBTCompound
*
* @param compound Has to contain GameProfile data
* @return The reconstructed GameProfile
*/
public static GameProfile fromNBT(NBTCompound compound) {
return (GameProfile) ReflectionMethod.GAMEPROFILE_DESERIALIZE.run(null, NBTReflectionUtil.gettoCompount(compound.getCompound(), compound));
}
}
@@ -1,45 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Integer implementation for NBTLists
*
* @author tr7zw
*
*/
public class NBTIntegerList extends NBTList<Integer> {
protected NBTIntegerList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
@Override
protected Object asTag(Integer object) {
try {
Constructor<?> con = ClassWrapper.NMS_NBTTAGINT.getClazz().getDeclaredConstructor(int.class);
con.setAccessible(true);
return con.newInstance(object);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
throw new NbtApiException("Error while wrapping the Object " + object + " to it's NMS object!", e);
}
}
@Override
public Integer get(int index) {
try {
Object obj = ReflectionMethod.LIST_GET.run(listObject, index);
return Integer.valueOf(obj.toString());
} catch (NumberFormatException nf) {
return 0;
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
}
@@ -1,165 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* NBT class to access vanilla/custom tags on ItemStacks. This class doesn't
* autosave to the Itemstack, use getItem to get the changed ItemStack
*
* @author tr7zw
*
*/
public class NBTItem extends NBTCompound {
private ItemStack bukkitItem;
private boolean directApply;
private ItemStack originalSrcStack = null;
/**
* Constructor for NBTItems. The ItemStack will be cloned!
*
* @param item
*/
public NBTItem(ItemStack item) {
this(item, false);
}
/**
* Constructor for NBTItems. The ItemStack will be cloned! If directApply is true,
* all changed will be mapped to the original item. Changes to the NBTItem will overwrite changes done
* to the original item in that case.
*
* @param item
* @param directApply
*/
public NBTItem(ItemStack item, boolean directApply) {
super(null, null);
if (item == null || item.getType() == Material.AIR) {
throw new NullPointerException("ItemStack can't be null/Air!");
}
this.directApply = directApply;
bukkitItem = item.clone();
if(directApply) {
this.originalSrcStack = item;
}
}
@Override
public Object getCompound() {
return NBTReflectionUtil.getItemRootNBTTagCompound(ReflectionMethod.ITEMSTACK_NMSCOPY.run(null, bukkitItem));
}
@Override
protected void setCompound(Object compound) {
Object stack = ReflectionMethod.ITEMSTACK_NMSCOPY.run(null, bukkitItem);
ReflectionMethod.ITEMSTACK_SET_TAG.run(stack, compound);
bukkitItem = (ItemStack) ReflectionMethod.ITEMSTACK_BUKKITMIRROR.run(null, stack);
}
/**
* Apply stored NBT tags to the provided ItemStack.
* <p>
* Note: This will completely override current item's {@link ItemMeta}.
* If you still want to keep the original item's NBT tags, see
* {@link #mergeNBT(ItemStack)} and {@link #mergeCustomNBT(ItemStack)}.
*
* @param item ItemStack that should get the new NBT data
*/
public void applyNBT(ItemStack item) {
if (item == null || item.getType() == Material.AIR) {
throw new NullPointerException("ItemStack can't be null/Air!");
}
NBTItem nbti = new NBTItem(new ItemStack(item.getType()));
nbti.mergeCompound(this);
item.setItemMeta(nbti.getItem().getItemMeta());
}
/**
* Merge all NBT tags to the provided ItemStack.
*
* @param item ItemStack that should get the new NBT data
*/
public void mergeNBT(ItemStack item) {
NBTItem nbti = new NBTItem(item);
nbti.mergeCompound(this);
item.setItemMeta(nbti.getItem().getItemMeta());
}
/**
* Merge only custom (non-vanilla) NBT tags to the provided ItemStack.
*
* @param item ItemStack that should get the new NBT data
*/
public void mergeCustomNBT(ItemStack item) {
if (item == null || item.getType() == Material.AIR) {
throw new NullPointerException("ItemStack can't be null/Air!");
}
ItemMeta meta = item.getItemMeta();
NBTReflectionUtil.getUnhandledNBTTags(meta).putAll(NBTReflectionUtil.getUnhandledNBTTags(bukkitItem.getItemMeta()));
item.setItemMeta(meta);
}
/**
* Remove all custom (non-vanilla) NBT tags from the NBTItem.
*/
public void clearCustomNBT() {
ItemMeta meta = bukkitItem.getItemMeta();
NBTReflectionUtil.getUnhandledNBTTags(meta).clear();
bukkitItem.setItemMeta(meta);
}
/**
* @return The modified ItemStack
*/
public ItemStack getItem() {
return bukkitItem;
}
protected void setItem(ItemStack item) {
bukkitItem = item;
}
/**
* This may return true even when the NBT is empty.
*
* @return Does the ItemStack have a NBTCompound.
*/
public boolean hasNBTData() {
return getCompound() != null;
}
/**
* Helper method that converts {@link ItemStack} to {@link NBTContainer} with
* all it's data like Material, Damage, Amount and Tags.
*
* @param item
* @return Standalone {@link NBTContainer} with the Item's data
*/
public static NBTContainer convertItemtoNBT(ItemStack item) {
return NBTReflectionUtil.convertNMSItemtoNBTCompound(ReflectionMethod.ITEMSTACK_NMSCOPY.run(null, item));
}
/**
* Helper method to do the inverse to "convertItemtoNBT". Creates an
* {@link ItemStack} using the {@link NBTCompound}
*
* @param comp
* @return ItemStack using the {@link NBTCompound}'s data
*/
public static ItemStack convertNBTtoItem(NBTCompound comp) {
return (ItemStack) ReflectionMethod.ITEMSTACK_BUKKITMIRROR.run(null,
NBTReflectionUtil.convertNBTCompoundtoNMSItem(comp));
}
@Override
protected void saveCompound() {
if(directApply) {
applyNBT(originalSrcStack);
}
}
}
@@ -1,429 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Abstract List implementation for ListCompounds
*
* @author tr7zw
*
* @param <T>
*/
public abstract class NBTList<T> implements List<T> {
private String listName;
private NBTCompound parent;
private NBTType type;
protected Object listObject;
protected NBTList(NBTCompound owner, String name, NBTType type, Object list) {
parent = owner;
listName = name;
this.type = type;
this.listObject = list;
}
/**
* @return Name of this list-compound
*/
public String getName() {
return listName;
}
/**
* @return The Compound's parent Object
*/
public NBTCompound getParent() {
return parent;
}
protected void save() {
parent.set(listName, listObject);
}
protected abstract Object asTag(T object);
@Override
public boolean add(T element) {
try {
parent.getWriteLock().lock();
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_14_R1.getVersionId()) {
ReflectionMethod.LIST_ADD.run(listObject, size(), asTag(element));
} else {
ReflectionMethod.LEGACY_LIST_ADD.run(listObject, asTag(element));
}
save();
return true;
} catch (Exception ex) {
throw new NbtApiException(ex);
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public void add(int index, T element) {
try {
parent.getWriteLock().lock();
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_14_R1.getVersionId()) {
ReflectionMethod.LIST_ADD.run(listObject, index, asTag(element));
} else {
ReflectionMethod.LEGACY_LIST_ADD.run(listObject, asTag(element));
}
save();
} catch (Exception ex) {
throw new NbtApiException(ex);
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public T set(int index, T element) {
try {
parent.getWriteLock().lock();
T prev = get(index);
ReflectionMethod.LIST_SET.run(listObject, index, asTag(element));
save();
return prev;
} catch (Exception ex) {
throw new NbtApiException(ex);
} finally {
parent.getWriteLock().unlock();
}
}
public T remove(int i) {
try {
parent.getWriteLock().lock();
T old = get(i);
ReflectionMethod.LIST_REMOVE_KEY.run(listObject, i);
save();
return old;
} catch (Exception ex) {
throw new NbtApiException(ex);
} finally {
parent.getWriteLock().unlock();
}
}
public int size() {
try {
parent.getReadLock().lock();
return (int) ReflectionMethod.LIST_SIZE.run(listObject);
} catch (Exception ex) {
throw new NbtApiException(ex);
} finally {
parent.getReadLock().unlock();
}
}
/**
* @return The type that this list contains
*/
public NBTType getType() {
return type;
}
@Override
public boolean isEmpty() {
return size() == 0;
}
@Override
public void clear() {
while (!isEmpty()) {
remove(0);
}
}
@Override
public boolean contains(Object o) {
try {
parent.getReadLock().lock();
for (int i = 0; i < size(); i++) {
if (o.equals(get(i)))
return true;
}
return false;
} finally {
parent.getReadLock().unlock();
}
}
@Override
public int indexOf(Object o) {
try {
parent.getReadLock().lock();
for (int i = 0; i < size(); i++) {
if (o.equals(get(i)))
return i;
}
return -1;
} finally {
parent.getReadLock().unlock();
}
}
@Override
public boolean addAll(Collection<? extends T> c) {
try {
parent.getWriteLock().lock();
int size = size();
for (T ele : c) {
add(ele);
}
return size != size();
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public boolean addAll(int index, Collection<? extends T> c) {
try {
parent.getWriteLock().lock();
int size = size();
for (T ele : c) {
add(index++, ele);
}
return size != size();
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public boolean containsAll(Collection<?> c) {
try {
parent.getReadLock().lock();
for (Object ele : c) {
if (!contains(ele))
return false;
}
return true;
} finally {
parent.getReadLock().unlock();
}
}
@Override
public int lastIndexOf(Object o) {
try {
parent.getReadLock().lock();
int index = -1;
for (int i = 0; i < size(); i++) {
if (o.equals(get(i)))
index = i;
}
return index;
} finally {
parent.getReadLock().unlock();
}
}
@Override
public boolean removeAll(Collection<?> c) {
try {
parent.getWriteLock().lock();
int size = size();
for (Object obj : c) {
remove(obj);
}
return size != size();
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public boolean retainAll(Collection<?> c) {
try {
parent.getWriteLock().lock();
int size = size();
for (Object obj : c) {
for (int i = 0; i < size(); i++) {
if (!obj.equals(get(i))) {
remove(i--);
}
}
}
return size != size();
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public boolean remove(Object o) {
try {
parent.getWriteLock().lock();
int size = size();
int id = -1;
while ((id = indexOf(o)) != -1) {
remove(id);
}
return size != size();
} finally {
parent.getWriteLock().unlock();
}
}
@Override
public Iterator<T> iterator() {
return new Iterator<T>() {
private int index = -1;
@Override
public boolean hasNext() {
return size() > index + 1;
}
@Override
public T next() {
if (!hasNext())
throw new NoSuchElementException();
return get(++index);
}
@Override
public void remove() {
NBTList.this.remove(index);
index--;
}
};
}
@Override
public ListIterator<T> listIterator() {
return listIterator(0);
}
@Override
public ListIterator<T> listIterator(int startIndex) {
final NBTList<T> list = this;
return new ListIterator<T>() {
int index = startIndex - 1;
@Override
public void add(T e) {
list.add(index, e);
}
@Override
public boolean hasNext() {
return size() > index + 1;
}
@Override
public boolean hasPrevious() {
return index >= 0 && index <= size();
}
@Override
public T next() {
if (!hasNext())
throw new NoSuchElementException();
return get(++index);
}
@Override
public int nextIndex() {
return index + 1;
}
@Override
public T previous() {
if (!hasPrevious())
throw new NoSuchElementException("Id: " + (index - 1));
return get(index--);
}
@Override
public int previousIndex() {
return index - 1;
}
@Override
public void remove() {
list.remove(index);
index--;
}
@Override
public void set(T e) {
list.set(index, e);
}
};
}
@Override
public Object[] toArray() {
try {
parent.getReadLock().lock();
Object[] ar = new Object[size()];
for (int i = 0; i < size(); i++)
ar[i] = get(i);
return ar;
} finally {
parent.getReadLock().unlock();
}
}
@SuppressWarnings("unchecked")
@Override
public <E> E[] toArray(E[] a) {
try {
parent.getReadLock().lock();
E[] ar = Arrays.copyOf(a, size());
Arrays.fill(ar, null);
Class<?> arrayclass = a.getClass().getComponentType();
for (int i = 0; i < size(); i++) {
T obj = get(i);
if (arrayclass.isInstance(obj)) {
ar[i] = (E) get(i);
} else {
throw new ArrayStoreException("The array does not match the objects stored in the List.");
}
}
return ar;
} finally {
parent.getReadLock().unlock();
}
}
@Override
public List<T> subList(int fromIndex, int toIndex) {
try {
parent.getReadLock().lock();
ArrayList<T> list = new ArrayList<>();
for (int i = fromIndex; i < toIndex; i++)
list.add(get(i));
return list;
} finally {
parent.getReadLock().unlock();
}
}
@Override
public String toString() {
try {
parent.getReadLock().lock();
return listObject.toString();
} finally {
parent.getReadLock().unlock();
}
}
}
@@ -1,42 +0,0 @@
package de.tr7zw.changeme.nbtapi;
/**
* Cut down version of the {@link NBTCompound} for inside
* {@link NBTCompoundList} This Compound implementation is missing the ability
* for further subCompounds and Lists. This class probably will change in the
* future
*
* @author tr7zw
*
*/
public class NBTListCompound extends NBTCompound {
private NBTList<?> owner;
private Object compound;
protected NBTListCompound(NBTList<?> parent, Object obj) {
super(null, null);
owner = parent;
compound = obj;
}
public NBTList<?> getListParent() {
return owner;
}
@Override
public Object getCompound() {
return compound;
}
@Override
protected void setCompound(Object compound) {
this.compound = compound;
}
@Override
protected void saveCompound() {
owner.save();
}
}
@@ -1,45 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Long implementation for NBTLists
*
* @author tr7zw
*
*/
public class NBTLongList extends NBTList<Long> {
protected NBTLongList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
@Override
protected Object asTag(Long object) {
try {
Constructor<?> con = ClassWrapper.NMS_NBTTAGLONG.getClazz().getDeclaredConstructor(long.class);
con.setAccessible(true);
return con.newInstance(object);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
throw new NbtApiException("Error while wrapping the Object " + object + " to it's NMS object!", e);
}
}
@Override
public Long get(int index) {
try {
Object obj = ReflectionMethod.LIST_GET.run(listObject, index);
return Long.valueOf(obj.toString().replace("L", ""));
} catch (NumberFormatException nf) {
return 0l;
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
}
@@ -1,31 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.util.Map;
import org.bukkit.persistence.PersistentDataContainer;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
public class NBTPersistentDataContainer extends NBTCompound {
private final PersistentDataContainer container;
protected NBTPersistentDataContainer(PersistentDataContainer container) {
super(null, null);
this.container = container;
}
@Override
public Object getCompound() {
return ReflectionMethod.CRAFT_PERSISTENT_DATA_CONTAINER_TO_TAG.run(container);
}
@Override
protected void setCompound(Object compound) {
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>) ReflectionMethod.CRAFT_PERSISTENT_DATA_CONTAINER_GET_MAP.run(container);
map.clear();
ReflectionMethod.CRAFT_PERSISTENT_DATA_CONTAINER_PUT_ALL.run(container, compound);
}
}
@@ -1,612 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Map;
import java.util.Set;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Entity;
import org.bukkit.inventory.meta.ItemMeta;
import de.tr7zw.changeme.nbtapi.utils.GsonWrapper;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ObjectCreator;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* Utility class for translating NBTApi calls to reflections into NMS code All
* methods are allowed to throw {@link NbtApiException}
*
* @author tr7zw
*
*/
public class NBTReflectionUtil {
private static Field field_unhandledTags = null;
static {
try {
field_unhandledTags = ClassWrapper.CRAFT_METAITEM.getClazz().getDeclaredField("unhandledTags");
field_unhandledTags.setAccessible(true);
} catch (NoSuchFieldException e) {
}
}
/**
* Hidden constructor
*/
private NBTReflectionUtil() {
}
/**
* Gets the NMS Entity for a given Bukkit Entity
*
* @param entity Bukkit Entity
* @return NMS Entity
*/
public static Object getNMSEntity(Entity entity) {
try {
return ReflectionMethod.CRAFT_ENTITY_GET_HANDLE.run(ClassWrapper.CRAFT_ENTITY.getClazz().cast(entity));
} catch (Exception e) {
throw new NbtApiException("Exception while getting the NMS Entity from a Bukkit Entity!", e);
}
}
/**
* Reads in a InputStream as NMS Compound
*
* @param stream InputStream of any NBT file
* @return NMS Compound
*/
public static Object readNBT(InputStream stream) {
try {
return ReflectionMethod.NBTFILE_READ.run(null, stream);
} catch (Exception e) {
throw new NbtApiException("Exception while reading a NBT File!", e);
}
}
/**
* Writes a NMS Compound to an OutputStream
*
* @param nbt NMS Compound
* @param stream Stream to write to
* @return ???
*/
public static Object writeNBT(Object nbt, OutputStream stream) {
try {
return ReflectionMethod.NBTFILE_WRITE.run(null, nbt, stream);
} catch (Exception e) {
throw new NbtApiException("Exception while writing NBT!", e);
}
}
/**
* Writes a Compound to an OutputStream
*
* @param comp Compound
* @param stream Stream to write to
*/
public static void writeApiNBT(NBTCompound comp, OutputStream stream) {
try {
Object nbttag = comp.getCompound();
if (nbttag == null) {
nbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
return;
Object workingtag = gettoCompount(nbttag, comp);
ReflectionMethod.NBTFILE_WRITE.run(null, workingtag, stream);
} catch (Exception e) {
throw new NbtApiException("Exception while writing NBT!", e);
}
}
/**
* Simulates getOrCreateTag. If an Item doesn't yet have a Tag, it will return a
* new empty tag.
*
* @param nmsitem
* @return NMS Compound
*/
public static Object getItemRootNBTTagCompound(Object nmsitem) {
try {
Object answer = ReflectionMethod.NMSITEM_GETTAG.run(nmsitem);
return answer != null ? answer : ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
} catch (Exception e) {
throw new NbtApiException("Exception while getting an Itemstack's NBTCompound!", e);
}
}
/**
* Converts {@link NBTCompound} to NMS ItemStacks
*
* @param nbtcompound Any valid {@link NBTCompound}
* @return NMS ItemStack
*/
public static Object convertNBTCompoundtoNMSItem(NBTCompound nbtcompound) {
try {
Object nmsComp = gettoCompount(nbtcompound.getCompound(), nbtcompound);
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_11_R1.getVersionId()) {
return ObjectCreator.NMS_COMPOUNDFROMITEM.getInstance(nmsComp);
} else {
return ReflectionMethod.NMSITEM_CREATESTACK.run(null, nmsComp);
}
} catch (Exception e) {
throw new NbtApiException("Exception while converting NBTCompound to NMS ItemStack!", e);
}
}
/**
* Converts NMS ItemStacks to {@link NBTContainer}
*
* @param nmsitem NMS ItemStack
* @return {@link NBTContainer} with all the data
*/
public static NBTContainer convertNMSItemtoNBTCompound(Object nmsitem) {
try {
Object answer = ReflectionMethod.NMSITEM_SAVE.run(nmsitem, ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance());
return new NBTContainer(answer);
} catch (Exception e) {
throw new NbtApiException("Exception while converting NMS ItemStack to NBTCompound!", e);
}
}
/**
* Gets a live copy of non-vanilla NBT tags.
*
* @param meta ItemMeta from which tags should be retrieved
* @return Map containing unhandled (custom) NBT tags
*/
@SuppressWarnings("unchecked")
public static Map<String, Object> getUnhandledNBTTags(ItemMeta meta) {
try {
return (Map<String, Object>) field_unhandledTags.get(meta);
} catch (Exception e) {
throw new NbtApiException("Exception while getting unhandled tags from ItemMeta!", e);
}
}
/**
* Gets the Vanilla NBT Compound from a given NMS Entity
*
* @param nmsEntity
* @return NMS NBT Compound
*/
public static Object getEntityNBTTagCompound(Object nmsEntity) {
try {
Object nbt = ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance();
Object answer = ReflectionMethod.NMS_ENTITY_GET_NBT.run(nmsEntity, nbt);
if (answer == null)
answer = nbt;
return answer;
} catch (Exception e) {
throw new NbtApiException("Exception while getting NBTCompound from NMS Entity!", e);
}
}
/**
* Loads all Vanilla tags from a NMS Compound into a NMS Entity
*
* @param nbtTag
* @param nmsEntity
* @return The NMS Entity
*/
public static Object setEntityNBTTag(Object nbtTag, Object nmsEntity) {
try {
ReflectionMethod.NMS_ENTITY_SET_NBT.run(nmsEntity, nbtTag);
return nmsEntity;
} catch (Exception ex) {
throw new NbtApiException("Exception while setting the NBTCompound of an Entity", ex);
}
}
/**
* Gets the NMS Compound from a given TileEntity
*
* @param tile
* @return NMS Compound with the Vanilla data
*/
public static Object getTileEntityNBTTagCompound(BlockState tile) {
try {
Object cworld = ClassWrapper.CRAFT_WORLD.getClazz().cast(tile.getWorld());
Object nmsworld = ReflectionMethod.CRAFT_WORLD_GET_HANDLE.run(cworld);
Object o = null;
if(MinecraftVersion.getVersion() == MinecraftVersion.MC1_7_R4) {
o = ReflectionMethod.NMS_WORLD_GET_TILEENTITY_1_7_10.run(nmsworld, tile.getX(), tile.getY(), tile.getZ());
}else {
Object pos = ObjectCreator.NMS_BLOCKPOSITION.getInstance(tile.getX(), tile.getY(), tile.getZ());
o = ReflectionMethod.NMS_WORLD_GET_TILEENTITY.run(nmsworld, pos);
}
Object tag = ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance();
Object answer = ReflectionMethod.TILEENTITY_GET_NBT.run(o, tag);
if (answer == null)
answer = tag;
return answer;
} catch (Exception e) {
throw new NbtApiException("Exception while getting NBTCompound from TileEntity!", e);
}
}
/**
* Sets Vanilla tags from a NMS Compound to a TileEntity
*
* @param tile
* @param comp
*/
public static void setTileEntityNBTTagCompound(BlockState tile, Object comp) {
try {
Object cworld = ClassWrapper.CRAFT_WORLD.getClazz().cast(tile.getWorld());
Object nmsworld = ReflectionMethod.CRAFT_WORLD_GET_HANDLE.run(cworld);
Object o = null;
if(MinecraftVersion.getVersion() == MinecraftVersion.MC1_7_R4) {
o = ReflectionMethod.NMS_WORLD_GET_TILEENTITY_1_7_10.run(nmsworld, tile.getX(), tile.getY(), tile.getZ());
}else {
Object pos = ObjectCreator.NMS_BLOCKPOSITION.getInstance(tile.getX(), tile.getY(), tile.getZ());
o = ReflectionMethod.NMS_WORLD_GET_TILEENTITY.run(nmsworld, pos);
}
if(MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_16_R1.getVersionId()) {
Object blockData = ReflectionMethod.TILEENTITY_GET_BLOCKDATA.run(o);
ReflectionMethod.TILEENTITY_SET_NBT.run(o, blockData, comp);
}else {
ReflectionMethod.TILEENTITY_SET_NBT_LEGACY1151.run(o, comp);
}
} catch (Exception e) {
throw new NbtApiException("Exception while setting NBTData for a TileEntity!", e);
}
}
/**
* Gets the subCompound with a given name from a NMS Compound
*
* @param compound
* @param name
* @return NMS Compound or null
*/
public static Object getSubNBTTagCompound(Object compound, String name) {
try {
if ((boolean) ReflectionMethod.COMPOUND_HAS_KEY.run(compound, name)) {
return ReflectionMethod.COMPOUND_GET_COMPOUND.run(compound, name);
} else {
throw new NbtApiException("Tried getting invalide compound '" + name + "' from '" + compound + "'!");
}
} catch (Exception e) {
throw new NbtApiException("Exception while getting NBT subcompounds!", e);
}
}
/**
* Creates a subCompound with a given name in the given NMS Compound
*
* @param comp
* @param name
*/
public static void addNBTTagCompound(NBTCompound comp, String name) {
if (name == null) {
remove(comp, name);
return;
}
Object nbttag = comp.getCompound();
if (nbttag == null) {
nbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp)) {
return;
}
Object workingtag = gettoCompount(nbttag, comp);
try {
ReflectionMethod.COMPOUND_SET.run(workingtag, name,
ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance());
comp.setCompound(nbttag);
} catch (Exception e) {
throw new NbtApiException("Exception while adding a Compound!", e);
}
}
/**
* Checks if the Compound is correctly linked to it's roots
*
* @param comp
* @return true if this is a valide Compound, else false
*/
public static Boolean valideCompound(NBTCompound comp) {
Object root = comp.getCompound();
if (root == null) {
root = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
return (gettoCompount(root, comp)) != null;
}
protected static Object gettoCompount(Object nbttag, NBTCompound comp) {
Deque<String> structure = new ArrayDeque<>();
while (comp.getParent() != null) {
structure.add(comp.getName());
comp = comp.getParent();
}
while (!structure.isEmpty()) {
String target = structure.pollLast();
nbttag = getSubNBTTagCompound(nbttag, target);
if (nbttag == null) {
throw new NbtApiException("Unable to find tag '" + target + "' in " + nbttag);
}
}
return nbttag;
}
/**
* Merges the second {@link NBTCompound} into the first one
*
* @param comp Target for the merge
* @param nbtcompoundSrc Data to merge
*/
public static void mergeOtherNBTCompound(NBTCompound comp, NBTCompound nbtcompoundSrc) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
Object workingtag = gettoCompount(rootnbttag, comp);
Object rootnbttagSrc = nbtcompoundSrc.getCompound();
if (rootnbttagSrc == null) {
rootnbttagSrc = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(nbtcompoundSrc))
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
Object workingtagSrc = gettoCompount(rootnbttagSrc, nbtcompoundSrc);
try {
ReflectionMethod.COMPOUND_MERGE.run(workingtag, workingtagSrc);
comp.setCompound(rootnbttag);
} catch (Exception e) {
throw new NbtApiException("Exception while merging two NBTCompounds!", e);
}
}
/**
* Returns the content for a given key inside a Compound
*
* @param comp
* @param key
* @return Content saved under this key
*/
public static String getContent(NBTCompound comp, String key) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
Object workingtag = gettoCompount(rootnbttag, comp);
try {
return ReflectionMethod.COMPOUND_GET.run(workingtag, key).toString();
} catch (Exception e) {
throw new NbtApiException("Exception while getting the Content for key '" + key + "'!", e);
}
}
/**
* Sets a key in a {@link NBTCompound} to a given value
*
* @param comp
* @param key
* @param val
*/
public static void set(NBTCompound comp, String key, Object val) {
if (val == null) {
remove(comp, key);
return;
}
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp)) {
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
}
Object workingtag = gettoCompount(rootnbttag, comp);
try {
ReflectionMethod.COMPOUND_SET.run(workingtag, key, val);
comp.setCompound(rootnbttag);
} catch (Exception e) {
throw new NbtApiException("Exception while setting key '" + key + "' to '" + val + "'!", e);
}
}
/**
* Returns the List saved with a given key.
*
* @param comp
* @param key
* @param type
* @param clazz
* @return The list at that key. Null if it's an invalide type
*/
@SuppressWarnings("unchecked")
public static <T> NBTList<T> getList(NBTCompound comp, String key, NBTType type, Class<T> clazz) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
return null;
Object workingtag = gettoCompount(rootnbttag, comp);
try {
Object nbt = ReflectionMethod.COMPOUND_GET_LIST.run(workingtag, key, type.getId());
if (clazz == String.class) {
return (NBTList<T>) new NBTStringList(comp, key, type, nbt);
} else if (clazz == NBTListCompound.class) {
return (NBTList<T>) new NBTCompoundList(comp, key, type, nbt);
} else if (clazz == Integer.class) {
return (NBTList<T>) new NBTIntegerList(comp, key, type, nbt);
} else if (clazz == Float.class) {
return (NBTList<T>) new NBTFloatList(comp, key, type, nbt);
} else if (clazz == Double.class) {
return (NBTList<T>) new NBTDoubleList(comp, key, type, nbt);
} else if (clazz == Long.class) {
return (NBTList<T>) new NBTLongList(comp, key, type, nbt);
} else {
return null;
}
} catch (Exception ex) {
throw new NbtApiException("Exception while getting a list with the type '" + type + "'!", ex);
}
}
public static NBTType getListType(NBTCompound comp, String key) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
return null;
Object workingtag = gettoCompount(rootnbttag, comp);
try {
Object nbt = ReflectionMethod.COMPOUND_GET.run(workingtag, key);
Field f = nbt.getClass().getDeclaredField("type");
f.setAccessible(true);
return NBTType.valueOf(f.getByte(nbt));
} catch (Exception ex) {
throw new NbtApiException("Exception while getting the list type!", ex);
}
}
public static Object getEntry(NBTCompound comp, String key) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
return null;
Object workingtag = gettoCompount(rootnbttag, comp);
try {
Object nbt = ReflectionMethod.COMPOUND_GET.run(workingtag, key);
return nbt;
} catch (Exception ex) {
throw new NbtApiException("Exception while getting an Entry!", ex);
}
}
/**
* Uses Gson to set a {@link Serializable} value in a Compound
*
* @param comp
* @param key
* @param value
*/
public static void setObject(NBTCompound comp, String key, Object value) {
if (!MinecraftVersion.hasGsonSupport())
return;
try {
String json = GsonWrapper.getString(value);
setData(comp, ReflectionMethod.COMPOUND_SET_STRING, key, json);
} catch (Exception e) {
throw new NbtApiException("Exception while setting the Object '" + value + "'!", e);
}
}
/**
* Uses Gson to load back a {@link Serializable} object from the Compound
*
* @param comp
* @param key
* @param type
* @return The loaded Object or null, if not found
*/
public static <T> T getObject(NBTCompound comp, String key, Class<T> type) {
if (!MinecraftVersion.hasGsonSupport())
return null;
String json = (String) getData(comp, ReflectionMethod.COMPOUND_GET_STRING, key);
if (json == null) {
return null;
}
return GsonWrapper.deserializeJson(json, type);
}
/**
* Deletes the given key
*
* @param comp
* @param key
*/
public static void remove(NBTCompound comp, String key) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
return;
Object workingtag = gettoCompount(rootnbttag, comp);
ReflectionMethod.COMPOUND_REMOVE_KEY.run(workingtag, key);
comp.setCompound(rootnbttag);
}
/**
* Gets the Keyset inside this Compound
*
* @param comp
* @return Set of all keys
*/
@SuppressWarnings("unchecked")
public static Set<String> getKeys(NBTCompound comp) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
Object workingtag = gettoCompount(rootnbttag, comp);
return (Set<String>) ReflectionMethod.COMPOUND_GET_KEYS.run(workingtag);
}
/**
* Sets data inside the Compound
*
* @param comp
* @param type
* @param key
* @param data
*/
public static void setData(NBTCompound comp, ReflectionMethod type, String key, Object data) {
if (data == null) {
remove(comp, key);
return;
}
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance();
}
if (!valideCompound(comp))
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
Object workingtag = gettoCompount(rootnbttag, comp);
type.run(workingtag, key, data);
comp.setCompound(rootnbttag);
}
/**
* Gets data from the Compound
*
* @param comp
* @param type
* @param key
* @return The value or default fallback from NMS
*/
public static Object getData(NBTCompound comp, ReflectionMethod type, String key) {
Object rootnbttag = comp.getCompound();
if (rootnbttag == null) {
return null;
}
if (!valideCompound(comp))
throw new NbtApiException("The Compound wasn't able to be linked back to the root!");
Object workingtag = gettoCompount(rootnbttag, comp);
return type.run(workingtag, key);
}
}
@@ -1,42 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
/**
* String implementation for NBTLists
*
* @author tr7zw
*
*/
public class NBTStringList extends NBTList<String> {
protected NBTStringList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
@Override
public String get(int index) {
try {
return (String) ReflectionMethod.LIST_GET_STRING.run(listObject, index);
} catch (Exception ex) {
throw new NbtApiException(ex);
}
}
@Override
protected Object asTag(String object) {
try {
Constructor<?> con = ClassWrapper.NMS_NBTTAGSTRING.getClazz().getDeclaredConstructor(String.class);
con.setAccessible(true);
return con.newInstance(object);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
throw new NbtApiException("Error while wrapping the Object " + object + " to it's NMS object!", e);
}
}
}
@@ -1,64 +0,0 @@
package de.tr7zw.changeme.nbtapi;
import org.bukkit.block.BlockState;
import de.tr7zw.annotations.FAUtil;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.annotations.AvaliableSince;
import de.tr7zw.changeme.nbtapi.utils.annotations.CheckUtil;
/**
* NBT class to access vanilla tags from TileEntities. TileEntities don't
* support custom tags. Use the NBTInjector for custom tags. Changes will be
* instantly applied to the Tile, use the merge method to do many things at
* once.
*
* @author tr7zw
*
*/
public class NBTTileEntity extends NBTCompound {
private final BlockState tile;
/**
* @param tile BlockState from any TileEntity
*/
public NBTTileEntity(BlockState tile) {
super(null, null);
if (tile == null || (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3) && !tile.isPlaced())) {
throw new NullPointerException("Tile can't be null/not placed!");
}
this.tile = tile;
}
@Override
public Object getCompound() {
return NBTReflectionUtil.getTileEntityNBTTagCompound(tile);
}
@Override
protected void setCompound(Object compound) {
NBTReflectionUtil.setTileEntityNBTTagCompound(tile, compound);
}
/**
* Gets the NBTCompound used by spigots PersistentDataAPI. This method is only
* available for 1.14+!
*
* @return NBTCompound containing the data of the PersistentDataAPI
*/
@AvaliableSince(version = MinecraftVersion.MC1_14_R1)
public NBTCompound getPersistentDataContainer() {
FAUtil.check(this::getPersistentDataContainer, CheckUtil::isAvaliable);
if (hasKey("PublicBukkitValues")) {
return getCompound("PublicBukkitValues");
} else {
NBTContainer container = new NBTContainer();
container.addCompound("PublicBukkitValues").setString("__nbtapi",
"Marker to make the PersistentDataContainer have content");
mergeCompound(container);
return getCompound("PublicBukkitValues");
}
}
}
@@ -1,48 +0,0 @@
package de.tr7zw.changeme.nbtapi;
/**
* Enum of all NBT Types Minecraft contains
*
* @author tr7zw
*
*/
@SuppressWarnings("javadoc")
public enum NBTType {
NBTTagEnd(0),
NBTTagByte(1),
NBTTagShort(2),
NBTTagInt(3),
NBTTagLong(4),
NBTTagFloat(5),
NBTTagDouble(6),
NBTTagByteArray(7),
NBTTagIntArray(11),
NBTTagString(8),
NBTTagList(9),
NBTTagCompound(10);
NBTType(int i) {
id = i;
}
private final int id;
/**
* @return Id used by Minecraft internally
*/
public int getId() {
return id;
}
/**
* @param id Internal Minecraft id
* @return Enum representing the id, NBTTagEnd for invalide ids
*/
public static NBTType valueOf(int id) {
for (NBTType t : values())
if (t.getId() == id)
return t;
return NBTType.NBTTagEnd;
}
}
@@ -1,56 +0,0 @@
package de.tr7zw.changeme.nbtapi;
/**
* A generic {@link RuntimeException} that can be thrown by most methods in the
* NBTAPI.
*
* @author tr7zw
*
*/
public class NbtApiException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = -993309714559452334L;
/**
*
*/
public NbtApiException() {
super();
}
/**
* @param message
* @param cause
* @param enableSuppression
* @param writableStackTrace
*/
public NbtApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
/**
* @param message
* @param cause
*/
public NbtApiException(String message, Throwable cause) {
super(message, cause);
}
/**
* @param message
*/
public NbtApiException(String message) {
super(message);
}
/**
* @param cause
*/
public NbtApiException(Throwable cause) {
super(cause);
}
}
@@ -1,388 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.ServicePriority;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Timer;
import java.util.TimerTask;
import java.util.UUID;
import java.util.logging.Level;
import java.util.zip.GZIPOutputStream;
import static de.tr7zw.changeme.nbtapi.utils.MinecraftVersion.getLogger;
/**
* bStats collects some data for plugin authors.
* <p>
* Check out https://bStats.org/ to learn more about bStats!
*
* This class is modified by tr7zw to work when the api is shaded into other peoples plugins.
*/
public class ApiMetricsLite {
private static final String PLUGINNAME = "ItemNBTAPI"; // DO NOT CHANGE THE NAME! else it won't link the data on bStats
// The version of this bStats class
public static final int B_STATS_VERSION = 1;
// The version of the NBT-Api bStats
public static final int NBT_BSTATS_VERSION = 1;
// The url to which the data is sent
private static final String URL = "https://bStats.org/submitData/bukkit";
// Is bStats enabled on this server?
private boolean enabled;
// Should failed requests be logged?
private static boolean logFailedRequests;
// Should the sent data be logged?
private static boolean logSentData;
// Should the response text be logged?
private static boolean logResponseStatusText;
// The uuid of the server
private static String serverUUID;
// The plugin
private Plugin plugin;
/**
* Class constructor.
*
*/
public ApiMetricsLite() {
// The register method just uses any enabled plugin it can find to register. This *shouldn't* cause any problems, since the plugin isn't used any other way.
// Register our service
for(Plugin plug : Bukkit.getPluginManager().getPlugins()) {
plugin = plug;
if(plugin != null)
break;
}
if(plugin == null) {
return;// Didn't find any plugin that could work
}
// Get the config file
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
File configFile = new File(bStatsFolder, "config.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
// Check if the config file exists
if (!config.isSet("serverUuid")) {
// Add default values
config.addDefault("enabled", true);
// Every server gets it's unique random id.
config.addDefault("serverUuid", UUID.randomUUID().toString());
// Should failed request be logged?
config.addDefault("logFailedRequests", false);
// Should the sent data be logged?
config.addDefault("logSentData", false);
// Should the response text be logged?
config.addDefault("logResponseStatusText", false);
// Inform the server owners about bStats
config.options().header(
"bStats collects some data for plugin authors like how many servers are using their plugins.\n" +
"To honor their work, you should not disable it.\n" +
"This has nearly no effect on the server performance!\n" +
"Check out https://bStats.org/ to learn more :)"
).copyDefaults(true);
try {
config.save(configFile);
} catch (IOException ignored) { }
}
// Load the data
serverUUID = config.getString("serverUuid");
logFailedRequests = config.getBoolean("logFailedRequests", false);
enabled = config.getBoolean("enabled", true);
logSentData = config.getBoolean("logSentData", false);
logResponseStatusText = config.getBoolean("logResponseStatusText", false);
if (enabled) {
boolean found = false;
// Search for all other bStats Metrics classes to see if we are the first one
for (Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
try {
service.getField("NBT_BSTATS_VERSION"); // Create only one instance of the nbt-api bstats.
return;
} catch (NoSuchFieldException ignored) { }
try {
service.getField("B_STATS_VERSION"); // Our identifier :)
found = true; // We aren't the first
break;
} catch (NoSuchFieldException ignored) { }
}
boolean fFound = found;
// Register our service
if(Bukkit.isPrimaryThread()){
Bukkit.getServicesManager().register(ApiMetricsLite.class, this, plugin, ServicePriority.Normal);
if (!fFound) {
getLogger().info("[NBTAPI] Using the plugin '" + plugin.getName() + "' to create a bStats instance!");
// We are the first!
startSubmitting();
}
}else{
Bukkit.getScheduler().runTask(plugin, () -> {
Bukkit.getServicesManager().register(ApiMetricsLite.class, this, plugin, ServicePriority.Normal);
if (!fFound) {
getLogger().info("[NBTAPI] Using the plugin '" + plugin.getName() + "' to create a bStats instance!");
// We are the first!
startSubmitting();
}
});
}
}
}
/**
* Checks if bStats is enabled.
*
* @return Whether bStats is enabled or not.
*/
public boolean isEnabled() {
return enabled;
}
/**
* Starts the Scheduler which submits our data every 30 minutes.
*/
private void startSubmitting() {
final Timer timer = new Timer(true); // We use a timer cause the Bukkit scheduler is affected by server lags
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if (!plugin.isEnabled()) { // Plugin was disabled
timer.cancel();
return;
}
// Nevertheless we want our code to run in the Bukkit main thread, so we have to use the Bukkit scheduler
// Don't be afraid! The connection to the bStats server is still async, only the stats collection is sync ;)
Bukkit.getScheduler().runTask(plugin, () -> submitData());
}
}, 1000l * 60l * 5l, 1000l * 60l * 30l);
// Submit the data every 30 minutes, first time after 5 minutes to give other plugins enough time to start
// WARNING: Changing the frequency has no effect but your plugin WILL be blocked/deleted!
// WARNING: Just don't do it!
}
/**
* Gets the plugin specific data.
* This method is called using Reflection.
*
* @return The plugin specific data.
*/
public JsonObject getPluginData() {
JsonObject data = new JsonObject();
data.addProperty("pluginName", PLUGINNAME); // Append the name of the plugin
data.addProperty("pluginVersion", MinecraftVersion.VERSION); // Append the version of the plugin
data.add("customCharts", new JsonArray());
return data;
}
/**
* Gets the server specific data.
*
* @return The server specific data.
*/
private JsonObject getServerData() {
// Minecraft specific data
int playerAmount;
try {
// Around MC 1.8 the return type was changed to a collection from an array,
// This fixes java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection;
Method onlinePlayersMethod = Class.forName("org.bukkit.Server").getMethod("getOnlinePlayers");
playerAmount = onlinePlayersMethod.getReturnType().equals(Collection.class)
? ((Collection<?>) onlinePlayersMethod.invoke(Bukkit.getServer())).size()
: ((Player[]) onlinePlayersMethod.invoke(Bukkit.getServer())).length;
} catch (Exception e) {
playerAmount = Bukkit.getOnlinePlayers().size(); // Just use the new method if the Reflection failed
}
int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = Bukkit.getVersion();
String bukkitName = Bukkit.getName();
// OS/Java specific data
String javaVersion = System.getProperty("java.version");
String osName = System.getProperty("os.name");
String osArch = System.getProperty("os.arch");
String osVersion = System.getProperty("os.version");
int coreCount = Runtime.getRuntime().availableProcessors();
JsonObject data = new JsonObject();
data.addProperty("serverUUID", serverUUID);
data.addProperty("playerAmount", playerAmount);
data.addProperty("onlineMode", onlineMode);
data.addProperty("bukkitVersion", bukkitVersion);
data.addProperty("bukkitName", bukkitName);
data.addProperty("javaVersion", javaVersion);
data.addProperty("osName", osName);
data.addProperty("osArch", osArch);
data.addProperty("osVersion", osVersion);
data.addProperty("coreCount", coreCount);
return data;
}
/**
* Collects the data and sends it afterwards.
*/
private void submitData() {
final JsonObject data = getServerData();
JsonArray pluginData = new JsonArray();
// Search for all other bStats Metrics classes to get their plugin data
for (Class<?> service : Bukkit.getServicesManager().getKnownServices()) {
try {
service.getField("B_STATS_VERSION"); // Our identifier :)
for (RegisteredServiceProvider<?> provider : Bukkit.getServicesManager().getRegistrations(service)) {
try {
Object plugin = provider.getService().getMethod("getPluginData").invoke(provider.getProvider());
if (plugin instanceof JsonObject) {
pluginData.add((JsonObject) plugin);
} else { // old bstats version compatibility
try {
Class<?> jsonObjectJsonSimple = Class.forName("org.json.simple.JSONObject");
if (plugin.getClass().isAssignableFrom(jsonObjectJsonSimple)) {
Method jsonStringGetter = jsonObjectJsonSimple.getDeclaredMethod("toJSONString");
jsonStringGetter.setAccessible(true);
String jsonString = (String) jsonStringGetter.invoke(plugin);
JsonObject object = new JsonParser().parse(jsonString).getAsJsonObject();
pluginData.add(object);
}
} catch (ClassNotFoundException e) {
// minecraft version 1.14+
if (logFailedRequests) {
getLogger().log(Level.WARNING, "[NBTAPI][BSTATS] Encountered exception while posting request!", e);
// Not using the plugins logger since the plugin isn't the plugin containing the NBT-Api most of the time
//this.plugin.getLogger().log(Level.SEVERE, "Encountered unexpected exception ", e);
}
continue; // continue looping since we cannot do any other thing.
}
}
} catch (NullPointerException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
}
}
} catch (NoSuchFieldException ignored) { }
}
data.add("plugins", pluginData);
// Create a new thread for the connection to the bStats server
new Thread(new Runnable() {
@Override
public void run() {
try {
// Send the data
sendData(plugin, data);
} catch (Exception e) {
// Something went wrong! :(
if (logFailedRequests) {
getLogger().log(Level.WARNING, "[NBTAPI][BSTATS] Could not submit plugin stats of " + plugin.getName(), e);
// Not using the plugins logger since the plugin isn't the plugin containing the NBT-Api most of the time
//plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats of " + plugin.getName(), e);
}
}
}
}).start();
}
/**
* Sends the data to the bStats server.
*
* @param plugin Any plugin. It's just used to get a logger instance.
* @param data The data to send.
* @throws Exception If the request failed.
*/
private static void sendData(Plugin plugin, JsonObject data) throws Exception {
if (data == null) {
throw new IllegalArgumentException("Data cannot be null!");
}
if (Bukkit.isPrimaryThread()) {
throw new IllegalAccessException("This method must not be called from the main thread!");
}
if (logSentData) {
System.out.println("[NBTAPI][BSTATS] Sending data to bStats: " + data.toString());
// Not using the plugins logger since the plugin isn't the plugin containing the NBT-Api most of the time
//plugin.getLogger().info("Sending data to bStats: " + data.toString());
}
HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
// Compress the data to save bandwidth
byte[] compressedData = compress(data.toString());
// Add headers
connection.setRequestMethod("POST");
connection.addRequestProperty("Accept", "application/json");
connection.addRequestProperty("Connection", "close");
connection.addRequestProperty("Content-Encoding", "gzip"); // We gzip our request
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
connection.setRequestProperty("Content-Type", "application/json"); // We send our data in JSON format
connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);
// Send data
connection.setDoOutput(true);
DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());
outputStream.write(compressedData);
outputStream.flush();
outputStream.close();
InputStream inputStream = connection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder builder = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
builder.append(line);
}
bufferedReader.close();
if (logResponseStatusText) {
getLogger().info("[NBTAPI][BSTATS] Sent data to bStats and received response: " + builder.toString());
// Not using the plugins logger since the plugin isn't the plugin containing the NBT-Api most of the time
//plugin.getLogger().info("Sent data to bStats and received response: " + builder.toString());
}
}
/**
* Gzips the given String.
*
* @param str The string to gzip.
* @return The gzipped String.
* @throws IOException If the compression failed.
*/
private static byte[] compress(final String str) throws IOException {
if (str == null) {
return new byte[0];
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
GZIPOutputStream gzip = new GZIPOutputStream(outputStream);
gzip.write(str.getBytes(StandardCharsets.UTF_8));
gzip.close();
return outputStream.toByteArray();
}
}
@@ -1,54 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils;
import com.google.gson.Gson;
import de.tr7zw.changeme.nbtapi.NbtApiException;
/**
* Helper class for 1.7 servers without Gson
*
* @author tr7zw
*
*/
public class GsonWrapper {
/**
* Private constructor
*/
private GsonWrapper() {
}
private static final Gson gson = new Gson();
/**
* Turns Objects into Json Strings
*
* @param obj
* @return Json, representing the Object
*/
public static String getString(Object obj) {
return gson.toJson(obj);
}
/**
* Creates an Object of the given type using the Json String
*
* @param json
* @param type
* @return Object that got created, or null if the json is null
*/
public static <T> T deserializeJson(String json, Class<T> type) {
try {
if (json == null) {
return null;
}
T obj = gson.fromJson(json, type);
return type.cast(obj);
} catch (Exception ex) {
throw new NbtApiException("Error while converting json to " + type.getName(), ex);
}
}
}
@@ -1,190 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
/**
* This class acts as the "Brain" of the NBTApi. It contains the main logger for
* other classes,registers bStats and checks rather Maven shading was done
* correctly.
*
* @author tr7zw
*
*/
@SuppressWarnings("javadoc")
public enum MinecraftVersion {
UNKNOWN(Integer.MAX_VALUE), // Use the newest known mappings
MC1_7_R4(174), MC1_8_R3(183), MC1_9_R1(191), MC1_9_R2(192), MC1_10_R1(1101), MC1_11_R1(1111), MC1_12_R1(1121),
MC1_13_R1(1131), MC1_13_R2(1132), MC1_14_R1(1141), MC1_15_R1(1151), MC1_16_R1(1161), MC1_16_R2(1162), MC1_16_R3(1163);
private static MinecraftVersion version;
private static Boolean hasGsonSupport;
private static boolean bStatsDisabled = false;
private static boolean disablePackageWarning = false;
private static boolean updateCheckDisabled = false;
/**
* Logger used by the api
*/
private static Logger logger = Logger.getLogger("NBTAPI");
// NBT-API Version
protected static final String VERSION = "2.7.0";
private final int versionId;
MinecraftVersion(int versionId) {
this.versionId = versionId;
}
/**
* @return A simple comparable Integer, representing the version.
*/
public int getVersionId() {
return versionId;
}
/**
* Returns true if the current versions is at least the given Version
*
* @param version The minimum version
* @return
*/
public static boolean isAtLeastVersion(MinecraftVersion version) {
return getVersion().getVersionId() >= version.getVersionId();
}
/**
* Returns true if the current versions newer (not equal) than the given version
*
* @param version The minimum version
* @return
*/
public static boolean isNewerThan(MinecraftVersion version) {
return getVersion().getVersionId() > version.getVersionId();
}
/**
* Getter for this servers MinecraftVersion. Also init's bStats and checks the
* shading.
*
* @return The enum for the MinecraftVersion this server is running
*/
public static MinecraftVersion getVersion() {
if (version != null) {
return version;
}
final String ver = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
logger.info("[NBTAPI] Found Spigot: " + ver + "! Trying to find NMS support");
try {
version = MinecraftVersion.valueOf(ver.replace("v", "MC"));
} catch (IllegalArgumentException ex) {
version = MinecraftVersion.UNKNOWN;
}
if (version != UNKNOWN) {
logger.info("[NBTAPI] NMS support '" + version.name() + "' loaded!");
} else {
logger.warning("[NBTAPI] Wasn't able to find NMS Support! Some functions may not work!");
}
init();
return version;
}
private static void init() {
try {
if (hasGsonSupport() && !bStatsDisabled)
new ApiMetricsLite();
} catch (Exception ex) {
logger.log(Level.WARNING, "[NBTAPI] Error enabling Metrics!", ex);
}
if (hasGsonSupport() && !updateCheckDisabled)
new Thread(() -> {
try {
VersionChecker.checkForUpdates();
} catch (Exception ex) {
logger.log(Level.WARNING, "[NBTAPI] Error while checking for updates!", ex);
}
}).start();
// Maven's Relocate is clever and changes strings, too. So we have to use this
// little "trick" ... :D (from bStats)
final String defaultPackage = new String(new byte[] { 'd', 'e', '.', 't', 'r', '7', 'z', 'w', '.', 'c', 'h',
'a', 'n', 'g', 'e', 'm', 'e', '.', 'n', 'b', 't', 'a', 'p', 'i', '.', 'u', 't', 'i', 'l', 's' });
if (!disablePackageWarning && MinecraftVersion.class.getPackage().getName().equals(defaultPackage)) {
logger.warning(
"#########################################- NBTAPI -#########################################");
logger.warning(
"The NBT-API package has not been moved! This *will* cause problems with other plugins containing");
logger.warning(
"a different version of the api! Please read the guide on the plugin page on how to get the");
logger.warning(
"Maven Shade plugin to relocate the api to your personal location! If you are not the developer,");
logger.warning("please check your plugins and contact their developer, so he can fix this issue.");
logger.warning(
"#########################################- NBTAPI -#########################################");
}
}
/**
* @return True, if Gson is usable
*/
public static boolean hasGsonSupport() {
if (hasGsonSupport != null) {
return hasGsonSupport;
}
try {
logger.info("[NBTAPI] Found Gson: " + Class.forName("com.google.gson.Gson"));
hasGsonSupport = true;
} catch (Exception ex) {
logger.info("[NBTAPI] Gson not found! This will not allow the usage of some methods!");
hasGsonSupport = false;
}
return hasGsonSupport;
}
/**
* Calling this function before the NBT-Api is used will disable bStats stats
* collection. Please consider not to do that, since it won't affect your plugin
* and helps the NBT-Api developer to see api's demand.
*/
public static void disableBStats() {
bStatsDisabled = true;
}
/**
* Disables the update check. Uses Spiget to get the current version and prints
* a warning when outdated.
*/
public static void disableUpdateCheck() {
updateCheckDisabled = true;
}
/**
* Forcefully disables the log message for plugins not shading the API to
* another location. This may be helpful for networks or development
* environments, but please don't use it for plugins that are uploaded to
* Spigotmc.
*/
public static void disablePackageWarning() {
disablePackageWarning = true;
}
/**
* @return Logger used by the NBT-API
*/
public static Logger getLogger() {
return logger;
}
/**
* Replaces the NBT-API logger with a custom implementation.
*
* @param logger The new logger(can not be null!)
*/
public static void replaceLogger(Logger logger) {
if(logger == null)throw new NullPointerException("Logger can not be null!");
MinecraftVersion.logger = logger;
}
}
@@ -1,53 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import de.tr7zw.changeme.nbtapi.NbtApiException;
public final class ReflectionUtil {
private static Field field_modifiers;
static {
try {
field_modifiers = Field.class.getDeclaredField("modifiers");
field_modifiers.setAccessible(true);
} catch (NoSuchFieldException ex) {
try {
// This hacky workaround is for newer jdk versions 11+?
Method fieldGetter = Class.class.getDeclaredMethod("getDeclaredFields0", boolean.class);
fieldGetter.setAccessible(true);
Field[] fields = (Field[]) fieldGetter.invoke(Field.class, false);
for (Field f : fields)
if (f.getName().equals("modifiers")) {
field_modifiers = f;
field_modifiers.setAccessible(true);
break;
}
} catch (Exception e) {
throw new NbtApiException(e);
}
}
if (field_modifiers == null) {
throw new NbtApiException("Unable to init the modifiers Field.");
}
}
public static Field makeNonFinal(Field field) throws IllegalArgumentException, IllegalAccessException {
int mods = field.getModifiers();
if (Modifier.isFinal(mods)) {
field_modifiers.set(field, mods & ~Modifier.FINAL);
}
return field;
}
public static void setFinal(Object obj, Field field, Object newValue)
throws IllegalArgumentException, IllegalAccessException {
field.setAccessible(true);
field = makeNonFinal(field);
field.set(obj, newValue);
}
}
@@ -1,106 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.logging.Level;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import de.tr7zw.changeme.nbtapi.NBTItem;
/**
* This class uses the Spiget API to check for updates
*
*/
public class VersionChecker {
private static final String USER_AGENT = "nbt-api Version check";
private static final String REQUEST_URL = "https://api.spiget.org/v2/resources/7939/versions?size=100";
protected static void checkForUpdates() throws Exception {
URL url = new URL(REQUEST_URL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.addRequestProperty("User-Agent", USER_AGENT);// Set
// User-Agent
// If you're not sure if the request will be successful,
// you need to check the response code and use #getErrorStream if it
// returned an error code
InputStream inputStream = connection.getInputStream();
InputStreamReader reader = new InputStreamReader(inputStream);
// This could be either a JsonArray or JsonObject
JsonElement element = new JsonParser().parse(reader);
if (element.isJsonArray()) {
// Is JsonArray
JsonArray updates = (JsonArray) element;
JsonObject latest = (JsonObject) updates.get(updates.size() - 1);
int versionDifference = getVersionDifference(latest.get("name").getAsString());
if (versionDifference == -1) { // Outdated
MinecraftVersion.getLogger().log(Level.WARNING,
"[NBTAPI] The NBT-API at '" + NBTItem.class.getPackage() + "' seems to be outdated!");
MinecraftVersion.getLogger().log(Level.WARNING, "[NBTAPI] Current Version: '" + MinecraftVersion.VERSION
+ "' Newest Version: " + latest.get("name").getAsString() + "'");
MinecraftVersion.getLogger().log(Level.WARNING,
"[NBTAPI] Please update the nbt-api or the plugin that contains the api!");
} else if (versionDifference == 0) {
MinecraftVersion.getLogger().log(Level.INFO, "[NBTAPI] The NBT-API seems to be up-to-date!");
} else if (versionDifference == 1) {
MinecraftVersion.getLogger().log(Level.WARNING, "[NBTAPI] The NBT-API at '" + NBTItem.class.getPackage()
+ "' seems to be a future Version, not yet released on Spigot/CurseForge!");
MinecraftVersion.getLogger().log(Level.WARNING, "[NBTAPI] Current Version: '" + MinecraftVersion.VERSION
+ "' Newest Version: " + latest.get("name").getAsString() + "'");
}
} else {
// wut?!
MinecraftVersion.getLogger().log(Level.WARNING,
"[NBTAPI] Error when looking for Updates! Got non Json Array: '" + element.toString() + "'");
}
}
// -1 = we are outdated
// 0 = up to date
// 1 = using a future version
// This method is only able to compare the Format 0.0.0(-SNAPSHOT)
private static int getVersionDifference(String version) {
String current = MinecraftVersion.VERSION;
if (current.equals(version))
return 0;
String pattern = "\\.";
if (current.split(pattern).length != 3 || version.split(pattern).length != 3)
return -1;
int curMaj = Integer.parseInt(current.split(pattern)[0]);
int curMin = Integer.parseInt(current.split(pattern)[1]);
String curPatch = current.split(pattern)[2];
int relMaj = Integer.parseInt(version.split(pattern)[0]);
int relMin = Integer.parseInt(version.split(pattern)[1]);
String relPatch = version.split(pattern)[2];
if (curMaj < relMaj)
return -1;
if (curMaj > relMaj)
return 1;
if (curMin < relMin)
return -1;
if (curMin > relMin)
return 1;
int curPatchN = Integer.parseInt(curPatch.split("-")[0]);
int relPatchN = Integer.parseInt(relPatch.split("-")[0]);
if (curPatchN < relPatchN)
return -1;
if (curPatchN > relPatchN)
return 1;
if (!relPatch.contains("-") && curPatch.contains("-"))
return -1; // Release has no - but we do = We use a Snapshot of the
// release
if (relPatch.contains("-") && curPatch.contains("-"))
return 0; // Release and cur are Snapshots/alpha/beta
return 1;
}
}
@@ -1,17 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
@Retention(RUNTIME)
@Target({ METHOD })
public @interface AvaliableSince {
MinecraftVersion version();
}
@@ -1,16 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils.annotations;
import java.lang.reflect.Method;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
public class CheckUtil {
public static boolean isAvaliable(Method method) {
if(MinecraftVersion.getVersion().getVersionId() < method.getAnnotation(AvaliableSince.class).version().getVersionId())
throw new NbtApiException("The Method '" + method.getName() + "' is only avaliable for the Versions " + method.getAnnotation(AvaliableSince.class).version() + "+, but still got called!");
return true;
}
}
@@ -1,98 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils.nmsmappings;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import static de.tr7zw.changeme.nbtapi.utils.MinecraftVersion.getLogger;
/**
* Wraps NMS and CRAFT classes
*
* @author tr7zw
*
*/
@SuppressWarnings("javadoc")
public enum ClassWrapper {
CRAFT_ITEMSTACK(PackageWrapper.CRAFTBUKKIT, "inventory.CraftItemStack"),
CRAFT_METAITEM(PackageWrapper.CRAFTBUKKIT, "inventory.CraftMetaItem"),
CRAFT_ENTITY(PackageWrapper.CRAFTBUKKIT, "entity.CraftEntity"),
CRAFT_WORLD(PackageWrapper.CRAFTBUKKIT, "CraftWorld"),
CRAFT_PERSISTENTDATACONTAINER(PackageWrapper.CRAFTBUKKIT, "persistence.CraftPersistentDataContainer", MinecraftVersion.MC1_14_R1, null),
NMS_NBTBASE(PackageWrapper.NMS, "NBTBase"),
NMS_NBTTAGSTRING(PackageWrapper.NMS, "NBTTagString"),
NMS_NBTTAGINT(PackageWrapper.NMS, "NBTTagInt"),
NMS_NBTTAGFLOAT(PackageWrapper.NMS, "NBTTagFloat"),
NMS_NBTTAGDOUBLE(PackageWrapper.NMS, "NBTTagDouble"),
NMS_NBTTAGLONG(PackageWrapper.NMS, "NBTTagLong"),
NMS_ITEMSTACK(PackageWrapper.NMS, "ItemStack"),
NMS_NBTTAGCOMPOUND(PackageWrapper.NMS, "NBTTagCompound"),
NMS_NBTTAGLIST(PackageWrapper.NMS, "NBTTagList"),
NMS_NBTCOMPRESSEDSTREAMTOOLS(PackageWrapper.NMS, "NBTCompressedStreamTools"),
NMS_MOJANGSONPARSER(PackageWrapper.NMS, "MojangsonParser"),
NMS_TILEENTITY(PackageWrapper.NMS, "TileEntity"),
NMS_BLOCKPOSITION(PackageWrapper.NMS, "BlockPosition", MinecraftVersion.MC1_8_R3, null),
NMS_WORLDSERVER(PackageWrapper.NMS, "WorldServer"),
NMS_MINECRAFTSERVER(PackageWrapper.NMS, "MinecraftServer"),
NMS_WORLD(PackageWrapper.NMS, "World"),
NMS_ENTITY(PackageWrapper.NMS, "Entity"),
NMS_ENTITYTYPES(PackageWrapper.NMS, "EntityTypes"),
NMS_REGISTRYSIMPLE(PackageWrapper.NMS, "RegistrySimple", MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_12_R1),
NMS_REGISTRYMATERIALS(PackageWrapper.NMS, "RegistryMaterials"),
NMS_IREGISTRY(PackageWrapper.NMS, "IRegistry"),
NMS_MINECRAFTKEY(PackageWrapper.NMS, "MinecraftKey", MinecraftVersion.MC1_8_R3, null),
NMS_GAMEPROFILESERIALIZER(PackageWrapper.NMS, "GameProfileSerializer"),
NMS_IBLOCKDATA(PackageWrapper.NMS, "IBlockData", MinecraftVersion.MC1_8_R3, null),
GAMEPROFILE("com.mojang.authlib.GameProfile", MinecraftVersion.MC1_8_R3)
;
private Class<?> clazz;
private boolean enabled = false;
ClassWrapper(PackageWrapper packageId, String suffix){
this(packageId, suffix, null, null);
}
ClassWrapper(PackageWrapper packageId, String suffix, MinecraftVersion from, MinecraftVersion to){
if(from != null && MinecraftVersion.getVersion().getVersionId() < from.getVersionId()) {
return;
}
if(to != null && MinecraftVersion.getVersion().getVersionId() > to.getVersionId()) {
return;
}
enabled = true;
try{
String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
clazz = Class.forName(packageId.getUri() + "." + version + "." + suffix);
}catch(Exception ex){
getLogger().log(Level.WARNING, "[NBTAPI] Error while trying to resolve the class '" + suffix + "'!", ex);
}
}
ClassWrapper(String path, MinecraftVersion from){
if(from != null && MinecraftVersion.getVersion().getVersionId() < from.getVersionId()) {
return;
}
enabled = true;
try{
clazz = Class.forName(path);
}catch(Exception ex){
getLogger().log(Level.WARNING, "[NBTAPI] Error while trying to resolve the class '" + path + "'!", ex);
}
}
/**
* @return The wrapped class
*/
public Class<?> getClazz(){
return clazz;
}
/**
* @return Is this class available in this Version
*/
public boolean isEnabled() {
return enabled;
}
}
@@ -1,56 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils.nmsmappings;
import java.lang.reflect.Constructor;
import java.util.logging.Level;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import static de.tr7zw.changeme.nbtapi.utils.MinecraftVersion.getLogger;
/**
* This Enum wraps Constructors for NMS classes
*
* @author tr7zw
*
*/
@SuppressWarnings("javadoc")
public enum ObjectCreator {
NMS_NBTTAGCOMPOUND(null, null, ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()),
NMS_BLOCKPOSITION(null, null, ClassWrapper.NMS_BLOCKPOSITION.getClazz(), int.class, int.class, int.class),
NMS_COMPOUNDFROMITEM(MinecraftVersion.MC1_11_R1, null, ClassWrapper.NMS_ITEMSTACK.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()),;
private Constructor<?> construct;
private Class<?> targetClass;
ObjectCreator(MinecraftVersion from, MinecraftVersion to, Class<?> clazz, Class<?>... args) {
if (clazz == null)
return;
if (from != null && MinecraftVersion.getVersion().getVersionId() < from.getVersionId())
return;
if (to != null && MinecraftVersion.getVersion().getVersionId() > to.getVersionId())
return;
try {
this.targetClass = clazz;
construct = clazz.getDeclaredConstructor(args);
construct.setAccessible(true);
} catch (Exception ex) {
getLogger().log(Level.SEVERE, "Unable to find the constructor for the class '" + clazz.getName() + "'", ex);
}
}
/**
* Creates an Object instance with given args
*
* @param args
* @return Object created
*/
public Object getInstance(Object... args) {
try {
return construct.newInstance(args);
} catch (Exception ex) {
throw new NbtApiException("Exception while creating a new instance of '" + targetClass + "'", ex);
}
}
}
@@ -1,28 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils.nmsmappings;
/**
* Package enum
*
* @author tr7zw
*
*/
@SuppressWarnings("javadoc")
public enum PackageWrapper {
NMS(new String(new byte[] {'n', 'e', 't', '.', 'm', 'i', 'n', 'e', 'c', 'r', 'a', 'f', 't', '.', 's', 'e', 'r', 'v', 'e', 'r'})),
CRAFTBUKKIT(new String(new byte[] {'o', 'r', 'g', '.', 'b', 'u', 'k', 'k', 'i', 't', '.', 'c', 'r', 'a', 'f', 't', 'b', 'u', 'k', 'k', 'i', 't'})),
;
private final String uri;
private PackageWrapper(String uri) {
this.uri = uri;
}
/**
* @return The Uri for that package
*/
public String getUri() {
return uri;
}
}
@@ -1,197 +0,0 @@
package de.tr7zw.changeme.nbtapi.utils.nmsmappings;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.util.UUID;
import org.bukkit.inventory.ItemStack;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
/**
* This class caches method reflections, keeps track of method name changes between versions and allows early checking for problems
*
* @author tr7zw
*
*/
@SuppressWarnings("javadoc")
public enum ReflectionMethod {
COMPOUND_SET_FLOAT(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, float.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setFloat")),
COMPOUND_SET_STRING(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setString")),
COMPOUND_SET_INT(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, int.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setInt")),
COMPOUND_SET_BYTEARRAY(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, byte[].class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setByteArray")),
COMPOUND_SET_INTARRAY(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, int[].class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setIntArray")),
COMPOUND_SET_LONG(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, long.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setLong")),
COMPOUND_SET_SHORT(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, short.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setShort")),
COMPOUND_SET_BYTE(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, byte.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setByte")),
COMPOUND_SET_DOUBLE(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, double.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setDouble")),
COMPOUND_SET_BOOLEAN(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, boolean.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setBoolean")),
COMPOUND_SET_UUID(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, UUID.class}, MinecraftVersion.MC1_16_R1, new Since(MinecraftVersion.MC1_16_R1, "a")),
COMPOUND_MERGE(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "a")), //FIXME: No Spigot mapping!
COMPOUND_SET(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, ClassWrapper.NMS_NBTBASE.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "set")),
COMPOUND_GET(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "get")),
COMPOUND_GET_LIST(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class, int.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getList")),
COMPOUND_OWN_TYPE(ClassWrapper.NMS_NBTBASE.getClazz(), new Class[]{}, MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getTypeId")), // Only needed for 1.7.10 getType
COMPOUND_GET_FLOAT(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getFloat")),
COMPOUND_GET_STRING(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getString")),
COMPOUND_GET_INT(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getInt")),
COMPOUND_GET_BYTEARRAY(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getByteArray")),
COMPOUND_GET_INTARRAY(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getIntArray")),
COMPOUND_GET_LONG(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getLong")),
COMPOUND_GET_SHORT(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getShort")),
COMPOUND_GET_BYTE(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getByte")),
COMPOUND_GET_DOUBLE(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getDouble")),
COMPOUND_GET_BOOLEAN(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getBoolean")),
COMPOUND_GET_UUID(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_16_R1, new Since(MinecraftVersion.MC1_16_R1, "a")),
COMPOUND_GET_COMPOUND(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getCompound")),
NMSITEM_GETTAG(ClassWrapper.NMS_ITEMSTACK.getClazz(), new Class[] {}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getTag")),
NMSITEM_SAVE(ClassWrapper.NMS_ITEMSTACK.getClazz(), new Class[] {ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "save")),
NMSITEM_CREATESTACK(ClassWrapper.NMS_ITEMSTACK.getClazz(), new Class[] {ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_10_R1, new Since(MinecraftVersion.MC1_7_R4, "createStack")),
COMPOUND_REMOVE_KEY(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "remove")),
COMPOUND_HAS_KEY(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "hasKey")),
COMPOUND_GET_TYPE(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "b"), new Since(MinecraftVersion.MC1_9_R1, "d"), new Since(MinecraftVersion.MC1_15_R1, "e"), new Since(MinecraftVersion.MC1_16_R1, "d")), //FIXME: No Spigot mapping!
COMPOUND_GET_KEYS(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "c"), new Since(MinecraftVersion.MC1_13_R1, "getKeys")),
LISTCOMPOUND_GET_KEYS(ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), new Class[]{}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "c"), new Since(MinecraftVersion.MC1_13_R1, "getKeys")),
LIST_REMOVE_KEY(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{int.class}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "a"), new Since(MinecraftVersion.MC1_9_R1, "remove")),
LIST_SIZE(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "size")),
LIST_SET(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{int.class, ClassWrapper.NMS_NBTBASE.getClazz()}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "a"), new Since(MinecraftVersion.MC1_13_R1, "set")),
LEGACY_LIST_ADD(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{ClassWrapper.NMS_NBTBASE.getClazz()}, MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_13_R2, new Since(MinecraftVersion.MC1_7_R4, "add")),
LIST_ADD(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{int.class, ClassWrapper.NMS_NBTBASE.getClazz()}, MinecraftVersion.MC1_14_R1, new Since(MinecraftVersion.MC1_14_R1, "add")),
LIST_GET_STRING(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{int.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getString")),
LIST_GET_COMPOUND(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{int.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "get")),
LIST_GET(ClassWrapper.NMS_NBTTAGLIST.getClazz(), new Class[]{int.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "get"), new Since(MinecraftVersion.MC1_8_R3, "g"), new Since(MinecraftVersion.MC1_9_R1, "h"), new Since(MinecraftVersion.MC1_12_R1, "i"), new Since(MinecraftVersion.MC1_13_R1, "get")),
ITEMSTACK_SET_TAG(ClassWrapper.NMS_ITEMSTACK.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "setTag")),
ITEMSTACK_NMSCOPY(ClassWrapper.CRAFT_ITEMSTACK.getClazz(), new Class[]{ItemStack.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "asNMSCopy")),
ITEMSTACK_BUKKITMIRROR(ClassWrapper.CRAFT_ITEMSTACK.getClazz(), new Class[]{ClassWrapper.NMS_ITEMSTACK.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "asCraftMirror")),
CRAFT_WORLD_GET_HANDLE(ClassWrapper.CRAFT_WORLD.getClazz(), new Class[]{}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getHandle")),
NMS_WORLD_GET_TILEENTITY(ClassWrapper.NMS_WORLDSERVER.getClazz(), new Class[]{ClassWrapper.NMS_BLOCKPOSITION.getClazz()}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "getTileEntity")),
NMS_WORLD_SET_TILEENTITY(ClassWrapper.NMS_WORLDSERVER.getClazz(), new Class[]{ClassWrapper.NMS_BLOCKPOSITION.getClazz(), ClassWrapper.NMS_TILEENTITY.getClazz()}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "setTileEntity")),
NMS_WORLD_REMOVE_TILEENTITY(ClassWrapper.NMS_WORLDSERVER.getClazz(), new Class[]{ClassWrapper.NMS_BLOCKPOSITION.getClazz()}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "t"), new Since(MinecraftVersion.MC1_9_R1, "s"), new Since(MinecraftVersion.MC1_13_R1, "n"), new Since(MinecraftVersion.MC1_14_R1, "removeTileEntity")),
NMS_WORLD_GET_TILEENTITY_1_7_10(ClassWrapper.NMS_WORLDSERVER.getClazz(), new Class[]{int.class, int.class, int.class}, MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getTileEntity")),
TILEENTITY_LOAD_LEGACY191(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_MINECRAFTSERVER.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_9_R1, MinecraftVersion.MC1_9_R1, new Since(MinecraftVersion.MC1_9_R1, "a")), //FIXME: No Spigot mapping!
TILEENTITY_LOAD_LEGACY183(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_8_R3, MinecraftVersion.MC1_9_R2, new Since(MinecraftVersion.MC1_8_R3, "c"), new Since(MinecraftVersion.MC1_9_R1, "a"), new Since(MinecraftVersion.MC1_9_R2, "c")), //FIXME: No Spigot mapping!
TILEENTITY_LOAD_LEGACY1121(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_WORLD.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_10_R1, MinecraftVersion.MC1_12_R1, new Since(MinecraftVersion.MC1_10_R1, "a"), new Since(MinecraftVersion.MC1_12_R1, "create")),
TILEENTITY_LOAD_LEGACY1151(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_13_R1, MinecraftVersion.MC1_15_R1, new Since(MinecraftVersion.MC1_12_R1, "create")),
TILEENTITY_LOAD(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_IBLOCKDATA.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_16_R1, new Since(MinecraftVersion.MC1_16_R1, "create")),
TILEENTITY_GET_NBT(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "b"), new Since(MinecraftVersion.MC1_9_R1, "save")),
TILEENTITY_SET_NBT_LEGACY1151(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_15_R1, new Since(MinecraftVersion.MC1_7_R4, "a"), new Since(MinecraftVersion.MC1_12_R1, "load")),
TILEENTITY_SET_NBT(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{ClassWrapper.NMS_IBLOCKDATA.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_16_R1, new Since(MinecraftVersion.MC1_16_R1, "load")),
TILEENTITY_GET_BLOCKDATA(ClassWrapper.NMS_TILEENTITY.getClazz(), new Class[]{}, MinecraftVersion.MC1_16_R1, new Since(MinecraftVersion.MC1_16_R1, "getBlock")),
CRAFT_ENTITY_GET_HANDLE(ClassWrapper.CRAFT_ENTITY.getClazz(), new Class[]{}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getHandle")),
NMS_ENTITY_SET_NBT(ClassWrapper.NMS_ENTITY.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "f"), new Since(MinecraftVersion.MC1_16_R1, "load")), //FIXME: No Spigot mapping!
NMS_ENTITY_GET_NBT(ClassWrapper.NMS_ENTITY.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "e"), new Since(MinecraftVersion.MC1_12_R1, "save")),
NMS_ENTITY_GETSAVEID(ClassWrapper.NMS_ENTITY.getClazz(), new Class[]{}, MinecraftVersion.MC1_14_R1,new Since(MinecraftVersion.MC1_14_R1, "getSaveID")),
NBTFILE_READ(ClassWrapper.NMS_NBTCOMPRESSEDSTREAMTOOLS.getClazz(), new Class[]{InputStream.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "a")), //FIXME: No Spigot mapping!
NBTFILE_WRITE(ClassWrapper.NMS_NBTCOMPRESSEDSTREAMTOOLS.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), OutputStream.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "a")), //FIXME: No Spigot mapping!
PARSE_NBT(ClassWrapper.NMS_MOJANGSONPARSER.getClazz(), new Class[]{String.class}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "parse")),
REGISTRY_KEYSET (ClassWrapper.NMS_REGISTRYSIMPLE.getClazz(), new Class[]{}, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "keySet")),
REGISTRY_GET (ClassWrapper.NMS_REGISTRYSIMPLE.getClazz(), new Class[]{Object.class}, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "get")),
REGISTRY_SET (ClassWrapper.NMS_REGISTRYSIMPLE.getClazz(), new Class[]{Object.class, Object.class}, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "a")), //FIXME: No Spigot mapping!
REGISTRY_GET_INVERSE (ClassWrapper.NMS_REGISTRYMATERIALS.getClazz(), new Class[]{Object.class}, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "b")), //FIXME: No Spigot mapping!
REGISTRYMATERIALS_KEYSET (ClassWrapper.NMS_REGISTRYMATERIALS.getClazz(), new Class[]{}, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_13_R1, "keySet")),
REGISTRYMATERIALS_GET (ClassWrapper.NMS_REGISTRYMATERIALS.getClazz(), new Class[]{ClassWrapper.NMS_MINECRAFTKEY.getClazz()}, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_13_R1, "get")),
REGISTRYMATERIALS_GETKEY (ClassWrapper.NMS_REGISTRYMATERIALS.getClazz(), new Class[]{Object.class}, MinecraftVersion.MC1_13_R2, new Since(MinecraftVersion.MC1_13_R2, "getKey")),
GAMEPROFILE_DESERIALIZE (ClassWrapper.NMS_GAMEPROFILESERIALIZER.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "deserialize")),
GAMEPROFILE_SERIALIZE (ClassWrapper.NMS_GAMEPROFILESERIALIZER.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), ClassWrapper.GAMEPROFILE.getClazz()}, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "serialize")),
CRAFT_PERSISTENT_DATA_CONTAINER_TO_TAG (ClassWrapper.CRAFT_PERSISTENTDATACONTAINER.getClazz(), new Class[]{}, MinecraftVersion.MC1_14_R1, new Since(MinecraftVersion.MC1_14_R1, "toTagCompound")),
CRAFT_PERSISTENT_DATA_CONTAINER_GET_MAP (ClassWrapper.CRAFT_PERSISTENTDATACONTAINER.getClazz(), new Class[]{}, MinecraftVersion.MC1_14_R1, new Since(MinecraftVersion.MC1_14_R1, "getRaw")),
CRAFT_PERSISTENT_DATA_CONTAINER_PUT_ALL (ClassWrapper.CRAFT_PERSISTENTDATACONTAINER.getClazz(), new Class[]{ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()}, MinecraftVersion.MC1_14_R1, new Since(MinecraftVersion.MC1_14_R1, "putAll")),
;
private MinecraftVersion removedAfter;
private Since targetVersion;
private Method method;
private boolean loaded = false;
private boolean compatible = false;
private String methodName = null;
ReflectionMethod(Class<?> targetClass, Class<?>[] args, MinecraftVersion addedSince, MinecraftVersion removedAfter, Since... methodnames){
this.removedAfter = removedAfter;
if(!MinecraftVersion.isAtLeastVersion(addedSince) || (this.removedAfter != null && MinecraftVersion.isNewerThan(removedAfter)))return;
compatible = true;
MinecraftVersion server = MinecraftVersion.getVersion();
Since target = methodnames[0];
for(Since s : methodnames){
if(s.version.getVersionId() <= server.getVersionId() && target.version.getVersionId() < s.version.getVersionId())
target = s;
}
targetVersion = target;
try{
method = targetClass.getMethod(targetVersion.name, args);
method.setAccessible(true);
loaded = true;
methodName = targetVersion.name;
}catch(NullPointerException | NoSuchMethodException | SecurityException ex){
System.out.println("[NBTAPI] Unable to find the method '" + targetVersion.name + "' in '" + (targetClass == null ? "null" : targetClass.getSimpleName()) + "' Enum: " + this); //NOSONAR This gets loaded before the logger is loaded
}
}
ReflectionMethod(Class<?> targetClass, Class<?>[] args, MinecraftVersion addedSince, Since... methodnames){
this(targetClass, args, addedSince, null, methodnames);
}
/**
* Runs the method on a given target object using the given args.
*
* @param target
* @param args
* @return Value returned by the method
*/
public Object run(Object target, Object... args){
if(method == null)
throw new NbtApiException("Method not loaded! '" + this + "'");
try{
return method.invoke(target, args);
}catch(Exception ex){
throw new NbtApiException("Error while calling the method '" + methodName + "', loaded: " + loaded + ", Enum: " + this, ex);
}
}
/**
* @return The MethodName, used in this Minecraft Version
*/
public String getMethodName() {
return methodName;
}
/**
* @return Has this method been linked
*/
public boolean isLoaded() {
return loaded;
}
/**
* @return Is this method available in this Minecraft Version
*/
public boolean isCompatible() {
return compatible;
}
protected static class Since{
public final MinecraftVersion version;
public final String name;
public Since(MinecraftVersion version, String name) {
this.version = version;
this.name = name;
}
}
}
-22
View File
@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2020 tr7zw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-102
View File
@@ -1,102 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>${nbt.version}</version>
</parent>
<artifactId>item-nbt-api-plugin</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>${nbt.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-injector</artifactId>
<version>${nbt.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-data-api</artifactId>
<version>${nbt.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>de.tr7zw.changeme.nbtapi</pattern>
<shadedPattern>de.tr7zw.nbtapi</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
<!-- Start and Stop a SpigotMC server automatically before and after the integration-test phase. -->
<plugin>
<groupId>de.tr7zw.spigotmc.maven</groupId>
<artifactId>tr-spigotmc-maven-plugin</artifactId>
<version>0.0.3-SNAPSHOT</version>
<executions>
<execution>
<id>start-server</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-server</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- 1.8.8-R0.1-SNAPSHOT-latest, 1.9.2-R0.1-SNAPSHOT-latest, 1.9.4-R0.1-SNAPSHOT-latest, 1.10.2-R0.1-SNAPSHOT-latest,1.11.2,1.12.2,1.13.2,1.14.4,1.15.1,1.16.1,1.16.2 -->
<versions>
https://yivesmirror.com/files/paper/PaperSpigot-1.8.8-R0.1-SNAPSHOT-latest.jar,
1.9.2-R0.1-SNAPSHOT-latest, 1.9.4-R0.1-SNAPSHOT-latest,
1.10.2-R0.1-SNAPSHOT-latest,
1.11.2,
1.12.2,
1.13.2,
1.14.4,
1.15.1,
https://yivesmirror.com/files/paper/Paper-1.16.4-latest.jar
</versions>
<works>Success! This version of NBT-API</works>
<error>WARNING! This version of NBT-API</error>
<filename>item-nbt-api-plugin-${project.version}.jar</filename>
<foldername>item-nbt-plugin</foldername>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,223 +0,0 @@
package de.tr7zw.nbtapi.plugin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
import de.tr7zw.nbtapi.plugin.tests.GameprofileTest;
import de.tr7zw.nbtapi.plugin.tests.NBTFileTest;
import de.tr7zw.nbtapi.plugin.tests.blocks.BlockNBTTest;
import de.tr7zw.nbtapi.plugin.tests.chunks.ChunkNBTPersistentTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.EqualsTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.ForEachTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.GetterSetterTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.IteratorTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.ListTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.MergeTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.RemovingKeys;
import de.tr7zw.nbtapi.plugin.tests.compounds.StreamTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.SubCompoundsTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.TypeTest;
import de.tr7zw.nbtapi.plugin.tests.data.WorldDataTest;
import de.tr7zw.nbtapi.plugin.tests.entities.EntityCustomNbtPersistentTest;
import de.tr7zw.nbtapi.plugin.tests.entities.EntityTest;
import de.tr7zw.nbtapi.plugin.tests.injector.EntityCustomNbtInjectorTest;
import de.tr7zw.nbtapi.plugin.tests.injector.MergeTileSubCompoundTest;
import de.tr7zw.nbtapi.plugin.tests.injector.SpawnEntityCustomNbtInjectorTest;
import de.tr7zw.nbtapi.plugin.tests.injector.TilesCustomNBTInjectorTest;
import de.tr7zw.nbtapi.plugin.tests.items.DirectApplyTest;
import de.tr7zw.nbtapi.plugin.tests.items.EmptyItemTest;
import de.tr7zw.nbtapi.plugin.tests.items.ItemConvertionTest;
import de.tr7zw.nbtapi.plugin.tests.tiles.TileTest;
import de.tr7zw.nbtapi.plugin.tests.tiles.TilesCustomNBTPersistentTest;
import de.tr7zw.nbtinjector.NBTInjector;
import de.tr7zw.nbtapi.plugin.tests.items.ItemMergingTest;
public class NBTAPI extends JavaPlugin {
private boolean compatible = true;
private ArrayList<de.tr7zw.nbtapi.plugin.tests.Test> apiTests = new ArrayList<>();
private static NBTAPI instance;
public static NBTAPI getInstance() {
return instance;
}
@Override
public void onLoad() {
getConfig().options().copyDefaults(true);
getConfig().addDefault("nbtInjector.enabled", false);
getConfig().addDefault("bStats.enabled", true);
getConfig().addDefault("updateCheck.enabled", true);
saveConfig();
if(!getConfig().getBoolean("bStats.enabled")) {
getLogger().info("bStats disabled");
MinecraftVersion.disableBStats();
}
if(!getConfig().getBoolean("updateCheck.enabled")) {
getLogger().info("Update check disabled");
MinecraftVersion.disableUpdateCheck();
}
//Disabled by default since 2.1. Enable it yourself by calling NBTInjector.inject(); during onLoad/config
if(getConfig().getBoolean("nbtInjector.enabled")) {
getLogger().info("Injecting custom NBT");
try {
NBTInjector.inject();
getLogger().info("Injected!");
} catch (Throwable ex) { // NOSONAR
getLogger().log(Level.SEVERE, "Error while Injecting custom Tile/Entity classes!", ex);
compatible = false;
}
}
// NBTCompounds
apiTests.add(new GetterSetterTest());
apiTests.add(new TypeTest());
apiTests.add(new RemovingKeys());
if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) // 1.7.10 list support is not complete at all
apiTests.add(new ListTest());
apiTests.add(new SubCompoundsTest());
if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) // 1.7.10 not a thing
apiTests.add(new MergeTest());
apiTests.add(new ForEachTest());
apiTests.add(new StreamTest());
apiTests.add(new EqualsTest());
if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) // 1.7.10 list support is not complete at all
apiTests.add(new IteratorTest());
// Items
if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) // 1.7.10 not a thing
apiTests.add(new ItemConvertionTest());
apiTests.add(new EmptyItemTest());
if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) { // 1.7.10 not a thing
apiTests.add(new ItemMergingTest());
apiTests.add(new DirectApplyTest());
}
// Entity
apiTests.add(new EntityTest());
apiTests.add(new EntityCustomNbtPersistentTest());
// Tiles
apiTests.add(new TileTest());
apiTests.add(new TilesCustomNBTPersistentTest());
// Chunks
apiTests.add(new ChunkNBTPersistentTest());
// Blocks
apiTests.add(new BlockNBTTest());
// Files
apiTests.add(new NBTFileTest());
// Data
apiTests.add(new WorldDataTest());
// Injector
apiTests.add(new TilesCustomNBTInjectorTest());
apiTests.add(new MergeTileSubCompoundTest());
apiTests.add(new EntityCustomNbtInjectorTest());
apiTests.add(new SpawnEntityCustomNbtInjectorTest());
if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3))
apiTests.add(new GameprofileTest());
}
@Override
public void onEnable() {
instance = this; // NOSONAR
// new MetricsLite(this); The metrics moved into the API
getLogger().info("Adding listeners...");
Bukkit.getPluginManager().registerEvents(new ReloadListener(), this);
getLogger().info("Gson:");
MinecraftVersion.hasGsonSupport();
getLogger().info("Checking bindings...");
MinecraftVersion.getVersion();
boolean classUnlinked = false;
for (ClassWrapper c : ClassWrapper.values()) {
if (c.isEnabled() && c.getClazz() == null) {
if(!classUnlinked)
getLogger().info("Classes:");
getLogger().warning(c.name() + " did not find it's class!");
compatible = false;
classUnlinked = true;
}
}
if (!classUnlinked)
getLogger().info("All Classes were able to link!");
boolean methodUnlinked = false;
for (ReflectionMethod method : ReflectionMethod.values()) {
if (method.isCompatible() && !method.isLoaded()) {
if(!methodUnlinked)
getLogger().info("Methods:");
getLogger().warning(method.name() + " did not find the method!");
compatible = false;
methodUnlinked = true;
}
}
if (!methodUnlinked)
getLogger().info("All Methods were able to link!");
getLogger().info("Running NBT reflection test...");
Map<de.tr7zw.nbtapi.plugin.tests.Test, Exception> results = new HashMap<>();
for (de.tr7zw.nbtapi.plugin.tests.Test test : apiTests) {
try {
test.test();
results.put(test, null);
} catch (Exception ex) {
results.put(test, ex);
getLogger().log(Level.WARNING, "Error during '" + test.getClass().getSimpleName() + "' test!", ex);
} catch (NoSuchFieldError th) { // NOSONAR
getLogger().log(Level.SEVERE, "Servere error during '" + test.getClass().getSimpleName() + "' test!");
getLogger().warning(
"WARNING! This version of Item-NBT-API seems to be broken with your Spigot version! Canceled the other tests!");
throw th;
}
}
for (Entry<de.tr7zw.nbtapi.plugin.tests.Test, Exception> entry : results.entrySet()) {
if (entry.getValue() != null)
compatible = false;
getLogger().info(entry.getKey().getClass().getSimpleName() + ": "
+ (entry.getValue() == null ? "Ok" : entry.getValue().getMessage()));
}
String checkMessage = "Plugins that don't check properly may throw Exeptions, crash or have unexpected behaviors!";
if (compatible) {
getLogger().info("Success! This version of NBT-API is compatible with your server.");
} else {
getLogger().warning(
"WARNING! This version of NBT-API seems to be broken with your Spigot version! " + checkMessage);
if(MinecraftVersion.getVersion() == MinecraftVersion.MC1_7_R4) {
getLogger().warning("1.7.10 is only partally supported! Some thing will not work/are not yet avaliable in 1.7.10!");
}
}
}
/**
* @return True if all selfchecks succeeded
*/
public boolean isCompatible() {
return compatible;
}
}
@@ -1,42 +0,0 @@
package de.tr7zw.nbtapi.plugin;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import de.tr7zw.nbtinjector.NBTInjector;
/**
* This listener class tries to prevent people from reloading while the NBTInjector is enabled.
*
* @author tr7zw
*
*/
public class ReloadListener implements Listener{
/**
* Console handler
*
* @param event
*/
@EventHandler
public void onCommand(org.bukkit.event.server.ServerCommandEvent event) {
if(event.getCommand().toLowerCase().startsWith("reload") && NBTInjector.isInjected()) {
event.setCancelled(true);
event.getSender().sendMessage("[NBTAPI] The NBTInjector is currently enabled. Reloading will turn the server into an unstable state and data-loss may accure. Please do a clean restart. Canceled reload!");
}
}
/**
* Player handler
*
* @param event
*/
@EventHandler
public void onCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
if(event.getMessage().toLowerCase().startsWith("/reload") && NBTInjector.isInjected()) {
event.setCancelled(true);
event.getPlayer().sendMessage("[NBTAPI] The NBTInjector is currently enabled. Reloading will turn the server into an unstable state and data-loss may accure. Please do a clean restart. Canceled reload!");
}
}
}
@@ -1,25 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTGameProfile;
import de.tr7zw.changeme.nbtapi.NbtApiException;
public class GameprofileTest implements Test {
@Override
public void test() throws Exception {
UUID uuid = UUID.randomUUID();
GameProfile profile = new GameProfile(uuid, "random");
NBTCompound nbt = NBTGameProfile.toNBT(profile);
profile = null;
profile = NBTGameProfile.fromNBT(nbt);
if (profile == null || !profile.getId().equals(uuid)) {
throw new NbtApiException("Error when converting a GameProfile from/to NBT!");
}
}
}
@@ -1,48 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests;
import java.io.File;
import java.nio.file.Files;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTFile;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.NBTAPI;
public class NBTFileTest implements Test {
@Override
public void test() throws Exception {
NBTAPI.getInstance().getDataFolder().mkdirs();
File testFile = new File(NBTAPI.getInstance().getDataFolder(), "test.nbt");
Files.deleteIfExists(testFile.toPath());
NBTFile file = new NBTFile(testFile);
file.addCompound("testcomp").setString("test1", "ok");
NBTCompound comp = file.getCompound("testcomp");
comp.setString("test2", "ok");
file.setLong("time", System.currentTimeMillis());
file.setString("test", "test");
NBTCompound chunks = file.addCompound("chunks");
NBTCompound chunk = chunks.addCompound("somechunk");
NBTCompound block = chunk.addCompound("someblock");
block.setString("type", "wool");
file.save();
if(!"wool".equals(block.getString("type"))) {
throw new NbtApiException("SubCompounds did not work!");
}
NBTFile fileLoaded = new NBTFile(testFile);
if (!fileLoaded.getString("test").equals("test")) {
throw new NbtApiException("Wasn't able to load NBT File with the correct content!");
}
Files.deleteIfExists(fileLoaded.getFile().toPath());
// String
String str = fileLoaded.asNBTString();
NBTContainer rebuild = new NBTContainer(str);
if (!str.equals(rebuild.asNBTString())) {
throw new NbtApiException("Wasn't able to parse NBT from a String!");
}
}
}
@@ -1,7 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests;
public interface Test {
public void test() throws Exception; // NOSONAR
}
@@ -1,40 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.blocks;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import de.tr7zw.changeme.nbtapi.NBTBlock;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class BlockNBTTest implements Test {
@Override
public void test() throws Exception {
if(MinecraftVersion.getVersion().getVersionId() < MinecraftVersion.MC1_16_R3.getVersionId())return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
if (world.getLoadedChunks().length > 1) {
Chunk chunk = world.getLoadedChunks()[0];
Block block = chunk.getBlock(0, 254, 0);
NBTBlock comp = new NBTBlock(block);
comp.getData().removeKey("Too");
if(comp.getData().hasKey("Too")) {
throw new NbtApiException("Unable to remove key from Block!");
}
comp.getData().setString("Too", "Bar");
if (!new NBTBlock(block).getData().getString("Too").equals("Bar")) {
throw new NbtApiException("Custom Data did not save to a Block!");
}
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTBlocks!", ex);
}
}
}
}
@@ -1,40 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.chunks;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import de.tr7zw.changeme.nbtapi.NBTChunk;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class ChunkNBTPersistentTest implements Test {
@Override
public void test() throws Exception {
if(MinecraftVersion.getVersion().getVersionId() < MinecraftVersion.MC1_16_R3.getVersionId())return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
if (world.getLoadedChunks().length > 1) {
Chunk chunk = world.getLoadedChunks()[0];
NBTChunk comp = new NBTChunk(chunk);
NBTCompound persistentData = comp.getPersistentDataContainer();
persistentData.removeKey("Foo");
if(persistentData.hasKey("Foo")) {
throw new NbtApiException("Unable to remove key from Chunk!");
}
persistentData.setString("Foo", "Bar");
if (!new NBTChunk(chunk).getPersistentDataContainer().getString("Foo").equals("Bar")) {
throw new NbtApiException("Custom Data did not save to the Chunk!");
}
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTChunks!", ex);
}
}
}
}
@@ -1,36 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import java.util.Arrays;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTItem;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class EqualsTest implements Test{
@Override
public void test() throws Exception {
NBTContainer cont = new NBTContainer();
cont.setString("hello", "world");
cont.setInteger("theAnswer", 42);
cont.addCompound("sub").setString("me", "too");
cont.getStringList("somelist").addAll(Arrays.asList("a", "b", "c"));
ItemStack item = new ItemStack(Material.STONE);
NBTItem nbti = new NBTItem(item);
NBTCompound customData = nbti.addCompound("customData");
// reverse order
customData.addCompound("sub").setString("me", "too");
customData.setInteger("theAnswer", 42);
customData.setString("hello", "world");
customData.getStringList("somelist").addAll(Arrays.asList("a", "b", "c"));
if(!customData.equals(cont)) {
throw new NbtApiException("Compounds did not match! " + customData + " " + cont);
}
}
}
@@ -1,50 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import java.util.ListIterator;
import de.tr7zw.changeme.nbtapi.NBTCompoundList;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTListCompound;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
/**
* Test requested by TAU on Discord
*
*/
public class ForEachTest implements Test {
@SuppressWarnings("unused")
@Override
public void test() throws Exception {
NBTContainer comp = new NBTContainer();
NBTCompoundList compList = comp.getCompoundList("testkey");
if (compList != null) {
compList.addCompound().setInteger("id", 1);
compList.addCompound().setInteger("id", 2);
compList.addCompound().setInteger("id", 3);
int count = 0;
for (NBTListCompound listComp : compList) {
count++;
}
if(count != compList.size())
throw new NbtApiException("For loop did not get all Entries!");
count = 0;
ListIterator<NBTListCompound> lit = compList.listIterator();
while(lit.hasNext()){
lit.next();
count++;
}
if(count != compList.size())
throw new NbtApiException("ListIterator did not get all Entries!");
count = 0;
while(lit.hasPrevious()){
lit.previous();
count++;
}
if(count != compList.size())
throw new NbtApiException("ListIterator previous did not get all Entries!");
}
}
}
@@ -1,61 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class GetterSetterTest implements Test {
private static final String STRING_TEST_KEY = "stringTest";
private static final String INT_TEST_KEY = "intTest";
private static final String DOUBLE_TEST_KEY = "doubleTest";
private static final String BOOLEAN_TEST_KEY = "booleanTest";
private static final String SHORT_TEST_KEY = "shortTest";
private static final String BYTE_TEST_KEY = "byteTest";
private static final String FLOAT_TEST_KEY = "floatTest";
private static final String LONG_TEST_KEY = "longTest";
private static final String INTARRAY_TEST_KEY = "intarrayTest";
private static final String BYTEARRAY_TEST_KEY = "bytearrayTest";
private static final String STRING_TEST_VALUE = "TestString";
private static final int INT_TEST_VALUE = 42;
private static final double DOUBLE_TEST_VALUE = 1.5d;
private static final boolean BOOLEAN_TEST_VALUE = true;
private static final short SHORT_TEST_VALUE = 64;
private static final byte BYTE_TEST_VALUE = 7;
private static final float FLOAT_TEST_VALUE = 13.37f;
private static final long LONG_TEST_VALUE = (long) Integer.MAX_VALUE + 42L;
private static final int[] INTARRAY_TEST_VALUE = new int[] { 1337, 42, 69 };
private static final byte[] BYTEARRAY_TEST_VALUE = new byte[] { 8, 7, 3, 2 };
@Override
public void test() throws Exception {
NBTContainer comp = new NBTContainer();
comp.setString(STRING_TEST_KEY, STRING_TEST_VALUE);
comp.setInteger(INT_TEST_KEY, INT_TEST_VALUE);
comp.setDouble(DOUBLE_TEST_KEY, DOUBLE_TEST_VALUE);
comp.setBoolean(BOOLEAN_TEST_KEY, BOOLEAN_TEST_VALUE);
comp.setByte(BYTE_TEST_KEY, BYTE_TEST_VALUE);
comp.setShort(SHORT_TEST_KEY, SHORT_TEST_VALUE);
comp.setLong(LONG_TEST_KEY, LONG_TEST_VALUE);
comp.setFloat(FLOAT_TEST_KEY, FLOAT_TEST_VALUE);
comp.setIntArray(INTARRAY_TEST_KEY, INTARRAY_TEST_VALUE);
comp.setByteArray(BYTEARRAY_TEST_KEY, BYTEARRAY_TEST_VALUE);
if (!comp.hasKey(STRING_TEST_KEY)) {
throw new NbtApiException("Wasn't able to check a key! The Item-NBT-API may not work!");
}
if (!(STRING_TEST_VALUE).equals(comp.getString(STRING_TEST_KEY))
|| comp.getInteger(INT_TEST_KEY) != INT_TEST_VALUE
|| comp.getDouble(DOUBLE_TEST_KEY) != DOUBLE_TEST_VALUE
|| comp.getByte(BYTE_TEST_KEY) != BYTE_TEST_VALUE || comp.getShort(SHORT_TEST_KEY) != SHORT_TEST_VALUE
|| comp.getFloat(FLOAT_TEST_KEY) != FLOAT_TEST_VALUE || comp.getLong(LONG_TEST_KEY) != LONG_TEST_VALUE
|| comp.getIntArray(INTARRAY_TEST_KEY).length != (INTARRAY_TEST_VALUE).length
|| comp.getByteArray(BYTEARRAY_TEST_KEY).length != (BYTEARRAY_TEST_VALUE).length
|| !comp.getBoolean(BOOLEAN_TEST_KEY).equals(BOOLEAN_TEST_VALUE)) {
throw new NbtApiException("One key does not equal the original value! The Item-NBT-API may not work!");
}
}
}
@@ -1,94 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import de.tr7zw.changeme.nbtapi.NBTItem;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class GsonTest implements Test {
@Override
public void test() throws Exception {
if (!MinecraftVersion.hasGsonSupport()) {
return;
}
try {
ItemStack item = new ItemStack(Material.STONE, 1);
NBTItem nbtItem = new NBTItem(item);
nbtItem.setObject(JSON_TEST_KEY, new SimpleJsonTestObject());
if (!nbtItem.hasKey(JSON_TEST_KEY)) {
throw new NbtApiException(
"Wasn't able to find JSON key! The Item-NBT-API may not work with Json serialization/deserialization!");
} else {
SimpleJsonTestObject simpleObject = nbtItem.getObject(JSON_TEST_KEY, SimpleJsonTestObject.class);
if (simpleObject == null) {
throw new NbtApiException(
"Wasn't able to check JSON key! The Item-NBT-API may not work with Json serialization/deserialization!");
} else if (!(STRING_TEST_VALUE).equals(simpleObject.getTestString())
|| simpleObject.getTestInteger() != INT_TEST_VALUE
|| simpleObject.getTestDouble() != DOUBLE_TEST_VALUE
|| !simpleObject.isTestBoolean() == BOOLEAN_TEST_VALUE) {
throw new NbtApiException(
"One key does not equal the original value in JSON! The Item-NBT-API may not work with Json serialization/deserialization!");
}
}
} catch (Exception ex) {
throw new NbtApiException("Exception during Gson check!", ex);
}
}
// region STATIC FINAL VARIABLES
private static final String JSON_TEST_KEY = "jsonTest";
private static final String STRING_TEST_VALUE = "TestString";
private static final int INT_TEST_VALUE = 42;
private static final double DOUBLE_TEST_VALUE = 1.5d;
private static final boolean BOOLEAN_TEST_VALUE = true;
// end region STATIC FINAL VARIABLES
public static class SimpleJsonTestObject {
private String testString = STRING_TEST_VALUE;
private int testInteger = INT_TEST_VALUE;
private double testDouble = DOUBLE_TEST_VALUE;
private boolean testBoolean = BOOLEAN_TEST_VALUE;
public String getTestString() {
return testString;
}
public void setTestString(String testString) {
this.testString = testString;
}
public int getTestInteger() {
return testInteger;
}
public void setTestInteger(int testInteger) {
this.testInteger = testInteger;
}
public double getTestDouble() {
return testDouble;
}
public void setTestDouble(double testDouble) {
this.testDouble = testDouble;
}
public boolean isTestBoolean() {
return testBoolean;
}
public void setTestBoolean(boolean testBoolean) {
this.testBoolean = testBoolean;
}
}
}
@@ -1,65 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTList;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class IteratorTest implements Test {
@Override
public void test() throws Exception {
NBTList<Integer> testList;
testList = initIntegerList();
testIterator(testList.iterator());
testList = initIntegerList();
testIterator(testList.listIterator());
}
private NBTList<Integer> initIntegerList() {
NBTContainer comp = new NBTContainer();
NBTList<Integer> list = comp.getIntegerList("test");
list.add(1);
list.add(2);
list.add(3);
list.add(4);
return list;
}
private static void testIterator(Iterator<Integer> iterator) {
assertTrue(iterator.hasNext());
assertTrue(iterator.next() == 1);
assertTrue(iterator.hasNext());
assertTrue(iterator.next() == 2);
iterator.remove();
assertTrue(iterator.hasNext());
assertTrue(iterator.next() == 3);
assertTrue(iterator.hasNext());
assertTrue(iterator.next() == 4);
testNoMoreElements(iterator);
}
private static void testNoMoreElements(Iterator<Integer> iterator) {
assertTrue(!iterator.hasNext());
try {
iterator.next();
} catch(NoSuchElementException expected) {
return;
} catch(Exception e) {
throw new NbtApiException("iterator threw wrong exception: " + e.toString());
}
throw new NbtApiException("iterator did not throw exception");
}
private static void assertTrue(boolean condition) {
if(!condition) {
throw new NbtApiException("iterator test failed");
}
}
}
@@ -1,133 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import java.util.Arrays;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTCompoundList;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTList;
import de.tr7zw.changeme.nbtapi.NBTListCompound;
import de.tr7zw.changeme.nbtapi.NBTType;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class ListTest implements Test {
@Override
public void test() throws Exception {
NBTContainer comp = new NBTContainer();
// Strings
NBTList<String> list = comp.getStringList("testlist");
list.add("test1");
list.add("test2");
list.add("test3");
list.add("test4");
list.set(2, "test42");
list.remove(1);
if (!list.get(1).equals("test42") || list.size() != 3) {
throw new NbtApiException("The String-list did not match what it should have looked like.");
}
// Compound
NBTCompoundList taglist = comp.getCompoundList("complist");
NBTListCompound lcomp = taglist.addCompound();
lcomp.setDouble("double1", 0.3333);
lcomp.setInteger("int1", 42);
lcomp.setString("test1", "test1");
lcomp.setString("test2", "test2");
lcomp.removeKey("test1");
NBTCompound subsubcomp = lcomp.addCompound("listsubkey");
subsubcomp.setString("deep", "String");
subsubcomp.getCompoundList("deeplist").addCompound().setString("test", "test");
subsubcomp.getCompoundList("clonelist").addCompound(comp);
taglist = null;
lcomp = null;
subsubcomp = null;
taglist = comp.getCompoundList("complist");
if (taglist.size() == 1) {
lcomp = taglist.get(0);
if (lcomp.getKeys().size() != 4) {
throw new NbtApiException("Wrong key amount in Taglist (" + lcomp.getKeys().size() + ")!");
} else if (!(lcomp.getDouble("double1") == 0.3333 && lcomp.getInteger("int1") == 42
&& lcomp.getString("test2").equals("test2") && !lcomp.hasKey("test1"))) {
throw new NbtApiException("One key in the Taglist changed! The Item-NBT-API may not work!");
} else if (lcomp.getCompound("listsubkey") == null
|| !"String".equals(lcomp.getCompound("listsubkey").getString("deep"))) {
throw new NbtApiException(
"The Compound nested in the listcompound was not correct! The Item-NBT-API may not work!");
} else if (lcomp.getCompound("listsubkey").getType("deep") != NBTType.NBTTagString) {
throw new NbtApiException("The nested key's type wasn't correct! The Item-NBT-API may not work!");
} else if (lcomp.getCompound("listsubkey").getType("deeplist") != NBTType.NBTTagList) {
throw new NbtApiException("The nested list's type wasn't correct '"
+ lcomp.getCompound("listsubkey").getType("deeplist") + "'! The Item-NBT-API may not work!");
}
} else {
throw new NbtApiException("Taglist is empty! The Item-NBT-API may not work!");
}
if(comp.getListType("complist") != NBTType.NBTTagCompound) {
throw new NbtApiException("complist had the wrong type! The Item-NBT-API may not work!");
}
// Integer
NBTList<Integer> intlist = comp.getIntegerList("inttest");
intlist.add(42);
intlist.add(69);
if (intlist.size() == 2 && intlist.get(0) == 42 && intlist.get(1) == 69) {
// ok
} else {
throw new NbtApiException("IntList is not correct! " + Arrays.toString(intlist.toArray(new Integer[0])));
}
if(comp.getListType("inttest") != NBTType.NBTTagInt) {
throw new NbtApiException("inttest had the wrong type! The Item-NBT-API may not work!");
}
// Double
NBTList<Double> doublelist = comp.getDoubleList("doubletest");
doublelist.add(42.23d);
doublelist.add(69.69d);
if (doublelist.size() == 2 && doublelist.get(0) == 42.23d && doublelist.get(1) == 69.69d) {
// ok
} else {
throw new NbtApiException("DoubleList is not correct! " + Arrays.toString(doublelist.toArray(new Double[0])));
}
if(comp.getListType("doubletest") != NBTType.NBTTagDouble) {
throw new NbtApiException("doubletest had the wrong type! The Item-NBT-API may not work!");
}
// Float
NBTList<Float> floatlist = comp.getFloatList("floattest");
floatlist.add(42.23f);
floatlist.add(69.69f);
if (floatlist.size() == 2 && floatlist.get(0) == 42.23f && floatlist.get(1) == 69.69f) {
// ok
} else {
throw new NbtApiException("FloatList is not correct! " + Arrays.toString(floatlist.toArray(new Float[0])));
}
if(comp.getListType("floattest") != NBTType.NBTTagFloat) {
throw new NbtApiException("floattest had the wrong type! The Item-NBT-API may not work!");
}
// Long
NBTList<Long> longlist = comp.getLongList("longtest");
longlist.add(1241234124124l);
longlist.add(1231454321312l);
if (longlist.size() == 2 && longlist.get(0) == 1241234124124l && longlist.get(1) == 1231454321312l) {
// ok
} else {
throw new NbtApiException("LongList is not correct! " + Arrays.toString(longlist.toArray(new Long[0])));
}
if(comp.getListType("longtest") != NBTType.NBTTagLong) {
throw new NbtApiException("longtest had the wrong type! The Item-NBT-API may not work!");
}
}
}
@@ -1,22 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class MergeTest implements Test {
@Override
public void test() throws Exception {
NBTContainer test1 = new NBTContainer();
test1.setString("test1", "test");
NBTContainer test2 = new NBTContainer();
test2.setString("test2", "test");
test2.addCompound("test").setLong("time", System.currentTimeMillis());
test1.mergeCompound(test2);
if (!test1.getString("test1").equals(test1.getString("test2"))) {
throw new NbtApiException("Wasn't able to merge Compounds!");
}
}
}
@@ -1,67 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class RemovingKeys implements Test {
private static final String STRING_TEST_KEY = "stringTest";
private static final String INT_TEST_KEY = "intTest";
private static final String DOUBLE_TEST_KEY = "doubleTest";
private static final String BOOLEAN_TEST_KEY = "booleanTest";
private static final String SHORT_TEST_KEY = "shortTest";
private static final String BYTE_TEST_KEY = "byteTest";
private static final String FLOAT_TEST_KEY = "floatTest";
private static final String LONG_TEST_KEY = "longTest";
private static final String INTARRAY_TEST_KEY = "intarrayTest";
private static final String BYTEARRAY_TEST_KEY = "bytearrayTest";
private static final String STRING_TEST_VALUE = "TestString";
private static final int INT_TEST_VALUE = 42;
private static final double DOUBLE_TEST_VALUE = 1.5d;
private static final boolean BOOLEAN_TEST_VALUE = true;
private static final short SHORT_TEST_VALUE = 64;
private static final byte BYTE_TEST_VALUE = 7;
private static final float FLOAT_TEST_VALUE = 13.37f;
private static final long LONG_TEST_VALUE = (long) Integer.MAX_VALUE + 42L;
private static final int[] INTARRAY_TEST_VALUE = new int[] { 1337, 42, 69 };
private static final byte[] BYTEARRAY_TEST_VALUE = new byte[] { 8, 7, 3, 2 };
@Override
public void test() throws Exception {
NBTContainer comp = new NBTContainer();
comp.setString(STRING_TEST_KEY, STRING_TEST_VALUE);
comp.setInteger(INT_TEST_KEY, INT_TEST_VALUE);
comp.setDouble(DOUBLE_TEST_KEY, DOUBLE_TEST_VALUE);
comp.setBoolean(BOOLEAN_TEST_KEY, BOOLEAN_TEST_VALUE);
comp.setByte(BYTE_TEST_KEY, BYTE_TEST_VALUE);
comp.setShort(SHORT_TEST_KEY, SHORT_TEST_VALUE);
comp.setLong(LONG_TEST_KEY, LONG_TEST_VALUE);
comp.setFloat(FLOAT_TEST_KEY, FLOAT_TEST_VALUE);
comp.setIntArray(INTARRAY_TEST_KEY, INTARRAY_TEST_VALUE);
comp.setByteArray(BYTEARRAY_TEST_KEY, BYTEARRAY_TEST_VALUE);
if (comp.getKeys().size() != 10) {
throw new NbtApiException("Key amount did not match after setting keys!");
}
comp.setString(STRING_TEST_KEY, null);
comp.setInteger(INT_TEST_KEY, null);
comp.setDouble(DOUBLE_TEST_KEY, null);
comp.setBoolean(BOOLEAN_TEST_KEY, null);
comp.setByte(BYTE_TEST_KEY, null);
comp.setShort(SHORT_TEST_KEY, null);
comp.setLong(LONG_TEST_KEY, null);
comp.setFloat(FLOAT_TEST_KEY, null);
comp.setIntArray(INTARRAY_TEST_KEY, null);
comp.setByteArray(BYTEARRAY_TEST_KEY, null);
if (comp.getKeys().size() != 0) {
throw new NbtApiException("Keys where not removed using the setter with null!");
}
}
}
@@ -1,26 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class StreamTest implements Test{
@Override
public void test() throws Exception {
NBTContainer base = new NBTContainer();
base.addCompound("sub").setString("hello", "world");
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
base.getCompound("sub").writeCompound(outStream);
byte[] data = outStream.toByteArray();
ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
NBTContainer container = new NBTContainer(inputStream);
if(!container.toString().equals(base.getCompound("sub").toString())) {
throw new NbtApiException("Component content did not match! " + base.getCompound("sub") + " " + container);
}
}
}
@@ -1,56 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class SubCompoundsTest implements Test {
private static final String COMP_TEST_KEY = "componentTest";
private static final String STRING_TEST_KEY = "stringTest";
private static final String INT_TEST_KEY = "intTest";
private static final String DOUBLE_TEST_KEY = "doubleTest";
private static final String BOOLEAN_TEST_KEY = "booleanTest";
private static final String STRING_TEST_VALUE = "TestString";
private static final int INT_TEST_VALUE = 42;
private static final double DOUBLE_TEST_VALUE = 1.5d;
private static final boolean BOOLEAN_TEST_VALUE = true;
@Override
public void test() throws Exception {
NBTContainer cont = new NBTContainer();
NBTCompound comp = cont.addCompound(COMP_TEST_KEY);
comp.setString(STRING_TEST_KEY, STRING_TEST_VALUE + "2");
comp.setInteger(INT_TEST_KEY, INT_TEST_VALUE * 2);
comp.setDouble(DOUBLE_TEST_KEY, DOUBLE_TEST_VALUE * 2);
if (cont.getCompound("invalide") != null) {
throw new NbtApiException("An invalide compound did not return null!");
}
comp = null;
comp = cont.getCompound(COMP_TEST_KEY);
if (comp == null) {
throw new NbtApiException("Wasn't able to get the NBTCompound!");
}
if (!comp.hasKey(STRING_TEST_KEY)) {
throw new NbtApiException("Wasn't able to check a compound key!");
}
if (!(STRING_TEST_VALUE + "2").equals(comp.getString(STRING_TEST_KEY))
|| comp.getInteger(INT_TEST_KEY) != INT_TEST_VALUE * 2
|| comp.getDouble(DOUBLE_TEST_KEY) != DOUBLE_TEST_VALUE * 2
|| comp.getBoolean(BOOLEAN_TEST_KEY) == BOOLEAN_TEST_VALUE) {
throw new NbtApiException("One key does not equal the original compound value!");
}
// Using getOrCreateCompound twice
comp.getOrCreateCompound("someName").setString("test", "abc");
if(!comp.getOrCreateCompound("someName").getString("test").equals("abc")) {
throw new NbtApiException("getOrCreateCompound did not return the same compound!");
}
}
}
@@ -1,22 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTType;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class TypeTest implements Test {
@Override
public void test() throws Exception {
NBTCompound comp = new NBTContainer();
comp.setString("s", "test");
comp.setInteger("i", 42);
comp.addCompound("c");
if (comp.getType("s") != NBTType.NBTTagString || comp.getType("i") != NBTType.NBTTagInt
|| comp.getType("c") != NBTType.NBTTagCompound)
throw new NbtApiException("One parsed type did not match what it should have been!");
}
}
@@ -1,24 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.data;
import java.io.File;
import org.bukkit.Bukkit;
import org.bukkit.World;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.data.NBTData;
import de.tr7zw.changeme.nbtapi.data.WorldData;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class WorldDataTest implements Test{
@Override
public void test() throws Exception {
for(World world : Bukkit.getWorlds()){
if(!new File(world.getWorldFolder(), "level.dat").exists())continue;
WorldData data = NBTData.getWorldData(world);
if(data.getWorldName() == null || data.getSpawnPosition() == null)throw new NbtApiException("Got Null");
}
}
}
@@ -1,41 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.entities;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Monster;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class EntityCustomNbtPersistentTest implements Test {
@Override
public void test() throws Exception {
if(MinecraftVersion.getVersion().getVersionId() < MinecraftVersion.MC1_14_R1.getVersionId())return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
if (!world.getEntitiesByClasses(Animals.class, Monster.class).isEmpty()) {
Entity ent = world.getEntitiesByClasses(Animals.class, Monster.class).iterator().next();
NBTEntity nbtEnt = new NBTEntity(ent);
NBTCompound comp = nbtEnt.getPersistentDataContainer();
comp.setString("Hello", "World");
NBTEntity nbtent = new NBTEntity(ent);
if (!nbtent.toString().contains("Hello:\"World\"")) {
throw new NbtApiException("Custom Data did not save to the Entity!");
}
comp.removeKey("Hello");
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTEntities!", ex);
}
}
}
}
@@ -1,30 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.entities;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Monster;
import de.tr7zw.changeme.nbtapi.NBTEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class EntityTest implements Test {
@Override
public void test() throws Exception {
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
if (!world.getEntitiesByClasses(Animals.class, Monster.class).isEmpty()) {
NBTEntity nbte = new NBTEntity(
world.getEntitiesByClasses(Animals.class, Monster.class).iterator().next());
nbte.setString("INVALIDEKEY", "test");
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTEntities!", ex);
}
}
}
}
@@ -1,41 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.injector;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Monster;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
import de.tr7zw.nbtinjector.NBTInjector;
public class EntityCustomNbtInjectorTest implements Test {
@Override
public void test() throws Exception {
if(!NBTInjector.isInjected())return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
if (!world.getEntitiesByClasses(Animals.class, Monster.class).isEmpty()) {
Entity ent = world.getEntitiesByClasses(Animals.class, Monster.class).iterator().next();
ent = NBTInjector.patchEntity(ent);
NBTCompound comp = NBTInjector.getNbtData(ent);
comp.setString("Hello", "World");
NBTEntity nbtent = new NBTEntity(ent);
if (!nbtent.toString().contains("__extraData:{Hello:\"World\"}")) {
throw new NbtApiException("Custom Data did not save to the Entity!");
}
comp.removeKey("Hello");
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTEntities!", ex);
}
}
}
}
@@ -1,46 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.injector;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
import de.tr7zw.nbtinjector.NBTInjector;
public class MergeTileSubCompoundTest implements Test {
@Override
public void test() throws Exception {
if (!NBTInjector.isInjected())
return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
boolean failed = false;
Block block = world.getBlockAt(world.getSpawnLocation().getBlockX(), 255,
world.getSpawnLocation().getBlockZ());
if (block.getType() == Material.AIR) {
block.setType(Material.CHEST);
NBTCompound comp = NBTInjector.getNbtData(block.getState());
comp.addCompound("subcomp").setString("hello", "world");
NBTContainer cont = new NBTContainer();
cont.mergeCompound(comp.getCompound("subcomp"));
if (!(cont.hasKey("hello") && "world".equals(cont.getString("hello")))) {
failed = true;
}
block.setType(Material.AIR);
if(failed) {
throw new NbtApiException("Data was not correct! " + cont);
}
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTTiles!", ex);
}
}
}
}
@@ -1,41 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.injector;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
import de.tr7zw.nbtinjector.NBTInjector;
public class SpawnEntityCustomNbtInjectorTest implements Test {
@Override
public void test() throws Exception {
if (!NBTInjector.isInjected())
return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
Entity entity = world.spawnEntity(new Location(world, 0, 0, 0), EntityType.ARMOR_STAND);
entity = NBTInjector.patchEntity(entity);
NBTCompound comp = NBTInjector.getNbtData(entity);
comp.setString("Hello", "World");
NBTEntity nbtent = new NBTEntity(entity);
if (!nbtent.toString().contains("__extraData:{Hello:\"World\"}")) {
throw new NbtApiException("Custom Data did not save to the Entity!");
}
comp.removeKey("Hello");
entity.remove();
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTEntities!", ex);
}
}
}
}
@@ -1,40 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.injector;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTTileEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
import de.tr7zw.nbtinjector.NBTInjector;
public class TilesCustomNBTInjectorTest implements Test {
@Override
public void test() throws Exception {
if(!NBTInjector.isInjected())return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
Block block = world.getBlockAt(world.getSpawnLocation().getBlockX(), 255,
world.getSpawnLocation().getBlockZ());
if (block.getType() == Material.AIR) {
block.setType(Material.CHEST);
NBTCompound comp = NBTInjector.getNbtData(block.getState());
comp.setString("Foo", "Bar");
if (!new NBTTileEntity(block.getState()).toString().contains("__extraData:{Foo:\"Bar\"}")) {
block.setType(Material.AIR);
throw new NbtApiException("Custom Data did not save to the Tile!");
}
block.setType(Material.AIR);
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTTiles!", ex);
}
}
}
}
@@ -1,22 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.items;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import de.tr7zw.changeme.nbtapi.NBTItem;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class DirectApplyTest implements Test{
@Override
public void test() throws Exception {
ItemStack baseItem = new ItemStack(Material.STONE);
NBTItem nbti = new NBTItem(baseItem, true);
nbti.setString("SomeKey", "SomeValue");
if(!baseItem.equals(nbti.getItem()) || !new NBTItem(baseItem).hasKey("SomeKey")) {
throw new NbtApiException("The item's where not equal!");
}
}
}
@@ -1,28 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.items;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import de.tr7zw.changeme.nbtapi.NBTItem;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class EmptyItemTest implements Test {
@Override
public void test() throws Exception {
ItemStack item = new ItemStack(Material.STONE);
NBTItem nbti = new NBTItem(item);
if (nbti.getBoolean("test") == null || nbti.getString("test") == null)
throw new NbtApiException("Getters return null instead of the default value");
try {
Material barrel = Material.valueOf("BARREL");
item = new ItemStack(barrel);
nbti = new NBTItem(item);
} catch (IllegalArgumentException ex) {
// old version
}
}
}
@@ -1,35 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.items;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import com.google.common.collect.Lists;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTItem;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class ItemConvertionTest implements Test {
@Override
public void test() throws Exception {
ItemStack item = new ItemStack(Material.STONE, 1);
ItemMeta meta = item.getItemMeta();
meta.setLore(Lists.newArrayList("Firest Line", "Second Line"));
item.setItemMeta(meta);
String nbt = NBTItem.convertItemtoNBT(item).toString();
if (!nbt.contains("Firest Line") || !nbt.contains("Second Line"))
throw new NbtApiException("The Item nbt '" + nbt + "' didn't contain the lore");
ItemStack rebuild = NBTItem.convertNBTtoItem(new NBTContainer(nbt));
if (!item.isSimilar(rebuild))
throw new NbtApiException("Rebuilt item did not match the original!");
NBTContainer cont = new NBTContainer();
cont.setItemStack("testItem", item);
if(!cont.getItemStack("testItem").isSimilar(item))
throw new NbtApiException("Rebuilt item did not match the original!");
}
}
@@ -1,56 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.items;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import de.tr7zw.changeme.nbtapi.NBTItem;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class ItemMergingTest implements Test {
@Override
public void test() throws Exception {
ItemStack item = new ItemStack(Material.WRITTEN_BOOK);
BookMeta bookMeta = (BookMeta) item.getItemMeta();
bookMeta.setAuthor("Author");
bookMeta.setDisplayName("name");
item.setItemMeta(bookMeta);
NBTItem nbti = new NBTItem(item);
nbti.setString("author", "New Author");
nbti.setString("test", "value");
nbti.mergeCustomNBT(item);
if (!new NBTItem(item).hasKey("test"))
throw new NbtApiException("Couldn't merge custom NBT tag!");
if ("New Author".equals(new NBTItem(item).getString("author")))
throw new NbtApiException("Vanilla NBT tag was merged when shouldn't!");
nbti.setString("test", "New Value");
nbti.mergeNBT(item);
if (!"New Author".equals(new NBTItem(item).getString("author")) || !"New Value".equals(new NBTItem(item).getString("test")))
throw new NbtApiException("Couldn't replace NBT tag while merging!");
ItemStack test = new ItemStack(Material.WRITTEN_BOOK);
nbti.applyNBT(test);
if (!item.isSimilar(test))
throw new NbtApiException("ItemStacks didn't match! " + new NBTItem(item) + " " + new NBTItem(test));
test = new ItemStack(Material.STONE);
nbti.applyNBT(test);
if (!nbti.hasKey("test"))
throw new NbtApiException("Couldn't merge custom NBT tag!");
if (!item.getItemMeta().getDisplayName().equals(test.getItemMeta().getDisplayName()))
throw new NbtApiException("Couldn't merge vanilla NBT tag!");
nbti.setBoolean("remove", true);
nbti.clearCustomNBT();
if (nbti.hasKey("remove"))
throw new NbtApiException("Couldn't clear custom NBT tags!");
if (!nbti.hasKey("author"))
throw new NbtApiException("Vanilla tag was removed!");
}
}
@@ -1,42 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.tiles;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import de.tr7zw.changeme.nbtapi.NBTTileEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class TileTest implements Test {
@Override
public void test() throws Exception {
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
Block block = world.getBlockAt(world.getSpawnLocation().getBlockX(), 255,
world.getSpawnLocation().getBlockZ());
if (block.getType() == Material.AIR) {
block.setType(Material.CHEST);
NBTTileEntity tile = new NBTTileEntity(block.getState());
if(tile.getInteger("y") != 255) {
block.setType(Material.AIR);
throw new NbtApiException("The Tile Y pos wasn't correct!");
}
tile.setString("Lock", "test");
if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3) && !tile.hasKey("Lock")) {
block.setType(Material.AIR);
throw new NbtApiException("The Lock wasn't successfully set.");
}
block.setType(Material.AIR);
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTTiles!", ex);
}
}
}
}
@@ -1,41 +0,0 @@
package de.tr7zw.nbtapi.plugin.tests.tiles;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTTileEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class TilesCustomNBTPersistentTest implements Test {
@Override
public void test() throws Exception {
if(MinecraftVersion.getVersion().getVersionId() < MinecraftVersion.MC1_14_R1.getVersionId())return;
if (!Bukkit.getWorlds().isEmpty()) {
World world = Bukkit.getWorlds().get(0);
try {
Block block = world.getBlockAt(world.getSpawnLocation().getBlockX(), 255,
world.getSpawnLocation().getBlockZ());
if (block.getType() == Material.AIR) {
block.setType(Material.CHEST);
NBTTileEntity comp = new NBTTileEntity(block.getState());
NBTCompound persistentData = comp.getPersistentDataContainer();
persistentData.setString("Foo", "Bar");
if (!new NBTTileEntity(block.getState()).getPersistentDataContainer().getString("Foo").equals("Bar")) {
block.setType(Material.AIR);
throw new NbtApiException("Custom Data did not save to the Tile!");
}
block.setType(Material.AIR);
}
} catch (Exception ex) {
throw new NbtApiException("Wasn't able to use NBTTiles!", ex);
}
}
}
}
@@ -1,6 +0,0 @@
main: de.tr7zw.nbtapi.plugin.NBTAPI
name: NBTAPI
version: ${project.version}
author: tr7zw
loadbefore: [ItemNBTAPI]
api-version: 1.13
-22
View File
@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2020 tr7zw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>${nbt.version}</version>
</parent>
<artifactId>nbt-data-api</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>${nbt.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean install javadoc:javadoc</defaultGoal>
</build>
</project>
@@ -1,66 +0,0 @@
package de.tr7zw.changeme.nbtapi.data;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.plugin.Plugin;
import de.tr7zw.changeme.nbtapi.NBTFile;
import de.tr7zw.changeme.nbtapi.NbtApiException;
public class NBTData {
public static WorldData getWorldData(World world) {
try {
return new WorldData(world.getWorldFolder());
} catch (IOException e) {
throw new NbtApiException("Error loading World Data!", e);
}
}
public static WorldData getWorldData(File worldFolder) {
try {
return new WorldData(worldFolder);
} catch (IOException e) {
throw new NbtApiException("Error loading World Data!", e);
}
}
public static PlayerData getOfflinePlayerData(UUID uuid) {
for (World world : Bukkit.getWorlds()) {
File dataFolder = new File(world.getWorldFolder(), "playerdata");
File playerFile = new File(dataFolder, uuid.toString() + ".dat");
if (playerFile.exists()) {
try {
return new PlayerData(playerFile);
} catch (IOException e) {
throw new NbtApiException("Error loading player data!", e);
}
}
}
return null;
}
public static NBTFile getPluginPlayerData(Plugin plugin, UUID uuid) {
try {
File dataFolder = new File(plugin.getDataFolder(), "nbt-playerdata");
dataFolder.mkdirs();
return new NBTFile(new File(dataFolder, uuid.toString() + ".dat"));
} catch (IOException e) {
throw new NbtApiException("Error getting Player Plugin data!", e);
}
}
public static NBTFile getPluginData(Plugin plugin) {
try {
plugin.getDataFolder().mkdirs();
return new NBTFile(new File(plugin.getDataFolder(), "settings.dat"));
} catch (IOException e) {
throw new NbtApiException("Error getting Plugin data!", e);
}
}
}
@@ -1,42 +0,0 @@
package de.tr7zw.changeme.nbtapi.data;
import java.io.File;
import java.io.IOException;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTFile;
import de.tr7zw.changeme.nbtapi.NbtApiException;
public class PlayerData {
private final NBTFile file;
protected PlayerData(File playerFile) throws IOException {
file = new NBTFile(playerFile);
}
public NBTFile getFile() {
return file;
}
public NBTCompound getCompound() {
return file;
}
public void saveChanges() {
try {
file.save();
} catch (IOException e) {
throw new NbtApiException("Error when saving level data!", e);
}
}
public float getHealth(){
return file.getFloat("Health");
}
public void setHealth(float health){
file.setFloat("Health", health);
}
}
@@ -1,58 +0,0 @@
package de.tr7zw.changeme.nbtapi.data;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.bukkit.util.Vector;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTFile;
import de.tr7zw.changeme.nbtapi.NbtApiException;
public class WorldData {
private final NBTFile file;
protected WorldData(File worldFolder) throws IOException {
if(!new File(worldFolder, "level.dat").exists())throw new FileNotFoundException("Level.dat at: " + new File(worldFolder, "level.dat").getAbsolutePath());
file = new NBTFile(new File(worldFolder, "level.dat"));
}
public NBTFile getFile() {
return file;
}
public NBTCompound getCompound() {
return file;
}
public void saveChanges() {
try {
file.save();
} catch (IOException e) {
throw new NbtApiException("Error when saving level data!", e);
}
}
public String getWorldName(){
return file.getCompound("Data").getString("LevelName");
}
public void setWorldName(String name){
file.getCompound("Data").setString("LevelName", name);
}
public Vector getSpawnPosition(){
NBTCompound data = file.getCompound("Data");
return new Vector(data.getInteger("SpawnX"), data.getInteger("SpawnY"), data.getInteger("SpawnZ"));
}
public void setSpawnPosition(Vector vec){
NBTCompound data = file.getCompound("Data");
data.setInteger("SpawnX", vec.getBlockX());
data.setInteger("SpawnY", vec.getBlockY());
data.setInteger("SpawnZ", vec.getBlockZ());
}
}
-22
View File
@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2020 tr7zw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>${nbt.version}</version>
</parent>
<artifactId>nbt-injector</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>${nbt.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.27.0-GA</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean install javadoc:javadoc</defaultGoal>
</build>
</project>
@@ -1,197 +0,0 @@
package de.tr7zw.nbtinjector;
import java.io.IOException;
import java.lang.reflect.Constructor;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtField;
import javassist.CtMethod;
import javassist.CtNewConstructor;
import javassist.LoaderClassPath;
import javassist.NotFoundException;
/**
* This class uses Javassist to create wrapped Entity/Tile classes during the
* runtime
*
* @author tr7zw
*
*/
public class ClassGenerator {
/**
* Hidden Constructor
*/
private ClassGenerator() {
}
private static final String GENERATOR_PACKAGE = "de.tr7zw.nbtinjector.generated";
/**
* Wrappes a given class with the INBTWrapper interface
*
* @param classPool The Javassist classpool
* @param originalClass The NMS Tile/Entity class
* @param writeMethod String of the saving method
* @param readMethod String of the loading method
* @param extraDataKey Key used to save the custom nbt
* @return Class reference to the generated class
* @throws NotFoundException
* @throws CannotCompileException
* @throws IOException
*/
protected static Class<?> wrapNbtClass(ClassPool classPool, Class<?> originalClass, String writeMethod,
String readMethod, String extraDataKey) throws NotFoundException, CannotCompileException, IOException {
classPool.insertClassPath(new LoaderClassPath(ClassGenerator.class.getClassLoader()));
CtClass generated = classPool.makeClass("de.tr7zw.nbtinjector.generated." + originalClass.getSimpleName());
CtClass wrapperInterface = classPool.get(INBTWrapper.class.getName());
generated.setInterfaces(new CtClass[] { wrapperInterface });
generated.setSuperclass(classPool.get(originalClass.getName()));
classPool.importPackage("net.minecraft.server." + MinecraftVersion.getVersion().name().replace("MC", "v"));
classPool.importPackage(NBTCompound.class.getPackage().getName());
classPool.importPackage(GENERATOR_PACKAGE);
generated.addField(CtField.make("public NBTCompound $extraCompound = new NBTContainer();", generated));
generated.addMethod(CtMethod
.make("public NBTCompound getNbtData() {\n" + " return this.$extraCompound;\n" + "}", generated));
generated.addMethod(CtMethod.make("public NBTTagCompound readExtraCompound(NBTTagCompound root) {\n"
+ " NBTTagCompound compound = root.getCompound(\"" + extraDataKey + "\");\n"
+ " this.$extraCompound = new NBTContainer(compound);\n"
// + " System.out.println(\"Read: \" + root);\n"
+ " return root;" + "}", generated));
generated.addMethod(CtMethod.make("public NBTTagCompound writeExtraCompound(NBTTagCompound root) {\n"
+ " NBTBase compound = (NBTBase) this.$extraCompound.getCompound();\n"
+ " NBTTagCompound newRoot = new NBTTagCompound();\n" + " newRoot.set(\"" + extraDataKey
+ "\", compound);\n" + " root.a(newRoot);\n" + " return root;"// Merge
+ "}", generated));
generated.addMethod(CtMethod.make(writeMethod, generated));
generated.addMethod(CtMethod.make(readMethod, generated));
// Overwrite constructors
for (Constructor<?> constructor : originalClass.getConstructors()) {
String paramString = "";
String paramNameString = "";
int c = 0;
for (Class<?> clazz : constructor.getParameterTypes()) {
if (c != 0) {
paramString += ",";
paramNameString += ",";
}
paramString += clazz.getName() + " param" + c;
paramNameString += "param" + c;
c++;
}
generated.addConstructor(CtNewConstructor.make("public " + originalClass.getSimpleName() + "(" + paramString
+ ") {\n" + " super(" + paramNameString + ");\n" + "}", generated));
}
generated.writeFile("nbtinjector_generated");
return generated.toClass(INBTWrapper.class.getClassLoader(), INBTWrapper.class.getProtectionDomain());
}
/**
* Creates a class for the EntityTypes getter for a given entity
*
* @param classPool The Javassist classpool
* @param targetClass The NMS Entity class
* @return Class reference to the generated class
* @throws NotFoundException
* @throws CannotCompileException
* @throws IOException
*/
protected static Class<?> createEntityTypeWrapper(ClassPool classPool, Class<?> targetClass)
throws NotFoundException, CannotCompileException, IOException {
classPool.insertClassPath(new LoaderClassPath(ClassGenerator.class.getClassLoader()));
CtClass generated = classPool.makeClass(GENERATOR_PACKAGE + ".entityCreator." + targetClass.getSimpleName());
CtClass wrapperInterface = classPool.get(ClassWrapper.NMS_ENTITYTYPES.getClazz().getName() + "$b");
generated.setInterfaces(new CtClass[] { wrapperInterface });
classPool.importPackage("net.minecraft.server." + MinecraftVersion.getVersion().name().replace("MC", "v"));
classPool.importPackage(GENERATOR_PACKAGE);
generated.addMethod(CtMethod.make("public Entity create(EntityTypes var1, World var2) {\n" + " return new "
+ targetClass.getName() + "(var1, var2);\n" + "}", generated));
generated.writeFile("nbtinjector_generated");
return generated.toClass(INBTWrapper.class.getClassLoader(), INBTWrapper.class.getProtectionDomain());
}
/**
* Wrappes a given Entity class with the INBTWrapper interface
*
* @param classPool The Javassist classpool
* @param originalClass The NMS Entity class
* @param extraDataKey
* @return Class reference to the generated class
* @throws NotFoundException
* @throws CannotCompileException
* @throws IOException
*/
protected static Class<?> wrapEntity(ClassPool classPool, Class<?> originalClass, String extraDataKey)
throws NotFoundException, CannotCompileException, IOException {
String writeReturn = MinecraftVersion.getVersion().getVersionId() > MinecraftVersion.MC1_10_R1.getVersionId()
? "NBTTagCompound"
: "void";
String writeName = ReflectionMethod.NMS_ENTITY_GET_NBT.getMethodName();
String readName = ReflectionMethod.NMS_ENTITY_SET_NBT.getMethodName();
if (MinecraftVersion.getVersion().getVersionId() < MinecraftVersion.MC1_11_R1.getVersionId()) {
writeName = "b";
readName = "f";
}
String writeMethod = "public " + writeReturn + " " + writeName + "(NBTTagCompound compound) {\n" + " super."
+ writeName + "(compound);\n" + " compound = writeExtraCompound(compound);\n"
// + " System.out.println(\"Saved-Data: \" + compound);"
+ " " + (!"void".equals(writeReturn) ? "return compound;" : "") + "}";
String readMethod = "public void " + readName + "(NBTTagCompound compound) {\n" + " super." + readName
+ "(compound);\n" + " readExtraCompound(compound);\n" + "}";
return wrapNbtClass(classPool, originalClass, writeMethod, readMethod, extraDataKey);
}
/**
* Wrappes a given Tile class with the INBTWrapper interface
*
* @param classPool The Javassist classpool
* @param originalClass The NMS Tile class
* @param extraDataKey
* @return Class reference to the generated class
* @throws NotFoundException
* @throws CannotCompileException
* @throws IOException
*/
protected static Class<?> wrapTileEntity(ClassPool classPool, Class<?> originalClass, String extraDataKey)
throws NotFoundException, CannotCompileException, IOException {
String writeReturn = MinecraftVersion.getVersion().getVersionId() > MinecraftVersion.MC1_9_R1.getVersionId()
? "NBTTagCompound"
: "void";
String writeName = ReflectionMethod.TILEENTITY_GET_NBT.getMethodName();
String readName = ReflectionMethod.TILEENTITY_SET_NBT.getMethodName();
if(MinecraftVersion.getVersion().getVersionId() < MinecraftVersion.MC1_16_R1.getVersionId()) {
readName = ReflectionMethod.TILEENTITY_SET_NBT_LEGACY1151.getMethodName();
}
String writeMethod = "public " + writeReturn + " " + writeName + "(NBTTagCompound compound) {\n"
+ " compound = writeExtraCompound(compound);\n"
// + " System.out.println(\"Save: \" +compound);\n"
+ " " + (!"void".equals(writeReturn) ? "return " : "") + "super." + writeName + "(compound);\n" + "}";
String readMethod = "public void " + readName + "(NBTTagCompound compound) {\n" + " super." + readName
+ "(compound);\n" + " readExtraCompound(compound);\n"
// + " System.out.println(\"Read: \" +compound);\n"
+ "}";
return wrapNbtClass(classPool, originalClass, writeMethod, readMethod, extraDataKey);
}
}
@@ -1,18 +0,0 @@
package de.tr7zw.nbtinjector;
import de.tr7zw.changeme.nbtapi.NBTCompound;
/**
* This interface gets placed on Tiles and Entities
*
* @author tr7zw
*
*/
public interface INBTWrapper {
/**
* @return The custom NBT compound inside this Object
*/
NBTCompound getNbtData();
}
@@ -1,292 +0,0 @@
package de.tr7zw.nbtinjector;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.ReflectionUtil;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
import de.tr7zw.nbtinjector.NBTInjector.Entity;
import de.tr7zw.nbtinjector.NBTInjector.TileEntity;
import javassist.ClassPool;
import static de.tr7zw.nbtinjector.NBTInjector.logger;
/**
* Contains the internal methods for different Minecraft Versions of injecting
* the Entities/Tiles
*
* @author tr7zw
*
*/
@SuppressWarnings("unchecked")
public class InternalInjectors {
private static final List<String> skippingEntities = Arrays.asList("minecraft:player", "minecraft:fishing_bobber",
"minecraft:lightning_bolt"); // These are broken/won't work, used by 1.14+
private static final Map<String, String> classMappings = new HashMap<>();
protected static final Map<Class<?>, Object> classToMCKey = new HashMap<Class<?>, Object>();
static {
classMappings.put("minecraft:wandering_trader", "VillagerTrader");
classMappings.put("minecraft:trader_llama", "LlamaTrader");
classMappings.put("minecraft:area_effect_cloud", "AreaEffectCloud");
classMappings.put("minecraft:donkey", "HorseDonkey");
classMappings.put("minecraft:ender_dragon", "EnderDragon");
classMappings.put("minecraft:skeleton_horse", "HorseSkeleton");
classMappings.put("minecraft:fireball", "LargeFireball");
classMappings.put("minecraft:mule", "HorseMule");
classMappings.put("minecraft:zombie_horse", "HorseZombie");
classMappings.put("minecraft:mooshroom", "MushroomCow");
classMappings.put("minecraft:wither_skeleton", "SkeletonWither");
classMappings.put("minecraft:snow_golem", "Snowman");
classMappings.put("minecraft:polar_bear", "PolarBear");
classMappings.put("minecraft:magma_cube", "MagmaCube");
classMappings.put("minecraft:armor_stand", "ArmorStand");
classMappings.put("minecraft:elder_guardian", "GuardianElder");
classMappings.put("minecraft:zombie_pigman", "PigZombie");
classMappings.put("minecraft:giant", "GiantZombie");
classMappings.put("minecraft:zombie_villager", "ZombieVillager");
classMappings.put("minecraft:husk", "ZombieHusk");
classMappings.put("minecraft:iron_golem", "IronGolem");
classMappings.put("minecraft:tropical_fish", "TropicalFish");
classMappings.put("minecraft:stray", "SkeletonStray");
classMappings.put("minecraft:illusioner", "IllagerIllusioner");
classMappings.put("minecraft:pufferfish", "PufferFish");
classMappings.put("minecraft:cave_spider", "CaveSpider");
classMappings.put("minecraft:item_frame", "ItemFrame");
classMappings.put("minecraft:leash_knot", "Leash");
}
/**
* Hidden constructor
*/
private InternalInjectors() {
}
protected static void entity1v10Below(ClassPool classPool) throws ReflectiveOperationException {
for (Map.Entry<String, Class<?>> entry : new HashSet<>(Entity.getCMap().entrySet())) {
try {
if (INBTWrapper.class.isAssignableFrom(entry.getValue())) {
continue;
} // Already injected
int entityId = Entity.getFMap().get(entry.getValue());
Class<?> wrapped = ClassGenerator.wrapEntity(classPool, entry.getValue(), "__extraData");
Entity.getCMap().put(entry.getKey(), wrapped);
Entity.getDMap().put(wrapped, entry.getKey());
Entity.getEMap().put(entityId, wrapped);
Entity.getFMap().put(wrapped, entityId);
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + entry.getKey(), e);
}
}
}
protected static void entity1v12Below(ClassPool classPool) throws ReflectiveOperationException {
Object registry = Entity.getRegistry();
Map<Object, Object> inverse = new HashMap<>();
Set<?> it = new HashSet<>((Set<?>) ReflectionMethod.REGISTRY_KEYSET.run(registry));
Object registryId = Entity.getRegistryId(registry);
for (Object mckey : it) {
Class<?> entclass = (Class<?>) ReflectionMethod.REGISTRY_GET.run(registry, mckey);
inverse.put(entclass, mckey);
try {
if (INBTWrapper.class.isAssignableFrom(entclass)) {
continue;
} // Already injected
Class<?> wrapped = ClassGenerator.wrapEntity(classPool, entclass, "__extraData");
ReflectionMethod.REGISTRY_SET.run(registry, mckey, wrapped);
inverse.put(wrapped, mckey);
int id = (int) registryId.getClass().getMethod("getId", new Class[] {Object.class}).invoke(registryId, entclass);
registryId.getClass().getMethod("a", new Class[] {Object.class, int.class}).invoke(registryId, wrapped, id);
classToMCKey.put(entclass, mckey);
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + mckey, e);
}
}
Field inverseField = registry.getClass().getDeclaredField("b");
ReflectionUtil.setFinal(registry, inverseField, inverse);
}
protected static void entity1v13Below(ClassPool classPool) throws ReflectiveOperationException {
Object entityRegistry = ClassWrapper.NMS_IREGISTRY.getClazz().getField("ENTITY_TYPE").get(null);
Set<?> registryentries = new HashSet<>((Set<?>) ReflectionMethod.REGISTRYMATERIALS_KEYSET.run(entityRegistry));
for (Object mckey : registryentries) {
Object entityTypesObj = ReflectionMethod.REGISTRYMATERIALS_GET.run(entityRegistry, mckey);
Field supplierField = entityTypesObj.getClass().getDeclaredField("aT");
Field classField = entityTypesObj.getClass().getDeclaredField("aS");
classField.setAccessible(true);
supplierField.setAccessible(true);
Function<Object, Object> function = (Function<Object, Object>) supplierField.get(entityTypesObj);
Class<?> nmsclass = (Class<?>) classField.get(entityTypesObj);
try {
if (INBTWrapper.class.isAssignableFrom(nmsclass)) {
continue;
} // Already injected
Class<?> wrapped = ClassGenerator.wrapEntity(classPool, nmsclass, "__extraData");
ReflectionUtil.setFinal(entityTypesObj, classField, wrapped);
ReflectionUtil.setFinal(entityTypesObj, supplierField, new Function<Object, Object>() {
@Override
public Object apply(Object t) {
try {
return wrapped.getConstructor(ClassWrapper.NMS_WORLD.getClazz()).newInstance(t);
} catch (Exception ex) {
logger.log(Level.SEVERE, "Error while creating custom entity instance! ", ex);
return function.apply(t);// Fallback to the original one
}
}
});
classToMCKey.put(nmsclass, mckey);
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + mckey, e);
}
}
}
protected static void entity1v14(ClassPool classPool) throws ReflectiveOperationException {
Object entityRegistry = ClassWrapper.NMS_IREGISTRY.getClazz().getField("ENTITY_TYPE").get(null);
Set<?> registryentries = new HashSet<>((Set<?>) ReflectionMethod.REGISTRYMATERIALS_KEYSET.run(entityRegistry));
for (Object mckey : registryentries) {
if (skippingEntities.contains(mckey.toString())) {
logger.info("Skipping, won't be able add NBT to '" + mckey + "' entities!");
continue;
}
Object entityTypesObj = ReflectionMethod.REGISTRYMATERIALS_GET.run(entityRegistry, mckey);
String creatorFieldName = "aZ";
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_15_R1.getVersionId())
creatorFieldName = "ba";
Field creatorField = entityTypesObj.getClass().getDeclaredField(creatorFieldName);
creatorField.setAccessible(true);
Object creator = creatorField.get(entityTypesObj);
Method createEntityMethod = creator.getClass().getMethod("create", ClassWrapper.NMS_ENTITYTYPES.getClazz(),
ClassWrapper.NMS_WORLD.getClazz());
createEntityMethod.setAccessible(true);
Class<?> nmsclass = null;
try {
nmsclass = createEntityMethod.invoke(creator, entityTypesObj, null).getClass();
} catch (Exception ignore) {
// ignore
}
if (nmsclass == null) {
String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
String name = mckey.toString().replace("minecraft:", "");
name = name.substring(0, 1).toUpperCase() + name.substring(1);
name = "Entity" + name;
if (classMappings.containsKey(mckey.toString()))
name = "Entity" + classMappings.get(mckey.toString());
try {
nmsclass = Class.forName("net.minecraft.server." + version + "." + name);
} catch (Exception ignore) {
logger.info("Not found: " + "net.minecraft.server." + version + "." + name);
// ignore
}
}
if (nmsclass == null) {
logger.info(
"Wasn't able to create an Entity instace, won't be able add NBT to '" + mckey + "' entities!");
continue;
}
classToMCKey.put(nmsclass, mckey);
try {
if (INBTWrapper.class.isAssignableFrom(nmsclass)) {
continue;
} // Already injected
Class<?> wrapped = ClassGenerator.wrapEntity(classPool, nmsclass, "__extraData");
ReflectionUtil.setFinal(entityTypesObj, creatorField,
ClassGenerator.createEntityTypeWrapper(classPool, wrapped).newInstance());
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + mckey, e);
}
}
}
protected static void tile1v10Below(ClassPool classPool) throws ReflectiveOperationException {
for (Map.Entry<String, Class<?>> entry : new HashSet<>(TileEntity.getFMap().entrySet())) {
try {
if (INBTWrapper.class.isAssignableFrom(entry.getValue())) {
continue;
} // Already injected
Class<?> wrapped = ClassGenerator.wrapTileEntity(classPool, entry.getValue(), "__extraData");
TileEntity.getFMap().put(entry.getKey(), wrapped);
TileEntity.getGMap().put(wrapped, entry.getKey());
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + entry.getKey(), e);
}
}
}
protected static void tile1v12Below(ClassPool classPool) throws ReflectiveOperationException {
Object registry = TileEntity.getRegistry();
Map<Object, Object> inverse = new HashMap<>();
Set<?> it = new HashSet<>((Set<?>) ReflectionMethod.REGISTRY_KEYSET.run(registry));
for (Object mckey : it) {
Class<?> tileclass = (Class<?>) ReflectionMethod.REGISTRY_GET.run(registry, mckey);
inverse.put(tileclass, mckey);
try {
if (INBTWrapper.class.isAssignableFrom(tileclass)) {
continue;
} // Already injected
Class<?> wrapped = ClassGenerator.wrapTileEntity(classPool, tileclass, "__extraData");
ReflectionMethod.REGISTRY_SET.run(registry, mckey, wrapped);
inverse.put(wrapped, mckey);
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + mckey, e);
}
}
Field inverseField = registry.getClass().getDeclaredField("b");
ReflectionUtil.setFinal(registry, inverseField, inverse);
}
protected static void tile1v13(ClassPool classPool) throws ReflectiveOperationException {
Object tileRegistry = ClassWrapper.NMS_IREGISTRY.getClazz().getField("BLOCK_ENTITY_TYPE").get(null);
Set<?> registryentries = new HashSet<>((Set<?>) ReflectionMethod.REGISTRYMATERIALS_KEYSET.run(tileRegistry));
for (Object mckey : registryentries) {
Object tileEntityTypesObj = ReflectionMethod.REGISTRYMATERIALS_GET.run(tileRegistry, mckey);
String supplierFieldName = "A";
if (MinecraftVersion.getVersion().getVersionId() == MinecraftVersion.MC1_14_R1.getVersionId())
supplierFieldName = "H";
else if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_15_R1.getVersionId())
supplierFieldName = "I";
Field supplierField = tileEntityTypesObj.getClass().getDeclaredField(supplierFieldName);
supplierField.setAccessible(true);
Supplier<Object> supplier = (Supplier<Object>) supplierField.get(tileEntityTypesObj);
Class<?> nmsclass = supplier.get().getClass();
try {
if (INBTWrapper.class.isAssignableFrom(nmsclass)) {
continue;
} // Already injected
Class<?> wrapped = ClassGenerator.wrapTileEntity(classPool, nmsclass, "__extraData");
ReflectionUtil.setFinal(tileEntityTypesObj, supplierField, new Supplier<Object>() {
@Override
public Object get() {
try {
return wrapped.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
logger.log(Level.SEVERE, "Error while creating custom tile instance! ", e);
return supplier.get(); // Use the original one as fallback
}
}
});
} catch (Exception e) {
throw new NbtApiException("Exception while injecting " + mckey, e);
}
}
}
}
@@ -1,307 +0,0 @@
package de.tr7zw.nbtinjector;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.logging.Logger;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTContainer;
import de.tr7zw.changeme.nbtapi.NBTEntity;
import de.tr7zw.changeme.nbtapi.NBTReflectionUtil;
import de.tr7zw.changeme.nbtapi.NBTTileEntity;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ClassWrapper;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ObjectCreator;
import de.tr7zw.changeme.nbtapi.utils.nmsmappings.ReflectionMethod;
import javassist.ClassPool;
/**
* Main class to interact with custom NBT on Tiles and Entities
*
* @author tr7zw
*
*/
public class NBTInjector {
/**
* Hidden Constructor
*/
private NBTInjector() {
}
protected static Logger logger = Logger.getLogger("NBTInjector");
private static boolean isInjected = false;
private static final String NOT_INJECTED_MESSAGE = "The NBTInjector has not been enabled!\n"
+ "You need to call 'NBTInjector.inject()' during the Method 'onLoad' of your Plugin!"
+ " Check the Wiki/Pluginpage for more information!";
/**
* Replaces the vanilla classes with Wrapped classes that support custom NBT.
* This method needs to be called during onLoad so classes are replaced before
* worlds load. If your plugin adds a new Entity(probably during onLoad) recall
* this method so it's class gets Wrapped.
*/
public static void inject() {
if(isInjected)return;
if(MinecraftVersion.getVersion() == MinecraftVersion.MC1_7_R4 || MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_16_R1)) {
logger.warning("[NBTINJECTOR] The NBT-Injector is not compatibel with this Minecraft Version! For 1.16+ please use the persistent storage API.");
return;
}
isInjected = true;
try {
ClassPool classPool = ClassPool.getDefault();
logger.info("[NBTINJECTOR] Injecting Entity classes...");
if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_10_R1.getVersionId()) {
InternalInjectors.entity1v10Below(classPool);
} else if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_12_R1.getVersionId()) {
InternalInjectors.entity1v12Below(classPool);
} else if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_13_R2.getVersionId()) {
InternalInjectors.entity1v13Below(classPool);
} else { // 1.14+
InternalInjectors.entity1v14(classPool);
}
logger.info("[NBTINJECTOR] Injecting Tile Entity classes...");
if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_10_R1.getVersionId()) {
InternalInjectors.tile1v10Below(classPool);
} else if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_12_R1.getVersionId()) {
InternalInjectors.tile1v12Below(classPool);
} else { // 1.13+
InternalInjectors.tile1v13(classPool);
}
} catch (Exception e) {
throw new NbtApiException(e);
}
}
public static boolean isInjected() {
return isInjected;
}
private static NBTCompound getNbtData(Object object) {
if (object instanceof INBTWrapper) {
return ((INBTWrapper) object).getNbtData();
}
return null;
}
/**
* Entities that have just been spawned(from plugins or natually) may use the
* wrong(Vanilla) class. Calling this method removes the wrong entity and
* respawns it using the correct class. It also tries to keep all data of the
* original entity, but some stuff like passengers will probably cause problems.
* Recalling this method on a patched Entity doesn nothing and returns the
* Entity instance.
*
* WARNING: This causes the entity to get a new Bukkit Entity instance. For
* other plugins the entity will be a dead/removed entity, even if it's still
* kinda there. Bestcase you spawn an Entity and directly replace your instance
* with a patched one. Also, for players ingame the entity will quickly flash,
* since it's respawned.
*
* @param entity Entity to respawn with the correct class.
* @return Entity The new instance of the entity.
*/
public static org.bukkit.entity.Entity patchEntity(org.bukkit.entity.Entity entity) {
if (entity == null) {
return null;
}
if(!isInjected)throw new NbtApiException(NOT_INJECTED_MESSAGE);
try {
Object ent = NBTReflectionUtil.getNMSEntity(entity);
if (!(ent instanceof INBTWrapper)) {// Replace Entity with custom one
Object cworld = ClassWrapper.CRAFT_WORLD.getClazz().cast(entity.getWorld());
Object nmsworld = ReflectionMethod.CRAFT_WORLD_GET_HANDLE.run(cworld);
NBTContainer oldNBT = new NBTContainer(new NBTEntity(entity).getCompound());
Method create = ClassWrapper.NMS_ENTITYTYPES.getClazz().getMethod("a",
ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz(), ClassWrapper.NMS_WORLD.getClazz());
String id = "";
if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_10_R1.getVersionId()) {
id = Entity.getBackupMap().get(ent.getClass());
} else if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_12_R1.getVersionId()) {
id = ReflectionMethod.REGISTRY_GET_INVERSE.run(Entity.getRegistry(), ent.getClass()).toString();
} else if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_13_R2.getVersionId()) {
id = InternalInjectors.classToMCKey.get(ent.getClass()).toString();
} else {
id = (String) ReflectionMethod.NMS_ENTITY_GETSAVEID.run(ent);
}
oldNBT.setString("id", id);
oldNBT.removeKey("UUIDMost");
oldNBT.removeKey("UUIDLeast");
entity.remove();
Object newEntity = create.invoke(null, oldNBT.getCompound(), nmsworld);
if (newEntity instanceof Optional<?> && ((Optional<?>) newEntity).isPresent())
newEntity = ((Optional<?>) newEntity).get();
Method spawn = ClassWrapper.NMS_WORLD.getClazz().getMethod("addEntity",
ClassWrapper.NMS_ENTITY.getClazz());
spawn.invoke(nmsworld, newEntity);
//logger.info("Created patched instance: " + newEntity.getClass().getName());
Method asBukkit = newEntity.getClass().getMethod("getBukkitEntity");
return (org.bukkit.entity.Entity) asBukkit.invoke(newEntity);
}
} catch (Exception e) {
throw new NbtApiException("Error while patching an Entity '" + entity + "'", e);
}
return entity;
}
/**
* Gets the persistant NBTCompound from a given entity. If the Entity isn't yet
* patched, this method will return null.
*
* @param entity Entity to get the NBTCompound from
* @return NBTCompound instance
*/
public static NBTCompound getNbtData(org.bukkit.entity.Entity entity) {
if (entity == null) {
return null;
}
if(!isInjected)throw new NbtApiException(NOT_INJECTED_MESSAGE);
try {
Object ent = NBTReflectionUtil.getNMSEntity(entity);
if (!(ent instanceof INBTWrapper)) {
logger.info("Entity wasn't the correct class! '" + ent.getClass().getName() + "'");
}
return getNbtData(ent);
} catch (Exception e) {
throw new NbtApiException("Error while getting the NBT from an Entity '" + entity + "'.", e);
}
}
/**
* Gets the persistant NBTCompound from a given TileEntity. If the Tile isn't
* yet patched, this method will autopatch it. This will unlink the given
* BlockState, so calling block.getState() again may be necessary. This behavior
* may change in the future.
*
* @param tile TileEntity to get the NBTCompound from
* @return NBTCompound instance
*/
public static NBTCompound getNbtData(org.bukkit.block.BlockState tile) {
if (tile == null) {
return null;
}
if(!isInjected)throw new NbtApiException(NOT_INJECTED_MESSAGE);
try {
Object pos = ObjectCreator.NMS_BLOCKPOSITION.getInstance(tile.getX(), tile.getY(), tile.getZ());
Object cworld = ClassWrapper.CRAFT_WORLD.getClazz().cast(tile.getWorld());
Object nmsworld = ReflectionMethod.CRAFT_WORLD_GET_HANDLE.run(cworld);
Object tileEntity = ReflectionMethod.NMS_WORLD_GET_TILEENTITY.run(nmsworld, pos);
if (tileEntity == null) { // Not a tile block
return null;
}
if (!(tileEntity instanceof INBTWrapper)) {
// Loading Updated Tile
Object tileEntityUpdated;
if (MinecraftVersion.getVersion() == MinecraftVersion.MC1_9_R1) {
tileEntityUpdated = ReflectionMethod.TILEENTITY_LOAD_LEGACY191.run(null, null,
new NBTTileEntity(tile).getCompound());
} else if (MinecraftVersion.getVersion() == MinecraftVersion.MC1_8_R3
|| MinecraftVersion.getVersion() == MinecraftVersion.MC1_9_R2) {
tileEntityUpdated = ReflectionMethod.TILEENTITY_LOAD_LEGACY183.run(null,
new NBTTileEntity(tile).getCompound());
} else if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_12_R1.getVersionId()) {
tileEntityUpdated = ReflectionMethod.TILEENTITY_LOAD_LEGACY1121.run(null, nmsworld,
new NBTTileEntity(tile).getCompound());
} else {
tileEntityUpdated = ReflectionMethod.TILEENTITY_LOAD.run(null,
new NBTTileEntity(tile).getCompound());
}
ReflectionMethod.NMS_WORLD_REMOVE_TILEENTITY.run(nmsworld, pos);
ReflectionMethod.NMS_WORLD_SET_TILEENTITY.run(nmsworld, pos, tileEntityUpdated);
return getNbtData(tileEntityUpdated);
}
return getNbtData(tileEntity);
} catch (Exception e) {
throw new NbtApiException(e);
}
}
private static Field getAccessable(Field field) {
field.setAccessible(true);
return field;
}
@SuppressWarnings("unchecked")
static class Entity {
/**
* Hidden Constructor
*/
private Entity() {
}
private static Map<Class<?>, String> backupMap = new HashMap<>();
static {
try {
if (MinecraftVersion.getVersion().getVersionId() <= MinecraftVersion.MC1_10_R1.getVersionId()) {
backupMap.putAll(getDMap());
}
} catch (ReflectiveOperationException e) {
throw new NbtApiException(e);
}
}
static Object getRegistry() throws ReflectiveOperationException {
return getAccessable(ClassWrapper.NMS_ENTITYTYPES.getClazz().getDeclaredField("b")).get(null);
}
static Object getRegistryId(Object reg) throws ReflectiveOperationException {
return getAccessable(reg.getClass().getDeclaredField("a")).get(reg);
}
static Map<Class<?>, String> getBackupMap() throws ReflectiveOperationException {
return backupMap;
}
static Map<String, Class<?>> getCMap() throws ReflectiveOperationException {
return (Map<String, Class<?>>) getAccessable(ClassWrapper.NMS_ENTITYTYPES.getClazz().getDeclaredField("c"))
.get(null);
}
static Map<Class<?>, String> getDMap() throws ReflectiveOperationException {
return (Map<Class<?>, String>) getAccessable(ClassWrapper.NMS_ENTITYTYPES.getClazz().getDeclaredField("d"))
.get(null);
}
static Map<Integer, Class<?>> getEMap() throws ReflectiveOperationException {
return (Map<Integer, Class<?>>) getAccessable(ClassWrapper.NMS_ENTITYTYPES.getClazz().getDeclaredField("e"))
.get(null);
}
static Map<Class<?>, Integer> getFMap() throws ReflectiveOperationException {
return (Map<Class<?>, Integer>) getAccessable(ClassWrapper.NMS_ENTITYTYPES.getClazz().getDeclaredField("f"))
.get(null);
}
}
@SuppressWarnings("unchecked")
static class TileEntity {
/**
* Hidden Constructor
*/
private TileEntity() {
}
static Object getRegistry() throws ReflectiveOperationException {
return getAccessable(ClassWrapper.NMS_TILEENTITY.getClazz().getDeclaredField("f")).get(null);
}
static Map<String, Class<?>> getFMap() throws ReflectiveOperationException {
return (Map<String, Class<?>>) getAccessable(ClassWrapper.NMS_TILEENTITY.getClazz().getDeclaredField("f"))
.get(null);
}
static Map<Class<?>, String> getGMap() throws ReflectiveOperationException {
return (Map<Class<?>, String>) getAccessable(ClassWrapper.NMS_TILEENTITY.getClazz().getDeclaredField("g"))
.get(null);
}
}
}
-144
View File
@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>${nbt.version}</version>
<packaging>pom</packaging>
<modules>
<module>item-nbt-api</module>
<module>nbt-injector</module>
<module>nbt-data-api</module>
<module>item-nbt-plugin</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<nbt.version>2.7.0</nbt.version>
</properties>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.tr7zw.spigotmc.maven</groupId>
<artifactId>tr-spigotmc-maven-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.25</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<!-- CodeMC -->
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<layout>default</layout>
</repository>
<!-- CodeMC NMS -->
<repository>
<id>codemc-nms-repo</id>
<url>https://repo.codemc.org/repository/nms/</url>
<layout>default</layout>
</repository>
<!-- Mojang -->
<repository>
<id>mojang-libraries</id>
<url>https://libraries.minecraft.net/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<!-- CodeMC -->
<pluginRepository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>clean install</defaultGoal>
<resources>
<resource>
<filtering>false</filtering>
<directory>.</directory>
<includes>
<include>LICENSE</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
</configuration>
</plugin>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>2.12.0</version>
<executions>
<execution>
<id>sortpom</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.tr7zw</groupId>
<artifactId>allcontributors</artifactId>
<version>0.0.1-SNAPSHOT</version>
<executions>
<execution>
<id>update-contributors</id>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
-289
View File
@@ -1,289 +0,0 @@
[B][SIZE=6](Item/Entity/Tile) NBT API[/SIZE][/B]
[URL='https://ci.codemc.io/job/Tr7zw/job/Item-NBT-API/'][IMG]https://ci.codemc.org/buildStatus/icon?job=Tr7zw%2FItem-NBT-API[/IMG][/URL] [URL='https://sonarcloud.io/dashboard?id=de.tr7zw%3Aitem-nbt-parent'][IMG]https://sonarcloud.io/api/project_badges/measure?project=de.tr7zw%3Aitem-nbt-parent&metric=ncloc[/IMG][/URL] [URL='https://bstats.org/plugin/bukkit/ItemNBTAPI'][IMG]https://img.shields.io/bstats/servers/1058.svg?color=green&label=OnlineServers&style=plastic[/IMG][/URL] [URL='https://bstats.org/plugin/bukkit/ItemNBTAPI'][IMG]https://img.shields.io/bstats/players/1058.svg?color=green&label=OnlinePlayers&style=plastic[/IMG] [/URL][URL='https://discordapp.com/invite/yk4caxM'][IMG]https://img.shields.io/discord/342814924310970398?color=%237289DA&label=Discord&logo=discord&logoColor=white[/IMG][/URL] [IMG]https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dtr7zw%26type%3Dpatrons&style=for-the-badge[/IMG]
The NBT API allows you to add custom NBT tags to Itemstacks, TileEntities and Entities, or modify excisting ones!
It completely uses reflections to interact with NMS code and works with all the latest versions. On server start the plugin checks all reflections.
Tested on Spigot
[LIST]
[*](1.7*)1.8.8-1.16.4
[*]The NBTInjector will not work with: 1.12.0, 1.12.1, 1.13.0 (Please just update to the final release of your chosen version)
[*]On startup you will get a notification if there is a version problem!
[/LIST]
* 1.7 Notes: Use a 1.7 with R4 (1.7.10), NBTLists may not work, everything using Gson is disabled(Add Gson before the NBTAPI loads, to turn it back on), and you can't get the NBTTypes, because 1.7 is missing this feature. TLDR: 1.7.10 is somewhat broken and not everything might work due to 1.7.10 limitations.
[B]What do I have to do as a server owner?[/B]
Just download the jar and drop it in the plugins folder. Done.
Note that outdated plugins may ask for "ItemNBTAPI". In this case download version 1.8.3 from the versions tab. The outdated "ItemNBTAPI" and "NBTApi" can be used at the same time.
[B]Important for version 2.0.0:[/B] Don't reload while using the NBTInjector. Reloading, in general, is a horrible thing and it will break the NBTInjector in horrible ways! When updating plugins/changing configs always restart the server normally!
[B]How can I use the API as developer?[/B]
Create the NBT Wrapper:
[CODE]NBTItem nbti = new NBTItem(item);
NBTEntity nbtent = new NBTEntity(zombie); //Only for vanilla tags!
NBTTileEntity tent = new NBTTileEntity(block.getState()); //Only for vanilla tags!
NBTFile file = new NBTFile(new File(getDataFolder(), "test.nbt"));
NBTContainer container = new NBTContainer(json); //Parse in json
[/CODE]
Add/Get/Override NBT tags:
[CODE]//Set
nbti.setString("Stringtest", "Teststring");
nbti.setInteger("Inttest", 42);
nbti.setDouble("Doubletest", 1.5d);
nbti.setBoolean("Booleantest", true);
//More are avaible!
//Get
nbti.getString("Stringtest");
nbti.getInteger("Inttest");
nbti.getDouble("Doubletest");
nbti.getBoolean("Booleantest");
//Get all Tags
nbti.getKeys();
//Check for an tag
nbti.hasKey("Key");
//Remove a tag
nbti.removeKey("Key");
//or
nbti.setString("Stringtest", null);
//Create NBTTagCombounds(Imagine folders)
nbti.addCompound("subtag");
//Get Compound
NBTCompound comp = nbti.getCompound("subtag");
//Get Compound parent(null at root)
comp.getParent();
//Save Objects via Gson
nbti.setObject("myobject", new SimpleJsonTestObject());
//Get Objects
SimpleJsonTestObject simpleObject = nbti.getObject("myobject", SimpleJsonTestObject.class);
//Merge the data from compound A into B (Like the /data merge command)
B.mergeCompound(A);
//Get the nbt as json
comp.asNBTString();
//Access/create lists
nbtent.getCompoundList("Attributes");
nbtent.getStringList("Attributes");
[/CODE]
And finally get back the Bukkit Itemstack(Changes on Tiles/Entities will happen directly):
[CODE]nbti.getItem();[/CODE]
Saving the NBTFile:
[CODE]file.save();[/CODE]
[B]Important note regarding Tiles/Entities
[B]Starting with 1.14+ you can use the getPersistentDataContainer() (for NBT(Tile)-Entity's) to save custom tags. This replaces the now mentioned NBT-Injector.[/B][/B]
Non-vanilla tags can't usually be added to to Tiles/Entities. Thanks to
[URL='https://www.spigotmc.org/members/inventivetalent.6643/'][IMG]https://tr7zw.dev/nbtapi/spigotPeople.php?id=6643[/IMG][/URL] the NBTAPI now includes a tool called "NBTInjector", that compiles custom (Tile-)Entity classes during runtime to allow custom nbt. The custom data will remain during chunk unloads/server restarts. [B]Data will be lost when chunks get loaded without the NBTAPI loaded! Since 2.1.0 the NBTInjector won't be enabled by default! Please enable it during onLoad with NBTInjector.inject(); if you are using it![/B]
Adding custom nbt to tiles:
[CODE]
NBTCompound comp = NBTInjector.getNbtData(block.getState());
comp.setString("Foo", "Bar");
[/CODE]
Adding custom nbt to entities:
[CODE]
Entity ent = world.getEntitiesByClasses(Animals.class, Monster.class).iterator().next();
ent = NBTInjector.patchEntity(ent); //This needs to be called at least once on the entity to enable custom nbt!
NBTCompound comp = NBTInjector.getNbtData(ent);
comp.setString("Hello", "World");
[/CODE]
[B]Note[/B]: Before NBTInjector.getNbtData can be used on an Entity, NBTInjector.patchEntity has to be used on it at least once. This method will check if the entity is patched, and if not remove the entity and respawn it with the correct class. This destroys the original entity reference(the new one is returned) and the entity will blink once ingame. Bestcase you call this method right when the entity is spawned to prevent unwanted behavior(the blink, entities interacting with the Entity beeing patched like riding/leashes/combat may have problems).
[B]Maven[/B]
(Historicly it was Jitpack. Don't use it anymore!)
NBTApi is hosted and compiled by CodeMC.
[URL='https://ci.codemc.org/job/Tr7zw/job/Item-NBT-API/']JenkinsBuild[/URL] [URL='https://github.com/CodeMC/CI-Documentation']CodeMC-Info[/URL]
[code]<repositories>
...
<!-- CodeMC -->
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<layout>default</layout>
</repository>
...
</repositories>
[/code]
The API can be used in different ways:
[SPOILER="Normal Plugin dependency"]
Just use the Plugin as Maven dependency and remember to add "NBTAPI" as dependency into the plugin.yml. This way server owners will have to install the api and keep it updated.
[CODE]
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.6.0</version>
</dependency>
[/CODE]
[/SPOILER]
[SPOILER="Shading the API into your plugin"]
Using this method the API gets copied into your plugin. Server owners don't have to install the API on their own, but you need to keep it updated. Also [B]relocating is required[/B]!
[CODE]
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.6.0</version>
</dependency>
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>de.tr7zw.changeme.nbtapi</pattern>
<shadedPattern>YOUR PACKGE WHERE THE API SHOULD END UP</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
[/CODE]
[/SPOILER]
[B]Example Code[/B]
[SPOILER="Zombie that will pickup loot and does 0.5 Hearts of damage"]
[CODE]
Zombie z = (Zombie) b.getWorld().spawnEntity(b.getLocation().add(0, 1, 0), EntityType.ZOMBIE);
NBTEntity nbtent = new NBTEntity(z);
nbtent.setByte("CanPickUpLoot", (byte) 1);
NBTList list = nbtent.getCompoundList("Attributes");
for(int i = 0; i < list.size(); i++){
NBTListCompound lc = list.getCompound(i);
if(lc.getString("Name").equals("generic.attackDamage")){
lc.setDouble("Base", 0.5d);
}
}
[/CODE]
[/SPOILER]
[SPOILER="Simulate the command /data merge entity @e[type=zombie] {Silent:1b,Invulnerable:1b,Glowing:1b,IsBaby:1b}"]
[CODE]
NBTEntity nbtent = new NBTEntity(zombie);
nbtent.mergeCompound(new NBTContainer("{Silent:1b,Invulnerable:1b,Glowing:1b,IsBaby:1b}"));
[/CODE]
[/SPOILER]
[SPOILER="Creating a Head with texture, healthboost and some more tags"]
[CODE]
ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
NBTItem nbti = new NBTItem(head);
NBTCompound disp = nbti.addCompound("display");
disp.setString("Name", "Testitem");
List<String> l = disp.getStringList("Lore");
l.add("Some lore");
NBTCompound skull = nbti.addCompound("SkullOwner");
skull.setString("Name", "tr7zw");
skull.setString("Id", "fce0323d-7f50-4317-9720-5f6b14cf78ea");
NBTListCompound texture = skull.addCompound("Properties").getCompoundList("textures").addCompound();
texture.setString("Signature", "XpRfRz6/vXE6ip7/vq+40H6W70GFB0yjG6k8hG4pmFdnJFR+VQhslE0gXX/i0OAGThcAVSIT+/W1685wUxNofAiy+EhcxGNxNSJkYfOgXEVHTCuugpr+EQCUBI6muHDKms3PqY8ECxdbFTUEuWxdeiJsGt9VjHZMmUukkGhk0IobjQS3hjQ44FiT1tXuUU86oAxqjlKFpXG/iXtpcoXa33IObSI1S3gCKzVPOkMGlHZqRqKKElB54I2Qo4g5CJ+noudIDTzxPFwEEM6XrbM0YBi+SOdRvTbmrlkWF+ndzVWEINoEf++2hkO0gfeCqFqSMHuklMSgeNr/YtFZC5ShJRRv7zbyNF33jZ5DYNVR+KAK9iLO6prZhCVUkZxb1/BjOze6aN7kyN01u3nurKX6n3yQsoQQ0anDW6gNLKzO/mCvoCEvgecjaOQarktl/xYtD4YvdTTlnAlv2bfcXUtc++3UPIUbzf/jpf2g2wf6BGomzFteyPDu4USjBdpeWMBz9PxVzlVpDAtBYClFH/PFEQHMDtL5Q+VxUPu52XlzlUreMHpLT9EL92xwCAwVBBhrarQQWuLjAQXkp3oBdw6hlX6Fj0AafMJuGkFrYzcD7nNr61l9ErZmTWnqTxkJWZfZxmYBsFgV35SKc8rkRSHBNjcdKJZVN4GA+ZQH5B55mi4=");
texture.setString("Value", "eyJ0aW1lc3RhbXAiOjE0OTMwNDkwMTcxNTIsInByb2ZpbGVJZCI6ImZjZTAzMjNkN2Y1MDQzMTc5NzIwNWY2YjE0Y2Y3OGVhIiwicHJvZmlsZU5hbWUiOiJ0cjd6dyIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTI3NDZlNWU5OGMwZWRmZTU1YTI3ZGRjNjUxMmJmNjllYzJiYmNlNmM3ZmNhNTQ5YmEzNjZkYThiNTRjZTRkYiJ9fX0=");
NBTCompoundList attribute = nbti.getCompoundList("AttributeModifiers");
NBTListCompound mod1 = attribute.addCompound();
mod1.setInteger("Amount", 10);
mod1.setString("AttributeName", "generic.maxHealth");
mod1.setString("Name", "generic.maxHealth");
mod1.setInteger("Operation", 0);
mod1.setInteger("UUIDLeast", 59664);
mod1.setInteger("UUIDMost", 31453);
nbti.setInteger("HideFlags", 4);
nbti.setBoolean("Unbreakable", true);
head = nbti.getItem();
e.getPlayer().getInventory().addItem(head);
[/CODE]
[/SPOILER]
[SPOILER="Printing the NBT tags"]
[CODE]
Ocelot m = (Ocelot) e.getPlayer().getWorld().spawnEntity(e.getPlayer().getLocation(), EntityType.OCELOT);
NBTEntity ent = new NBTEntity(m);
System.out.println(ent);
[/CODE]
Output:
[CODE]
-AgeLocked: 0b
-HurtByTimestamp: 0
-CatType: 0
-Leashed: 0b
-Health: 10.0f
-Sitting: 0b
-Attributes: [0:{Base:10.0d,Name:"generic.maxHealth"},1:{Base:0.0d,Name:"generic.knockbackResistance"},2:{Base:0.30000001192092896d,Name:"generic.movementSpeed"},3:{Base:0.0d,Name:"generic.armor"},4:{Base:0.0d,Name:"generic.armorToughness"},5:{Base:16.0d,Modifiers:[0:{UUIDMost:-8783172028836920024L,UUIDLeast:-6820414278857408689L,Amount:-0.030166473586416633d,Operation:1,Name:"Random spawn bonus"}],Name:"generic.followRange"}]
-FallFlying: 0b
-LeftHanded: 0b
-ForcedAge: 0
-AbsorptionAmount: 0.0f
-HandItems: [0:{},1:{}]
-ArmorDropChances: [0:0.085f,1:0.085f,2:0.085f,3:0.085f]
-OwnerUUID: ""
-InLove: 0
-DeathTime: 0s
-ArmorItems: [0:{},1:{},2:{},3:{}]
-CanPickUpLoot: 0b
-HandDropChances: [0:0.085f,1:0.085f]
-PersistenceRequired: 0b
-HurtTime: 0s
-Age: 0
[/CODE]
[/SPOILER]
[SPOILER="Locking Chests"]
[CODE] NBTTileEntity tent = new NBTTileEntity(b.getState());
tent.setString("Lock", "test");[/CODE]
[/SPOILER]
[B]More Infos:[/B]
[LIST]
[*][URL]https://www.spigotmc.org/threads/override-base-item-attribute-value.236434/#post-2387235[/URL]
[/LIST]
[B]This API can't be used for:[/B]
[LIST]
[*][I][SIZE=4][S]Adding custom tags to TileEntities/Entities[/S] [/SIZE][/I][SIZE=4]Not true anymore, check the NBTInjector examples above[/SIZE]
[/LIST]
Git: [URL='https://github.com/tr7zw/Item-NBT-API']Github[/URL]
Maven Repo: [URL='https://repo.codemc.org/#browse/browse:maven-public:de%2Ftr7zw%2Fitem-nbt-api-plugin']CodeMC[/URL]
Jenkins: [URL='https://ci.codemc.org/job/Tr7zw/job/Item-NBT-API/']Jenkins[/URL]
Discord server for help: [URL='https://discord.gg/yk4caxM']Discord[/URL]
Feel free to create forks for your need! (Send me a message on [S]Spigot[/S] the Discord server if you want stuff to be added/need help)
Yes you are allowed to integrate the API into your plugin(remember to shade)! (Send me a link to your project so I can check it out ;))
[B][SIZE=5]Projects using the API(That I know of)[/SIZE]
[U][SIZE=4]Plugins[/SIZE][/U][/B]
[URL='https://www.spigotmc.org/resources/crazy-enchantments.16470/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=16470&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/backpacks.45622/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=45622&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/gravy.45288/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=45288&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/interactivebooks.45604/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=45604&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/vouchers.13654/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=13654&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/itemcommands.49543/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=49543&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/comparable-hoppers-2.45058/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=45058&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/nottooexpensive.62680/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=62680&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/papermoney.70361/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=70361&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/blockstackerx-plugin-for-askyblock.71514/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=71514&[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/blockstackerx-recoded.73749/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=73749[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/63020/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=63020&reload[/IMG][/URL]
[URL='https://www.spigotmc.org/resources/72810/'][IMG]https://tr7zw.dev/nbtapi/linkedProjects.php?id=72810&reload[/IMG][/URL]
[U][B]Server/Networks[/B][/U]
[URL='http://Timolia.de'][IMG]http://status.mclive.eu/Timolia.de/timolia.de/25565/banner.png[/IMG][/URL]
[U][B]Other[/B][/U]
- [URL='https://github.com/LogisticsCraft/Logistics-API']Logistics-API[/URL]
If you like this Resource, donate me a Coffee or become a Patreon for cool perks! [URL='https://tr7zw.dev/donate/']Donating[/URL]
[SIZE=4][SIZE=4][U][B]Donators[/B][/U]
[U][B][URL='https://www.spigotmc.org/members/mrdienns.35704/'][IMG]https://tr7zw.dev/nbtapi/spigotPeople.php?id=35704[/IMG][/URL] [/B][/U]
[U][B][URL='https://www.spigotmc.org/members/mraxetv.27720/'][IMG]https://tr7zw.dev/nbtapi/spigotPeople.php?id=27720[/IMG][/URL] [/B][/U]
[URL='https://www.spigotmc.org/members/lonedev.88296/'][IMG]https://tr7zw.dev/nbtapi/spigotPeople.php?id=88296[/IMG][/URL]
[URL='https://www.spigotmc.org/members/gc.25090/'][IMG]https://tr7zw.dev/nbtapi/spigotPeople.php?id=25090[/IMG][/URL]
[URL='https://www.spigotmc.org/members/peaches_mlg100.194338/'][IMG]https://tr7zw.dev/nbtapi/spigotPeople.php?id=194338[/IMG][/URL][/SIZE][/SIZE]
[IMG]https://bstats.org/signatures/bukkit/ItemNBTAPI.svg[/IMG]
+78
View File
@@ -0,0 +1,78 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:50 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/Casing.html" title="enum in de.tr7zw.changeme.nbtapi.wrapper" target="classFrame">Casing</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/CheckUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">CheckUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ClassWrapper.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">ClassWrapper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/CodecHelper.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">CodecHelper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">DataFixerUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/Forge1710Mappings.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">Forge1710Mappings</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/GameprofileUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">GameprofileUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/GsonWrapper.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">GsonWrapper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/MinecraftVersion.html" title="enum in de.tr7zw.changeme.nbtapi.utils" target="classFrame">MinecraftVersion</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/MojangToMapping.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">MojangToMapping</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBT.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBT</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NbtApiException.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NbtApiException</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTBlock.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTBlock</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTChunk.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTChunk</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTCompound</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTCompoundList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTCompoundList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTContainer.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTContainer</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTDoubleList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTDoubleList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTEntity.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTEntity</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTFile.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTFile</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/NBTFileHandle.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">NBTFileHandle</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTFloatList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTFloatList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTGameProfile.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTGameProfile</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/NBTHandler.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">NBTHandler</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/handler/NBTHandlers.html" title="class in de.tr7zw.changeme.nbtapi.handler" target="classFrame">NBTHandlers</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTIntArrayList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTIntArrayList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTIntegerList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTIntegerList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTItem.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTItem</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/NBTJsonUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">NBTJsonUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTListCompound</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTLongList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTLongList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTPersistentDataContainer.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTPersistentDataContainer</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/NBTProxy.html" title="interface in de.tr7zw.changeme.nbtapi.wrapper" target="classFrame"><span class="interfaceName">NBTProxy</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTReflectionUtil.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTReflectionUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTStringList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTStringList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/NBTTarget.html" title="annotation in de.tr7zw.changeme.nbtapi.wrapper" target="classFrame">NBTTarget</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/NBTTarget.Type.html" title="enum in de.tr7zw.changeme.nbtapi.wrapper" target="classFrame">NBTTarget.Type</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTTileEntity.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTTileEntity</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTType.html" title="enum in de.tr7zw.changeme.nbtapi" target="classFrame">NBTType</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTUUIDList.html" title="class in de.tr7zw.changeme.nbtapi" target="classFrame">NBTUUIDList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ObjectCreator.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">ObjectCreator</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/PackageWrapper.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">PackageWrapper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/PathUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">PathUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/PathUtil.PathSegment.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">PathUtil.PathSegment</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/ProxyBuilder.html" title="class in de.tr7zw.changeme.nbtapi.wrapper" target="classFrame">ProxyBuilder</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/ProxyList.html" title="interface in de.tr7zw.changeme.nbtapi.wrapper" target="classFrame"><span class="interfaceName">ProxyList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadableItemNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadableItemNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadableNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadableNBTList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteItemNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadWriteItemNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadWriteNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadWriteNBTCompoundList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface" target="classFrame"><span class="interfaceName">ReadWriteNBTList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">ReflectionMethod</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.Since.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings" target="classFrame">ReflectionMethod.Since</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/ReflectionUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">ReflectionUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/UUIDUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">UUIDUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/VersionChecker.html" title="class in de.tr7zw.changeme.nbtapi.utils" target="classFrame">VersionChecker</a></li>
</ul>
</div>
</body>
</html>
+78
View File
@@ -0,0 +1,78 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:50 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/Casing.html" title="enum in de.tr7zw.changeme.nbtapi.wrapper">Casing</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/CheckUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">CheckUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ClassWrapper.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings">ClassWrapper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/CodecHelper.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings">CodecHelper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">DataFixerUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/Forge1710Mappings.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings">Forge1710Mappings</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/GameprofileUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">GameprofileUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/GsonWrapper.html" title="class in de.tr7zw.changeme.nbtapi.utils">GsonWrapper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/MinecraftVersion.html" title="enum in de.tr7zw.changeme.nbtapi.utils">MinecraftVersion</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/MojangToMapping.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings">MojangToMapping</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBT.html" title="class in de.tr7zw.changeme.nbtapi">NBT</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NbtApiException.html" title="class in de.tr7zw.changeme.nbtapi">NbtApiException</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTBlock.html" title="class in de.tr7zw.changeme.nbtapi">NBTBlock</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTChunk.html" title="class in de.tr7zw.changeme.nbtapi">NBTChunk</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTCompoundList.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompoundList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTContainer.html" title="class in de.tr7zw.changeme.nbtapi">NBTContainer</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTDoubleList.html" title="class in de.tr7zw.changeme.nbtapi">NBTDoubleList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTEntity.html" title="class in de.tr7zw.changeme.nbtapi">NBTEntity</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTFile.html" title="class in de.tr7zw.changeme.nbtapi">NBTFile</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/NBTFileHandle.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">NBTFileHandle</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTFloatList.html" title="class in de.tr7zw.changeme.nbtapi">NBTFloatList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTGameProfile.html" title="class in de.tr7zw.changeme.nbtapi">NBTGameProfile</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/NBTHandler.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">NBTHandler</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/handler/NBTHandlers.html" title="class in de.tr7zw.changeme.nbtapi.handler">NBTHandlers</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTIntArrayList.html" title="class in de.tr7zw.changeme.nbtapi">NBTIntArrayList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTIntegerList.html" title="class in de.tr7zw.changeme.nbtapi">NBTIntegerList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTItem.html" title="class in de.tr7zw.changeme.nbtapi">NBTItem</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/NBTJsonUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">NBTJsonUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTLongList.html" title="class in de.tr7zw.changeme.nbtapi">NBTLongList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTPersistentDataContainer.html" title="class in de.tr7zw.changeme.nbtapi">NBTPersistentDataContainer</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/NBTProxy.html" title="interface in de.tr7zw.changeme.nbtapi.wrapper"><span class="interfaceName">NBTProxy</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTReflectionUtil.html" title="class in de.tr7zw.changeme.nbtapi">NBTReflectionUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTStringList.html" title="class in de.tr7zw.changeme.nbtapi">NBTStringList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/NBTTarget.html" title="annotation in de.tr7zw.changeme.nbtapi.wrapper">NBTTarget</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/NBTTarget.Type.html" title="enum in de.tr7zw.changeme.nbtapi.wrapper">NBTTarget.Type</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTTileEntity.html" title="class in de.tr7zw.changeme.nbtapi">NBTTileEntity</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTType.html" title="enum in de.tr7zw.changeme.nbtapi">NBTType</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/NBTUUIDList.html" title="class in de.tr7zw.changeme.nbtapi">NBTUUIDList</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ObjectCreator.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings">ObjectCreator</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/PackageWrapper.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings">PackageWrapper</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/PathUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">PathUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/PathUtil.PathSegment.html" title="class in de.tr7zw.changeme.nbtapi.utils">PathUtil.PathSegment</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/ProxyBuilder.html" title="class in de.tr7zw.changeme.nbtapi.wrapper">ProxyBuilder</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/wrapper/ProxyList.html" title="interface in de.tr7zw.changeme.nbtapi.wrapper"><span class="interfaceName">ProxyList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadableItemNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadableItemNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadableNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadableNBTList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteItemNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadWriteItemNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadWriteNBT</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadWriteNBTCompoundList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface"><span class="interfaceName">ReadWriteNBTList</span></a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.html" title="enum in de.tr7zw.changeme.nbtapi.utils.nmsmappings">ReflectionMethod</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.Since.html" title="class in de.tr7zw.changeme.nbtapi.utils.nmsmappings">ReflectionMethod.Since</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/ReflectionUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">ReflectionUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/UUIDUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">UUIDUtil</a></li>
<li><a href="de/tr7zw/changeme/nbtapi/utils/VersionChecker.html" title="class in de.tr7zw.changeme.nbtapi.utils">VersionChecker</a></li>
</ul>
</div>
</body>
</html>
+412
View File
@@ -0,0 +1,412 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:50 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Constant Field Values (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values (item-nbt-api 2.16.1 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#de.tr7zw">de.tr7zw.*</a></li>
</ul>
</div>
<div class="constantValuesContainer"><a name="de.tr7zw">
<!-- -->
</a>
<h2 title="de.tr7zw">de.tr7zw.*</h2>
<ul class="blockList">
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>de.tr7zw.changeme.nbtapi.utils.<a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html" title="class in de.tr7zw.changeme.nbtapi.utils">DataFixerUtil</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION_26_1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION_26_1">VERSION_26_1</a></code></td>
<td class="colLast"><code>4786</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION_26_2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION_26_2">VERSION_26_2</a></code></td>
<td class="colLast"><code>4903</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION_26_3">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION_26_3">VERSION_26_3</a></code></td>
<td class="colLast"><code>5023</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_12_2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_12_2">VERSION1_12_2</a></code></td>
<td class="colLast"><code>1343</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_12R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_12R1">VERSION1_12R1</a></code></td>
<td class="colLast"><code>1343</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_16_5">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_16_5">VERSION1_16_5</a></code></td>
<td class="colLast"><code>2586</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_16R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_16R1">VERSION1_16R1</a></code></td>
<td class="colLast"><code>2586</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_17_1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_17_1">VERSION1_17_1</a></code></td>
<td class="colLast"><code>2730</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_17R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_17R1">VERSION1_17R1</a></code></td>
<td class="colLast"><code>2730</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_18_2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_18_2">VERSION1_18_2</a></code></td>
<td class="colLast"><code>2975</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_18R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_18R1">VERSION1_18R1</a></code></td>
<td class="colLast"><code>2975</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_19_2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_19_2">VERSION1_19_2</a></code></td>
<td class="colLast"><code>3120</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_19_4">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_19_4">VERSION1_19_4</a></code></td>
<td class="colLast"><code>3337</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_19R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_19R1">VERSION1_19R1</a></code></td>
<td class="colLast"><code>3120</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_19R3">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_19R3">VERSION1_19R3</a></code></td>
<td class="colLast"><code>3337</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20_1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20_1">VERSION1_20_1</a></code></td>
<td class="colLast"><code>3465</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20_2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20_2">VERSION1_20_2</a></code></td>
<td class="colLast"><code>3578</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20_4">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20_4">VERSION1_20_4</a></code></td>
<td class="colLast"><code>3700</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20_5">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20_5">VERSION1_20_5</a></code></td>
<td class="colLast"><code>3837</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20R1">VERSION1_20R1</a></code></td>
<td class="colLast"><code>3465</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20R2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20R2">VERSION1_20R2</a></code></td>
<td class="colLast"><code>3578</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20R3">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20R3">VERSION1_20R3</a></code></td>
<td class="colLast"><code>3700</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_20R4">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_20R4">VERSION1_20R4</a></code></td>
<td class="colLast"><code>3837</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21">VERSION1_21</a></code></td>
<td class="colLast"><code>3953</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21_2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21_2">VERSION1_21_2</a></code></td>
<td class="colLast"><code>4080</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21_3">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21_3">VERSION1_21_3</a></code></td>
<td class="colLast"><code>4189</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21_4">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21_4">VERSION1_21_4</a></code></td>
<td class="colLast"><code>4323</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21_5">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21_5">VERSION1_21_5</a></code></td>
<td class="colLast"><code>4435</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R1">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R1">VERSION1_21R1</a></code></td>
<td class="colLast"><code>3953</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R2">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R2">VERSION1_21R2</a></code></td>
<td class="colLast"><code>4080</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R3">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R3">VERSION1_21R3</a></code></td>
<td class="colLast"><code>4189</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R4">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R4">VERSION1_21R4</a></code></td>
<td class="colLast"><code>4323</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R5">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R5">VERSION1_21R5</a></code></td>
<td class="colLast"><code>4435</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R6">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R6">VERSION1_21R6</a></code></td>
<td class="colLast"><code>4554</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.DataFixerUtil.VERSION1_21R7">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.html#VERSION1_21R7">VERSION1_21R7</a></code></td>
<td class="colLast"><code>4671</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>de.tr7zw.changeme.nbtapi.utils.<a href="de/tr7zw/changeme/nbtapi/utils/MinecraftVersion.html" title="enum in de.tr7zw.changeme.nbtapi.utils">MinecraftVersion</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="de.tr7zw.changeme.nbtapi.utils.MinecraftVersion.VERSION">
<!-- -->
</a><code>protected&nbsp;static&nbsp;final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="de/tr7zw/changeme/nbtapi/utils/MinecraftVersion.html#VERSION">VERSION</a></code></td>
<td class="colLast"><code>"2.16.1"</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2026 <a href="https://github.com/tr7zw/">tr7zw</a>. All rights reserved.</small></p>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,303 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:49 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NBTBlock (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NBTBlock (item-nbt-api 2.16.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":42};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTBlock.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NbtApiException.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTChunk.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTBlock.html" target="_top">Frames</a></li>
<li><a href="NBTBlock.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">de.tr7zw.changeme.nbtapi</div>
<h2 title="Class NBTBlock" class="title">Class NBTBlock</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>de.tr7zw.changeme.nbtapi.NBTBlock</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use methods in <a href="../../../../de/tr7zw/changeme/nbtapi/NBT.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBT</code></a> class to read/modify block's NBT</span></div>
</div>
<br>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public class <span class="typeNameLabel">NBTBlock</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Helper class to store NBT data to Block Locations. Use getData() to get the
NBT instance. Important notes:
<p>
- Non BlockEntities can not have NBT data. This stores the data to the chunk
instead!
<p>
- The data is really just on the location. If the block gets
broken/changed/exploded/moved etc., the data is still on that location!</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>tr7zw</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTBlock.html#NBTBlock-org.bukkit.block.Block-">NBTBlock</a></span>(org.bukkit.block.Block&nbsp;block)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTBlock.html#getData--">getData</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use methods in <a href="../../../../de/tr7zw/changeme/nbtapi/NBT.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBT</code></a> class to read/modify block's NBT</span></div>
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="NBTBlock-org.bukkit.block.Block-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NBTBlock</h4>
<pre>public&nbsp;NBTBlock(org.bukkit.block.Block&nbsp;block)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getData--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getData</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;getData()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use methods in <a href="../../../../de/tr7zw/changeme/nbtapi/NBT.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBT</code></a> class to read/modify block's NBT</span></div>
<div class="block">Gets the block NBT data stored within the chunk's PDC.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>block NBT data</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTBlock.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NbtApiException.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTChunk.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTBlock.html" target="_top">Frames</a></li>
<li><a href="NBTBlock.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2026 <a href="https://github.com/tr7zw/">tr7zw</a>. All rights reserved.</small></p>
</body>
</html>
@@ -0,0 +1,291 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:49 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NBTChunk (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NBTChunk (item-nbt-api 2.16.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":42};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTChunk.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTBlock.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTChunk.html" target="_top">Frames</a></li>
<li><a href="NBTChunk.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">de.tr7zw.changeme.nbtapi</div>
<h2 title="Class NBTChunk" class="title">Class NBTChunk</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>de.tr7zw.changeme.nbtapi.NBTChunk</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use methods in <a href="../../../../de/tr7zw/changeme/nbtapi/NBT.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBT</code></a> class to read/modify chunk's nbt</span></div>
</div>
<br>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public class <span class="typeNameLabel">NBTChunk</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Helper class to store NBT data to <code>Chunk</code>'s PDC (persistent data container).</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTChunk.html#NBTChunk-org.bukkit.Chunk-">NBTChunk</a></span>(org.bukkit.Chunk&nbsp;chunk)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTChunk.html#getPersistentDataContainer--">getPersistentDataContainer</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Gets the NBTCompound used by spigots PersistentDataAPI.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="NBTChunk-org.bukkit.Chunk-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NBTChunk</h4>
<pre>public&nbsp;NBTChunk(org.bukkit.Chunk&nbsp;chunk)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getPersistentDataContainer--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getPersistentDataContainer</h4>
<pre>public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;getPersistentDataContainer()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Gets the NBTCompound used by spigots PersistentDataAPI. This method is only
available for 1.16.4+!</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>NBTCompound containing the data of the PersistentDataAPI</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTChunk.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTBlock.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTChunk.html" target="_top">Frames</a></li>
<li><a href="NBTChunk.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2026 <a href="https://github.com/tr7zw/">tr7zw</a>. All rights reserved.</small></p>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,549 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:49 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NBTCompoundList (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NBTCompoundList (item-nbt-api 2.16.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":42,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTCompoundList.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTCompoundList.html" target="_top">Frames</a></li>
<li><a href="NBTCompoundList.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.tr7zw.changeme.nbtapi.NBTList">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">de.tr7zw.changeme.nbtapi</div>
<h2 title="Class NBTCompoundList" class="title">Class NBTCompoundList</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">de.tr7zw.changeme.nbtapi.NBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</li>
<li>
<ul class="inheritance">
<li>de.tr7zw.changeme.nbtapi.NBTCompoundList</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTCompoundList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">NBTCompoundList</span>
extends <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;
implements <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTCompoundList</a></pre>
<div class="block"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBTListCompound</code></a> implementation for NBTLists</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>tr7zw</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.de.tr7zw.changeme.nbtapi.NBTList">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;de.tr7zw.changeme.nbtapi.<a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a></h3>
<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#listObject">listObject</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#NBTCompoundList-de.tr7zw.changeme.nbtapi.NBTCompound-java.lang.String-de.tr7zw.changeme.nbtapi.NBTType-java.lang.Object-">NBTCompoundList</a></span>(<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;owner,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="../../../../de/tr7zw/changeme/nbtapi/NBTType.html" title="enum in de.tr7zw.changeme.nbtapi">NBTType</a>&nbsp;type,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;list)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#add-int-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">add</a></span>(int&nbsp;index,
<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;element)</code>
<div class="block">Adds the specified element at the specified position in this list.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#add-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">add</a></span>(<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;empty)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Please use addCompound!</span></div>
</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#addCompound--">addCompound</a></span>()</code>
<div class="block">Adds a new Compound to the end of the List and returns it.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#addCompound-de.tr7zw.changeme.nbtapi.NBTCompound-">addCompound</a></span>(<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;comp)</code>
<div class="block">Adds a copy of the Compound to the end of the List and returns it.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#addCompound-de.tr7zw.changeme.nbtapi.iface.ReadableNBT-">addCompound</a></span>(<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBT</a>&nbsp;comp)</code>
<div class="block">Adds a copy of the Compound to the end of the List and returns it.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#asTag-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">asTag</a></span>(<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;object)</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#get-int-">get</a></span>(int&nbsp;index)</code>
<div class="block">Get the object with the given id.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html#set-int-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">set</a></span>(int&nbsp;index,
<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;element)</code>
<div class="block">Replaces the element at the specified position in this list with the
specified element.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.tr7zw.changeme.nbtapi.NBTList">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;de.tr7zw.changeme.nbtapi.<a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a></h3>
<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#addAll-java.util.Collection-">addAll</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#addAll-int-java.util.Collection-">addAll</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#clear--">clear</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#contains-java.lang.Object-">contains</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#containsAll-java.util.Collection-">containsAll</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#getName--">getName</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#getParent--">getParent</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#getType--">getType</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#indexOf-java.lang.Object-">indexOf</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#isEmpty--">isEmpty</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#iterator--">iterator</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#lastIndexOf-java.lang.Object-">lastIndexOf</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#listIterator--">listIterator</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#listIterator-int-">listIterator</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#remove-int-">remove</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#remove-java.lang.Object-">remove</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#removeAll-java.util.Collection-">removeAll</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#removeIf-java.util.function.Predicate-">removeIf</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#retainAll-java.util.Collection-">retainAll</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#save--">save</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#size--">size</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#subList-int-int-">subList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#toArray--">toArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#toArray-E:A-">toArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#toString--">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.tr7zw.changeme.nbtapi.iface.ReadWriteNBTCompoundList">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;de.tr7zw.changeme.nbtapi.iface.<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTCompoundList</a></h3>
<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html#clear--">clear</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html#remove-int-">remove</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html#removeIf-java.util.function.Predicate-">removeIf</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.tr7zw.changeme.nbtapi.iface.ReadableNBTList">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;de.tr7zw.changeme.nbtapi.iface.<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBTList</a></h3>
<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#contains-java.lang.Object-">contains</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#containsAll-java.util.Collection-">containsAll</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#getType--">getType</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#indexOf-java.lang.Object-">indexOf</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#isEmpty--">isEmpty</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#lastIndexOf-java.lang.Object-">lastIndexOf</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#size--">size</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#subList-int-int-">subList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#toArray--">toArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#toArray-E:A-">toArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#toListCopy--">toListCopy</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#forEach-java.util.function.Consumer-" title="class or interface in java.lang">forEach</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#iterator--" title="class or interface in java.lang">iterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#spliterator--" title="class or interface in java.lang">spliterator</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.List">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.util.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.util">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#hashCode--" title="class or interface in java.util">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#replaceAll-java.util.function.UnaryOperator-" title="class or interface in java.util">replaceAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#sort-java.util.Comparator-" title="class or interface in java.util">sort</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#spliterator--" title="class or interface in java.util">spliterator</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.Collection">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.util.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream--" title="class or interface in java.util">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream--" title="class or interface in java.util">stream</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="NBTCompoundList-de.tr7zw.changeme.nbtapi.NBTCompound-java.lang.String-de.tr7zw.changeme.nbtapi.NBTType-java.lang.Object-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NBTCompoundList</h4>
<pre>protected&nbsp;NBTCompoundList(<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;owner,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="../../../../de/tr7zw/changeme/nbtapi/NBTType.html" title="enum in de.tr7zw.changeme.nbtapi">NBTType</a>&nbsp;type,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;list)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="addCompound--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addCompound</h4>
<pre>public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a>&nbsp;addCompound()</pre>
<div class="block">Adds a new Compound to the end of the List and returns it.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html#addCompound--">addCompound</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTCompoundList</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The added <a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBTListCompound</code></a></dd>
</dl>
</li>
</ul>
<a name="addCompound-de.tr7zw.changeme.nbtapi.NBTCompound-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addCompound</h4>
<pre>public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;addCompound(<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a>&nbsp;comp)</pre>
<div class="block">Adds a copy of the Compound to the end of the List and returns it. When null
is given, a new Compound will be created</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>comp</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
</dl>
</li>
</ul>
<a name="addCompound-de.tr7zw.changeme.nbtapi.iface.ReadableNBT-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addCompound</h4>
<pre>public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;addCompound(<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBT</a>&nbsp;comp)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html#addCompound-de.tr7zw.changeme.nbtapi.iface.ReadableNBT-">ReadWriteNBTCompoundList</a></code></span></div>
<div class="block">Adds a copy of the Compound to the end of the List and returns it. When null
is given, a new Compound will be created</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html#addCompound-de.tr7zw.changeme.nbtapi.iface.ReadableNBT-">addCompound</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTCompoundList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTCompoundList</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
</dl>
</li>
</ul>
<a name="add-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;boolean&nbsp;add(<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;empty)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">Please use addCompound!</span></div>
<div class="block">Adds a new Compound to the end of the List.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html#add-T-">add</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#add-E-" title="class or interface in java.util">add</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#add-E-" title="class or interface in java.util">add</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#add-T-">add</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>empty</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>True, if compound was added</dd>
</dl>
</li>
</ul>
<a name="add-int-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;void&nbsp;add(int&nbsp;index,
<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;element)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html#add-int-T-">ReadWriteNBTList</a></code></span></div>
<div class="block">Adds the specified element at the specified position in this list.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html#add-int-T-">add</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#add-int-E-" title="class or interface in java.util">add</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#add-int-T-">add</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index at which the specified element is to be inserted</dd>
<dd><code>element</code> - The element to be added to the list.</dd>
</dl>
</li>
</ul>
<a name="get-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a>&nbsp;get(int&nbsp;index)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#get-int-">ReadableNBTList</a></code></span></div>
<div class="block">Get the object with the given id.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html#get-int-">get</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#get-int-" title="class or interface in java.util">get</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The id of the object to get.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The object with the given id.</dd>
</dl>
</li>
</ul>
<a name="set-int-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>public&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTListCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTListCompound</a>&nbsp;set(int&nbsp;index,
<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;element)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html#set-int-T-">ReadWriteNBTList</a></code></span></div>
<div class="block">Replaces the element at the specified position in this list with the
specified element.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html#set-int-T-">set</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBTList.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#set-int-E-" title="class or interface in java.util">set</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#set-int-T-">set</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index of the element to replace</dd>
<dd><code>element</code> - The element to be stored at the specified position</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The element that was previously at the specified position.</dd>
</dl>
</li>
</ul>
<a name="asTag-de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>asTag</h4>
<pre>protected&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;asTag(<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&nbsp;object)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html#asTag-T-">asTag</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTList.html" title="class in de.tr7zw.changeme.nbtapi">NBTList</a>&lt;<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a>&gt;</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTCompoundList.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTCompoundList.html" target="_top">Frames</a></li>
<li><a href="NBTCompoundList.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.tr7zw.changeme.nbtapi.NBTList">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2026 <a href="https://github.com/tr7zw/">tr7zw</a>. All rights reserved.</small></p>
</body>
</html>
@@ -0,0 +1,466 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang>
<head>
<!-- Generated by javadoc (1.8.0_504) on Thu Sep 17 18:08:49 UTC 2026 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NBTContainer (item-nbt-api 2.16.1 API)</title>
<meta name="date" content="2026-09-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NBTContainer (item-nbt-api 2.16.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTContainer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTDoubleList.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTContainer.html" target="_top">Frames</a></li>
<li><a href="NBTContainer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">de.tr7zw.changeme.nbtapi</div>
<h2 title="Class NBTContainer" class="title">Class NBTContainer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">de.tr7zw.changeme.nbtapi.NBTCompound</a></li>
<li>
<ul class="inheritance">
<li>de.tr7zw.changeme.nbtapi.NBTContainer</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBT</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadWriteNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadWriteNBT</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">NBTContainer</span>
extends <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></pre>
<div class="block">A Standalone <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBTCompound</code></a> implementation. All data is just kept inside
this Object.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>tr7zw</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#NBTContainer--">NBTContainer</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use <a href="../../../../de/tr7zw/changeme/nbtapi/NBT.html#createNBTObject--"><code>NBT.createNBTObject()</code></a></span></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#NBTContainer-java.io.InputStream-">NBTContainer</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;inputsteam)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Use NBT.readNBT</span></div>
</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#NBTContainer-java.lang.Object-">NBTContainer</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;nbt)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Use NBT.wrapNMSTag</span></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#NBTContainer-java.lang.String-">NBTContainer</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nbtString)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Use NBT.parseNBT</span></div>
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#getCompound--">getCompound</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#isClosed--">isClosed</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#isReadOnly--">isReadOnly</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#setClosed--">setClosed</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#setCompound-java.lang.Object-">setCompound</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;tag)</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html" title="class in de.tr7zw.changeme.nbtapi">NBTContainer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html#setReadOnly-boolean-">setReadOnly</a></span>(boolean&nbsp;readOnly)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.tr7zw.changeme.nbtapi.NBTCompound">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;de.tr7zw.changeme.nbtapi.<a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></h3>
<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#addCompound-java.lang.String-">addCompound</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#asNBTString--">asNBTString</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#clearNBT--">clearNBT</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#equals-java.lang.Object-">equals</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#extractDifference-de.tr7zw.changeme.nbtapi.iface.ReadableNBT-">extractDifference</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#get-java.lang.String-de.tr7zw.changeme.nbtapi.iface.NBTHandler-">get</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getBoolean-java.lang.String-">getBoolean</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getByte-java.lang.String-">getByte</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getByteArray-java.lang.String-">getByteArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getCompound-java.lang.String-">getCompound</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getCompoundList-java.lang.String-">getCompoundList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getDouble-java.lang.String-">getDouble</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getDoubleList-java.lang.String-">getDoubleList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getEnum-java.lang.String-java.lang.Class-">getEnum</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getFloat-java.lang.String-">getFloat</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getFloatList-java.lang.String-">getFloatList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getIntArray-java.lang.String-">getIntArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getIntArrayList-java.lang.String-">getIntArrayList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getInteger-java.lang.String-">getInteger</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getIntegerList-java.lang.String-">getIntegerList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getItemStack-java.lang.String-">getItemStack</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getItemStackArray-java.lang.String-">getItemStackArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getKeys--">getKeys</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getListType-java.lang.String-">getListType</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getLong-java.lang.String-">getLong</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getLongArray-java.lang.String-">getLongArray</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getLongList-java.lang.String-">getLongList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getName--">getName</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getObject-java.lang.String-java.lang.Class-">getObject</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getOrCreateCompound-java.lang.String-">getOrCreateCompound</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getOrDefault-java.lang.String-T-">getOrDefault</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getOrNull-java.lang.String-java.lang.Class-">getOrNull</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getParent--">getParent</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getReadLock--">getReadLock</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getResolvedObject--">getResolvedObject</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getShort-java.lang.String-">getShort</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getString-java.lang.String-">getString</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getStringList-java.lang.String-">getStringList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getType-java.lang.String-">getType</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getUUID-java.lang.String-">getUUID</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getUUIDList-java.lang.String-">getUUIDList</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getWriteLock--">getWriteLock</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#hashCode--">hashCode</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#hasKey-java.lang.String-">hasKey</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#hasTag-java.lang.String-">hasTag</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#mergeCompound-de.Line truncated
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.tr7zw.changeme.nbtapi.iface.ReadableNBT">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;de.tr7zw.changeme.nbtapi.iface.<a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html" title="interface in de.tr7zw.changeme.nbtapi.iface">ReadableNBT</a></h3>
<code><a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html#hasTag-java.lang.String-de.tr7zw.changeme.nbtapi.NBTType-">hasTag</a>, <a href="../../../../de/tr7zw/changeme/nbtapi/iface/ReadableNBT.html#isEmpty--">isEmpty</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="NBTContainer--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NBTContainer</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;NBTContainer()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use <a href="../../../../de/tr7zw/changeme/nbtapi/NBT.html#createNBTObject--"><code>NBT.createNBTObject()</code></a></span></div>
<div class="block">Creates an empty, standalone NBTCompound</div>
</li>
</ul>
<a name="NBTContainer-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NBTContainer</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;NBTContainer(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;nbt)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">Use NBT.wrapNMSTag</span></div>
<div class="block">Takes in any NMS Compound to wrap it</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nbt</code> - </dd>
</dl>
</li>
</ul>
<a name="NBTContainer-java.io.InputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NBTContainer</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;NBTContainer(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;inputsteam)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">Use NBT.readNBT</span></div>
<div class="block">Reads in a NBT InputStream</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputsteam</code> - </dd>
</dl>
</li>
</ul>
<a name="NBTContainer-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NBTContainer</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;NBTContainer(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nbtString)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">Use NBT.parseNBT</span></div>
<div class="block">Parses in a NBT String to a standalone <a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi"><code>NBTCompound</code></a>. Can throw a
<a href="../../../../de/tr7zw/changeme/nbtapi/NbtApiException.html" title="class in de.tr7zw.changeme.nbtapi"><code>NbtApiException</code></a> in case something goes wrong.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nbtString</code> - </dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getCompound--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCompound</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;getCompound()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#getCompound--">getCompound</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The NMS Compound behind this Object</dd>
</dl>
</li>
</ul>
<a name="setCompound-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCompound</h4>
<pre>public&nbsp;void&nbsp;setCompound(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;tag)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#setCompound-java.lang.Object-">setCompound</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></dd>
</dl>
</li>
</ul>
<a name="setClosed--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setClosed</h4>
<pre>protected&nbsp;void&nbsp;setClosed()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#setClosed--">setClosed</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></dd>
</dl>
</li>
</ul>
<a name="isClosed--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isClosed</h4>
<pre>protected&nbsp;boolean&nbsp;isClosed()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#isClosed--">isClosed</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></dd>
</dl>
</li>
</ul>
<a name="isReadOnly--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isReadOnly</h4>
<pre>protected&nbsp;boolean&nbsp;isReadOnly()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html#isReadOnly--">isReadOnly</a></code>&nbsp;in class&nbsp;<code><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompound.html" title="class in de.tr7zw.changeme.nbtapi">NBTCompound</a></code></dd>
</dl>
</li>
</ul>
<a name="setReadOnly-boolean-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setReadOnly</h4>
<pre>protected&nbsp;<a href="../../../../de/tr7zw/changeme/nbtapi/NBTContainer.html" title="class in de.tr7zw.changeme.nbtapi">NBTContainer</a>&nbsp;setReadOnly(boolean&nbsp;readOnly)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NBTContainer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTCompoundList.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../de/tr7zw/changeme/nbtapi/NBTDoubleList.html" title="class in de.tr7zw.changeme.nbtapi"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/tr7zw/changeme/nbtapi/NBTContainer.html" target="_top">Frames</a></li>
<li><a href="NBTContainer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2026 <a href="https://github.com/tr7zw/">tr7zw</a>. All rights reserved.</small></p>
</body>
</html>
Loaded 100 of 617 files, more files were not shown because too many files have changed in this diff. Show more