2014-04-27 04:57:45 +00:00
|
|
|
/*
|
|
|
|
* WorldEdit, a Minecraft world manipulation toolkit
|
|
|
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
|
|
* Copyright (C) WorldEdit team and contributors
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-07-09 21:14:17 +00:00
|
|
|
package com.sk89q.worldedit.world.registry;
|
2014-04-27 04:57:45 +00:00
|
|
|
|
|
|
|
/**
|
2018-01-03 06:49:57 +00:00
|
|
|
* An implementation of {@link WorldData} that converts legacy numeric IDs and
|
2018-06-11 13:45:19 +00:00
|
|
|
* a contains a built-in block and item database.
|
2014-04-27 04:57:45 +00:00
|
|
|
*/
|
2018-01-03 06:49:57 +00:00
|
|
|
public class BundledWorldData implements WorldData {
|
2014-04-27 04:57:45 +00:00
|
|
|
|
2018-01-03 06:49:57 +00:00
|
|
|
private static final BundledWorldData INSTANCE = new BundledWorldData();
|
|
|
|
private final BundledBlockRegistry blockRegistry = new BundledBlockRegistry();
|
2018-06-11 13:45:19 +00:00
|
|
|
private final BundledItemRegistry itemRegistry = new BundledItemRegistry();
|
2014-07-16 02:47:47 +00:00
|
|
|
private final NullEntityRegistry entityRegistry = new NullEntityRegistry();
|
2014-07-17 07:21:13 +00:00
|
|
|
private final NullBiomeRegistry biomeRegistry = new NullBiomeRegistry();
|
2014-07-09 21:14:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new instance.
|
|
|
|
*/
|
2018-01-03 06:49:57 +00:00
|
|
|
protected BundledWorldData() {
|
2014-04-27 04:57:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-07-09 21:14:17 +00:00
|
|
|
public BlockRegistry getBlockRegistry() {
|
|
|
|
return blockRegistry;
|
|
|
|
}
|
|
|
|
|
2015-10-27 06:14:30 +00:00
|
|
|
@Override
|
|
|
|
public ItemRegistry getItemRegistry() {
|
|
|
|
return itemRegistry;
|
|
|
|
}
|
|
|
|
|
2014-07-16 02:47:47 +00:00
|
|
|
@Override
|
|
|
|
public EntityRegistry getEntityRegistry() {
|
|
|
|
return entityRegistry;
|
|
|
|
}
|
|
|
|
|
2014-07-17 07:21:13 +00:00
|
|
|
@Override
|
|
|
|
public BiomeRegistry getBiomeRegistry() {
|
|
|
|
return biomeRegistry;
|
|
|
|
}
|
|
|
|
|
2014-07-09 21:14:17 +00:00
|
|
|
/**
|
|
|
|
* Get a singleton instance.
|
|
|
|
*
|
|
|
|
* @return an instance
|
|
|
|
*/
|
2018-01-03 06:49:57 +00:00
|
|
|
public static BundledWorldData getInstance() {
|
2014-07-09 21:14:17 +00:00
|
|
|
return INSTANCE;
|
2014-04-27 04:57:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|