Code formatter take 2
This commit is contained in:
parent
33985f1a31
commit
5eed5b161d
450 changed files with 32768 additions and 26684 deletions
|
@ -6,27 +6,37 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class OreDictUtils {
|
||||
public class OreDictUtils
|
||||
{
|
||||
|
||||
public static boolean isOre(Block block, String oreName) {
|
||||
public static boolean isOre(Block block, String oreName)
|
||||
{
|
||||
return isOre(new ItemStack(Item.getItemFromBlock(block)), oreName);
|
||||
}
|
||||
|
||||
public static boolean isOre(IBlockState state, String oreName) {
|
||||
return isOre(new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)), oreName);
|
||||
public static boolean isOre(IBlockState state, String oreName)
|
||||
{
|
||||
return isOre(
|
||||
new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)),
|
||||
oreName);
|
||||
}
|
||||
|
||||
public static boolean isOre(Item item, String oreName) {
|
||||
public static boolean isOre(Item item, String oreName)
|
||||
{
|
||||
return isOre(new ItemStack(item), oreName);
|
||||
}
|
||||
|
||||
public static boolean isOre(ItemStack stack, String oreName) {
|
||||
if (stack != null && stack.getItem() != null && oreName != null) {
|
||||
public static boolean isOre(ItemStack stack, String oreName)
|
||||
{
|
||||
if (stack != null && stack.getItem() != null && oreName != null)
|
||||
{
|
||||
int id = OreDictionary.getOreID(oreName);
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
|
||||
for (int i : ids) {
|
||||
if (id == i) {
|
||||
for (int i : ids)
|
||||
{
|
||||
if (id == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,15 +3,16 @@ package techreborn.utils;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.items.ItemCells;
|
||||
|
||||
|
||||
public class RecipeUtils {
|
||||
public static ItemStack getEmptyCell(int stackSize) { //TODO ic2
|
||||
// if (Loader.isModLoaded("IC2")) {
|
||||
// ItemStack cell = IC2Items.getItem("cell").copy();
|
||||
// cell.stackSize = stackSize;
|
||||
// return cell;
|
||||
// } else {
|
||||
return ItemCells.getCellByName("empty", stackSize);
|
||||
// }
|
||||
}
|
||||
public class RecipeUtils
|
||||
{
|
||||
public static ItemStack getEmptyCell(int stackSize)
|
||||
{ // TODO ic2
|
||||
// if (Loader.isModLoaded("IC2")) {
|
||||
// ItemStack cell = IC2Items.getItem("cell").copy();
|
||||
// cell.stackSize = stackSize;
|
||||
// return cell;
|
||||
// } else {
|
||||
return ItemCells.getCellByName("empty", stackSize);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,37 @@
|
|||
package techreborn.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by Mark on 23/03/2016.
|
||||
*/
|
||||
public class StackWIPHandler {
|
||||
public class StackWIPHandler
|
||||
{
|
||||
|
||||
ArrayList<Block> wipBlocks = new ArrayList<>();
|
||||
ArrayList<Block> wipBlocks = new ArrayList<>();
|
||||
|
||||
public StackWIPHandler() {
|
||||
wipBlocks.add(ModBlocks.LightningRod);
|
||||
wipBlocks.add(ModBlocks.MagicalAbsorber);
|
||||
wipBlocks.add(ModBlocks.ChunkLoader);
|
||||
wipBlocks.add(ModBlocks.ElectricCraftingTable);
|
||||
wipBlocks.add(ModBlocks.playerDetector);
|
||||
}
|
||||
public StackWIPHandler()
|
||||
{
|
||||
wipBlocks.add(ModBlocks.LightningRod);
|
||||
wipBlocks.add(ModBlocks.MagicalAbsorber);
|
||||
wipBlocks.add(ModBlocks.ChunkLoader);
|
||||
wipBlocks.add(ModBlocks.ElectricCraftingTable);
|
||||
wipBlocks.add(ModBlocks.playerDetector);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void toolTip(ItemTooltipEvent event){
|
||||
Block block = Block.getBlockFromItem(event.itemStack.getItem());
|
||||
if(block != null && wipBlocks.contains(block)){
|
||||
event.toolTip.add(TextFormatting.RED + "WIP Coming Soon");
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void toolTip(ItemTooltipEvent event)
|
||||
{
|
||||
Block block = Block.getBlockFromItem(event.itemStack.getItem());
|
||||
if (block != null && wipBlocks.contains(block))
|
||||
{
|
||||
event.toolTip.add(TextFormatting.RED + "WIP Coming Soon");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,10 @@ import net.minecraft.util.DamageSource;
|
|||
/**
|
||||
* Created by modmuss50 on 06/03/2016.
|
||||
*/
|
||||
public class ElectrialShockSource extends DamageSource {
|
||||
public ElectrialShockSource() {
|
||||
super("shock");
|
||||
}
|
||||
public class ElectrialShockSource extends DamageSource
|
||||
{
|
||||
public ElectrialShockSource()
|
||||
{
|
||||
super("shock");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,10 @@ import net.minecraft.util.DamageSource;
|
|||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class FusionDamageSource extends DamageSource {
|
||||
public FusionDamageSource() {
|
||||
super("fusion");
|
||||
}
|
||||
public class FusionDamageSource extends DamageSource
|
||||
{
|
||||
public FusionDamageSource()
|
||||
{
|
||||
super("fusion");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue