Skip to content

Commit

Permalink
Update texture pack
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Jul 29, 2021
1 parent 9d90612 commit f555d67
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 17 deletions.
Binary file not shown.
7 changes: 3 additions & 4 deletions src/main/java/fr/zelytra/daedalus/Daedalus.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import fr.zelytra.daedalus.commands.state.StateTabs;
import fr.zelytra.daedalus.commands.test;
import fr.zelytra.daedalus.commands.wiki.Wiki;
import fr.zelytra.daedalus.events.EventsManager;
import fr.zelytra.daedalus.managers.game.GameManager;
import fr.zelytra.daedalus.managers.items.CraftManager;
import fr.zelytra.daedalus.managers.setup.StartupManager;
Expand Down Expand Up @@ -51,11 +50,11 @@ public void onLoad() {
public void onEnable() {
/* Init world */
Bukkit.createWorld(new WorldCreator("daedalus"));
checkFAWE();
//checkFAWE();
/* Init registers */
EventsManager.registerEvents(this);
//EventsManager.registerEvents(this);
regCommands();
setupServer();
//setupServer();

/* Init managers */
gameManager = new GameManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.bukkit.event.player.PlayerResourcePackStatusEvent;

public class ForcedTexturePack implements Listener {
private final String url = "https://raw.githubusercontent.com/zelytra/Daedalus/master/resources/Daedalus_0.8.zip";
private final String url = "https://raw.githubusercontent.com/zelytra/Daedalus/master/resources/Daedalus_0.9.zip";

@EventHandler
public void joinListener(PlayerJoinEvent e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

import fr.zelytra.daedalus.Daedalus;
import fr.zelytra.daedalus.managers.game.settings.GameSettings;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.*;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.meta.FireworkMeta;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class JumpCheckPoint implements Listener {
public static HashMap<String, Location> jumpCP = new HashMap<>();
private final static List<String> playerWin = new ArrayList<>();

@EventHandler
public void onPressurePlate(PlayerInteractEvent e) {
Expand All @@ -38,18 +43,53 @@ public void onPressurePlate(PlayerInteractEvent e) {
temp.setZ(z);

if (temp.getBlock().getType() == Material.JUNGLE_PRESSURE_PLATE) {
jumpCP.put(e.getPlayer().getName(), temp);
e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.BLOCK_NOTE_BLOCK_XYLOPHONE, 2, 2);
e.getPlayer().sendMessage(GameSettings.LANG.textOf("event.jumpCP"));
checkPointEvent(e, temp);
return;
} else if (temp.getBlock().getType() == Material.LIGHT_WEIGHTED_PRESSURE_PLATE) {
saucisse(e.getPlayer());
return;
}
}
} else {
jumpCP.put(e.getPlayer().getName(), cp);
e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.BLOCK_NOTE_BLOCK_XYLOPHONE, 2, 2);
e.getPlayer().sendMessage(GameSettings.LANG.textOf("event.jumpCP"));
}
} else if (cp.getBlock().getType() == Material.JUNGLE_PRESSURE_PLATE)
checkPointEvent(e, cp);

else if (cp.getBlock().getType() == Material.LIGHT_WEIGHTED_PRESSURE_PLATE)
saucisse(e.getPlayer());

}
}

private void checkPointEvent(PlayerInteractEvent e, Location loc) {
jumpCP.put(e.getPlayer().getName(), loc);
e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.BLOCK_NOTE_BLOCK_XYLOPHONE, 2, 2);
e.getPlayer().sendMessage(GameSettings.LANG.textOf("event.jumpCP"));
}

private void saucisse(Player player) {
if(playerWin.contains(player.getName()))
return;
playerWin.add(player.getName());
for (int x = 0; x <= 150; x++) {
Bukkit.getScheduler().runTaskLater(Daedalus.getInstance(), () -> {

double randomx = (Math.random() * (10.0 + 10.0 + 1)) - 10.0;
double randomy = (Math.random() * (10.0));
double randomz = (Math.random() * (10.0 + 10.0 + 1)) - 10.0;

Location Location1 = new Location(player.getWorld(),
player.getLocation().getX() + randomx,
player.getLocation().getY() + randomy,
player.getLocation().getZ() + randomz);

Firework fw = (Firework) player.getWorld().spawnEntity(Location1, EntityType.FIREWORK);
FireworkMeta fwm = fw.getFireworkMeta();

fwm.setPower(20);
fwm.addEffect(FireworkEffect.builder().withColor(Color.fromRGB((int) (Math.random() * (16000000) + 1))).flicker(true).build());
fw.setFireworkMeta(fwm);
fw.detonate();

}, x + 10);

}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.zelytra.daedalus.events.waiting.players;

import fr.zelytra.daedalus.Daedalus;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
Expand All @@ -10,7 +11,7 @@ public class PlayerInteractListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {

if (e.getAction() == Action.RIGHT_CLICK_BLOCK && Daedalus.getInstance().getGameManager().isWaiting())
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && Daedalus.getInstance().getGameManager().isWaiting() && e.getClickedBlock().getType() != Material.BROWN_SHULKER_BOX)
e.setCancelled(true);

}
Expand Down

0 comments on commit f555d67

Please sign in to comment.