player doesn't attack in continuous and fixed event suggestions fixes #552.
This commit is contained in:
1 parent
3875a1708a
commit
b00b5772c9
2 files changed
+6
-3
No files matched your search
@@ -75,7 +75,7 @@ public class ScriptCommand
|
||||
filter(s -> s.startsWith(prefix) && s.length() <= maxLen).map(s -> s+"(").collect(Collectors.toList()));
|
||||
// not that useful in commandline, more so in external scripts, so skipping here
|
||||
if (eventPrefix != null) scarpetMatches.addAll(CarpetEventServer.Event.publicEvents(null).stream().
|
||||
filter(e -> e.name.startsWith(eventPrefix)).map(s -> "__on_"+s+"(").collect(Collectors.toList()));
|
||||
filter(e -> e.name.startsWith(eventPrefix)).map(s -> "__on_"+s.name+"(").collect(Collectors.toList()));
|
||||
scarpetMatches.addAll(host.globaFunctionNames(host.main, s -> s.startsWith(prefix)).map(s -> s+"(").collect(Collectors.toList()));
|
||||
scarpetMatches.addAll(host.globaVariableNames(host.main, s -> s.startsWith(prefix)).collect(Collectors.toList()));
|
||||
return scarpetMatches;
|
||||
|
||||
@@ -364,10 +364,13 @@ public class EntityPlayerActionPack
|
||||
switch (hit.getType()) {
|
||||
case ENTITY: {
|
||||
EntityHitResult entityHit = (EntityHitResult) hit;
|
||||
player.attack(entityHit.getEntity());
|
||||
if (!action.isContinuous)
|
||||
{
|
||||
player.attack(entityHit.getEntity());
|
||||
player.swingHand(Hand.MAIN_HAND);
|
||||
}
|
||||
player.resetLastAttackedTicks();
|
||||
player.updateLastActionTime();
|
||||
player.swingHand(Hand.MAIN_HAND);
|
||||
return true;
|
||||
}
|
||||
case BLOCK: {
|
||||
|
||||
Reference in new issue
Block a user