fix style

This commit is contained in:
asiekierka 2014-10-26 12:42:11 +01:00
parent 24b4859178
commit 5fde18014b
9 changed files with 18 additions and 19 deletions

View file

@ -37,7 +37,7 @@ public class BlockMetaPair implements Comparable<BlockMetaPair> {
if (arg.id != id) { if (arg.id != id) {
return (id - arg.id) * 16; return (id - arg.id) * 16;
} else { } else {
return (meta - arg.meta); return meta - arg.meta;
} }
} }
} }

View file

@ -11,7 +11,6 @@ package buildcraft.api.core;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;

View file

@ -52,7 +52,6 @@ import buildcraft.core.BlockSpring;
import buildcraft.core.DefaultProps; import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms; import buildcraft.core.InterModComms;
import buildcraft.core.Version; import buildcraft.core.Version;
import buildcraft.core.blueprints.SchematicRegistry;
import buildcraft.core.network.BuildCraftChannelHandler; import buildcraft.core.network.BuildCraftChannelHandler;
import buildcraft.core.proxy.CoreProxy; import buildcraft.core.proxy.CoreProxy;
import buildcraft.energy.BlockBuildcraftFluid; import buildcraft.energy.BlockBuildcraftFluid;

View file

@ -38,7 +38,6 @@ import buildcraft.builders.schematics.SchematicIgnoreMeta;
import buildcraft.core.DefaultProps; import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms; import buildcraft.core.InterModComms;
import buildcraft.core.Version; import buildcraft.core.Version;
import buildcraft.core.blueprints.SchematicRegistry;
import buildcraft.core.network.BuildCraftChannelHandler; import buildcraft.core.network.BuildCraftChannelHandler;
import buildcraft.core.proxy.CoreProxy; import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.ConfigUtils; import buildcraft.core.utils.ConfigUtils;

View file

@ -36,7 +36,6 @@ import buildcraft.core.InterModComms;
import buildcraft.core.ItemBuildCraft; import buildcraft.core.ItemBuildCraft;
import buildcraft.core.ItemRobot; import buildcraft.core.ItemRobot;
import buildcraft.core.Version; import buildcraft.core.Version;
import buildcraft.core.blueprints.SchematicRegistry;
import buildcraft.core.network.BuildCraftChannelHandler; import buildcraft.core.network.BuildCraftChannelHandler;
import buildcraft.core.proxy.CoreProxy; import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.robots.RobotIntegrationRecipe; import buildcraft.core.robots.RobotIntegrationRecipe;

View file

@ -51,7 +51,6 @@ import buildcraft.core.InterModComms;
import buildcraft.core.ItemBuildCraft; import buildcraft.core.ItemBuildCraft;
import buildcraft.core.PowerMode; import buildcraft.core.PowerMode;
import buildcraft.core.Version; import buildcraft.core.Version;
import buildcraft.core.blueprints.SchematicRegistry;
import buildcraft.core.network.BuildCraftChannelHandler; import buildcraft.core.network.BuildCraftChannelHandler;
import buildcraft.core.proxy.CoreProxy; import buildcraft.core.proxy.CoreProxy;
import buildcraft.silicon.ItemRedstoneChipset.Chipset; import buildcraft.silicon.ItemRedstoneChipset.Chipset;

View file

@ -1,15 +1,19 @@
package buildcraft.builders; package buildcraft.builders;
import buildcraft.api.blueprints.SchematicBlock;
import buildcraft.api.blueprints.SchematicFluid;
import buildcraft.core.blueprints.SchematicRegistry;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import buildcraft.api.blueprints.SchematicBlock;
import buildcraft.api.blueprints.SchematicFluid;
import buildcraft.builders.schematics.SchematicBlockCreative;
import buildcraft.core.blueprints.SchematicRegistry;
public final class HeuristicBlockDetection { public final class HeuristicBlockDetection {
private HeuristicBlockDetection() { private HeuristicBlockDetection() {
} }
@ -29,12 +33,14 @@ public final class HeuristicBlockDetection {
for (int meta = 0; meta < 16; meta++) { for (int meta = 0; meta < 16; meta++) {
if (!SchematicRegistry.INSTANCE.isSupported(block, meta)) { if (!SchematicRegistry.INSTANCE.isSupported(block, meta)) {
boolean creativeOnly = false;
// Stops dupes with (for instance) ore blocks // Stops dupes with (for instance) ore blocks
try { try {
if (block.getItemDropped(meta, null, 0) != Item.getItemFromBlock(block)) { if (block.getItemDropped(meta, null, 0) != Item.getItemFromBlock(block)) {
continue; creativeOnly = true;
} }
} catch(NullPointerException e) { } catch (NullPointerException e) {
// The "null" for Random in getItemDropped stops blocks // The "null" for Random in getItemDropped stops blocks
// depending on an RNG for deciding the dropped item // depending on an RNG for deciding the dropped item
// from being autodetected. // from being autodetected.
@ -43,7 +49,11 @@ public final class HeuristicBlockDetection {
continue; continue;
} }
if (creativeOnly) {
SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicBlock.class); SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicBlock.class);
} else {
SchematicRegistry.INSTANCE.registerSchematicBlock(block, meta, SchematicBlockCreative.class);
}
} }
} }
} }

View file

@ -14,15 +14,10 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property; import net.minecraftforge.common.config.Property;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import buildcraft.api.blueprints.ISchematicRegistry; import buildcraft.api.blueprints.ISchematicRegistry;
import buildcraft.api.blueprints.Schematic; import buildcraft.api.blueprints.Schematic;
@ -31,7 +26,7 @@ import buildcraft.api.blueprints.SchematicEntity;
import buildcraft.api.core.BlockMetaPair; import buildcraft.api.core.BlockMetaPair;
import buildcraft.api.core.JavaTools; import buildcraft.api.core.JavaTools;
public class SchematicRegistry implements ISchematicRegistry { public final class SchematicRegistry implements ISchematicRegistry {
public static SchematicRegistry INSTANCE = new SchematicRegistry(); public static SchematicRegistry INSTANCE = new SchematicRegistry();

View file

@ -20,7 +20,6 @@ import buildcraft.core.IBoxProvider;
import buildcraft.core.LaserData; import buildcraft.core.LaserData;
import buildcraft.core.RFBattery; import buildcraft.core.RFBattery;
import buildcraft.core.TileBuildCraft; import buildcraft.core.TileBuildCraft;
import buildcraft.core.blueprints.SchematicRegistry;
import buildcraft.core.network.RPC; import buildcraft.core.network.RPC;
import buildcraft.core.network.RPCHandler; import buildcraft.core.network.RPCHandler;
import buildcraft.core.network.RPCMessageInfo; import buildcraft.core.network.RPCMessageInfo;