Compare commits

...

35 Commits

Author SHA1 Message Date
ca8ef90c1e Update to 1.21.8 2025-07-20 23:17:22 +02:00
70822899fa Update to 1.21.5 2025-04-16 20:08:55 +02:00
5c5b307664 Update 2024-12-23 08:48:41 +01:00
f3d06b275a Update to 1.21.4 2024-12-05 14:22:38 +01:00
e78966f133 Update 2024-11-01 23:28:44 +01:00
419a5ab607 Fix update stuff
Some checks failed
build / build (17, ubuntu-22.04) (push) Failing after 1m58s
build / build (17, windows-2022) (push) Has been cancelled
2024-08-18 11:50:01 +02:00
da2d60bf72 Update Fabric API
Some checks failed
build / build (17, ubuntu-22.04) (push) Failing after 4m9s
build / build (17, windows-2022) (push) Has been cancelled
2024-08-14 18:34:53 +02:00
0aa33920ab Update Fabric API
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-06-28 22:09:10 +02:00
15334b7221 Fix fabric API
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
Update polymer
2024-06-18 16:05:26 +02:00
1da82f241b Update polymer
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-06-14 15:40:13 +02:00
f3d3cfb6ee Bump server translations
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-06-14 15:08:42 +02:00
9d4a291086 Bump server translations
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-06-14 15:01:46 +02:00
38f4464789 Bump server translations
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-06-14 14:39:28 +02:00
719702cb6d Update to 1.21
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-06-14 14:37:18 +02:00
24a61bcd23 Change icon
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-05-25 14:22:35 +02:00
23bb09f795 Fix texture
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-05-25 14:14:50 +02:00
0c372eaa8c Add texture from YeahAkis_
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-05-25 14:06:28 +02:00
706cb823e7 Bump versions
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-05-24 07:57:36 +02:00
5e7ff98f05 Bump versions
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-05-24 07:55:45 +02:00
caf573fc55 bump java
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-05-24 07:51:41 +02:00
d59a623213 Change recepie
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-05-07 20:07:41 +02:00
40887164a9 Change recepie
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-05-07 20:07:21 +02:00
e33be889a4 Merge fix from Archie Lamb 2024-05-07 20:03:17 +02:00
d018c369ae Update to 1.20.6
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-05-05 08:43:33 +02:00
791195a2a1 Change json
Some checks failed
build / build (17, ubuntu-22.04) (push) Has been cancelled
build / build (17, windows-2022) (push) Has been cancelled
2024-04-09 21:18:50 +02:00
6c2df592c5 Update
Some checks are pending
build / build (17, ubuntu-22.04) (push) Waiting to run
build / build (17, windows-2022) (push) Waiting to run
2024-04-09 21:17:17 +02:00
VenomCode
64c6f17d7f Update README.md 2023-08-18 15:18:25 -05:00
VenomCodeDev
84afee23e9 Version v1.0.9+mc1.20.1
Fixed teleport not working consistently
Updated included ServerAPI version to latest
2023-08-18 15:12:30 -05:00
VenomCodeDev
2bccfd97fd Attempt #1 at fixing requestTeleport() rejecting the request on the ServerPlayerEntity type and teleporting the player back. 2023-08-16 20:44:36 -05:00
VenomCode
20f4a65f8d updated mod_version again... 2023-06-30 19:43:04 -05:00
VenomCode
06901be171 updated mod_version in gradle.properties 2023-06-30 19:41:09 -05:00
VenomCode
fbf9a16918 Merge remote-tracking branch 'origin/1.20.1' into 1.20.1 2023-06-30 19:40:48 -05:00
VenomCode
1107ead2a7 Updated serverapi_version in gradle.properties 2023-06-30 19:40:43 -05:00
VenomCode
d1348868cd Updated serverapi_version in gradle.properties 2023-06-30 19:40:17 -05:00
VenomCode
66d797b928 Updated implementation of most things. Switched to a working config file. Fixed config changing proxy'd jumpvader block to incorrect types. Added an "ENABLE" config option. 2023-06-30 14:34:39 -05:00
32 changed files with 294 additions and 455 deletions

View File

@@ -1,40 +0,0 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build
on: [pull_request, push]
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/

View File

