-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
684 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/huige233/transcend/compat/tinkers/TiCConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package huige233.transcend.items; | ||
|
||
import huige233.transcend.Main; | ||
import huige233.transcend.init.ModItems; | ||
import huige233.transcend.util.IHasModel; | ||
import huige233.transcend.util.Reference; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemFood; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
import java.util.Locale; | ||
|
||
public class InfinityFood extends ItemFood implements IHasModel { | ||
public InfinityFood(){ | ||
super(20,10.f,false); | ||
this.setMaxStackSize(1); | ||
this.setTranslationKey("infinity_food"); | ||
this.setAlwaysEdible(); | ||
setRegistryName("infinity_food"); | ||
this.setCreativeTab(Main.TranscendTab); | ||
addPropertyOverride(new ResourceLocation(Reference.MOD_ID,"easter"),(stack, worldIn, entityIn) -> InfinityFood.isEaster(stack)?1F:0F); | ||
ModItems.ITEMS.add(this); | ||
} | ||
|
||
@Override | ||
public void registerModels() { | ||
Main.proxy.registerItemRenderer(this, 0, "inventory"); | ||
} | ||
|
||
@Override | ||
public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase entity) { | ||
if (entity instanceof EntityPlayer){ | ||
stack.grow(1); | ||
} | ||
return super.onItemUseFinish(stack,world,entity); | ||
} | ||
|
||
public int getMaxItemUseDuration(ItemStack stack) | ||
{ | ||
return 8; | ||
} | ||
|
||
@SideOnly(Side.CLIENT) | ||
public boolean hasEffect( ItemStack stack) | ||
{ | ||
return true; | ||
} | ||
|
||
public static boolean isEaster(ItemStack stack){ | ||
String name = stack.getDisplayName().toLowerCase(Locale.ROOT).trim(); | ||
return name.equals("azazel sakura"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.