This repository has been archived by the owner on Aug 21, 2021. It is now read-only.
-
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
Showing
6 changed files
with
133 additions
and
7 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/cf/warriorcrystal/other/phobos/EventStage.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,22 @@ | ||
package cf.warriorcrystal.other.phobos; | ||
|
||
import net.minecraftforge.fml.common.eventhandler.Event; | ||
|
||
public class EventStage extends Event { | ||
private int stage; | ||
|
||
public EventStage() { | ||
} | ||
|
||
public EventStage(int stage) { | ||
this.stage = stage; | ||
} | ||
|
||
public int getStage() { | ||
return this.stage; | ||
} | ||
|
||
public void setStage(int stage) { | ||
this.stage = stage; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/cf/warriorcrystal/other/phobos/UpdateWalkingPlayerEvent.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,12 @@ | ||
package cf.warriorcrystal.other.phobos; | ||
|
||
import cf.warriorcrystal.other.phobos.EventStage; | ||
import net.minecraftforge.fml.common.eventhandler.Cancelable; | ||
|
||
@Cancelable | ||
public class UpdateWalkingPlayerEvent | ||
extends EventStage { | ||
public UpdateWalkingPlayerEvent(int stage) { | ||
super(stage); | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
src/main/java/me/travis/wurstplus/wurstplustwo/hacks/dev/GodMode.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,89 @@ | ||
package me.travis.wurstplus.wurstplustwo.hacks.dev; | ||
|
||
import me.travis.wurstplus.wurstplustwo.hacks.WurstplusCategory; | ||
import me.travis.wurstplus.wurstplustwo.hacks.WurstplusHack; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.network.Packet; | ||
import net.minecraft.network.play.client.CPacketEntityAction; | ||
import net.minecraft.network.play.client.CPacketInput; | ||
import net.minecraft.network.play.client.CPacketPlayer; | ||
import net.minecraft.network.play.client.CPacketVehicleMove; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import me.travis.wurstplus.Wurstplus; | ||
import me.travis.wurstplus.wurstplustwo.event.events.WurstplusEventPacket.SendPacket; | ||
import cf.warriorcrystal.other.phobos.UpdateWalkingPlayerEvent; | ||
import me.travis.wurstplus.wurstplustwo.guiscreen.settings.WurstplusSetting; | ||
// in collab with ! Beat#7777 | ||
public class GodMode extends WurstplusHack { | ||
public GodMode(){ | ||
super(WurstplusCategory.WURSTPLUS_BETA); | ||
this.name = "GodMode";// from phobos LOL A PHOBOS MODULE | ||
this.tag = "GodMode"; | ||
this.description = "modo dios activado Bv"; | ||
} | ||
public Minecraft mc = Minecraft.getMinecraft(); | ||
Entity entity; | ||
WurstplusSetting remount = create("Remount", "Remount", false); | ||
|
||
@Override | ||
public void enable() { | ||
super.enable(); | ||
if (mc.world != null && mc.player.getRidingEntity() != null) { | ||
entity = mc.player.getRidingEntity(); | ||
mc.renderGlobal.loadRenderers(); | ||
hideEntity(); | ||
mc.player.setPosition((double)mc.player.getPosition().getX(), (double)(mc.player.getPosition().getY() - 1), (double)mc.player.getPosition().getZ()); | ||
} | ||
if (mc.world != null && remount.get_value(true)) { | ||
remount.set_value(false); | ||
} | ||
} | ||
|
||
@Override | ||
public void disable() { | ||
super.disable(); | ||
if (remount.get_value(true)) { | ||
remount.set_value(false); | ||
} | ||
mc.player.dismountRidingEntity(); | ||
mc.getConnection().sendPacket((Packet)new CPacketEntityAction((Entity)mc.player, CPacketEntityAction.Action.START_SNEAKING)); | ||
mc.getConnection().sendPacket((Packet)new CPacketEntityAction((Entity)mc.player, CPacketEntityAction.Action.STOP_SNEAKING)); | ||
} | ||
|
||
@SubscribeEvent | ||
public void onPacketSend(SendPacket event) { | ||
if (event.get_packet() instanceof CPacketPlayer.Position || event.get_packet() instanceof CPacketPlayer.PositionRotation) { | ||
event.cancel(); | ||
} | ||
} | ||
|
||
private void hideEntity() { | ||
if (mc.player.getRidingEntity() != null) { | ||
mc.player.dismountRidingEntity(); | ||
mc.world.removeEntity(entity); | ||
} | ||
} | ||
|
||
private void showEntity(Entity entity2) { | ||
entity2.isDead = false; | ||
mc.world.loadedEntityList.add(entity2); | ||
mc.player.startRiding(entity2, true); | ||
} | ||
|
||
@SubscribeEvent | ||
public void onPlayerWalkingUpdate(UpdateWalkingPlayerEvent event) { | ||
if (entity == null) { | ||
return; | ||
} | ||
if (event.getStage() == 0) {// idk, the original include this | ||
if (remount.get_value(true) && Wurstplus.get_module_manager().get_module_with_tag("GodMode").is_active()) { | ||
showEntity(entity); | ||
} | ||
entity.setPositionAndRotation(Minecraft.getMinecraft().player.posX, Minecraft.getMinecraft().player.posY, Minecraft.getMinecraft().player.posZ, Minecraft.getMinecraft().player.rotationYaw, Minecraft.getMinecraft().player.rotationPitch); | ||
mc.player.connection.sendPacket((Packet)new CPacketPlayer.Rotation(mc.player.rotationYaw, mc.player.rotationPitch, true)); | ||
mc.player.connection.sendPacket((Packet)new CPacketInput(mc.player.movementInput.moveForward, mc.player.movementInput.moveStrafe, false, false)); | ||
mc.player.connection.sendPacket((Packet)new CPacketVehicleMove(entity)); | ||
} | ||
} | ||
} |
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