Skip to content

Commit

Permalink
#31 Port to MC 1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DuchLord committed Feb 25, 2017
1 parent 9c72088 commit c0d9da2
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 86 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Supports mods (e.g. Biomes O' Plenty, Forestry, Tinkers Construct).
* Can be deactivated by holding SHIFT.
* Config with settings and list of allowed axes and types of wood.
* Option to reverse function (chopping with SHIFT)

<h3>Usage</h3>
Type in-game command "/tch help" or "/treechop help" for more info
Expand All @@ -20,6 +21,6 @@ Add UnlocalizedName of new item into "treechopper.cfg" (appdata/roaming/.minecra

[Curse.com](https://mods.curse.com/mc-mods/minecraft/250241-tree-chopper)

For Minecraft **1.10.2**.
For Minecraft **1.11.2**.

Recommended forge version: **1.10.2 - 12.18.3.2185**
Recommended forge version: **1.11.2 - 13.20.0.2228**
27 changes: 13 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ buildscript {
}
}
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.
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


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

sourceCompatibility = targetCompatibility = "1.6" // Need this here so eclipse task generates correctly.
Expand All @@ -21,15 +21,15 @@ compileJava {
}

minecraft {
version = "1.10.2-12.18.3.2185"
version = "1.11.2-13.20.0.2228"
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.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20161111"
mappings = "snapshot_20161220"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

Expand All @@ -38,7 +38,7 @@ dependencies {
// 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
Expand All @@ -57,21 +57,20 @@ dependencies {

}

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

// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/treechopper/client/gui/GuiFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
}

@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { //Why
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
return null;
}

}
112 changes: 56 additions & 56 deletions src/main/java/treechopper/common/command/Commands.java

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main/java/treechopper/common/handler/TreeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private boolean logAnalyze(Block logType, BlockPos position, BlockPos originPos,
return false;
}

if (world.getBlockState(position).getPropertyNames().toString().contains("variant") && logType.getBlockState().getProperty("variant") != null)
if (world.getBlockState(position).getPropertyKeys().toString().contains("variant") && logType.getBlockState().getProperty("variant") != null)
return ((world.getBlockState(position).getValue(logType.getBlockState().getProperty("variant")) == world.getBlockState(originPos).getValue(logType.getBlockState().getProperty("variant"))));

return true; // Ignoring log variant - doesnt have one..
Expand Down Expand Up @@ -208,7 +208,7 @@ public int treeDestroy(BlockEvent.BreakEvent event) {
if (!ConfigHandler.decayLeaves) {

for (BlockPos blockPos : leaves) {
if (event.getWorld().getBlockState(blockPos).getPropertyNames().toString().contains("variant") && event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant") != null)
if (event.getWorld().getBlockState(blockPos).getPropertyKeys().toString().contains("variant") && event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant") != null)
leafVariant = event.getWorld().getBlockState(blockPos).getValue(event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant")).toString().toUpperCase();
else
leafVariant = "notKnown";
Expand Down Expand Up @@ -245,7 +245,7 @@ public int treeDestroy(BlockEvent.BreakEvent event) {

soundMuter = 0;
for (BlockPos blockPos : leaves) {
if (event.getWorld().getBlockState(blockPos).getPropertyNames().toString().contains("variant") && event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant") != null)
if (event.getWorld().getBlockState(blockPos).getPropertyKeys().toString().contains("variant") && event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant") != null)
leafVariant = event.getWorld().getBlockState(blockPos).getValue(event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant")).toString().toUpperCase();
else
leafVariant = "notKnown";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/treechopper/core/TreeChopper.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Created by Duchy on 8/11/2016.
*/

@Mod(modid = TreeChopper.MODID, version = TreeChopper.VERSION, dependencies = "required-after:Forge@[12.18.1.2017,)", guiFactory = "treechopper.client.gui.GuiFactory")
@Mod(modid = TreeChopper.MODID, version = TreeChopper.VERSION, dependencies = "required-after:forge@[13.20.0.2200,)", guiFactory = "treechopper.client.gui.GuiFactory")

public class TreeChopper {
public static SimpleNetworkWrapper network;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/treechopper/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public void interactTree(PlayerInteractEvent event) {
StaticHandler.playerHoldShift.put(event.getEntityPlayer().getEntityId(), event.getEntityPlayer().isSneaking());

if (StaticHandler.playerPrintUnName.contains(event.getEntityPlayer().getEntityId()) && event.getSide().isServer()) { // No text formation because of forge diferences may cause error
event.getEntityPlayer().addChatMessage(new TextComponentTranslation("Block: " + event.getWorld().getBlockState(event.getPos()).getBlock().getUnlocalizedName()));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("Block: " + event.getWorld().getBlockState(event.getPos()).getBlock().getUnlocalizedName()));
if (event.getEntityPlayer().getHeldItemMainhand() != null)
event.getEntityPlayer().addChatMessage(new TextComponentTranslation("Main hand item: " + event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName()));
event.getEntityPlayer().addChatMessage(new TextComponentTranslation("-"));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("Main hand item: " + event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName()));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("-"));
}

return;
Expand Down Expand Up @@ -83,7 +83,7 @@ public void interactTree(PlayerInteractEvent event) {
if (logCount > axeDurability && !ConfigHandler.ignoreDurability) {
if (event.getSide().isClient()) {
String notEnoughDur = ChatFormatting.WHITE + "[" + ChatFormatting.GOLD + "TreeChop" + ChatFormatting.WHITE + "] Not enough durability..";
event.getEntityPlayer().addChatMessage(new TextComponentString(notEnoughDur));
event.getEntityPlayer().sendMessage(new TextComponentString(notEnoughDur));
}
ClientProxy.logCount = 0;
return;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/treechopper/proxy/ServerProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public void interactTree(PlayerInteractEvent event) {
StaticHandler.playerHoldShift.put(event.getEntityPlayer().getEntityId(), event.getEntityPlayer().isSneaking());

if (StaticHandler.playerPrintUnName.contains(event.getEntityPlayer().getEntityId()) && event.getSide().isServer()) { // No text formation because of forge diferences may cause error
event.getEntityPlayer().addChatMessage(new TextComponentTranslation("Block: " + event.getWorld().getBlockState(event.getPos()).getBlock().getUnlocalizedName()));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("Block: " + event.getWorld().getBlockState(event.getPos()).getBlock().getUnlocalizedName()));
if (event.getEntityPlayer().getHeldItemMainhand() != null)
event.getEntityPlayer().addChatMessage(new TextComponentTranslation("Main hand item: " + event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName()));
event.getEntityPlayer().addChatMessage(new TextComponentTranslation("-"));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("Main hand item: " + event.getEntityPlayer().getHeldItemMainhand().getItem().getUnlocalizedName()));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("-"));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[{
"modid": "treechopper",
"name": "Tree Chopper",
"description": "Simple mod for chop down whole tree and much more.. \n\nRecommended forge version: 1.10.2 - 12.18.3.2185",
"description": "Simple mod for chop down whole tree and much more.. \n\nRecommended forge version: 1.11.2 - 13.20.0.2228",
"version": "1.1",
"mcversion": "${version}",
"logoFile": "textures/logo.jpg",
Expand Down

0 comments on commit c0d9da2

Please sign in to comment.