Skip to content

Commit

Permalink
Fix everything and add server compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
msifd committed Oct 8, 2017
1 parent 104e061 commit f5a1599
Show file tree
Hide file tree
Showing 40 changed files with 624 additions and 719 deletions.
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ buildscript {

apply plugin: 'forge'

// Fix IntelliJ IDEA resources
apply plugin: 'idea'
idea { module { inheritOutputDirs = true } }

version = "2.0.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 {
Expand Down Expand Up @@ -58,4 +65,4 @@ processResources {
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/clothingcraft/blocks/BlockCottonFabric.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
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;
Expand All @@ -26,7 +26,7 @@ protected BlockCottonFabric(Material mat) {
this.setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_fabric_bundle");
this.setLightOpacity(225);
this.setStepSound(Block.soundTypeGravel);
this.setCreativeTab(ClothingCraft.tabCore);
this.setCreativeTab(ClientProxy.tabCore);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setHarvestLevel("pickaxe", 0);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/clothingcraft/blocks/BlockCottonPlant.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/
package clothingcraft.blocks;

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 Down Expand Up @@ -45,14 +45,14 @@ public int quantityDropped(int parMetadata, int parFortune, Random parRand) {
* @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
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/clothingcraft/blocks/BlockCottonWildPlant.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package clothingcraft.blocks;

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 Down Expand Up @@ -79,7 +79,7 @@ protected Item func_149866_i() {
* @see clothingcraft.blocks.RecipeBlockCrops#getItemDropSeeds()
*/
public Item getItemDropSeeds() {
return ClothingCraft.cottonSeeds;
return CommonProxy.cottonSeeds;
}

@Override
Expand All @@ -92,7 +92,7 @@ protected Item func_149865_P() {
* @see clothingcraft.blocks.RecipeBlockCrops#getItemDropProduce()
*/
public Item getItemDropProduce() {
return ClothingCraft.cotton;
return CommonProxy.cotton;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/clothingcraft/blocks/BlockHaliteBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
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;
Expand All @@ -26,7 +26,7 @@ protected BlockHaliteBlock(Material mat) {
this.setBlockTextureName(ClothingCraftInfo.MODID + ":halite_block");
this.setLightOpacity(225);
this.setStepSound(Block.soundTypeGravel);
this.setCreativeTab(ClothingCraft.tabCore);
this.setCreativeTab(ClientProxy.tabCore);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setHarvestLevel("pickaxe", 0);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/clothingcraft/blocks/BlockHaliteOre.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clothingcraft.blocks;

import clothingcraft.core.ClothingCraft;
import clothingcraft.client.ClientProxy;
import clothingcraft.core.ClothingCraftInfo;
import clothingcraft.items.ClothingCraftHaliteItemList;
import net.minecraft.block.Block;
Expand All @@ -21,7 +21,7 @@ public class BlockHaliteOre extends Block {
private int most_quantity;

public BlockHaliteOre() {
this("halite_ore", Material.rock, ClothingCraft.tabCore, ClothingCraftHaliteItemList.rockSalt, 2, 2, 4);
this("halite_ore", Material.rock, ClientProxy.tabCore, ClothingCraftHaliteItemList.rockSalt, 2, 2, 4);
}

protected BlockHaliteOre(String unlocalizedName, Material mat, CreativeTabs tab, Item drop, int meta, int least_quantity, int most_quantity) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/clothingcraft/blocks/BlockSandCastle.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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;
Expand All @@ -19,7 +19,7 @@ protected BlockSandCastle() {
this.setBlockName("sandcastle");
this.setBlockTextureName(ClothingCraftInfo.MODID + ":sandcastle");
this.setStepSound(Block.soundTypeSand);
this.setCreativeTab(ClothingCraft.tabAccessories);
this.setCreativeTab(ClientProxy.tabAccessories);
this.setHarvestLevel("shovel", 0);
this.setBlockBounds(
0.30000000000000004F,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/
package clothingcraft.blocks;

import clothingcraft.core.ClothingCraft;
import clothingcraft.client.ClientProxy;
import clothingcraft.core.ClothingCraftInfo;
import clothingcraft.core.CommonProxy;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
Expand Down Expand Up @@ -33,7 +34,7 @@ public static void preInit() {
.setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_bale")
.setLightOpacity(126)
.setStepSound(Block.soundTypeGrass)
.setCreativeTab(ClothingCraft.tabCore);
.setCreativeTab(ClientProxy.tabCore);
cottonBale.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
//Block.blockRegistry.addObject(192, "cotton_bale", cottonBale);
cottonBale.setHarvestLevel("pickaxe", 0);
Expand All @@ -45,7 +46,7 @@ public static void preInit() {
.setStepSound(Block.soundTypeGrass)
.setResistance(0.0F)
.setBlockName("cottonplant")
//.setCreativeTab(ClothingCraft.tabCore)
// .setCreativeTab(ClientProxy.tabCore)
.setBlockTextureName(ClothingCraftInfo.MODID + ":cottonplant");
GameRegistry.registerBlock(cottonPlant, "cottonplant");

Expand All @@ -55,23 +56,22 @@ public static void preInit() {
.setStepSound(Block.soundTypeGrass)
.setResistance(0.0F)
.setBlockName("cottonwildplant")
//.setCreativeTab(ClothingCraft.tabCore)
// .setCreativeTab(ClientProxy.tabCore)
.setBlockTextureName(ClothingCraftInfo.MODID + ":cottonwildplant");
GameRegistry.registerBlock(cottonWildPlant, "cottonwildplant");
}

public static void init() {
GameRegistry.addRecipe(new ItemStack(cottonBale, 1),
new Object[]{"012", "345", "678",
Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('1'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('3'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('4'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('5'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('7'), new ItemStack(ClothingCraft.cotton, 1),
Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1),
});
"012", "345", "678",
'0', new ItemStack(CommonProxy.cotton, 1),
'1', new ItemStack(CommonProxy.cotton, 1),
'2', new ItemStack(CommonProxy.cotton, 1),
'3', new ItemStack(CommonProxy.cotton, 1),
'4', new ItemStack(CommonProxy.cotton, 1),
'5', new ItemStack(CommonProxy.cotton, 1),
'6', new ItemStack(CommonProxy.cotton, 1),
'7', new ItemStack(CommonProxy.cotton, 1),
'8', new ItemStack(CommonProxy.cotton, 1));
}
}
37 changes: 37 additions & 0 deletions src/main/java/clothingcraft/client/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
package clothingcraft.client;

import clothingcraft.core.CommonProxy;
import clothingcraft.gui.CreativeTabsClothingCraft;
import clothingcraft.items.ClothingCraftAccessoriesItemList;
import clothingcraft.items.ClothingCraftFabricItemList;
import clothingcraft.items.ClothingCraftToolsItemList;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class ClientProxy extends CommonProxy {
public static CreativeTabs tabCore = new CreativeTabsClothingCraft("tabClothingCraftCore") {
public Item getTabIconItem() {
return cotton;
}
};
public static CreativeTabs tabMaterials = new CreativeTabsClothingCraft("tabClothingCraftMaterials") {
public Item getTabIconItem() {
return ClothingCraftFabricItemList.cottonFabric;
}
};
public static CreativeTabs tabTools = new CreativeTabsClothingCraft("tabClothingCraftTools") {
public Item getTabIconItem() {
return ClothingCraftToolsItemList.sewingScissors;
}
};
public static CreativeTabs tabAccessories = new CreativeTabsClothingCraft("tabClothingCraftAccessories") {
public Item getTabIconItem() {
return ClothingCraftAccessoriesItemList.purse;
}
};
public static CreativeTabs tabWardrobe = new CreativeTabsClothingCraft("tabClothingCraftWardrobe") {
public Item getTabIconItem() {
return ClothingCraftToolsItemList.needleAndThread;
}
};

@Override
public void preInit(FMLPreInitializationEvent e) {
Expand All @@ -15,6 +46,12 @@ public void preInit(FMLPreInitializationEvent e) {
@Override
public void init(FMLInitializationEvent e) {
super.init(e);

// place armor pieces into core tab
cottonArmorHelmet.setCreativeTab(ClientProxy.tabCore);
cottonArmorChestPlate.setCreativeTab(ClientProxy.tabCore);
cottonArmorLeggings.setCreativeTab(ClientProxy.tabCore);
cottonArmorBoots.setCreativeTab(ClientProxy.tabCore);
}

@Override
Expand Down
Loading

0 comments on commit f5a1599

Please sign in to comment.