Fixed path finder crap in UtilEnt

Cleaned up unused code in OutfitRaveSuit
Fixed eclipse bug for NotificationManager
Removed christmas/Sleigh columns.
This commit is contained in:
Jonathan Williams 2014-12-10 03:32:35 -08:00
parent 625d517058
commit ea034812b9
5 changed files with 25 additions and 30 deletions

View File

@ -3,6 +3,7 @@ package mineplex.core.common.util;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List;
import net.minecraft.server.v1_7_R4.EntityBat; import net.minecraft.server.v1_7_R4.EntityBat;
import net.minecraft.server.v1_7_R4.EntityCreature; import net.minecraft.server.v1_7_R4.EntityCreature;
@ -41,6 +42,8 @@ public class UtilEnt
private static Field _goalSelector; private static Field _goalSelector;
private static Field _targetSelector; private static Field _targetSelector;
private static Field _bsRestrictionGoal; private static Field _bsRestrictionGoal;
private static Field _pathfinderBList;
private static Field _pathfinderCList;
public static HashMap<Entity, String> GetEntityNames() public static HashMap<Entity, String> GetEntityNames()
{ {
@ -97,6 +100,18 @@ public class UtilEnt
_targetSelector.setAccessible(true); _targetSelector.setAccessible(true);
} }
if (_pathfinderBList == null)
{
_pathfinderBList = PathfinderGoalSelector.class.getDeclaredField("b");
_pathfinderBList.setAccessible(true);
}
if (_pathfinderCList == null)
{
_pathfinderCList = PathfinderGoalSelector.class.getDeclaredField("c");
_pathfinderCList.setAccessible(true);
}
if (entity instanceof CraftCreature) if (entity instanceof CraftCreature)
{ {
EntityCreature creature = ((CraftCreature)entity).getHandle(); EntityCreature creature = ((CraftCreature)entity).getHandle();
@ -116,13 +131,12 @@ public class UtilEnt
creature.Vegetated = true; creature.Vegetated = true;
creature.Silent = mute; creature.Silent = mute;
PathfinderGoalSelector goalSelector = new PathfinderGoalSelector(((CraftWorld)entity.getWorld()).getHandle().methodProfiler);
goalSelector.a(7, new PathfinderGoalLookAtPlayer(creature, EntityHuman.class, 6.0F)); ((List)_pathfinderBList.get(((PathfinderGoalSelector)_goalSelector.get(creature)))).clear();
goalSelector.a(7, new PathfinderGoalRandomLookaround(creature)); ((List)_pathfinderCList.get(((PathfinderGoalSelector)_goalSelector.get(creature)))).clear();
_goalSelector.set(creature, goalSelector); ((List)_pathfinderBList.get(((PathfinderGoalSelector)_targetSelector.get(creature)))).clear();
_targetSelector.set(creature, new PathfinderGoalSelector(((CraftWorld)entity.getWorld()).getHandle().methodProfiler)); ((List)_pathfinderCList.get(((PathfinderGoalSelector)_targetSelector.get(creature)))).clear();
} }
if (((CraftEntity)entity).getHandle() instanceof EntityBat) if (((CraftEntity)entity).getHandle() instanceof EntityBat)

View File

@ -147,20 +147,4 @@ public class OutfitRaveSuit extends OutfitGadget
stack.setItemMeta(meta); stack.setItemMeta(meta);
} }
} }
//@EventHandler
public void debug(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().contains("on"))
{
this.Enable(event.getPlayer());
event.setCancelled(true);
}
if (event.getMessage().contains("off"))
{
this.Disable(event.getPlayer());
event.setCancelled(true);
}
}
} }

View File

@ -10,5 +10,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/> <classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-io-2.4.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-io-2.4.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.ServerData"/> <classpathentry combineaccessrules="false" kind="src" path="/Mineplex.ServerData"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jooq-3.4.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Database"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -1,6 +1,7 @@
package mineplex.hub.notification; package mineplex.hub.notification;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@ -67,7 +68,7 @@ public class NotificationManager extends MiniPlugin
notifications.addAll(notifier.getNotifications(player)); notifications.addAll(notifier.getNotifications(player));
} }
notifications.sort(COMPARATOR); Collections.sort(notifications, COMPARATOR);
return notifications; return notifications;
} }

View File

@ -121,12 +121,6 @@ public class Sleigh
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 3)); SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 3));
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 3)); SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 3));
//Corners
SleighEnts.add(new SleighPart(4, 44, 7, loc.clone(), -2, -3));
SleighEnts.add(new SleighPart(4, 44, 7, loc.clone(), 2, -3));
SleighEnts.add(new SleighPart(4, 44, 7, loc.clone(), -2, 0));
SleighEnts.add(new SleighPart(4, 44, 7, loc.clone(), 2, 0));
//Santa //Santa
SleighPart santa = new SleighPart(3, 0, 0, loc.clone(), 0, 1); SleighPart santa = new SleighPart(3, 0, 0, loc.clone(), 0, 1);
santa.AddSanta(); santa.AddSanta();