Skip to content

Commit

Permalink
0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverpanda committed Mar 25, 2017
1 parent 24bb466 commit 9d6736a
Show file tree
Hide file tree
Showing 480 changed files with 8,676 additions and 9 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
40 changes: 31 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
*.class
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# Mobile Tools for Java (J2ME)
.mtj.tmp/
# idea
out
*.ipr
*.iws
*.iml
.idea

# Package Files #
*.jar
*.war
*.ear
# gradle
build
.gradle

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# other
eclipse
run

CREDITS-fml.txt
Paulscode SoundSystem CodecIBXM License.txt
LICENSE-new.txt
forge-1.10.2-12.18.3.2221-changelog.txt
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
Paulscode IBXM Library License.txt
MinecraftForge-Credits.txt
gradlew.bat
gradlew
gradle.properties
59 changes: 59 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-------------------------------------------
Source installation information for modders
-------------------------------------------
This code follows the Minecraft Forge installation methodology. It will apply
some small patches to the vanilla MCP source code, giving you and it access
to some of the data and functions you need to build a successful mod.

Note also that the patches are built against "unrenamed" MCP source code (aka
srgnames) - this means that you will not be able to read them directly against
normal code.

Source pack installation information:

Standalone source installation
==============================

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:

Windows: "gradlew setupDecompWorkspace"
Linux/Mac OS: "./gradlew setupDecompWorkspace"

Step 3: After all that finished, you're left with a choice.
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)

If you preffer to use IntelliJ, steps are a little different.
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Once it's finished you must close IntelliJ and run the following command:

"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)

Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.

Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.

Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.

Tip:
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.

Forge source installation
=========================
MinecraftForge ships with this code and installs it as part of the forge
installation process, no further action is required on your part.

LexManos' Install Video
=======================
https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be

For more details update more often refer to the Forge Forums:
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
78 changes: 78 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.


version = "1.0"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

sourceCompatibility = targetCompatibility = "1.6" // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = "1.6"
}

minecraft {
version = "1.10.2-12.18.3.2221"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20161111"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

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

// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// 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
{
// 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
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
64 changes: 64 additions & 0 deletions src/main/java/panda/gotwood/GotWood.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package panda.gotwood;

import panda.gotwood.blocks.BlockPlanks;
import panda.gotwood.blocks.SpecialFire;
import panda.gotwood.events.BlockBreakHandler;
import panda.gotwood.events.ConfigurationHandler;
import panda.gotwood.events.ConsumedByFireListener;
import panda.gotwood.events.FireHandler;
import panda.gotwood.generation.WorldGenerator;
import panda.gotwood.proxy.CommonProxy;
import panda.gotwood.proxy.ProxyClient;
import panda.gotwood.registry.BlockRegistry;
import panda.gotwood.registry.ItemRegistry;
import panda.gotwood.registry.MasterRegistrar;
import panda.gotwood.util.WoodMaterial;
import panda.gotwood.util.WoodMaterials;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.ExistingSubstitutionException;
import net.minecraftforge.fml.common.registry.GameRegistry;

@Mod(modid = GotWood.MODID, name = GotWood.NAME, version = GotWood.VERSION)


public class GotWood
{
public static final String MODID = "gotwood";
public static final String VERSION = "0.10.0";

public static final String NAME = "Got Wood?";
@SidedProxy(serverSide = "panda.gotwood.proxy.ProxyServer", clientSide = "panda.gotwood.proxy.ProxyClient")
public static CommonProxy proxy;

public static ProxyClient PROXY = null;

@EventHandler
public void preinit(FMLPreInitializationEvent event)
{
MasterRegistrar.callRegistry(event);
}

@EventHandler
public void init(FMLInitializationEvent event) throws ExistingSubstitutionException
{
//GameRegistry.registerWorldGenerator(new WorldGenerator(), 0);
((SpecialFire)BlockRegistry.specialfire).init();
}

public static final CreativeTabs TreeTab = new CreativeTabs(GotWood.MODID) {
@Override public Item getTabIconItem() {
return ItemRegistry.oak_seed;
}
};

}
108 changes: 108 additions & 0 deletions src/main/java/panda/gotwood/blocks/BlockBerryBush.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package panda.gotwood.blocks;

import java.util.Random;

import javax.annotation.Nullable;

import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockBerryBush extends BlockBush{

public static final PropertyInteger GROWTH = PropertyInteger.create("growth", 0, 1);

public BlockBerryBush(){
this.setDefaultState(this.blockState.getBaseState().withProperty(GROWTH, Integer.valueOf(0)));
this.setTickRandomly(true);
}

public boolean isOpaqueCube(IBlockState state)
{
return false;
}

public boolean isFullCube(IBlockState state)
{
return false;
}

public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
{
super.neighborChanged(state, worldIn, pos, blockIn);
this.checkAndDropBlock(worldIn, pos, state);
}

public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
this.checkAndDropBlock(worldIn, pos, state);
}

protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state)
{
if (!this.canBlockStay(worldIn, pos, state)|| areaCleared( worldIn,pos))
{
if(areaCleared(worldIn,pos)){
this.dropBlockAsItem(worldIn, pos, state, 0);
}
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
}
}

public boolean areaCleared(World world, BlockPos pos){
if((world.getBlockState(pos.down(2)).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.east()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.east().down()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.west()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.west().down()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.north()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.north().down()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.south()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.south().down()).getBlock() == Blocks.AIR)&&
(world.getBlockState(pos.down()).getBlock() != Blocks.AIR)){
return true;
}
return false;
}


public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
return this.canSustainBush(worldIn.getBlockState(pos.down()));

}

public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, @Nullable ItemStack stack)
{
super.harvestBlock(worldIn, player, pos, state, te, stack);
worldIn.setBlockToAir(pos);
}

public IBlockState getStateFromMeta(int meta)
{
return this.getDefaultState().withProperty(GROWTH, Integer.valueOf(meta));
}

/**
* Convert the BlockState into the correct metadata value
*/
public int getMetaFromState(IBlockState state)
{
return ((Integer)state.getValue(GROWTH)).intValue();
}

protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] {GROWTH});
}
}
16 changes: 16 additions & 0 deletions src/main/java/panda/gotwood/blocks/BlockDoubleSlab.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package panda.gotwood.blocks;

import panda.gotwood.util.WoodMaterial;

public class BlockDoubleSlab extends BlockWoodSlab {

public BlockDoubleSlab(WoodMaterial wood) {
super(wood);
this.setRegistryName("double_"+wood.getName()+"_slab");
}

@Override
public boolean isDouble() {
return true;
}
}
Loading

0 comments on commit 9d6736a

Please sign in to comment.