Permalink
Browse files

Update for new required methods in 42be11009782e1d2ff8e311e8d4ce58944…

…e07c07.
  • Loading branch information...
sk89q committed Jul 17, 2014
1 parent 72ae498 commit 0fbbd271052960ada61ec0ab632c773016af6868
@@ -37,6 +37,7 @@
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.internal.Constants;
import net.minecraft.server.v1_7_R2.BiomeBase;
import net.minecraft.server.v1_7_R2.Block;
import net.minecraft.server.v1_7_R2.Entity;
import net.minecraft.server.v1_7_R2.EntityTypes;
@@ -58,8 +59,11 @@
import net.minecraft.server.v1_7_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R2.block.CraftBlock;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -177,6 +181,30 @@ private static void readEntityIntoTag(Entity entity, NBTTagCompound tag) {
// Code that is less likely to break
// ------------------------------------------------------------------------
@SuppressWarnings("deprecation")
@Override
public int getBlockId(Material material) {
return material.getId();
}
@SuppressWarnings("deprecation")
@Override
public Material getMaterial(int id) {
return Material.getMaterial(id);
}
@Override
public int getBiomeId(Biome biome) {
BiomeBase mcBiome = CraftBlock.biomeToBiomeBase(biome);
return mcBiome != null ? mcBiome.id : 0;
}
@Override
public Biome getBiome(int id) {
BiomeBase mcBiome = BiomeBase.getBiome(id);
return CraftBlock.biomeBaseToBiome(mcBiome); // Defaults to ocean if it's an invalid ID
}
@SuppressWarnings("deprecation")
@Override
public BaseBlock getBlock(Location location) {
@@ -37,6 +37,7 @@
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.internal.Constants;
import net.minecraft.server.v1_7_R3.BiomeBase;
import net.minecraft.server.v1_7_R3.Block;
import net.minecraft.server.v1_7_R3.Entity;
import net.minecraft.server.v1_7_R3.EntityTypes;
@@ -58,8 +59,11 @@
import net.minecraft.server.v1_7_R3.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.craftbukkit.v1_7_R3.CraftServer;
import org.bukkit.craftbukkit.v1_7_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R3.block.CraftBlock;
import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -177,6 +181,30 @@ private static void readEntityIntoTag(Entity entity, NBTTagCompound tag) {
// Code that is less likely to break
// ------------------------------------------------------------------------
@SuppressWarnings("deprecation")
@Override
public int getBlockId(Material material) {
return material.getId();
}
@SuppressWarnings("deprecation")
@Override
public Material getMaterial(int id) {
return Material.getMaterial(id);
}
@Override
public int getBiomeId(Biome biome) {
BiomeBase mcBiome = CraftBlock.biomeToBiomeBase(biome);
return mcBiome != null ? mcBiome.id : 0;
}
@Override
public Biome getBiome(int id) {
BiomeBase mcBiome = BiomeBase.getBiome(id);
return CraftBlock.biomeBaseToBiome(mcBiome); // Defaults to ocean if it's an invalid ID
}
@SuppressWarnings("deprecation")
@Override
public BaseBlock getBlock(Location location) {
@@ -37,6 +37,7 @@
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.internal.Constants;
import net.minecraft.server.v1_7_R4.BiomeBase;
import net.minecraft.server.v1_7_R4.Block;
import net.minecraft.server.v1_7_R4.Entity;
import net.minecraft.server.v1_7_R4.EntityTypes;
@@ -58,8 +59,11 @@
import net.minecraft.server.v1_7_R4.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.craftbukkit.v1_7_R4.CraftServer;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R4.block.CraftBlock;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -177,6 +181,30 @@ private static void readEntityIntoTag(Entity entity, NBTTagCompound tag) {
// Code that is less likely to break
// ------------------------------------------------------------------------
@SuppressWarnings("deprecation")
@Override
public int getBlockId(Material material) {
return material.getId();
}
@SuppressWarnings("deprecation")
@Override
public Material getMaterial(int id) {
return Material.getMaterial(id);
}
@Override
public int getBiomeId(Biome biome) {
BiomeBase mcBiome = CraftBlock.biomeToBiomeBase(biome);
return mcBiome != null ? mcBiome.id : 0;
}
@Override
public Biome getBiome(int id) {
BiomeBase mcBiome = BiomeBase.getBiome(id);
return CraftBlock.biomeBaseToBiome(mcBiome); // Defaults to ocean if it's an invalid ID
}
@SuppressWarnings("deprecation")
@Override
public BaseBlock getBlock(Location location) {

0 comments on commit 0fbbd27

Please sign in to comment.