@@ -1,9 +1,24 @@
# Jump Vader - A Fabric Server-Side Elevator Mod
# Televator - A Fabric Server-Side Elevator Mod
based on [JumpVader](https://github.com/StimzRx/JumpVaderMod) by [StimzRx](https://github.com/StimzRx)
## What is it
I'ts a mod that lets you place "Jump Vader" blocks similar to the Quark mod's elevators.
It's a mod that lets you place "Televator" blocks similar to the Quark mod's elevators.
You simply place one above the other at any vertical distance, and jump/crouch on top of the
block to go in between the different heights.
## Crafting
![Crafting Recipe](https://github.com/VenomCodeDev/JumpVaderMod/blob/d1cd96ccd846d3249a4a7fcb298e740775ee344c/assets/JumpVaderCraftingRecipe.png?raw=true)
```
G A G
A P A
G A G
```
```A``` is amethyst shard
```G``` is glass
```P``` is an ender pearl
## Removal
**NOTE:** Removing the mods from the mods folder will delete all Televator blocks in inventories and the world permanently!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -1,7 +1,5 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'fabric-loom' version '1.11-SNAPSHOT'
}
version = project.mod_version
@@ -17,10 +15,7 @@ repositories {
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url 'https://maven.nucleoid.xyz' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
}
dependencies {
@@ -32,27 +27,31 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
include(modImplementation("eu.pb4:polymer-core:${project.polymer_version}"))
modImplementation include("eu.pb4:polymer-resource-pack:${project.polymer_version}")
modImplementation include("eu.pb4:polymer-resource-pack-extras:${project.polymer_version}")
modImplementation include("eu.pb4:polymer-autohost:${project.polymer_version}")
modImplementation include("eu.pb4:polymer-blocks:${project.polymer_version}")
include(modImplementation("xyz.nucleoid:server-translations-api:${project.server_translations_api_version}"))
shadow(implementation('org.spongepowered:configurate-hocon:4.1.2'))
}
processResources {
inputs.property "version", project.version
inputs.property "minecraft_version", project.minecraft_version
inputs.property "loader_version", project.loader_version
inputs.property "loader_version", project.loader_version
filesMatching("fabric.mod.json") {
expand "version": project.version
expand "version": project.version,
"minecraft_version": project.minecraft_version,
"fabric_version": project.fabric_version,
"loader_version": project.loader_version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}
java {
@@ -61,8 +60,8 @@ java {
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
jar {
@@ -70,29 +69,3 @@ jar {
rename { "${it}_${project.archivesBaseName}"}
}
}
shadowJar {
configurations = [project.configurations.shadow]
archiveClassifier.set("dev")
relocate "net.objecthunter", "de.siphalor.spiceoffabric.shadow.net.objecthunter"
}
remapJar {
dependsOn(shadowJar)
inputFile = tasks.shadowJar.archiveFile
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

View File

@@ -1,19 +1,19 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.2
loader_version=0.14.21
minecraft_version=1.21.8
yarn_mappings=1.21.8+build.1
loader_version=0.16.14
# Mod Properties
mod_version = 1.0.2+1.20.1
maven_group = dev.venomcode
archives_base_name = jumpvader
mod_version=1.2.5
maven_group=systems.brn.televator
archives_base_name=televator
# Dependencies
fabric_version=0.129.0+1.21.8
# Dependencies
fabric_version=0.83.1+1.20.1
polymer_version=0.5.2+1.20.1
server_translations_api_version=2.0.0+1.20
polymer_version=0.13.7+1.21.8
server_translations_api_version=2.5.1+1.21.5

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

6
gradlew vendored
View File

@@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

14
gradlew.bat vendored
View File

@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

View File

@@ -1,88 +0,0 @@
package dev.venomcode.jumpvader;
import org.spongepowered.configurate.CommentedConfigurationNode;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.hocon.HoconConfigurationLoader;
import org.spongepowered.configurate.serialize.SerializationException;
import java.io.IOException;
import java.nio.file.Path;
public class JumpVaderConfig
{
public boolean getEnabled()
{
return rootNode.node(ENABLED_TAG).getBoolean(true);
}
public int getMaxVerticalBlocks()
{
return rootNode.node(MAX_VERTICAL_BLOCKS_TAG).getInt(128);
}
public String getAlternativeBlock()
{
return rootNode.node(USE_ALTERNATIVE_BLOCK_TAG).getString("default");
}
public void setupConfig() throws SerializationException
{
rootNode.node(ENABLED_TAG).comment(ENABLED_TAG_COMMENT).set(getEnabled());
rootNode.node(MAX_VERTICAL_BLOCKS_TAG).comment(MAX_VERTICAL_BLOCKS_TAG_COMMENT).set(getMaxVerticalBlocks());
rootNode.node(USE_ALTERNATIVE_BLOCK_TAG).comment(USE_ALTERNATIVE_BLOCK_TAG_COMMENT).set(getAlternativeBlock());
save();
}
// NODE LOCATION TAGS & COMMENTS
private static final String ENABLED_TAG = "enabled";
private static final String ENABLED_TAG_COMMENT = "Toggles this entire mod on and off.";
private static final String MAX_VERTICAL_BLOCKS_TAG = "max_blocks_vertical";
private static final String MAX_VERTICAL_BLOCKS_TAG_COMMENT = "The maximum amount of vertical blocks to travel when using the jump vader block.";
private static final String USE_ALTERNATIVE_BLOCK_TAG = "use_alternative_block";
private static final String USE_ALTERNATIVE_BLOCK_TAG_COMMENT = "Block to use for clients. Allowed Values: default, stained_glass, white_wool";
public JumpVaderConfig()
{
loader = HoconConfigurationLoader.builder()
.path(Path.of("./config/" + JumpVaderMod.MODID + ".conf"))
.build();
try
{
rootNode = loader.load();
setupConfig();
}
catch (IOException ex)
{
JumpVaderMod.LOGGER.info("Error occurred loading config:" + ex.getMessage());
if(ex.getCause() != null)
{
ex.getCause().printStackTrace();
}
rootNode = null;
}
}
private boolean save()
{
try
{
loader.save(rootNode);
return true;
}
catch (final ConfigurateException ex)
{
JumpVaderMod.LOGGER.info("Unable to save config for '" + JumpVaderMod.MODID + "'! Error: " + ex.getMessage());
}
return false;
}
private CommentedConfigurationNode getRootNode()
{
return rootNode;
}
private final HoconConfigurationLoader loader;
private CommentedConfigurationNode rootNode;
}

View File

@@ -1,38 +0,0 @@
package dev.venomcode.jumpvader;
import dev.venomcode.jumpvader.blocks.JumpVaderBlock;
import eu.pb4.polymer.core.api.item.PolymerBlockItem;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Blocks;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JumpVaderMod implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final String MODID = "jumpvader";
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);
private static JumpVaderConfig config;
@Override
public void onInitialize()
{
config = new JumpVaderConfig();
Registry.register(Registries.BLOCK, new Identifier(JumpVaderMod.MODID, "jumpvader_block"), JUMP_VADER_BLOCK);
Registry.register( Registries.ITEM, new Identifier(JumpVaderMod.MODID, "jumpvader_block"), new PolymerBlockItem( JUMP_VADER_BLOCK, new FabricItemSettings(), Items.ORANGE_STAINED_GLASS ) );
}
public static JumpVaderConfig getConfig()
{
return config;
}
public static final JumpVaderBlock JUMP_VADER_BLOCK = new JumpVaderBlock(FabricBlockSettings.copyOf(Blocks.BAMBOO_PLANKS), Blocks.ORANGE_STAINED_GLASS);
}

View File

@@ -1,104 +0,0 @@
package dev.venomcode.jumpvader.blocks;
import dev.venomcode.jumpvader.JumpVaderMod;
import dev.venomcode.jumpvader.ifaces.IJumpVaderListener;
import eu.pb4.polymer.core.api.block.PolymerBlock;
import eu.pb4.polymer.core.api.block.SimplePolymerBlock;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
public class JumpVaderBlock extends SimplePolymerBlock implements IJumpVaderListener {
public JumpVaderBlock(Settings settings, Block polymerBlock) {
super(settings, polymerBlock);
}
@Override
public boolean onJump(BlockPos pos , ServerPlayerEntity player )
{
if(!JumpVaderMod.getConfig().getEnabled())
return false;
pos = pos.up();
ServerWorld w = (ServerWorld) player.getWorld();
int count = 0;
while(count < JumpVaderMod.getConfig().getMaxVerticalBlocks() && pos.getY() < 316)
{
Block blk = w.getBlockState( pos ).getBlock();
if(blk instanceof JumpVaderBlock)
{
final BlockPos tpPos = pos.up();
if(w.getBlockState( tpPos ).getBlock().equals( Blocks.AIR ) && w.getBlockState( tpPos.up() ).getBlock().equals( Blocks.AIR ))
{
player.networkHandler.requestTeleport( tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, player.getHeadYaw(), 0f );
w.playSound( null, tpPos, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 0.5f, 1.5f );
w.spawnParticles( ParticleTypes.POOF, tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, 5, 0, 0, 0, 0.25f );
return true;
}
}
pos = pos.up();
count++;
}
return false;
}
@Override
public void onCrouch( BlockPos pos , ServerPlayerEntity player )
{
if(!JumpVaderMod.getConfig().getEnabled())
return;
pos = pos.down();
ServerWorld w = (ServerWorld) player.getWorld();
int count = 0;
while(count < JumpVaderMod.getConfig().getMaxVerticalBlocks() && pos.getY() >= -64)
{
Block blk = w.getBlockState( pos ).getBlock();
if(blk instanceof JumpVaderBlock)
{
final BlockPos tpPos = pos.up();
if(w.getBlockState( tpPos ).getBlock().equals( Blocks.AIR ) && w.getBlockState( tpPos.up() ).getBlock().equals( Blocks.AIR ))
{
player.networkHandler.requestTeleport( tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, player.getHeadYaw(), 0f );
w.playSound( null, tpPos, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 0.5f, 1.5f );
w.spawnParticles( ParticleTypes.POOF, tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, 5, 0, 0, 0, 0.25f );
return;
}
}
pos = pos.down();
count++;
}
}
@Override
public Block getPolymerBlock(BlockState state)
{
return switch (JumpVaderMod.getConfig().getAlternativeBlock()) {
case "tinted_glass" -> Blocks.TINTED_GLASS;
case "white_wool" -> Blocks.WHITE_WOOL;
default -> Blocks.ORANGE_STAINED_GLASS;
};
}
private static final Identifier _identifier = new Identifier( JumpVaderMod.MODID, "jumpvader_block" );
}

View File

@@ -1,10 +0,0 @@
package dev.venomcode.jumpvader.ifaces;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
public interface IJumpVaderListener
{
boolean onJump(BlockPos pos, ServerPlayerEntity player );
void onCrouch( BlockPos pos, ServerPlayerEntity player );
}

View File

@@ -1,53 +0,0 @@
package dev.venomcode.jumpvader.mixin;
import com.mojang.authlib.GameProfile;
import dev.venomcode.jumpvader.ifaces.IJumpVaderListener;
import net.minecraft.block.Block;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.encryption.PlayerPublicKey;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
@Mixin( ServerPlayerEntity.class )
public abstract class ServerPlayerMixin extends PlayerEntity
{
@Override
public void jump( )
{
BlockPos p = this.getBlockPos().down();
Block blk = this.world.getBlockState( p ).getBlock();
if(blk instanceof IJumpVaderListener bActioner)
{
if(bActioner.onJump( p, (ServerPlayerEntity ) (Object)this ))
{
return;
}
}
super.jump( );
}
@Override
public void setSneaking( boolean sneaking )
{
super.setSneaking( sneaking );
if(sneaking)
{
BlockPos p = this.getBlockPos().down();
Block blk = this.world.getBlockState( p ).getBlock();
if(blk instanceof IJumpVaderListener bActioner)
{
bActioner.onCrouch( p, (ServerPlayerEntity ) (Object)this );
}
}
}
public ServerPlayerMixin(World world , BlockPos pos , float yaw , GameProfile profile, PlayerPublicKey pubKey)
{
super(world, pos, yaw, profile, pubKey);
}
}

View File

@@ -0,0 +1,55 @@
package systems.brn.televator;
import com.mojang.authlib.GameProfile;
import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras;
import eu.pb4.polymer.resourcepack.impl.client.rendering.PolymerResourcePack;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import systems.brn.televator.blocks.TelevatorBlock;
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.util.math.BlockPos;
import java.util.HashMap;
import java.util.UUID;
public class Televator implements ModInitializer {
public static final String MODID = "televator";
public static final String MODELID = "televator";
public static final HashMap<UUID, Boolean> primed = new HashMap<>();
@Override
public void onInitialize() {
PolymerResourcePackUtils.addModAssets(MODID);
ResourcePackExtras.forDefault().addBridgedModelsFolder(Identifier.of(MODID, "item"));
PolymerResourcePackUtils.markAsRequired();
TelevatorBlock.register();
ServerTickEvents.END_SERVER_TICK.register(server -> {
// Iterate over all online players
server.getPlayerManager().getPlayerList().forEach(player -> {
// Check if the player is sneaking
if (!player.getPlayerInput().sneak() && !player.getPlayerInput().jump()) {
primed.put(player.getUuid(), true);
}
if (primed.getOrDefault(player.getUuid(), false)) {
if (player.getPlayerInput().sneak()) {
BlockPos testPos = player.getBlockPos().down();
if (player.getWorld().getBlockState(testPos).getBlock() instanceof TelevatorBlock televatorBlock) {
televatorBlock.handleMovement(testPos, player, false);
}
} else if (player.getPlayerInput().jump()) {
BlockPos testPos = player.getBlockPos().down();
if (player.getWorld().getBlockState(testPos).getBlock() instanceof TelevatorBlock televatorBlock) {
televatorBlock.handleMovement(testPos, player, true);
}
}
}
});
});
}
}

View File

@@ -0,0 +1,85 @@
package systems.brn.televator.blocks;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.AbstractBlock;
import net.minecraft.item.ItemGroups;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.world.Heightmap;
import systems.brn.televator.Televator;
import systems.brn.televator.items.TelevatorBlockItem;
import eu.pb4.polymer.blocks.api.BlockModelType;
import eu.pb4.polymer.blocks.api.PolymerBlockModel;
import eu.pb4.polymer.blocks.api.PolymerTexturedBlock;
import eu.pb4.polymer.blocks.api.PolymerBlockResourceUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.Item;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import xyz.nucleoid.packettweaker.PacketContext;
import static systems.brn.televator.Televator.primed;
public class TelevatorBlock extends Block implements PolymerTexturedBlock {
private final BlockState polymerBlockState;
public TelevatorBlock(Settings settings, BlockModelType type, String modelId) {
super(settings);
this.polymerBlockState = PolymerBlockResourceUtils.requestBlock(type, PolymerBlockModel.of(Identifier.of(Televator.MODID, "block/" + modelId)));
}
@Override
public BlockState getPolymerBlockState(BlockState state, PacketContext packetContext) {
return this.polymerBlockState;
}
public static void register() {
var modId = Identifier.of(Televator.MODID, Televator.MODELID);
var block = Registry.register(Registries.BLOCK, modId,
new TelevatorBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL).registryKey(RegistryKey.of(RegistryKeys.BLOCK, modId)), BlockModelType.FULL_BLOCK, Televator.MODELID));
Item item = Registry.register(Registries.ITEM, modId, new TelevatorBlockItem(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, modId)), block, Televator.MODELID));
ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item));
}
public void handleMovement(BlockPos pos, ServerPlayerEntity player, boolean isJumping) {
pos = isJumping ? pos.up() : pos.down();
ServerWorld world = (ServerWorld) player.getWorld();
int maxY = world.getDimension().height() + world.getDimension().minY();
int minY = world.getDimension().minY();
while (pos.getY() <= maxY && pos.getY() >= minY) {
Block blk = world.getBlockState(pos).getBlock();
if (blk instanceof TelevatorBlock) {
final BlockPos tpPos = pos.up();
if (tpPos.getY() + 1 > maxY || (world.getBlockState(tpPos).getBlock().equals(Blocks.AIR) && world.getBlockState(tpPos.up()).getBlock().equals(Blocks.AIR))) {
teleportWithEffect(player, world, tpPos);
primed.put(player.getUuid(), false);
break;
}
}
pos = isJumping ? pos.up() : pos.down();
}
}
private void teleportWithEffect(ServerPlayerEntity player, ServerWorld w, BlockPos tpPos) {
player.teleport(tpPos.getX() + 0.5d, tpPos.getY(), tpPos.getZ() + 0.5d, true);
player.setVelocity(0, 0, 0);
player.setSneaking(false);
w.playSound(null, tpPos, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 0.5f, 1.5f);
w.spawnParticles(ParticleTypes.POOF, tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f, 5, 0, 0, 0, 0.25f);
}
}

