Skip to content

Commit 488619d

Browse files
committed
fixes and additions
- fixed empty message of propick - fixed low hp after login + Added smart tree tap Former-commit-id: 1e2ad53
1 parent 77c955d commit 488619d

12 files changed

Lines changed: 137 additions & 7 deletions

File tree

build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
minecraft.version=1.7.10
22
forge.version=10.13.4.1566-1.7.10
33

4-
detravscanner.version=gt.9.28-0.36.1
4+
detravscanner.version=gt.9.28-0.40.0
55

66
ae2.version=rv2-beta-33
77
applecore.version=1.7.10-1.2.1+107.59407

src/main/java/com/detrav/DetravScannerMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class DetravScannerMod
2424
{
2525
public static final String MODID = "detravscannermod";
26-
public static final String VERSION = "0.35";
26+
public static final String VERSION = "0.40";
2727

2828
public static final CreativeTabs TAB_DETRAV = new DetravCreativeTab();
2929

src/main/java/com/detrav/enums/DetravToolDictNames.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ public enum DetravToolDictNames {
88
craftingToolElectricProPick,
99
craftingToolPortableCharger,
1010
craftingToolPortableAnvil,
11-
craftingToolSmartPlunger;
11+
craftingToolSmartPlunger,
12+
craftingToolSmartTreeTap;
1213
}

src/main/java/com/detrav/enums/Textures01.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class Textures01 {
1919
new Textures.ItemIcons.CustomIcon("gt.detrav.metatool.01/ELECTRIC_HV_PRO_PICK_HEAD"),
2020
new Textures.ItemIcons.CustomIcon("gt.detrav.metatool.01/PORTABE_CHARGER"),
2121
new Textures.ItemIcons.CustomIcon("gt.detrav.metatool.01/PORTABE_CHARGER_BORDER"),
22-
new Textures.ItemIcons.CustomIcon("gt.detrav.metatool.01/ANVIL_TOOL")
22+
new Textures.ItemIcons.CustomIcon("gt.detrav.metatool.01/ANVIL_TOOL"),
23+
new Textures.ItemIcons.CustomIcon("gt.detrav.metatool.01/TOOL_TREE_TAP")
2324
};
2425
}

src/main/java/com/detrav/events/DetravLevelUpEvent.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,29 @@ public void onPlayerPickupXpEvent(PlayerPickupXpEvent ev) {
2424
EntityPlayer player = ev.entityPlayer;
2525
if (player != null) {
2626
if (!player.getEntityWorld().isRemote) {
27-
if ((player.experience + ev.orb.xpValue) >= player.xpBarCap()) {
28-
UpdateHealthAttribute(player);
27+
if ((player.experience + ev.orb.xpValue*2) >= player.xpBarCap()) {
28+
UpdateHealthAttribute(player,1);
2929
}
3030
}
3131
}
3232
}
3333

3434
public static void UpdateHealthAttribute(EntityPlayer player)
35+
{
36+
UpdateHealthAttribute(player,0);
37+
}
38+
39+
public static void UpdateHealthAttribute(EntityPlayer player,int bonus)
3540
{
3641
if (!player.getEntityWorld().isRemote) {
37-
AttributeModifier mod = GetAttributeModifier(player.experienceLevel);
42+
AttributeModifier mod = GetAttributeModifier(player.experienceLevel+bonus);
3843
player.getEntityAttribute(
3944
SharedMonsterAttributes.maxHealth
4045
).removeModifier(mod);
4146
player.getEntityAttribute(
4247
SharedMonsterAttributes.maxHealth
4348
).applyModifier(mod);
49+
player.heal(player.getMaxHealth());
4450
}
4551
}
4652

src/main/java/com/detrav/items/DetravMetaGeneratedTool01.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public DetravMetaGeneratedTool01() {
3333
addTool(4, "Smart plunger 1 bucket", "", new DetravToolSmartPlunger(),new Object[] {DetravToolDictNames.craftingToolSmartPlunger},new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 5L));
3434
addTool(6, "Smart plunger 16 buckets", "", new DetravToolSmartPlunger16(),new Object[] {DetravToolDictNames.craftingToolSmartPlunger},new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 5L));
3535
addTool(8, "Smart plunger 64 buckets", "", new DetravToolSmartPlunger64(),new Object[] {DetravToolDictNames.craftingToolSmartPlunger},new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 5L));
36+
addTool(10, "Smart Tree Tap","Changes resin tap",new DetravToolSmartTreeTap(),new Object[] {DetravToolDictNames.craftingToolSmartTreeTap}, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 5L) );
3637
addTool(100, "Electric Prospector's Scanner (LV)", "", new DetravToolLVElectricProPick(), new Object[]{DetravToolDictNames.craftingToolElectricProPick, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)}, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L));
3738
addTool(102, "Electric Prospector's Scanner (MV)", "", new DetravToolMVElectricProPick(), new Object[]{DetravToolDictNames.craftingToolElectricProPick, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)}, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L));
3839
addTool(104, "Electric Prospector's Scanner (HV)", "", new DetravToolHVElectricProPick(), new Object[]{DetravToolDictNames.craftingToolElectricProPick, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)}, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L));

