further tutorial progress
This commit is contained in:
parent
d23804be70
commit
195c990e29
@ -28,85 +28,4 @@ public class EnclosedObject<T>
|
||||
{
|
||||
return _value.toString();
|
||||
}
|
||||
|
||||
// Arithmetic operations, will only work if T is an instance of Number
|
||||
public long Add(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).longValue() + number.longValue();
|
||||
}
|
||||
|
||||
public long Subtract(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).longValue() - number.longValue();
|
||||
}
|
||||
|
||||
public long Multiply(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).longValue() * number.longValue();
|
||||
}
|
||||
|
||||
public long Divide(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).longValue() / number.longValue();
|
||||
}
|
||||
|
||||
public double PreciseAdd(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).doubleValue() + number.doubleValue();
|
||||
}
|
||||
|
||||
public double PreciseSubtract(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).doubleValue() - number.doubleValue();
|
||||
}
|
||||
|
||||
public double PreciseMultiply(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).doubleValue() * number.doubleValue();
|
||||
}
|
||||
|
||||
public double PreciseDivide(Number number)
|
||||
{
|
||||
if (!(_value instanceof Number))
|
||||
{
|
||||
throw new RuntimeException("Type of T must be an instance of Number to perform arithmetic.");
|
||||
}
|
||||
|
||||
return ((Number) _value).doubleValue() / number.doubleValue();
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class ClanEnergyTracker extends MiniPlugin
|
||||
|
||||
Triple<Long, Long, String[]> energyBounds = _updateMap.get(type);
|
||||
|
||||
if (energyBounds != null && energyRemaining > energyBounds.getLeft() && energyRemaining < energyBounds.getMiddle())
|
||||
if (energyBounds != null && energyRemaining > energyBounds.getLeft().longValue() && energyRemaining < energyBounds.getMiddle().longValue())
|
||||
{
|
||||
_clans.middleTextClan(clan, energyBounds.getRight()[0], energyBounds.getRight()[1], 20, 200, 80);
|
||||
_clans.sendTipToClan(clan, TipType.ENERGY);
|
||||
|
@ -10,8 +10,6 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@ -55,11 +53,11 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.portal.ServerTransferEvent;
|
||||
import mineplex.core.timing.TimingManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ClansUtility;
|
||||
import mineplex.game.clans.clans.map.events.PlayerGetMapEvent;
|
||||
import mineplex.game.clans.clans.worldevent.WorldEventManager;
|
||||
import net.minecraft.server.v1_8_R3.Block;
|
||||
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||
@ -866,6 +864,8 @@ public class ItemMapManager extends MiniPlugin
|
||||
|
||||
public void setMap(Player player)
|
||||
{
|
||||
UtilServer.CallEvent(new PlayerGetMapEvent(player));
|
||||
|
||||
for (ItemStack item : UtilInv.getItems(player))
|
||||
{
|
||||
if (item.getType() == Material.MAP && (item.getDurability() >= _mapId && item.getDurability() <= _mapId + 100))
|
||||
|
@ -523,7 +523,7 @@ public class Outpost implements Listener
|
||||
_outpostManager.runSyncLater(() -> {
|
||||
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, block.getLocation(), new Vector(0,0,0), 1f, 1, ViewDist.MAX);
|
||||
_origin.getWorld().playSound(block.getLocation(), Sound.EXPLODE, 1.0f, 1.0f);
|
||||
}, wait.Add(Integer.valueOf(4 + UtilMath.random.nextInt(4))))
|
||||
}, wait.Set(Integer.valueOf(wait.Get().intValue() + 4 + UtilMath.random.nextInt(4))).longValue())
|
||||
);
|
||||
|
||||
_outpostManager.runSyncLater(() -> {
|
||||
|
@ -266,7 +266,7 @@ public class Cannon extends SiegeWeapon
|
||||
private void updateInventory()
|
||||
{
|
||||
_inventory.setItem(0, new ItemBuilder(Material.LEVER).setTitle(C.cRed + "-1 Firepower").build());
|
||||
_inventory.setItem(1, new ItemBuilder(Material.SULPHUR).setTitle(C.cWhiteB + "Firepower: " + C.cYellow + _firepower).build());
|
||||
_inventory.setItem(1, new ItemBuilder(Material.SULPHUR).setTitle(C.cWhiteB + "Firepower: " + C.cYellow + _firepower).setAmount(_firepower).build());
|
||||
_inventory.setItem(2, new ItemBuilder(Material.LEVER).setTitle(C.cGreen + "+1 Firepower").build());
|
||||
|
||||
for (int slot : UtilCollections.newList(Integer.valueOf(3), Integer.valueOf(5), Integer.valueOf(6), Integer.valueOf(7), Integer.valueOf(8)))
|
||||
|
@ -48,6 +48,8 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.siege.SiegeManager;
|
||||
import mineplex.game.clans.clans.siege.events.LoadSiegeWeaponEvent;
|
||||
import mineplex.game.clans.clans.siege.events.MountSiegeWeaponEvent;
|
||||
import mineplex.game.clans.clans.siege.events.SiegeWeaponExplodeEvent;
|
||||
import mineplex.game.clans.clans.siege.repository.tokens.SiegeWeaponToken;
|
||||
import mineplex.game.clans.clans.siege.weapon.projectile.ProjectileAttributes;
|
||||
@ -401,6 +403,8 @@ public abstract class SiegeWeapon implements Listener
|
||||
|
||||
private void handleMount(Player player)
|
||||
{
|
||||
UtilServer.CallEvent(new MountSiegeWeaponEvent(player, this));
|
||||
|
||||
if (!CustomMount(player))
|
||||
{
|
||||
getEntity("PLAYERMOUNT").setPassenger(player);
|
||||
@ -634,6 +638,10 @@ public abstract class SiegeWeapon implements Listener
|
||||
|
||||
_inventory.setItem(slot, new ItemStack(_ammunitionType, _maxAmmunition));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilServer.CallEvent(new LoadSiegeWeaponEvent(getRider(), this));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_firepowerSlots.contains(Integer.valueOf(slot)))
|
||||
|
@ -2,8 +2,6 @@ package mineplex.game.clans.tutorial.tutorials.clans;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -29,6 +27,7 @@ import mineplex.game.clans.tutorial.Tutorial;
|
||||
import mineplex.game.clans.tutorial.TutorialRegion;
|
||||
import mineplex.game.clans.tutorial.TutorialWorldManager;
|
||||
import mineplex.game.clans.tutorial.map.TutorialMapManager;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.ClassesObjective;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.FieldsObjective;
|
||||
@ -57,6 +56,7 @@ public class ClansMainTutorial extends Tutorial
|
||||
|
||||
addObjective(new LeaveSpawnObjective(this, plugin));
|
||||
addObjective(new ClanObjective(this, plugin));
|
||||
addObjective(new AttackEnemyObjective(this, plugin));
|
||||
addObjective(new ShopsObjective(this, plugin));
|
||||
addObjective(new ClassesObjective(this, plugin));
|
||||
addObjective(new FieldsObjective(this, plugin));
|
||||
|
@ -5,13 +5,13 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.game.clans.tutorial.objective.OrderedObjective;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.AttackEnemyGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.BlowUpWallGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.StealEnemyPotatoesGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.BuildHouseGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.ClaimLandGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.ClanDetailsGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.CreateClanGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.SetHomeGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.StealEnemyPotatoesGoal;
|
||||
|
||||
public class ClanObjective extends OrderedObjective<ClansMainTutorial>
|
||||
{
|
||||
@ -24,8 +24,6 @@ public class ClanObjective extends OrderedObjective<ClansMainTutorial>
|
||||
addGoal(new ClaimLandGoal(this));
|
||||
addGoal(new BuildHouseGoal(this));
|
||||
addGoal(new SetHomeGoal(this));
|
||||
addGoal(new AttackEnemyGoal(this));
|
||||
addGoal(new StealEnemyPotatoesGoal(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan;
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -14,7 +14,6 @@ import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.fallingblock.FallingBlocks;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.siege.SiegeManager;
|
||||
import mineplex.game.clans.clans.siege.events.SiegeWeaponExplodeEvent;
|
||||
import mineplex.game.clans.clans.siege.weapon.Cannon;
|
||||
@ -22,13 +21,11 @@ import mineplex.game.clans.tutorial.TutorialRegion;
|
||||
import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial.Point;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective;
|
||||
|
||||
public class AttackEnemyGoal extends ObjectiveGoal<ClanObjective>
|
||||
public class BlowUpWallGoal extends ObjectiveGoal<AttackEnemyObjective>
|
||||
{
|
||||
private Map<String, Cannon> _cannon = new HashMap<>();
|
||||
|
||||
public AttackEnemyGoal(ClanObjective objective)
|
||||
public BlowUpWallGoal(AttackEnemyObjective objective)
|
||||
{
|
||||
super(objective, "Attack Enemy", "Attack enemy clan! Blow a hole in their base with a Cannon.");
|
||||
}
|
||||
@ -37,15 +34,6 @@ public class AttackEnemyGoal extends ObjectiveGoal<ClanObjective>
|
||||
protected void customStart(Player player)
|
||||
{
|
||||
UtilInv.give(player, Material.TNT);
|
||||
|
||||
_cannon.put(player.getName(), SiegeManager.Instance.spawnCannon(player, getObjective().getPlugin().getPoint(getObjective().getPlugin().getRegion(player), Point.CANNON), false));
|
||||
_cannon.get(player.getName()).SetForcedVelocity(0.4, 2.45);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clean(Player player, TutorialRegion region)
|
||||
{
|
||||
_cannon.remove(player.getName()).kill();
|
||||
}
|
||||
|
||||
@EventHandler
|
@ -1,4 +1,4 @@
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan;
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
Loading…
Reference in New Issue
Block a user