From bf5e9f98b92a15c8967d4ffb4d2994e839544924 Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Mon, 9 Jun 2025 11:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E4=B8=BA1.?= =?UTF-8?q?0.6=201.=20=E4=BF=AE=E5=A4=8D=20#2=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9A=20=E8=A7=82=E5=AF=9F=E8=80=85=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=B2=A1=E6=9C=89=E5=85=B3=E9=97=AD=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=89=A9=E7=90=86=E5=AF=BC=E8=87=B4=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E7=A9=BF=E8=B6=8A=E6=96=B9=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2.更新了下开源许可协议 3.添加了些示例,例如沙子,红纱发射示例 4.更新了readme --- LICENSE.txt | 21 ++++++ ORIGINAL_LICENSE.txt | 21 ++++++ README.md | 60 +++++++++++++++++- gradle.properties | 2 +- .../blasttravelreborn/BlastTravelReborn.java | 4 ++ .../content/entity/BTREntityTypes.java | 1 - .../content/entity/CannonEntity.java | 3 + .../mixin/PlayerEntityMixin.java | 4 +- .../textures/entity/cannon/red_sand.png | Bin 0 -> 2062 bytes .../textures/entity/cannon/sand.png | Bin 0 -> 2065 bytes 10 files changed, 110 insertions(+), 6 deletions(-) create mode 100644 LICENSE.txt create mode 100644 ORIGINAL_LICENSE.txt create mode 100644 src/main/resources/assets/blasttravelreborn/textures/entity/cannon/red_sand.png create mode 100644 src/main/resources/assets/blasttravelreborn/textures/entity/cannon/sand.png diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..180c60f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 3944Realms, LeisureTimeDock + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ORIGINAL_LICENSE.txt b/ORIGINAL_LICENSE.txt new file mode 100644 index 0000000..f3eaa83 --- /dev/null +++ b/ORIGINAL_LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 FoundationGames + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 9f32977..0dd7d6b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,58 @@ -# BlastTravelReborn +# Preface -# Issue -Welcome to submit your issue \ No newline at end of file +Just like Michel Ardan, the French adventurer in Jules Verne's novel *From the Earth to the Moon*, who traveled to the moon in a projectile, this mod allows you to embark on long-distance journeys via cannon—completely safely and efficiently (do not attempt this in real life). + +## How to Do It? + +All you need is a cannon and enough gunpowder, and you can experience a journey that starts whenever you want. + +**A cannon-based travel method—efficient and safe!** + +# About the Mod + +## Mod Development Plan + +| Mod Update Plan | Status | +|----------------|--------| +| Migration to Forge 1.20.1 | ✅ Completed | +| Migration to higher versions of NeoForge | Not started, planned for July/August | +| Open API for cross-mod compatibility | Not started, planned for July/August | +| Improve and refactor the original mod's operations | Not started | + +## Mod Development Statement + +This mod is a migration and refactor of **Blast Travel** (the original mod only supported 1.19.2 Quilt) for **1.20.1**. + +- The **1.20.1 Quilt version** is based on **Abbie5's fork**, with the MODID remaining as `blasttravel`. +- The **1.20.1 Forge version** is a partial logic refactor by the author, with the MODID changed to `blasttravelreborn`. Please note the difference. + +## Q&A + +**Q1: Will there be Fabric support for future higher versions?** +**A1:** Probably not. The author is not a fan of Fabric's development workflow. However, anyone is welcome to fork the project and develop a Fabric version. That said, the author might consider using the **Architectury** framework for multi-loader support (though it would be quite a hassle). + +**Q2: Can my mod integrate with this mod?** +**A2:** Yes! The author welcomes mod integrations. If you're a mod developer interested in compatibility, feel free to submit an **ISSUE** in this repository. The author is happy to provide code-level support. + +**Q3: Will you support versions below 1.19.2?** +**A3:** No. The author will **never** backport to lower versions. However, there is a mod with similar functionality—**Cannon (Teacon2022 Example Mod)**, which supports **1.18–1.18.2** and can serve as an alternative. + +# Adding to Your Project +1. Download mod jar file,and put it under your project's 'libs/' dir, and rename it into "{modid}-{minecraft-version}-{mod_version}.jar"(for example, "blasttravelreborn-1.20.1-1.0.6-forge-all.jar") +2. Ensure your `build.gradle` has enable 'libs' flatDir repositories + ```groovy + repositories { + flatDir { + dir 'libs' + } + } + ```` +3. Add it to dependencies + ```groovy + dependencies { + implementation fg.deobf("blank:blasttravelreborn-1.20.1:1.0.6-forge-all")//for example + } + ```` +Cannon Model please install [BlockBench Plugin](https://github.com/LeisureTimeDock/JsonEM_Neo_Forge/blob/1.21/jsonem_models.js) in your BlockBench. + +And import 'entity/cannon/main.json' with this jsonem plugin. Then you can view the cannon model correctly and create its texture. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 568e1a1..ba9a632 100644 --- a/gradle.properties +++ b/gradle.properties @@ -38,7 +38,7 @@ mod_name=BlastTravel-Reborn # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=MIT # The mod version. See https://semver.org/ -mod_version=1.0.5+1.20.1-forge-fix +mod_version=1.0.6+1.20.1-forge jsonem_version=0.2.2+1.20-fabrge # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. diff --git a/src/main/java/com/leisuretimedock/blasttravelreborn/BlastTravelReborn.java b/src/main/java/com/leisuretimedock/blasttravelreborn/BlastTravelReborn.java index e94ad6f..e60a678 100644 --- a/src/main/java/com/leisuretimedock/blasttravelreborn/BlastTravelReborn.java +++ b/src/main/java/com/leisuretimedock/blasttravelreborn/BlastTravelReborn.java @@ -28,4 +28,8 @@ public class BlastTravelReborn { public static ResourceLocation id(String path) { return new ResourceLocation(MOD_ID, path); } + + public static ResourceLocation id(String mod_id, String path) { + return new ResourceLocation(mod_id, path); + } } diff --git a/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/BTREntityTypes.java b/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/BTREntityTypes.java index a8e2e3d..c7164b2 100644 --- a/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/BTREntityTypes.java +++ b/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/BTREntityTypes.java @@ -1,7 +1,6 @@ package com.leisuretimedock.blasttravelreborn.content.entity; import com.leisuretimedock.blasttravelreborn.BlastTravelReborn; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import net.minecraftforge.eventbus.api.IEventBus; diff --git a/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/CannonEntity.java b/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/CannonEntity.java index 8e301c6..fbf01df 100644 --- a/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/CannonEntity.java +++ b/src/main/java/com/leisuretimedock/blasttravelreborn/content/entity/CannonEntity.java @@ -59,6 +59,9 @@ public class CannonEntity extends Entity { public static final CannonBehavior TNT = new EntityCannonBehavior(Items.TNT, BlastTravelReborn.id("textures/entity/cannon/tnt.png"), EntityCannonBehavior::tntFactory).register(); public static final CannonBehavior ANVIL = new EntityCannonBehavior(Items.ANVIL, s -> s.is(ItemTags.ANVIL), BlastTravelReborn.id("textures/entity/cannon/anvil.png"), EntityCannonBehavior::fallingBlockFactory).register(); public static final CannonBehavior POWDER = new ConcretePowderCannonBehavior().register(); + //Register Your Mod Item with Cannon Behavior Like this + public static final CannonBehavior SAND = new EntityCannonBehavior(Items.SAND, BlastTravelReborn.id(/*your mod_id*/BlastTravelReborn.MOD_ID,/*the cannon texture path*/"textures/entity/cannon/sand.png"), EntityCannonBehavior::fallingBlockFactory).register(); + public static final CannonBehavior RED_SAND = new EntityCannonBehavior(Items.RED_SAND, BlastTravelReborn.id("textures/entity/cannon/red_sand.png"), EntityCannonBehavior::fallingBlockFactory).register(); public static final EntityDataAccessor BEHAVIOR = SynchedEntityData.defineId(CannonEntity.class, EntityDataSerializers.INT); public static final EntityDataAccessor CHAINED = SynchedEntityData.defineId(CannonEntity.class, EntityDataSerializers.BOOLEAN); diff --git a/src/main/java/com/leisuretimedock/blasttravelreborn/mixin/PlayerEntityMixin.java b/src/main/java/com/leisuretimedock/blasttravelreborn/mixin/PlayerEntityMixin.java index bdb246a..01cec89 100644 --- a/src/main/java/com/leisuretimedock/blasttravelreborn/mixin/PlayerEntityMixin.java +++ b/src/main/java/com/leisuretimedock/blasttravelreborn/mixin/PlayerEntityMixin.java @@ -33,6 +33,8 @@ public abstract class PlayerEntityMixin extends LivingEntity implements PlayerEn @Shadow public abstract Abilities getAbilities(); + @Shadow public abstract boolean isSpectator(); + @Unique private static final EntityDimensions CANNON_FLIGHT_DIMENSIONS = EntityDimensions.scalable(0.6f, 0.6f); @Unique @@ -89,7 +91,7 @@ public abstract class PlayerEntityMixin extends LivingEntity implements PlayerEn this.blasttravel$ticksFlying++; } else { this.blasttravel$ticksFlying = 0; - this.noPhysics = false; + if(!self.isSpectator()) this.noPhysics = false; } if (!self.isLocalPlayer()) { diff --git a/src/main/resources/assets/blasttravelreborn/textures/entity/cannon/red_sand.png b/src/main/resources/assets/blasttravelreborn/textures/entity/cannon/red_sand.png new file mode 100644 index 0000000000000000000000000000000000000000..008e8c240e2a95ca0b275b9b42830102c407882e GIT binary patch literal 2062 zcmV+p2=VucP)Px+$Vo&&RCt`tTTN^mMHK$LUE8(2n;*Q*PaBd35v45!A|T?DLph?VH>7YWptc8Y z98gcF5>lmJxN$0|;?fhB9zfiCsE`l{<)rKF z_PZpW`PMt{&71e$ycx%)Up?tGn@s?Kq9`Cxloq^zla2M*+}v3Q4A$1}$IxS3 zy!g3OtJS6bi9}r3?)RD7w{OM(Kvk3&6y*q-O$S5~`%s`LF|K`ILF41I$mQ09$`lCY zvIziaG-|GPRZRc@c6WE%p5eLtbE0R|M&l*@z*+!WGfxyWC@e2ucHAvTeb06xp-aD) z=PoZ_b`ps=RGHbcAWL8nU}ve*jEbHWJ;QQIKd}f^wAOjJmj;l{4k4H8D2osa3+Eh7 z(~->%dGdX*y!W0&53J?j;f7UdeYMT{4op$H!wr#g@gG3O*B}xDnfmp#qCqjG!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Zw^JDoU4x(rQULj62lf?P)LW7%mnUjp10%U8w+c3y0 sh$uR83V>wo^6Q@GcM5~Nf{2s+9~6fhm_cA>Hvj+t07*qoM6N<$f-Kh6i~s-t literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/blasttravelreborn/textures/entity/cannon/sand.png b/src/main/resources/assets/blasttravelreborn/textures/entity/cannon/sand.png new file mode 100644 index 0000000000000000000000000000000000000000..8b715049d44df4048b00670cf317ea02664d145c GIT binary patch literal 2065 zcmV+s2=4cZP)Px+%Sl8*RCt`tThDJ3M-=|NT|2CIosfEyI3Wa5H4RYOraz)ya^PAaq#i1z7g`B8 z^wvYgsY0rR#HIfLs!%VSdf`&_&H+`bsM;K$5K=WjQ?QL)gT3nwwwvuCp2_TZX1%-q zk^L^VXTRN@_vX!eZ{Ca(bBB+*J3Bi707X$ipePCYeP_p|Z4V!9CKeV>x?r%eaVLR3 z0svG+NkCCv!Oo5gqKI86P?QAMzN?_Asd*F%n_*=N zg=)110BE%uo_1AD0RXnQw>$3Px%_>id(>9zKl+2U0JKM*C}>z%T|Mu5TMh&s?Nllw zeJ;;kT|MunQc0*Xvu8o3z%am$QnwKm-7C6><&x{fB2>{_=i!|iKsGyyLZPcHLM$zv zat$McYN>CsF{jl#L zY!EPv3@oeWnHD0e2#ZKVS}s>3zc4DY*-=U>%>x z#G}rAf=CJ&bP~j)7ZdLWIt5H~(glF=@kuGUQYi}CNow3}w0ecEn;m^1@3gF1q-RQf z0Q(|dDY|ZUI3oCrl!zM!tZ-~!$nzdO`p5I0Fc2!BQYoTT@@m@8GKk=srulY03T(Rs zT{mG_H5f()M~)owTqg-rRCFjnBs~AyFfvrztnlfyH)nSor-K_Nf)FlI0=Njo3LZHT z;v0Bj*>=;M?07L58OL!veDa&;qMhLdO@#^k1nkA%^qd5B%kAs+CerDoN1!I z)BNsDcT-6^1puICcbbtO$U|B4(=@H4k`pIBo#!hnXIyYKJCb(?S^w+0NnglnSeDMl zg-;d0Z+C@7x1}yWI&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