Skip to content

Commit

Permalink
Adjusts textures and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeryn99 committed Jul 4, 2023
1 parent f37b907 commit 2203efc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 549 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ def version = rootProject.mod_version
def forgeDir = new File(project.projectDir, 'forge/build/libs/')
def fabricDir = new File(project.projectDir, 'fabric/build/libs/')
def commonDir = new File(project.projectDir, 'common/build/libs/')
forgeDir.mkdir()
fabricDir.mkdir()
commonDir.mkdir()

def filter = { File file -> file.getName().contains(version) } as FileFilter

// Create directories if they do not exist
forgeDir.mkdirs()
fabricDir.mkdirs()
commonDir.mkdirs()

def forgeFiles = forgeDir.listFiles(filter)
def fabricFiles = fabricDir.listFiles(filter)
def commonFiles = commonDir.listFiles(filter)


githubRelease {
token project.findProperty("github") ?: System.getenv("github") ?: ""
owner "VentureCraftMods"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ public static void startGliderAnimation(LivingEntity livingEntity, CallbackInfo
ModifierLayer<IAnimation> animationContainer = ((AnimatedPlayer) livingEntity).gliders_getModifierLayer();
KeyframeAnimation gliderAnimation = PlayerAnimationRegistry.getAnimation(new ResourceLocation(VCGliders.MOD_ID, "gliding"));


if (GliderUtil.isGlidingWithActiveGlider(livingEntity)) {
if (animationContainer.getAnimation() == null) {
var builder = gliderAnimation.mutableCopy();
KeyframeAnimation.AnimationBuilder builder = null;
if (gliderAnimation != null) {
builder = gliderAnimation.mutableCopy();
}
gliderAnimation = builder.build();
animationContainer.setAnimation(new KeyframeAnimationPlayer(gliderAnimation));
}
Expand Down
31 changes: 12 additions & 19 deletions common/src/main/java/net/venturecraft/gliders/util/GliderUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
Expand All @@ -17,7 +16,6 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.threetag.palladiumcore.util.Platform;
import net.venturecraft.gliders.common.compat.trinket.CuriosTrinketsUtil;
import net.venturecraft.gliders.common.item.GliderItem;
import net.venturecraft.gliders.common.sound.SoundRegistry;
Expand Down Expand Up @@ -62,11 +60,12 @@ public static void onTickPlayerGlide(Level level, LivingEntity player) {

lightningLogic(level, player, glider);

if (player.tickCount % (player.level.dimension() == Level.NETHER ? 40 : 400) == 0) {
if (player.tickCount % (player.level.dimension() == Level.NETHER ? 40 : 100) == 0) {
if (player instanceof ServerPlayer serverPlayer) {

int damageAmount = player.level.dimension() == Level.NETHER && !hasNetherUpgrade(glider) ? glider.getMaxDamage() / 2 : 1;
glider.setDamageValue(glider.getDamageValue() - damageAmount);
glider.setDamageValue(glider.getDamageValue() + damageAmount);
System.out.println(glider.getDamageValue());
if (glider.getDamageValue() >= glider.getMaxDamage()) {
level.playSound(null, serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ(), SoundEvents.FIRE_EXTINGUISH, SoundSource.PLAYERS, 1.0F, 1.0F / (level.getRandom().nextFloat() * 0.4F + 1.2F));
level.playSound(null, serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ(), SoundEvents.ITEM_BREAK, SoundSource.PLAYERS, 1.0F, 1.0F / (level.getRandom().nextFloat() * 0.4F + 1.2F));
Expand All @@ -78,33 +77,27 @@ public static void onTickPlayerGlide(Level level, LivingEntity player) {

handleNetherLogic(level, player, glider);

if(checkUpdraft(player.blockPosition(), level, player)) return;
if (checkUpdraft(player.blockPosition(), level, player)) return;


// Particles
float horizonalSpeed = (float) player.getDeltaMovement().horizontalDistance();
if (isSpaceGlider(glider) && horizonalSpeed >= 0.01F) {
if (horizonalSpeed >= 0.01F) {

if (!level.isClientSide()) {
// Space Glider
if (isSpaceGlider(glider)) {
for (int i = 0; i < 2; ++i) {
for (ServerPlayer serverplayer : Platform.getCurrentServer().getPlayerList().getPlayers()) {
((ServerLevel) serverplayer.level).sendParticles(ParticleTypes.DRAGON_BREATH, player.getRandomX(0.5D), player.getY() + 2.5, player.getRandomZ(0.5D), 1, 0.0D, 0.0D, 0.0D, 0.0D);
}
level.addParticle(ParticleTypes.DRAGON_BREATH, player.getRandomX(0.5D), player.getY() + 2.5, player.getRandomZ(0.5D), 1, 0.0D, 0.0D);
}
}
}

// Speed Modifications
if (hasSpeedMods) {
if (!level.isClientSide() && horizonalSpeed >= 0.01F) {
for (int i = 0; i < 2; ++i) {
for (ServerPlayer serverplayer : Platform.getCurrentServer().getPlayerList().getPlayers()) {
((ServerLevel) serverplayer.level).sendParticles(ParticleTypes.GLOW, player.getRandomX(0.5D), player.getY() + 2.5, player.getRandomZ(0.5D), 1, 0.0D, 0.0D, 0.0D, 0.0D);
}
}
// Speed Modifications
if (hasSpeedMods) {
level.addParticle(ParticleTypes.WITCH, player.getRandomX(0.5D), player.getY() + 2.5, player.getRandomZ(0.5D), 0.5, 0.0D, 0.0D);
}
}


if (m.y < -0.05)
player.setDeltaMovement(new Vec3(m.x, -0.05, m.z));
return;
Expand Down
Loading

0 comments on commit 2203efc

Please sign in to comment.