generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from AV306/FastBreak-DEV
not fastbreak anymore
- Loading branch information
Showing
28 changed files
with
295 additions
and
117 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
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
16 changes: 16 additions & 0 deletions
16
src/main/java/me/av306/xenon/config/feature/ProximityRadarGroup.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,16 @@ | ||
package me.av306.xenon.config.feature; | ||
|
||
import me.av306.xenon.config.XenonConfigGroup; | ||
import me.lortseam.completeconfig.api.ConfigEntries; | ||
import me.lortseam.completeconfig.api.ConfigEntry; | ||
|
||
@ConfigEntries | ||
public class ProximityRadarGroup implements XenonConfigGroup | ||
{ | ||
@ConfigEntry.BoundedInteger( min = 1, max = 100 ) | ||
public static int range = 3; | ||
|
||
@ConfigEntry.BoundedInteger( min = 1, max = 100 ) | ||
@ConfigEntry.Slider | ||
public static int interval = 5; | ||
} |
11 changes: 5 additions & 6 deletions
11
...erTickCounterBeginRenderTickCallback.java → ...306/xenon/event/BeginRenderTickEvent.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
10 changes: 5 additions & 5 deletions
10
...t/callback/ChatHudAddMessageCallback.java → ...6/xenon/event/ChatHudAddMessageEvent.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
11 changes: 5 additions & 6 deletions
11
...n/event/callback/KeyboardKeyCallback.java → ...n/java/me/av306/xenon/event/KeyEvent.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
27 changes: 27 additions & 0 deletions
27
src/main/java/me/av306/xenon/event/PlayerDamageBlockEvent.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,27 @@ | ||
package me.av306.xenon.event; | ||
|
||
import net.fabricmc.fabric.api.event.Event; | ||
import net.fabricmc.fabric.api.event.EventFactory; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
|
||
public interface PlayerDamageBlockEvent | ||
{ | ||
Event<PlayerDamageBlockEvent> EVENT = EventFactory.createArrayBacked( | ||
PlayerDamageBlockEvent.class, | ||
(listeners) -> (pos, direction) -> | ||
{ | ||
for ( PlayerDamageBlockEvent listener : listeners ) | ||
{ | ||
ActionResult result = listener.interact( pos, direction ); | ||
|
||
if ( result != ActionResult.PASS ) return result; | ||
} | ||
|
||
return ActionResult.PASS; | ||
} | ||
); | ||
|
||
ActionResult interact( BlockPos pos, Direction direction ); | ||
} |
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
41 changes: 41 additions & 0 deletions
41
src/main/java/me/av306/xenon/event/RenderInGameHudEvent.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,41 @@ | ||
package me.av306.xenon.event; | ||
|
||
import net.fabricmc.fabric.api.event.Event; | ||
import net.fabricmc.fabric.api.event.EventFactory; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.util.ActionResult; | ||
|
||
public interface RenderInGameHudEvent | ||
{ | ||
Event<RenderInGameHudEvent> HEAD = EventFactory.createArrayBacked( | ||
RenderInGameHudEvent.class, | ||
(listeners) -> (matrices, tickDelta) -> | ||
{ | ||
for ( RenderInGameHudEvent listener : listeners ) | ||
{ | ||
ActionResult result = listener.interact( matrices, tickDelta ); | ||
|
||
if ( result != ActionResult.PASS ) return result; | ||
} | ||
|
||
return ActionResult.PASS; | ||
} | ||
); | ||
|
||
Event<RenderInGameHudEvent> AFTER_VIGNETTE = EventFactory.createArrayBacked( | ||
RenderInGameHudEvent.class, | ||
(listeners) -> (matrices, tickDelta) -> | ||
{ | ||
for ( RenderInGameHudEvent listener : listeners ) | ||
{ | ||
ActionResult result = listener.interact( matrices, tickDelta ); | ||
|
||
if ( result != ActionResult.PASS ) return result; | ||
} | ||
|
||
return ActionResult.PASS; | ||
} | ||
); | ||
|
||
ActionResult interact( MatrixStack matrices, float tickDelta ); | ||
} |
26 changes: 0 additions & 26 deletions
26
src/main/java/me/av306/xenon/event/callback/InGameHudRenderCallback.java
This file was deleted.
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
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
45 changes: 45 additions & 0 deletions
45
src/main/java/me/av306/xenon/features/FastBreakFeature.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,45 @@ | ||
package me.av306.xenon.features; | ||
|
||
import me.av306.xenon.Xenon; | ||
import me.av306.xenon.feature.IToggleableFeature; | ||
import me.av306.xenon.mixin.ClientPlayerInteractionManagerAccessor; | ||
import net.minecraft.client.network.ClientPlayerInteractionManager; | ||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
|
||
// FIXME: too complex, won;t work | ||
public class FastBreakFeature extends IToggleableFeature | ||
{ | ||
protected FastBreakFeature() | ||
{ | ||
super( "FastBreak" ); | ||
} | ||
|
||
private ActionResult onUpdateBlockBreakingProgress( BlockPos pos, Direction dir ) | ||
{ | ||
// TODO: Add CPIM onDamageBlock event, hook to that, and set the cooldown to 0 and send the following packer | ||
ClientPlayerInteractionManager im = Xenon.INSTANCE.client.interactionManager; | ||
|
||
if( ((ClientPlayerInteractionManagerAccessor) im).getCurrentBreakingProgress() >= 1 ) | ||
return ActionResult.PASS; | ||
|
||
PlayerActionC2SPacket.Action action = PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK; | ||
BlockPos blockPos = pos; | ||
Direction direction = dir; | ||
//im.sendPlayerActionC2SPacket(action, blockPos, direction); | ||
return ActionResult.PASS; | ||
} | ||
|
||
@Override | ||
protected void onEnable() | ||
{ | ||
} | ||
|
||
@Override | ||
protected void onDisable() | ||
{ | ||
|
||
} | ||
} |
Oops, something went wrong.