Fix deprecations
This commit is contained in:
@@ -6,6 +6,7 @@ import com.raoulvdberge.refinedstorage.api.network.security.Permission;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.capability.CapabilityNetworkNodeProxy;
|
||||
import com.raoulvdberge.refinedstorage.util.WorldUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
@@ -29,8 +30,8 @@ public class NetworkNodeListener {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockPlace(BlockEvent.PlaceEvent e) {
|
||||
if (!e.getWorld().isRemote) {
|
||||
public void onBlockPlace(BlockEvent.EntityPlaceEvent e) {
|
||||
if (!e.getWorld().isRemote && e.getEntity() instanceof EntityPlayer) {
|
||||
TileEntity placed = e.getWorld().getTileEntity(e.getPos());
|
||||
|
||||
if (placed != null && placed.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, null)) {
|
||||
@@ -41,8 +42,8 @@ public class NetworkNodeListener {
|
||||
INetworkNodeProxy nodeProxy = side.getCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing.getOpposite());
|
||||
INetworkNode node = nodeProxy.getNode();
|
||||
|
||||
if (node.getNetwork() != null && !node.getNetwork().getSecurityManager().hasPermission(Permission.BUILD, e.getPlayer())) {
|
||||
WorldUtils.sendNoPermissionMessage(e.getPlayer());
|
||||
if (node.getNetwork() != null && !node.getNetwork().getSecurityManager().hasPermission(Permission.BUILD, (EntityPlayer) e.getEntity())) {
|
||||
WorldUtils.sendNoPermissionMessage((EntityPlayer) e.getEntity());
|
||||
|
||||
e.setCanceled(true);
|
||||
|
||||
|
@@ -162,7 +162,7 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable,
|
||||
}
|
||||
|
||||
private boolean canPlace(BlockPos pos, IBlockState state) {
|
||||
BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(world, pos, state), world.getBlockState(pos), getFakePlayer(), EnumHand.MAIN_HAND);
|
||||
BlockEvent.EntityPlaceEvent e = new BlockEvent.EntityPlaceEvent(new BlockSnapshot(world, pos, state), world.getBlockState(pos), getFakePlayer());
|
||||
|
||||
return !MinecraftForge.EVENT_BUS.post(e);
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ public class TextFieldSearch extends GuiTextField {
|
||||
|
||||
@Override
|
||||
public boolean textboxKeyTyped(char typedChar, int keyCode) {
|
||||
boolean canLoseFocus = ObfuscationReflectionHelper.getPrivateValue(GuiTextField.class, this, 10);
|
||||
@SuppressWarnings("deprecation") boolean canLoseFocus = ObfuscationReflectionHelper.getPrivateValue(GuiTextField.class, this, 10);
|
||||
|
||||
boolean result = super.textboxKeyTyped(typedChar, keyCode);
|
||||
|
||||
|
@@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.integration.jei;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.ingredients.VanillaTypes;
|
||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
@@ -25,7 +26,7 @@ public class RecipeWrapperCover implements ICraftingRecipeWrapper {
|
||||
inputs.add(new ItemStack(RSItems.CUTTING_TOOL));
|
||||
inputs.add(stack);
|
||||
|
||||
ingredients.setInputs(ItemStack.class, inputs);
|
||||
ingredients.setOutput(ItemStack.class, cover);
|
||||
ingredients.setInputs(VanillaTypes.ITEM, inputs);
|
||||
ingredients.setOutput(VanillaTypes.ITEM, cover);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.integration.jei;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.ingredients.VanillaTypes;
|
||||
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
@@ -29,8 +30,8 @@ public class RecipeWrapperHollowCover implements IShapedCraftingRecipeWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
ingredients.setInputs(ItemStack.class, inputs);
|
||||
ingredients.setOutput(ItemStack.class, hollowCover);
|
||||
ingredients.setInputs(VanillaTypes.ITEM, inputs);
|
||||
ingredients.setOutput(VanillaTypes.ITEM, hollowCover);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -420,7 +420,7 @@ public final class RenderUtils {
|
||||
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
if (i == 0) {
|
||||
lines.set(i, stack.getRarity().color + lines.get(i));
|
||||
lines.set(i, stack.getItem().getForgeRarity(stack).getColor() + lines.get(i));
|
||||
} else {
|
||||
lines.set(i, TextFormatting.GRAY + lines.get(i));
|
||||
}
|
||||
|
Reference in New Issue
Block a user