Skip to content

Commit

Permalink
formatting and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
FN-FAL113 committed Feb 22, 2024
1 parent 445d457 commit 7b9c775
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ne.fnfal113</groupId>
<artifactId>RelicsOfCthonia</artifactId>
<version>Unofficial-1.8.1</version>
<version>Unofficial-1.8.2</version>
<packaging>jar</packaging>

<name>RelicsOfCthonia</name>
Expand Down Expand Up @@ -119,14 +119,14 @@
<dependency>
<groupId>com.github.baked-libs.dough</groupId>
<artifactId>dough-updater</artifactId>
<version>c4231a4d1a</version>
<version>fcdbd45aa0</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.github.baked-libs.dough</groupId>
<artifactId>dough-common</artifactId>
<version>c4231a4d1a</version>
<version>fcdbd45aa0</version>
<scope>compile</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class MiningListener implements Listener {

@Getter
@Getter
private final Map<AbstractRelic, List<Material>> whereToDropMaterialMap = RelicsOfCthonia.getInstance().getRelicsRegistry().getWhereToDropMaterialMap();

@EventHandler(priority = EventPriority.MONITOR)
Expand All @@ -41,7 +41,7 @@ public void onBlockBreak(BlockBreakEvent event) {
Material blockBrokeType = block.getType();

// only naturally generated blocks are accepted to prevent place and break farming
if(block.hasMetadata("placed_block")){
if(block.hasMetadata("placed_block")) {
block.removeMetadata("placed_block", RelicsOfCthonia.getInstance());

return;
Expand All @@ -52,10 +52,11 @@ public void onBlockBreak(BlockBreakEvent event) {
ThreadLocalRandom currentRandomThread = ThreadLocalRandom.current();

Utils.createAsyncTask(asyncTask -> {
Iterator<Map.Entry<AbstractRelic, List<Material>>> dropIterator = getWhereToDropMaterialMap().entrySet().iterator();
Iterator<Map.Entry<AbstractRelic, List<Material>>> dropIterator = getWhereToDropMaterialMap().entrySet().iterator();

while (dropIterator.hasNext()) {
Map.Entry<AbstractRelic, List<Material>> pair = dropIterator.next();

AbstractRelic abstractRelic = pair.getKey();

if(abstractRelic.isDisabledIn(world) || abstractRelic.isDisabled()) {
Expand Down Expand Up @@ -92,15 +93,15 @@ public void onBlockBreak(BlockBreakEvent event) {
}

@EventHandler
public void onBlockPlace(BlockPlaceEvent event){
if(!event.isCancelled()){
public void onBlockPlace(BlockPlaceEvent event) {
if(!event.isCancelled()) {
handlePlacedBlock(event.getBlockPlaced());
}
}

@EventHandler
public void onBlockPlacerPlaced(BlockPlacerPlaceEvent event) {
if(!event.isCancelled()){
if(!event.isCancelled()) {
handlePlacedBlock(event.getBlock());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void onRelicClick(PlayerInteractEvent event){
}*/

@EventHandler
public void onRelicPlace(BlockPlaceEvent event){
if(event.isCancelled()){
public void onRelicPlace(BlockPlaceEvent event) {
if(event.isCancelled()) {
return;
}

Expand All @@ -79,16 +79,16 @@ public void onRelicPlace(BlockPlaceEvent event){
Optional<SlimefunItem> relic = Optional.ofNullable(SlimefunItem.getByItem(itemInHand));

relic.ifPresent(item -> {
if(item instanceof AbstractRelic){
if(item instanceof AbstractRelic) {
Utils.sendRelicMessage("You placed a relic, it will not drop anything once broken!", event.getPlayer());
}
});

}

@EventHandler
public void onRelicBreak(BlockBreakEvent event){
if(event.isCancelled()){
public void onRelicBreak(BlockBreakEvent event) {
if(event.isCancelled()) {
return;
}

Expand All @@ -97,7 +97,7 @@ public void onRelicBreak(BlockBreakEvent event){
Optional<SlimefunItem> relic = Optional.ofNullable(BlockStorage.check(blockBroken));

relic.ifPresent(item -> {
if(item instanceof AbstractRelic){
if(item instanceof AbstractRelic) {
event.setCancelled(true);

BlockStorage.clearBlockInfo(blockBroken);
Expand Down

0 comments on commit 7b9c775

Please sign in to comment.