-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45558fb
commit f2c6ce6
Showing
74 changed files
with
4,054 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/com/greencat/antimony/common/function/AuctionTracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.greencat.antimony.common.function; | ||
|
||
import com.greencat.antimony.core.FunctionManager.FunctionManager; | ||
import com.greencat.antimony.core.auctionTracker.AuctionItem; | ||
import com.greencat.antimony.core.config.getConfigByFunctionName; | ||
import com.greencat.antimony.core.event.CustomEventHandler; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.event.ClickEvent; | ||
import net.minecraft.util.*; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
|
||
import java.util.UUID; | ||
|
||
public class AuctionTracker { | ||
public AuctionTracker() { | ||
MinecraftForge.EVENT_BUS.register(this); | ||
CustomEventHandler.EVENT_BUS.register(this); | ||
} | ||
@SubscribeEvent | ||
public void onTick(TickEvent.ClientTickEvent event){ | ||
if(FunctionManager.getStatus("AuctionTracker")){ | ||
if(com.greencat.antimony.core.auctionTracker.AuctionTracker.finish && System.currentTimeMillis() - com.greencat.antimony.core.auctionTracker.AuctionTracker.lastGet > ((Integer) getConfigByFunctionName.get("AuctionTracker","cooldown") * 1000)){ | ||
com.greencat.antimony.core.auctionTracker.AuctionTracker.getAuctions(); | ||
} | ||
if (com.greencat.antimony.core.auctionTracker.AuctionTracker.finish && !com.greencat.antimony.core.auctionTracker.AuctionTracker.auctions.isEmpty()) { | ||
new Thread(() -> { | ||
for(AuctionItem item : com.greencat.antimony.core.auctionTracker.AuctionTracker.auctions){ | ||
if(Minecraft.getMinecraft().thePlayer != null){ | ||
ChatComponentText text = new ChatComponentText(EnumChatFormatting.GOLD + "Item: " + item.item_name + EnumChatFormatting.GOLD + " | Coins: " + item.item_name); | ||
ChatStyle style = text.getChatStyle(); | ||
String uuid = item.uuid.substring(0,8) + "-" + item.uuid.substring(8,12) + "-" + item.uuid.substring(12,16) + "-" + item.uuid.substring(16,20) + "-" + item.uuid.substring(20,32); | ||
style.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,"/viewauction " + uuid)); | ||
Minecraft.getMinecraft().thePlayer.addChatMessage(text); | ||
} | ||
} | ||
com.greencat.antimony.core.auctionTracker.AuctionTracker.auctions.clear(); | ||
}); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/com/greencat/antimony/common/function/AutoWeapon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.greencat.antimony.common.function; | ||
|
||
import com.greencat.antimony.core.FunctionManager.FunctionManager; | ||
import com.greencat.antimony.core.config.getConfigByFunctionName; | ||
import com.greencat.antimony.core.event.CustomEventHandler; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.ItemSword; | ||
import net.minecraft.network.play.client.C02PacketUseEntity; | ||
import net.minecraft.network.play.client.C09PacketHeldItemChange; | ||
import net.minecraft.util.BlockPos; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
|
||
public class AutoWeapon { | ||
public static boolean isEnable = false; | ||
public static long latest; | ||
public AutoWeapon(){ | ||
MinecraftForge.EVENT_BUS.register(this); | ||
CustomEventHandler.EVENT_BUS.register(this); | ||
} | ||
@SubscribeEvent | ||
public void onTick(TickEvent.ClientTickEvent event){ | ||
if(FunctionManager.getStatus("AutoWeapon")){ | ||
isEnable = true; | ||
} else { | ||
isEnable = false; | ||
} | ||
} | ||
@SubscribeEvent | ||
public void onPacketSent(CustomEventHandler.PacketSentEvent event){ | ||
if (isEnable && event.packet instanceof C02PacketUseEntity && ((C02PacketUseEntity) event.packet).getAction() == C02PacketUseEntity.Action.ATTACK){ | ||
Switch(); | ||
} | ||
} | ||
public static void Switch(){ | ||
try { | ||
if (System.currentTimeMillis() - latest >= 0) { | ||
latest = System.currentTimeMillis(); | ||
ItemStack hand = Minecraft.getMinecraft().thePlayer.getHeldItem(); | ||
if (hand == null || !(hand.getItem() instanceof ItemSword)) { | ||
for (int i = 0; i < 8; ++i) { | ||
ItemStack stack = Minecraft.getMinecraft().thePlayer.inventory.mainInventory[i]; | ||
if (stack != null && stack.getItem() instanceof ItemSword) { | ||
Minecraft.getMinecraft().getNetHandler().getNetworkManager().sendPacket(new C09PacketHeldItemChange(i)); | ||
Minecraft.getMinecraft().thePlayer.inventory.currentItem = i; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} catch(Exception e){ | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/main/java/com/greencat/antimony/common/function/AutoWolfSlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/com/greencat/antimony/common/function/BHop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.greencat.antimony.common.function; | ||
|
||
import com.greencat.antimony.core.FunctionManager.FunctionManager; | ||
import com.greencat.antimony.core.config.getConfigByFunctionName; | ||
import com.greencat.antimony.core.event.CustomEventHandler; | ||
import com.greencat.antimony.utils.Utils; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
|
||
public class BHop { | ||
public static boolean isEnable = false; | ||
public static boolean useStrafe = false; | ||
public BHop() { | ||
MinecraftForge.EVENT_BUS.register(this); | ||
CustomEventHandler.EVENT_BUS.register(this); | ||
} | ||
@SubscribeEvent | ||
public void onTick(TickEvent.ClientTickEvent event){ | ||
if(FunctionManager.getStatus("BHop")){ | ||
isEnable = true; | ||
useStrafe = (Boolean) getConfigByFunctionName.get("BHop","strafe"); | ||
} else { | ||
isEnable = false; | ||
} | ||
} | ||
@SubscribeEvent | ||
public void onMotionPre(CustomEventHandler.MotionChangeEvent.Pre event){ | ||
if(isEnable && !Minecraft.getMinecraft().thePlayer.isInWater() && !Minecraft.getMinecraft().thePlayer.isInLava()){ | ||
if(Utils.isMoving()){ | ||
if(Minecraft.getMinecraft().thePlayer.onGround){ | ||
Minecraft.getMinecraft().thePlayer.jump(); | ||
if (useStrafe) { | ||
Utils.strafe(); | ||
} | ||
} | ||
} else if(useStrafe){ | ||
Minecraft.getMinecraft().thePlayer.motionX = 0.0F; | ||
Minecraft.getMinecraft().thePlayer.motionZ = 0.0F; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.