Skip to content

Commit

Permalink
Merge pull request #206 from GrowthcraftCE/development
Browse files Browse the repository at this point in the history
Pull request to release 4.0.5.200 to master
  • Loading branch information
Alatyami authored Jul 11, 2019
2 parents a686bae + 630a7d8 commit a2c0ebb
Show file tree
Hide file tree
Showing 160 changed files with 9,037 additions and 3,314 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Growthcraft
===========
[![](http://cf.way2muchnoise.eu/versions/growthcraft-community-edition_latest.svg)](https://minecraft.curseforge.com/projects/growthcraft-community-edition/)
[![Growthcraft Version](https://img.shields.io/badge/Growthcraft-4.0.4.500-orange.svg)](https://github.com/GrowthcraftCE/Growthcraft-1.12)
[![Forge Version](https://img.shields.io/badge/Minecraft%20Forge-14.23.4.2705-yellow.svg)](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.12.2.html)
[![Growthcraft Version](https://img.shields.io/badge/Growthcraft-4.0.5.200-orange.svg)](https://github.com/GrowthcraftCE/Growthcraft-1.12)
[![Forge Version](https://img.shields.io/badge/Minecraft%20Forge-14.23.4.2768-yellow.svg)](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.12.2.html)
[![Java Version](https://img.shields.io/badge/JAVA-8-blue.svg)](https://www.java.com/en/)
[![Build Status](https://travis-ci.org/GrowthcraftCE/Growthcraft-1.12.svg?branch=development)](https://travis-ci.org/GrowthcraftCE/Growthcraft-1.12)
[![Discord Channel](https://img.shields.io/discord/333690296334548994.svg?color=green)](https://discord.gg/Quh76Jn)
Expand Down
Binary file added design/knife.xcf
Binary file not shown.
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.logging.level=warn

# Growthcraft Version
mod_version=4.0.4.500
mod_version=4.0.5.200

# Minecraft Versions
minecraft_version=1.12.2
Expand All @@ -16,7 +16,9 @@ mappings=snapshot_20171003

# Dependency Versions
baubles_version=1.5.2
jei_version=4.13.1.225
jei_version=4.15.0.268
hwyla_version=1.8.26-B41_1.12.2
rustic_version=1.0.12
rustic_version=1.1.0
# https://minecraft.curseforge.com/projects/rustic/files?filter-game-version=2020709689%3A6756
thaumcraft_version=6.1.BETA26
# https://minecraft.curseforge.com/projects/thaumcraft/files?filter-game-version=2020709689%3A6756
1 change: 1 addition & 0 deletions run_gradlew_eclipse.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gradlew eclipse
1 change: 1 addition & 0 deletions run_gradlew_runClient.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gradlew runClient
1 change: 1 addition & 0 deletions run_gradlew_setupDecompWorkspace.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gradlew setupDecompWorkspace
1 change: 0 additions & 1 deletion run_gradlew_setupDecompWorkspace_eclipse.bat

This file was deleted.

33 changes: 32 additions & 1 deletion src/main/java/growthcraft/apples/common/block/BlockApple.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package growthcraft.apples.common.block;

import growthcraft.apples.shared.Reference;
import growthcraft.core.shared.block.ICropDataProvider;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.IGrowable;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
Expand All @@ -22,15 +24,17 @@
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nullable;
import java.util.List;
import java.util.Random;

public class BlockApple extends BlockBush implements IGrowable {
public class BlockApple extends BlockBush implements ICropDataProvider, IGrowable, IPlantable {

// TODO: Make fields configurable
public static final int CHANCE_GROWTH = 10;
Expand All @@ -51,10 +55,12 @@ public class BlockApple extends BlockBush implements IGrowable {
};

public BlockApple(String unlocalizedName) {
super(Material.PLANTS);
this.setUnlocalizedName(unlocalizedName);
this.setRegistryName(new ResourceLocation(Reference.MODID, unlocalizedName));
this.setTickRandomly(true);
this.setSoundType(SoundType.WOOD);
this.setHarvestLevel("axe", 0);
}

@Override
Expand Down Expand Up @@ -184,4 +190,29 @@ public Item getItemDropped(IBlockState state, Random rand, int fortune) {

return Items.AIR;
}

@Override
public float getGrowthProgress(IBlockAccess world, BlockPos pos, IBlockState state) {
return (float)getAge(state) / 7.0F;
}

@Override
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) {
return new ItemStack(Items.APPLE);
}

/************
* IPLANTABLE
************/
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
return EnumPlantType.Crop;
}

@Override
public IBlockState getPlant(IBlockAccess world, BlockPos pos)
{
return getDefaultState();
}
}
95 changes: 53 additions & 42 deletions src/main/java/growthcraft/bamboo/GrowthcraftBamboo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import growthcraft.bamboo.common.CommonProxy;
import growthcraft.bamboo.common.Init;
import growthcraft.bamboo.shared.Reference;
import growthcraft.bamboo.shared.config.GrowthcraftBambooConfig;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
Expand All @@ -21,11 +22,11 @@
import net.minecraftforge.registries.IForgeRegistry;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION,
dependencies = "required-after:"+growthcraft.core.shared.Reference.MODID)
dependencies = "required-after:" + growthcraft.core.shared.Reference.MODID)
public class GrowthcraftBamboo {
private static final String CLIENT_PROXY_CLASS = "growthcraft.bamboo.client.ClientProxy";
private static final String SERVER_PROXY_CLASS = "growthcraft.bamboo.common.CommonProxy";

public static Configuration configuration;

@Mod.Instance(Reference.MODID)
Expand All @@ -36,53 +37,63 @@ public class GrowthcraftBamboo {

@Mod.EventHandler
public static void preInit(FMLPreInitializationEvent event) {
Init.preInitBlocks();
Init.preInitItems();
proxy.preInit();
GrowthcraftBambooConfig.preInit(event);

if (GrowthcraftBambooConfig.enableGrowthcraftBamboo) {
Init.preInitBlocks();
Init.preInitItems();
proxy.preInit();
}
}

@Mod.EventHandler
public static void init(FMLInitializationEvent event) {
Init.registerRecipes();
proxy.init();
if (GrowthcraftBambooConfig.enableGrowthcraftBamboo) {
Init.registerRecipes();
Init.registerSmeltingRecipes();
proxy.init();
}
}

@Mod.EventHandler
public static void postInit(FMLPostInitializationEvent event) {
// Nothing to do here at this time.
}

@Mod.EventHandler
public void construct(FMLConstructionEvent event) {
MinecraftForge.EVENT_BUS.register(this);
}

@SubscribeEvent
public void registerBlocks(RegistryEvent.Register<Block> event) {
if (GrowthcraftBambooConfig.enableGrowthcraftBamboo) {
IForgeRegistry<Block> registry = event.getRegistry();

Init.registerBlocks(registry);

proxy.registerStateMappers();
}
}

@SubscribeEvent
public void registerItems(RegistryEvent.Register<Item> event) {
if (GrowthcraftBambooConfig.enableGrowthcraftBamboo) {
IForgeRegistry<Item> registry = event.getRegistry();

Init.registerItems(registry);
Init.registerBlockItems(registry);

proxy.postRegisterItems();
}
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void registerModels(ModelRegistryEvent event) {
if (GrowthcraftBambooConfig.enableGrowthcraftBamboo) {
Init.registerItemRenders();
Init.registerBlockRenders();
}
}

@Mod.EventHandler
public void construct(FMLConstructionEvent event)
{
MinecraftForge.EVENT_BUS.register(this);
}

@SubscribeEvent
public void registerBlocks(RegistryEvent.Register<Block> event)
{
IForgeRegistry<Block> registry = event.getRegistry();

Init.registerBlocks(registry);

proxy.registerStateMappers();
}

@SubscribeEvent
public void registerItems(RegistryEvent.Register<Item> event)
{
IForgeRegistry<Item> registry = event.getRegistry();

Init.registerItems(registry);
Init.registerBlockItems(registry);

proxy.postRegisterItems();
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void registerModels(ModelRegistryEvent event)
{
Init.registerItemRenders();
Init.registerBlockRenders();
}
}
36 changes: 20 additions & 16 deletions src/main/java/growthcraft/bamboo/common/Init.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
package growthcraft.bamboo.common;

import static growthcraft.core.shared.GrowthcraftCoreApis.tabGrowthcraft;

import java.io.File;

import org.apache.logging.log4j.Level;

import growthcraft.bamboo.GrowthcraftBamboo;
import growthcraft.bamboo.client.handler.ColorHandlerBlockBambooLeaves;
import growthcraft.bamboo.common.block.BlockBambooDoor;
import growthcraft.bamboo.common.block.BlockBambooFence;
import growthcraft.bamboo.common.block.BlockBambooFenceGate;
import growthcraft.bamboo.common.block.BlockBambooLeaves;
import growthcraft.bamboo.common.block.BlockBambooPlank;
import growthcraft.bamboo.common.block.BlockBambooShoot;
import growthcraft.bamboo.common.block.BlockBambooSlabDouble;
import growthcraft.bamboo.common.block.BlockBambooSlabHalf;
import growthcraft.bamboo.common.block.BlockBambooStairs;
import growthcraft.bamboo.common.block.BlockBambooStalk;
import growthcraft.bamboo.common.block.*;
import growthcraft.bamboo.common.item.ItemBambooCoal;
import growthcraft.bamboo.common.item.ItemBambooDoor;
import growthcraft.bamboo.common.item.ItemBambooStick;
Expand All @@ -40,9 +25,16 @@
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
import org.apache.logging.log4j.Level;

import java.io.File;

import static growthcraft.core.shared.GrowthcraftCoreApis.tabGrowthcraft;

public class Init {
private Init() {}
Expand Down Expand Up @@ -101,6 +93,10 @@ public static void registerBlockItems(IForgeRegistry<Item> registry) {
GrowthcraftBambooBlocks.bambooShoot.registerBlockItem(registry);
}

public static void registerBlockOres() {
OreDictionary.registerOre("plankWood", GrowthcraftBambooBlocks.bambooPlank.getItem());
}

public static void registerBlockRenders() {
GrowthcraftBambooBlocks.bambooPlank.registerItemRender();
GrowthcraftBambooBlocks.bambooSlabHalf.registerItemRender();
Expand Down Expand Up @@ -141,6 +137,10 @@ public static void preInitItems() {
GrowthcraftBambooItems.itemBambooDoor = new ItemDefinition( new ItemBambooDoor("bamboo_door_item", GrowthcraftBambooBlocks.blockBambooDoor.getBlock()) );
}

public static void registerItemOres() {
OreDictionary.registerOre("stickWood", GrowthcraftBambooItems.bambooStick.getItem());
}

public static void registerItems(IForgeRegistry<Item> registry) {
GrowthcraftBambooItems.bambooStick.getItem().setCreativeTab(tabGrowthcraft);
GrowthcraftBambooItems.bambooStick.registerItem(registry);
Expand All @@ -167,6 +167,10 @@ public static void registerRecipes() {
private static void registerCraftingRecipes() {

}

public static void registerSmeltingRecipes() {
GameRegistry.addSmelting(GrowthcraftBambooBlocks.bambooStalk.getItemAsStack(1), GrowthcraftBambooItems.bambooCoal.asStack(1), 0.4f);
}

// Config

Expand Down
Loading

0 comments on commit a2c0ebb

Please sign in to comment.