Skip to content

Commit

Permalink
🐛 Fix looping parry
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes committed Jul 6, 2024
1 parent 52b37d1 commit c6ad242
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 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.4
mod.version = 1.0.5
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.4+1.21
deps.cabinetapi = 1.3.5+1.21
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import dev.callmeecho.bombastic.client.render.entity.model.ClownBootsEntityModel;
import dev.callmeecho.bombastic.client.render.entity.model.ClownHairEntityModel;
import dev.callmeecho.bombastic.client.render.entity.model.JugglingBallEntityModel;
import dev.callmeecho.bombastic.main.BombasticConfig;
import dev.callmeecho.bombastic.main.particle.ConfettiParticle;
import dev.callmeecho.bombastic.main.particle.FirecrackerFlashParticle;
import dev.callmeecho.bombastic.main.registry.*;
import dev.callmeecho.cabinetapi.client.ModMenuHelper;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
Expand All @@ -23,6 +25,8 @@
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;

import static dev.callmeecho.bombastic.main.Bombastic.MODID;

public class BombasticClient implements ClientModInitializer {
public static int freezeFrames = -1;

Expand Down Expand Up @@ -50,6 +54,8 @@ public void onInitializeClient() {

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

ModMenuHelper.addConfig(MODID, BombasticConfig.class);

ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (freezeFrames > 0) {
freezeFrames--;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/dev/callmeecho/bombastic/main/Bombastic.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.callmeecho.bombastic.main;

import dev.callmeecho.bombastic.main.registry.*;
import dev.callmeecho.cabinetapi.config.ConfigHandler;
import dev.callmeecho.cabinetapi.item.CabinetItemGroup;
import dev.callmeecho.cabinetapi.registry.RegistrarHandler;
import net.fabricmc.api.ModInitializer;
Expand All @@ -26,6 +27,7 @@ public class Bombastic implements ModInitializer {
);

public static final SpecialRecipeSerializer<PipeBombRecipe> PIPE_BOMB_RECIPE = new SpecialRecipeSerializer<>(PipeBombRecipe::new);
public static final BombasticConfig CONFIG = ConfigHandler.getConfig(BombasticConfig.class);

@Override
public void onInitialize() {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/dev/callmeecho/bombastic/main/BombasticConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package dev.callmeecho.bombastic.main;

import dev.callmeecho.cabinetapi.config.Config;
import dev.callmeecho.cabinetapi.config.annotations.Range;
import net.minecraft.util.Identifier;

import static dev.callmeecho.bombastic.main.Bombastic.MODID;

public class BombasticConfig implements Config {
@Range(min = 1.0F, max = 10.0F)
public float clownBootsMultiplier = 7.5F;

@Override
public Identifier getName() { return Identifier.of(MODID, "bombastic"); }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.callmeecho.bombastic.mixin;

import dev.callmeecho.bombastic.main.Bombastic;
import dev.callmeecho.bombastic.main.RandomHelper;
import dev.callmeecho.bombastic.main.registry.BombasticItemRegistrar;
import dev.callmeecho.bombastic.main.registry.BombasticSoundEventRegistrar;
Expand Down Expand Up @@ -58,7 +59,11 @@ private void onExplodedBy(Entity entity, CallbackInfo ci) {
playerEntity.networkHandler.sendPacket(
new EntityVelocityUpdateS2CPacket(
playerEntity.getId(),
playerEntity.getVelocity().multiply(7.5F, 0.0F, 7.5F)
playerEntity.getVelocity().multiply(
Bombastic.CONFIG.clownBootsMultiplier,
0.0F,
Bombastic.CONFIG.clownBootsMultiplier
)
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ProjectileEntityMixin(EntityType<?> type, World world) {

@Inject(method = "deflect", at = @At("HEAD"))
private void deflect(ProjectileDeflection deflection, Entity deflector, Entity owner, boolean fromAttack, CallbackInfoReturnable<Boolean> cir) {
if (!this.getWorld().isClient || !this.getType().isIn(PARRIABLE_PROJECTILE)) return;
if (!this.getWorld().isClient || !this.getType().isIn(PARRIABLE_PROJECTILE) || this.getType() == deflector.getType()) return;

ClientPlayerEntity player = MinecraftClient.getInstance().player;
if (player == null) return;
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/assets/bombastic/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
"enchantment.bombastic.ballistic": "Ballistic",

"entity.bombastic.juggling_ball": "Juggling Ball",
"entity.bombastic.pipe_bomb": "Pipe Bomb"
"entity.bombastic.pipe_bomb": "Pipe Bomb",

"config.bombastic:bombastic.title": "Bombastic",

"config.bombastic:bombastic.clownBootsMultiplier": "Clown Boots Multiplier"
}

0 comments on commit c6ad242

Please sign in to comment.