-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Double Jumps and Triple Jumps. Implemented the Ground Pou…
…nd's associated stomp type. Implemented repeat-ground-pounding, where Mario can hold the button down after pounding some blocks to slam them repeatedly. Repeat ground pounding is allowed when the previous pound caused some change to the blockstate.
- Loading branch information
1 parent
6ffeae1
commit c211a28
Showing
28 changed files
with
445 additions
and
67 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
55 changes: 55 additions & 0 deletions
55
src/main/java/com/floralquafloral/bumping/handlers/SpawnerBumpingHandler.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,55 @@ | ||
package com.floralquafloral.bumping.handlers; | ||
|
||
import com.floralquafloral.mariodata.MarioClientSideData; | ||
import com.floralquafloral.mariodata.MarioData; | ||
import com.floralquafloral.mariodata.moveable.MarioTravelData; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.block.SpawnerBlock; | ||
import net.minecraft.block.TrialSpawnerBlock; | ||
import net.minecraft.block.entity.MobSpawnerBlockEntity; | ||
import net.minecraft.block.entity.TrialSpawnerBlockEntity; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.state.property.Properties; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import net.minecraft.world.BlockView; | ||
import net.minecraft.world.World; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class SpawnerBumpingHandler implements BumpingHandler { | ||
@Override | ||
public @Nullable BumpLegality evaluateBumpLegality(BlockState state, BlockView world, BlockPos pos, int strength, Direction direction) { | ||
if(state.isOf(Blocks.SPAWNER) || state.isOf(Blocks.TRIAL_SPAWNER)) { | ||
return BumpLegality.BUMP; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean bumpResponseCommon(MarioData data, @Nullable MarioTravelData travelData, World world, BlockState state, BlockPos pos, int baseStrength, int modifiedStrength, Direction direction) { | ||
if(world instanceof ServerWorld serverWorld) { | ||
if(world.getBlockEntity(pos) instanceof MobSpawnerBlockEntity spawnerEntity) { | ||
for(int incrementeroo = 0; incrementeroo < 7; incrementeroo++) { | ||
spawnerEntity.getLogic().serverTick(serverWorld, pos); | ||
} | ||
return true; | ||
} | ||
|
||
if(world.getBlockEntity(pos) instanceof TrialSpawnerBlockEntity trialSpawnerEntity) { | ||
for(int incrementeroo = 0; incrementeroo < 3; incrementeroo++) { | ||
trialSpawnerEntity.getSpawner().trySpawnMob(serverWorld, pos); | ||
} | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public boolean bumpResponseClients(MarioClientSideData data, ClientWorld world, BlockState state, BlockPos pos, int baseStrength, int modifiedStrength, Direction direction) { | ||
return false; | ||
} | ||
} |
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
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
Oops, something went wrong.