Custom Model Loader
This commit is contained in:
@@ -23,7 +23,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public interface IBlockDefinition extends IItemDefinition
|
||||
@@ -31,12 +32,20 @@ public interface IBlockDefinition extends IItemDefinition
|
||||
/**
|
||||
* @return the {@link Block} implementation if applicable
|
||||
*/
|
||||
RegistryObject<Block> maybeBlock();
|
||||
default Optional<Block> maybeBlock() {
|
||||
return Optional.of(block());
|
||||
}
|
||||
|
||||
Block block();
|
||||
|
||||
/**
|
||||
* @return the {@link BlockItem} implementation if applicable
|
||||
*/
|
||||
RegistryObject<BlockItem> maybeBlockItem();
|
||||
default Optional<BlockItem> maybeBlockItem() {
|
||||
return Optional.of(blockItem());
|
||||
}
|
||||
|
||||
BlockItem blockItem();
|
||||
|
||||
/**
|
||||
* Compare Block with world.
|
||||
|
||||
@@ -44,12 +44,20 @@ public interface IItemDefinition extends IComparableDefinition
|
||||
/**
|
||||
* @return the {@link Item} Implementation if applicable
|
||||
*/
|
||||
Optional<Item> maybeItem();
|
||||
default Optional<Item> maybeItem() {
|
||||
return Optional.of(item());
|
||||
}
|
||||
|
||||
Item item();
|
||||
|
||||
/**
|
||||
* @return an {@link ItemStack} with specified quantity of this item.
|
||||
*/
|
||||
Optional<ItemStack> maybeStack( int stackSize );
|
||||
default Optional<ItemStack> maybeStack( int stackSize ) {
|
||||
return Optional.of(stack(stackSize));
|
||||
}
|
||||
|
||||
ItemStack stack( int stackSize );
|
||||
|
||||
/**
|
||||
* @return <tt>true</tt> if definition is enabled
|
||||
|
||||
@@ -44,7 +44,7 @@ import net.minecraft.item.ItemStack;
|
||||
* {@literal @}Override
|
||||
* public default EnumActionResult onItemUse(ItemStack is, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
* {
|
||||
* return AEApi.instance().partHelper().placeBus( is, pos, side, player, hand, world );
|
||||
* return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world );
|
||||
* }
|
||||
* </code>
|
||||
* </pre>
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
*
|
||||
* Don't Implement.
|
||||
*
|
||||
* Construct with AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class).createStack( FluidStack )
|
||||
* Construct with Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class).createStack( FluidStack )
|
||||
*/
|
||||
public interface IAEFluidStack extends IAEStack<IAEFluidStack>
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.item.ItemStack;
|
||||
*
|
||||
* Don't Implement.
|
||||
*
|
||||
* Construct with AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class).createStack( ItemStack )
|
||||
* Construct with Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class).createStack( ItemStack )
|
||||
*/
|
||||
public interface IAEItemStack extends IAEStack<IAEItemStack>
|
||||
{
|
||||
|
||||
@@ -35,8 +35,8 @@ import appeng.api.storage.IStorageChannel;
|
||||
* Don't Implement.
|
||||
*
|
||||
* Construct with
|
||||
* - For items: AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class).createList()
|
||||
* - For fluids: AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class).createList()
|
||||
* - For items: Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class).createList()
|
||||
* - For fluids: Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class).createList()
|
||||
* - Replace with the corresponding {@link IStorageChannel} type for non native channels
|
||||
*/
|
||||
public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Iterable<T>
|
||||
|
||||
@@ -34,11 +34,6 @@ import net.minecraft.world.IBlockReader;
|
||||
public interface IOrientableBlock
|
||||
{
|
||||
|
||||
/**
|
||||
* @return if this block uses metadata to store its rotation.
|
||||
*/
|
||||
boolean usesMetadata();
|
||||
|
||||
/**
|
||||
* @param world world of block
|
||||
* @param pos The position of the block.
|
||||
|
||||
Reference in New Issue
Block a user