More compile things

This commit is contained in:
covers1624
2020-06-02 15:12:30 +09:30
parent 404ef5624b
commit 3f5c299d09
111 changed files with 838 additions and 873 deletions
@@ -26,7 +26,9 @@ import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
@@ -48,6 +50,7 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.core.AEConfig;
import appeng.core.Api;
import appeng.core.features.AEFeature;
import appeng.core.localization.GuiText;
import appeng.items.AEBaseItem;
@@ -162,7 +165,7 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
public ActionResult<ItemStack> onItemRightClick( final World world, final PlayerEntity player, final Hand hand )
{
this.disassembleDrive( player.getHeldItem( hand ), world, player );
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
return new ActionResult<>( ActionResultType.SUCCESS, player.getHeldItem( hand ) );
}
private boolean disassembleDrive( final ItemStack stack, final World world, final PlayerEntity player )
@@ -206,9 +209,9 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
// drop empty storage cell case
this.dropEmptyStorageCellCase( ia, player );
if( player.inventoryContainer != null )
if( player.container != null )
{
player.inventoryContainer.detectAndSendChanges();
player.container.detectAndSendChanges();
}
return true;
@@ -221,9 +224,9 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
protected abstract void dropEmptyStorageCellCase( final InventoryAdaptor ia, final PlayerEntity player );
@Override
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
public ActionResultType onItemUseFirst( ItemStack stack, ItemUseContext context )
{
return this.disassembleDrive( player.getHeldItem( hand ), world, player ) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
return this.disassembleDrive( stack, context.getWorld(), context.getPlayer() ) ? ActionResultType.SUCCESS : ActionResultType.PASS;
}
@Override
@@ -26,6 +26,7 @@ import appeng.api.AEApi;
import appeng.api.storage.IStorageChannel;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.Api;
import appeng.items.materials.MaterialType;
import appeng.util.InventoryAdaptor;
@@ -35,6 +35,7 @@ import appeng.api.storage.ICellInventoryHandler;
import appeng.api.storage.ICellWorkbenchItem;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.core.Api;
import appeng.items.AEBaseItem;
import appeng.items.contents.CellConfig;
@@ -110,7 +110,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
if( is.hasTag() )
{
final CompoundNBT c = is.getTag();
return new WorldCoord( c.getInteger( NBT_SIZE_X_KEY ), c.getInteger( NBT_SIZE_Y_KEY ), c.getInteger( NBT_SIZE_Z_KEY ) );
return new WorldCoord( c.getInt( NBT_SIZE_X_KEY ), c.getInt( NBT_SIZE_Y_KEY ), c.getInt( NBT_SIZE_Z_KEY ) );
}
return new WorldCoord( 0, 0, 0 );
}
@@ -121,7 +121,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
if( is.hasTag() )
{
final CompoundNBT c = is.getTag();
return c.getInteger( NBT_CELL_ID_KEY );
return c.getInt( NBT_CELL_ID_KEY );
}
return -1;
}
@@ -182,9 +182,9 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
{
final CompoundNBT c = is.getOrCreateTag();
c.setInteger( NBT_CELL_ID_KEY, id );
c.setInteger( NBT_SIZE_X_KEY, size.getX() );
c.setInteger( NBT_SIZE_Y_KEY, size.getY() );
c.setInteger( NBT_SIZE_Z_KEY, size.getZ() );
c.putInt( NBT_CELL_ID_KEY, id );
c.putInt( NBT_SIZE_X_KEY, size.getX() );
c.putInt( NBT_SIZE_Y_KEY, size.getY() );
c.putInt( NBT_SIZE_Z_KEY, size.getZ() );
}
}