src/main/java/com/detrav/items/behaviours/BehaviourDetravToolProPick.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ protected void processOreProspecting(DetravMetaGeneratedTool01 aItem, ItemStack
181181
addChatMassageByValue(aPlayer,total,"Total");
182182
if (!aPlayer.capabilities.isCreativeMode)
183183
aItem.doDamage(aStack, this.mCosts);
184+
if(total==0)
185+
{
186+
addChatMassageByValue(aPlayer,0,null);
187+
}
184188
return;
185189
}
186190
addChatMassageByValue(aPlayer,0,null);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.detrav.items.behaviours;
2+
3+
import com.detrav.items.DetravMetaGeneratedTool01;
4+
import gregtech.api.items.GT_MetaBase_Item;
5+
import gregtech.common.items.behaviors.Behaviour_None;
6+
import ic2.core.block.BlockRubWood;
7+
import net.minecraft.block.Block;
8+
import net.minecraft.entity.player.EntityPlayer;
9+
import net.minecraft.item.ItemStack;
10+
import net.minecraft.world.World;
11+
12+
/**
13+
* Created by Detrav on 01.04.2017.
14+
*/
15+
public class BehaviourDetravToolTreeTap extends Behaviour_None {
16+
17+
public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
18+
if (aWorld.isRemote) {
19+
return false;
20+
}
21+
Block b = aWorld.getBlock(aX,aY,aZ);
22+
if(b instanceof BlockRubWood)
23+
{
24+
int startPos = aY;
25+
for(int i = aY; i> aY-10 && i> 1 && aWorld.getBlock(aX,i,aZ) instanceof BlockRubWood; i--)
26+
startPos = i;
27+
28+
for(int i = startPos; i< aY + 10; i++)
29+
{
30+
if(!(aWorld.getBlock(aX,i,aZ) instanceof BlockRubWood))
31+
break;
32+
if(i == aY)
33+
{
34+
aWorld.setBlockMetadataWithNotify(aX,i,aZ,aSide,2);
35+
}
36+
else
37+
{
38+
aWorld.setBlockMetadataWithNotify(aX,i,aZ,1,2);
39+
}
40+
}
41+
42+
((DetravMetaGeneratedTool01)aItem).doDamage(aStack, 100);
43+
return true;
44+
}
45+
return false;
46+
}
47+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.detrav.items.tools;
2+
3+
import com.detrav.enums.Textures01;
4+
import com.detrav.items.behaviours.BehaviourDetravToolTreeTap;
5+
import gregtech.api.GregTech_API;
6+
import gregtech.api.interfaces.IIconContainer;
7+
import gregtech.api.items.GT_MetaGenerated_Tool;
8+
import gregtech.common.tools.GT_Tool;
9+
import net.minecraft.block.Block;
10+
import net.minecraft.entity.EntityLivingBase;
11+
import net.minecraft.item.ItemStack;
12+
import net.minecraft.util.ChatComponentText;
13+
import net.minecraft.util.EnumChatFormatting;
14+
import net.minecraft.util.IChatComponent;
15+
16+
/**
17+
* Created by Detrav on 01.04.2017.
18+
*/
19+
public class DetravToolSmartTreeTap extends GT_Tool {
20+
public float getBaseDamage() {
21+
return 1.25F;
22+
}
23+
24+
public float getMaxDurabilityMultiplier() {
25+
return 0.5F;
26+
}
27+
28+
public String getCraftingSound() {
29+
return (String) GregTech_API.sSoundList.get(Integer.valueOf(101));
30+
}
31+
32+
public String getEntityHitSound() {
33+
return (String) GregTech_API.sSoundList.get(Integer.valueOf(101));
34+
}
35+
36+
public String getBreakingSound() {
37+
return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
38+
}
39+
40+
public String getMiningSound() {
41+
return (String) GregTech_API.sSoundList.get(Integer.valueOf(101));
42+
}
43+
44+
public boolean isMinableBlock(Block aBlock, byte aMetaData) {
45+
return false;
46+
}
47+
48+
public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
49+
return aIsToolHead ? Textures01.mTextures[7] : null;
50+
}
51+
52+
public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
53+
return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa;
54+
}
55+
56+
public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {
57+
aItem.addItemBehavior(aID, new BehaviourDetravToolTreeTap());
58+
}
59+
60+
public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
61+
return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was sucked through a hole while fighting " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
62+
}
63+
}

src/main/java/com/detrav/proxies/CommonProxy.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import gregtech.api.enums.*;
2020
import gregtech.api.util.GT_ModHandler;
2121
import gregtech.api.util.GT_OreDictUnificator;
22+
import ic2.api.item.IC2Items;
23+
import ic2.core.Ic2Items;
2224
import net.minecraft.entity.player.EntityPlayer;
2325
import net.minecraft.init.Blocks;
2426
import net.minecraft.init.Items;
@@ -60,6 +62,11 @@ public void onPostLoad() {
6062

6163
GT_ModHandler.addShapelessCraftingRecipe(DetravItemList.DetravAdvancedMiner2.get(1L, new Object[0]),new Object[]{ItemList.AdvancedMiner2});
6264

65+
//Treetap recipes
66+
67+
GT_ModHandler.addShapelessCraftingRecipe(DetravMetaGeneratedTool01.INSTANCE.getToolWithStats(10,1, Materials.Wood,Materials.Wood, null ),
68+
new Object[]{Ic2Items.treetap,Ic2Items.rubberWood,Ic2Items.resin});
69+
6370
//DetravCraftingEventHandler.register();
6471
DetravEntityDropEvent.register();
6572
DetravLevelUpEvent.register();

0 commit comments

Comments
 (0)