Skip to content

Commit

Permalink
Rename legacy things to bundled things.
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Aug 4, 2018
1 parent f5f1d35 commit d5012bb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package com.sk89q.worldedit.bukkit;

import com.sk89q.worldedit.world.registry.BiomeRegistry;
import com.sk89q.worldedit.world.registry.LegacyWorldData;
import com.sk89q.worldedit.world.registry.BundledWorldData;

/**
* World data for the Bukkit platform.
*/
class BukkitWorldData extends LegacyWorldData {
class BukkitWorldData extends BundledWorldData {

private static final BukkitWorldData INSTANCE = new BukkitWorldData();
private final BiomeRegistry biomeRegistry = new BukkitBiomeRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.TreeGenerator.TreeType;
import com.sk89q.worldedit.world.biome.BaseBiome;
import com.sk89q.worldedit.world.registry.LegacyWorldData;
import com.sk89q.worldedit.world.registry.BundledWorldData;
import com.sk89q.worldedit.world.registry.WorldData;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -97,7 +97,7 @@ public boolean generateTree(TreeType type, EditSession editSession, Vector posit

@Override
public WorldData getWorldData() {
return LegacyWorldData.getInstance();
return BundledWorldData.getInstance();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,6 @@ public String fromLegacyId(Integer id) {
}
}

/**
* Get the material properties for the given block.
*
* @param id the legacy numeric ID
* @return the material's properties, or null
*/
@Nullable
@Deprecated
public BlockMaterial getMaterialById(int id) {
BlockEntry entry = findById(id);
if (entry != null) {
return entry.material;
} else {
return null;
}
}

/**
* Get the material properties for the given block.
*
Expand All @@ -177,23 +160,6 @@ public BlockMaterial getMaterialById(String id) {
}
}

/**
* Get the states for the given block.
*
* @param id the legacy numeric ID
* @return the block's states, or null if no information is available
*/
@Nullable
@Deprecated
public Map<String, ? extends State> getStatesById(int id) {
BlockEntry entry = findById(id);
if (entry != null) {
return entry.states;
} else {
return null;
}
}

/**
* Get the states for the given block.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* A block registry that uses {@link BundledBlockData} to serve information
* about blocks.
*/
public class LegacyBlockRegistry implements BlockRegistry {
public class BundledBlockRegistry implements BlockRegistry {

@Nullable
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
package com.sk89q.worldedit.world.registry;

/**
* An implementation of {@link WorldData} that uses legacy numeric IDs and
* a built-in block database.
* An implementation of {@link WorldData} that converts legacy numeric IDs and
* a contains a built-in block database.
*/
public class LegacyWorldData implements WorldData {
public class BundledWorldData implements WorldData {

private static final LegacyWorldData INSTANCE = new LegacyWorldData();
private final LegacyBlockRegistry blockRegistry = new LegacyBlockRegistry();
private static final BundledWorldData INSTANCE = new BundledWorldData();
private final BundledBlockRegistry blockRegistry = new BundledBlockRegistry();
private final NullItemRegistry itemRegistry = new NullItemRegistry();
private final NullEntityRegistry entityRegistry = new NullEntityRegistry();
private final NullBiomeRegistry biomeRegistry = new NullBiomeRegistry();

/**
* Create a new instance.
*/
protected LegacyWorldData() {
protected BundledWorldData() {
}

@Override
Expand Down Expand Up @@ -62,7 +62,7 @@ public BiomeRegistry getBiomeRegistry() {
*
* @return an instance
*/
public static LegacyWorldData getInstance() {
public static BundledWorldData getInstance() {
return INSTANCE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.sk89q.worldedit.math.transform.AffineTransform;
import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.world.registry.BlockRegistry;
import com.sk89q.worldedit.world.registry.LegacyBlockRegistry;
import com.sk89q.worldedit.world.registry.BundledBlockRegistry;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
Expand Down Expand Up @@ -54,7 +54,7 @@ public void setUp() throws Exception {

@Test
public void testTransform() throws Exception {
BlockRegistry blockRegistry = new LegacyBlockRegistry();
BlockRegistry blockRegistry = new BundledBlockRegistry();
for (BlockType type : BlockType.values()) {
if (ignored.contains(type)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

import com.sk89q.worldedit.world.registry.BiomeRegistry;
import com.sk89q.worldedit.world.registry.ItemRegistry;
import com.sk89q.worldedit.world.registry.LegacyWorldData;
import com.sk89q.worldedit.world.registry.BundledWorldData;

/**
* World data for the Forge platform.
*/
class ForgeWorldData extends LegacyWorldData {
class ForgeWorldData extends BundledWorldData {

private static final ForgeWorldData INSTANCE = new ForgeWorldData();
private final BiomeRegistry biomeRegistry = new ForgeBiomeRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package com.sk89q.worldedit.sponge;

import com.sk89q.worldedit.world.registry.BiomeRegistry;
import com.sk89q.worldedit.world.registry.LegacyWorldData;
import com.sk89q.worldedit.world.registry.BundledWorldData;

/**
* World data for the Sponge platform.
*/
class SpongeWorldData extends LegacyWorldData {
class SpongeWorldData extends BundledWorldData {

private static final SpongeWorldData INSTANCE = new SpongeWorldData();
private final BiomeRegistry biomeRegistry = new SpongeBiomeRegistry();
Expand Down

0 comments on commit d5012bb

Please sign in to comment.