generated from tilera/1710mod
feat: crystalline bell
This commit is contained in:
parent
dbe4c9783f
commit
4a1289e3d1
|
@ -38,7 +38,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
|
||||
implementation "dev.tilera:auracore:1.1.2:deobf"
|
||||
implementation "dev.tilera:auracore:1.8.9:deobf"
|
||||
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.anvilcraft.thaummach.items.ItemCrystallineBell;
|
||||
import net.anvilcraft.thaummach.items.ItemFocus;
|
||||
import net.anvilcraft.thaummach.items.ItemRunicEssence;
|
||||
import net.anvilcraft.thaummach.items.ItemSingularity;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class TMItems {
|
||||
public static Item crystallineBell;
|
||||
public static Item focus0;
|
||||
public static Item focus1;
|
||||
public static Item focus2;
|
||||
|
@ -16,6 +18,8 @@ public class TMItems {
|
|||
public static Item singularity;
|
||||
|
||||
public static void init() {
|
||||
crystallineBell = new ItemCrystallineBell();
|
||||
|
||||
focus0 = new ItemFocus(0);
|
||||
focus1 = new ItemFocus(1);
|
||||
focus2 = new ItemFocus(2);
|
||||
|
@ -26,13 +30,15 @@ public class TMItems {
|
|||
|
||||
singularity = new ItemSingularity();
|
||||
|
||||
GameRegistry.registerItem(crystallineBell, "crystalline_bell");
|
||||
|
||||
GameRegistry.registerItem(focus0, "focus0");
|
||||
GameRegistry.registerItem(focus1, "focus1");
|
||||
GameRegistry.registerItem(focus2, "focus2");
|
||||
GameRegistry.registerItem(focus3, "focus3");
|
||||
GameRegistry.registerItem(focus4, "focus4");
|
||||
|
||||
GameRegistry.registerItem(runicEssence, "runicEssence");
|
||||
GameRegistry.registerItem(runicEssence, "runic_essence");
|
||||
|
||||
GameRegistry.registerItem(singularity, "singularity");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
package net.anvilcraft.thaummach.items;
|
||||
|
||||
import dev.tilera.auracore.api.ICrystal;
|
||||
import net.anvilcraft.thaummach.TMTab;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemCrystallineBell extends Item implements IRepairable {
|
||||
public ItemCrystallineBell() {
|
||||
super();
|
||||
super.maxStackSize = 1;
|
||||
this.setMaxDamage(100);
|
||||
this.setUnlocalizedName("thaummach:crystalline_bell");
|
||||
this.setCreativeTab(TMTab.INSTANCE);
|
||||
this.canRepair = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister reg) {
|
||||
this.itemIcon = reg.registerIcon("thaummach:crystalline_bell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack itemstack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack itemstack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
int l,
|
||||
// useless parameters
|
||||
float alec1,
|
||||
float alec2,
|
||||
float alec3
|
||||
) {
|
||||
if (itemstack.stackSize == 0)
|
||||
return false;
|
||||
|
||||
int meta = world.getBlockMetadata(i, j, k);
|
||||
TileEntity te = world.getTileEntity(i, j, k);
|
||||
if (te != null && te instanceof ICrystal) {
|
||||
if (((ICrystal) te).getCrystalCount(meta) == 1)
|
||||
return false;
|
||||
world.playSoundEffect(
|
||||
(double) ((float) i + 0.5F),
|
||||
(double) ((float) j + 0.5F),
|
||||
(double) ((float) k + 0.5F),
|
||||
"random.orb",
|
||||
0.5F,
|
||||
0.8F + (float) ((ICrystal) te).getCrystalCount(meta) * 0.1F
|
||||
);
|
||||
|
||||
((ICrystal) te).harvestShard(player);
|
||||
|
||||
itemstack.damageItem(1, player);
|
||||
world.markBlockForUpdate(i, j, k);
|
||||
return true;
|
||||
}
|
||||
return super.onItemUse(itemstack, player, world, i, j, k, l, alec1, alec2, alec3);
|
||||
}
|
||||
|
||||
// TODO: WTF
|
||||
//@Override
|
||||
//public float visRepairCost() {
|
||||
// return 0.5F;
|
||||
//}
|
||||
}
|
|
@ -40,6 +40,7 @@ item.thaummach:focus_3.name=Arcane Focus: Earth
|
|||
item.thaummach:focus_4.name=Arcane Focus: Fire
|
||||
|
||||
item.thaummach:singularity.name=Arcane Singularity
|
||||
item.thaummach:crystalline_bell.name=Crystalline Bell
|
||||
|
||||
thaummach:runic_essence.0.name=Runic Essence: Magic
|
||||
thaummach:runic_essence.1.name=Runic Essence: Air
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 424 B |
Loading…
Reference in New Issue