Skip to content

Commit

Permalink
update to 1.16.5
Browse files Browse the repository at this point in the history
  • Loading branch information
wiauxb committed May 14, 2021
1 parent 9418fdb commit a3520b2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# FastTravel
Minecraft 1.16.3 Mod adding teleporters to the game
Minecraft 1.16.5 Mod adding teleporters to the game

## Installation
You need [fabricMC](https://fabricmc.net/) and the [fabric API](https://www.curseforge.com/minecraft/mc-mods/fabric-api) in order to run the mod.
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.3
yarn_mappings=1.16.3+build.47
loader_version=0.11.1
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.9
loader_version=0.11.3

# Mod Properties
mod_version = 1
Expand All @@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1G

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.29.4+1.16
fabric_version=0.34.2+1.16
11 changes: 7 additions & 4 deletions remappedSrc/net/fast/travel/FastTravel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@


import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
import net.fabricmc.fabric.impl.biome.modification.BiomeModificationImpl;
import net.fast.travel.blocks.Teleporter;
import net.fast.travel.blocks.TeleporterEntity;
import net.fast.travel.structure.TeleporterTempleFeature;
Expand Down Expand Up @@ -63,15 +66,15 @@ V recharger la partie et utiliser un Teleporter fait crasher le jeu (Nullpointer
V lier un teleporteur dans un chunk non chargé ne sauve pas son tag
V systême de selection doit être étendu au multijoueur
V Chunk chargé par la selection doit être déchargé et la selection effacée à la déconnexion
o teleport à la position relative au teleporter
X teleport à la position relative au teleporter
V le passage end -> overworld ne teleport pas au bon endroit car le passage à l'overworld n'est pas fini lorsqu'on tp aux bonnes positions
V probleme avec les ticking entity: lié au passage nether, si le joueur n'a jamais utilisé de netherportal NullPointer exception ServerPlayerEntity.java:702 (lié à moveToWorld, ServerPlayerEntity.java:613, Entity.java:2222)
V les items disparaisses si le teleporter est dans un chunk non chargé
- joueur sort du minecart coté client mais pas coté server: -> bug général pour rideable
V joueur sort du minecart coté client mais pas coté server: -> bug général pour rideable
V minecart ne tp qu'une fois
o teleportation detectable par observer
V teleportation detectable par observer
V structure naturelles
o certaines structures sont liées, d'autres non
X certaines structures sont liées, d'autres non
- la target semble ne pas avoir de world
- n'a pas encore de suport pour la rotation
- locateStructure trouve la structure de dépard
Expand Down
15 changes: 10 additions & 5 deletions remappedSrc/net/fast/travel/blocks/Teleporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public void onSteppedOn(World world, BlockPos pos, Entity entity) {
return;
}

if(target == null || target.getWorld().getBlockState(target.getPos()).getBlock() != FastTravel.TELEPORTER) {
if (target == null || target.getWorld().getBlockState(target.getPos()).getBlock() != FastTravel.TELEPORTER) {
world.playSound(null, pos, SoundEvents.BLOCK_BEACON_DEACTIVATE, SoundCategory.BLOCKS, 1f, 1f);
world.setBlockState(pos, world.getBlockState(pos).with(LINKED, false));
return;
}
if(entity.canUsePortals() && entity_ext.canUseTeleporter()) {
if (entity.canUsePortals() && entity_ext.canUseTeleporter() && !entity.hasVehicle() && !entity.hasPassengers()) {

BlockPos dest = target.getPos();
World targetWorld = target.getWorld();
Expand All @@ -77,24 +77,29 @@ public void onSteppedOn(World world, BlockPos pos, Entity entity) {
EntityExt teleportedEntity = entity_ext;
if (targetWorld instanceof ServerWorld) {
float y_offset = getYOffset(targetWorld.getBlockState(dest));
if (entity instanceof ServerPlayerEntity){
if (entity instanceof ServerPlayerEntity) {
((ServerPlayerEntity) entity).teleport((ServerWorld) targetWorld,
dest.getX() + .5f, dest.getY() + y_offset, dest.getZ() + .5f, entity.yaw, entity.pitch);
} else {
if(world.getRegistryKey() != targetWorld.getRegistryKey()) {
if (world.getRegistryKey() != targetWorld.getRegistryKey()) {
teleportedEntity = (EntityExt) ((EntityExt) entity).moveToTeleporter(target);
} else {
entity.teleport(dest.getX()+.5f, dest.getY()+y_offset, dest.getZ()+.5f);
entity.teleport(dest.getX() + .5f, dest.getY() + y_offset, dest.getZ() + .5f);
}
}
world.playSound(null, dest, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.BLOCKS, 1f, 1f);
}
teleportedEntity.setTeleporterCooldown();
world.setBlockState(pos, world.getBlockState(pos).with(LINKED, false));
world.setBlockState(pos, world.getBlockState(pos).with(LINKED, true));
targetWorld.setBlockState(dest, targetWorld.getBlockState(dest).with(LINKED, false));
targetWorld.setBlockState(dest, targetWorld.getBlockState(dest).with(LINKED, true));
}
}
super.onSteppedOn(world, pos, entity);
}


private float getYOffset(BlockState blockState){
return (blockState.get(TYPE) == SlabType.BOTTOM) ? .5f : 1;
}
Expand Down

0 comments on commit a3520b2

Please sign in to comment.