Skip to content

Commit

Permalink
🐛 Fix several small bugs and issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes committed Jun 28, 2024
1 parent 86bc965 commit 52b37d1
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 177 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

mod.version = 1.0.3
mod.version = 1.0.4
mod.group = dev.callmeecho
mod.id = bombastic

Expand All @@ -11,4 +11,4 @@ deps.minecraft = 1.21

deps.yarn_mappings = 1.21+build.2
deps.fabric_api = 0.100.4+1.21
deps.cabinetapi = 1.3.3+1.21
deps.cabinetapi = 1.3.4+1.21
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import dev.callmeecho.bombastic.client.render.entity.model.JugglingBallEntityModel;
import dev.callmeecho.bombastic.main.particle.ConfettiParticle;
import dev.callmeecho.bombastic.main.particle.FirecrackerFlashParticle;
import dev.callmeecho.bombastic.main.particle.TrailParticle;
import dev.callmeecho.bombastic.main.registry.*;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
Expand All @@ -19,10 +18,8 @@
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.client.render.entity.FlyingItemEntityRenderer;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;

Expand Down Expand Up @@ -50,7 +47,6 @@ public void onInitializeClient() {

ParticleFactoryRegistry.getInstance().register(BombasticParticleRegistrar.CONFETTI, ConfettiParticle.Factory::new);
ParticleFactoryRegistry.getInstance().register(BombasticParticleRegistrar.FIRECRACKER_FLASH, FirecrackerFlashParticle.Factory::new);
ParticleFactoryRegistry.getInstance().register(BombasticParticleRegistrar.TRAIL, TrailParticle.Factory::new);

BlockEntityRendererFactories.register(BombasticBlockEntityRegistrar.CONFETTI_CANNON, ConfettiCannonBlockEntityRenderer::new);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/callmeecho/bombastic/main/Bombastic.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void onInitialize() {
RegistrarHandler.process(BombasticParticleRegistrar.class, MODID);
RegistrarHandler.process(BombasticBlockRegistrar.class, MODID);
RegistrarHandler.process(BombasticBlockEntityRegistrar.class, MODID);
RegistrarHandler.process(BombasticEnchantmentComponentTypeRegistry.class, MODID);
RegistrarHandler.process(BombasticEnchantmentComponentTypeRegistrar.class, MODID);

Registry.register(
Registries.RECIPE_SERIALIZER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package dev.callmeecho.bombastic.main.entity;

import dev.callmeecho.bombastic.client.BombasticClient;
import dev.callmeecho.bombastic.main.registry.BombasticEnchantmentComponentTypeRegistry;
import dev.callmeecho.bombastic.main.registry.BombasticEnchantmentComponentTypeRegistrar;
import dev.callmeecho.bombastic.main.registry.BombasticEntityTypeRegistrar;
import dev.callmeecho.bombastic.main.registry.BombasticItemRegistrar;
import dev.callmeecho.bombastic.main.registry.BombasticSoundEventRegistrar;
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.*;
import net.minecraft.entity.data.DataTracker;
Expand All @@ -16,23 +12,19 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.entity.projectile.thrown.ThrownEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
import org.apache.commons.lang3.mutable.MutableFloat;
import org.apache.commons.lang3.mutable.MutableInt;
import org.jetbrains.annotations.Nullable;

public class JugglingBallEntity extends PersistentProjectileEntity implements FlyingItemEntity {
private static final TrackedData<Boolean> RETURNING = DataTracker.registerData(JugglingBallEntity.class, TrackedDataHandlerRegistry.BOOLEAN);
Expand Down Expand Up @@ -63,7 +55,7 @@ public static JugglingBallEntity create(World world, PlayerEntity player, ItemSt
EnchantmentHelper.forEachEnchantment(
stack,
(enchantment, level) -> enchantment.value().modifyValue(
BombasticEnchantmentComponentTypeRegistry.JUGGLING_BALL_BOUNCE,
BombasticEnchantmentComponentTypeRegistrar.JUGGLING_BALL_BOUNCE,
player.getRandom(),
level,
bounces
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.callmeecho.bombastic.main.item;

import dev.callmeecho.bombastic.main.entity.JugglingBallEntity;
import dev.callmeecho.bombastic.main.registry.BombasticSoundEventRegistrar;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -37,7 +38,7 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand han
stack.decrement(1);

user.getItemCooldownManager().set(this, 10);
world.playSound(null, user.getX(), user.getY(), user.getZ(), SoundEvents.ENTITY_SNOWBALL_THROW, user.getSoundCategory(), 1.0F, 1.0F);
world.playSound(null, user.getX(), user.getY(), user.getZ(), BombasticSoundEventRegistrar.JUGGLING_BALL, user.getSoundCategory(), 1.0F, 1.0F);

return TypedActionResult.success(stack);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package dev.callmeecho.bombastic.main.item;

import dev.callmeecho.bombastic.main.registry.BombasticEnchantmentComponentTypeRegistry;
import dev.callmeecho.bombastic.main.registry.BombasticEnchantmentComponentTypeRegistrar;
import dev.callmeecho.bombastic.main.registry.BombasticParticleRegistrar;
import dev.callmeecho.bombastic.main.registry.BombasticSoundEventRegistrar;
import dev.callmeecho.bombastic.main.utils.ChangingExplosionBehavior;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EquipmentSlot;
Expand Down Expand Up @@ -58,6 +59,9 @@ private static void explode(World world, PlayerEntity playerEntity, float power)
BombasticParticleRegistrar.CONFETTI,
Registries.SOUND_EVENT.getEntry(SoundEvents.INTENTIONALLY_EMPTY)
);

world.syncWorldEvent(WorldEvents.SMASH_ATTACK, playerEntity.getSteppingPos(), 750);
playerEntity.setIgnoreFallDamageFromCurrentExplosion(true);
}

@Override
Expand Down Expand Up @@ -91,7 +95,7 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity,
playerEntity.getX(),
playerEntity.getY(),
playerEntity.getZ(),
SoundEvents.ENTITY_FIREWORK_ROCKET_LAUNCH,
BombasticSoundEventRegistrar.PARTY_POPPER,
playerEntity.getSoundCategory(),
1.0F,
1.0F
Expand All @@ -104,7 +108,7 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity,
EnchantmentHelper.forEachEnchantment(
stack,
(enchantment, level) -> enchantment.value().modifyValue(
BombasticEnchantmentComponentTypeRegistry.PARTY_POPPER_EXPLOSION,
BombasticEnchantmentComponentTypeRegistrar.PARTY_POPPER_EXPLOSION,
random,
level,
power
Expand All @@ -114,9 +118,6 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity,
if (power.floatValue() > 0.0F)
explode(world, playerEntity, power.floatValue());

world.syncWorldEvent(WorldEvents.SMASH_ATTACK, playerEntity.getSteppingPos(), 750);
playerEntity.setIgnoreFallDamageFromCurrentExplosion(true);

playerEntity.getItemCooldownManager().set(this, 20);
stack.damage(1, playerEntity, EquipmentSlot.MAINHAND);
return TypedActionResult.success(playerEntity.getStackInHand(hand));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.callmeecho.bombastic.main.particle;

import dev.callmeecho.bombastic.main.Bombastic;
import dev.callmeecho.bombastic.main.utils.Easing;
import dev.callmeecho.cabinetapi.util.Easing;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.particle.*;
Expand Down Expand Up @@ -80,9 +80,7 @@ public void buildGeometry(VertexConsumer vertexConsumer, Camera camera, float ti

@Override
public float getSize(float tickDelta) {
return scale - Easing.QUINT_IN.apply(
Math.min((float) this.age + tickDelta, this.maxAge),
0, scale, maxAge);
return (float) Easing.QUINT.in(Math.min(age + tickDelta, getMaxAge()), scale, 0, getMaxAge());
}

Quaternionf getRotation(Camera camera, float tickDelta) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.callmeecho.bombastic.main.particle;

import dev.callmeecho.bombastic.main.Bombastic;
import dev.callmeecho.bombastic.main.utils.Easing;
import dev.callmeecho.cabinetapi.util.Easing;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.particle.*;
Expand All @@ -27,6 +27,8 @@ protected FirecrackerFlashParticle(
this.velocityX = 0.0F;
this.velocityY = 0.0F;
this.velocityZ = 0.0F;

this.scale = 2.0F;
this.maxAge = 4;
}

Expand Down Expand Up @@ -55,12 +57,7 @@ public void tick() {

@Override
public float getSize(float tickDelta) {
return (float)
(2.0F * Math.sin(
Math.min(
(float) this.age + tickDelta,
maxAge
) * (1.0F / getMaxAge()) * MathHelper.PI));
return (float) Easing.QUART.yoyoOutIn(Math.min(age + tickDelta, getMaxAge()), 0, scale, getMaxAge());
}

@Environment(EnvType.CLIENT)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;

public class BombasticEnchantmentComponentTypeRegistry implements Registrar<ComponentType<?>> {
public class BombasticEnchantmentComponentTypeRegistrar implements Registrar<ComponentType<?>> {
public static final ComponentType<EnchantmentValueEffect> JUGGLING_BALL_BOUNCE = ComponentType.<EnchantmentValueEffect>builder()
.codec(EnchantmentValueEffect.CODEC)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
public class BombasticParticleRegistrar implements Registrar<ParticleType<?>> {
public static final SimpleParticleType CONFETTI = FabricParticleTypes.simple();
public static final SimpleParticleType FIRECRACKER_FLASH = FabricParticleTypes.simple();
public static final SimpleParticleType TRAIL = FabricParticleTypes.simple();

public static final SimpleParticleType NULL = FabricParticleTypes.simple();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
@SuppressWarnings("unused")
public class BombasticSoundEventRegistrar implements Registrar<SoundEvent> {
public static final SoundEvent CLOWN_BOOTS = SoundEvent.of(Identifier.of("bombastic", "clown_boots"));
public static final SoundEvent PARTY_POPPER = SoundEvent.of(Identifier.of("bombastic", "party_popper"));
public static final SoundEvent JUGGLING_BALL = SoundEvent.of(Identifier.of("bombastic", "juggling_ball"));
public static final SoundEvent PARRY = SoundEvent.of(Identifier.of("bombastic", "parry"));


Expand Down
63 changes: 0 additions & 63 deletions src/main/java/dev/callmeecho/bombastic/main/utils/Easing.java

This file was deleted.

4 changes: 3 additions & 1 deletion src/main/resources/assets/bombastic/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"block.bombastic.firecracker": "Firecracker",

"subtitles.bombastic.clown_boots": "Clown Boots spring",
"subtitles.bombastic.parry": "Projectile parried",
"subtitles.bombastic.parry": "Projectile clangs",
"subtitles.bombastic.party_popper": "Party Popper pops",
"subtitles.bombastic.juggling_ball": "Juggling Ball flies",

"enchantment.bombastic.explosive": "Explosive",
"enchantment.bombastic.wind_shot": "Wind Shot",
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/assets/bombastic/particles/trail.json

This file was deleted.

Loading

0 comments on commit 52b37d1

Please sign in to comment.