From e8e899fb8ec40fc2a8094e3a1f65527af23b11e4 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 2 Apr 2019 14:47:39 +1000 Subject: + Added some basis for new redstone things. --- src/Java/gtPlusPlus/api/interfaces/IToolable.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/Java/gtPlusPlus/api/interfaces/IToolable.java (limited to 'src/Java/gtPlusPlus/api') diff --git a/src/Java/gtPlusPlus/api/interfaces/IToolable.java b/src/Java/gtPlusPlus/api/interfaces/IToolable.java new file mode 100644 index 0000000000..24797825a9 --- /dev/null +++ b/src/Java/gtPlusPlus/api/interfaces/IToolable.java @@ -0,0 +1,17 @@ +package gtPlusPlus.api.interfaces; + +public interface IToolable { + + public boolean isScrewdriverable(); + public boolean onScrewdriverLMB(); + public boolean onScrewdriverRMB(); + + public boolean isWrenchable(); + public boolean onWrenchLMB(); + public boolean onWrenchRMB(); + + public boolean isMalletable(); + public boolean onMalletLMB(); + public boolean onMalletRMB(); + +} -- cgit From f6a126e4467c5bf7ab72249c7fc55df3bc574d94 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 2 Apr 2019 15:39:02 +1000 Subject: + Added TexturePackages. $ More work on redstone systems. --- .../api/objects/minecraft/TexturePackage.java | 55 ++++++++++ src/Java/gtPlusPlus/core/block/ModBlocks.java | 3 + .../general/redstone/BlockGenericRedstone.java | 25 ++++- .../redstone/BlockGenericRedstoneDetector.java | 113 +++++++++++---------- .../redstone/TileEntityRedstoneHandler.java | 67 ++++++++++-- .../blocks/redstone/redstone_meter/top.png | Bin 0 -> 822 bytes 6 files changed, 195 insertions(+), 68 deletions(-) create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/TexturePackage.java create mode 100644 src/resources/assets/miscutils/textures/blocks/redstone/redstone_meter/top.png (limited to 'src/Java/gtPlusPlus/api') diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/TexturePackage.java b/src/Java/gtPlusPlus/api/objects/minecraft/TexturePackage.java new file mode 100644 index 0000000000..e610f8fdf0 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/TexturePackage.java @@ -0,0 +1,55 @@ +package gtPlusPlus.api.objects.minecraft; + +import java.util.LinkedHashMap; +import java.util.Set; + +import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraft.util.IIcon; + +public class TexturePackage { + + private AutoMap mAnimationArray = new AutoMap(); + + public IIcon getFrame(int aFrame) { + if (aFrame < 0 || aFrame >= mAnimationArray.size()) { + return mAnimationArray.get(0); + } + return mAnimationArray.get(aFrame); + } + + public boolean addFrame(IIcon aFrame) { + if (aFrame != null) { + return mAnimationArray.add(aFrame); + } + return false; + } + + public boolean addFrames(AutoMap aFrames) { + for (IIcon h : aFrames) { + if (!addFrame(h)) { + return false; + } + } + return true; + } + + public boolean addFrames(LinkedHashMap aFrames) { + for (IIcon h : aFrames.values()) { + if (!addFrame(h)) { + return false; + } + } + return true; + } + + public boolean addFrames(Set aFrames) { + for (IIcon h : aFrames) { + if (!addFrame(h)) { + return false; + } + } + return true; + } + + +} diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 2b04356f52..8471c13351 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -11,6 +11,7 @@ import gtPlusPlus.core.block.general.LightGlass; import gtPlusPlus.core.block.general.MiningExplosives; import gtPlusPlus.core.block.general.PlayerDoors; import gtPlusPlus.core.block.general.antigrief.BlockWitherProof; +import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneDetector; import gtPlusPlus.core.block.machine.CircuitProgrammer; import gtPlusPlus.core.block.machine.DecayablesChest; import gtPlusPlus.core.block.machine.FishTrap; @@ -140,6 +141,8 @@ public final class ModBlocks { blockCustomJukebox = new Machine_SuperJukebox(); blockPooCollector = new Machine_PooCollector(); + + new BlockGenericRedstoneDetector(); } diff --git a/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java b/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java index 14dac32b63..3197d149c8 100644 --- a/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java +++ b/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java @@ -53,13 +53,18 @@ public abstract class BlockGenericRedstone extends BlockContainer { * A map of the textures used for this blocks. The key is the meta, then each internal map holds textures tied to each forge direction. Do not use unknown direction. * @return */ - public abstract HashMap> getTextureArray(); + public HashMap> getTextureArray() { + return mTextures; + } + + public abstract void generateTextureArray(final IIconRegister iicon); @Override @SideOnly(Side.CLIENT) - public final void registerBlockIcons(final IIconRegister p_149651_1_) { - this.blockIcon = p_149651_1_.registerIcon("redstone_block"); + public final void registerBlockIcons(final IIconRegister iicon) { + generateTextureArray(iicon); + this.blockIcon = iicon.registerIcon("redstone_block"); } @@ -305,8 +310,18 @@ public abstract class BlockGenericRedstone extends BlockContainer { * Ticks the block if it's been scheduled */ public void updateTick(World aWorld, int aX, int aY, int aZ, Random p_149674_5_) { - if (!aWorld.isRemote && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) { - // aWorld.setBlock(aX, aY, aZ, Blocks.redstone_lamp, 0, 2); + TileEntityRedstoneHandler aTile = getTileEntity(aWorld, aX, aY, aZ); + // Client side handling + if (aTile != null) { + this.setLightLevel(aTile.getLightBrightness()); + } + // Only continue on server + if (aWorld.isRemote) { + return; + } + if (aTile != null) { + if (aTile.isGettingIndirectlyPowered()) { + } } } diff --git a/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java b/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java index 3e7816f83a..7728b29a7c 100644 --- a/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java +++ b/src/Java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java @@ -1,17 +1,21 @@ package gtPlusPlus.core.block.general.redstone; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Random; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler; -import net.minecraft.block.Block; +import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.IIcon; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class BlockGenericRedstoneDetector extends BlockGenericRedstone { @@ -32,81 +36,86 @@ public class BlockGenericRedstoneDetector extends BlockGenericRedstone { } @Override - public void registerBlockIcons(IIconRegister p_149651_1_) { - // TODO Auto-generated method stub - super.registerBlockIcons(p_149651_1_); - } - - @Override - public int getLightValue() { - // TODO Auto-generated method stub - return super.getLightValue(); + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) { + aList.add(ItemUtils.getSimpleStack(this)); } - @Override - public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, - int p_149709_5_) { - return 0; - } @Override - public boolean canProvidePower() { - return false; - } - - @Override - public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, - int p_149748_5_) { - return 0; + public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) { + super.updateTick(aWorld, aX, aY, aZ, aRand); } @Override - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { // TODO Auto-generated method stub - super.getSubBlocks(p_149666_1_, p_149666_2_, p_149666_3_); + return ItemUtils.getSimpleStack(this).getItem(); } @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { // TODO Auto-generated method stub - return super.getLightValue(world, x, y, z); + return ItemUtils.getSimpleStack(this).getItem(); } @Override - public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) { - // TODO Auto-generated method stub - return super.shouldCheckWeakPower(world, x, y, z, side); - } + protected ItemStack createStackedBlock(int p_149644_1_) { + return ItemUtils.simpleMetaStack(this, p_149644_1_, 1); + } + + public void generateTextureArray(final IIconRegister iicon) { + HashMap> aTextures = new HashMap>(); - @Override - public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) { - TileEntity aThisTile = aWorld.getTileEntity(aX, aY, aZ); - if (aThisTile != null) { - TileEntityRedstoneHandler aRedstoneTile = (TileEntityRedstoneHandler) aThisTile; - aRedstoneTile.setCurrentTextureArray(null); + //New Block for Each Meta + int aMeta = 0; + { + HashMap aTempMap = new HashMap(); + aTempMap.put(ForgeDirection.UP, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top")); + aTempMap.put(ForgeDirection.DOWN, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top")); + aTempMap.put(ForgeDirection.NORTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top")); + aTempMap.put(ForgeDirection.SOUTH, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top")); + aTempMap.put(ForgeDirection.EAST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top")); + aTempMap.put(ForgeDirection.WEST, iicon.registerIcon(CORE.MODID + ":" + "redstone/redstone_meter/" + "top")); + aTextures.put(aMeta++, aTempMap); } - - super.updateTick(aWorld, aX, aY, aZ, aRand); } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { - // TODO Auto-generated method stub - return null; + public IIcon getIcon(int side, int meta) { + HashMap aTemp = getTextureArray().get(meta); + if (aTemp != null) { + IIcon aSide = aTemp.get(ForgeDirection.getOrientation(side)); + if (aSide != null) { + return aSide; + } + else { + //Smart calculate missing sides + if (side <= 1) { + for (int ss = 0; ss < 2; ss++) { + aSide = aTemp.get(ForgeDirection.getOrientation(side)); + if (aSide != null) { + return aSide; + } + } + } + for (int ss = 2; ss < 6; ss++) { + aSide = aTemp.get(ForgeDirection.getOrientation(side)); + if (aSide != null) { + return aSide; + } + } + } + } + return blockIcon; } @Override - protected ItemStack createStackedBlock(int p_149644_1_) { - // TODO Auto-generated method stub - return null; + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + ArrayList aDrops = new ArrayList(); + aDrops.add(ItemUtils.getSimpleStack(this)); + return aDrops; } } diff --git a/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java b/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java index fbd5f4280d..163c4453b6 100644 --- a/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java +++ b/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java @@ -17,7 +17,9 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable { private BlockPos mTilePos; private boolean mRequiresUpdate = false; private Long mStartTime; - private int mLightValue = 0; + + public boolean mLightMode = false; + public int mLightValue = 0; /** * Sets the Redstone Handler Type. @@ -30,13 +32,26 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable { public Block getBlock() { return mTilePos != null ? mTilePos.getBlockAtPos() : Blocks.redstone_block; } + + public final boolean isLight() { + return mLightMode; + } + public final int getLightBrightness() { + if (!isLight()) { + return 0; + } + else { + return mLightValue; + } + } @Override public void readFromNBT(NBTTagCompound aNBT) { mStartTime = aNBT.getLong("mStartTime"); mInvName = aNBT.getString("mInvName"); mLightValue = aNBT.getInteger("mLightValue"); + mLightMode = aNBT.getBoolean("mLightMode"); super.readFromNBT(aNBT); } @@ -46,6 +61,7 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable { aNBT.setLong("mStartTime", mStartTime); aNBT.setString("mInvName", mInvName); aNBT.setInteger("mLightValue", mLightValue); + aNBT.setBoolean("mLightMode", mLightMode); super.writeToNBT(aNBT); } @@ -250,6 +266,45 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable { } + public boolean providesWeakPower() { + return isProvidingPower(); + } + + public boolean providesStrongPower() { + return isProvidingPower(); + } + + + /** + * Returns the amount of week power this block is providing to a side. + * @param world + * @param x + * @param y + * @param z + * @param side + * @return + */ + public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { + if (!providesWeakPower()) { + return 0; + } + return getOutputPowerLevel(); + } + /** + * Returns the amount of strong power this block is providing to a side. + * @param world + * @param x + * @param y + * @param z + * @param side + * @return + */ + public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) { + if (!providesStrongPower()) { + return 0; + } + return getOutputPowerLevel(); + } @@ -379,16 +434,6 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable { public boolean hasCustomInventoryName() { return (this.mInvName != null) && !this.mInvName.equals(""); } - - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - // TODO Auto-generated method stub - return 0; - } - - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) { - // TODO Auto-generated method stub - return 0; - } diff --git a/src/resources/assets/miscutils/textures/blocks/redstone/redstone_meter/top.png b/src/resources/assets/miscutils/textures/blocks/redstone/redstone_meter/top.png new file mode 100644 index 0000000000..ba45c43891 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/redstone/redstone_meter/top.png differ -- cgit From b6368490a3d910bcff1837b15f44bd78411d37bd Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 8 Apr 2019 16:04:31 +1000 Subject: + Added Custom tooltips to Items with Hazmat bonuses granted by GT++. + Made AutoMap implement List. % More work on HazmatUtils.java. $ Fixed a bug with my GeneralTooltipEventHandler. --- src/Java/gtPlusPlus/api/objects/data/AutoMap.java | 79 ++++++++- .../handler/events/GeneralTooltipEventHandler.java | 14 +- .../core/util/minecraft/HazmatUtils.java | 190 ++++++++++++++++++++- 3 files changed, 269 insertions(+), 14 deletions(-) (limited to 'src/Java/gtPlusPlus/api') diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java index 4663229514..fe2caa466d 100644 --- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java +++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java @@ -3,7 +3,7 @@ package gtPlusPlus.api.objects.data; import java.io.Serializable; import java.util.*; -public class AutoMap implements Iterable, Cloneable, Serializable, Collection, Queue { +public class AutoMap implements Iterable, Cloneable, Serializable, Collection, Queue, List { /** * The Internal Map @@ -22,6 +22,10 @@ public class AutoMap implements Iterable, Cloneable, Serializable, Collect this(new LinkedHashMap()); } + public Map getMap(){ + return mInternalMap; + } + public AutoMap(Map defaultMapType) { mInternalMap = defaultMapType; mInternalNameMap = new LinkedHashMap(); @@ -211,5 +215,78 @@ public class AutoMap implements Iterable, Cloneable, Serializable, Collect public V peek() { return element(); } + + @Override + public boolean addAll(int index, Collection c) { + for (V y : c) { + add(y); + } + return true; + } + + @Override + public V set(int index, V element) { + return mInternalMap.put(index, element); + } + + @Override + public void add(int index, V element) { + add(element); + } + + @Override + public V remove(int index) { + V h = mInternalMap.get(index); + set(index, null); + return h; + } + + @Override + public int indexOf(Object o) { + int aCount = 0; + for (V of : mInternalMap.values()) { + if (of != o) { + aCount++; + continue; + } + else { + return aCount; + } + } + return -1; + } + + @Override + public int lastIndexOf(Object o) { + //TODO + return indexOf(o); + } + + @Override + public ListIterator listIterator() { + // TODO Auto-generated method stub + return null; + } + + @Override + public ListIterator listIterator(int index) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List subList(int fromIndex, int toIndex) { + AutoMap aNewSubList = new AutoMap(); + for (int slot=fromIndex; slot<=toIndex; slot++) { + V obj = mInternalMap.get(slot); + if (obj == null) { + continue; + } + else { + aNewSubList.put(obj); + } + } + return aNewSubList; + } } diff --git a/src/Java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java index ef91647c1a..5b49b495ce 100644 --- a/src/Java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java @@ -1,22 +1,16 @@ package gtPlusPlus.core.handler.events; import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_Utility; import gtPlusPlus.GTplusplus; import gtPlusPlus.GTplusplus.INIT_PHASE; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.handler.events.BlockEventHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; public class GeneralTooltipEventHandler { @@ -29,7 +23,7 @@ public class GeneralTooltipEventHandler { public void onItemTooltip(ItemTooltipEvent event){ - if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED && GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) { + if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED || GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) { return; } if (event.itemStack == null) { diff --git a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java index f05b1ef393..638e5dec10 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java @@ -7,50 +7,186 @@ import static gregtech.api.GregTech_API.sGasHazmatList; import static gregtech.api.GregTech_API.sHeatHazmatList; import static gregtech.api.GregTech_API.sRadioHazmatList; +import java.util.Collections; +import java.util.HashMap; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.objects.GT_HashSet; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.GTplusplus; +import gtPlusPlus.GTplusplus.INIT_PHASE; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.Utils; +import ic2.core.Ic2Items; +import ic2.core.item.armor.ItemArmorHazmat; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; public class HazmatUtils { + + + public static final GT_HashSet sHazmatList = new GT_HashSet(); + + private static final HashMap> mToolTips = new HashMap>(); + + + private static boolean mInit = false; + private static HazmatUtils mInstance; + + public static void init() { + if (mInit){ + return; + } + + mInstance = new HazmatUtils(); + + sHazmatList.add(GT_ModHandler.getIC2Item("hazmatHelmet", 1L, 32767)); + sHazmatList.add(GT_ModHandler.getIC2Item("hazmatChestplate", 1L, 32767)); + sHazmatList.add(GT_ModHandler.getIC2Item("hazmatLeggings", 1L, 32767)); + sHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767)); + //Make Nano a hazmat suit + addProtection(Ic2Items.nanoHelmet); + addProtection(Ic2Items.nanoBodyarmor); + addProtection(Ic2Items.nanoLeggings); + addProtection(Ic2Items.nanoBoots); + + //Make Quantum a hazmat suit + addProtection(Ic2Items.quantumHelmet); + addProtection(Ic2Items.quantumBodyarmor); + addProtection(Ic2Items.quantumLeggings); + addProtection(Ic2Items.quantumBoots); + + Utils.registerEvent(mInstance); + + } + + private final static String mToolTipText = "Provides protection from:"; + + @SubscribeEvent + public void onItemTooltip(ItemTooltipEvent event){ + if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED || GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) { + return; + } + if (event.itemStack == null || isVanillaHazmatPiece(event.itemStack)) { + return; + } + else { + ItemStack aStack = event.itemStack; + String[] aTooltips = getTooltips(aStack); + if (aTooltips == null || aTooltips.length == 0) { + return; + } + else { + if (providesProtection(aStack)) { + event.toolTip.add("Provides full hazmat protection."); + } + else { + event.toolTip.add(mToolTipText); + for (String r : aTooltips) { + event.toolTip.add(" - "+r); + } + } + } + } + } + + + /** + * Static function to replace {@link #ic2.core.item.armor.ItemArmorHazmat.hasCompleteHazmat(EntityLivingBase)}. + * Because IC2 doesn't let us register things ourself, anything registered via GT/GT++ will return true. + * @param living - Entity Wearing Armour + * @return - Does {@link EntityLivingBase} have a full hazmat suit on? + */ + public static boolean hasCompleteHazmat(EntityLivingBase living) { + //Entity is Null, cannot have Hazmat. + if (living == null || living.isDead) { + return false; + } + else { + + //Map All Player Armour slots + AutoMap aEquipment = new AutoMap(); + for (int i = 1; i < 5; ++i) { + ItemStack stack = living.getEquipmentInSlot(i); + + //Item is Null, cannot have full suit + if (stack == null) { + return false; + } + else { + aEquipment.put(stack); + } + } + + //Compare Equipment to all items mapped for full hazmat. + for (ItemStack aSlotStack : aEquipment) { + if (!isHazmatPiece(aSlotStack)) { + return false; + } + } + + //We are in some kind of full hazmat, huzzah! + return true; + } + } + + + + public static boolean isVanillaHazmatPiece(ItemStack aArmour) { + return aArmour != null ? aArmour.getItem() instanceof ItemArmorHazmat : false; + } + + public static boolean isHazmatPiece(ItemStack aStack) { + return isVanillaHazmatPiece(aStack) || providesProtection(aStack); + } + /** * Registers the {@link ItemStack} to all types of protection. * Provides full hazmat protection. Frost, Fire, Bio, Gas, Radioaton & Electricity. * @param aStack - The Armour to provide protection. * @return - Did we register this ItemStack properly? */ - public boolean addProtection(ItemStack aStack) { + public static boolean addProtection(ItemStack aStack) { AutoMap aAdded = new AutoMap(); aAdded.put(addProtection_Frost(aStack)); aAdded.put(addProtection_Fire(aStack)); aAdded.put(addProtection_Biohazard(aStack)); aAdded.put(addProtection_Gas(aStack)); aAdded.put(addProtection_Radiation(aStack)); - aAdded.put(addProtection_Electricty(aStack)); + aAdded.put(addProtection_Electricty(aStack)); for (boolean b : aAdded) { if (!b) { return false; } } + sHazmatList.add(aStack); return true; } - public static boolean addProtection_Frost(ItemStack aStack) { + registerTooltip(aStack, "Frost"); return addProtection_Generic(sFrostHazmatList, aStack); } public static boolean addProtection_Fire(ItemStack aStack) { + registerTooltip(aStack, "Heat"); return addProtection_Generic(sHeatHazmatList, aStack); } public static boolean addProtection_Biohazard(ItemStack aStack) { + registerTooltip(aStack, "Biohazards"); return addProtection_Generic(sBioHazmatList, aStack); } public static boolean addProtection_Gas(ItemStack aStack) { + registerTooltip(aStack, "Gas"); return addProtection_Generic(sGasHazmatList, aStack); } public static boolean addProtection_Radiation(ItemStack aStack) { + registerTooltip(aStack, "Radiation"); return addProtection_Generic(sRadioHazmatList, aStack); } public static boolean addProtection_Electricty(ItemStack aStack) { + registerTooltip(aStack, "Electricity"); return addProtection_Generic(sElectroHazmatList, aStack); } @@ -60,4 +196,52 @@ public class HazmatUtils { return aMapSize < aSet.size(); } + public static boolean providesProtection(ItemStack aStack) { + return providesProtetion_Generic(sHazmatList, aStack); + } + public static boolean providesProtetion_Frost(ItemStack aStack) { + return providesProtetion_Generic(sFrostHazmatList, aStack); + } + public static boolean providesProtetion_Fire(ItemStack aStack) { + return providesProtetion_Generic(sHeatHazmatList, aStack); + } + public static boolean providesProtetion_Biohazard(ItemStack aStack) { + return providesProtetion_Generic(sBioHazmatList, aStack); + } + public static boolean providesProtetion_Gas(ItemStack aStack) { + return providesProtetion_Generic(sGasHazmatList, aStack); + } + public static boolean providesProtetion_Radiation(ItemStack aStack) { + return providesProtetion_Generic(sRadioHazmatList, aStack); + } + public static boolean providesProtetion_Electricity(ItemStack aStack) { + return providesProtetion_Generic(sElectroHazmatList, aStack); + } + + private static boolean providesProtetion_Generic(GT_HashSet aSet, ItemStack aStack) { + if (isVanillaHazmatPiece(aStack)) { + return true; + } + return aSet.getMap().containsKey(aStack); + } + + private static String[] getTooltips(ItemStack aStack) { + AutoMap aTempTooltipData = mToolTips.get(aStack); + if (aTempTooltipData == null) { + return new String[] {}; + } + else { + Collections.sort(aTempTooltipData); + return aTempTooltipData.toArray(); + } + } + + private static void registerTooltip(ItemStack aStack, String aTooltip) { + AutoMap aTempTooltipData = mToolTips.get(aStack); + if (aTempTooltipData == null) { + aTempTooltipData = new AutoMap(); + } + aTempTooltipData.add(aTooltip); + } + } -- cgit From 3b7cff8412af5afbf99bfd40fee1193a6cd8c400 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 11 Apr 2019 02:59:02 +1000 Subject: + Added some new Monster Killer Baubles. Kill nearby mobs for power, power cost scales with HP total, left and other EntityLiving stats. + Added new constructors for AutoMaps. + Added a Wrapper (AABB) for AxisAlignedBB. $ Fixed Hot Titanium Ingot recipe. --- src/Java/gtPlusPlus/api/objects/data/AutoMap.java | 40 +++++++++++ .../gtPlusPlus/api/objects/minecraft/AABB.java | 65 ++++++++++++++++++ .../core/common/compat/COMPAT_Baubles.java | 12 ++++ src/Java/gtPlusPlus/core/item/ModItems.java | 12 +++- .../core/item/bauble/MonsterKillerBaseBauble.java | 78 +++++++++++++++++----- .../core/util/minecraft/EntityUtils.java | 48 ++++++++++--- 6 files changed, 227 insertions(+), 28 deletions(-) create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/AABB.java (limited to 'src/Java/gtPlusPlus/api') diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java index fe2caa466d..3583a04a74 100644 --- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java +++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java @@ -31,6 +31,46 @@ public class AutoMap implements Iterable, Cloneable, Serializable, Collect mInternalNameMap = new LinkedHashMap(); } + /** + * Generates an AutoMap from the List. + * @param aList - Data to be inserted into the AutoMap. + */ + public AutoMap(List aList) { + mInternalMap = new LinkedHashMap(); + mInternalNameMap = new LinkedHashMap(); + if (aList != null && aList.size() > 0) { + for (V obj : aList) { + add(obj); + } + } + } + /** + * Generates an AutoMap from a Set. + * @param aList - Data to be inserted into the AutoMap. + */ + public AutoMap(Set aList) { + mInternalMap = new LinkedHashMap(); + mInternalNameMap = new LinkedHashMap(); + if (aList != null && aList.size() > 0) { + for (V obj : aList) { + add(obj); + } + } + } + /** + * Generates an AutoMap from a Collection. + * @param aList - Data to be inserted into the AutoMap. + */ + public AutoMap(Collection aList) { + mInternalMap = new LinkedHashMap(); + mInternalNameMap = new LinkedHashMap(); + if (aList != null && aList.size() > 0) { + for (V obj : aList) { + add(obj); + } + } + } + @Override public Iterator iterator() { return values().iterator(); diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/AABB.java b/src/Java/gtPlusPlus/api/objects/minecraft/AABB.java new file mode 100644 index 0000000000..722ac00b64 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/AABB.java @@ -0,0 +1,65 @@ +package gtPlusPlus.api.objects.minecraft; + +import gtPlusPlus.core.util.minecraft.EntityUtils; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +/** + * Generates an AABB around an entity. + * @author Alkalus + * + */ +public class AABB { + + private final AxisAlignedBB mAabb; + private final World mWorld; + + /** + * Creates a AxisAlignedBB based around an Entity. + * @param aEntity - The Entity to work with. + * @param x - Maximum X from origin. + * @param y - Maximum Y from origin. + * @param z - Maximum Z from origin. + */ + public AABB(Entity aEntity, int x, int y, int z) { + if (aEntity == null) { + mAabb = null; + mWorld = null; + } + else { + mWorld = aEntity.worldObj; + BlockPos aEntityLocation = EntityUtils.findBlockPosUnderEntity(aEntity); + int xMin, xMax, yMin, yMax, zMin, zMax; + xMin = aEntityLocation.xPos; + yMin = aEntityLocation.yPos; + zMin = aEntityLocation.zPos; + xMax = aEntityLocation.xPos + x; + yMax = aEntityLocation.yPos + y; + zMax = aEntityLocation.zPos + z; + mAabb = AxisAlignedBB.getBoundingBox(xMin, yMin, zMin, xMax, yMax, zMax); + } + + } + + /** + * Used to get the AxisAlignedBB from this class. + * @return + */ + public AxisAlignedBB get() { + return mAabb; + } + + /** + * Used to determine if this object is valid or not. + * @return + */ + public boolean valid() { + return mAabb != null && mWorld != null; + } + + public World world() { + return mWorld; + } + +} diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java index f57c09b62d..d779e60975 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java @@ -3,10 +3,16 @@ package gtPlusPlus.core.common.compat; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.bauble.BatteryPackBaseBauble; +import gtPlusPlus.core.item.bauble.MonsterKillerBaseBauble; import gtPlusPlus.core.item.general.ItemCloakingDevice; import gtPlusPlus.core.item.general.ItemHealingDevice; import gtPlusPlus.core.item.general.ItemSlowBuildingRing; import gtPlusPlus.core.lib.LoadedMods; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityZombie; public class COMPAT_Baubles { @@ -34,6 +40,12 @@ public class COMPAT_Baubles { catch (Throwable t) { t.printStackTrace(); } + + ModItems.itemAmuletMonsterKiller_Zombie = new MonsterKillerBaseBauble(new Class[] {EntityZombie.class}, "Zombie", 6); + ModItems.itemAmuletMonsterKiller_Skeleton = new MonsterKillerBaseBauble(new Class[] {EntitySkeleton.class}, "Skeleton", 6); + ModItems.itemAmuletMonsterKiller_Spider = new MonsterKillerBaseBauble(new Class[] {EntitySpider.class}, "Spider", 6); + ModItems.itemAmuletMonsterKiller_Creeper = new MonsterKillerBaseBauble(new Class[] {EntityCreeper.class}, "Creeper", 6); + ModItems.itemAmuletMonsterKiller_Enderman = new MonsterKillerBaseBauble(new Class[] {EntityEnderman.class}, "Enderman", 6); if (LoadedMods.PlayerAPI){ ModItems.itemSlowBuildingRing = new ItemSlowBuildingRing(); diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index e3c01b7ea5..68aacd6943 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -32,6 +32,7 @@ import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble; import gtPlusPlus.core.item.bauble.BatteryPackBaseBauble; import gtPlusPlus.core.item.bauble.HealthBoostBauble; import gtPlusPlus.core.item.bauble.ModularBauble; +import gtPlusPlus.core.item.bauble.MonsterKillerBaseBauble; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.item.chemistry.CoalTar; import gtPlusPlus.core.item.chemistry.GenericChem; @@ -345,6 +346,15 @@ public final class ModItems { public static CoreItem itemDetCable; public static ItemThrowableBomb itemBomb; + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Zombie; + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Skeleton; + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Spider; + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Creeper; + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Enderman; + + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether; + public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal; + static { Logger.INFO("Items!"); //Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is called upon. @@ -829,7 +839,7 @@ public final class ModItems { else { itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); } - GT_Values.RA.addBlastRecipe(ELEMENT.getInstance().TITANIUM.getIngot(1), null, itemHotTitaniumIngot, null, 10 * 20, 512, Materials.Titanium.mBlastFurnaceTemp); + GT_Values.RA.addBlastRecipe(ELEMENT.getInstance().TITANIUM.getIngot(1), CI.getNumberedCircuit(16), itemHotTitaniumIngot, null, 10 * 20, 500, Materials.Titanium.mBlastFurnaceTemp); //Special Sillyness if (true) { diff --git a/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java index 024f6aa907..2cffb8737f 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java @@ -3,14 +3,18 @@ package gtPlusPlus.core.item.bauble; import java.util.List; import baubles.api.BaubleType; -import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.AABB; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.EntityUtils; import ic2.api.item.ElectricItem; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -20,14 +24,13 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; public class MonsterKillerBaseBauble extends ElectricBaseBauble { - - private final int mTier; + private final Class[] mTargets; - public MonsterKillerBaseBauble(Class[] aMonsterBaseClassArray, String aMonsterTypeName, int aPowerTier) { - super(BaubleType.AMULET, aPowerTier, GT_Values.V[aPowerTier] * 20 * 300, "GTPP.MonsterKiller."+aMonsterTypeName+".name"); - mTier = aPowerTier; - mTargets = aMonsterBaseClassArray; + public MonsterKillerBaseBauble(Class[] aMonsterBaseClassArray, String aMonsterTypeName, int aPowerTier) { + super(BaubleType.AMULET, aPowerTier, GT_Values.V[aPowerTier] * 20 * 300, + "GTPP.MonsterKiller." + aMonsterTypeName + ".name"); + mTargets = aMonsterBaseClassArray; } @SideOnly(Side.CLIENT) @@ -56,7 +59,7 @@ public class MonsterKillerBaseBauble extends ElectricBaseBauble { @Override public boolean canProvideEnergy(final ItemStack itemStack) { - double aItemCharge = ElectricItem.manager.getCharge(itemStack); + double aItemCharge = ElectricItem.manager.getCharge(itemStack); return aItemCharge > 0; } @@ -78,17 +81,18 @@ public class MonsterKillerBaseBauble extends ElectricBaseBauble { String aString2 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.2"); String aString3 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.3"); String aString4 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.4"); - String aEU = StatCollector.translateToLocal("GTPP.info.eu"); - String aEUT = aEU+"/t"; + String aEU = StatCollector.translateToLocal("GTPP.info.eu"); + String aEUT = aEU + "/t"; list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY); - list.add(EnumChatFormatting.GREEN + aString2+" " + (int) getTransferLimit(stack) + aEUT + aString3 + EnumChatFormatting.GRAY); + list.add(EnumChatFormatting.GREEN + aString2 + " " + (int) getTransferLimit(stack) + aEUT + aString3 + + EnumChatFormatting.GRAY); list.add(""); - list.add(""+EnumChatFormatting.GREEN + aString4 + " " + EnumChatFormatting.GRAY); + list.add("" + EnumChatFormatting.GREEN + aString4 + " " + EnumChatFormatting.GRAY); for (Class cz : mTargets) { - list.add("- "+EnumChatFormatting.DARK_GREEN + cz.getSimpleName() + EnumChatFormatting.GRAY); + list.add("- " + EnumChatFormatting.DARK_GREEN + cz.getSimpleName() + EnumChatFormatting.GRAY); } - + super.addInformation(stack, aPlayer, list, bool); } @@ -113,17 +117,57 @@ public class MonsterKillerBaseBauble extends ElectricBaseBauble { } @Override // TODO - public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) { + public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayerEntity) { + if (aPlayerEntity == null) { + return; + } + EntityPlayer aPlayer = (EntityPlayer) aPlayerEntity; if (!aPlayer.worldObj.isRemote) { if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) { - + AABB aPlayerBox = new AABB(aPlayerEntity, 5, 5, 5); + if (this.mTargets != null && this.mTargets.length > 0) { + for (Class clazz : mTargets) { + AutoMap aEnts = EntityUtils.getEntitiesWithinBoundingBox(clazz, aPlayerBox); + if (aEnts.isEmpty()) { + continue; + } else { + EntityLiving aClosest = null; + double aEntityDistance = Short.MIN_VALUE; + for (Object ent : aEnts) { + if (!EntityLiving.class.isInstance(ent)) { + continue; + } else { + double aCurEntDis = EntityUtils.getDistance(aPlayerEntity, (Entity) ent); + if (aEntityDistance == Short.MIN_VALUE || aCurEntDis < aEntityDistance) { + aEntityDistance = aCurEntDis; + aClosest = (EntityLiving) ent; + } + } + } + if (aClosest != null) { + float aEntHealth = aClosest.getHealth(); + float aEntMaxHealth = aClosest.getMaxHealth(); + double aEntHealthPerc = MathUtils.findPercentage(aEntHealth, aEntMaxHealth); + long aEuUsage = (long) (aEntHealthPerc * 50 * aEntMaxHealth); + if (this.discharge(aBaubleStack, aEuUsage, mTier, true, false, false) > 0) { + aClosest.setDead(); + break; + } + } else { + continue; + } + } + } + } + } else { + return; } } } @Override public String getTextureNameForBauble() { - return CORE.MODID+":"+""; + return CORE.MODID + ":" + "baubles/itemAmulet"; } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java index 844bb0bcaf..8c5a9f6581 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java @@ -3,26 +3,28 @@ package gtPlusPlus.core.util.minecraft; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.HashMap; +import java.util.List; import java.util.Map; import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.AABB; +import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import ic2.core.IC2Potion; +import ic2.core.item.armor.ItemArmorHazmat; import net.minecraft.block.Block; -import net.minecraft.entity.*; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; -import gregtech.api.util.GT_Utility; - -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import ic2.core.IC2Potion; -import ic2.core.item.armor.ItemArmorHazmat; - public class EntityUtils { public static void setEntityOnFire(final Entity entity, final int length){ @@ -158,5 +160,31 @@ public class EntityUtils { } return false; } + + public static double getDistance(Entity p1, Entity p2) { + return Math.sqrt( Math.pow(p1.posX - p2.posX, 2) + Math.pow(p1.posY - p2.posY, 2) + Math.pow(p1.posZ - p2.posZ, 2)); + } + + public static AutoMap getEntitiesWithinBoundingBoxExcluding(Entity aExclusion, AABB aBoundingBox){ + + if (aExclusion == null) { + return new AutoMap(); + } + else { + List aEntities = aBoundingBox.world().getEntitiesWithinAABBExcludingEntity(aExclusion, aBoundingBox.get()); + return new AutoMap(aEntities); + } + } + + public static AutoMap getEntitiesWithinBoundingBox(Class aEntityType, AABB aBoundingBox){ + + if (aEntityType == null) { + return new AutoMap(); + } + else { + List aEntities = aBoundingBox.world().getEntitiesWithinAABB(aEntityType, aBoundingBox.get()); + return new AutoMap(aEntities); + } + } } -- cgit