finished semtex and c4 timed bombs, some more laser detonator stuff

This commit is contained in:
Boblet 2022-03-11 15:16:50 +01:00
parent 04e63544c7
commit 99cdbb9f03
14 changed files with 94 additions and 12 deletions

View File

@ -0,0 +1,58 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.GunConfiguration;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class GunDetonatorFactory {
public static GunConfiguration getDetonatorConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 1;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_AUTO;
config.hasSights = false;
config.reloadDuration = 20;
config.firingDuration = 0;
config.ammoCap = 1;
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.DUAL;
config.durability = 1_000_000_000;
config.reloadSound = GunConfiguration.RSOUND_LAUNCHER;
config.firingSound = "hbm:weapon.dartShoot";
config.reloadSoundEnd = false;
config.showAmmo = true;
config.name = "Hopeville Laser Detonator";
config.manufacturer = "WestTek";
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.R5_NORMAL_BOLT);
config.config.add(BulletConfigSyncingUtil.R5_EXPLOSIVE_BOLT);
config.config.add(BulletConfigSyncingUtil.R5_DU_BOLT);
config.config.add(BulletConfigSyncingUtil.R5_STAR_BOLT);
config.config.add(BulletConfigSyncingUtil.CHL_R5_BOLT);
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.NUKE_NORMAL);
config.config.add(BulletConfigSyncingUtil.NUKE_LOW);
config.config.add(BulletConfigSyncingUtil.NUKE_SAFE);
config.config.add(BulletConfigSyncingUtil.NUKE_HIGH);
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_NORMAL);
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_LOW);
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_SAFE);
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_HIGH);
return config;
}
}

View File

