Dieser Commit ist enthalten in:
Ursprung
ed799b2937
Commit
163967483f
@ -1,115 +0,0 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2024 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.features.portablehole;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
// @Linked
|
||||
public class PortableHoleListener implements Listener {
|
||||
|
||||
private Map<Long, List<BlockState>> toReplace = new HashMap<>();
|
||||
|
||||
{
|
||||
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {
|
||||
List<BlockState> blockStates = toReplace.remove(TPSUtils.currentRealTick.get());
|
||||
if (blockStates == null) return;
|
||||
blockStates.forEach(blockState -> {
|
||||
blockState.update(true, false);
|
||||
});
|
||||
}, 1, 1);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (!event.hasItem()) return;
|
||||
if (event.getItem().getType() != Material.FIREWORK_STAR) return;
|
||||
|
||||
BlockFace blockFace;
|
||||
if (event.getPlayer().getLocation().getPitch() < -45) {
|
||||
blockFace = BlockFace.UP;
|
||||
} else if (event.getPlayer().getLocation().getPitch() > 45) {
|
||||
blockFace = BlockFace.DOWN;
|
||||
} else if (event.getPlayer().getLocation().getYaw() > 135) {
|
||||
blockFace = BlockFace.NORTH;
|
||||
} else if (event.getPlayer().getLocation().getYaw() > 45) {
|
||||
blockFace = BlockFace.WEST;
|
||||
} else if (event.getPlayer().getLocation().getYaw() > -45) {
|
||||
blockFace = BlockFace.SOUTH;
|
||||
} else if (event.getPlayer().getLocation().getYaw() > -135) {
|
||||
blockFace = BlockFace.EAST;
|
||||
} else {
|
||||
blockFace = BlockFace.NORTH;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Location source = event.getPlayer().getLocation().getBlock().getLocation().clone();
|
||||
source.add(blockFace.getDirection().clone().multiply(i + 1 + (blockFace == BlockFace.UP ? 1 : 0)));
|
||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||
long reappearTime = TPSUtils.currentRealTick.get() + 100;
|
||||
if (blockFace == BlockFace.UP || blockFace == BlockFace.DOWN) {
|
||||
for (int dx = -1; dx <= 1; dx++) {
|
||||
for (int dz = -1; dz <= 1; dz++) {
|
||||
Block block = source.clone().add(dx, 0, dz).getBlock();
|
||||
BlockState blockState = block.getState();
|
||||
if (blockState.getType().isAir()) continue;
|
||||
toReplace.computeIfAbsent(reappearTime, __ -> new ArrayList<>()).add(blockState);
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
} else if (blockFace == BlockFace.NORTH || blockFace == BlockFace.SOUTH) {
|
||||
for (int dx = -1; dx <= 1; dx++) {
|
||||
for (int dy = 0; dy <= 2; dy++) {
|
||||
Block block = source.clone().add(dx, dy, 0).getBlock();
|
||||
BlockState blockState = block.getState();
|
||||
if (blockState.getType().isAir()) continue;
|
||||
toReplace.computeIfAbsent(reappearTime, __ -> new ArrayList<>()).add(blockState);
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int dy = 0; dy <= 2; dy++) {
|
||||
for (int dz = -1; dz <= 1; dz++) {
|
||||
Block block = source.clone().add(0, dy, dz).getBlock();
|
||||
BlockState blockState = block.getState();
|
||||
if (blockState.getType().isAir()) continue;
|
||||
toReplace.computeIfAbsent(reappearTime, __ -> new ArrayList<>()).add(blockState);
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, i);
|
||||
}
|
||||
}
|
||||
}
|
252
MiningIII.md
252
MiningIII.md
@ -1,252 +0,0 @@
|
||||
# Mining III
|
||||
|
||||
Stats menu, blocks broken
|
||||
Pickaxe skins? / Cosmetics (Armor)
|
||||
Crystals?
|
||||
Music selector
|
||||
McPrison enchantments?
|
||||
Legendary enchantments? -> Overdrive entchantments via prestige points
|
||||
Combo Perk Enchantments?
|
||||
Show proc rate enchtantment
|
||||
Crystal Level increase by mining?
|
||||
Keeping -> Keep an enchantment or n levels on random enchantments
|
||||
Max upgrade? +5 upgrade?
|
||||
Auto buy?
|
||||
|
||||
## Enchantments
|
||||
|
||||
### Efficiency
|
||||
|
||||
- Increases Mining speed
|
||||
- id: efficiency
|
||||
- max: 10
|
||||
- cost_block_base: 50
|
||||
- cost_block_inc: 10
|
||||
- cost_shards_base: -80
|
||||
- cost_shards_inc: 20
|
||||
|
||||
### Haste
|
||||
|
||||
- Gain Haste
|
||||
- id: haste
|
||||
- max: 10
|
||||
- cost_block_base: 1000
|
||||
- cost_block_inc: 0
|
||||
- cost_gold_base: 100
|
||||
- cost_gold_inc: 100
|
||||
|
||||
### Speed
|
||||
|
||||
- Gain Speed
|
||||
- id: speed
|
||||
- max: 5
|
||||
- cost_blocks_base: 500
|
||||
- cost_blocks_inc: -100
|
||||
- cost_shards_base: 100
|
||||
- cost_shards_inc: 150
|
||||
|
||||
### Fortune
|
||||
|
||||
- Increases Blocks gained
|
||||
- id: fortune
|
||||
- max: 50
|
||||
- cost_block_base: 100
|
||||
- cost_block_inc: 25
|
||||
- cost_gold_base: 200
|
||||
- cost_gold_inc: 50
|
||||
- cost_shards_base: -40
|
||||
- cost_shards_inc: 10
|
||||
|
||||
### Prosperity
|
||||
|
||||
- Rare chance to greatly increse block gain
|
||||
- id: prosperity
|
||||
- max: 10
|
||||
- cost_block_base: 1000
|
||||
- cost_block_inc: 100
|
||||
- cost_gold_base: 1000
|
||||
- cost_gold_inc: 100
|
||||
- cost_shards_base: 100
|
||||
- cost_shards_inc: 100
|
||||
|
||||
### Gifted
|
||||
|
||||
- Get luckier prosperity procs
|
||||
- id: gifted
|
||||
- max: 25
|
||||
- cost_block_base: 10000
|
||||
- cost_block_inc: 1000
|
||||
- cost_shards_base: 1000
|
||||
- cost_shards_inc: 250
|
||||
|
||||
### Shard Fusing Tome
|
||||
|
||||
- Chance to turn ores into shards
|
||||
- id: shard_fusing_tome
|
||||
- max: 10
|
||||
- cost_block_base: 5000
|
||||
- cost_block_inc: 500
|
||||
- cost_shards_base: 1000
|
||||
- cost_shards_inc: 0
|
||||
|
||||
### Unstable shards
|
||||
|
||||
- Destroy every shard created by Shard Fusing Tome
|
||||
- id: unstable_shards
|
||||
- max: 1
|
||||
- cost_block_base: 100000
|
||||
- cost_block_inc: 0
|
||||
- cost_gold_base: 25000
|
||||
- cost_gold_inc: 0
|
||||
- cost_shards_base: 10000
|
||||
- cost_shards_inc: 0
|
||||
|
||||
### Gatherer
|
||||
|
||||
- Chance to gain Gold on Block break
|
||||
- id: gatherer
|
||||
- max: 10
|
||||
- cost_block_base: 1000
|
||||
- cost_block_inc: 1000
|
||||
- cost_gold_base: 1000
|
||||
- cost_gold_inc: 0
|
||||
|
||||
### Block Shatterer
|
||||
|
||||
- Greatly increase Block gain
|
||||
- id: block_shatterer
|
||||
- max: 10
|
||||
- cost_block_base: 5000
|
||||
- cost_block_inc: 5000
|
||||
- cost_gold_base: 1000
|
||||
- cost_gold_inc: 1000
|
||||
- cost_shards_base: 500
|
||||
- cost_shards_inc: 500
|
||||
|
||||
### Gold Shatterer
|
||||
|
||||
- Greatly increase Gold gain
|
||||
- id: gold_shatterer
|
||||
- max: 10
|
||||
- cost_block_base: 1000
|
||||
- cost_block_inc: 1000
|
||||
- cost_gold_base: 5000
|
||||
- cost_gold_inc: 5000
|
||||
- cost_shards_base: 500
|
||||
- cost_shards_inc: 500
|
||||
|
||||
### Shard Shatterer
|
||||
|
||||
- Greatly increase Shard gain
|
||||
- id: shard_shatterer
|
||||
- max: 10
|
||||
- cost_block_base: 5000
|
||||
- cost_block_inc: 5000
|
||||
- cost_gold_base: 500
|
||||
- cost_gold_inc: 500
|
||||
- cost_shards_base: 1000
|
||||
- cost_shards_inc: 1000
|
||||
|
||||
### Explosive
|
||||
|
||||
- Chance to explode
|
||||
- id: explosive
|
||||
- max: 30
|
||||
- cost_block_base: 200
|
||||
- cost_block_inc: 50
|
||||
- cost_gold_base: -700
|
||||
- cost_gold_inc: 100
|
||||
- cost_shards_base: -3200
|
||||
- cost_shards_inc: 200
|
||||
|
||||
### Laser
|
||||
|
||||
- Chance to fire a laser
|
||||
- id: laser
|
||||
- max: 300
|
||||
- cost_block_base: 1000
|
||||
- cost_block_inc: 0
|
||||
- cost_gold_base: 3000
|
||||
- cost_gold_inc: -20
|
||||
- cost_shards_base: 0
|
||||
- cost_shards_inc: 30
|
||||
|
||||
### Jackhammer
|
||||
|
||||
- Chance to destroy 3*3*3 (100) or 5*5*5 (200) area
|
||||
- id: jackhammer
|
||||
- max: 200
|
||||
- cost_block_base: 10000
|
||||
- cost_block_inc: 100
|
||||
- cost_gold_base: -12250
|
||||
- cost_gold_inc: 250
|
||||
- cost_shards_base: -74500
|
||||
- cost_shards_inc: 500
|
||||
|
||||
### Corrosive Mine
|
||||
|
||||
- Destroy level number of blocks in the vicinity
|
||||
- id: corrosive_mine
|
||||
- max: 25
|
||||
- cost_block_base: 5000
|
||||
- cost_block_inc: 100
|
||||
- cost_gold_base: 5000
|
||||
- cost_gold_inc: 100
|
||||
- cost_shards_base: 5000
|
||||
- cost_shards_inc: 100
|
||||
|
||||
### Jackpot
|
||||
|
||||
- Chance to receive the jackpot of 1000 blocks, 1000 gold and 1000 shards
|
||||
- id: jackpot
|
||||
- max: 1
|
||||
- cost_shards_base: 50000
|
||||
- cost_shards_inc: 0
|
||||
|
||||
### Dual Pickaxe
|
||||
|
||||
- Chance to proc enchantments on another block in vicinity
|
||||
- id: dual_pickaxe
|
||||
- max: 10
|
||||
- cost_block_base: 2500
|
||||
- cost_block_inc: 500
|
||||
- cost_gold_base: 2500
|
||||
- cost_gold_inc: 500
|
||||
- cost_shards_base: 2500
|
||||
- cost_shards_inc: 500
|
||||
|
||||
### Luck
|
||||
|
||||
- Chance for laser bounces to proc any enchantment
|
||||
- id: luck
|
||||
- max: 10
|
||||
- cost_block_base: 10000
|
||||
- cost_block_inc: 10000
|
||||
- cost_gold_base: 10000
|
||||
- cost_gold_inc: 10000
|
||||
- cost_shards_base: 10000
|
||||
- cost_shards_inc: 10000
|
||||
|
||||
### Lumberjack
|
||||
|
||||
- Change to axe while looking onto Wood
|
||||
- id: lumberjack
|
||||
- max: 1
|
||||
- cost_block_base: 5000
|
||||
- cost_block_inc: 0
|
||||
- cost_gold_base: 5000
|
||||
- cost_gold_inc: 0
|
||||
- cost_shards_base: 5000
|
||||
- cost_shards_inc: 0
|
||||
|
||||
### Soul Remover
|
||||
|
||||
- Change to shovel while looking onto Wood
|
||||
- id: soul_remover
|
||||
- max: 1
|
||||
- cost_block_base: 5000
|
||||
- cost_block_inc: 0
|
||||
- cost_gold_base: 5000
|
||||
- cost_gold_inc: 0
|
||||
- cost_shards_base: 5000
|
||||
- cost_shards_inc: 0
|
In neuem Issue referenzieren
Einen Benutzer sperren