View File

@@ -0,0 +1,36 @@
package systems.brn.televator.items;
import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras;
import eu.pb4.polymer.resourcepack.extras.api.format.item.model.BasicItemModel;
import eu.pb4.polymer.resourcepack.impl.client.rendering.PolymerResourcePack;
import net.minecraft.resource.ResourcePack;
import systems.brn.televator.Televator;
import eu.pb4.polymer.core.api.item.PolymerItem;
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import xyz.nucleoid.packettweaker.PacketContext;
public class TelevatorBlockItem extends BlockItem implements PolymerItem {
private final Identifier polymerModel;
public TelevatorBlockItem(Settings settings, Block block, String modelId) {
super(block, settings);
this.polymerModel = Identifier.of(Televator.MODID, modelId);
}
@Override
public Item getPolymerItem(ItemStack itemStack, PacketContext packetContext) {
return Items.BARRIER;
}
@Override
public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) {
return polymerModel;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "televator:block/televator"
}
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "televator:item/televator"
}
}

View File

@@ -0,0 +1,4 @@
{
"block.televator.televator": "Televator",
"item.televator.televator": "Televator"
}

View File

@@ -0,0 +1,7 @@
{
"parent": "block/cube_column",
"textures": {
"end": "televator:block/televator_top",
"side": "televator:block/televator_side"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "televator:block/televator"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

View File

@@ -1,3 +0,0 @@
{
"block.jumpvader.jumpvader_block": "Jump Vader"
}

View File

@@ -1,23 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#A#",
"AEA",
"#A#"
],
"key": {
"#": {
"item": "minecraft:glass"
},
"A": {
"item": "minecraft:amethyst_shard"
},
"E": {
"item": "minecraft:ender_pearl"
}
},
"result": {
"item": "jumpvader:jumpvader_block",
"count": 2
}
}

