mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fixed fallout, mini nuke 16" shells
This commit is contained in:
parent
b0d7b16da3
commit
596decb191
@ -32,8 +32,9 @@ public class FalloutConfigJSON {
|
||||
|
||||
File config = new File(folder.getAbsolutePath() + File.separatorChar + "hbmFallout.json");
|
||||
|
||||
initDefault();
|
||||
|
||||
if(!config.exists()) {
|
||||
initDefault();
|
||||
writeDefault(config);
|
||||
}
|
||||
}
|
||||
@ -149,7 +150,7 @@ public class FalloutConfigJSON {
|
||||
private Triplet<Block, Integer, Integer>[] secondaryBlocks = null;
|
||||
private double primaryChance = 1.0D;
|
||||
private double minDist = 0.0D;
|
||||
private double maxDist = 1.0D;
|
||||
private double maxDist = 100.0D;
|
||||
|
||||
private boolean isSolid = false;
|
||||
|
||||
@ -172,7 +173,7 @@ public class FalloutConfigJSON {
|
||||
if(matchesOpaque && !b.isOpaqueCube()) return false;
|
||||
if(dist > maxDist || dist < minDist) return false;
|
||||
|
||||
if(primaryChance < 1F && rand.nextFloat() > primaryChance) {
|
||||
if(primaryChance == 1D || rand.nextDouble() < primaryChance) {
|
||||
|
||||
if(primaryBlocks == null) return false;
|
||||
|
||||
@ -201,7 +202,7 @@ public class FalloutConfigJSON {
|
||||
int r = rand.nextInt(weight);
|
||||
|
||||
for(Triplet<Block, Integer, Integer> choice : blocks) {
|
||||
r += choice.getZ();
|
||||
r -= choice.getZ();
|
||||
|
||||
if(r <= 0) {
|
||||
return new MetaBlock(choice.getX(), choice.getY());
|
||||
|
||||
@ -4,14 +4,11 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.config.FalloutConfigJSON;
|
||||
import com.hbm.config.FalloutConfigJSON.FalloutEntry;
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.saveddata.AuxSavedData;
|
||||
import com.hbm.util.Tuple.Quintet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
@ -21,7 +18,6 @@ import net.minecraft.world.storage.WorldInfo;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class EntityFalloutRain extends Entity {
|
||||
private boolean firstTick = true; // Of course Vanilla has it private in Entity...
|
||||
@ -172,7 +168,7 @@ public class EntityFalloutRain extends Entity {
|
||||
}
|
||||
|
||||
if(!eval && b.isNormalCube()) {
|
||||
return;
|
||||
depth++;
|
||||
}
|
||||
|
||||
/*if (b == Blocks.leaves || b == Blocks.leaves2) {
|
||||
|
||||
@ -186,7 +186,8 @@ public class ItemAmmoArty extends Item {
|
||||
};
|
||||
this.types[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke") {
|
||||
@Override public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
||||
ExplosionNukeSmall.explode(shell.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, ExplosionNukeSmall.medium);
|
||||
Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize();
|
||||
ExplosionNukeSmall.explode(shell.worldObj, mop.hitVec.xCoord - vec.xCoord, mop.hitVec.yCoord - vec.yCoord, mop.hitVec.zCoord - vec.zCoord, ExplosionNukeSmall.medium);
|
||||
shell.setDead();
|
||||
}
|
||||
};
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 319 B |
Binary file not shown.
|
After Width: | Height: | Size: 311 B |
Loading…
x
Reference in New Issue
Block a user