mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 11:49:37 +00:00
Merge branch 'master' into ah-OOG-ah/patchEnch
This commit is contained in:
7 files changed
+49
-87
No files matched your search
@@ -3,9 +3,9 @@ name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
|
||||
@@ -62,10 +62,13 @@ public class BlockAlfPortal extends BlockModContainer<TileAlfPortal> implements
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
boolean did = ((TileAlfPortal) world.getTileEntity(x, y, z)).onWanded();
|
||||
if(did && player != null)
|
||||
player.addStat(ModAchievements.elfPortalOpen, 1);
|
||||
return did;
|
||||
if(!world.isRemote) {
|
||||
boolean did = ((TileAlfPortal) world.getTileEntity(x, y, z)).onWanded();
|
||||
if(did && player != null)
|
||||
player.addStat(ModAchievements.elfPortalOpen, 1);
|
||||
return did;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-47
@@ -12,15 +12,9 @@ package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.ExplosionEvent;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
@@ -29,10 +23,6 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
|
||||
public SubTileEntropinnyum() {
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
private static final int RANGE = 12;
|
||||
|
||||
@Override
|
||||
@@ -73,47 +63,11 @@ public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.entropinnyum;
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void consumeExplosion(ExplosionEvent.Start event) {
|
||||
if(processExplosion(event.world, event.explosion.exploder, event.explosion.explosionX, event.explosion.explosionY, event.explosion.explosionZ)) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void consumeExplosionIC2(ic2.api.event.ExplosionEvent event) {
|
||||
if(processExplosion(event.world, event.entity, event.x, event.y, event.z)) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean processExplosion(World world, Entity explosionSource, double posX, double posY, double posZ) {
|
||||
if (world.isRemote || mana != 0 || !(Math.abs(supertile.xCoord - posX) <= RANGE && Math.abs(supertile.yCoord - posY) <= RANGE && Math.abs(supertile.zCoord - posZ) <= RANGE)) {
|
||||
return false;
|
||||
}
|
||||
if (explosionSource == null) return false;
|
||||
|
||||
explosionSource.setDead();
|
||||
mana += getMaxMana();
|
||||
supertile.getWorldObj().playSoundEffect(posX, posY, posZ, "random.explode", 0.2F, (1F + (supertile.getWorldObj().rand.nextFloat() - supertile.getWorldObj().rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
sync();
|
||||
|
||||
for(int i = 0; i < 50; i++) {
|
||||
Botania.proxy.sparkleFX(world, posX + Math.random() * 4 - 2, posY + Math.random() * 4 - 2, posZ + Math.random() * 4 - 2, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, (float) (Math.random() * 0.65F + 1.25F), 12);
|
||||
}
|
||||
|
||||
supertile.getWorldObj().spawnParticle("hugeexplosion", posX, posY, posZ, 1D, 0D, 0D);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,8 @@ public class TileAlfPortal extends TileMod {
|
||||
} else closeNow = false;
|
||||
|
||||
if(closeNow) {
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 | 2);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 | 2);
|
||||
for(int i = 0; i < 36; i++)
|
||||
blockParticle(meta);
|
||||
closeNow = false;
|
||||
@@ -175,7 +176,8 @@ public class TileAlfPortal extends TileMod {
|
||||
if(newMeta == 0)
|
||||
for(int i = 0; i < 36; i++)
|
||||
blockParticle(meta);
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
} else if(explode) {
|
||||
worldObj.createExplosion(null, xCoord + .5, yCoord + 2.0, zCoord + .5, 3f, true);
|
||||
explode = false;
|
||||
|
||||
@@ -464,8 +464,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
|
||||
public EntityManaBurst getBurst(boolean fake) {
|
||||
EntityManaBurst burst = new EntityManaBurst(this, fake);
|
||||
|
||||
boolean dreamwood = isDreamwood();
|
||||
boolean ultra = isULTRA_SPREADER();
|
||||
int maxMana = ultra ? 640 : dreamwood ? 240 : 160;
|
||||
@@ -480,29 +478,31 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
if(lens != null && lens.getItem() instanceof ILensEffect)
|
||||
((ILensEffect) lens.getItem()).apply(lens, props);
|
||||
|
||||
burst.setSourceLens(lens);
|
||||
if(getCurrentMana() >= props.maxMana || fake) {
|
||||
if(mapmakerOverride) {
|
||||
burst.setColor(mmForcedColor);
|
||||
burst.setMana(mmForcedManaPayload);
|
||||
burst.setStartingMana(mmForcedManaPayload);
|
||||
burst.setMinManaLoss(mmForcedTicksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(mmForcedManaLossPerTick);
|
||||
burst.setGravity(mmForcedGravity);
|
||||
burst.setMotion(burst.motionX * mmForcedVelocityMultiplier, burst.motionY * mmForcedVelocityMultiplier, burst.motionZ * mmForcedVelocityMultiplier);
|
||||
} else {
|
||||
burst.setColor(props.color);
|
||||
burst.setMana(props.maxMana);
|
||||
burst.setStartingMana(props.maxMana);
|
||||
burst.setMinManaLoss(props.ticksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(props.manaLossPerTick);
|
||||
burst.setGravity(props.gravity);
|
||||
burst.setMotion(burst.motionX * props.motionModifier, burst.motionY * props.motionModifier, burst.motionZ * props.motionModifier);
|
||||
}
|
||||
if(getCurrentMana() < props.maxMana && !fake)
|
||||
return null;
|
||||
|
||||
return burst;
|
||||
// Construct the entity only after the mana check, every new Entity takes a global entity ID
|
||||
EntityManaBurst burst = new EntityManaBurst(this, fake);
|
||||
burst.setSourceLens(lens);
|
||||
if(mapmakerOverride) {
|
||||
burst.setColor(mmForcedColor);
|
||||
burst.setMana(mmForcedManaPayload);
|
||||
burst.setStartingMana(mmForcedManaPayload);
|
||||
burst.setMinManaLoss(mmForcedTicksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(mmForcedManaLossPerTick);
|
||||
burst.setGravity(mmForcedGravity);
|
||||
burst.setMotion(burst.motionX * mmForcedVelocityMultiplier, burst.motionY * mmForcedVelocityMultiplier, burst.motionZ * mmForcedVelocityMultiplier);
|
||||
} else {
|
||||
burst.setColor(props.color);
|
||||
burst.setMana(props.maxMana);
|
||||
burst.setStartingMana(props.maxMana);
|
||||
burst.setMinManaLoss(props.ticksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(props.manaLossPerTick);
|
||||
burst.setGravity(props.gravity);
|
||||
burst.setMotion(burst.motionX * props.motionModifier, burst.motionY * props.motionModifier, burst.motionZ * props.motionModifier);
|
||||
}
|
||||
return null;
|
||||
|
||||
return burst;
|
||||
}
|
||||
|
||||
public ILensControl getLensController(ItemStack stack) {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
*
|
||||
* File Created @ [Aug 21, 2014, 5:43:44 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.entity;
|
||||
@@ -81,9 +81,6 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
if(first || upgrade == 2 || upgrade == 3)
|
||||
allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ);
|
||||
|
||||
if(first)
|
||||
first = true;
|
||||
|
||||
Collection<ISparkEntity> transfers = getTransfers();
|
||||
|
||||
|
||||
@@ -171,10 +168,11 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
|
||||
if(!transfers.isEmpty()) {
|
||||
int manaTotal = Math.min(TRANSFER_RATE * transfers.size(), tile.getCurrentMana());
|
||||
int manaForEach = manaTotal / transfers.size();
|
||||
int manaSpent = 0;
|
||||
if (manaTotal > 0){
|
||||
int manaForEach = manaTotal / transfers.size();
|
||||
if (manaForEach == 0) manaForEach = 1;
|
||||
int manaSpent = 0;
|
||||
|
||||
if(manaForEach > transfers.size()) {
|
||||
for(ISparkEntity spark : transfers) {
|
||||
if(spark.getAttachedTile() == null || spark.getAttachedTile().isFull() || spark.areIncomingTransfersDone()) {
|
||||
manaTotal -= manaForEach;
|
||||
@@ -187,9 +185,13 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
manaSpent += spend;
|
||||
|
||||
particlesTowards((Entity) spark);
|
||||
|
||||
if (manaSpent >= manaTotal) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
tile.recieveMana(-manaSpent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(removeTransferants > 0)
|
||||
|
||||
@@ -160,6 +160,7 @@ botaniamisc.keyCategory=Botania
|
||||
#LOKI
|
||||
botaniamisc.toggleLoki=Ring of Loki Switch Key
|
||||
botaniamisc.ringOfLokiClear=Clear Ring of Loki Selection
|
||||
botaniamisc.ringOfLokiMirror=Toggle Ring of Loki Mirroring
|
||||
botaniamisc.lokiOn=On
|
||||
botaniamisc.lokiOff=Off
|
||||
botaniamisc.breaking=Breaking
|
||||
|
||||
Reference in new issue
Block a user