View File

@@ -6,7 +6,7 @@
"entries": [
{
"type": "minecraft:item",
"name": "jumpvader:jumpvader_block"
"name": "televator:televator"
}
],
"conditions": [

View File

@@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"pattern": [
"#A#",
"AEA",
"#A#"
],
"key": {
"#": "minecraft:glass",
"A": "minecraft:amethyst_shard",
"E": "minecraft:ender_pearl"
},
"result": {
"id": "televator:televator",
"count": 2
}
}

View File

@@ -1,38 +1,33 @@
{
"schemaVersion": 1,
"id": "jumpvader",
"id": "televator",
"version": "${version}",
"name": "Jump Vader",
"description": "Ender Vaders ServerSide Only",
"name": "Televator",
"description": "Televator Serversider",
"authors": [
"VenomCodeDev"
"VenomCodeDev",
"BRNSystems"
],
"contact": {
"homepage": "https://github.com/VenomCodeDev/JumpVaderMod",
"sources": "https://github.com/VenomCodeDev/JumpVaderMod"
"homepage": "https://git.brn.systems/BRNSystems/Televator",
"sources": "https://git.brn.systems/BRNSystems/Televator"
},
"license": "MIT",
"icon": "assets/jumpvader/icon.png",
"icon": "assets/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"dev.venomcode.jumpvader.JumpVaderMod"
"systems.brn.televator.Televator"
]
},
"mixins": [
"jumpvader.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.21",
"minecraft": "~1.20.1",
"java": ">=17",
"fabric-api": "*"
},
"suggests": {
"another-mod": "*"
"fabricloader": ">=${loader_version}",
"minecraft": ">=${minecraft_version}",
"java": ">=21",
"fabric-api": ">=${fabric_version}"
}
}

View File

@@ -1,14 +0,0 @@
{
"required": true,
"minVersion": "0.8",
"package": "dev.venomcode.jumpvader.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ServerPlayerMixin"
],
"client": [
],
"injectors": {
"defaultRequire": 1
}
}