Skip to content

Commit

Permalink
Split commonutils into a library
Browse files Browse the repository at this point in the history
  • Loading branch information
hea3ven committed Dec 12, 2015
1 parent c1a6c28 commit c8fa6ba
Show file tree
Hide file tree
Showing 35 changed files with 68 additions and 1,025 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/bootstrap/java"]
path = src/bootstrap/java
url = git@github.com:hea3ven/bootstrap.git
43 changes: 28 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ apply plugin: 'com.matthewprenger.cursegradle'
import groovy.io.FileType

repositories {
mavenLocal()
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
Expand Down Expand Up @@ -58,31 +59,43 @@ curseforge {
}

configurations {
release
runmods
}

dependencies {
runmods "codechicken:CodeChickenCore:1.8-1.0.5.34:dev"
runmods "codechicken:NotEnoughItems:1.8-1.0.5.82:dev"
compile 'com.hea3ven.tools.commonutils:h3nt-commonutils:1.0.2'
release('com.hea3ven.tools.commonutils:h3nt-commonutils:1.0.2') {
transitive = false
}

testCompile "junit:junit:4.12"
}

processResources
{
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
inputs.property "forgeversion", project.minecraft.forgeVersion
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
inputs.property "forgeversion", project.minecraft.forgeVersion

from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version, 'forgeversion': project.minecraft.forgeVersion
}
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version, 'forgeversion': project.minecraft.forgeVersion
}

from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}

sourceSets.main.java {
srcDirs += 'src/bootstrap/java'
}

jar {
into ('libs') {
from configurations.release
}
}

task copyRunMods(type: Copy) {
from configurations.runmods.files
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/java
Submodule java added at 14c4df
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.apache.logging.log4j.Logger;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
Expand All @@ -26,13 +27,19 @@
import com.hea3ven.buildingbricks.core.materials.mapping.IdMappingLoader;
import com.hea3ven.buildingbricks.core.network.TrowelRotateBlockTypeMessage;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.tools.bootstrap.Bootstrap;
import com.hea3ven.tools.commonutils.resources.ResourceScanner;

@Mod(modid = Properties.MODID, name = "Building Bricks", version = Properties.VERSION,
dependencies = Properties.DEPENDENCIES,
guiFactory = "com.hea3ven.buildingbricks.core.config.BuildingBricksConfigGuiFactory")
public class ModBuildingBricks {

static {
Bootstrap.require(Properties.MODID, "1.0.x");
Bootstrap.initLib(Properties.MODID, "h3nt-commonutils", "1.0.2", "1.0.x");
}

public static final Logger logger = LogManager.getLogger("BuildingBricks");

@SidedProxy(serverSide = "com.hea3ven.buildingbricks.core.ProxyCommonBuildingBricks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.world.World;

import com.hea3ven.buildingbricks.core.blocks.base.BlockBuildingBricksNonSolid;
import com.hea3ven.buildingbricks.core.blocks.blockstate.BlockStateUtil;
import com.hea3ven.tools.commonutils.util.BlockStateUtil;
import com.hea3ven.buildingbricks.core.blocks.properties.BlockProperties;
import com.hea3ven.buildingbricks.core.blockstate.EnumBlockHalf;
import com.hea3ven.buildingbricks.core.blockstate.EnumRotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialBlock extends BlockBuildingBricksBlock implements BlockMaterial {

Expand Down Expand Up @@ -81,7 +81,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialCorner extends BlockBuildingBricksCorner implements BlockMaterial {

Expand Down Expand Up @@ -81,7 +81,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialFence extends BlockBuildingBricksFence implements BlockMaterial {
public BlockMaterialFence(StructureMaterial structMat) {
Expand Down Expand Up @@ -80,7 +80,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialFenceGate extends BlockBuildingBricksFenceGate implements BlockMaterial {
public BlockMaterialFenceGate(StructureMaterial structMat) {
Expand Down Expand Up @@ -79,7 +79,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialSlab extends BlockBuildingBricksSlab implements BlockMaterial {

Expand Down Expand Up @@ -85,7 +85,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialStairs extends BlockBuildingBricksStairs implements BlockMaterial {

Expand Down Expand Up @@ -81,7 +81,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialStep extends BlockBuildingBricksStep implements BlockMaterial {

Expand Down Expand Up @@ -81,7 +81,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialVerticalSlab extends BlockBuildingBricksVerticalSlab
implements BlockMaterial {
Expand Down Expand Up @@ -82,7 +82,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.hea3ven.buildingbricks.core.materials.Material;
import com.hea3ven.buildingbricks.core.materials.StructureMaterial;
import com.hea3ven.buildingbricks.core.tileentity.TileMaterial;
import com.hea3ven.buildingbricks.core.utils.ItemStackUtils;
import com.hea3ven.tools.commonutils.util.ItemStackUtil;

public class BlockMaterialWall extends BlockBuildingBricksWall implements BlockMaterial {

Expand Down Expand Up @@ -81,7 +81,7 @@ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, b
ItemStack stack = TileMaterial.getHarvestBlock(world, pos, player);
boolean removed = super.removedByPlayer(world, pos, player, willHarvest);
if (removed && !world.isRemote && !player.capabilities.isCreativeMode)
ItemStackUtils.dropFromBlock(world, pos, stack);
ItemStackUtil.dropFromBlock(world, pos, stack);
return removed;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class BlockProperties {
CONNECT_NORTH, CONNECT_SOUTH, CONNECT_WEST, CONNECT_EAST};

public static EnumFacing getFacing(IBlockState state) {
return (EnumFacing) state.getValue(FACING);
return state.getValue(FACING);
}

public static IBlockState setFacing(IBlockState state, EnumFacing facing) {
Expand Down Expand Up @@ -66,7 +66,7 @@ public static IBlockState setRotation(IBlockState state, EnumRotation rotation)
}

public static boolean getConnectionNorth(IBlockState state) {
return (Boolean) state.getValue(CONNECT_NORTH);
return state.getValue(CONNECT_NORTH);
}

public static IBlockState setConnectionNorth(IBlockState state, Boolean connected) {
Expand All @@ -82,15 +82,15 @@ public static IBlockState setConnectionEast(IBlockState state, Boolean connected
}

public static boolean getConnectionSouth(IBlockState state) {
return (Boolean) state.getValue(CONNECT_SOUTH);
return state.getValue(CONNECT_SOUTH);
}

public static IBlockState setConnectionSouth(IBlockState state, Boolean connected) {
return state.withProperty(CONNECT_SOUTH, connected);
}

public static boolean getConnectionWest(IBlockState state) {
return (Boolean) state.getValue(CONNECT_WEST);
return state.getValue(CONNECT_WEST);
}

public static IBlockState setConnectionWest(IBlockState state, Boolean connected) {
Expand Down

This file was deleted.

Loading

0 comments on commit c8fa6ba

Please sign in to comment.