added an improved sound loader that can load from the .modsounds folder inside of the game directory. Added textures and sounds to the nuke!
This commit is contained in:
36
.idea/workspace.xml
generated
36
.idea/workspace.xml
generated
@@ -1,21 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="21afa9bb-6936-4dba-b025-44007f88dd40" name="Changes" comment="add a BlockRegister class to let rev not shoot himself trying to register blocks">
|
<list default="true" id="21afa9bb-6936-4dba-b025-44007f88dd40" name="Changes" comment="added a nuke">
|
||||||
<change afterPath="$PROJECT_DIR$/src/lang/en_US_Mod.lang" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockChunkDeleter.java" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/src/lang/languages.txt" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/ImplSoundLoader.java" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/CreativeTabTest.java" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Items/Detonator.java" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockNuke.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/CreativeTabs/CreativeTabDebug.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Entities/EntityNukePrimed.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/lang/en_US_Mod.lang" beforeDir="false" afterPath="$PROJECT_DIR$/src/lang/en_US_Mod.lang" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/CreativeTabs.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/CreativeTabs.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/EntityLargeFireball.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/EntityLargeFireball.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/GuiContainerCreative.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/GuiContainerCreative.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Explosion.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Explosion.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Item.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Item.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Item.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Item.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/StringTranslate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/StringTranslate.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/SoundManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/SoundManager.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/World.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/World.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/World.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/World.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/mml/BlockLoader.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/BlockLoader.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockNuke.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockNuke.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/mml/Entities/EntityNukePrimed.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Entities/EntityNukePrimed.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -87,7 +86,7 @@
|
|||||||
<updated>1781711682567</updated>
|
<updated>1781711682567</updated>
|
||||||
<workItem from="1781711683576" duration="10131000" />
|
<workItem from="1781711683576" duration="10131000" />
|
||||||
<workItem from="1781724230644" duration="29000" />
|
<workItem from="1781724230644" duration="29000" />
|
||||||
<workItem from="1781839713575" duration="1832000" />
|
<workItem from="1781839713575" duration="12598000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="add a BlockRegister class to let rev not shoot himself trying to register blocks">
|
<task id="LOCAL-00001" summary="add a BlockRegister class to let rev not shoot himself trying to register blocks">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -97,7 +96,15 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1781712814228</updated>
|
<updated>1781712814228</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="2" />
|
<task id="LOCAL-00002" summary="added a nuke">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1781841566418</created>
|
||||||
|
<option name="number" value="00002" />
|
||||||
|
<option name="presentableId" value="LOCAL-00002" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1781841566418</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="3" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -105,6 +112,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="add a BlockRegister class to let rev not shoot himself trying to register blocks" />
|
<MESSAGE value="add a BlockRegister class to let rev not shoot himself trying to register blocks" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="add a BlockRegister class to let rev not shoot himself trying to register blocks" />
|
<MESSAGE value="added a nuke" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="added a nuke" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -1318,3 +1318,6 @@ mco.gameMode.adventure.line2=be added or removed
|
|||||||
|
|
||||||
|
|
||||||
tile.test.name=TestBlock
|
tile.test.name=TestBlock
|
||||||
|
item.detonator.name=Detonator
|
||||||
|
tile.nuke.name=Nuclear Bomb
|
||||||
|
tile.chunkDeleter.name=Chunk Destroyer
|
||||||
@@ -3,6 +3,7 @@ package net.minecraft.src;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import net.minecraft.src.mml.BlockLoader;
|
import net.minecraft.src.mml.BlockLoader;
|
||||||
|
import net.minecraft.src.mml.Blocks.BlockChunkDeleter;
|
||||||
import net.minecraft.src.mml.Blocks.BlockNuke;
|
import net.minecraft.src.mml.Blocks.BlockNuke;
|
||||||
|
|
||||||
public class Block {
|
public class Block {
|
||||||
@@ -189,6 +190,7 @@ public class Block {
|
|||||||
public static final Block test = Loader.registerBlock(159, Material.ground, "test", CreativeTabs.tabDebug);
|
public static final Block test = Loader.registerBlock(159, Material.ground, "test", CreativeTabs.tabDebug);
|
||||||
|
|
||||||
public static final Block nuke = (new BlockNuke(160)).setHardness(0.0F).setStepSound(soundGrassFootstep).setUnlocalizedName("nuke");
|
public static final Block nuke = (new BlockNuke(160)).setHardness(0.0F).setStepSound(soundGrassFootstep).setUnlocalizedName("nuke");
|
||||||
|
public static final Block chunkDeleter = (new BlockChunkDeleter(161)).setUnlocalizedName("chunkDeleter");
|
||||||
|
|
||||||
public final int blockID;
|
public final int blockID;
|
||||||
protected float blockHardness;
|
protected float blockHardness;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class EntityLargeFireball extends EntityFireball {
|
|||||||
var1.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6);
|
var1.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
|
this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,15 @@ import java.util.Random;
|
|||||||
public class Explosion {
|
public class Explosion {
|
||||||
public boolean isFlaming = false;
|
public boolean isFlaming = false;
|
||||||
public boolean isSmoking = true;
|
public boolean isSmoking = true;
|
||||||
|
|
||||||
|
// all custom modifiers
|
||||||
|
|
||||||
|
public boolean isWasting = false;
|
||||||
|
public boolean isWatering = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private int field_77289_h = 16;
|
private int field_77289_h = 16;
|
||||||
private Random explosionRNG = new Random();
|
private Random explosionRNG = new Random();
|
||||||
private World worldObj;
|
private World worldObj;
|
||||||
@@ -192,6 +201,22 @@ public class Explosion {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isWasting) {
|
||||||
|
var2 = this.affectedBlockPositions.iterator();
|
||||||
|
|
||||||
|
while(var2.hasNext()) {
|
||||||
|
var3 = (ChunkPosition)var2.next();
|
||||||
|
var4 = var3.x;
|
||||||
|
var5 = var3.y;
|
||||||
|
var6 = var3.z;
|
||||||
|
var7 = this.worldObj.getBlockId(var4, var5, var6);
|
||||||
|
int var25 = this.worldObj.getBlockId(var4, var5 - 1, var6);
|
||||||
|
if(var7 == 0 && Block.opaqueCubeLookup[var25] && this.explosionRNG.nextInt(3) == 0) {
|
||||||
|
this.worldObj.setBlock(var4, var5, var6, Block.bedrock.blockID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map func_77277_b() {
|
public Map func_77277_b() {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
|
import net.minecraft.src.mml.Items.Detonator;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -160,6 +162,15 @@ public class Item {
|
|||||||
public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials);
|
public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials);
|
||||||
public static Item minecartTnt = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt");
|
public static Item minecartTnt = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt");
|
||||||
public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper");
|
public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper");
|
||||||
|
|
||||||
|
// this is a decorator for the item class so i dont have to manually find it
|
||||||
|
|
||||||
|
//custItems
|
||||||
|
|
||||||
|
// Register custom items
|
||||||
|
public static Item detonator = (new Detonator(153));
|
||||||
|
|
||||||
|
|
||||||
public static Item record13 = (new ItemRecord(2000, "13")).setUnlocalizedName("record");
|
public static Item record13 = (new ItemRecord(2000, "13")).setUnlocalizedName("record");
|
||||||
public static Item recordCat = (new ItemRecord(2001, "cat")).setUnlocalizedName("record");
|
public static Item recordCat = (new ItemRecord(2001, "cat")).setUnlocalizedName("record");
|
||||||
public static Item recordBlocks = (new ItemRecord(2002, "blocks")).setUnlocalizedName("record");
|
public static Item recordBlocks = (new ItemRecord(2002, "blocks")).setUnlocalizedName("record");
|
||||||
|
|||||||
@@ -12,10 +12,13 @@ import paulscode.sound.SoundSystemConfig;
|
|||||||
import paulscode.sound.codecs.CodecJOrbis;
|
import paulscode.sound.codecs.CodecJOrbis;
|
||||||
import paulscode.sound.codecs.CodecWav;
|
import paulscode.sound.codecs.CodecWav;
|
||||||
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
|
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
|
||||||
|
import net.minecraft.src.mml.ImplSoundLoader;
|
||||||
|
|
||||||
|
import static net.minecraft.src.mml.ImplSoundLoader.registerSounds;
|
||||||
|
|
||||||
public class SoundManager {
|
public class SoundManager {
|
||||||
private static SoundSystem sndSystem;
|
private static SoundSystem sndSystem;
|
||||||
private SoundPool soundPoolSounds = new SoundPool();
|
public SoundPool soundPoolSounds = new SoundPool();
|
||||||
private SoundPool soundPoolStreaming = new SoundPool();
|
private SoundPool soundPoolStreaming = new SoundPool();
|
||||||
private SoundPool soundPoolMusic = new SoundPool();
|
private SoundPool soundPoolMusic = new SoundPool();
|
||||||
private int latestSoundID = 0;
|
private int latestSoundID = 0;
|
||||||
@@ -33,6 +36,8 @@ public class SoundManager {
|
|||||||
this.tryToSetLibraryAndCodecs();
|
this.tryToSetLibraryAndCodecs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerSounds(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryToSetLibraryAndCodecs() {
|
private void tryToSetLibraryAndCodecs() {
|
||||||
|
|||||||
@@ -1654,6 +1654,14 @@ public abstract class World implements IBlockAccess {
|
|||||||
return this.newExplosion(entity, X, Y, Z, Power, false, explode);
|
return this.newExplosion(entity, X, Y, Z, Power, false, explode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Explosion createFireyExplosion(Entity entity, double X, double Y, double Z, float Power, boolean explode) {
|
||||||
|
return this.newExplosion(entity, X, Y, Z, Power, true, explode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Explosion createWastedExplosion(Entity entity, double X, double Y, double Z, float Power, boolean explode) {
|
||||||
|
return this.newCustomExplosion(entity, X, Y, Z, Power, false, true, false, explode);
|
||||||
|
}
|
||||||
|
|
||||||
public Explosion newExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9, boolean var10) {
|
public Explosion newExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9, boolean var10) {
|
||||||
Explosion var11 = new Explosion(this, var1, var2, var4, var6, var8);
|
Explosion var11 = new Explosion(this, var1, var2, var4, var6, var8);
|
||||||
var11.isFlaming = var9;
|
var11.isFlaming = var9;
|
||||||
@@ -1663,6 +1671,17 @@ public abstract class World implements IBlockAccess {
|
|||||||
return var11;
|
return var11;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Explosion newCustomExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9, boolean isWasting, boolean isWatering, boolean var10) {
|
||||||
|
Explosion var11 = new Explosion(this, var1, var2, var4, var6, var8);
|
||||||
|
var11.isFlaming = var9;
|
||||||
|
var11.isSmoking = var10;
|
||||||
|
var11.isWasting = isWasting;
|
||||||
|
var11.isWatering = isWatering;
|
||||||
|
var11.doExplosionA();
|
||||||
|
var11.doExplosionB(true);
|
||||||
|
return var11;
|
||||||
|
}
|
||||||
|
|
||||||
public float getBlockDensity(Vec3 var1, AxisAlignedBB var2) {
|
public float getBlockDensity(Vec3 var1, AxisAlignedBB var2) {
|
||||||
double var3 = 1.0D / ((var2.maxX - var2.minX) * 2.0D + 1.0D);
|
double var3 = 1.0D / ((var2.maxX - var2.minX) * 2.0D + 1.0D);
|
||||||
double var5 = 1.0D / ((var2.maxY - var2.minY) * 2.0D + 1.0D);
|
double var5 = 1.0D / ((var2.maxY - var2.minY) * 2.0D + 1.0D);
|
||||||
|
|||||||
46
src/net/minecraft/src/mml/Blocks/BlockChunkDeleter.java
Normal file
46
src/net/minecraft/src/mml/Blocks/BlockChunkDeleter.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package net.minecraft.src.mml.Blocks;
|
||||||
|
|
||||||
|
import net.minecraft.src.*;
|
||||||
|
|
||||||
|
public class BlockChunkDeleter extends Block {
|
||||||
|
|
||||||
|
private Icon TextureTop;
|
||||||
|
private Icon TextureBottom;
|
||||||
|
|
||||||
|
public BlockChunkDeleter(int BlockID) {
|
||||||
|
super(BlockID, Material.piston);
|
||||||
|
this.setCreativeTab(CreativeTabs.tabDebug);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Icon getIcon(int side, int var2) {
|
||||||
|
return side == 0 ? this.TextureBottom : (side == 1 ? this.TextureTop : this.blockIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockAdded(World world, int X, int Y, int Z) {
|
||||||
|
super.onBlockAdded(world, X, Y, Z);
|
||||||
|
|
||||||
|
int chunkStartX = (X >> 4) << 4;
|
||||||
|
int chunkStartZ = (Z >> 4) << 4;
|
||||||
|
|
||||||
|
for (int cx = 0; cx < 16; cx++) {
|
||||||
|
for (int cz = 0; cz < 16; cz++) {
|
||||||
|
for (int cy = 0; cy < 256; cy++) {
|
||||||
|
|
||||||
|
int targetX = chunkStartX + cx;
|
||||||
|
int targetZ = chunkStartZ + cz;
|
||||||
|
|
||||||
|
if (cy > 0) {
|
||||||
|
world.setBlockToAir(targetX, cy, targetZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerIcons(IconRegister ir) {
|
||||||
|
this.blockIcon = ir.registerIcon("cd_side");
|
||||||
|
this.TextureTop = ir.registerIcon("cd_top");
|
||||||
|
this.TextureBottom = ir.registerIcon("cd_bottom");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package net.minecraft.src.mml.Blocks;
|
package net.minecraft.src.mml.Blocks;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.src.*;
|
import net.minecraft.src.*;
|
||||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||||
|
|
||||||
@@ -25,8 +26,6 @@ public class BlockNuke extends Block {
|
|||||||
var1.setBlockToAir(var2, var3, var4);
|
var1.setBlockToAir(var2, var3, var4);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.BlowupNuke(var1, var2, var3, var4, 1, (EntityLiving) null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
|
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
|
||||||
@@ -38,7 +37,7 @@ public class BlockNuke extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int quantityDropped(Random var1) {
|
public int quantityDropped(Random var1) {
|
||||||
return 1;
|
return 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) {
|
public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) {
|
||||||
@@ -58,14 +57,15 @@ public class BlockNuke extends Block {
|
|||||||
if((var5 & 1) == 1) {
|
if((var5 & 1) == 1) {
|
||||||
EntityNukePrimed var7 = new EntityNukePrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var6);
|
EntityNukePrimed var7 = new EntityNukePrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var6);
|
||||||
var1.spawnEntityInWorld(var7);
|
var1.spawnEntityInWorld(var7);
|
||||||
var1.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F);
|
|
||||||
|
var1.playSoundAtEntity(var7, "mod.beep", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) {
|
public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) {
|
||||||
if(var5.getCurrentEquippedItem() != null && var5.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID) {
|
if(var5.getCurrentEquippedItem() != null && var5.getCurrentEquippedItem().itemID == Item.detonator.itemID) {
|
||||||
this.BlowupNuke(var1, var2, var3, var4, 1, var5);
|
this.BlowupNuke(var1, var2, var3, var4, 1, var5);
|
||||||
var1.setBlockToAir(var2, var3, var4);
|
var1.setBlockToAir(var2, var3, var4);
|
||||||
return true;
|
return true;
|
||||||
@@ -90,8 +90,8 @@ public class BlockNuke extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void registerIcons(IconRegister var1) {
|
public void registerIcons(IconRegister var1) {
|
||||||
this.blockIcon = var1.registerIcon("tnt_side");
|
this.blockIcon = var1.registerIcon("nuke_side");
|
||||||
this.TextureTop = var1.registerIcon("tnt_top");
|
this.TextureTop = var1.registerIcon("nuke_top");
|
||||||
this.TextureBottom = var1.registerIcon("tnt_bottom");
|
this.TextureBottom = var1.registerIcon("nuke_bottom");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ public class EntityNukePrimed extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void explode() {
|
private void explode() {
|
||||||
float explosionPower = 40.0F;
|
float explosionPower = 200.0F;
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, explosionPower, true);
|
this.worldObj.createWastedExplosion(this, this.posX, this.posY, this.posZ, explosionPower, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeEntityToNBT(NBTTagCompound var1) {
|
protected void writeEntityToNBT(NBTTagCompound var1) {
|
||||||
|
|||||||
33
src/net/minecraft/src/mml/ImplSoundLoader.java
Normal file
33
src/net/minecraft/src/mml/ImplSoundLoader.java
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package net.minecraft.src.mml;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.src.MinecraftAppletImpl;
|
||||||
|
import net.minecraft.src.SoundManager;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class ImplSoundLoader {
|
||||||
|
|
||||||
|
public static void registerASound(SoundManager SM, String path, String pointer) {
|
||||||
|
File file = new File(path);
|
||||||
|
SM.soundPoolSounds.addSound(pointer, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerSounds(SoundManager SM) {
|
||||||
|
Path path = Paths.get(MinecraftAppletImpl.getMinecraftDir() + "modsounds");
|
||||||
|
|
||||||
|
try (Stream<Path> stream = Files.list(path)) {
|
||||||
|
stream.filter(Files::isRegularFile) // Exclude subdirectories
|
||||||
|
.forEach(p -> registerASound(SM, p.toString(), "mod/" + p.getFileName().toString()));
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/net/minecraft/src/mml/Items/Detonator.java
Normal file
12
src/net/minecraft/src/mml/Items/Detonator.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package net.minecraft.src.mml.Items;
|
||||||
|
|
||||||
|
import net.minecraft.src.CreativeTabs;
|
||||||
|
import net.minecraft.src.Item;
|
||||||
|
|
||||||
|
public class Detonator extends Item {
|
||||||
|
public Detonator(int ItemID) {
|
||||||
|
super(ItemID);
|
||||||
|
setCreativeTab(CreativeTabs.tabDebug);
|
||||||
|
setUnlocalizedName("detonator");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user