Compare commits

..

10 Commits

Author SHA1 Message Date
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
25 changed files with 223 additions and 384 deletions

View File

@@ -1,9 +1,15 @@
# 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/JumpVaderMod)
## 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 "Jump Vader" 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)
![Crafting Recipe](https://github.com/VenomCodeDev/TelevatorMod/blob/d1cd96ccd846d3249a4a7fcb298e740775ee344c/assets/TelevatorCraftingRecipe.png?raw=true)
## Removal
**NOTE:** Removing the mods from the mods folder will delete all Televator blocks in inventories and the world permanently!

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.6-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,15 +27,12 @@ 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-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 {
@@ -69,30 +61,4 @@ jar {
from("LICENSE") {
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

@@ -4,16 +4,17 @@ 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.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.9
# Mod Properties
mod_version = 1.0.2+1.20.1
maven_group = dev.venomcode
archives_base_name = jumpvader
mod_version = 1.0.9+1.20.4
maven_group = systems.brn.televator
archives_base_name = televator
# 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
fabric_version=0.96.11+1.20.4
serverapi_version=1.0.8+1.20.1
polymer_version=0.7.7+1.20.4
server_translations_api_version=2.2.0+1.20.3-rc1

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.7-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,47 @@
package systems.brn.televator;
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;
public class Televator implements ModInitializer {
public static final String MODID = "televator";
public static final String MODELID = "televator";
@Override
public void onInitialize()
{
PolymerResourcePackUtils.addModAssets(MODID);
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.isSneaking() && player.isOnGround()) {
BlockPos testPos = player.getBlockPos().down();
if(player.getWorld().getBlockState(testPos).getBlock() instanceof TelevatorBlock jumpVaderBlock) {
jumpVaderBlock.handleMovement(testPos, player, false);
}
}
// Check if the player is jumping
if (player.getVelocity().y > 0 && !player.isOnGround()) {
BlockPos testPos = player.getBlockPos().down();
if(player.getWorld().getBlockState(testPos).getBlock() instanceof TelevatorBlock jumpVaderBlock)
{
jumpVaderBlock.handleMovement(testPos, player, true);
}
}
});
});
}
public static TelevatorBlock JUMP_VADER_BLOCK;
}

View File

@@ -0,0 +1,12 @@
package systems.brn.televator;
public class TelevatorConfig {
public static int getMaxVerticalBlocks()
{
return 128;
}
public static String getAlternativeBlock()
{
return "minecraft:orange_wool";
}
}

View File

@@ -0,0 +1,77 @@
package systems.brn.televator.blocks;
import systems.brn.televator.Televator;
import systems.brn.televator.TelevatorConfig;
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.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
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;
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(new Identifier(Televator.MODID, modelId)));
}
@Override
public Block getPolymerBlock(BlockState state) {
return this.polymerBlockState.getBlock();
}
@Override
public BlockState getPolymerBlockState(BlockState state) {
return this.polymerBlockState;
}
public static void register() {
var modId = new Identifier(Televator.MODID, Televator.MODELID);
var block = Registry.register(Registries.BLOCK, modId,
new TelevatorBlock(FabricBlockSettings.copy(Blocks.WHITE_WOOL), BlockModelType.FULL_BLOCK, Televator.MODELID));
Registry.register(Registries.ITEM, modId, new TelevatorBlockItem(new Item.Settings(), block, Televator.MODELID));
}
public void handleMovement(BlockPos pos, ServerPlayerEntity player, boolean isJumping) {
pos = isJumping ? pos.up() : pos.down();
ServerWorld world = (ServerWorld) player.getWorld();
int count = 0;
while (count < TelevatorConfig.getMaxVerticalBlocks() && pos.getY() < world.getTopY() && pos.getY() >= world.getBottomY()) {
Block blk = world.getBlockState(pos).getBlock();
if (blk instanceof TelevatorBlock) {
final BlockPos tpPos = pos.up();
if (world.getBlockState(tpPos).getBlock().equals(Blocks.AIR) && world.getBlockState(tpPos.up()).getBlock().equals(Blocks.AIR)) {
teleportWithEffect(player, world, tpPos);
}
}
pos = isJumping ? pos.up() : pos.down();
count++;
}
}
private void teleportWithEffect(ServerPlayerEntity player, ServerWorld w, BlockPos tpPos) {
player.teleport(tpPos.getX() + 0.5f, tpPos.getY(), tpPos.getZ() + 0.5f);
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,33 @@
package systems.brn.televator.items;
import systems.brn.televator.Televator;
import eu.pb4.polymer.core.api.item.PolymerItem;
import eu.pb4.polymer.resourcepack.api.PolymerModelData;
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.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
public class TelevatorBlockItem extends BlockItem implements PolymerItem {
private final PolymerModelData polymerModel;
public TelevatorBlockItem(Settings settings, Block block, String modelId) {
super(block, settings);
this.polymerModel = PolymerResourcePackUtils.requestModel(Items.BARRIER, new Identifier(Televator.MODID, modelId));
}
@Override
public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
return this.polymerModel.item();
}
@Override
public int getPolymerCustomModelData(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
return this.polymerModel.value();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

View File

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

View File

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

View File

@@ -17,7 +17,7 @@
}
},
"result": {
"item": "jumpvader:jumpvader_block",
"item": "televator:televator",
"count": 2
}
}

View File

@@ -1,38 +1,34 @@
{
"schemaVersion": 1,
"id": "jumpvader",
"id": "televator",
"version": "${version}",
"name": "Jump Vader",
"description": "Ender Vaders ServerSide Only",
"authors": [
"VenomCodeDev"
"VenomCodeDev",
"BRNSystems"
],
"contact": {
"homepage": "https://github.com/VenomCodeDev/JumpVaderMod",
"sources": "https://github.com/VenomCodeDev/JumpVaderMod"
"homepage": "https://github.com/VenomCodeDev/TelevatorMod",
"sources": "https://github.com/VenomCodeDev/TelevatorMod"
},
"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",
"fabricloader": ">=0.15.9",
"minecraft": "~1.20.4",
"java": ">=17",
"fabric-api": "*"
},
"suggests": {
"another-mod": "*"
"fabric-api": "*",
"polymer-core": "0.7.7+1.20.4"
}
}

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
}
}