-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ useless wake particle
- Loading branch information
Showing
16 changed files
with
411 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.goby56.wakes.command; | ||
|
||
import com.mojang.brigadier.CommandDispatcher; | ||
import com.mojang.brigadier.arguments.IntegerArgumentType; | ||
import com.mojang.brigadier.arguments.StringArgumentType; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import com.mojang.brigadier.exceptions.CommandSyntaxException; | ||
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; | ||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
import net.minecraft.client.color.world.BiomeColors; | ||
import net.minecraft.client.render.WorldRenderer; | ||
import net.minecraft.command.CommandRegistryAccess; | ||
import net.minecraft.fluid.FluidState; | ||
import net.minecraft.registry.tag.FluidTags; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.ColorHelper; | ||
import net.minecraft.util.math.Vec3d; | ||
import net.minecraft.world.World; | ||
|
||
public class DebugCommand { | ||
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher, CommandRegistryAccess registryAccess) { | ||
dispatcher.register(ClientCommandManager.literal("wakes_debug") | ||
.then(ClientCommandManager.literal("light") | ||
.executes(DebugCommand::lightCoordinate)) | ||
.then(ClientCommandManager.literal("color") | ||
.executes(DebugCommand::waterColor))); | ||
} | ||
|
||
public static int lightCoordinate(CommandContext<FabricClientCommandSource> cmdCtx) throws CommandSyntaxException { | ||
World world = cmdCtx.getSource().getWorld(); | ||
BlockPos blockPos = cmdCtx.getSource().getPlayer().getBlockPos(); | ||
|
||
cmdCtx.getSource().sendFeedback(Text.of(String.valueOf(WorldRenderer.getLightmapCoordinates(world, blockPos)))); | ||
return 1; | ||
} | ||
|
||
public static int waterColor(CommandContext<FabricClientCommandSource> cmdCtx) throws CommandSyntaxException { | ||
World world = cmdCtx.getSource().getWorld(); | ||
BlockPos blockPos = cmdCtx.getSource().getPlayer().getBlockPos(); | ||
|
||
int col = BiomeColors.getWaterColor(world, blockPos); | ||
cmdCtx.getSource().sendFeedback(Text.of(String.format("(%d, %d, %d)", | ||
ColorHelper.Argb.getRed(col), | ||
ColorHelper.Argb.getGreen(col), | ||
ColorHelper.Argb.getBlue(col)))); | ||
return 1; | ||
} | ||
} |
60 changes: 0 additions & 60 deletions
60
src/main/java/com/goby56/wakes/command/SpawnWakesCommand.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
package com.goby56.wakes.particle; | ||
|
||
import com.goby56.wakes.WakesClient; | ||
import com.goby56.wakes.particle.custom.SplashPlaneParticle; | ||
import com.goby56.wakes.particle.custom.WakeParticle; | ||
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class ModParticles { | ||
public static WakeParticleType WAKE_SPLASH; | ||
public static SplashPlaneParticleType SPLASH_PLANE; | ||
public static WakeParticleType WAKE_PARTICLE; | ||
|
||
public static void registerParticles() { | ||
WAKE_SPLASH = Registry.register(Registries.PARTICLE_TYPE, new Identifier(WakesClient.MOD_ID, "wake"), new WakeParticleType(true)); | ||
ParticleFactoryRegistry.getInstance().register(WAKE_SPLASH, WakeParticle.Factory::new); | ||
SPLASH_PLANE = Registry.register(Registries.PARTICLE_TYPE, new Identifier(WakesClient.MOD_ID, "splash_plane"), new SplashPlaneParticleType(true)); | ||
ParticleFactoryRegistry.getInstance().register(SPLASH_PLANE, SplashPlaneParticle.Factory::new); | ||
|
||
WAKE_PARTICLE = Registry.register(Registries.PARTICLE_TYPE, new Identifier(WakesClient.MOD_ID, "wake_particle"), new WakeParticleType(true)); | ||
ParticleFactoryRegistry.getInstance().register(WAKE_PARTICLE, WakeParticle.Factory::new); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/goby56/wakes/particle/SplashPlaneParticleType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.goby56.wakes.particle; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.particle.DefaultParticleType; | ||
|
||
public class SplashPlaneParticleType extends DefaultParticleType { | ||
public Entity owner; | ||
|
||
protected SplashPlaneParticleType(boolean alwaysShow) { | ||
super(alwaysShow); | ||
} | ||
|
||
public SplashPlaneParticleType withOwner(Entity owner) { | ||
this.owner = owner; | ||
return this; | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
src/main/java/com/goby56/wakes/particle/WakeParticleType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
package com.goby56.wakes.particle; | ||
|
||
import com.goby56.wakes.utils.WakeNode; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.particle.DefaultParticleType; | ||
|
||
public class WakeParticleType extends DefaultParticleType { | ||
public Entity owner; | ||
public WakeNode node; | ||
|
||
protected WakeParticleType(boolean alwaysShow) { | ||
super(alwaysShow); | ||
} | ||
|
||
public WakeParticleType withOwner(Entity owner) { | ||
this.owner = owner; | ||
public WakeParticleType withNode(WakeNode node) { | ||
this.node = node; | ||
return this; | ||
} | ||
} |
Oops, something went wrong.