mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
A bunch of items
This commit is contained in:
1 parent
5c3ac18670
commit
6f20d51b04
48 files changed
+337
-484
No files matched your search
@@ -30,6 +30,7 @@ import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.RegistryNamespaced;
|
||||
import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey;
|
||||
@@ -97,7 +98,7 @@ public final class BotaniaAPI {
|
||||
public static final Map<String, Integer> oreWeightsNether = new HashMap<>();
|
||||
|
||||
public static final Set<Item> looniumBlacklist = new LinkedHashSet<>();
|
||||
public static final Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static final Map<Block, EnumProperty<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static final Set<String> magnetBlacklist = new LinkedHashSet<>();
|
||||
public static final Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
package vazkii.botania.common.core;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
@@ -26,7 +26,7 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
public final class BotaniaCreativeTab extends ItemGroup {
|
||||
|
||||
public static final BotaniaCreativeTab INSTANCE = new BotaniaCreativeTab();
|
||||
private NonNullList<ItemStack> list;
|
||||
|
||||
@@ -26,7 +26,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemMod extends Item implements IModelRegister {
|
||||
|
||||
public ItemMod(String name) {
|
||||
public ItemMod(Item.Builder builder) {
|
||||
super(builder);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setTranslationKey(name);
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 17, 2015, 4:46:36 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemPhantomInk extends ItemMod {
|
||||
|
||||
public ItemPhantomInk() {
|
||||
super(LibItemNames.PHANTOM_INK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,18 +16,19 @@ import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.common.advancements.UseItemSuccessTrigger;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.entity.EntityPinkWither;
|
||||
@@ -39,10 +40,8 @@ import java.util.List;
|
||||
|
||||
public class ItemPinkinator extends ItemMod {
|
||||
|
||||
public ItemPinkinator() {
|
||||
super(LibItemNames.PINKINATOR);
|
||||
setMaxStackSize(1);
|
||||
setFull3D();
|
||||
public ItemPinkinator(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -52,11 +51,11 @@ public class ItemPinkinator extends ItemMod {
|
||||
int range = 16;
|
||||
List<EntityWither> withers = world.getEntitiesWithinAABB(EntityWither.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
|
||||
for(EntityWither wither : withers)
|
||||
if(!world.isRemote && !wither.isDead && !(wither instanceof EntityPinkWither)) {
|
||||
wither.setDead();
|
||||
if(!world.isRemote && !wither.removed && !(wither instanceof EntityPinkWither)) {
|
||||
wither.remove();
|
||||
EntityPinkWither pink = new EntityPinkWither(world);
|
||||
pink.setLocationAndAngles(wither.posX, wither.posY, wither.posZ, wither.rotationYaw, wither.rotationPitch);
|
||||
pink.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(pink)), null);
|
||||
pink.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(pink)), null, null);
|
||||
world.spawnEntity(pink);
|
||||
pink.spawnExplosionParticle();
|
||||
pink.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
@@ -68,10 +67,10 @@ public class ItemPinkinator extends ItemMod {
|
||||
return ActionResult.newResult(EnumActionResult.PASS, stack);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flags) {
|
||||
tooltip.add(I18n.format("botaniamisc.pinkinatorDesc"));
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flags) {
|
||||
tooltip.add(new TextComponentTranslation("botaniamisc.pinkinatorDesc"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,9 @@ package vazkii.botania.common.item;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -26,22 +28,23 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemPoolMinecart extends ItemMod {
|
||||
|
||||
public ItemPoolMinecart() {
|
||||
super(LibItemNames.POOL_MINECART);
|
||||
setMaxStackSize(1);
|
||||
public ItemPoolMinecart(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
public EnumActionResult onItemUse(ItemUseContext ctx) {
|
||||
World world = ctx.getWorld();
|
||||
BlockPos pos = ctx.getPos();
|
||||
ItemStack stack = ctx.getItem();
|
||||
|
||||
if(BlockRailBase.isRailBlock(world.getBlockState(pos))) {
|
||||
if(BlockRailBase.isRail(world.getBlockState(pos))) {
|
||||
if(!world.isRemote) {
|
||||
EntityMinecart entityminecart = new EntityPoolMinecart(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
|
||||
if(stack.hasDisplayName())
|
||||
entityminecart.setCustomNameTag(stack.getDisplayName());
|
||||
entityminecart.setCustomName(stack.getDisplayName());
|
||||
|
||||
world.spawnEntity(entityminecart);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
@@ -26,6 +27,8 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -47,25 +50,24 @@ public class ItemSextant extends ItemMod {
|
||||
private static final String TAG_SOURCE_Y = "sourceY";
|
||||
private static final String TAG_SOURCE_Z = "sourceZ";
|
||||
|
||||
public ItemSextant() {
|
||||
super(LibItemNames.SEXTANT);
|
||||
setMaxStackSize(1);
|
||||
public ItemSextant(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
public EnumAction getUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.BOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
|
||||
public int getUseDuration(ItemStack par1ItemStack) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) {
|
||||
if(getMaxItemUseDuration(stack) - count < 10
|
||||
if(getUseDuration(stack) - count < 10
|
||||
|| !(living instanceof EntityPlayer))
|
||||
return;
|
||||
|
||||
@@ -109,7 +111,7 @@ public class ItemSextant extends ItemMod {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if(!player.isSneaking()) {
|
||||
RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, false, 128);
|
||||
if(pos != null && pos.entityHit == null && pos.getBlockPos() != null) {
|
||||
if(pos != null && pos.entity == null && pos.getBlockPos() != null) {
|
||||
if(!world.isRemote) {
|
||||
ItemNBTHelper.setInt(stack, TAG_SOURCE_X, pos.getBlockPos().getX());
|
||||
ItemNBTHelper.setInt(stack, TAG_SOURCE_Y, pos.getBlockPos().getY());
|
||||
@@ -143,14 +145,14 @@ public class ItemSextant extends ItemMod {
|
||||
return MathHelper.pointDistancePlane(source.x, source.z, lookVec.x, lookVec.z);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) {
|
||||
ItemStack onUse = player.getActiveItemStack();
|
||||
int time = player.getItemInUseCount();
|
||||
|
||||
if(onUse == stack && stack.getItem().getMaxItemUseDuration(stack) - time >= 10) {
|
||||
if(onUse == stack && stack.getItem().getUseDuration(stack) - time >= 10) {
|
||||
double radius = calculateRadius(stack, player);
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
FontRenderer font = Minecraft.getInstance().fontRenderer;
|
||||
int x = resolution.getScaledWidth() / 2 + 30;
|
||||
int y = resolution.getScaledHeight() / 2;
|
||||
|
||||
@@ -166,7 +168,7 @@ public class ItemSextant extends ItemMod {
|
||||
GlStateManager.disableTexture2D();
|
||||
GL11.glLineWidth(3F);
|
||||
GL11.glBegin(GL11.GL_LINE_STRIP);
|
||||
GlStateManager.color(0F, 1F, 1F, 1F);
|
||||
GlStateManager.color4f(0F, 1F, 1F, 1F);
|
||||
for(int i = 0; i < 361; i++) {
|
||||
float radian = (float) (i * Math.PI / 180);
|
||||
double xp = x + Math.cos(radian) * radius;
|
||||
@@ -184,7 +186,7 @@ public class ItemSextant extends ItemMod {
|
||||
@Override
|
||||
public Map<EnumFacing, Multiblock> createRotations() {
|
||||
Map<EnumFacing, Multiblock> ret = new EnumMap<>(EnumFacing.class);
|
||||
for (EnumFacing e : EnumFacing.VALUES) {
|
||||
for (EnumFacing e : EnumFacing.BY_INDEX) {
|
||||
ret.put(e, this);
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -13,12 +13,11 @@ package vazkii.botania.common.item;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
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.block.subtile.generating.SubTileNarslimmus;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -30,14 +29,13 @@ import javax.annotation.Nullable;
|
||||
public class ItemSlimeBottle extends ItemMod {
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
|
||||
public ItemSlimeBottle() {
|
||||
super(LibItemNames.SLIME_BOTTLE);
|
||||
setMaxStackSize(1);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "active"), (stack, worldIn, entityIn) -> stack.hasTagCompound() && stack.getTagCompound().getBoolean(TAG_ACTIVE) ? 1.0F : 0.0F);
|
||||
public ItemSlimeBottle(Item.Builder builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "active"), (stack, worldIn, entityIn) -> stack.hasTag() && stack.getTag().getBoolean(TAG_ACTIVE) ? 1.0F : 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int something, boolean somethingelse) {
|
||||
public void inventoryTick(ItemStack stack, World world, Entity entity, int something, boolean somethingelse) {
|
||||
if(!world.isRemote) {
|
||||
int x = MathHelper.floor(entity.posX);
|
||||
int z = MathHelper.floor(entity.posZ);
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
@@ -31,23 +32,22 @@ public class ItemSlingshot extends ItemMod {
|
||||
|
||||
private static final Predicate<ItemStack> AMMO_FUNC = s -> s != null && s.getItem() == ModItems.vineBall;
|
||||
|
||||
public ItemSlingshot() {
|
||||
super(LibItemNames.SLINGSHOT);
|
||||
setMaxStackSize(1);
|
||||
public ItemSlingshot(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World world, EntityLivingBase living, int par4) {
|
||||
int j = getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
int j = getUseDuration(par1ItemStack) - par4;
|
||||
|
||||
if(!world.isRemote && (!(living instanceof EntityPlayer) || ((EntityPlayer) living).capabilities.isCreativeMode || PlayerHelper.hasAmmo((EntityPlayer) living, AMMO_FUNC))) {
|
||||
if(!world.isRemote && (!(living instanceof EntityPlayer) || ((EntityPlayer) living).abilities.isCreativeMode || PlayerHelper.hasAmmo((EntityPlayer) living, AMMO_FUNC))) {
|
||||
float f = j / 20.0F;
|
||||
f = (f * f + f * 2.0F) / 3.0F;
|
||||
|
||||
if(f < 1F)
|
||||
return;
|
||||
|
||||
if(living instanceof EntityPlayer && !((EntityPlayer) living).capabilities.isCreativeMode)
|
||||
if(living instanceof EntityPlayer && !((EntityPlayer) living).abilities.isCreativeMode)
|
||||
PlayerHelper.consumeAmmo((EntityPlayer) living, AMMO_FUNC);
|
||||
|
||||
EntityVineBall ball = new EntityVineBall(living, false);
|
||||
@@ -56,18 +56,18 @@ public class ItemSlingshot extends ItemMod {
|
||||
ball.motionY *= 1.6;
|
||||
ball.motionZ *= 1.6;
|
||||
world.spawnEntity(ball);
|
||||
world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
|
||||
public int getUseDuration(ItemStack par1ItemStack) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
public EnumAction getUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.BOW;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ItemSlingshot extends ItemMod {
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if(player.capabilities.isCreativeMode || PlayerHelper.hasAmmo(player, AMMO_FUNC)) {
|
||||
if(player.abilities.isCreativeMode || PlayerHelper.hasAmmo(player, AMMO_FUNC)) {
|
||||
player.setActiveHand(hand);
|
||||
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -28,17 +30,19 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemSpark extends ItemMod implements IManaGivingItem {
|
||||
|
||||
public ItemSpark() {
|
||||
super(LibItemNames.SPARK);
|
||||
public ItemSpark(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xv, float yv, float zv) {
|
||||
public EnumActionResult onItemUse(ItemUseContext ctx) {
|
||||
World world = ctx.getWorld();
|
||||
BlockPos pos = ctx.getPos();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof ISparkAttachable) {
|
||||
ISparkAttachable attach = (ISparkAttachable) tile;
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
ItemStack stack = ctx.getItem();
|
||||
if(attach.canAttachSpark(stack) && attach.getAttachedSpark() == null) {
|
||||
if(!world.isRemote) {
|
||||
stack.shrink(1);
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.Locale;
|
||||
public class ItemSparkUpgrade extends ItemMod {
|
||||
public final SparkUpgradeType type;
|
||||
|
||||
public ItemSparkUpgrade(SparkUpgradeType type) {
|
||||
super(LibItemNames.SPARK_UPGRADE + "_" + type.name().toLowerCase(Locale.ROOT));
|
||||
public ItemSparkUpgrade(Item.Builder builder, SparkUpgradeType type) {
|
||||
super(builder);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@@ -17,11 +18,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemSpellCloth extends ItemMod {
|
||||
|
||||
public ItemSpellCloth() {
|
||||
super(LibItemNames.SPELL_CLOTH);
|
||||
setMaxDamage(35);
|
||||
setMaxStackSize(1);
|
||||
setNoRepair();
|
||||
public ItemSpellCloth(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,7 +36,7 @@ public class ItemSpellCloth extends ItemMod {
|
||||
@Override
|
||||
public ItemStack getContainerItem(@Nonnull ItemStack itemStack) {
|
||||
ItemStack stack = itemStack.copy();
|
||||
stack.setItemDamage(stack.getItemDamage() + 1);
|
||||
stack.setDamage(stack.getDamage() + 1);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,15 +15,18 @@ import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
@@ -35,9 +38,8 @@ import java.util.List;
|
||||
public class ItemTemperanceStone extends ItemMod {
|
||||
public static final String TAG_ACTIVE = "active";
|
||||
|
||||
public ItemTemperanceStone() {
|
||||
super(LibItemNames.TEMPERANCE_STONE);
|
||||
setMaxStackSize(1);
|
||||
public ItemTemperanceStone(Item.Builder builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "active"),
|
||||
(stack, worldIn, entityIn) -> ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false) ? 1 : 0);
|
||||
}
|
||||
@@ -52,15 +54,11 @@ public class ItemTemperanceStone extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, World world, List<String> stacks, ITooltipFlag flags) {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
|
||||
if(ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false))
|
||||
addStringToTooltip(I18n.format("botaniamisc.active"), stacks);
|
||||
else addStringToTooltip(I18n.format("botaniamisc.inactive"), stacks);
|
||||
}
|
||||
|
||||
private void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
stacks.add(new TextComponentTranslation("botaniamisc.active"));
|
||||
else stacks.add(new TextComponentTranslation("botaniamisc.inactive"));
|
||||
}
|
||||
|
||||
public static boolean hasTemperanceActive(EntityPlayer player) {
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
@@ -24,9 +25,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemThornChakram extends ItemMod {
|
||||
|
||||
public ItemThornChakram(String name) {
|
||||
super(name);
|
||||
setMaxStackSize(6);
|
||||
public ItemThornChakram(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -42,7 +42,7 @@ public class ItemThornChakram extends ItemMod {
|
||||
if(stack.getItem() == ModItems.flareChakram)
|
||||
c.setFire(true);
|
||||
world.spawnEntity(c);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F));
|
||||
stack.shrink(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,10 @@ 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;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
@@ -33,10 +31,12 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.ICoordBoundItem;
|
||||
@@ -71,9 +71,8 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
private static final String TAG_BIND_MODE = "bindMode";
|
||||
private static final BlockPos UNBOUND_POS = new BlockPos(0, -1, 0);
|
||||
|
||||
public ItemTwigWand() {
|
||||
super(LibItemNames.TWIG_WAND);
|
||||
setMaxStackSize(1);
|
||||
public ItemTwigWand(Item.Builder builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation("botania", "bindmode"), (stack, worldIn, entityIn) -> getBindMode(stack) ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -121,7 +120,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
|
||||
if(axis != null) {
|
||||
if(!world.isRemote) {
|
||||
world.setBlockState(pos, ModBlocks.enchanter.getDefaultState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, axis), 1 | 2);
|
||||
world.setBlockState(pos, ModBlocks.enchanter.getDefaultState().with(BotaniaStateProps.ENCHANTER_DIRECTION, axis), 1 | 2);
|
||||
world.playSound(null, pos, ModSounds.enchanterForm, SoundCategory.BLOCKS, 0.5F, 0.6F);
|
||||
PlayerHelper.grantCriterion((EntityPlayerMP) player, new ResourceLocation(LibMisc.MOD_ID, "main/enchanter_make"), "code_triggered");
|
||||
} else {
|
||||
@@ -173,7 +172,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
|
||||
if(!world.isRemote && ((BlockPistonRelay) ModBlocks.pistonRelay).playerPositions.containsKey(player.getUniqueID())) {
|
||||
BlockPistonRelay.DimWithPos bindPos = ((BlockPistonRelay) ModBlocks.pistonRelay).playerPositions.get(player.getUniqueID());
|
||||
BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(world.provider.getDimension(), pos);
|
||||
BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(world.getDimension().getId(), pos);
|
||||
|
||||
((BlockPistonRelay) ModBlocks.pistonRelay).playerPositions.remove(player.getUniqueID());
|
||||
((BlockPistonRelay) ModBlocks.pistonRelay).mappedPositions.put(bindPos, currentPos);
|
||||
@@ -216,7 +215,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
public void inventoryTick(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {
|
||||
BlockPos coords = getBoundTile(par1ItemStack);
|
||||
TileEntity tile = world.getTileEntity(coords);
|
||||
if(tile == null || !(tile instanceof IWandBindable))
|
||||
@@ -244,10 +243,10 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flags) {
|
||||
list.add(I18n.format(getModeString(stack)));
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> list, ITooltipFlag flags) {
|
||||
list.add(new TextComponentTranslation(getModeString(stack)));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -303,9 +302,9 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
if(bound.getY() != -1)
|
||||
return bound;
|
||||
|
||||
RayTraceResult pos = Minecraft.getMinecraft().objectMouseOver;
|
||||
if(pos != null && pos.typeOfHit == RayTraceResult.Type.BLOCK) {
|
||||
TileEntity tile = Minecraft.getMinecraft().world.getTileEntity(pos.getBlockPos());
|
||||
RayTraceResult pos = Minecraft.getInstance().objectMouseOver;
|
||||
if(pos != null && pos.type == RayTraceResult.Type.BLOCK) {
|
||||
TileEntity tile = Minecraft.getInstance().world.getTileEntity(pos.getBlockPos());
|
||||
if(tile != null && tile instanceof ITileBound) {
|
||||
BlockPos coords = ((ITileBound) tile).getBinding();
|
||||
return coords;
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
@@ -25,17 +26,17 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemVineBall extends ItemMod {
|
||||
|
||||
public ItemVineBall() {
|
||||
super(LibItemNames.VINE_BALL);
|
||||
public ItemVineBall(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) {
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
if(!player.abilities.isCreativeMode)
|
||||
player.getHeldItem(hand).shrink(1);
|
||||
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if(!world.isRemote) {
|
||||
EntityVineBall ball = new EntityVineBall(player, true);
|
||||
|
||||
@@ -24,21 +24,22 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID)
|
||||
public class ItemVirus extends ItemMod {
|
||||
public ItemVirus(String name) {
|
||||
super(name);
|
||||
public ItemVirus(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +49,7 @@ public class ItemVirus extends ItemMod {
|
||||
return true;
|
||||
AbstractHorse horse = (AbstractHorse) living;
|
||||
if(horse.isTame()) {
|
||||
IItemHandler inv = horse.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
|
||||
IItemHandler inv = horse.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElseThrow(NullPointerException::new);
|
||||
ItemStack saddle = inv.getStackInSlot(0);
|
||||
|
||||
// Not all AbstractHorse's have saddles in slot 0
|
||||
@@ -64,7 +65,7 @@ public class ItemVirus extends ItemMod {
|
||||
if (horse instanceof AbstractChestHorse && ((AbstractChestHorse) horse).hasChest())
|
||||
horse.entityDropItem(new ItemStack(Blocks.CHEST), 0);
|
||||
|
||||
horse.setDead();
|
||||
horse.remove();
|
||||
|
||||
AbstractHorse newHorse = stack.getItem() == ModItems.necroVirus ? new EntityZombieHorse(player.world) : new EntitySkeletonHorse(player.world);
|
||||
newHorse.setTamedBy(player);
|
||||
@@ -72,7 +73,7 @@ public class ItemVirus extends ItemMod {
|
||||
|
||||
// Put the saddle back
|
||||
if(!saddle.isEmpty())
|
||||
newHorse.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).insertItem(0, saddle, false);
|
||||
newHorse.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElseThrow(NullPointerException::new).insertItem(0, saddle, false);
|
||||
|
||||
AbstractAttributeMap oldAttributes = horse.getAttributeMap();
|
||||
AbstractAttributeMap attributes = newHorse.getAttributeMap();
|
||||
@@ -90,7 +91,7 @@ public class ItemVirus extends ItemMod {
|
||||
jumpHeight.applyModifier(new AttributeModifier("Ermergerd Virus D:", jumpHeight.getBaseValue() * 0.5, 0));
|
||||
|
||||
newHorse.playSound(SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0F + living.world.rand.nextFloat(), living.world.rand.nextFloat() * 0.7F + 1.3F);
|
||||
newHorse.onInitialSpawn(player.world.getDifficultyForLocation(new BlockPos(newHorse)), null);
|
||||
newHorse.onInitialSpawn(player.world.getDifficultyForLocation(new BlockPos(newHorse)), null, null);
|
||||
newHorse.setGrowingAge(horse.getGrowingAge());
|
||||
player.world.spawnEntity(newHorse);
|
||||
newHorse.spawnExplosionParticle();
|
||||
@@ -105,7 +106,7 @@ public class ItemVirus extends ItemMod {
|
||||
@SubscribeEvent
|
||||
public static void onLivingHurt(LivingHurtEvent event) {
|
||||
EntityLivingBase entity = event.getEntityLiving();
|
||||
if(entity.isRiding() && entity.getRidingEntity() instanceof EntityLivingBase)
|
||||
if(entity.isPassenger() && entity.getRidingEntity() instanceof EntityLivingBase)
|
||||
entity = (EntityLivingBase) entity.getRidingEntity();
|
||||
|
||||
if((entity instanceof EntityZombieHorse || entity instanceof EntitySkeletonHorse)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
@@ -24,9 +25,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemWaterBowl extends ItemMod {
|
||||
|
||||
public ItemWaterBowl() {
|
||||
super(LibItemNames.WATER_BOWL);
|
||||
setMaxStackSize(1);
|
||||
public ItemWaterBowl(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
@@ -27,8 +28,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemWorldSeed extends ItemMod {
|
||||
|
||||
public ItemWorldSeed() {
|
||||
super(LibItemNames.WORLD_SEED);
|
||||
public ItemWorldSeed(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -42,10 +43,10 @@ public class ItemWorldSeed extends ItemMod {
|
||||
player.rotationYaw = 0F;
|
||||
player.setPositionAndUpdate(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5);
|
||||
|
||||
while(!world.getCollisionBoxes(player, player.getEntityBoundingBox()).isEmpty())
|
||||
while(!world.getCollisionBoxes(player, player.getBoundingBox()).isEmpty())
|
||||
player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ);
|
||||
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F);
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F);
|
||||
for(int i = 0; i < 50; i++)
|
||||
Botania.proxy.sparkleFX(player.posX + Math.random() * player.width, player.posY - 1.6 + Math.random() * player.height, player.posZ + Math.random() * player.width, 0.25F, 1F, 0.25F, 1F, 10);
|
||||
|
||||
|
||||
@@ -25,10 +25,9 @@ import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.api.mana.spark.SparkUpgradeType;
|
||||
import vazkii.botania.api.item.IAncientWillContainer;
|
||||
import vazkii.botania.api.state.enums.CratePattern;
|
||||
import vazkii.botania.common.item.brew.ItemBrewFlask;
|
||||
import vazkii.botania.common.item.brew.ItemBrewVial;
|
||||
import vazkii.botania.common.item.brew.ItemIncenseStick;
|
||||
import vazkii.botania.common.item.brew.ItemVial;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.item.brew.*;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumBoots;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumChest;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm;
|
||||
@@ -75,6 +74,7 @@ import vazkii.botania.common.item.material.ItemManaResource;
|
||||
import vazkii.botania.common.item.material.ItemPestleAndMortar;
|
||||
import vazkii.botania.common.item.material.ItemPetal;
|
||||
import vazkii.botania.common.item.material.ItemRune;
|
||||
import vazkii.botania.common.item.record.ItemModRecord;
|
||||
import vazkii.botania.common.item.record.ItemRecordGaia1;
|
||||
import vazkii.botania.common.item.record.ItemRecordGaia2;
|
||||
import vazkii.botania.common.item.relic.ItemDice;
|
||||
@@ -101,10 +101,7 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
@@ -119,8 +116,8 @@ public final class ModItems {
|
||||
}
|
||||
}
|
||||
|
||||
public static final Item pestleAndMortar = new ItemPestleAndMortar();
|
||||
public static final Item twigWand = new ItemTwigWand();
|
||||
public static final Item pestleAndMortar = new ItemPestleAndMortar(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.PESTLE_AND_MORTAR);
|
||||
public static final Item twigWand = new ItemTwigWand(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.TWIG_WAND);
|
||||
|
||||
public static final Item manaSteel = new ItemManaResource(LibItemNames.MANA_RESOURCE_NAMES[0]);
|
||||
public static final Item manaPearl = new ItemManaResource(LibItemNames.MANA_RESOURCE_NAMES[1]);
|
||||
@@ -146,48 +143,48 @@ public final class ModItems {
|
||||
public static final Item manaweaveCloth = new ItemManaResource(LibItemNames.MANA_RESOURCE_NAMES[22]);
|
||||
public static final Item manaPowder = new ItemManaResource(LibItemNames.MANA_RESOURCE_NAMES[23]);
|
||||
|
||||
public static final Item lensNormal = new ItemLens(LibItemNames.LENS_NAMES[0], new Lens(), ItemLens.PROP_NONE);
|
||||
public static final Item lensSpeed = new ItemLens(LibItemNames.LENS_NAMES[1], new LensSpeed(), ItemLens.PROP_NONE);
|
||||
public static final Item lensPower = new ItemLens(LibItemNames.LENS_NAMES[2], new LensPower(), ItemLens.PROP_POWER);
|
||||
public static final Item lensTime = new ItemLens(LibItemNames.LENS_NAMES[3], new LensTime(), ItemLens.PROP_NONE);
|
||||
public static final Item lensEfficiency = new ItemLens(LibItemNames.LENS_NAMES[4], new LensEfficiency(), ItemLens.PROP_NONE);
|
||||
public static final Item lensBounce = new ItemLens(LibItemNames.LENS_NAMES[5], new LensBounce(), ItemLens.PROP_TOUCH);
|
||||
public static final Item lensGravity = new ItemLens(LibItemNames.LENS_NAMES[6], new LensGravity(), ItemLens.PROP_ORIENTATION);
|
||||
public static final Item lensMine = new ItemLens(LibItemNames.LENS_NAMES[7], new LensMine(), ItemLens.PROP_TOUCH | ItemLens.PROP_ORIENTATION);
|
||||
public static final Item lensDamage = new ItemLens(LibItemNames.LENS_NAMES[8], new LensDamage(), ItemLens.PROP_DAMAGE);
|
||||
public static final Item lensPhantom = new ItemLens(LibItemNames.LENS_NAMES[9], new LensPhantom(), ItemLens.PROP_TOUCH);
|
||||
public static final Item lensMagnet = new ItemLens(LibItemNames.LENS_NAMES[10], new LensMagnet(), ItemLens.PROP_ORIENTATION);
|
||||
public static final Item lensExplosive = new ItemLens(LibItemNames.LENS_NAMES[11], new LensExplosive(), ItemLens.PROP_DAMAGE | ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensInfluence = new ItemLens(LibItemNames.LENS_NAMES[12], new LensInfluence(), ItemLens.PROP_NONE);
|
||||
public static final Item lensWeight = new ItemLens(LibItemNames.LENS_NAMES[13], new LensWeight(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensPaint = new ItemLens(LibItemNames.LENS_NAMES[14], new LensPaint(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensFire = new ItemLens(LibItemNames.LENS_NAMES[15], new LensFire(), ItemLens.PROP_DAMAGE | ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensPiston = new ItemLens(LibItemNames.LENS_NAMES[16], new LensPiston(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensLight = new ItemLens(LibItemNames.LENS_NAMES[17], new LensLight(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensWarp = new ItemLens(LibItemNames.LENS_NAMES[18], new LensWarp(), ItemLens.PROP_NONE);
|
||||
public static final Item lensRedirect = new ItemLens(LibItemNames.LENS_NAMES[19], new LensRedirect(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION);
|
||||
public static final Item lensFirework = new ItemLens(LibItemNames.LENS_NAMES[20], new LensFirework(), ItemLens.PROP_TOUCH);
|
||||
public static final Item lensFlare = new ItemLens(LibItemNames.LENS_NAMES[21], new LensFlare(), ItemLens.PROP_CONTROL);
|
||||
public static final Item lensMessenger = new ItemLens(LibItemNames.LENS_NAMES[22], new LensMessenger(), ItemLens.PROP_POWER);
|
||||
public static final Item lensTripwire = new ItemLens(LibItemNames.LENS_NAMES[23], new LensTripwire(), ItemLens.PROP_CONTROL);
|
||||
public static final Item lensStorm = new ItemLens(LibItemNames.LENS_NAMES[24], new LensStorm(), ItemLens.PROP_NONE);
|
||||
public static final Item lensNormal = new ItemLens(unstackable(), new Lens(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[0]);
|
||||
public static final Item lensSpeed = new ItemLens(unstackable(), new LensSpeed(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[1]);
|
||||
public static final Item lensPower = new ItemLens(unstackable(), new LensPower(), ItemLens.PROP_POWER).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[2]);
|
||||
public static final Item lensTime = new ItemLens(unstackable(), new LensTime(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[3]);
|
||||
public static final Item lensEfficiency = new ItemLens(unstackable(), new LensEfficiency(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[4]);
|
||||
public static final Item lensBounce = new ItemLens(unstackable(), new LensBounce(), ItemLens.PROP_TOUCH).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[5]);
|
||||
public static final Item lensGravity = new ItemLens(unstackable(), new LensGravity(), ItemLens.PROP_ORIENTATION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[6]);
|
||||
public static final Item lensMine = new ItemLens(unstackable(), new LensMine(), ItemLens.PROP_TOUCH | ItemLens.PROP_ORIENTATION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[7]);
|
||||
public static final Item lensDamage = new ItemLens(unstackable(), new LensDamage(), ItemLens.PROP_DAMAGE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[8]);
|
||||
public static final Item lensPhantom = new ItemLens(unstackable(), new LensPhantom(), ItemLens.PROP_TOUCH).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[9]);
|
||||
public static final Item lensMagnet = new ItemLens(unstackable(), new LensMagnet(), ItemLens.PROP_ORIENTATION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[10]);
|
||||
public static final Item lensExplosive = new ItemLens(unstackable(), new LensExplosive(), ItemLens.PROP_DAMAGE | ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[11]);
|
||||
public static final Item lensInfluence = new ItemLens(unstackable(), new LensInfluence(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[12]);
|
||||
public static final Item lensWeight = new ItemLens(unstackable(), new LensWeight(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[13]);
|
||||
public static final Item lensPaint = new ItemLens(unstackable(), new LensPaint(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[14]);
|
||||
public static final Item lensFire = new ItemLens(unstackable(), new LensFire(), ItemLens.PROP_DAMAGE | ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[15]);
|
||||
public static final Item lensPiston = new ItemLens(unstackable(), new LensPiston(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[16]);
|
||||
public static final Item lensLight = new ItemLens(unstackable(), new LensLight(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[17]);
|
||||
public static final Item lensWarp = new ItemLens(unstackable(), new LensWarp(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[18]);
|
||||
public static final Item lensRedirect = new ItemLens(unstackable(), new LensRedirect(), ItemLens.PROP_TOUCH | ItemLens.PROP_INTERACTION).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[19]);
|
||||
public static final Item lensFirework = new ItemLens(unstackable(), new LensFirework(), ItemLens.PROP_TOUCH).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[20]);
|
||||
public static final Item lensFlare = new ItemLens(unstackable(), new LensFlare(), ItemLens.PROP_CONTROL).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[21]);
|
||||
public static final Item lensMessenger = new ItemLens(unstackable(), new LensMessenger(), ItemLens.PROP_POWER).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[22]);
|
||||
public static final Item lensTripwire = new ItemLens(unstackable(), new LensTripwire(), ItemLens.PROP_CONTROL).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[23]);
|
||||
public static final Item lensStorm = new ItemLens(unstackable(), new LensStorm(), ItemLens.PROP_NONE).setRegistryName(LibMisc.MOD_ID, LibItemNames.LENS_NAMES[24]);
|
||||
|
||||
public static final Item runeWater = new ItemRune(LibItemNames.RUNE_NAMES[0]);
|
||||
public static final Item runeFire = new ItemRune(LibItemNames.RUNE_NAMES[1]);
|
||||
public static final Item runeEarth = new ItemRune(LibItemNames.RUNE_NAMES[2]);
|
||||
public static final Item runeAir = new ItemRune(LibItemNames.RUNE_NAMES[3]);
|
||||
public static final Item runeSpring = new ItemRune(LibItemNames.RUNE_NAMES[4]);
|
||||
public static final Item runeSummer = new ItemRune(LibItemNames.RUNE_NAMES[5]);
|
||||
public static final Item runeAutumn = new ItemRune(LibItemNames.RUNE_NAMES[6]);
|
||||
public static final Item runeWinter = new ItemRune(LibItemNames.RUNE_NAMES[7]);
|
||||
public static final Item runeMana = new ItemRune(LibItemNames.RUNE_NAMES[8]);
|
||||
public static final Item runeLust = new ItemRune(LibItemNames.RUNE_NAMES[9]);
|
||||
public static final Item runeGluttony = new ItemRune(LibItemNames.RUNE_NAMES[10]);
|
||||
public static final Item runeGreed = new ItemRune(LibItemNames.RUNE_NAMES[11]);
|
||||
public static final Item runeSloth = new ItemRune(LibItemNames.RUNE_NAMES[12]);
|
||||
public static final Item runeWrath = new ItemRune(LibItemNames.RUNE_NAMES[13]);
|
||||
public static final Item runeEnvy = new ItemRune(LibItemNames.RUNE_NAMES[14]);
|
||||
public static final Item runePride = new ItemRune(LibItemNames.RUNE_NAMES[15]);
|
||||
public static final Item runeWater = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[0]);
|
||||
public static final Item runeFire = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[1]);
|
||||
public static final Item runeEarth = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[2]);
|
||||
public static final Item runeAir = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[3]);
|
||||
public static final Item runeSpring = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[4]);
|
||||
public static final Item runeSummer = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[5]);
|
||||
public static final Item runeAutumn = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[6]);
|
||||
public static final Item runeWinter = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[7]);
|
||||
public static final Item runeMana = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[8]);
|
||||
public static final Item runeLust = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[9]);
|
||||
public static final Item runeGluttony = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[10]);
|
||||
public static final Item runeGreed = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[11]);
|
||||
public static final Item runeSloth = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[12]);
|
||||
public static final Item runeWrath = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[13]);
|
||||
public static final Item runeEnvy = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[14]);
|
||||
public static final Item runePride = new ItemRune(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RUNE_NAMES[15]);
|
||||
|
||||
public static final Item manaTablet = new ItemManaTablet();
|
||||
public static final Item manaGun = new ItemManaGun();
|
||||
@@ -267,30 +264,30 @@ public final class ModItems {
|
||||
public static final Item rainbowRod = new ItemRainbowRod();
|
||||
public static final Item tornadoRod = new ItemTornadoRod();
|
||||
public static final Item fireRod = new ItemFireRod();
|
||||
public static final Item vineBall = new ItemVineBall();
|
||||
public static final Item slingshot = new ItemSlingshot();
|
||||
public static final Item vineBall = new ItemVineBall(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.VINE_BALL);
|
||||
public static final Item slingshot = new ItemSlingshot(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.SLINGSHOT);
|
||||
public static final Item manaBottle = new ItemBottledMana();
|
||||
public static final Item laputaShard = new ItemLaputaShard();
|
||||
public static final Item necroVirus = new ItemVirus(LibItemNames.NECRO_VIRUS);
|
||||
public static final Item nullVirus = new ItemVirus(LibItemNames.NULL_VIRUS);
|
||||
public static final Item necroVirus = new ItemVirus(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.NECRO_VIRUS);
|
||||
public static final Item nullVirus = new ItemVirus(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.NULL_VIRUS);
|
||||
public static final Item reachRing = new ItemReachRing();
|
||||
public static final Item skyDirtRod = new ItemSkyDirtRod();
|
||||
public static final Item itemFinder = new ItemItemFinder();
|
||||
public static final Item superLavaPendant = new ItemSuperLavaPendant();
|
||||
public static final Item enderHand = new ItemEnderHand();
|
||||
public static final Item glassPick = new ItemGlassPick();
|
||||
public static final Item spark = new ItemSpark();
|
||||
public static final Item sparkUpgradeDispersive = new ItemSparkUpgrade(SparkUpgradeType.DISPERSIVE);
|
||||
public static final Item sparkUpgradeDominant = new ItemSparkUpgrade(SparkUpgradeType.DOMINANT);
|
||||
public static final Item sparkUpgradeRecessive = new ItemSparkUpgrade(SparkUpgradeType.RECESSIVE);
|
||||
public static final Item sparkUpgradeIsolated = new ItemSparkUpgrade(SparkUpgradeType.ISOLATED);
|
||||
public static final Item spark = new ItemSpark(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.SPARK);
|
||||
public static final Item sparkUpgradeDispersive = new ItemSparkUpgrade(defaultBuilder(), SparkUpgradeType.DISPERSIVE).setRegistryName(LibMisc.MOD_ID, LibItemNames.SPARK_UPGRADE + "_" + SparkUpgradeType.DISPERSIVE.name().toLowerCase(Locale.ROOT));
|
||||
public static final Item sparkUpgradeDominant = new ItemSparkUpgrade(defaultBuilder(), SparkUpgradeType.DOMINANT).setRegistryName(LibMisc.MOD_ID, LibItemNames.SPARK_UPGRADE + "_" + SparkUpgradeType.DOMINANT.name().toLowerCase(Locale.ROOT));
|
||||
public static final Item sparkUpgradeRecessive = new ItemSparkUpgrade(defaultBuilder(), SparkUpgradeType.RECESSIVE).setRegistryName(LibMisc.MOD_ID, LibItemNames.SPARK_UPGRADE + "_" + SparkUpgradeType.RECESSIVE.name().toLowerCase(Locale.ROOT));
|
||||
public static final Item sparkUpgradeIsolated = new ItemSparkUpgrade(defaultBuilder(), SparkUpgradeType.ISOLATED).setRegistryName(LibMisc.MOD_ID, LibItemNames.SPARK_UPGRADE + "_" + SparkUpgradeType.ISOLATED.name().toLowerCase(Locale.ROOT));
|
||||
public static final Item diviningRod = new ItemDiviningRod();
|
||||
public static final Item gravityRod = new ItemGravityRod();
|
||||
public static final Item manaInkwell = new ItemManaInkwell();
|
||||
public static final Item vial = new ItemVial(LibItemNames.VIAL);
|
||||
public static final Item flask = new ItemVial(LibItemNames.FLASK);
|
||||
public static final Item brewVial = new ItemBrewVial();
|
||||
public static final Item brewFlask = new ItemBrewFlask();
|
||||
public static final Item vial = new ItemVial(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.VIAL);
|
||||
public static final Item flask = new ItemVial(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.FLASK);
|
||||
public static final Item brewVial = new ItemBrewBase(unstackable(), 4, 32, new ItemStack(vial)).setRegistryName(LibMisc.MOD_ID, LibItemNames.BREW_VIAL);
|
||||
public static final Item brewFlask = new ItemBrewBase(unstackable(), 6, 24, new ItemStack(flask)).setRegistryName(LibMisc.MOD_ID, LibItemNames.BREW_FLASK);
|
||||
public static final Item bloodPendant = new ItemBloodPendant();
|
||||
public static final Item missileRod = new ItemMissileRod();
|
||||
public static final Item holyCloak = new ItemHolyCloak();
|
||||
@@ -303,10 +300,10 @@ public final class ModItems {
|
||||
public static final Item clip = new ItemClip();
|
||||
public static final Item cobbleRod = new ItemCobbleRod();
|
||||
public static final Item smeltRod = new ItemSmeltRod();
|
||||
public static final Item worldSeed = new ItemWorldSeed();
|
||||
public static final Item spellCloth = new ItemSpellCloth();
|
||||
public static final Item thornChakram = new ItemThornChakram(LibItemNames.THORN_CHAKRAM);
|
||||
public static final Item flareChakram = new ItemThornChakram(LibItemNames.FLARE_CHAKRAM);
|
||||
public static final Item worldSeed = new ItemWorldSeed(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.WORLD_SEED);
|
||||
public static final Item spellCloth = new ItemSpellCloth(unstackable().defaultMaxDamage(35).setNoRepair()).setRegistryName(LibMisc.MOD_ID, LibItemNames.SPELL_CLOTH);
|
||||
public static final Item thornChakram = new ItemThornChakram(defaultBuilder().maxStackSize(6)).setRegistryName(LibMisc.MOD_ID, LibItemNames.THORN_CHAKRAM);
|
||||
public static final Item flareChakram = new ItemThornChakram(defaultBuilder().maxStackSize(6)).setRegistryName(LibMisc.MOD_ID, LibItemNames.FLARE_CHAKRAM);
|
||||
public static final Item overgrowthSeed = new ItemOvergrowthSeed();
|
||||
public static final Item craftPattern1_1 = new ItemCraftPattern(CratePattern.CRAFTY_1_1);
|
||||
public static final Item craftPattern2_2 = new ItemCraftPattern(CratePattern.CRAFTY_2_2);
|
||||
@@ -325,8 +322,8 @@ public final class ModItems {
|
||||
public static final Item ancientWillKaril = new ItemAncientWill(IAncientWillContainer.AncientWillType.KARIL);
|
||||
public static final Item corporeaSpark = new ItemCorporeaSpark(LibItemNames.CORPOREA_SPARK);
|
||||
public static final Item corporeaSparkMaster = new ItemCorporeaSpark(LibItemNames.CORPOREA_SPARK_MASTER);
|
||||
public static final Item livingwoodBow = new ItemLivingwoodBow();
|
||||
public static final Item crystalBow = new ItemCrystalBow();
|
||||
public static final Item livingwoodBow = new ItemLivingwoodBow(defaultBuilder().defaultMaxDamage(500)).setRegistryName(LibMisc.MOD_ID, LibItemNames.LIVINGWOOD_BOW);
|
||||
public static final Item crystalBow = new ItemCrystalBow(defaultBuilder().defaultMaxDamage(500)).setRegistryName(LibMisc.MOD_ID, LibItemNames.CRYSTAL_BOW);
|
||||
public static final Map<ItemBaubleCosmetic.Variant, Item> cosmetics = new EnumMap<>(ItemBaubleCosmetic.Variant.class);
|
||||
static {
|
||||
for(ItemBaubleCosmetic.Variant v : ItemBaubleCosmetic.Variant.values()) {
|
||||
@@ -335,9 +332,9 @@ public final class ModItems {
|
||||
}
|
||||
public static final Item swapRing = new ItemSwapRing();
|
||||
public static final Item flowerBag = new ItemFlowerBag();
|
||||
public static final Item phantomInk = new ItemPhantomInk();
|
||||
public static final Item poolMinecart = new ItemPoolMinecart();
|
||||
public static final Item pinkinator = new ItemPinkinator();
|
||||
public static final Item phantomInk = new ItemMod(defaultBuilder()).setRegistryName(LibMisc.MOD_ID, LibItemNames.PHANTOM_INK);
|
||||
public static final Item poolMinecart = new ItemPoolMinecart(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.POOL_MINECART);
|
||||
public static final Item pinkinator = new ItemPinkinator(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.PINKINATOR);
|
||||
public static final Item infiniteFruit = new ItemInfiniteFruit();
|
||||
public static final Item kingKey = new ItemKingKey();
|
||||
public static final Item flugelEye = new ItemFlugelEye();
|
||||
@@ -347,15 +344,15 @@ public final class ModItems {
|
||||
public static final Item dice = new ItemDice();
|
||||
public static final Item keepIvy = new ItemKeepIvy();
|
||||
public static final Item blackHoleTalisman = new ItemBlackHoleTalisman();
|
||||
public static final Item recordGaia1 = new ItemRecordGaia1();
|
||||
public static final Item recordGaia2 = new ItemRecordGaia2();
|
||||
public static final Item temperanceStone = new ItemTemperanceStone();
|
||||
public static final Item incenseStick = new ItemIncenseStick();
|
||||
public static final Item recordGaia1 = new ItemModRecord(1, ModSounds.gaiaMusic1, unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RECORD_GAIA1);
|
||||
public static final Item recordGaia2 = new ItemModRecord(1, ModSounds.gaiaMusic2, unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.RECORD_GAIA2);
|
||||
public static final Item temperanceStone = new ItemTemperanceStone(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.TEMPERANCE_STONE);
|
||||
public static final Item incenseStick = new ItemIncenseStick(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.INCENSE_STICK);
|
||||
public static final Item terraAxe = new ItemTerraAxe();
|
||||
public static final Item waterBowl = new ItemWaterBowl();
|
||||
public static final Item waterBowl = new ItemWaterBowl(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.WATER_BOWL);
|
||||
public static final Item obedienceStick = new ItemObedienceStick();
|
||||
public static final Item cacophonium = new ItemCacophonium();
|
||||
public static final Item slimeBottle = new ItemSlimeBottle();
|
||||
public static final Item slimeBottle = new ItemSlimeBottle(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.SLIME_BOTTLE);
|
||||
public static final Item starSword = new ItemStarSword();
|
||||
public static final Item exchangeRod = new ItemExchangeRod();
|
||||
public static final Item magnetRingGreater = new ItemGreaterMagnetRing();
|
||||
@@ -366,7 +363,7 @@ public final class ModItems {
|
||||
public static final Item manaweaveBoots = new ItemManaweaveBoots();
|
||||
public static final Item autocraftingHalo = new ItemAutocraftingHalo();
|
||||
public static final Item gaiaHead = new ItemGaiaHead();
|
||||
public static final Item sextant = new ItemSextant();
|
||||
public static final Item sextant = new ItemSextant(unstackable()).setRegistryName(LibMisc.MOD_ID, LibItemNames.SEXTANT);
|
||||
public static final Item speedUpBelt = new ItemSpeedUpBelt();
|
||||
public static final Item baubleBox = new ItemBaubleBox();
|
||||
public static final Item dodgeRing = new ItemDodgeRing();
|
||||
@@ -377,6 +374,14 @@ public final class ModItems {
|
||||
public static final Item astrolabe = new ItemAstrolabe();
|
||||
public static final Item goddessCharm = new ItemGoddessCharm();
|
||||
|
||||
private static Item.Builder defaultBuilder() {
|
||||
return new Item.Builder().group(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
private static Item.Builder unstackable() {
|
||||
return defaultBuilder().maxStackSize(1);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerItems(RegistryEvent.Register<Item> evt) {
|
||||
IForgeRegistry<Item> r = evt.getRegistry();
|
||||
|
||||
@@ -12,11 +12,12 @@ package vazkii.botania.common.item.brew;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -28,8 +29,6 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
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.brew.Brew;
|
||||
import vazkii.botania.api.brew.IBrewItem;
|
||||
@@ -40,7 +39,7 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ItemBrewBase extends ItemMod implements IBrewItem {
|
||||
public class ItemBrewBase extends ItemMod implements IBrewItem {
|
||||
|
||||
private static final String TAG_BREW_KEY = "brewKey";
|
||||
private static final String TAG_SWIGS_LEFT = "swigsLeft";
|
||||
@@ -49,23 +48,22 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem {
|
||||
private final int drinkSpeed;
|
||||
private final ItemStack baseItem;
|
||||
|
||||
public ItemBrewBase(String name, int swigs, int drinkSpeed, ItemStack baseItem) {
|
||||
super(name);
|
||||
public ItemBrewBase(Item.Builder builder, int swigs, int drinkSpeed, ItemStack baseItem) {
|
||||
super(builder);
|
||||
this.swigs = swigs;
|
||||
this.drinkSpeed = drinkSpeed;
|
||||
this.baseItem = baseItem;
|
||||
setMaxStackSize(1);
|
||||
addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "swigs_taken"), (stack, world, entity) -> swigs - getSwigsLeft(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack stack) {
|
||||
public int getUseDuration(ItemStack stack) {
|
||||
return drinkSpeed;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack stack) {
|
||||
public EnumAction getUseAction(ItemStack stack) {
|
||||
return EnumAction.DRINK;
|
||||
}
|
||||
|
||||
@@ -91,7 +89,7 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem {
|
||||
world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1F, 1F);
|
||||
|
||||
int swigs = getSwigsLeft(stack);
|
||||
if(living instanceof EntityPlayer && !((EntityPlayer) living).capabilities.isCreativeMode) {
|
||||
if(living instanceof EntityPlayer && !((EntityPlayer) living).abilities.isCreativeMode) {
|
||||
if(swigs == 1) {
|
||||
if(!((EntityPlayer) living).inventory.addItemStackToInventory(baseItem.copy()))
|
||||
return baseItem.copy();
|
||||
@@ -109,8 +107,8 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
if(isInCreativeTab(tab)) {
|
||||
public void fillItemGroup(ItemGroup tab, NonNullList<ItemStack> list) {
|
||||
if(isInGroup(tab)) {
|
||||
for(String s : BotaniaAPI.brewMap.keySet()) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
setBrew(stack, s);
|
||||
@@ -151,7 +149,7 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem {
|
||||
|
||||
@Nonnull
|
||||
public static String getSubtype(ItemStack stack) {
|
||||
return stack.hasTagCompound() ? ItemNBTHelper.getString(stack, TAG_BREW_KEY, "none") : "none";
|
||||
return stack.hasTag() ? ItemNBTHelper.getString(stack, TAG_BREW_KEY, "none") : "none";
|
||||
}
|
||||
|
||||
public int getSwigsLeft(ItemStack stack) {
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Nov 1, 2014, 7:34:30 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.brew;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemBrewFlask extends ItemBrewBase {
|
||||
|
||||
public ItemBrewFlask() {
|
||||
super(LibItemNames.BREW_FLASK, 6, 24, new ItemStack(ModItems.flask));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Nov 1, 2014, 7:33:24 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.brew;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemBrewVial extends ItemBrewBase {
|
||||
|
||||
public ItemBrewVial() {
|
||||
super(LibItemNames.BREW_VIAL, 4, 32, new ItemStack(ModItems.vial));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,15 +12,17 @@ package vazkii.botania.common.item.brew;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
import vazkii.botania.api.brew.IBrewContainer;
|
||||
@@ -37,15 +39,14 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain
|
||||
private static final String TAG_BREW_KEY = "brewKey";
|
||||
public static final int TIME_MULTIPLIER = 60;
|
||||
|
||||
public ItemIncenseStick() {
|
||||
super(LibItemNames.INCENSE_STICK);
|
||||
setMaxStackSize(1);
|
||||
public ItemIncenseStick(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
super.getSubItems(tab, list);
|
||||
if(isInCreativeTab(tab)) {
|
||||
public void fillItemGroup(@Nonnull ItemGroup tab, @Nonnull NonNullList<ItemStack> list) {
|
||||
super.fillItemGroup(tab, list);
|
||||
if(isInGroup(tab)) {
|
||||
for(String s : BotaniaAPI.brewMap.keySet()) {
|
||||
ItemStack brewStack = getItemForBrew(BotaniaAPI.brewMap.get(s), new ItemStack(this));
|
||||
if(!brewStack.isEmpty())
|
||||
@@ -54,9 +55,9 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flags) {
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> list, ITooltipFlag flags) {
|
||||
Brew brew = getBrew(stack);
|
||||
if(brew == BotaniaAPI.fallbackBrew) {
|
||||
addStringToTooltip(TextFormatting.LIGHT_PURPLE + I18n.format("botaniamisc.notInfused"), list);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.brew;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
import vazkii.botania.api.brew.IBrewContainer;
|
||||
@@ -18,8 +19,8 @@ import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class ItemVial extends ItemMod implements IBrewContainer {
|
||||
|
||||
public ItemVial(String name) {
|
||||
super(name);
|
||||
public ItemVial(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -83,15 +82,15 @@ public final class ToolCommons {
|
||||
|
||||
if(!world.isRemote && filter.test(state)
|
||||
&& !block.isAir(state, world, pos) && state.getPlayerRelativeBlockHardness(player, world, pos) > 0
|
||||
&& block.canHarvestBlock(player.world, pos, player)) {
|
||||
&& state.canHarvestBlock(player.world, pos, player)) {
|
||||
int exp = ForgeHooks.onBlockBreakEvent(world, ((EntityPlayerMP) player).interactionManager.getGameType(), (EntityPlayerMP) player, pos);
|
||||
if(exp == -1)
|
||||
return;
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
if(!player.abilities.isCreativeMode) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(block.removedByPlayer(state, world, pos, player, true)) {
|
||||
if(block.removedByPlayer(state, world, pos, player, true, world.getFluidState(pos))) {
|
||||
block.onPlayerDestroy(world, pos, state);
|
||||
|
||||
if(!dispose || !ItemElementiumPick.isDisposable(block)) {
|
||||
@@ -101,7 +100,7 @@ public final class ToolCommons {
|
||||
}
|
||||
|
||||
damageItem(stack, 1, player, 80);
|
||||
} else world.setBlockToAir(pos);
|
||||
} else world.removeBlock(pos);
|
||||
|
||||
if(particles && ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool)
|
||||
world.playEvent(2001, pos, Block.getStateId(state));
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
@@ -23,8 +24,8 @@ public class ItemCrystalBow extends ItemLivingwoodBow {
|
||||
|
||||
private final int ARROW_COST = 200;
|
||||
|
||||
public ItemCrystalBow() {
|
||||
super(LibItemNames.CRYSTAL_BOW);
|
||||
public ItemCrystalBow(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,7 +36,7 @@ public class ItemCrystalBow extends ItemLivingwoodBow {
|
||||
@Override
|
||||
boolean canFire(ItemStack stack, EntityPlayer player) {
|
||||
int infinity = EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack);
|
||||
return player.capabilities.isCreativeMode || ManaItemHandler.requestManaExactForTool(stack, player, ARROW_COST / (infinity + 1), false);
|
||||
return player.abilities.isCreativeMode || ManaItemHandler.requestManaExactForTool(stack, player, ARROW_COST / (infinity + 1), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+14
-34
@@ -20,6 +20,7 @@ import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArrow;
|
||||
import net.minecraft.item.ItemBow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -32,8 +33,6 @@ import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
@@ -48,20 +47,13 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModelRegister {
|
||||
public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem {
|
||||
|
||||
private static final Predicate<ItemStack> AMMO_FUNC = s -> !s.isEmpty() && s.getItem() instanceof ItemArrow;
|
||||
public static final int MANA_PER_DAMAGE = 40;
|
||||
|
||||
public ItemLivingwoodBow() {
|
||||
this(LibItemNames.LIVINGWOOD_BOW);
|
||||
}
|
||||
|
||||
public ItemLivingwoodBow(String name) {
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setTranslationKey(name);
|
||||
setMaxDamage(500);
|
||||
public ItemLivingwoodBow(Item.Builder builder) {
|
||||
super(builder);
|
||||
addPropertyOverride(new ResourceLocation("minecraft:pull"), (stack, worldIn, entityIn) -> {
|
||||
if (entityIn == null)
|
||||
{
|
||||
@@ -70,17 +62,11 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
else
|
||||
{
|
||||
ItemStack itemstack = entityIn.getActiveItemStack();
|
||||
return !itemstack.isEmpty() && itemstack.getItem() instanceof ItemLivingwoodBow ? (stack.getMaxItemUseDuration() - entityIn.getItemInUseCount()) * chargeVelocityMultiplier() / 20.0F : 0.0F;
|
||||
return !itemstack.isEmpty() && itemstack.getItem() instanceof ItemLivingwoodBow ? (stack.getUseDuration() - entityIn.getItemInUseCount()) * chargeVelocityMultiplier() / 20.0F : 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, EntityPlayer player, @Nonnull EnumHand hand) {
|
||||
@@ -90,7 +76,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
ActionResult<ItemStack> ret = ForgeEventFactory.onArrowNock(stack, world, player, hand, flag);
|
||||
if (ret != null) return ret;
|
||||
|
||||
if (!player.capabilities.isCreativeMode && !flag)
|
||||
if (!player.abilities.isCreativeMode && !flag)
|
||||
{
|
||||
return new ActionResult<>(EnumActionResult.FAIL, stack);
|
||||
}
|
||||
@@ -109,7 +95,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
boolean flag = canFire(stack, player); // Botania - Custom canFire check
|
||||
ItemStack itemstack = getAmmo(player);
|
||||
|
||||
int i = (int) ((getMaxItemUseDuration(stack) - useTicks) * chargeVelocityMultiplier()); // Botania - velocity multiplier
|
||||
int i = (int) ((getUseDuration(stack) - useTicks) * chargeVelocityMultiplier()); // Botania - velocity multiplier
|
||||
i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(stack, world, player, i, !itemstack.isEmpty() || flag);
|
||||
if (i < 0) return;
|
||||
|
||||
@@ -124,7 +110,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
|
||||
if (f >= 0.1D)
|
||||
{
|
||||
boolean infinite = player.capabilities.isCreativeMode || (itemstack.getItem() instanceof ItemArrow ? ((ItemArrow)itemstack.getItem()).isInfinite(itemstack, stack, player) : false);
|
||||
boolean infinite = player.abilities.isCreativeMode || (itemstack.getItem() instanceof ItemArrow ? ((ItemArrow)itemstack.getItem()).isInfinite(itemstack, stack, player) : false);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
@@ -168,9 +154,9 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
}
|
||||
|
||||
|
||||
world.playSound(null, shooter.posX, shooter.posY, shooter.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||||
world.playSound(null, shooter.posX, shooter.posY, shooter.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||||
|
||||
player.addStat(StatList.getObjectUseStats(this));
|
||||
player.addStat(StatList.ITEM_USED.get(this));
|
||||
}
|
||||
}
|
||||
// End modified ItemBow.onPlayerStoppedUsing
|
||||
@@ -181,7 +167,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
}
|
||||
|
||||
boolean canFire(ItemStack stack, EntityPlayer player) {
|
||||
return player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack) > 0 || PlayerHelper.hasAmmo(player, AMMO_FUNC);
|
||||
return player.abilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack) > 0 || PlayerHelper.hasAmmo(player, AMMO_FUNC);
|
||||
}
|
||||
|
||||
void onFire(ItemStack bow, EntityLivingBase living, boolean infinity, EntityArrow arrow) {
|
||||
@@ -194,9 +180,9 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
if(!world.isRemote && player instanceof EntityPlayer && stack.getItemDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (EntityPlayer) player, MANA_PER_DAMAGE * 2, true))
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
if(!world.isRemote && player instanceof EntityPlayer && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (EntityPlayer) player, MANA_PER_DAMAGE * 2, true))
|
||||
stack.setDamage(stack.getDamage() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -223,10 +209,4 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel
|
||||
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -76,8 +76,8 @@ public class ItemManasteelSword extends ItemSword implements IManaUsingItem, IMo
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
if(!world.isRemote && player instanceof EntityPlayer && stack.getItemDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (EntityPlayer) player, getManaPerDamage() * 2, true))
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
if(!world.isRemote && player instanceof EntityPlayer && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (EntityPlayer) player, getManaPerDamage() * 2, true))
|
||||
stack.setDamage(stack.getDamage() - 1);
|
||||
}
|
||||
|
||||
public int getManaPerDamage() {
|
||||
|
||||
@@ -12,16 +12,18 @@ package vazkii.botania.common.item.lens;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ICompositableLens;
|
||||
@@ -56,33 +58,29 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens
|
||||
private final Lens lens;
|
||||
private final int props;
|
||||
|
||||
public ItemLens(String name, Lens lens, int props) {
|
||||
super(name);
|
||||
setMaxStackSize(1);
|
||||
public ItemLens(Item.Builder builder, Lens lens, int props) {
|
||||
super(builder);
|
||||
this.lens = lens;
|
||||
this.props = props;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, World world, List<String> stacks, ITooltipFlag flags) {
|
||||
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
|
||||
int storedColor = getStoredColor(par1ItemStack);
|
||||
if(storedColor != -1)
|
||||
stacks.add(I18n.format("botaniamisc.color", I18n.format("botania.color" + storedColor)));
|
||||
}
|
||||
|
||||
|
||||
private String getItemShortTermName(ItemStack stack) {
|
||||
return net.minecraft.util.text.translation.I18n.translateToLocal(stack.getTranslationKey().replaceAll("item.", "item.botania:") + ".short");
|
||||
stacks.add(new TextComponentTranslation("botaniamisc.color", new TextComponentTranslation("botania.color" + storedColor)));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getItemStackDisplayName(@Nonnull ItemStack stack) {
|
||||
public ITextComponent getDisplayName(@Nonnull ItemStack stack) {
|
||||
ItemStack compositeLens = getCompositeLens(stack);
|
||||
if(compositeLens.isEmpty())
|
||||
return super.getItemStackDisplayName(stack);
|
||||
return String.format(net.minecraft.util.text.translation.I18n.translateToLocal("item.botania:compositeLens.name"), getItemShortTermName(stack), getItemShortTermName(compositeLens));
|
||||
return super.getDisplayName(stack);
|
||||
String shortKeyA = stack.getTranslationKey() + ".short";
|
||||
String shortKeyB = compositeLens.getTranslationKey() + ".short";
|
||||
return new TextComponentTranslation("item.botania:compositeLens", new TextComponentTranslation(shortKeyA), new TextComponentTranslation(shortKeyB));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,7 +134,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).colorValue;
|
||||
return EnumDyeColor.byId(storedColor).colorValue;
|
||||
}
|
||||
|
||||
public static int getStoredColor(ItemStack stack) {
|
||||
@@ -168,7 +166,7 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens
|
||||
public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens) {
|
||||
ICompositableLens sourceItem = (ICompositableLens) sourceLens.getItem();
|
||||
ICompositableLens compositeItem = (ICompositableLens) compositeLens.getItem();
|
||||
if(sourceItem == compositeItem && sourceLens.getItemDamage() == compositeLens.getItemDamage())
|
||||
if(sourceItem == compositeItem)
|
||||
return false;
|
||||
|
||||
if(!sourceItem.isCombinable(sourceLens) || !compositeItem.isCombinable(compositeLens))
|
||||
@@ -185,13 +183,13 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_COMPOSITE_LENS, true);
|
||||
if(cmp == null)
|
||||
return ItemStack.EMPTY;
|
||||
else return new ItemStack(cmp);
|
||||
else return ItemStack.read(cmp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack setCompositeLens(ItemStack sourceLens, ItemStack compositeLens) {
|
||||
if(!compositeLens.isEmpty()) {
|
||||
NBTTagCompound cmp = compositeLens.writeToNBT(new NBTTagCompound());
|
||||
NBTTagCompound cmp = compositeLens.write(new NBTTagCompound());
|
||||
ItemNBTHelper.setCompound(sourceLens, TAG_COMPOSITE_LENS, cmp);
|
||||
}
|
||||
return sourceLens;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class LensBounce extends Lens {
|
||||
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!isManaBlock && pos.entityHit == null && pos.getBlockPos() != null) {
|
||||
if(!isManaBlock && pos.entity == null && pos.getBlockPos() != null) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(!coords.equals(pos.getBlockPos())) {
|
||||
Vector3 currentMovementVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class LensExplosive extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!entity.world.isRemote && !burst.isFake()) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())))
|
||||
if(pos.entity == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())))
|
||||
entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true);
|
||||
} else dead = false;
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ public class LensFire extends Lens {
|
||||
Block blockAt = entity.world.getBlockState(pos).getBlock();
|
||||
Block blockAtOffset = entity.world.getBlockState(offPos).getBlock();
|
||||
|
||||
if(blockAt == Blocks.PORTAL)
|
||||
if(blockAt == Blocks.NETHER_PORTAL)
|
||||
entity.world.setBlockState(pos, Blocks.AIR.getDefaultState());
|
||||
if(blockAtOffset == Blocks.PORTAL)
|
||||
if(blockAtOffset == Blocks.NETHER_PORTAL)
|
||||
entity.world.setBlockState(offPos, Blocks.AIR.getDefaultState());
|
||||
else if(blockAt == ModBlocks.incensePlate) {
|
||||
TileIncensePlate plate = (TileIncensePlate) entity.world.getTileEntity(pos);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class LensFirework extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!entity.world.isRemote && !burst.isFake()) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) {
|
||||
if(pos.entity == null && !isManaBlock && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) {
|
||||
ItemStack fireworkStack = generateFirework(burst.getColor());
|
||||
|
||||
EntityFireworkRocket rocket = new EntityFireworkRocket(entity.world, entity.posX, entity.posY, entity.posZ, fireworkStack);
|
||||
@@ -39,7 +39,7 @@ public class LensFirework extends Lens {
|
||||
}
|
||||
|
||||
public ItemStack generateFirework(int color) {
|
||||
ItemStack stack = new ItemStack(Items.FIREWORKS);
|
||||
ItemStack stack = new ItemStack(Items.FIREWORK_ROCKET);
|
||||
NBTTagCompound explosion = new NBTTagCompound();
|
||||
explosion.setIntArray("Colors", new int[] { color });
|
||||
|
||||
@@ -51,7 +51,7 @@ public class LensFirework extends Lens {
|
||||
else type = 0;
|
||||
}
|
||||
|
||||
explosion.setInteger("Type", type);
|
||||
explosion.setInt("Type", type);
|
||||
|
||||
if(Math.random() < 0.05)
|
||||
if(Math.random() < 0.5)
|
||||
@@ -61,10 +61,10 @@ public class LensFirework extends Lens {
|
||||
ItemNBTHelper.setCompound(stack, "Explosion", explosion);
|
||||
|
||||
NBTTagCompound fireworks = new NBTTagCompound();
|
||||
fireworks.setInteger("Flight", (int) (Math.random() * 3 + 2));
|
||||
fireworks.setInt("Flight", (int) (Math.random() * 3 + 2));
|
||||
|
||||
NBTTagList explosions = new NBTTagList();
|
||||
explosions.appendTag(explosion);
|
||||
explosions.add(explosion);
|
||||
fireworks.setTag("Explosions", explosions);
|
||||
|
||||
ItemNBTHelper.setCompound(stack, "Fireworks", fireworks);
|
||||
|
||||
@@ -52,9 +52,9 @@ public class LensFlare extends Lens {
|
||||
|
||||
TileEntity tile = (TileEntity) spreader;
|
||||
if(storedColor == 16) {
|
||||
hex = Color.HSBtoRGB(tile.getWorld().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F);
|
||||
hex = Color.HSBtoRGB(tile.getWorld().getGameTime() * 2 % 360 / 360F, 1F, 1F);
|
||||
} else if(storedColor >= 0) {
|
||||
hex = EnumDyeColor.byMetadata(storedColor).colorValue;
|
||||
hex = EnumDyeColor.byId(storedColor).colorValue;
|
||||
}
|
||||
|
||||
float r = ((hex & 0xFF0000) >> 16) / 255F;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class LensMagnet extends Lens {
|
||||
@Override
|
||||
public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) {
|
||||
BlockPos basePos = new BlockPos(entity);
|
||||
boolean magnetized = entity.getEntityData().hasKey(TAG_MAGNETIZED);
|
||||
boolean magnetized = entity.getData().hasKey(TAG_MAGNETIZED);
|
||||
int range = 3;
|
||||
|
||||
magnetize : {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class LensMine extends Lens {
|
||||
ItemStack composite = ((ItemLens) stack.getItem()).getCompositeLens(stack);
|
||||
boolean warp = !composite.isEmpty() && composite.getItem() == ModItems.lensWarp;
|
||||
|
||||
if(warp && (block == ModBlocks.pistonRelay || block == Blocks.PISTON || block == Blocks.PISTON_EXTENSION || block == Blocks.PISTON_HEAD))
|
||||
if(warp && (block == ModBlocks.pistonRelay || block == Blocks.PISTON || block == Blocks.MOVING_PISTON || block == Blocks.PISTON_HEAD))
|
||||
return false;
|
||||
|
||||
int harvestLevel = ConfigHandler.harvestLevelBore;
|
||||
@@ -58,10 +58,10 @@ public class LensMine extends Lens {
|
||||
if(!burst.hasAlreadyCollidedAt(collidePos)) {
|
||||
if(!burst.isFake()) {
|
||||
NonNullList<ItemStack> items = NonNullList.create();
|
||||
block.getDrops(items, world, collidePos, world.getBlockState(collidePos), 0);
|
||||
state.getDrops(items, world, collidePos, 0);
|
||||
float chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, world, collidePos, state, 0, 1.0f, false, null);
|
||||
|
||||
world.setBlockToAir(collidePos);
|
||||
world.removeBlock(collidePos);
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
world.playEvent(2001, collidePos, Block.getStateId(state));
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ public class LensPaint extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
int storedColor = ItemLens.getStoredColor(stack);
|
||||
if(!entity.world.isRemote && !burst.isFake() && storedColor > -1 && storedColor < 17) {
|
||||
if(pos.entityHit != null && pos.entityHit instanceof EntitySheep) {
|
||||
if(pos.entity != null && pos.entity instanceof EntitySheep) {
|
||||
int r = 20;
|
||||
EnumDyeColor sheepColor = ((EntitySheep) pos.entityHit).getFleeceColor();
|
||||
List<EntitySheep> sheepList = entity.world.getEntitiesWithinAABB(EntitySheep.class, new AxisAlignedBB(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r));
|
||||
EnumDyeColor sheepColor = ((EntitySheep) pos.entity).getFleeceColor();
|
||||
List<EntitySheep> sheepList = entity.world.getEntitiesWithinAABB(EntitySheep.class, new AxisAlignedBB(pos.entity.posX - r, pos.entity.posY - r, pos.entity.posZ - r, pos.entity.posX + r, pos.entity.posY + r, pos.entity.posZ + r));
|
||||
for(EntitySheep sheep : sheepList) {
|
||||
if(sheep.getFleeceColor() == sheepColor)
|
||||
sheep.setFleeceColor(EnumDyeColor.byMetadata(storedColor == 16 ? sheep.world.rand.nextInt(16) : storedColor));
|
||||
sheep.setFleeceColor(EnumDyeColor.byId(storedColor == 16 ? sheep.world.rand.nextInt(16) : storedColor));
|
||||
}
|
||||
dead = true;
|
||||
} else if (pos.getBlockPos() != null) {
|
||||
@@ -59,7 +59,7 @@ public class LensPaint extends Lens {
|
||||
coordsFound.remove(coords);
|
||||
coordsToPaint.add(coords);
|
||||
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
for(EnumFacing dir : EnumFacing.BY_INDEX) {
|
||||
IBlockState state_ = entity.world.getBlockState(coords.offset(dir));
|
||||
BlockPos coords_ = new BlockPos(coords.offset(dir));
|
||||
if(state_ == state && !coordsFound.contains(coords_) && !coordsToPaint.contains(coords_))
|
||||
@@ -69,14 +69,14 @@ public class LensPaint extends Lens {
|
||||
} while(!coordsFound.isEmpty() && coordsToPaint.size() < 1000);
|
||||
|
||||
for(BlockPos coords : coordsToPaint) {
|
||||
EnumDyeColor placeColor = EnumDyeColor.byMetadata(storedColor == 16 ? entity.world.rand.nextInt(16) : storedColor);
|
||||
EnumDyeColor placeColor = EnumDyeColor.byId(storedColor == 16 ? entity.world.rand.nextInt(16) : storedColor);
|
||||
IBlockState stateThere = entity.world.getBlockState(coords);
|
||||
|
||||
if(stateThere.getValue(BotaniaAPI.paintableBlocks.get(block)) != placeColor
|
||||
if(stateThere.get(BotaniaAPI.paintableBlocks.get(block)) != placeColor
|
||||
&& BotaniaAPI.paintableBlocks.get(block).getAllowedValues().contains(placeColor)) {
|
||||
entity.world.setBlockState(coords, stateThere.withProperty(BotaniaAPI.paintableBlocks.get(block), placeColor), 2);
|
||||
entity.world.setBlockState(coords, stateThere.with(BotaniaAPI.paintableBlocks.get(block), placeColor), 2);
|
||||
PacketHandler.sendToNearby(entity.world, coords,
|
||||
new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.PAINT_LENS, coords.getX(), coords.getY(), coords.getZ(), placeColor.getMetadata()));
|
||||
new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.PAINT_LENS, coords.getX(), coords.getY(), coords.getZ(), placeColor.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class LensRedirect extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(!entity.world.isRemote && pos.entityHit == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) {
|
||||
if(!entity.world.isRemote && pos.entity == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) {
|
||||
TileEntity tile = entity.world.getTileEntity(pos.getBlockPos());
|
||||
if(tile instanceof IDirectioned) {
|
||||
if(!burst.isFake()) {
|
||||
|
||||
@@ -22,7 +22,7 @@ public class LensStorm extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!entity.world.isRemote && !burst.isFake()) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())))
|
||||
if(pos.entity == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())))
|
||||
entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true);
|
||||
} else dead = false;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class LensWarp extends Lens {
|
||||
if(block == ModBlocks.pistonRelay) {
|
||||
BlockPistonRelay.DimWithPos key = ((BlockPistonRelay) ModBlocks.pistonRelay).mappedPositions.get(new BlockPistonRelay.DimWithPos(entity.world.provider.getDimension(), pos.getBlockPos()));
|
||||
if(key != null) {
|
||||
if(key.dim == entity.world.provider.getDimension()) {
|
||||
if(key.dim == entity.world.getDimension().getId()) {
|
||||
entity.setPosition(key.blockPos.getX() + 0.5, key.blockPos.getY() + 0.5, key.blockPos.getZ() + 0.5);
|
||||
burst.setCollidedAt(key.blockPos);
|
||||
|
||||
|
||||
@@ -16,8 +16,9 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Particles;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.particles.BlockParticleData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.WorldServer;
|
||||
@@ -27,12 +28,6 @@ import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import java.util.Map;
|
||||
|
||||
public class LensWeight extends Lens {
|
||||
|
||||
private static final Map<IBlockState, IBlockState> TECHNICAL_BLOCK_REMAP = ImmutableMap.of(
|
||||
Blocks.LIT_REDSTONE_ORE.getDefaultState(), Blocks.REDSTONE_ORE.getDefaultState(),
|
||||
Blocks.LIT_REDSTONE_LAMP.getDefaultState(), Blocks.REDSTONE_LAMP.getDefaultState()
|
||||
);
|
||||
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!entity.world.isRemote && !burst.isFake() && pos.getBlockPos() != null) {
|
||||
@@ -43,12 +38,11 @@ public class LensWeight extends Lens {
|
||||
IBlockState state = entity.world.getBlockState(bPos);
|
||||
int neededHarvestLevel = block.getHarvestLevel(state);
|
||||
|
||||
if(entity.world.isAirBlock(bPos.down()) && state.getBlockHardness(entity.world, bPos) != -1 && neededHarvestLevel <= harvestLevel && entity.world.getTileEntity(bPos) == null && block.canSilkHarvest(entity.world, bPos, state, null)) {
|
||||
state = TECHNICAL_BLOCK_REMAP.getOrDefault(state, state);
|
||||
if(entity.world.isAirBlock(bPos.down()) && state.getBlockHardness(entity.world, bPos) != -1 && neededHarvestLevel <= harvestLevel && entity.world.getTileEntity(bPos) == null && state.canSilkHarvest(entity.world, bPos, null)) {
|
||||
EntityFallingBlock falling = new EntityFallingBlock(entity.world, bPos.getX() + 0.5, bPos.getY(), bPos.getZ() + 0.5, state);
|
||||
falling.fallTime = 1;
|
||||
entity.world.setBlockToAir(bPos);
|
||||
((WorldServer) entity.world).spawnParticle(EnumParticleTypes.FALLING_DUST, bPos.getX() + 0.5, bPos.getY() + 0.5, bPos.getZ() + 0.5, 10, 0.45, 0.45, 0.45, 5, new int[] {Block.getStateId(state)});
|
||||
entity.world.removeBlock(bPos);
|
||||
((WorldServer) entity.world).spawnParticle(new BlockParticleData(Particles.FALLING_DUST, state), bPos.getX() + 0.5, bPos.getY() + 0.5, bPos.getZ() + 0.5, 10, 0.45, 0.45, 0.45, 5);
|
||||
entity.world.spawnEntity(falling);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,25 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.material;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemPestleAndMortar extends ItemMod {
|
||||
|
||||
public ItemPestleAndMortar() {
|
||||
super(LibItemNames.PESTLE_AND_MORTAR);
|
||||
setMaxStackSize(1);
|
||||
setContainerItem(this);
|
||||
public ItemPestleAndMortar(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack stack) {
|
||||
return new ItemStack(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.material;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.item.IPetalApothecary;
|
||||
import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
@@ -17,8 +18,8 @@ import vazkii.botania.common.item.ItemMod;
|
||||
|
||||
public class ItemRune extends ItemMod implements IFlowerComponent {
|
||||
|
||||
public ItemRune(String name) {
|
||||
super(name);
|
||||
public ItemRune(Item.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,42 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
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.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemModRecord extends ItemRecord implements IModelRegister {
|
||||
|
||||
private final String file;
|
||||
|
||||
public ItemModRecord(String record, SoundEvent sound, String name) {
|
||||
super("botania:" + record, sound);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setTranslationKey(name);
|
||||
file = "botania:music." + record;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item\\.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
|
||||
public class ItemModRecord extends ItemRecord {
|
||||
public ItemModRecord(int comparator, SoundEvent sound, Item.Builder builder) {
|
||||
super(comparator, sound, builder);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Apr 11, 2015, 10:03:46 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemRecordGaia1 extends ItemModRecord {
|
||||
|
||||
public ItemRecordGaia1() {
|
||||
super("gaia1", ModSounds.gaiaMusic1, LibItemNames.RECORD_GAIA1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Apr 11, 2015, 10:06:28 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemRecordGaia2 extends ItemModRecord {
|
||||
|
||||
public ItemRecordGaia2() {
|
||||
super("gaia2", ModSounds.gaiaMusic2, LibItemNames.RECORD_GAIA2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -112,8 +112,8 @@ public final class LibItemNames {
|
||||
public static final String MANA_INKWELL = "manainkwell";
|
||||
public static final String VIAL = "vial";
|
||||
public static final String FLASK = "flask";
|
||||
public static final String BREW_VIAL = "brewvial";
|
||||
public static final String BREW_FLASK = "brewflask";
|
||||
public static final String BREW_VIAL = "brew_vial";
|
||||
public static final String BREW_FLASK = "brew_flask";
|
||||
public static final String BLOOD_PENDANT = "bloodpendant";
|
||||
public static final String MISSILE_ROD = "missilerod";
|
||||
public static final String HOLY_CLOAK = "holycloak";
|
||||
@@ -135,8 +135,8 @@ public final class LibItemNames {
|
||||
public static final String ANCIENT_WILL = "ancient_will";
|
||||
public static final String CORPOREA_SPARK = "corporea_spark";
|
||||
public static final String CORPOREA_SPARK_MASTER = "corporea_spark_master";
|
||||
public static final String LIVINGWOOD_BOW = "livingwoodbow";
|
||||
public static final String CRYSTAL_BOW = "crystalbow";
|
||||
public static final String LIVINGWOOD_BOW = "livingwood_bow";
|
||||
public static final String CRYSTAL_BOW = "crystal_bow";
|
||||
public static final String COSMETIC = "cosmetic";
|
||||
public static final String SWAP_RING = "swapring";
|
||||
public static final String FLOWER_BAG = "flowerbag";
|
||||
@@ -155,7 +155,7 @@ public final class LibItemNames {
|
||||
public static final String RECORD_GAIA1 = "recordgaia1";
|
||||
public static final String RECORD_GAIA2 = "recordgaia2";
|
||||
public static final String TEMPERANCE_STONE = "temperancestone";
|
||||
public static final String INCENSE_STICK = "incensestick";
|
||||
public static final String INCENSE_STICK = "incense_stick";
|
||||
public static final String TERRA_AXE = "terraaxe";
|
||||
public static final String WATER_BOWL = "waterbowl";
|
||||
public static final String OBEDIENCE_STICK = "obediencestick";
|
||||
|
||||
Reference in new issue
Block a user