Normalized code formatting.
This commit is contained in:
parent
b1db7c5152
commit
134b11f177
122 changed files with 944 additions and 697 deletions
|
@ -61,10 +61,12 @@ public class Utils
|
|||
}
|
||||
|
||||
/**
|
||||
* @param tile - The {@link TileInventory} to input the item to
|
||||
* @param player - The player to take the item from.
|
||||
* @param tile
|
||||
* - The {@link TileInventory} to input the item to
|
||||
* @param player
|
||||
* - The player to take the item from.
|
||||
* @return {@code true} if the ItemStack is inserted, {@code false}
|
||||
* otherwise
|
||||
* otherwise
|
||||
* @see #insertItemToTile(TileInventory, EntityPlayer, int)
|
||||
*/
|
||||
public static boolean insertItemToTile(TileInventory tile, EntityPlayer player)
|
||||
|
@ -77,12 +79,15 @@ public class Utils
|
|||
* inventory at slot 0
|
||||
* <p/>
|
||||
* EG: Block Altar
|
||||
*
|
||||
* @param tile - The {@link TileInventory} to input the item to
|
||||
* @param player - The player to take the item from.
|
||||
* @param slot - The slot to attempt to insert to
|
||||
*
|
||||
* @param tile
|
||||
* - The {@link TileInventory} to input the item to
|
||||
* @param player
|
||||
* - The player to take the item from.
|
||||
* @param slot
|
||||
* - The slot to attempt to insert to
|
||||
* @return {@code true} if the ItemStack is inserted, {@code false}
|
||||
* otherwise
|
||||
* otherwise
|
||||
*/
|
||||
public static boolean insertItemToTile(TileInventory tile, EntityPlayer player, int slot)
|
||||
{
|
||||
|
@ -109,28 +114,29 @@ public class Utils
|
|||
|
||||
/**
|
||||
* Gets a default block for each type of {@link EnumAltarComponent}
|
||||
*
|
||||
* @param component - The Component to provide a block for.
|
||||
*
|
||||
* @param component
|
||||
* - The Component to provide a block for.
|
||||
* @return The default Block for the EnumAltarComponent
|
||||
*/
|
||||
public static Block getBlockForComponent(EnumAltarComponent component)
|
||||
{
|
||||
switch (component)
|
||||
{
|
||||
case GLOWSTONE:
|
||||
return Blocks.glowstone;
|
||||
case BLOODSTONE:
|
||||
return ModBlocks.bloodStoneBrick;
|
||||
case BEACON:
|
||||
return Blocks.beacon;
|
||||
case BLOODRUNE:
|
||||
return ModBlocks.bloodRune;
|
||||
case CRYSTAL:
|
||||
return ModBlocks.crystal;
|
||||
case NOTAIR:
|
||||
return Blocks.stonebrick;
|
||||
default:
|
||||
return Blocks.air;
|
||||
case GLOWSTONE:
|
||||
return Blocks.glowstone;
|
||||
case BLOODSTONE:
|
||||
return ModBlocks.bloodStoneBrick;
|
||||
case BEACON:
|
||||
return Blocks.beacon;
|
||||
case BLOODRUNE:
|
||||
return ModBlocks.bloodRune;
|
||||
case CRYSTAL:
|
||||
return ModBlocks.crystal;
|
||||
case NOTAIR:
|
||||
return Blocks.stonebrick;
|
||||
default:
|
||||
return Blocks.air;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,9 +249,11 @@ public class Utils
|
|||
/**
|
||||
* Used to determine if stack1 can be placed into stack2. If stack2 is null
|
||||
* and stack1 isn't null, returns true. Ignores stack size
|
||||
*
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
*
|
||||
* @param stack1
|
||||
* Stack that is placed into a slot
|
||||
* @param stack2
|
||||
* Slot content that stack1 is placed into
|
||||
* @return True if they can be combined
|
||||
*/
|
||||
public static boolean canCombine(ItemStack stack1, ItemStack stack2)
|
||||
|
@ -269,8 +277,10 @@ public class Utils
|
|||
}
|
||||
|
||||
/**
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
* @param stack1
|
||||
* Stack that is placed into a slot
|
||||
* @param stack2
|
||||
* Slot content that stack1 is placed into
|
||||
* @return Stacks after stacking
|
||||
*/
|
||||
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2, int transferMax)
|
||||
|
@ -300,8 +310,10 @@ public class Utils
|
|||
}
|
||||
|
||||
/**
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
* @param stack1
|
||||
* Stack that is placed into a slot
|
||||
* @param stack2
|
||||
* Slot content that stack1 is placed into
|
||||
* @return Stacks after stacking
|
||||
*/
|
||||
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2)
|
||||
|
|
|
@ -29,20 +29,12 @@ import WayofTime.bloodmagic.client.render.RenderFakeBlocks;
|
|||
import WayofTime.bloodmagic.item.ItemRitualDiviner;
|
||||
import WayofTime.bloodmagic.util.GhostItemHelper;
|
||||
|
||||
|
||||
public class ClientEventHandler
|
||||
{
|
||||
public static int currentLP = 0;
|
||||
public static int capacity = 0;
|
||||
|
||||
public TextureAtlasSprite
|
||||
ritualStoneBlankIcon,
|
||||
ritualStoneWaterIcon,
|
||||
ritualStoneFireIcon,
|
||||
ritualStoneEarthIcon,
|
||||
ritualStoneAirIcon,
|
||||
ritualStoneDawnIcon,
|
||||
ritualStoneDuskIcon;
|
||||
public TextureAtlasSprite ritualStoneBlankIcon, ritualStoneWaterIcon, ritualStoneFireIcon, ritualStoneEarthIcon, ritualStoneAirIcon, ritualStoneDawnIcon, ritualStoneDuskIcon;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTooltipEvent(ItemTooltipEvent event)
|
||||
|
@ -129,27 +121,27 @@ public class ClientEventHandler
|
|||
|
||||
switch (ritualComponent.getRuneType())
|
||||
{
|
||||
case BLANK:
|
||||
texture = ritualStoneBlankIcon;
|
||||
break;
|
||||
case WATER:
|
||||
texture = ritualStoneWaterIcon;
|
||||
break;
|
||||
case FIRE:
|
||||
texture = ritualStoneFireIcon;
|
||||
break;
|
||||
case EARTH:
|
||||
texture = ritualStoneEarthIcon;
|
||||
break;
|
||||
case AIR:
|
||||
texture = ritualStoneAirIcon;
|
||||
break;
|
||||
case DAWN:
|
||||
texture = ritualStoneDawnIcon;
|
||||
break;
|
||||
case DUSK:
|
||||
texture = ritualStoneDuskIcon;
|
||||
break;
|
||||
case BLANK:
|
||||
texture = ritualStoneBlankIcon;
|
||||
break;
|
||||
case WATER:
|
||||
texture = ritualStoneWaterIcon;
|
||||
break;
|
||||
case FIRE:
|
||||
texture = ritualStoneFireIcon;
|
||||
break;
|
||||
case EARTH:
|
||||
texture = ritualStoneEarthIcon;
|
||||
break;
|
||||
case AIR:
|
||||
texture = ritualStoneAirIcon;
|
||||
break;
|
||||
case DAWN:
|
||||
texture = ritualStoneDawnIcon;
|
||||
break;
|
||||
case DUSK:
|
||||
texture = ritualStoneDuskIcon;
|
||||
break;
|
||||
}
|
||||
|
||||
RenderFakeBlocks.drawFakeBlock(texture, minX, minY, minZ, world);
|
||||
|
|
|
@ -483,7 +483,8 @@ public class EventHandler
|
|||
BindableHelper.setItemOwnerName(held, player.getDisplayNameString());
|
||||
}
|
||||
|
||||
if (held != null && held.getItem() instanceof IBloodOrb) {
|
||||
if (held != null && held.getItem() instanceof IBloodOrb)
|
||||
{
|
||||
held = NBTHelper.checkNBT(held);
|
||||
IBloodOrb bloodOrb = (IBloodOrb) held.getItem();
|
||||
SoulNetwork network = NetworkHelper.getSoulNetwork(player);
|
||||
|
|
|
@ -8,10 +8,13 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
|||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class IMCHandler {
|
||||
public class IMCHandler
|
||||
{
|
||||
|
||||
public static void handleIMC(FMLInterModComms.IMCEvent event) {
|
||||
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
|
||||
public static void handleIMC(FMLInterModComms.IMCEvent event)
|
||||
{
|
||||
for (FMLInterModComms.IMCMessage message : event.getMessages())
|
||||
{
|
||||
if (message.key.equals("teleposerBlacklist") && message.isItemStackMessage())
|
||||
{
|
||||
ItemStack stack = message.getItemStackValue();
|
||||
|
|
|
@ -24,8 +24,8 @@ import WayofTime.bloodmagic.api.Constants;
|
|||
*
|
||||
* If you pass a Block through here that uses the default ItemBlock, you
|
||||
* should specify a custom name.
|
||||
*
|
||||
* @deprecated in favor of {@link InventoryRenderHelperV2}
|
||||
*
|
||||
* @deprecated in favor of {@link InventoryRenderHelperV2}
|
||||
*/
|
||||
@Deprecated
|
||||
public class InventoryRenderHelper
|
||||
|
|
|
@ -7,47 +7,58 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
public class InventoryRenderHelperV2 {
|
||||
public class InventoryRenderHelperV2
|
||||
{
|
||||
|
||||
private final String domain;
|
||||
|
||||
public InventoryRenderHelperV2(String domain) {
|
||||
public InventoryRenderHelperV2(String domain)
|
||||
{
|
||||
this.domain = domain.endsWith(":") ? domain.replace(":", "") : domain;
|
||||
}
|
||||
|
||||
public void registerMesher(Item item, ItemMeshDefinition meshDefinition) {
|
||||
public void registerMesher(Item item, ItemMeshDefinition meshDefinition)
|
||||
{
|
||||
ModelLoader.setCustomMeshDefinition(item, meshDefinition);
|
||||
}
|
||||
|
||||
public void registerRender(Item item, int meta, String name, String variant) {
|
||||
public void registerRender(Item item, int meta, String name, String variant)
|
||||
{
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(new ResourceLocation(domain, "item/" + name), "type=" + variant));
|
||||
}
|
||||
|
||||
public void registerRender(Item item, int meta, String variant) {
|
||||
public void registerRender(Item item, int meta, String variant)
|
||||
{
|
||||
registerRender(item, meta, item.getRegistryName().split(":")[1], variant);
|
||||
}
|
||||
|
||||
public void registerRender(Item item, String name, String variant) {
|
||||
public void registerRender(Item item, String name, String variant)
|
||||
{
|
||||
registerRender(item, 0, name, variant);
|
||||
}
|
||||
|
||||
public void registerRender(Item item, String variant) {
|
||||
public void registerRender(Item item, String variant)
|
||||
{
|
||||
registerRender(item, item.getRegistryName().split(":")[1], variant);
|
||||
}
|
||||
|
||||
public void registerRender(Block block, int meta, String name, String variant) {
|
||||
public void registerRender(Block block, int meta, String name, String variant)
|
||||
{
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(new ResourceLocation(domain, name), variant));
|
||||
}
|
||||
|
||||
public void registerRender(Block block, int meta, String variant) {
|
||||
public void registerRender(Block block, int meta, String variant)
|
||||
{
|
||||
registerRender(block, meta, block.getRegistryName().split(":")[1], variant);
|
||||
}
|
||||
|
||||
public void registerRender(Block block, String name, String variant) {
|
||||
public void registerRender(Block block, String name, String variant)
|
||||
{
|
||||
registerRender(block, 0, name, variant);
|
||||
}
|
||||
|
||||
public void registerRender(Block block, String variant) {
|
||||
public void registerRender(Block block, String variant)
|
||||
{
|
||||
registerRender(block, block.getRegistryName().split(":")[1], variant);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue