mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
More fixes
This commit is contained in:
1 parent
5c145362d8
commit
bf0e3bb1c7
74 files changed
+165
-279
No files matched your search
@@ -16,6 +16,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
@@ -24,7 +27,7 @@ import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
/**
|
||||
* A basic (and fallback) implementation of SubTileSignature.
|
||||
*/
|
||||
public class BasicSignature extends SubTileSignature {
|
||||
public class BasicSignature implements SubTileSignature {
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -61,8 +64,9 @@ public class BasicSignature extends SubTileSignature {
|
||||
return "botania.flowerType.misc";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addTooltip(ItemStack stack, EntityPlayer player, List<String> tooltip) {
|
||||
public void addTooltip(ItemStack stack, World world, List<String> tooltip) {
|
||||
tooltip.add(TextFormatting.BLUE + I18n.translateToLocal(getType()));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,29 +14,33 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* A singleton instance for a SubTileEntity, this is called for a few methods.
|
||||
*/
|
||||
public abstract class SubTileSignature {
|
||||
public interface SubTileSignature {
|
||||
|
||||
public static final String SPECIAL_FLOWER_PREFIX = "flower.";
|
||||
|
||||
/**
|
||||
* Gets the display name for the flower item.
|
||||
*/
|
||||
public abstract String getUnlocalizedNameForStack(ItemStack stack);
|
||||
String getUnlocalizedNameForStack(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets the lore text for the flower item, displayed in the item's tooltip.
|
||||
* If you do not want a reference return a key that does not have localization such
|
||||
* as "botaniamisc.noloc".
|
||||
*/
|
||||
public abstract String getUnlocalizedLoreTextForStack(ItemStack stack);
|
||||
String getUnlocalizedLoreTextForStack(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Adds additional text to the tooltip. This text is added after getUnlocalizedLoreTextForStack.
|
||||
*/
|
||||
public void addTooltip(ItemStack stack, EntityPlayer player, List<String> tooltip) {}
|
||||
@SideOnly(Side.CLIENT)
|
||||
default void addTooltip(ItemStack stack, World world, List<String> tooltip) {}
|
||||
|
||||
}
|
||||
@@ -41,7 +41,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
@@ -117,7 +117,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if(server == null)
|
||||
return Blocks.AIR.getDefaultState();
|
||||
return server.worldServerForDimension(key.dim).getBlockState(key.blockPos);
|
||||
return server.getWorld(key.dim).getBlockState(key.blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -217,7 +217,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
{
|
||||
int worldId = s.dim, x = s.blockPos.getX(), y = s.blockPos.getY(), z = s.blockPos.getZ();
|
||||
BlockPos pos = s.blockPos;
|
||||
World world = server.worldServerForDimension(worldId);
|
||||
World world = server.getWorld(worldId);
|
||||
if(world.isAirBlock(pos.offset(dir)))
|
||||
world.setBlockState(pos.offset(dir), ModBlocks.pistonRelay.getDefaultState());
|
||||
else if(!world.isRemote) {
|
||||
@@ -232,7 +232,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
DimWithPos pos = mappedPositions.get(s);
|
||||
int worldId = pos.dim;
|
||||
BlockPos pos2 = pos.blockPos;
|
||||
World world = server.worldServerForDimension(worldId);
|
||||
World world = server.getWorld(worldId);
|
||||
|
||||
IBlockState srcState = world.getBlockState(pos2);
|
||||
TileEntity tile = world.getTileEntity(pos2);
|
||||
|
||||
@@ -17,16 +17,13 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
|
||||
public abstract class BlockCorporeaBase extends BlockMod implements ICraftAchievement {
|
||||
public abstract class BlockCorporeaBase extends BlockMod {
|
||||
|
||||
public BlockCorporeaBase(Material material, String name) {
|
||||
super(material, name);
|
||||
@@ -41,14 +38,8 @@ public abstract class BlockCorporeaBase extends BlockMod implements ICraftAchiev
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.corporeaCraft;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,21 +20,18 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockCorporeaRetainer extends BlockMod implements ILexiconable, ICraftAchievement {
|
||||
public class BlockCorporeaRetainer extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockCorporeaRetainer() {
|
||||
super(Material.IRON, LibBlockNames.CORPOREA_RETAINER);
|
||||
@@ -97,11 +94,6 @@ public class BlockCorporeaRetainer extends BlockMod implements ILexiconable, ICr
|
||||
return new TileCorporeaRetainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.corporeaCraft;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.corporeaRetainer;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
EnumDyeColor color = state.getValue(BotaniaStateProps.COLOR);
|
||||
int hex = color.getMapColor().colorValue;
|
||||
int hex = color.getColorValue();
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
@@ -85,9 +85,9 @@ public class BlockCustomBrick extends BlockMod implements ILexiconable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
for(int i = 4; i < CustomBrickVariant.values().length; i++)
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -145,7 +145,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getColorValue();
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
@@ -156,9 +156,9 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
public void getSubBlocks(CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
par3.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -119,9 +119,9 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,7 +132,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getColorValue();
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
@@ -103,9 +103,9 @@ public class BlockPavement extends BlockMod {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -75,9 +75,9 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
|
||||
@@ -45,9 +45,9 @@ public class BlockBiomeStone extends BlockMod implements ILexiconable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -122,7 +122,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
stacks.add(new ItemStack(this, 1, 0));
|
||||
stacks.add(new ItemStack(this, 1, 1));
|
||||
stacks.add(new ItemStack(this, 1, 2));
|
||||
|
||||
@@ -101,8 +101,8 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable, IM
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tabs, @Nonnull NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(item));
|
||||
public void getSubBlocks(CreativeTabs tabs, @Nonnull NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -116,9 +116,9 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 3; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -54,15 +53,13 @@ import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.item.block.ItemBlockPool;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexiconable, ICraftAchievement {
|
||||
public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.5, 1);
|
||||
|
||||
@@ -150,11 +147,11 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
par3.add(new ItemStack(item, 1, 0));
|
||||
par3.add(new ItemStack(item, 1, 2));
|
||||
par3.add(new ItemStack(item, 1, 3));
|
||||
par3.add(new ItemStack(item, 1, 1));
|
||||
public void getSubBlocks(CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
par3.add(new ItemStack(this, 1, 0));
|
||||
par3.add(new ItemStack(this, 1, 2));
|
||||
par3.add(new ItemStack(this, 1, 3));
|
||||
par3.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,11 +244,6 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
return world.getBlockState(pos).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS ? LexiconData.rainbowRod : LexiconData.pool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.manaPoolPickup;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
|
||||
@@ -50,8 +50,8 @@ public class BlockSpawnerClaw extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(item));
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(this));
|
||||
list.add(new ItemStack(Blocks.MOB_SPAWNER));
|
||||
}
|
||||
|
||||
|
||||
@@ -96,9 +96,9 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
public void getSubBlocks(CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
for(int i = 0; i < 4; i++)
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
par3.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,7 +239,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getWireframeAABB(World world, BlockPos pos) {
|
||||
return FULL_BLOCK_AABB.offset(pos).contract(1.0/16.0);
|
||||
return FULL_BLOCK_AABB.offset(pos).shrink(1.0/16.0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -32,9 +32,9 @@ public class Item16Colors extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -15,11 +15,13 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -44,14 +46,14 @@ public class ItemAncientWill extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> list, boolean adv) {
|
||||
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flag) {
|
||||
addStringToTooltip(I18n.format("botaniamisc.craftToAddWill"), list);
|
||||
addStringToTooltip(I18n.format("botania.armorset.will" + stack.getItemDamage() + ".shortDesc"), list);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -280,7 +281,7 @@ public class ItemAstrolabe extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, World world, List par3List, ITooltipFlag flags) {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
int size = getSize(par1ItemStack);
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ public class ItemBlackLotus extends ItemMod implements IManaDissolvable {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 2; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -18,6 +18,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -52,7 +53,7 @@ import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class ItemCacophonium extends ItemMod implements ICraftAchievement {
|
||||
public class ItemCacophonium extends ItemMod {
|
||||
|
||||
private static final String TAG_SOUND = "sound";
|
||||
private static final String TAG_SOUND_NAME = "soundName";
|
||||
@@ -171,9 +172,4 @@ public class ItemCacophonium extends ItemMod implements ICraftAchievement {
|
||||
private static boolean isDOIT(ItemStack stack) {
|
||||
return !stack.isEmpty() && stack.getDisplayName().equalsIgnoreCase("shia labeouf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.cacophoniumCraft;
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,9 @@ public class ItemCorporeaSpark extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 2; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -54,9 +54,9 @@ public class ItemCraftPattern extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < TileCraftCrate.PATTERNS.length; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -70,7 +70,7 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
public class ItemCraftingHalo extends ItemMod {
|
||||
|
||||
private static final ResourceLocation glowTexture = new ResourceLocation(LibResources.MISC_GLOW_GREEN);
|
||||
private static final ItemStack craftingTable = new ItemStack(Blocks.CRAFTING_TABLE);
|
||||
@@ -605,10 +605,4 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(label, resolution.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(label) / 2, resolution.getScaledHeight() / 2 - yoff, 0xFFFFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.craftingHaloCraft;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class ItemFertilizer extends ItemMod {
|
||||
for(int j = -range - 1; j < range; j++) {
|
||||
for(int k = 2; k >= -2; k--) {
|
||||
BlockPos pos_ = pos.add(i + 1, k + 1, j + 1);
|
||||
if(world.isAirBlock(pos_) && (!world.provider.hasNoSky() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(world, pos_))
|
||||
if(world.isAirBlock(pos_) && (!world.provider.isNether() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(world, pos_))
|
||||
validCoords.add(pos_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ public class ItemGrassHorn extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -72,9 +72,9 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
public void getSubItems(@Nonnull CreativeTabs par2, @Nonnull NonNullList<ItemStack> par3) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
par3.add(new ItemStack(item, 1, i));
|
||||
par3.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
@@ -44,7 +45,6 @@ import vazkii.botania.api.mana.ILensEffect;
|
||||
import vazkii.botania.api.mana.ITinyPlanetExcempt;
|
||||
import vazkii.botania.api.sound.BotaniaSoundEvents;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
@@ -76,10 +76,10 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
super.getSubItems(tab, list);
|
||||
for(int i = 0; i < 4; i++)
|
||||
list.add(new ItemStack(item, 1, (i + 1) * 5 - 1));
|
||||
list.add(new ItemStack(this, 1, (i + 1) * 5 - 1));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -51,7 +51,6 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.api.sound.BotaniaSoundEvents;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
|
||||
@@ -28,7 +28,6 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.render.IModelRegister;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -45,12 +44,6 @@ public class ItemManaCookie extends ItemFood implements IModelRegister {
|
||||
(stack, worldIn, entityIn) -> stack.getDisplayName().toLowerCase(Locale.ROOT).contains("totalbiscuit") ? 1F : 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten(ItemStack stack, World world, @Nonnull EntityPlayer player) {
|
||||
super.onFoodEaten(stack, world, player);
|
||||
player.addStat(ModAchievements.manaCookieEat, 1);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) {
|
||||
|
||||
@@ -15,10 +15,12 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.MobEffects;
|
||||
@@ -188,7 +190,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
|
||||
ItemStack lens = getLens(par1ItemStack);
|
||||
if(!lens.isEmpty()) {
|
||||
List<String> tooltip = lens.getTooltip(player, false);
|
||||
List<String> tooltip = lens.getTooltip(Minecraft.getMinecraft().player, false);
|
||||
if(tooltip.size() > 1)
|
||||
stacks.addAll(tooltip.subList(1, tooltip.size()));
|
||||
}
|
||||
|
||||
@@ -47,17 +47,17 @@ public class ItemManaTablet extends ItemMod implements IManaItem, ICreativeManaP
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
|
||||
// Empty tablet
|
||||
stacks.add(new ItemStack(item));
|
||||
stacks.add(new ItemStack(this));
|
||||
|
||||
// Full tablet
|
||||
ItemStack fullPower = new ItemStack(item);
|
||||
ItemStack fullPower = new ItemStack(this);
|
||||
setMana(fullPower, MAX_MANA);
|
||||
stacks.add(fullPower);
|
||||
|
||||
// Creative Tablet
|
||||
ItemStack creative = new ItemStack(item);
|
||||
ItemStack creative = new ItemStack(this);
|
||||
setMana(creative, MAX_MANA);
|
||||
setStackCreative(creative);
|
||||
stacks.add(creative);
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
|
||||
@@ -20,20 +20,17 @@ import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.entity.EntityPoolMinecart;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@Optional.Interface(modid = "Railcraft", iface = "mods.railcraft.api.core.items.IMinecartItem", striprefs = true)
|
||||
public class ItemPoolMinecart extends ItemMod implements ICraftAchievement, IMinecartItem {
|
||||
public class ItemPoolMinecart extends ItemMod implements IMinecartItem {
|
||||
|
||||
public ItemPoolMinecart() {
|
||||
super(LibItemNames.POOL_MINECART);
|
||||
@@ -62,11 +59,6 @@ public class ItemPoolMinecart extends ItemMod implements ICraftAchievement, IMin
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.manaCartCraft;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBePlacedByNonPlayer(ItemStack cart) {
|
||||
return true;
|
||||
|
||||
@@ -15,7 +15,6 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -25,12 +24,10 @@ import net.minecraft.world.World;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaGivingItem;
|
||||
import vazkii.botania.api.mana.spark.ISparkAttachable;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.entity.EntitySpark;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemSpark extends ItemMod implements ICraftAchievement, IManaGivingItem {
|
||||
public class ItemSpark extends ItemMod implements IManaGivingItem {
|
||||
|
||||
public ItemSpark() {
|
||||
super(LibItemNames.SPARK);
|
||||
@@ -57,10 +54,4 @@ public class ItemSpark extends ItemMod implements ICraftAchievement, IManaGiving
|
||||
}
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.sparkCraft;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,9 +34,9 @@ public class ItemSparkUpgrade extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < VARIANTS; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -17,6 +17,7 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -30,12 +29,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.entity.EntityThornChakram;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemThornChakram extends ItemMod implements ICraftAchievement {
|
||||
public class ItemThornChakram extends ItemMod {
|
||||
|
||||
public ItemThornChakram() {
|
||||
super(LibItemNames.THORN_CHAKRAM);
|
||||
@@ -45,9 +42,9 @@ public class ItemThornChakram extends ItemMod implements ICraftAchievement {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 2; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -75,11 +72,6 @@ public class ItemThornChakram extends ItemMod implements ICraftAchievement {
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.terrasteelWeaponCraft;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.block.BlockCommandBlock;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -230,7 +231,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
stacks.add(forColors(i, i));
|
||||
}
|
||||
|
||||
@@ -127,9 +127,9 @@ public class ItemVirus extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -35,7 +34,6 @@ import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.api.subtile.signature.SubTileSignature;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -87,7 +85,7 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr
|
||||
String type = getType(par1ItemStack);
|
||||
SubTileSignature sig = BotaniaAPI.getSignatureForName(type);
|
||||
|
||||
sig.addTooltip(par1ItemStack, player, stacks);
|
||||
sig.addTooltip(par1ItemStack, world, stacks);
|
||||
|
||||
if(ConfigHandler.referencesEnabled) {
|
||||
String refUnlocalized = sig.getUnlocalizedLoreTextForStack(par1ItemStack);
|
||||
|
||||
@@ -36,8 +36,8 @@ public class ItemBalanceCloak extends ItemHolyCloak {
|
||||
if(!event.getSource().isMagicDamage()) {
|
||||
event.setAmount(event.getAmount() / 2);
|
||||
|
||||
if(event.getSource().getEntity() != null)
|
||||
event.getSource().getEntity().attackEntityFrom(DamageSource.causeIndirectMagicDamage(player, player), event.getAmount());
|
||||
if(event.getSource().getTrueSource() != null)
|
||||
event.getSource().getTrueSource().attackEntityFrom(DamageSource.causeIndirectMagicDamage(player, player), event.getAmount());
|
||||
|
||||
if(event.getAmount() > player.getHealth())
|
||||
event.setAmount(player.getHealth() - 1);
|
||||
|
||||
@@ -50,10 +50,10 @@ public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipD
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
stacks.add(new ItemStack(item));
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
|
||||
stacks.add(new ItemStack(this));
|
||||
|
||||
ItemStack full = new ItemStack(item);
|
||||
ItemStack full = new ItemStack(this);
|
||||
setMana(full, getMaxMana(full));
|
||||
stacks.add(full);
|
||||
}
|
||||
|
||||
@@ -18,21 +18,18 @@ import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.sound.BotaniaSoundEvents;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.entity.EntityFallingStar;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemStarSword extends ItemManasteelSword implements ICraftAchievement {
|
||||
public class ItemStarSword extends ItemManasteelSword {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 120;
|
||||
|
||||
@@ -90,11 +87,4 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.terrasteelWeaponCraft;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -28,19 +28,16 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemThunderSword extends ItemManasteelSword implements ICraftAchievement {
|
||||
public class ItemThunderSword extends ItemManasteelSword {
|
||||
|
||||
private static final String TAG_LIGHTNING_SEED = "lightningSeed";
|
||||
|
||||
@@ -86,11 +83,6 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
|
||||
return super.hitEntity(stack, entity, attacker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.terrasteelWeaponCraft;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ public class ItemElementiumAxe extends ItemManasteelAxe {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDrops(LivingDropsEvent event) {
|
||||
if(event.isRecentlyHit() && event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||
ItemStack weapon = ((EntityPlayer) event.getSource().getEntity()).getHeldItemMainhand();
|
||||
if(event.isRecentlyHit() && event.getSource().getTrueSource() != null && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
||||
ItemStack weapon = ((EntityPlayer) event.getSource().getTrueSource()).getHeldItemMainhand();
|
||||
if(!weapon.isEmpty() && weapon.getItem() == this) {
|
||||
Random rand = event.getEntityLiving().world.rand;
|
||||
int looting = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, weapon);
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -87,9 +88,9 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int mana : CREATIVE_MANA) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
ItemStack stack = new ItemStack(this);
|
||||
setMana(stack, mana);
|
||||
list.add(stack);
|
||||
}
|
||||
|
||||
+1
-10
@@ -19,7 +19,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -34,8 +33,6 @@ import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ILensEffect;
|
||||
import vazkii.botania.api.sound.BotaniaSoundEvents;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -45,7 +42,7 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
import vazkii.botania.common.network.PacketLeftClick;
|
||||
|
||||
public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, ICraftAchievement {
|
||||
public class ItemTerraSword extends ItemManasteelSword implements ILensEffect {
|
||||
|
||||
private static final String TAG_ATTACKER_USERNAME = "attackerUsername";
|
||||
|
||||
@@ -151,10 +148,4 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.terrasteelWeaponCraft;
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -47,9 +47,9 @@ public class ItemManaInkwell extends ItemMod implements IManaItem, IScribeTools
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(item, 1, USES));
|
||||
list.add(new ItemStack(item));
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
list.add(new ItemStack(this, 1, USES));
|
||||
list.add(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
@@ -25,6 +26,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -242,7 +244,7 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens
|
||||
if(storedColor == 16)
|
||||
return Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 1F, 1F);
|
||||
|
||||
return EnumDyeColor.byMetadata(storedColor).getMapColor().colorValue;
|
||||
return EnumDyeColor.byMetadata(storedColor).getColorValue();
|
||||
}
|
||||
|
||||
public static int getStoredColor(ItemStack stack) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -41,14 +40,12 @@ import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.IPickupAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.entity.EntityEnderAirBottle;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem, IPickupAchievement {
|
||||
public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem {
|
||||
|
||||
final int types = 24;
|
||||
|
||||
@@ -69,7 +66,6 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
event.getEntityPlayer().swingArm(event.getHand());
|
||||
} else {
|
||||
ItemStack stack1 = new ItemStack(this, 1, 15);
|
||||
event.getEntityPlayer().addStat(ModAchievements.enderAirMake, 1);
|
||||
|
||||
ItemHandlerHelper.giveItemToPlayer(event.getEntityPlayer(), stack1);
|
||||
|
||||
@@ -124,10 +120,10 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
|
||||
for(int i = 0; i < types; i++)
|
||||
if(Botania.gardenOfGlassLoaded || i != 20 && i != 21)
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -159,11 +155,6 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
return itemStack.getItemDamage() == 11 ? itemStack.copy() : ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return stack.getItemDamage() == 4 ? ModAchievements.terrasteelPickup : null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
|
||||
@@ -96,6 +96,6 @@ public class ItemPetal extends Item16Colors implements IFlowerComponent {
|
||||
|
||||
@Override
|
||||
public int getParticleColor(ItemStack stack) {
|
||||
return EnumDyeColor.byMetadata(stack.getItemDamage()).getMapColor().colorValue;
|
||||
return EnumDyeColor.byMetadata(stack.getItemDamage()).getColorValue();
|
||||
}
|
||||
}
|
||||
@@ -37,9 +37,9 @@ public class ItemQuartz extends ItemMod implements IElvenItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
for(int i = ConfigHandler.darkQuartzEnabled ? 0 : 1; i < SUBTYPES; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -19,19 +19,16 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.item.IPetalApothecary;
|
||||
import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.achievement.IPickupAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchievement {
|
||||
public class ItemRune extends ItemMod implements IFlowerComponent {
|
||||
|
||||
public ItemRune() {
|
||||
super(LibItemNames.RUNE);
|
||||
@@ -40,9 +37,9 @@ public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchiev
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
stacks.add(new ItemStack(item, 1, i));
|
||||
stacks.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -65,11 +62,6 @@ public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchiev
|
||||
return 0xA8A8A8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return ModAchievements.runePickup;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
@@ -34,14 +33,12 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.api.item.IWireframeCoordinateListProvider;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.handler.MethodHandles;
|
||||
import vazkii.botania.common.crafting.recipe.AesirRingRecipe;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordinateListProvider, ICraftAchievement {
|
||||
public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordinateListProvider {
|
||||
|
||||
private final Multimap<String, AttributeModifier> attributes = HashMultimap.create();
|
||||
|
||||
@@ -54,19 +51,19 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDropped(ItemTossEvent event) {
|
||||
if(event.getItem() != null && !event.getItem().getItem().isEmpty() && !event.getItem().world.isRemote) {
|
||||
ItemStack stack = event.getItem().getItem();
|
||||
if(event.getEntityItem() != null && !event.getEntityItem().getItem().isEmpty() && !event.getEntityItem().world.isRemote) {
|
||||
ItemStack stack = event.getEntityItem().getItem();
|
||||
if(stack.getItem() == this) {
|
||||
event.getItem().setDead();
|
||||
event.getEntityItem().setDead();
|
||||
|
||||
UUID user = getSoulbindUUID(stack);
|
||||
for(Item item : new Item[] { ModItems.thorRing, ModItems.lokiRing, ModItems.odinRing }) {
|
||||
ItemStack stack1 = new ItemStack(item);
|
||||
bindToUUID(user, stack1);
|
||||
EntityItem entity = new EntityItem(event.getItem().world, event.getItem().posX, event.getItem().posY, event.getItem().posZ, stack1);
|
||||
entity.motionX = event.getItem().motionX;
|
||||
entity.motionY = event.getItem().motionY;
|
||||
entity.motionZ = event.getItem().motionZ;
|
||||
EntityItem entity = new EntityItem(event.getEntityItem().world, event.getEntityItem().posX, event.getEntityItem().posY, event.getEntityItem().posZ, stack1);
|
||||
entity.motionX = event.getEntityItem().motionX;
|
||||
entity.motionY = event.getEntityItem().motionY;
|
||||
entity.motionZ = event.getEntityItem().motionZ;
|
||||
|
||||
try {
|
||||
MethodHandles.itemAge_setter.invokeExact(entity, MethodHandles.itemAge_getter.invokeExact(entity));
|
||||
@@ -74,7 +71,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina
|
||||
|
||||
int pickupDelay = 0;
|
||||
try {
|
||||
pickupDelay = (int) MethodHandles.pickupDelay_getter.invokeExact(event.getItem());
|
||||
pickupDelay = (int) MethodHandles.pickupDelay_getter.invokeExact(event.getEntityItem());
|
||||
} catch (Throwable ignored) {}
|
||||
entity.setPickupDelay(pickupDelay);
|
||||
|
||||
@@ -125,10 +122,4 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina
|
||||
|
||||
attributes.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.relicAesirRing;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
|
||||
@@ -15,8 +15,10 @@ import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -52,17 +54,17 @@ public class ItemRelic extends ItemMod implements IRelic {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flags) {
|
||||
addBindInfo(tooltip, stack, player);
|
||||
addBindInfo(tooltip, stack);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBindInfo(List<String> list, ItemStack stack, EntityPlayer player) {
|
||||
public void addBindInfo(List<String> list, ItemStack stack) {
|
||||
if(GuiScreen.isShiftKeyDown()) {
|
||||
if(!hasUUID(stack)) {
|
||||
addStringToTooltip(I18n.format("botaniamisc.relicUnbound"), list);
|
||||
} else {
|
||||
addStringToTooltip(I18n.format("botaniamisc.relicSoulbound", getSoulbindUsername(stack)), list);
|
||||
if(!getSoulbindUUID(stack).equals(player.getUniqueID()))
|
||||
if(!getSoulbindUUID(stack).equals(Minecraft.getMinecraft().player.getUniqueID()))
|
||||
addStringToTooltip(I18n.format("botaniamisc.notYourSagittarius", getSoulbindUsername(stack)), list);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -63,7 +62,7 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
@Override
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, World world, List<String> stacks, ITooltipFlag flags) {
|
||||
super.addHiddenTooltip(par1ItemStack, world, stacks, flags);
|
||||
dummy.addBindInfo(stacks, par1ItemStack, world);
|
||||
dummy.addBindInfo(stacks, par1ItemStack);
|
||||
}
|
||||
|
||||
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {}
|
||||
|
||||
@@ -19,7 +19,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -35,12 +34,10 @@ import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchievement, IBlockProvider, IAvatarWieldable {
|
||||
public class ItemDirtRod extends ItemMod implements IManaUsingItem, IBlockProvider, IAvatarWieldable {
|
||||
|
||||
private static final ResourceLocation avatarOverlay = new ResourceLocation(LibResources.MODEL_AVATAR_DIRT);
|
||||
|
||||
@@ -92,11 +89,6 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.dirtRodCraft;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) {
|
||||
if(block == Blocks.DIRT && meta == 0)
|
||||
|
||||
@@ -187,7 +187,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
int ex = px + i - diff;
|
||||
int ez = pz + j - diff;
|
||||
|
||||
if(!axis.isVecInside(new Vec3d(ex + 0.5, py + 1, ez + 0.5)))
|
||||
if(!axis.contains(new Vec3d(ex + 0.5, py + 1, ez + 0.5)))
|
||||
continue;
|
||||
BlockPos pos = new BlockPos(ex, py, ez);
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -44,12 +43,10 @@ import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockProvider, ICraftAchievement{
|
||||
public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockProvider {
|
||||
|
||||
private static final int COST_PER = 55;
|
||||
|
||||
@@ -193,10 +190,4 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.terraformRodCraft;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -63,7 +64,7 @@ public class PageRecipe extends LexiconPage {
|
||||
PageText.renderText(x, y, width, height, getUnlocalizedName());
|
||||
|
||||
if(!tooltipStack.isEmpty()) {
|
||||
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().player, false);
|
||||
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().player, ITooltipFlag.TooltipFlags.NORMAL);
|
||||
List<String> parsedTooltip = new ArrayList<>();
|
||||
boolean first = true;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -77,7 +78,7 @@ public class PageShedding extends PageEntity {
|
||||
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
|
||||
|
||||
if(!tooltipStack.isEmpty()) {
|
||||
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().player, false);
|
||||
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().player, ITooltipFlag.TooltipFlags.NORMAL);
|
||||
List<String> parsedTooltip = new ArrayList<>();
|
||||
boolean first = true;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class PageTutorial extends PageText {
|
||||
super.renderScreen(gui, mx, my);
|
||||
|
||||
if(!VIDEO_ENABLED)
|
||||
PageText.renderText(buttonText.xPosition + buttonText.width + 4, buttonText.yPosition - 14, 65, 100, "botaniamisc.noVideo");
|
||||
PageText.renderText(buttonText.x + buttonText.width + 4, buttonText.y - 14, 65, 100, "botaniamisc.noVideo");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -99,7 +99,7 @@ public class PacketBotaniaEffect implements IMessage {
|
||||
}
|
||||
case PAINT_LENS: {
|
||||
EnumDyeColor placeColor = EnumDyeColor.byMetadata(message.args[0]);
|
||||
int hex = placeColor.getMapColor().colorValue;
|
||||
int hex = placeColor.getColorValue();
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -36,7 +37,7 @@ public class PacketDodge implements IMessage {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketDodge message, MessageContext ctx) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
EntityPlayerMP player = ctx.getServerHandler().player;
|
||||
player.mcServer.addScheduledTask(() -> {
|
||||
player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F);
|
||||
|
||||
@@ -45,7 +46,7 @@ public class PacketDodge implements IMessage {
|
||||
if(ringStack.isEmpty() || !(ringStack.getItem() instanceof ItemDodgeRing)) {
|
||||
ringStack = baublesInv.getStackInSlot(2);
|
||||
if(ringStack.isEmpty() || !(ringStack.getItem() instanceof ItemDodgeRing))
|
||||
ctx.getServerHandler().disconnect("Invalid Dodge Packet");
|
||||
ctx.getServerHandler().disconnect(new TextComponentString("Invalid Dodge Packet")); // todo 1.12 textcomponenttranslation
|
||||
}
|
||||
|
||||
player.addExhaustion(0.3F);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PacketJump implements IMessage {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketJump message, MessageContext ctx) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
EntityPlayerMP player = ctx.getServerHandler().player;
|
||||
player.mcServer.addScheduledTask(() -> {
|
||||
IItemHandler baublesInv = BaublesApi.getBaublesHandler(player);
|
||||
ItemStack amuletStack = baublesInv.getStackInSlot(0);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class PacketLeftClick implements IMessage {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketLeftClick message, MessageContext ctx) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
EntityPlayerMP player = ctx.getServerHandler().player;
|
||||
player.mcServer.addScheduledTask(() -> ((ItemTerraSword) ModItems.terraSword).trySpawnBurst(player));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,10 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.gen.ChunkProviderFlat;
|
||||
import net.minecraft.world.gen.ChunkGeneratorFlat;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class WorldTypeSkyblock extends WorldType {
|
||||
|
||||
@@ -30,8 +32,9 @@ public class WorldTypeSkyblock extends WorldType {
|
||||
return world.getWorldInfo().getTerrainType() instanceof WorldTypeSkyblock;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean showWorldInfoNotice() {
|
||||
public boolean hasInfoNotice() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -53,7 +56,7 @@ public class WorldTypeSkyblock extends WorldType {
|
||||
@Nonnull
|
||||
@Override
|
||||
public IChunkGenerator getChunkGenerator(@Nonnull World world, String generatorOptions) {
|
||||
ChunkProviderFlat flat = new ChunkProviderFlat(world, world.getSeed(), false, "3;minecraft:air;");
|
||||
ChunkGeneratorFlat flat = new ChunkGeneratorFlat(world, world.getSeed(), false, "3;minecraft:air;");
|
||||
world.setSeaLevel(64);
|
||||
return flat;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user