-
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.
improved map detection, quickjoin prison
- Loading branch information
1 parent
7b747eb
commit d135b38
Showing
4 changed files
with
77 additions
and
38 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
27 changes: 26 additions & 1 deletion
27
src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Map.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,5 +1,30 @@ | ||
package com.github.stachelbeere1248.zombiesutils.game.enums; | ||
|
||
import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.util.BlockPos; | ||
import net.minecraft.world.World; | ||
|
||
import java.util.Optional; | ||
|
||
public enum Map { | ||
DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM, PRISON | ||
DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM, PRISON; | ||
|
||
public static Optional<Map> getMap() { | ||
World world = Minecraft.getMinecraft().theWorld; | ||
BlockPos pos = new BlockPos(44,71,0); | ||
if (!world.isBlockLoaded(pos) || Scoreboard.isNotZombies()) return Optional.empty(); | ||
Block block = world.getBlockState(pos).getBlock(); | ||
if (block.equals(Blocks.air)) { | ||
return Optional.of(Map.DEAD_END); | ||
} else if (block.equals(Blocks.wool)) { | ||
return Optional.of(Map.BAD_BLOOD); | ||
} else if (block.equals(Blocks.stone_slab)) { | ||
return Optional.of(Map.ALIEN_ARCADIUM); | ||
} else if (block.equals(Blocks.wooden_slab)) { | ||
return Optional.of(Map.PRISON); | ||
} else return Optional.empty(); | ||
} | ||
} |
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