Skip to content

Commit

Permalink
Merge pull request #1 from msifd/master
Browse files Browse the repository at this point in the history
Add server compatibility
  • Loading branch information
JujuBeans authored Oct 8, 2017
2 parents 158e32e + 910ab9f commit e202927
Show file tree
Hide file tree
Showing 50 changed files with 2,768 additions and 2,932 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gradle/**
build/**
out/**
eclipse/**
25 changes: 15 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,52 @@ buildscript {

apply plugin: 'forge'

version = "2.0.0"
group= "jujuawesomebeans.jujusclothingcraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
// Fix IntelliJ IDEA resources
apply plugin: 'idea'
idea { module { inheritOutputDirs = true } }

version = "2.1.0"
group = "jujuawesomebeans.jujusclothingcraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "JujusClothingCraft-1.7.10"

minecraft {
version = "1.7.10-10.13.4.1558-1.7.10"
runDir = "eclipse"

replaceIn "ClothingCraftInfo.java"
replace "@VERSION@", project.version
}

dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"

// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

}

processResources
{
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
expand 'version': project.version, 'mcversion': project.minecraft.version
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
}
31 changes: 15 additions & 16 deletions src/main/java/clothingcraft/blocks/BlockCottonBale.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
*
*
*/
package clothingcraft.blocks;

Expand All @@ -9,31 +9,30 @@
import net.minecraft.util.IIcon;

/**
*
* @author JujuAwesomeBeans
* @author NinjaSoldier40
* @since 02/07/2017 05:25 AM
*/
public class BlockCottonBale extends Block {

public IIcon[] icons = new IIcon[6];
public BlockCottonBale(Material material) {
super(material);
}
@Override
public IIcon[] icons = new IIcon[6];

public BlockCottonBale(Material material) {
super(material);
}

@Override
public void registerBlockIcons(IIconRegister reg) {
for (int i = 0; i < 6; i ++) {
for (int i = 0; i < 6; i++) {
int imgNum = 1;
if (i == 0 || i == 1) {
// only 2 of the sides will show without bale bands.
imgNum = 2;
}
this.icons[i] = reg.registerIcon(this.textureName + "_" + imgNum);
if (i == 0 || i == 1) {
// only 2 of the sides will show without bale bands.
imgNum = 2;
}
this.icons[i] = reg.registerIcon(this.textureName + "_" + imgNum);
}
}

@Override
public IIcon getIcon(int side, int meta) {
return this.icons[side];
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/clothingcraft/blocks/BlockCottonFabric.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/**
*
*
*/
package clothingcraft.blocks;

import clothingcraft.core.ClothingCraft;
import clothingcraft.client.ClientProxy;
import clothingcraft.core.ClothingCraftInfo;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

/**
* block of material resulting in combining rock salt
*
*
* @author JujuAwesomeBeans
* @author NinjaSoldier40
* @since 02/11/2017 01:55 PM (-07:00 GMT)
*/
public class BlockCottonFabric extends Block {

protected BlockCottonFabric(Material mat) {
super(mat);
this.setHardness(1.0F);
this.setResistance(3.0F);
this.setLightLevel(15.0F);
this.setBlockName("cotton_fabric_bundle");
this.setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_fabric_bundle");
this.setLightOpacity(225);
this.setStepSound(Block.soundTypeGravel);
this.setCreativeTab(ClothingCraft.tabCore);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setHarvestLevel("pickaxe", 0);
}
protected BlockCottonFabric(Material mat) {
super(mat);
this.setHardness(1.0F);
this.setResistance(3.0F);
this.setLightLevel(15.0F);
this.setBlockName("cotton_fabric_bundle");
this.setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_fabric_bundle");
this.setLightOpacity(225);
this.setStepSound(Block.soundTypeGravel);
this.setCreativeTab(ClientProxy.tabCore);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setHarvestLevel("pickaxe", 0);
}

}
79 changes: 36 additions & 43 deletions src/main/java/clothingcraft/blocks/BlockCottonPlant.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/**
*
*
*/
package clothingcraft.blocks;

import java.util.Random;

import clothingcraft.core.ClothingCraft;
import clothingcraft.core.ClothingCraftInfo;
import clothingcraft.core.CommonProxy;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
Expand All @@ -15,68 +13,63 @@
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;

import java.util.Random;

/**
*
*
* @author JujuAwesomeBeans
* @author NinjaSoldier40
* @since 02/05/2017 09:01 PM
*
*/
public class BlockCottonPlant extends RecipeBlockCrops
{
public BlockCottonPlant()
{
super(8);
public class BlockCottonPlant extends RecipeBlockCrops {
public BlockCottonPlant() {
super(8);
}
/**
* @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block)
*/
@Override
protected boolean canPlaceBlockOn(Block parBlock) {
return (parBlock == Blocks.farmland);
}

/**
* @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block)
*/
@Override
protected boolean canPlaceBlockOn(Block parBlock) {
return (parBlock == Blocks.farmland);
}

/**
* Returns the quantity of items to drop on block destruction.
*/
@Override
public int quantityDropped(int parMetadata, int parFortune, Random parRand)
{
return (parMetadata/2);
public int quantityDropped(int parMetadata, int parFortune, Random parRand) {
return (parMetadata / 2);
}

/**
* @see clothingcraft.blocks.RecipeBlockCrops#getItemDropSeeds()
*/
public Item getItemDropSeeds() {
return ClothingCraft.cottonSeeds;
return CommonProxy.cottonSeeds;
}

/**
* @see clothingcraft.blocks.RecipeBlockCrops#getItemDropProduce()
*/
public Item getItemDropProduce() {
return ClothingCraft.cotton;
return CommonProxy.cotton;
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister parIIconRegister)
{
iIcon = new IIcon[maxGrowthStage+1];
// seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want
// to make generic should loop to maxGrowthStage
iIcon[0] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_0");
iIcon[1] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_1");
iIcon[2] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_2");
iIcon[3] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_3");
iIcon[4] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_4");
iIcon[5] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_5");
iIcon[6] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_6");
iIcon[7] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_7");
iIcon[8] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_8");
public void registerBlockIcons(IIconRegister parIIconRegister) {
iIcon = new IIcon[maxGrowthStage + 1];
// seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want
// to make generic should loop to maxGrowthStage
iIcon[0] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_0");
iIcon[1] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_1");
iIcon[2] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_2");
iIcon[3] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_3");
iIcon[4] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_4");
iIcon[5] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_5");
iIcon[6] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_6");
iIcon[7] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_7");
iIcon[8] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_8");
}

}
Loading

0 comments on commit e202927

Please sign in to comment.