reformatted all src files (#141)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package appeng.fluids.items;
|
||||
|
||||
|
||||
import appeng.items.AEBaseItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -27,8 +28,6 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.items.AEBaseItem;
|
||||
|
||||
|
||||
/**
|
||||
* Dummy item to display the fluid Icon
|
||||
@@ -37,47 +36,37 @@ import appeng.items.AEBaseItem;
|
||||
* @version rv6 - 2018-01-22
|
||||
* @since rv6 2018-01-22
|
||||
*/
|
||||
public class FluidDummyItem extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack stack )
|
||||
{
|
||||
public class FluidDummyItem extends AEBaseItem {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
|
||||
FluidStack fluidStack = this.getFluidStack( stack );
|
||||
if( fluidStack == null )
|
||||
{
|
||||
fluidStack = new FluidStack( FluidRegistry.WATER, Fluid.BUCKET_VOLUME );
|
||||
}
|
||||
return fluidStack.getLocalizedName();
|
||||
}
|
||||
FluidStack fluidStack = this.getFluidStack(stack);
|
||||
if (fluidStack == null) {
|
||||
fluidStack = new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME);
|
||||
}
|
||||
return fluidStack.getLocalizedName();
|
||||
}
|
||||
|
||||
public FluidStack getFluidStack( ItemStack is )
|
||||
{
|
||||
if( is.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound tag = is.getTagCompound();
|
||||
return FluidStack.loadFluidStackFromNBT( tag );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public FluidStack getFluidStack(ItemStack is) {
|
||||
if (is.hasTagCompound()) {
|
||||
NBTTagCompound tag = is.getTagCompound();
|
||||
return FluidStack.loadFluidStackFromNBT(tag);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setFluidStack( ItemStack is, FluidStack fs )
|
||||
{
|
||||
if( fs == null )
|
||||
{
|
||||
is.setTagCompound( null );
|
||||
}
|
||||
else
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
fs.writeToNBT( tag );
|
||||
is.setTagCompound( tag );
|
||||
}
|
||||
}
|
||||
public void setFluidStack(ItemStack is, FluidStack fs) {
|
||||
if (fs == null) {
|
||||
is.setTagCompound(null);
|
||||
} else {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
fs.writeToNBT(tag);
|
||||
is.setTagCompound(tag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// Don't show this item in CreativeTabs
|
||||
}
|
||||
@Override
|
||||
protected void getCheckedSubItems(final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks) {
|
||||
// Don't show this item in CreativeTabs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user