AE2 First Commit, the dawn of 1.7 hast arrived.

This commit is contained in:
algorithmx2
2013-12-27 16:59:59 -06:00
commit e9acdcbee2
468 changed files with 47440 additions and 0 deletions
@@ -0,0 +1,45 @@
package appeng.core.features.registries;
import java.util.HashMap;
import net.minecraftforge.event.ForgeSubscribe;
import appeng.api.events.LocatableEventAnnounce;
import appeng.api.events.LocatableEventAnnounce.LocatableEvent;
import appeng.api.features.ILocatable;
import appeng.api.features.ILocateableRegistry;
import appeng.util.Platform;
public class LocateableRegistry implements ILocateableRegistry
{
private HashMap<Long, ILocatable> set;
@ForgeSubscribe
public void updateLocateable(LocatableEventAnnounce e)
{
if ( Platform.isClient() )
return; // IGNORE!
if ( e.change == LocatableEvent.Register )
{
set.put( e.target.getLocatableSerial(), e.target );
} else if ( e.change == LocatableEvent.Unregister )
{
set.remove( e.target.getLocatableSerial() );
}
}
public LocateableRegistry() {
set = new HashMap();
}
/**
* Find a locate-able object by its serial.
*/
@Override
public Object findLocateableBySerial(long ser)
{
return set.get( ser );
}
}