Fix Javadocs and code issues.

This commit is contained in:
sk89q
2014-07-29 11:04:04 -07:00
parent 8834af7538
commit 1dc84d2511
230 changed files with 1646 additions and 1882 deletions

View File

@@ -19,14 +19,12 @@
package com.sk89q.worldedit.forge;
import java.util.Map;
import com.sk89q.worldedit.blocks.BaseItemStack;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import com.sk89q.worldedit.blocks.BaseItemStack;
import cpw.mods.fml.common.FMLCommonHandler;
import java.util.Map;
public final class ForgeUtil {
@@ -41,7 +39,7 @@ public final class ForgeUtil {
public static ItemStack toForgeItemStack(BaseItemStack item) {
ItemStack ret = new ItemStack(item.getType(), item.getAmount(), item.getData());
for (Map.Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
ret.addEnchantment(net.minecraft.enchantment.Enchantment.enchantmentsList[((Integer)entry.getKey()).intValue()], ((Integer)entry.getValue()).intValue());
ret.addEnchantment(net.minecraft.enchantment.Enchantment.enchantmentsList[((Integer) entry.getKey())], (Integer) entry.getValue());
}
return ret;

View File

@@ -33,7 +33,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Utility methods for setting tile entities in the world.
*/
class TileEntityUtils {
final class TileEntityUtils {
private TileEntityUtils() {
}
@@ -110,7 +110,8 @@ class TileEntityUtils {
* @param clazz the class
* @return a tile entity (may be null if it failed)
*/
static @Nullable TileEntity constructTileEntity(World world, Vector position, Class<? extends TileEntity> clazz) {
@Nullable
static TileEntity constructTileEntity(World world, Vector position, Class<? extends TileEntity> clazz) {
Constructor<? extends TileEntity> baseConstructor;
try {
baseConstructor = clazz.getConstructor(); // creates "blank" TE

View File

@@ -33,6 +33,7 @@ import cpw.mods.fml.common.network.Player;
public class WECUIPacketHandler implements IPacketHandler {
public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
if (player instanceof EntityPlayerMP) {
LocalSession session = ForgeWorldEdit.inst.getSession((EntityPlayerMP) player);