PageRenderTime 120ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java

http://github.com/sk89q/worldedit
Java | 75 lines | 38 code | 11 blank | 26 comment | 0 complexity | 254a0404857f5f39a36bde1d1aa2283c MD5 | raw file
  1. /*
  2. * WorldEdit, a Minecraft world manipulation toolkit
  3. * Copyright (C) sk89q <http://www.sk89q.com>
  4. * Copyright (C) WorldEdit team and contributors
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. package com.sk89q.worldedit.forge;
  20. import com.sk89q.worldedit.world.registry.BiomeRegistry;
  21. import com.sk89q.worldedit.world.registry.BlockCategoryRegistry;
  22. import com.sk89q.worldedit.world.registry.BlockRegistry;
  23. import com.sk89q.worldedit.world.registry.BundledRegistries;
  24. import com.sk89q.worldedit.world.registry.ItemCategoryRegistry;
  25. import com.sk89q.worldedit.world.registry.ItemRegistry;
  26. /**
  27. * World data for the Forge platform.
  28. */
  29. class ForgeRegistries extends BundledRegistries {
  30. private static final ForgeRegistries INSTANCE = new ForgeRegistries();
  31. private final BlockRegistry blockRegistry = new ForgeBlockRegistry();
  32. private final BiomeRegistry biomeRegistry = new ForgeBiomeRegistry();
  33. private final ItemRegistry itemRegistry = new ForgeItemRegistry();
  34. private final BlockCategoryRegistry blockCategoryRegistry = new ForgeBlockCategoryRegistry();
  35. private final ItemCategoryRegistry itemCategoryRegistry = new ForgeItemCategoryRegistry();
  36. @Override
  37. public BlockRegistry getBlockRegistry() {
  38. return blockRegistry;
  39. }
  40. @Override
  41. public BiomeRegistry getBiomeRegistry() {
  42. return biomeRegistry;
  43. }
  44. @Override
  45. public ItemRegistry getItemRegistry() {
  46. return itemRegistry;
  47. }
  48. @Override
  49. public BlockCategoryRegistry getBlockCategoryRegistry() {
  50. return blockCategoryRegistry;
  51. }
  52. @Override
  53. public ItemCategoryRegistry getItemCategoryRegistry() {
  54. return itemCategoryRegistry;
  55. }
  56. /**
  57. * Get a static instance.
  58. *
  59. * @return an instance
  60. */
  61. public static ForgeRegistries getInstance() {
  62. return INSTANCE;
  63. }
  64. }