Skip to content
This repository was archived by the owner on Jan 3, 2020. It is now read-only.

Commit 10f402f

Browse files
committed
license added
1 parent 092bf79 commit 10f402f

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

src/main/java/org/devinprogress/autoharvest/AutoHarvest.java

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
import cpw.mods.fml.common.gameevent.TickEvent;
1111
import cpw.mods.fml.relauncher.Side;
1212
import net.minecraft.block.*;
13-
import net.minecraft.block.material.Material;
1413
import net.minecraft.client.Minecraft;
15-
import net.minecraft.client.multiplayer.PlayerControllerMP;
1614
import net.minecraft.client.settings.KeyBinding;
1715
import net.minecraft.entity.player.EntityPlayer;
1816
import net.minecraft.init.Items;
@@ -27,7 +25,32 @@
2725
import java.util.*;
2826

2927
/**
30-
* Created by recursiveg on 14-9-28.
28+
* Auto Harvest Mod
29+
* This Mod can help you harvest crops automatically.
30+
* It can also help you clear the ground.
31+
* Works for both SSP & SMP
32+
* This Mod is published under GPLv3
33+
* Use it *AT YOUR OWN RISK*
34+
* RecursiveG
35+
* 2014 Sept. 29th
36+
*
37+
*
38+
*
39+
* Auto Harvest Mod
40+
* Copyright (C) 2014 RecursiveG
41+
*
42+
* This program is free software: you can redistribute it and/or modify
43+
* it under the terms of the GNU General Public License as published by
44+
* the Free Software Foundation, either version 3 of the License, or
45+
* (at your option) any later version.
46+
*
47+
* This program is distributed in the hope that it will be useful,
48+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
49+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+
* GNU General Public License for more details.
51+
*
52+
* You should have received a copy of the GNU General Public License
53+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
3154
*/
3255

3356
@Mod(modid="autoharvest", name="Auto Harvest Mod", version="0.1-dev")
@@ -53,7 +76,7 @@ public class AutoHarvest {
5376
put(BlockPotato.class,Items.potato);
5477
put(BlockNetherWart.class,Items.nether_wart);
5578
}};
56-
private static final Map<Class<?>,Integer> cropMatureData=new HashMap<Class<?>, Integer>(){{
79+
static final Map<Class<?>,Integer> cropMatureData=new HashMap<Class<?>, Integer>(){{
5780
put(BlockCrops.class,7);
5881
put(BlockCarrot.class,7);
5982
put(BlockPotato.class,7);
@@ -62,6 +85,7 @@ public class AutoHarvest {
6285

6386

6487
@Mod.EventHandler
88+
@SuppressWarnings("unused")
6589
public void load(FMLInitializationEvent event) {
6690
ClientRegistry.registerKeyBinding(toggleKey);
6791
MinecraftForge.EVENT_BUS.register(this);
@@ -71,7 +95,9 @@ public void load(FMLInitializationEvent event) {
7195
private void sendPlayerPrivateMsg(String str){
7296
FMLClientHandler.instance().getClient().thePlayer.addChatMessage(new ChatComponentText(str));
7397
}
98+
7499
@SubscribeEvent
100+
@SuppressWarnings("unused")
75101
public void onToggle(InputEvent.KeyInputEvent e){
76102
if(toggleKey.isPressed()){
77103
if(!enabled){
@@ -109,7 +135,7 @@ private void doClearGrass(EntityPlayer p){
109135
for(int deltaX=-2;deltaX<=2;++deltaX)
110136
for(int deltaZ=-2;deltaZ<=2;++deltaZ)
111137
if(canClearGrass(w,X + deltaX, Y+deltaY, Z + deltaZ)){
112-
mc.playerController.onPlayerDamageBlock(X + deltaX, Y+deltaY, Z + deltaZ, 1);
138+
mc.playerController.onPlayerDamageBlock(X + deltaX, Y + deltaY, Z + deltaZ, 1);
113139
return;
114140
}
115141
}
@@ -137,8 +163,8 @@ private void doPlant(EntityPlayer p){
137163
for(int deltaZ=-harvestRange;deltaZ<=harvestRange;++deltaZ){
138164
if(canPlantOn(w, p,X + deltaX, Y, Z + deltaZ)) {
139165
ItemStack seed=mc.thePlayer.inventory.getCurrentItem();
140-
mc.playerController.onPlayerRightClick(p,w,seed,X + deltaX, Y, Z + deltaZ,1,
141-
Vec3.createVectorHelper(X + deltaX+0.5, Y+1, Z + deltaZ+0.5));
166+
mc.playerController.onPlayerRightClick(p, w, seed, X + deltaX, Y, Z + deltaZ, 1,
167+
Vec3.createVectorHelper(X + deltaX + 0.5, Y + 1, Z + deltaZ + 0.5));
142168
return;
143169
}
144170
}

0 commit comments

Comments
 (0)