Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Dedicated Server Crash due to calling SERVER side on client-onl… #33

Merged
merged 2 commits into from
Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/mods/railcraft/api/charge/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public INetwork network(World world) {
/**
* Entry point for rendering charge related effects.
*/
@SideOnly(Side.CLIENT)
public static IZapEffectRenderer effects() {
return effects;
}
Expand Down Expand Up @@ -271,7 +270,6 @@ default void zapEffectDeath(World world, Object source) {
}
}

@SideOnly(Side.CLIENT)
public interface IZapEffectRenderer {
/**
* Helper method that most blocks can use for spark effects. It has a chance of calling
Expand All @@ -282,6 +280,7 @@ public interface IZapEffectRenderer {
* @param chance Integer value such that chance of sparking is defined by {@code rand.nextInt(chance) == 0}
* Most blocks use 50, tracks use 75. Lower numbers means more frequent sparks.
*/
@SideOnly(Side.CLIENT)
default void throwSparks(IBlockState state, World world, BlockPos pos, Random rand, int chance) {
}

Expand All @@ -291,6 +290,7 @@ default void throwSparks(IBlockState state, World world, BlockPos pos, Random ra
* @param source Can be a TileEntity, Entity, BlockPos, or Vec3d
* @throws IllegalArgumentException If source is of an unexpected type.
*/
@SideOnly(Side.CLIENT)
default void zapEffectPoint(World world, Object source) {
}

Expand All @@ -300,12 +300,14 @@ default void zapEffectPoint(World world, Object source) {
* @param source Can be a TileEntity, Entity, BlockPos, or Vec3d
* @throws IllegalArgumentException If source is of an unexpected type.
*/
@SideOnly(Side.CLIENT)
default void zapEffectDeath(World world, Object source) {
}

/**
* Spawns a spark from the surface of each rendered side of a block.
*/
@SideOnly(Side.CLIENT)
default void zapEffectSurface(IBlockState stateIn, World worldIn, BlockPos pos) {
}
}
Expand Down