Remove some deprecated methods and clean up

This commit is contained in:
Ben Staddon authored and mezz committed 2017-06-25 22:30:18 -07:00
1 parent 7892ca922c
commit 9a09ff68aa
28 files changed
+45 -444

No files matched your search

@@ -62,14 +62,6 @@ public class DungeonHooks
return rarity;
}
// TODO: remove
/** @deprecated use {@link #removeDungeonMob(ResourceLocation)} */
@Deprecated
public static int removeDungeonMob(String name)
{
return removeDungeonMob(new ResourceLocation(name));
}
/**
* Will completely remove a Mob from the dungeon spawn list.
*
@@ -1032,52 +1032,27 @@ public class ForgeHooks
return git == null ? null : git.hitVec;
}
// TODO 1.12 remove these three
@Deprecated
public static boolean onInteractEntityAt(EntityPlayer player, Entity entity, RayTraceResult ray, EnumHand hand)
{
return onInteractEntityAtAction(player, entity, ray, hand) != null;
}
@Deprecated
public static boolean onInteractEntityAt(EntityPlayer player, Entity entity, Vec3d vec3d, EnumHand hand)
{
return onInteractEntityAtAction(player, entity, vec3d, hand) != null;
}
@Deprecated
public static boolean onInteractEntity(EntityPlayer player, Entity entity, EnumHand hand)
{
return onInteractEntityAction(player, entity, hand) != null;
}
public static EnumActionResult onInteractEntityAtAction(EntityPlayer player, Entity entity, RayTraceResult ray, EnumHand hand)
public static EnumActionResult onInteractEntityAt(EntityPlayer player, Entity entity, RayTraceResult ray, EnumHand hand)
{
Vec3d vec3d = new Vec3d(ray.hitVec.x - entity.posX, ray.hitVec.y - entity.posY, ray.hitVec.z - entity.posZ);
return onInteractEntityAtAction(player, entity, vec3d, hand);
return onInteractEntityAt(player, entity, vec3d, hand);
}
public static EnumActionResult onInteractEntityAtAction(EntityPlayer player, Entity entity, Vec3d vec3d, EnumHand hand)
public static EnumActionResult onInteractEntityAt(EntityPlayer player, Entity entity, Vec3d vec3d, EnumHand hand)
{
PlayerInteractEvent.EntityInteractSpecific evt = new PlayerInteractEvent.EntityInteractSpecific(player, hand, entity, vec3d);
MinecraftForge.EVENT_BUS.post(evt);
return evt.isCanceled() ? evt.getCancellationResult() : null;
}
public static EnumActionResult onInteractEntityAction(EntityPlayer player, Entity entity, EnumHand hand)
public static EnumActionResult onInteractEntity(EntityPlayer player, Entity entity, EnumHand hand)
{
PlayerInteractEvent.EntityInteract evt = new PlayerInteractEvent.EntityInteract(player, hand, entity);
MinecraftForge.EVENT_BUS.post(evt);
return evt.isCanceled() ? evt.getCancellationResult() : null;
}
@Deprecated // TODO 1.12 remove
public static boolean onItemRightClick(EntityPlayer player, EnumHand hand)
{
return onItemRightClickAction(player, hand) != null;
}
public static EnumActionResult onItemRightClickAction(EntityPlayer player, EnumHand hand)
public static EnumActionResult onItemRightClick(EntityPlayer player, EnumHand hand)
{
PlayerInteractEvent.RightClickItem evt = new PlayerInteractEvent.RightClickItem(player, hand);
MinecraftForge.EVENT_BUS.post(evt);
@@ -1108,14 +1083,6 @@ public class ForgeHooks
MinecraftForge.EVENT_BUS.post(new PlayerInteractEvent.LeftClickEmpty(player));
}
// TODO: remove
/** @deprecated use {@link ForgeHooks#onEmptyLeftClick(EntityPlayer)} */
@Deprecated
public static void onEmptyLeftClick(EntityPlayer player, @Nonnull ItemStack stack)
{
onEmptyLeftClick(player);
}
private static ThreadLocal<Deque<LootTableContext>> lootContext = new ThreadLocal<Deque<LootTableContext>>();
private static LootTableContext getLootTableContext()
{
@@ -1127,14 +1094,6 @@ public class ForgeHooks
return ctx;
}
// TODO: remove
/** @deprecated use {@link ForgeHooks#loadLootTable(Gson, ResourceLocation, String, boolean, LootTableManager)} */
@Deprecated
public static LootTable loadLootTable(Gson gson, ResourceLocation name, String data, boolean custom)
{
return loadLootTable(gson, name, data, custom, null);
}
@Nullable
public static LootTable loadLootTable(Gson gson, ResourceLocation name, String data, boolean custom, LootTableManager lootTableManager)
{
@@ -1,49 +0,0 @@
/*
* Minecraft Forge
* Copyright (c) 2016.
*
* This library 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 version 2.1
* of the License.
*
* This library 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.common.util;
import org.apache.commons.io.IOUtils;
import javax.annotation.Nullable;
import java.io.Closeable;
import java.io.IOException;
import java.util.zip.ZipFile;
public class Java6Utils
{
/**
* {@link ZipFile} does not implement {@link Closeable} on Java 6.
* This method is the same as {@link IOUtils#closeQuietly(Closeable)} but works on {@link ZipFile} on Java 6.
*/
public static void closeZipQuietly(@Nullable ZipFile file)
{
try
{
if (file != null)
{
file.close();
}
}
catch (IOException ioe)
{
// ignore
}
}
}