@ -1690,6 +1690,7 @@ public class ModItems {
public static Item gun_dampfmaschine;
public static Item gun_waluigi;
public static Item gun_darter;
public static Item gun_detonator;
public static Item crucible;
@ -4356,6 +4357,7 @@ public class ModItems {
gun_moist_nugget = new ItemNugget(3, false).setUnlocalizedName("gun_moist_nugget").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_moist_nugget");
gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_dampfmaschine");
gun_darter = new ItemGunDart(GunDartFactory.getDarterConfig()).setFull3D().setUnlocalizedName("gun_darter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
gun_detonator = new ItemGunDetonator(GunDetonatorFactory.getDetonatorConfig()).setUnlocalizedName("gun_detonator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 10, 3, 50.0F, 100.0F, 0);
crucible = new ItemCrucible(5000, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible");
@ -7072,6 +7074,7 @@ public class ModItems {
GameRegistry.registerItem(gun_moist_nugget, gun_moist_nugget.getUnlocalizedName());
GameRegistry.registerItem(gun_dampfmaschine, gun_dampfmaschine.getUnlocalizedName());
GameRegistry.registerItem(gun_darter, gun_darter.getUnlocalizedName());
GameRegistry.registerItem(gun_detonator, gun_detonator.getUnlocalizedName());
GameRegistry.registerItem(crucible, crucible.getUnlocalizedName());
//Ammo

View File

@ -7,12 +7,10 @@ import org.lwjgl.input.Mouse;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.handler.HbmKeybinds;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.interfaces.IHoldableWeapon;
import com.hbm.interfaces.IItemHUD;
import com.hbm.packet.AuxParticlePacketNT;
@ -36,7 +34,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
@ -110,7 +107,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(mainConfig.reloadType != mainConfig.RELOAD_NONE || (altConfig != null && altConfig.reloadType != 0)) {
if(Keyboard.isKeyDown(HbmKeybinds.reloadKey.getKeyCode()) && (getMag(stack) < mainConfig.ammoCap || (mainConfig.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0))) {
if(Keyboard.isKeyDown(HbmKeybinds.reloadKey.getKeyCode()) && (getMag(stack) < mainConfig.ammoCap || hasInfinity(stack, mainConfig))) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 2));
setIsReloading(stack, true);
resetReloadCycle(stack);
@ -444,7 +441,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
//initiates a reload
public void startReloadAction(ItemStack stack, World world, EntityPlayer player) {
if(player.isSneaking() && mainConfig.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0) {
if(player.isSneaking() && hasInfinity(stack, mainConfig)) {
if(this.getMag(stack) == mainConfig.ammoCap) {
this.setMag(stack, 0);
@ -618,7 +615,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(!main)
config = altConfig;
if(config.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0)
if(hasInfinity(stack, config))
return;
@ -629,6 +626,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
}
}
public boolean hasInfinity(ItemStack stack, GunConfiguration config) {
return config.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
}
/*//returns main config from itemstack
public static GunConfiguration extractConfig(ItemStack stack) {

View File

@ -0,0 +1,17 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import net.minecraft.item.ItemStack;
public class ItemGunDetonator extends ItemGunBase {
public ItemGunDetonator(GunConfiguration config) {
super(config);
}
@Override
public boolean hasInfinity(ItemStack stack, GunConfiguration config) {
return true;
}
}

View File

@ -50,7 +50,6 @@ import com.hbm.entity.mob.botprime.*;
import com.hbm.entity.mob.siege.*;
import com.hbm.entity.particle.*;
import com.hbm.entity.projectile.*;
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
import com.hbm.handler.HbmKeybinds;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.items.ModItems;
@ -421,6 +420,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter_digamma, new ItemRenderWeaponBolter());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fireext, new ItemRenderFireExt());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ar15, new ItemRenderWeaponAR15());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_detonator, new ItemRenderDetonatorLaser());
MinecraftForgeClient.registerItemRenderer(ModItems.detonator_laser, new ItemRenderDetonatorLaser());
//multitool
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());

View File

@ -470,6 +470,8 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.emp_bomb, 1), new Object[] { "LML", "LCL", "LML", 'L', PB.plate(), 'M', ModItems.magnetron, 'C', ModItems.circuit_gold });
addShapelessAuto(new ItemStack(ModBlocks.charge_dynamite, 1), new Object[] { ModItems.stick_dynamite, ModItems.stick_dynamite, ModItems.stick_dynamite, ModItems.ducttape });
addRecipeAuto(new ItemStack(ModBlocks.charge_miner, 1), new Object[] { " F ", "FCF", " F ", 'F', Items.flint, 'C', ModBlocks.charge_dynamite });
addShapelessAuto(new ItemStack(ModBlocks.charge_semtex, 1), new Object[] { ModItems.stick_semtex, ModItems.stick_semtex, ModItems.stick_semtex, ModItems.ducttape });
addShapelessAuto(new ItemStack(ModBlocks.charge_c4, 1), new Object[] { ModItems.stick_c4, ModItems.stick_c4, ModItems.stick_c4, ModItems.ducttape });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_generic), new Object[] { " A ", "PRP", "PRP", 'A', ModItems.wire_aluminium, 'P', AL.plate(), 'R', REDSTONE.dust() });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_advanced), new Object[] { " A ", "PSP", "PLP", 'A', ModItems.wire_red_copper, 'P', CU.plate(), 'S', "sulfur", 'L', PB.dust() });

View File

@ -3,14 +3,10 @@ package com.hbm.render.item;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderDetonatorLaser implements IItemRenderer {
@ -87,11 +83,13 @@ public class ItemRenderDetonatorLaser implements IItemRenderer {
}
ResourceManager.detonator_laser.renderPart("Main");
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(1F, 0F, 0F);
ResourceManager.detonator_laser.renderPart("Lights");
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_FLAT);

View File

@ -7,7 +7,6 @@ import java.util.Random;
import com.hbm.blocks.BlockDummyable;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.main.MainRegistry;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;

View File

@ -3015,8 +3015,10 @@ tile.broadcaster_pc.name=Korrupter Sender
tile.burning_earth.name=Brennendes Gras
tile.cable_detector.name=Redstone-Stromschalter
tile.cable_switch.name=Stromschalter
tile.charge_c4.name=Abrissladung
tile.charge_dynamite.name=Zeitbombe
tile.charge_miner.name=Bergbauladung mit Zeitzünder
tile.charge_semtex.name=Semtex-Bergbauladung
tile.cheater_virus.name=Geliertes Euphemium
tile.cheater_virus_seed.name=Instabiler Euphemiumschrabid-Block
tile.chlorine_gas.name=Chlorgas

View File

@ -3379,8 +3379,10 @@ tile.broadcaster_pc.name=Corrupted Broadcaster
tile.burning_earth.name=Burning Grass
tile.cable_detector.name=Redstone Power Switch
tile.cable_switch.name=Power Switch
tile.charge_c4.name=Demolition Charge
tile.charge_dynamite.name=Time Bomb
tile.charge_miner.name=Timed Mining Charge
tile.charge_semtex.name=Semtex Mining Charge
tile.cheater_virus.name=Gelid Euphemium
tile.cheater_virus_seed.name=Unstable Euphemium Schrabide Block
tile.chlorine_gas.name=Chlorine Gas

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B