From 37261ee8e6f0dfa0a866eff39fd225b87bace534 Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Thu, 22 Jul 2021 14:16:00 -0700 Subject: [PATCH] Update Forge - Bump minimum required Forge version to 36.2.0 - Re-add chorus teleport event compatibility - Update Flywheel, JEI, and Shade plugin --- gradle.properties | 8 ++++---- .../weapons/PotatoCannonProjectileTypes.java | 14 ++++++-------- src/main/resources/META-INF/mods.toml | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/gradle.properties b/gradle.properties index 73f5b705b..c0804abfe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,18 +6,18 @@ org.gradle.daemon = false # mod version info mod_version = 0.3.2c minecraft_version = 1.16.5 -forge_version = 36.1.32 +forge_version = 36.2.0 # build dependency versions forgegradle_version = 4.1.+ mixingradle_version = 0.7-SNAPSHOT -shadow_version = 5.2.0 +shadow_version = 6.1.0 cursegradle_version = 1.4.0 # dependency versions registrate_version = 1.0.4 -flywheel_version = 1.16-0.1.1.24 -jei_version = 7.7.0.106 +flywheel_version = 1.16-0.1.1.26 +jei_version = 7.7.1.110 # curseforge information projectId = 328085 diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java index 1d8fb49a5..52c847bd7 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoCannonProjectileTypes.java @@ -46,6 +46,8 @@ import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.living.EntityTeleportEvent; import net.minecraftforge.registries.IRegistryDelegate; public class PotatoCannonProjectileTypes { @@ -447,14 +449,10 @@ public class PotatoCannonProjectileTypes { double teleportY = MathHelper.clamp(entityY + (livingEntity.getRandom().nextInt((int) teleportDiameter) - (int) (teleportDiameter / 2)), 0.0D, world.getHeight() - 1); double teleportZ = entityZ + (livingEntity.getRandom().nextDouble() - 0.5D) * teleportDiameter; - /* Usable as soon as lowest supported forge > 36.1.3 */ - -// EntityTeleportEvent.ChorusFruit event = ForgeEventFactory.onChorusFruitTeleport(livingEntity, teleportX, teleportY, teleportZ); -// if (event.isCanceled()) -// return; -// if (livingEntity.attemptTeleport(event.getTargetX(), event.getTargetY(), event.getTargetZ(), true)) { - - if (livingEntity.randomTeleport(teleportX, teleportY, teleportZ, true)) { + EntityTeleportEvent.ChorusFruit event = ForgeEventFactory.onChorusFruitTeleport(livingEntity, teleportX, teleportY, teleportZ); + if (event.isCanceled()) + return false; + if (livingEntity.randomTeleport(event.getTargetX(), event.getTargetY(), event.getTargetZ(), true)) { if (livingEntity.isPassenger()) livingEntity.stopRiding(); diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 123163fb6..7339a8d9c 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -18,7 +18,7 @@ Technology that empowers the player.''' [[dependencies.create]] modId="forge" mandatory=true - versionRange="[36.1.0,)" + versionRange="[36.2.0,)" ordering="NONE" side="BOTH"