Cleanup & reformat

This commit is contained in:
John Yorke committed 2021-11-25 23:38:31 -04:00
1 parent f479b19255
commit 38e0cefaa2
76 files changed
+2371 -2766

No files matched your search

@@ -1,7 +1,5 @@
package taintedmagic.common.items;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
@@ -19,45 +17,40 @@ import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.playerdata.PacketAspectPool;
import thaumcraft.common.lib.research.ResearchManager;
public class ItemMagicFunguar extends ItemFood
{
Aspect aspects[] = Aspect.getPrimalAspects().toArray(new Aspect[0]);
public class ItemMagicFunguar extends ItemFood {
public ItemMagicFunguar (int healAmount, float saturation, boolean b)
{
public ItemMagicFunguar (final int healAmount, final float saturation, final boolean b) {
super(healAmount, saturation, b);
this.setCreativeTab(TaintedMagic.tabTM);
this.setTextureName("taintedmagic:ItemMagicFunguar");
this.setAlwaysEdible();
this.setUnlocalizedName("ItemMagicFunguar");
setCreativeTab(TaintedMagic.tabTM);
setTextureName("taintedmagic:ItemMagicFunguar");
setAlwaysEdible();
setUnlocalizedName("ItemMagicFunguar");
}
@Override
protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
{
protected void onFoodEaten (final ItemStack stack, final World world, final EntityPlayer player) {
super.onFoodEaten(stack, world, player);
// Potion effects
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 1));
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 2));
int i = world.rand.nextInt(aspects.length);
Aspect[] aspects = Aspect.getPrimalAspects().toArray(new Aspect[0]);
final int i = world.rand.nextInt(aspects.length);
if (!world.isRemote)
{
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspects[i],
Short.valueOf((short) (1)));
if (!world.isRemote) {
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspects[i], (short) 1);
ResearchManager.scheduleSave(player);
PacketHandler.INSTANCE.sendTo(
new PacketAspectPool(aspects[i].getTag(), Short.valueOf((short) 1), Short.valueOf(
Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspects[i]))),
new PacketAspectPool(aspects[i].getTag(), (short) 1,
Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspects[i])),
(EntityPlayerMP) player);
}
}
@Override
@SideOnly (Side.CLIENT)
public EnumRarity getRarity (ItemStack stack)
{
public EnumRarity getRarity (final ItemStack stack) {
return EnumRarity.uncommon;
}
}