The Teleportation Restrictor now blocks Portal Teleportation
This commit is contained in:
parent
56d88ebcb2
commit
61732c4cd6
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**1.0.17**
|
||||
* The Teleportation Restrictor now blocks Portal Teleportation
|
||||
|
||||
**1.0.16**
|
||||
* Register Loot Function
|
||||
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.7.10+build.191
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.16
|
||||
mod_version = 1.0.17
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = reliccraft
|
||||
|
||||
|
@ -7,6 +7,7 @@ import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Mixin(Entity.class)
|
||||
@ -26,6 +27,13 @@ public class MixinEntity implements TeleportationRestrictorBlock.TeleportingEnti
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "canUsePortals", cancellable = true)
|
||||
public void canUsePortals(CallbackInfoReturnable<Boolean> info) {
|
||||
if (cannotTeleport()) {
|
||||
info.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cannotTeleport() {
|
||||
return teleportCooldown > 0;
|
||||
|
Reference in New Issue
Block a user