Formatting!

This commit is contained in:
WayofTime 2016-06-23 21:43:27 -04:00
parent d240daf958
commit 8c4eff0d81
30 changed files with 301 additions and 225 deletions

View file

@ -11,5 +11,6 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Handler {
public @interface Handler
{
}

View file

@ -151,8 +151,8 @@ public class BloodMagicAPI
}
/**
* Used to add a {@link BlockStack} to the Transposition blacklist that cannot
* be changed via Configuration files.
* Used to add a {@link BlockStack} to the Transposition blacklist that
* cannot be changed via Configuration files.
*
* IMC:
* {@code FMLInterModComs.sendMessage("BloodMagic", "transpositionBlacklist", ItemStack)}

View file

@ -46,8 +46,8 @@ public class TeleposeEvent extends Event
}
/**
* Fired when a Teleposer attempts to move an Entity between locations. Can be cancelled to
* stop transposition.
* Fired when a Teleposer attempts to move an Entity between locations. Can
* be cancelled to stop transposition.
*/
@Cancelable
public static class Ent extends TeleposeEvent
@ -76,9 +76,11 @@ public class TeleposeEvent extends Event
/**
* Called after the entity has been transposed.
*/
public static class Post extends Ent {
public static class Post extends Ent
{
public Post(Entity entity, World initialWorld, BlockPos initialBlockPos, World finalWorld, BlockPos finalBlockPos) {
public Post(Entity entity, World initialWorld, BlockPos initialBlockPos, World finalWorld, BlockPos finalBlockPos)
{
super(entity, initialWorld, initialBlockPos, finalWorld, finalBlockPos);
}
}

View file

@ -12,12 +12,14 @@ import java.util.List;
/**
* Marks blocks as one that is documented.
*
* This documentation can be read by an {@link WayofTime.bloodmagic.item.ItemSanguineBook} (or child)
* This documentation can be read by an
* {@link WayofTime.bloodmagic.item.ItemSanguineBook} (or child)
*/
public interface IDocumentedBlock
{
/**
* Provides the documentation to provide to the player. Usually a short'n'sweet description about basic usage.
* Provides the documentation to provide to the player. Usually a
* short'n'sweet description about basic usage.
*
* @param player
* - The EntityPlayer attempting to view the Documentation.
@ -28,7 +30,8 @@ public interface IDocumentedBlock
* @param state
* - The IBlockState of the interacted Block.
*
* @return - A list of formatted ITextComponent to provide to the player. Provide an empty list if there is no available documentation.
* @return - A list of formatted ITextComponent to provide to the player.
* Provide an empty list if there is no available documentation.
*/
@Nonnull
List<ITextComponent> getDocumentation(EntityPlayer player, World world, BlockPos pos, IBlockState state);

View file

@ -19,7 +19,8 @@ public enum EnumRuneType implements IStringSerializable
public final TextFormatting colorCode;
EnumRuneType(TextFormatting colorCode) {
EnumRuneType(TextFormatting colorCode)
{
this.colorCode = colorCode;
}

View file

@ -74,7 +74,8 @@ public class BlockPhantom extends BlockContainer implements IVariantProvider
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
{
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
}

View file

@ -83,7 +83,8 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
{
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
}

View file

@ -12,7 +12,8 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
@Getter
@Setter
public abstract class HUDElement {
public abstract class HUDElement
{
private int xOffset;
private int yOffset;
@ -20,7 +21,8 @@ public abstract class HUDElement {
private final int yOffsetDefault;
private final RenderGameOverlayEvent.ElementType elementType;
public HUDElement(int xOffset, int yOffset, RenderGameOverlayEvent.ElementType elementType) {
public HUDElement(int xOffset, int yOffset, RenderGameOverlayEvent.ElementType elementType)
{
this.xOffset = xOffset;
this.xOffsetDefault = xOffset;
this.yOffset = yOffset;
@ -34,16 +36,19 @@ public abstract class HUDElement {
public abstract boolean shouldRender(Minecraft minecraft);
public void onPositionChanged() {
public void onPositionChanged()
{
}
public void resetToDefault() {
public void resetToDefault()
{
this.xOffset = xOffsetDefault;
this.yOffset = yOffsetDefault;
}
public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) {
public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height)
{
float f = 0.00390625F;
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.getInstance();

View file

@ -14,14 +14,17 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
import javax.annotation.Nullable;
public class HUDElementHolding extends HUDElement {
public class HUDElementHolding extends HUDElement
{
public HUDElementHolding() {
public HUDElementHolding()
{
super(0, 0, RenderGameOverlayEvent.ElementType.HOTBAR);
}
@Override
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) {
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
{
ItemStack sigilHolding = minecraft.thePlayer.getHeldItemMainhand();
// TODO - Clean this mess
// Check mainhand for Sigil of Holding
@ -59,7 +62,8 @@ public class HUDElementHolding extends HUDElement {
}
@Override
public boolean shouldRender(Minecraft minecraft) {
public boolean shouldRender(Minecraft minecraft)
{
return true;
}

View file

@ -13,21 +13,26 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer> {
public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer>
{
private static final ResourceLocation TEXTURE_BLOOD_ELYTRA = new ResourceLocation("bloodmagic", "textures/entities/bloodElytra.png");
private final RenderPlayer renderPlayer;
private final ModelElytra modelElytra = new ModelElytra();
public LayerBloodElytra(RenderPlayer renderPlayer) {
public LayerBloodElytra(RenderPlayer renderPlayer)
{
this.renderPlayer = renderPlayer;
}
@Override
public void doRenderLayer(AbstractClientPlayer clientPlayer, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (LivingArmour.hasFullSet(clientPlayer)) {
public void doRenderLayer(AbstractClientPlayer clientPlayer, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (LivingArmour.hasFullSet(clientPlayer))
{
ItemStack chestStack = clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if (ItemLivingArmour.hasUpgrade(Constants.Mod.MODID + ".upgrade.elytra", chestStack)) {
if (ItemLivingArmour.hasUpgrade(Constants.Mod.MODID + ".upgrade.elytra", chestStack))
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableBlend();
@ -47,7 +52,8 @@ public class LayerBloodElytra implements LayerRenderer<AbstractClientPlayer> {
}
@Override
public boolean shouldCombineTextures() {
public boolean shouldCombineTextures()
{
return false;
}
}

View file

@ -50,24 +50,28 @@ public class SubCommandNetwork extends SubCommandBase
{
EntityPlayer player = CommandBase.getPlayer(server, commandSender, args[1]);
try {
try
{
ValidCommands command = ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH));
command.run(player, commandSender, isBounded(0, 2, args.length), args);
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException e)
{
}
} catch (PlayerNotFoundException e)
{
displayErrorString(commandSender, e.getLocalizedMessage());
}
} else {
} else
{
displayErrorString(commandSender, "commands.error.arg.missing");
}
}
private enum ValidCommands
{
SYPHON("commands.network.syphon.help") {
SYPHON("commands.network.syphon.help")
{
@Override
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args)
{
@ -94,7 +98,8 @@ public class SubCommandNetwork extends SubCommandBase
}
}
},
ADD("commands.network.add.help") {
ADD("commands.network.add.help")
{
@Override
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args)
{
@ -123,7 +128,8 @@ public class SubCommandNetwork extends SubCommandBase
}
}
},
SET("commands.network.set.help") {
SET("commands.network.set.help")
{
@Override
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args)
{
@ -152,7 +158,8 @@ public class SubCommandNetwork extends SubCommandBase
}
}
},
GET("commands.network.get.help") {
GET("commands.network.get.help")
{
@Override
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args)
{
@ -169,9 +176,11 @@ public class SubCommandNetwork extends SubCommandBase
}
},
FILL("commands.network.fill.help") {
FILL("commands.network.fill.help")
{
@Override
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args) {
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args)
{
if (displayHelp)
{
displayHelpString(sender, this.help, Integer.MAX_VALUE);
@ -187,9 +196,11 @@ public class SubCommandNetwork extends SubCommandBase
}
}
},
CAP("commands.network.cap.help") {
CAP("commands.network.cap.help")
{
@Override
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args) {
public void run(EntityPlayer player, ICommandSender sender, boolean displayHelp, String... args)
{
if (displayHelp)
{
displayHelpString(sender, this.help);

View file

@ -14,8 +14,6 @@ public class CategoryAlchemy
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
String keyBase = Constants.Mod.DOMAIN + "alchemy_";
return entries;
}
}

View file

@ -15,8 +15,6 @@ public class CategorySpell
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
String keyBase = Constants.Mod.DOMAIN + "spell_";
return entries;
}
}

View file

@ -16,19 +16,23 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Collections;
import java.util.List;
public class EntryText extends EntryResourceLocation {
public class EntryText extends EntryResourceLocation
{
public EntryText(List<IPage> pageList, String unlocEntryName, boolean unicode) {
public EntryText(List<IPage> pageList, String unlocEntryName, boolean unicode)
{
super(pageList, unlocEntryName, new ResourceLocation("bloodmagicguide", "textures/gui/bullet_point.png"), unicode);
}
public EntryText(List<IPage> pageList, String unlocEntryName) {
public EntryText(List<IPage> pageList, String unlocEntryName)
{
this(pageList, unlocEntryName, false);
}
@Override
@SideOnly(Side.CLIENT)
public void drawExtras(Book book, CategoryAbstract category, int entryX, int entryY, int entryWidth, int entryHeight, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj) {
public void drawExtras(Book book, CategoryAbstract category, int entryX, int entryY, int entryWidth, int entryHeight, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(image);
GuiHelper.drawSizedIconWithoutColor(entryX + 4, entryY + 2, 8, 8, 1F);
@ -42,7 +46,8 @@ public class EntryText extends EntryResourceLocation {
if (strWidth > guiBase.xSize - 80 && strWidth > fontRendererObj.getStringWidth("..."))
cutString = true;
if (GuiHelper.isMouseBetween(mouseX, mouseY, entryX, entryY, entryWidth, entryHeight) && cutString) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, entryX, entryY, entryWidth, entryHeight) && cutString)
{
guiBase.drawHoveringText(Collections.singletonList(getLocalizedName()), entryX, entryY + 12);
fontRendererObj.setUnicodeFlag(unicode);

View file

@ -31,7 +31,8 @@ public class OrbRecipeRenderer implements IRecipeRenderer
}
@Override
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("gudieapi", "textures/gui/recipe_elements.png"));
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65);
@ -43,8 +44,10 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int width = 3;
int height = 3;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
if (list.size() - 1 < y * width + x)
{
continue;
@ -54,21 +57,29 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5);
Object component = list.get(y * width + x);
if (component != null) {
if (component instanceof ItemStack) {
if (component != null)
{
if (component instanceof ItemStack)
{
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip((ItemStack) component, stackX, stackY);
}
} else if (component instanceof Integer) {
} else if (component instanceof Integer)
{
GuiHelper.drawItemStack(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
}
} else {
if (((ArrayList<ItemStack>) component).isEmpty()) return;
} else
{
if (((ArrayList<ItemStack>) component).isEmpty())
return;
GuiHelper.drawItemStack(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
}
}
@ -78,7 +89,8 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7);
int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5);
GuiHelper.drawItemStack(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
{
guiBase.renderToolTip(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
}
} else if (recipe instanceof ShapedBloodOrbRecipe)
@ -86,26 +98,36 @@ public class OrbRecipeRenderer implements IRecipeRenderer
ShapedBloodOrbRecipe shapedBloodOrbRecipe = (ShapedBloodOrbRecipe) recipe;
int width = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 4);
int height = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 5);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7);
int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5);
Object component = shapedBloodOrbRecipe.getInput()[y * width + x];
if (component != null) {
if (component instanceof ItemStack) {
if (component != null)
{
if (component instanceof ItemStack)
{
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip((ItemStack) component, stackX, stackY);
}
} else if (component instanceof Integer) {
} else if (component instanceof Integer)
{
GuiHelper.drawItemStack(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
}
} else {
if (((ArrayList<ItemStack>) component).isEmpty()) return;
} else
{
if (((ArrayList<ItemStack>) component).isEmpty())
return;
GuiHelper.drawItemStack(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
}
}
@ -115,14 +137,16 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7);
int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5);
GuiHelper.drawItemStack(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
{
guiBase.renderToolTip(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
}
}
}
@Override
public void drawExtras(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
public void drawExtras(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer)
{
}
}

View file

@ -120,7 +120,8 @@ public class DataProviderBloodAltar implements IWailaDataProvider
return false;
}
private static boolean holdingSeerSigil(EntityPlayer player) {
private static boolean holdingSeerSigil(EntityPlayer player)
{
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilSeer)
return true;
@ -130,7 +131,8 @@ public class DataProviderBloodAltar implements IWailaDataProvider
return false;
}
private static boolean holdingDivinationSigil(EntityPlayer player) {
private static boolean holdingDivinationSigil(EntityPlayer player)
{
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilDivination)
return true;

View file

@ -92,7 +92,6 @@ public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
continue;
if (blockStack.getBlock() != null && blockStack.getBlock().getBlockHardness(blockStack.getState(), world, blockPos) != -1)
{
float strengthVsBlock = getStrVsBlock(stack, blockStack.getState());

View file

@ -477,7 +477,8 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
return null;
}
public static boolean hasUpgrade(String id, ItemStack stack) {
public static boolean hasUpgrade(String id, ItemStack stack)
{
if (!armourMap.containsKey(stack))
armourMap.put(stack, getLivingArmour(stack));

View file

@ -41,8 +41,7 @@ public class ContainerHolding extends Container
if (actionBarIndex == currentSlotHeldIn)
{
this.addSlotToContainer(new SlotDisabled(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 99));
}
else
} else
{
this.addSlotToContainer(new Slot(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 99));
}
@ -97,13 +96,11 @@ public class ContainerHolding extends Container
{
return null;
}
}
else if (!this.mergeItemStack(stackInSlot, 0, ItemSigilHolding.inventorySize, false))
} else if (!this.mergeItemStack(stackInSlot, 0, ItemSigilHolding.inventorySize, false))
{
return null;
}
}
else if (stack.getItem() instanceof ItemSigilHolding)
} else if (stack.getItem() instanceof ItemSigilHolding)
{
if (slotIndex < ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS))
{
@ -111,8 +108,7 @@ public class ContainerHolding extends Container
{
return null;
}
}
else if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize, ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), false))
} else if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize, ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), false))
{
return null;
}

View file

@ -226,7 +226,8 @@ public class ItemSigilHolding extends ItemSigilBase implements IKeybindable, IAl
ItemStack[] itemStacks = getInternalInventory(itemStack);
if (itemStacks != null)
return itemStacks[slot == 5 ? 4 : slot];
else return null;
else
return null;
}
return null;
@ -301,8 +302,7 @@ public class ItemSigilHolding extends ItemSigilBase implements IKeybindable, IAl
index = next(index);
currentItemStack = getItemStackInSlot(itemStack, index);
}
}
else
} else
{
index = prev(currentIndex);
currentItemStack = getItemStackInSlot(itemStack, index);
@ -320,7 +320,8 @@ public class ItemSigilHolding extends ItemSigilBase implements IKeybindable, IAl
}
@Override
public List<Pair<Integer, String>> getVariants() {
public List<Pair<Integer, String>> getVariants()
{
return Collections.emptyList();
}
}

View file

@ -90,24 +90,23 @@ public class ClientProxy extends CommonProxy
@Override
public void init()
{
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(
new IItemColor()
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(new IItemColor()
{
@Override
public int getColorFromItemstack(ItemStack stack, int tintIndex)
{
try {
try
{
if (stack.hasTagCompound() && stack.getTagCompound().hasKey(Constants.NBT.COLOR))
if (tintIndex == 1)
return Color.decode(stack.getTagCompound().getString(Constants.NBT.COLOR)).getRGB();
} catch (NumberFormatException e) {
} catch (NumberFormatException e)
{
return -1;
}
return -1;
}
},
ModItems.sigilHolding
);
}, ModItems.sigilHolding);
addElytraLayer();
}
@ -149,13 +148,16 @@ public class ClientProxy extends CommonProxy
}
}
private void addElytraLayer() {
private void addElytraLayer()
{
RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
try {
try
{
RenderPlayer renderPlayer = ObfuscationReflectionHelper.getPrivateValue(RenderManager.class, renderManager, "playerRenderer", "field_178637_m");
renderPlayer.addLayer(new LayerBloodElytra(renderPlayer));
BloodMagic.instance.getLogger().info("Elytra layer added");
} catch (Exception e) {
} catch (Exception e)
{
BloodMagic.instance.getLogger().error("Failed to set custom Elytra Layer for Elytra Living Armour Upgrade.");
BloodMagic.instance.getLogger().error(e.getLocalizedMessage());
}

View file

@ -93,7 +93,8 @@ public class Utils
return true;
}
public static String toFancyCasing(String input) {
public static String toFancyCasing(String input)
{
return String.valueOf(input.charAt(0)).toUpperCase(Locale.ENGLISH) + input.substring(1);
}
@ -731,7 +732,8 @@ public class Utils
{
spawnPos.offset(pushDirection);
switch (pushDirection) {
switch (pushDirection)
{
case DOWN:
{
entityItem.motionY = -velocity;
@ -918,14 +920,18 @@ public class Utils
return largerStack ? stack : null;
}
public static void registerHandlers(Set<ASMDataTable.ASMData> eventHandlers) {
for (ASMDataTable.ASMData data : eventHandlers) {
try {
public static void registerHandlers(Set<ASMDataTable.ASMData> eventHandlers)
{
for (ASMDataTable.ASMData data : eventHandlers)
{
try
{
Class<?> handlerClass = Class.forName(data.getClassName());
Object handlerImpl = handlerClass.newInstance();
MinecraftForge.EVENT_BUS.register(handlerImpl);
BloodMagic.instance.getLogger().debug("Registering event handler for class {}", data.getClassName());
} catch (Exception e) {
} catch (Exception e)
{
// No-op
}
}

View file

@ -30,7 +30,8 @@ public class IMCHandler
if (message.key.equals("transpositionBlacklist") && message.isItemStackMessage())
{
ItemStack stack = message.getItemStackValue();
if (stack.getItem() instanceof ItemBlock) {
if (stack.getItem() instanceof ItemBlock)
{
Block block = Block.getBlockFromItem(stack.getItem());
BloodMagicAPI.addToTranspositionBlacklist(block, stack.getItemDamage());
}

View file

@ -138,8 +138,7 @@ public class ClientHandler
renderRitualStones(mrsHoloTile, event.getPartialTicks());
else
ClientHandler.setRitualHolo(null, null, EnumFacing.NORTH, false);
}
else
} else
{
ClientHandler.setRitualHolo(null, null, EnumFacing.NORTH, false);
}

View file

@ -25,7 +25,8 @@ import java.util.ArrayList;
import java.util.List;
@Handler
public class CraftingHandler {
public class CraftingHandler
{
// Sets the uses of crafted Inscription Tools to 10
@SubscribeEvent
@ -42,7 +43,8 @@ public class CraftingHandler {
event.getOutput().getTagCompound().setInteger(Constants.NBT.USES, 10);
}
if (event.getOutput().getItem() == ForgeModContainer.getInstance().universalBucket && event.getAltarRecipe().getSyphon() == 1000) {
if (event.getOutput().getItem() == ForgeModContainer.getInstance().universalBucket && event.getAltarRecipe().getSyphon() == 1000)
{
NBTTagCompound bucketTags = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, BloodMagicAPI.getLifeEssence()).getTagCompound();
event.getOutput().setTagCompound(bucketTags);
}
@ -68,8 +70,10 @@ public class CraftingHandler {
}
}
if (event.getLeft().getItem() == ModItems.sigilHolding) {
if (event.getRight().getItem() == Items.NAME_TAG) {
if (event.getLeft().getItem() == ModItems.sigilHolding)
{
if (event.getRight().getItem() == Items.NAME_TAG)
{
ItemStack output = event.getLeft().copy();
if (!output.hasTagCompound())
output.setTagCompound(new NBTTagCompound());
@ -81,7 +85,8 @@ public class CraftingHandler {
return;
}
if (event.getRight().getItem() == Items.DYE) {
if (event.getRight().getItem() == Items.DYE)
{
EnumDyeColor dyeColor = ItemBanner.getBaseColor(event.getRight());
ItemStack output = event.getLeft().copy();
if (!output.hasTagCompound())

View file

@ -27,7 +27,8 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Handler
public class LivingArmourHandler {
public class LivingArmourHandler
{
// Applies: Grim Reaper
@SubscribeEvent(priority = EventPriority.HIGHEST)

View file

@ -17,11 +17,14 @@ import java.util.UUID;
// Migrates from the old data storage system to the cleaner new one
@Handler
public class MigrateNetworkDataHandler {
public class MigrateNetworkDataHandler
{
@SubscribeEvent
public void playerJoin(EntityJoinWorldEvent event) {
if (!event.getWorld().isRemote && event.getEntity() instanceof EntityPlayer) {
public void playerJoin(EntityJoinWorldEvent event)
{
if (!event.getWorld().isRemote && event.getEntity() instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.getEntity();
UUID playerId = PlayerHelper.getUUIDFromPlayer(player);
Stopwatch stopwatch = Stopwatch.createStarted();