Skip to content

Instantly share code, notes, and snippets.

@thomas15v
Created September 10, 2014 08:12
Show Gist options
  • Save thomas15v/d33c8f265a84da2f198b to your computer and use it in GitHub Desktop.
Save thomas15v/d33c8f265a84da2f198b to your computer and use it in GitHub Desktop.
package org.spongepowered.mod.world;
import net.minecraft.world.WorldServer;
import org.spongepowered.api.block.Block;
import org.spongepowered.api.world.Chunk;
import org.spongepowered.api.world.World;
import org.spongepowered.mod.block.SpongeBlock;
import java.util.UUID;
/**
* Created by thomas on 9/10/2014.
*/
public class SpongeWorld implements World {
private WorldServer nmsworld;
public SpongeWorld(WorldServer nmsworld){
this.nmsworld = nmsworld;
}
@Override
public UUID getUniqueID() {
return null;
}
@Override
public String getName() {
return nmsworld.getWorldInfo().getWorldName();
}
@Override
public Chunk getChunk(int x, int z) {
return new SpongeChunk(nmsworld.getChunkFromBlockCoords(x,z));
}
@Override
public Block getBlock(int x, int y, int z) {
return new SpongeBlock(nmsworld.getBlock(x, y, z));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment