Skip to content

Commit

Permalink
Remove some 1.11 cruft.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Jan 6, 2017
1 parent 5c3e7b9 commit 23d655c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions src/main/java/mod/chiselsandbits/client/ModConflictContext.java
Expand Up @@ -7,7 +7,6 @@
import mod.chiselsandbits.api.KeyBindingContext;
import mod.chiselsandbits.core.ClientSide;
import mod.chiselsandbits.helpers.ChiselToolType;
import mod.chiselsandbits.helpers.ModUtil;
import mod.chiselsandbits.interfaces.IVoxelBlobItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand All @@ -29,7 +28,7 @@ public boolean isActive()
}

final ItemStack held = ClientSide.instance.getPlayer().getHeldItemMainhand();
return !ModUtil.isEmpty( held ) && held.getItem() instanceof IVoxelBlobItem;
return held != null && held.getItem() instanceof IVoxelBlobItem;
}

@Override
Expand Down Expand Up @@ -115,7 +114,7 @@ public boolean conflicts(
}
};

private Set<Class<? extends Item>> activeItemClasses = new HashSet<Class<? extends Item>>();
private final Set<Class<? extends Item>> activeItemClasses = new HashSet<Class<? extends Item>>();

public void setItemActive(
final Item item )
Expand All @@ -128,12 +127,12 @@ public boolean isActive()
{
final ItemStack held = ClientSide.instance.getPlayer().getHeldItemMainhand();

if ( ModUtil.isEmpty( held ) )
if ( held == null )
{
return false;
}

for ( Class<? extends Item> itemClass : activeItemClasses )
for ( final Class<? extends Item> itemClass : activeItemClasses )
{
if ( itemClass.isInstance( held.getItem() ) )
{
Expand All @@ -147,7 +146,7 @@ public boolean isActive()

if ( annotation instanceof KeyBindingContext )
{
for ( String name : ( (KeyBindingContext) annotation ).value() )
for ( final String name : ( (KeyBindingContext) annotation ).value() )
{
if ( name.equals( getName() ) )
{
Expand Down
Expand Up @@ -2,7 +2,6 @@

import mod.chiselsandbits.client.ModConflictContext;
import mod.chiselsandbits.core.Log;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
Expand All @@ -27,7 +26,7 @@ public void excuteIMC(
item = Item.REGISTRY.getObject( new ResourceLocation( name ) );

// try finding the item in the mod instead...
if ( item == null || item == Items.field_190931_a )
if ( item == null )
{
errorName = message.getSender() + ":" + name;
item = Item.REGISTRY.getObject( new ResourceLocation( message.getSender(), name ) );
Expand All @@ -44,12 +43,12 @@ else if ( message.isResourceLocationMessage() )
return;
}

if ( item == null || item == Items.field_190931_a )
if ( item == null )
{
throw new RuntimeException( "Unable to locate item " + errorName );
}

for ( ModConflictContext conflictContext : ModConflictContext.values() )
for ( final ModConflictContext conflictContext : ModConflictContext.values() )
{
if ( conflictContext.getName().equals( message.key ) )
{
Expand Down

0 comments on commit 23d655c

Please sign in to comment.