Luminizers can now move items.

This commit is contained in:
Vasco Lavos committed 2015-09-06 14:32:32 +01:00
1 parent e08df30363
commit 14cd05f7e2
3 files changed
+19 -10

No files matched your search

@@ -15,7 +15,9 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -80,9 +82,12 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
}
if(!relays.isEmpty()) {
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
List<Entity> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, aabb);
entities.addAll(world.getEntitiesWithinAABB(EntityItem.class, aabb));
if(!entities.isEmpty()) {
for(EntityLivingBase entity : entities) {
for(Entity entity : entities) {
TileLightRelay relay = relays.get(world.rand.nextInt(relays.size()));
relay.mountEntity(entity);
}
@@ -15,6 +15,7 @@ import java.awt.Color;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -39,14 +40,15 @@ public class TileLightRelay extends TileMod implements IWandBindable {
int bindX, bindY = -1, bindZ;
int ticksElapsed = 0;
public void mountEntity(EntityLivingBase e) {
public void mountEntity(Entity e) {
if(e.ridingEntity != null || worldObj.isRemote || bindY == -1 || !isValidBinding())
return;
EntityPlayerMover mover = new EntityPlayerMover(worldObj, xCoord, yCoord, zCoord, bindX, bindY, bindZ);
worldObj.spawnEntityInWorld(mover);
e.mountEntity(mover);
worldObj.playSoundAtEntity(mover, "botania:lightRelay", 0.2F, (float) Math.random() * 0.3F + 0.7F);
if(!(e instanceof EntityItem))
worldObj.playSoundAtEntity(mover, "botania:lightRelay", 0.2F, (float) Math.random() * 0.3F + 0.7F);
}
@Override
@@ -155,14 +157,15 @@ public class TileLightRelay extends TileMod implements IWandBindable {
public void onUpdate() {
super.onUpdate();
if(ticksExisted % 30 == 0)
worldObj.playSoundAtEntity(this, "botania:lightRelay", 0.2F, (float) Math.random() * 0.3F + 0.7F);
if(riddenByEntity == null && !worldObj.isRemote) {
setDead();
return;
}
boolean isItem = riddenByEntity instanceof EntityItem;
if(!isItem && ticksExisted % 30 == 0)
worldObj.playSoundAtEntity(this, "botania:lightRelay", 0.2F, (float) Math.random() * 0.3F + 0.7F);
int exitX = getExitX();
int exitY = getExitY();
int exitZ = getExitZ();
@@ -173,7 +176,8 @@ public class TileLightRelay extends TileMod implements IWandBindable {
if(x == exitX && y == exitY && z == exitZ) {
TileEntity tile = worldObj.getTileEntity(x, y, z);
if(tile != null && tile instanceof TileLightRelay) {
worldObj.playSoundAtEntity(this, "random.orb", 0.2F, (float) Math.random() * 0.3F + 0.7F);
if(!isItem)
worldObj.playSoundAtEntity(this, "random.orb", 0.2F, (float) Math.random() * 0.3F + 0.7F);
int meta = worldObj.getBlockMetadata(x, y, z);
if(meta > 0) {
@@ -2933,7 +2933,7 @@ botania.page.luminizerTransport1=&1Luminizers&0 have a range of twenty blocks ea
botania.page.luminizerTransport2=Luminize to the future
botania.page.luminizerTransport3=Adding some redstone to a &1Luminizer&0 creates a &1Detector Luminizer&0. For all intents and purposes, it functions just like a regular &1Luminizer&0, however, it sends out a &4redstone pulse&0 every time something passes through it or reaches it as an endpoint.
botania.page.luminizerTransport4=Are you ready to draw?
botania.page.luminizerTransport5=While players can just right click the &1Luminizers&0, in order to get animals or other beings into the trails, a &1Luminizer Launcher&0 is required.<br>This block needs to be placed down adjacent to &1Luminizers&0, and when it receives a &4redstone pulse&0, it'll randomly distribute all living beings on top of it into all of the adjacent &1Luminizers&0, causing them to go on their merry way.
botania.page.luminizerTransport5=While players can just right click the &1Luminizers&0, in order to get animals, dropped items, or other beings into the trails, a &1Luminizer Launcher&0 is required. This block needs to be placed down adjacent to &1Luminizers&0, and when it receives a &4redstone pulse&0, it'll randomly distribute all living beings and dropped items on top of it into all of the adjacent &1Luminizers&0, causing them to go on their merry way.
botania.page.luminizerTransport6=Let's believe it, open the flag
# -- STARCALLER