Add Bow Damge and Fire #261
@ -347,7 +347,7 @@ public class Config {
|
|||||||
EventTeamRedID = 0;
|
EventTeamRedID = 0;
|
||||||
BothTeamsPublic = true;
|
BothTeamsPublic = true;
|
||||||
MaximumTeamMembers = Integer.MAX_VALUE;
|
MaximumTeamMembers = Integer.MAX_VALUE;
|
||||||
SpectateSystem = false;
|
SpectateSystem = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String blueLeader = System.getProperty("blueLeader", null);
|
String blueLeader = System.getProperty("blueLeader", null);
|
||||||
@ -384,6 +384,6 @@ public class Config {
|
|||||||
return ArenaMode.Test.contains(mode);
|
return ArenaMode.Test.contains(mode);
|
||||||
}
|
}
|
||||||
public static boolean recording(){
|
public static boolean recording(){
|
||||||
return mode == ArenaMode.EVENT;
|
return true;//mode == ArenaMode.EVENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.*;
|
||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
|
||||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
@ -111,6 +108,21 @@ public class Recording implements Listener {
|
|||||||
RecordSystem.entityAnimation(e.getPlayer(), AIR);
|
RecordSystem.entityAnimation(e.getPlayer(), AIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onEntityDamage(EntityDamageEvent e) {
|
||||||
|
if(e.getEntityType() != EntityType.PLAYER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player p = (Player) e.getEntity();
|
||||||
|
if(isNotSent(p))
|
||||||
|
return;
|
||||||
|
|
||||||
|
RecordSystem.damageAnimation(p);
|
||||||
|
|
||||||
|
if(e.getCause() == EntityDamageEvent.DamageCause.FIRE_TICK)
|
||||||
|
RecordSystem.setOnFire(p);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onTNTSpawn(EntitySpawnEvent e){
|
public void onTNTSpawn(EntitySpawnEvent e){
|
||||||
//TODO: Falling block
|
//TODO: Falling block
|
||||||
@ -228,4 +240,6 @@ public class Recording implements Listener {
|
|||||||
FightPlayer fp = Fight.getFightPlayer(p);
|
FightPlayer fp = Fight.getFightPlayer(p);
|
||||||
return fp == null || !fp.isLiving() || FightState.getFightState() == FightState.SPECTATE;
|
return fp == null || !fp.isLiving() || FightState.getFightState() == FightState.SPECTATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,9 @@ public class RecordSystem {
|
|||||||
* PlayerItemPacket (0x07) + int EntityId + String item + boolean enchanted + String slot
|
* PlayerItemPacket (0x07) + int EntityId + String item + boolean enchanted + String slot
|
||||||
* ArrowSpawnPacket (0x08) + int EntityId
|
* ArrowSpawnPacket (0x08) + int EntityId
|
||||||
* FireballSpawnPacket (0x09) + int EntityId
|
* FireballSpawnPacket (0x09) + int EntityId
|
||||||
* TODO Bow spanning
|
* BowSpanPacket (0x0A) + int EntityId + boolean hand
|
||||||
*
|
* PlayerDamagePacket (0x0B) + int EntityId
|
||||||
|
* SetOnFire (0x0C) + int EntityId
|
||||||
Lixfel markierte diese Unterhaltung als gelöst
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* BlockPacket (0x30) + pos int, byte, int + int BlockState
|
* BlockPacket (0x30) + pos int, byte, int + int BlockState
|
||||||
@ -172,6 +173,24 @@ public class RecordSystem {
|
|||||||
spawnEntity(e);
|
spawnEntity(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static synchronized void bowSpan(Player p) {
|
||||||
|
Recorder.rByte(0x0A);
|
||||||
|
Recorder.rInt(p.getEntityId());
|
||||||
Chaoscaot markierte diese Unterhaltung als gelöst
Lixfel
hat
Bögen kann man nur in der MainHand spannen? (Meines wissens nach?) Bögen kann man nur in der MainHand spannen? (Meines wissens nach?)
|
|||||||
|
Recorder.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized void damageAnimation(Player p) {
|
||||||
|
Recorder.rByte(0x0B);
|
||||||
|
Recorder.rInt(p.getEntityId());
|
||||||
|
Recorder.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized void setOnFire(Player p) {
|
||||||
|
Recorder.rByte(0x0C);
|
||||||
|
Recorder.rInt(p.getEntityId());
|
||||||
|
Recorder.flush();
|
||||||
|
}
|
||||||
Chaoscaot markierte diese Unterhaltung als gelöst
Lixfel
hat
Gibt es überhaupt permafeuer, wenn ja, wo? Gibt es überhaupt permafeuer, wenn ja, wo?
|
|||||||
|
|
||||||
public static synchronized void blockChange(Block block){
|
public static synchronized void blockChange(Block block){
|
||||||
int blockState = blockToId(block);
|
int blockState = blockToId(block);
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Dieses Packet kommt mir nicht ganz richtig vor, FireTick ist doch eine sache, welche zufällig weggeht, somit ist es nicht deterministisch, also weiß ich nicht, ob das abspielen dieser nicht dann mal länger und mal kürzer ist, was nicht im Sinne des Packets sein dürfte.
Deshalb wird der FireTick auch, wenn die perma flag auf false ist, nur für 21 Ticks abgespielt, somit ist relativ genau, kann aber noch max. 1 Sekunde off sein.