This commit is contained in:
Bob 2022-05-05 23:06:44 +02:00
parent 3dfdacd45a
commit f3837beb70
5 changed files with 50 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package com.hbm.entity.grenade;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGenericGrenade;
import net.minecraft.entity.EntityLivingBase;
@ -28,7 +29,8 @@ public class EntityGrenadeBouncyGeneric extends EntityGrenadeBouncyBase implemen
@Override
public ItemGenericGrenade getGrenade() {
return (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
ItemGenericGrenade gren = (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
return gren != null ? gren : (ItemGenericGrenade) ModItems.grenade_kyiv;
}
@Override

View File

@ -1,5 +1,6 @@
package com.hbm.entity.grenade;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGenericGrenade;
import net.minecraft.entity.EntityLivingBase;
@ -28,7 +29,8 @@ public class EntityGrenadeImpactGeneric extends EntityGrenadeBase implements IGe
@Override
public ItemGenericGrenade getGrenade() {
return (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
ItemGenericGrenade gren = (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
return gren != null ? gren : (ItemGenericGrenade) ModItems.grenade_kyiv;
}
@Override
@ -39,7 +41,7 @@ public class EntityGrenadeImpactGeneric extends EntityGrenadeBase implements IGe
@Override
public void explode() {
if(!this.worldObj.isRemote) {
if(!this.worldObj.isRemote && getGrenade() != null) {
getGrenade().explode(worldObj, posX, posY, posZ);
this.setDead();
}

View File

@ -453,7 +453,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.sat_dock, 1), new Object[] { "SSS", "PCP", 'S', STEEL.ingot(), 'P', ANY_PLASTIC.ingot(), 'C', ModBlocks.crate_iron });
addRecipeAuto(new ItemStack(ModBlocks.book_guide, 1), new Object[] { "IBI", "LBL", "IBI", 'B', Items.book, 'I', KEY_BLACK, 'L', KEY_BLUE });
addRecipeAuto(new ItemStack(ModBlocks.rail_wood, 16), new Object[] { "S S", "SRS", "S S", 'S', ModBlocks.steel_beam, 'R', DictFrame.fromOne(ModItems.plant_item, EnumPlantType.ROPE) });
addRecipeAuto(new ItemStack(ModBlocks.rail_wood, 16), new Object[] { "S S", "SRS", "S S", 'S', Items.stick, 'R', DictFrame.fromOne(ModItems.plant_item, EnumPlantType.ROPE) });
addRecipeAuto(new ItemStack(ModBlocks.rail_narrow, 64), new Object[] { "S S", "S S", "S S", 'S', ModBlocks.steel_beam });
addRecipeAuto(new ItemStack(ModBlocks.rail_highspeed, 16), new Object[] { "S S", "SIS", "S S", 'S', STEEL.ingot(), 'I', IRON.plate() });
addRecipeAuto(new ItemStack(ModBlocks.rail_booster, 6), new Object[] { "S S", "CIC", "SRS", 'S', STEEL.ingot(), 'I', IRON.plate(), 'R', MINGRADE.ingot(), 'C', ModItems.coil_copper });

View File

@ -489,8 +489,8 @@ public class MainRegistry {
EntityRegistry.registerModEntity(EntitySiegeLaser.class, "entity_ntm_siege_laser", 164, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntitySiegeDropship.class, "entity_ntm_siege_dropship", 165, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityTNTPrimedBase.class, "entity_ntm_tnt_primed", 166, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeBouncyGeneric.class, "entity_grenade_generic", 168, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeImpactGeneric.class, "entity_grenade_generic", 169, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeBouncyGeneric.class, "entity_grenade_bouncy_generic", 168, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeImpactGeneric.class, "entity_grenade_impact_generic", 169, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityMinecartCrate.class, "entity_ntm_cart_crate", 170, this, 250, 1, true);
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);

View File

@ -47,6 +47,10 @@ public class ComponentNTMFeatures {
private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone();
public NTMHouse1() {
super();
}
/** Constructor for this feature; takes coordinates for bounding box */
protected NTMHouse1(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 9, 4, 6);
@ -145,6 +149,10 @@ public class ComponentNTMFeatures {
private boolean[] hasPlacedLoot = new boolean[2];
public NTMHouse2() {
super();
}
protected NTMHouse2(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 15, 5, 9);
this.hasPlacedLoot[0] = false;
@ -295,6 +303,10 @@ public class ComponentNTMFeatures {
private boolean[] hasPlacedLoot = new boolean[2];
public NTMLab1() {
super();
}
/** Constructor for this feature; takes coordinates for bounding box */
protected NTMLab1(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 9, 4, 7);
@ -428,6 +440,10 @@ public class ComponentNTMFeatures {
private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles();
private boolean[] hasPlacedLoot = new boolean[2];
public NTMLab2() {
super();
}
protected NTMLab2(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 12, 11, 8);
@ -607,6 +623,10 @@ public class ComponentNTMFeatures {
private boolean hasPlacedLoot;
public NTMWorkshop1() {
super();
}
protected NTMWorkshop1(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 10, 6, 8);
this.hasPlacedLoot = false;
@ -761,6 +781,10 @@ public class ComponentNTMFeatures {
private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks();
public NTMRuin1() {
super();
}
protected NTMRuin1(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 8, 6, 10);
}
@ -833,6 +857,10 @@ public class ComponentNTMFeatures {
private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks();
public NTMRuin2() {
super();
}
protected NTMRuin2(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 7, 5, 10);
}
@ -896,6 +924,10 @@ public class ComponentNTMFeatures {
private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks();
public NTMRuin3() {
super();
}
protected NTMRuin3(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 8, 3, 10);
}
@ -953,6 +985,10 @@ public class ComponentNTMFeatures {
private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks();
public NTMRuin4() {
super();
}
protected NTMRuin4(Random rand, int minX, int minY, int minZ) {
super(rand, minX, minY, minZ, 10, 2, 11);
}
@ -1018,6 +1054,10 @@ public class ComponentNTMFeatures {
protected int hpos = -1;
protected Feature() {
super(0);
}
protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) {
super(0);
this.featureSizeX = maxX;