更新版本为1.0.6

1. 修复 #2 的问题:
观察者模式没有关闭玩家实体物理导致无法穿越方块

2.更新了下开源许可协议

3.添加了些示例,例如沙子,红纱发射示例

4.更新了readme
This commit is contained in:
叁玖领域 2025-06-09 11:38:51 +08:00
parent 6f412fcb35
commit bf5e9f98b9
10 changed files with 110 additions and 6 deletions

21
LICENSE.txt Normal file
View File

@ -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.

21
ORIGINAL_LICENSE.txt Normal file
View File

@ -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.

View File

@ -1,4 +1,58 @@
# BlastTravelReborn
# Preface
# Issue
Welcome to submit your issue
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.181.18.2** and can serve as an alternative.
# Adding to Your Project
1. Download mod jar fileand 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.

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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<Integer> BEHAVIOR = SynchedEntityData.defineId(CannonEntity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Boolean> CHAINED = SynchedEntityData.defineId(CannonEntity.class, EntityDataSerializers.BOOLEAN);

View File

@ -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()) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB